@konfirm/geojson 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -7
- package/dist/{geojson.d.ts → main.d.mts} +18 -79
- package/dist/main.d.ts +137 -15
- package/dist/main.global.js +853 -0
- package/dist/main.global.js.map +1 -0
- package/dist/main.js +824 -0
- package/dist/main.js.map +1 -0
- package/dist/main.mjs +772 -0
- package/dist/main.mjs.map +1 -0
- package/package.json +101 -63
- package/.editorconfig +0 -16
- package/.github/workflows/release.yml +0 -21
- package/.github/workflows/tests.yml +0 -56
- package/CHANGELOG.md +0 -21
- package/dist/Domain/Constants.d.ts +0 -5
- package/dist/Domain/GeoJSON/Concept/Altitude.d.ts +0 -3
- package/dist/Domain/GeoJSON/Concept/BoundingBox.d.ts +0 -6
- package/dist/Domain/GeoJSON/Concept/ExteriorRing.d.ts +0 -4
- package/dist/Domain/GeoJSON/Concept/GeoJSONObject.d.ts +0 -11
- package/dist/Domain/GeoJSON/Concept/InteriorRing.d.ts +0 -4
- package/dist/Domain/GeoJSON/Concept/Latitude.d.ts +0 -3
- package/dist/Domain/GeoJSON/Concept/LinearRing.d.ts +0 -4
- package/dist/Domain/GeoJSON/Concept/Longitude.d.ts +0 -3
- package/dist/Domain/GeoJSON/Concept/Position.d.ts +0 -7
- package/dist/Domain/GeoJSON/Feature.d.ts +0 -12
- package/dist/Domain/GeoJSON/FeatureCollection.d.ts +0 -8
- package/dist/Domain/GeoJSON/GeoJSON.d.ts +0 -7
- package/dist/Domain/GeoJSON/Geometry/LineString.d.ts +0 -11
- package/dist/Domain/GeoJSON/Geometry/MultiLineString.d.ts +0 -7
- package/dist/Domain/GeoJSON/Geometry/MultiPoint.d.ts +0 -8
- package/dist/Domain/GeoJSON/Geometry/MultiPolygon.d.ts +0 -7
- package/dist/Domain/GeoJSON/Geometry/Point.d.ts +0 -11
- package/dist/Domain/GeoJSON/Geometry/Polygon.d.ts +0 -11
- package/dist/Domain/GeoJSON/Geometry.d.ts +0 -9
- package/dist/Domain/GeoJSON/GeometryCollection.d.ts +0 -8
- package/dist/Domain/GeoJSON/GeometryObject.d.ts +0 -12
- package/dist/Domain/Guards/Number.d.ts +0 -3
- package/dist/Domain/Guards/Tuple.d.ts +0 -3
- package/dist/Domain/Iterator/IterablePair.d.ts +0 -32
- package/dist/Domain/Iterator/SimpleGeometry.d.ts +0 -90
- package/dist/Domain/Utility/Calculate.d.ts +0 -9
- package/dist/Domain/Utility/Distance.d.ts +0 -3
- package/dist/Domain/Utility/Intersect.d.ts +0 -2
- package/dist/Domain/Utility/Segments.d.ts +0 -2
- package/dist/Domain/Utility/Winding.d.ts +0 -3
- package/dist/geojson.cjs.js +0 -655
- package/dist/geojson.cjs.min.js +0 -1
- package/dist/geojson.es.js +0 -627
- package/dist/geojson.es.min.js +0 -1
- package/dist/geojson.js +0 -660
- package/dist/geojson.min.js +0 -1
- package/rollup.config.mjs +0 -43
- package/source/Domain/Constants.ts +0 -5
- package/source/Domain/GeoJSON/Concept/Altitude.ts +0 -9
- package/source/Domain/GeoJSON/Concept/BoundingBox.ts +0 -31
- package/source/Domain/GeoJSON/Concept/ExteriorRing.ts +0 -12
- package/source/Domain/GeoJSON/Concept/GeoJSONObject.ts +0 -23
- package/source/Domain/GeoJSON/Concept/InteriorRing.ts +0 -12
- package/source/Domain/GeoJSON/Concept/Latitude.ts +0 -7
- package/source/Domain/GeoJSON/Concept/LinearRing.ts +0 -14
- package/source/Domain/GeoJSON/Concept/Longitude.ts +0 -7
- package/source/Domain/GeoJSON/Concept/Position.ts +0 -18
- package/source/Domain/GeoJSON/Feature.ts +0 -24
- package/source/Domain/GeoJSON/FeatureCollection.ts +0 -16
- package/source/Domain/GeoJSON/GeoJSON.ts +0 -9
- package/source/Domain/GeoJSON/Geometry/LineString.ts +0 -12
- package/source/Domain/GeoJSON/Geometry/MultiLineString.ts +0 -9
- package/source/Domain/GeoJSON/Geometry/MultiPoint.ts +0 -10
- package/source/Domain/GeoJSON/Geometry/MultiPolygon.ts +0 -9
- package/source/Domain/GeoJSON/Geometry/Point.ts +0 -12
- package/source/Domain/GeoJSON/Geometry/Polygon.ts +0 -20
- package/source/Domain/GeoJSON/Geometry.ts +0 -11
- package/source/Domain/GeoJSON/GeometryCollection.ts +0 -23
- package/source/Domain/GeoJSON/GeometryObject.ts +0 -20
- package/source/Domain/Guards/Number.ts +0 -13
- package/source/Domain/Guards/Tuple.ts +0 -6
- package/source/Domain/Guards/Utility.ts +0 -1
- package/source/Domain/Iterator/IterablePair.ts +0 -47
- package/source/Domain/Iterator/SimpleGeometry.ts +0 -137
- package/source/Domain/Utility/Calculate.ts +0 -143
- package/source/Domain/Utility/Distance.ts +0 -56
- package/source/Domain/Utility/Intersect.ts +0 -42
- package/source/Domain/Utility/Numeric.ts +0 -8
- package/source/Domain/Utility/Segments.ts +0 -5
- package/source/Domain/Utility/Winding.ts +0 -19
- package/source/main.ts +0 -20
- package/test/Domain/GeoJSON/Concept/Altitude.ts +0 -58
- package/test/Domain/GeoJSON/Concept/BoundingBox.ts +0 -77
- package/test/Domain/GeoJSON/Concept/ExteriorRing.ts +0 -65
- package/test/Domain/GeoJSON/Concept/GeoJSONObject.ts +0 -56
- package/test/Domain/GeoJSON/Concept/InteriorRing.ts +0 -65
- package/test/Domain/GeoJSON/Concept/Latitude.ts +0 -56
- package/test/Domain/GeoJSON/Concept/LinearRing.ts +0 -63
- package/test/Domain/GeoJSON/Concept/Longitude.ts +0 -56
- package/test/Domain/GeoJSON/Concept/Position.ts +0 -56
- package/test/Domain/GeoJSON/Feature.ts +0 -9
- package/test/Domain/GeoJSON/FeatureCollection.ts +0 -9
- package/test/Domain/GeoJSON/GeoJSON.ts +0 -21
- package/test/Domain/GeoJSON/Geometry/LineString.ts +0 -11
- package/test/Domain/GeoJSON/Geometry/MultiLineString.ts +0 -11
- package/test/Domain/GeoJSON/Geometry/MultiPoint.ts +0 -11
- package/test/Domain/GeoJSON/Geometry/MultiPolygon.ts +0 -11
- package/test/Domain/GeoJSON/Geometry/Point.ts +0 -11
- package/test/Domain/GeoJSON/Geometry/Polygon.ts +0 -11
- package/test/Domain/GeoJSON/Geometry.ts +0 -9
- package/test/Domain/GeoJSON/GeometryCollection.ts +0 -9
- package/test/Domain/GeoJSON/GeometryObject.ts +0 -4
- package/test/Domain/Guards/Number.ts +0 -49
- package/test/Domain/Guards/Tuple.ts +0 -27
- package/test/Domain/Iterator/IterablePair.ts +0 -203
- package/test/Domain/Iterator/SimpleGeometry.ts +0 -195
- package/test/Domain/Utility/Calculate.ts +0 -178
- package/test/Domain/Utility/Distance.ts +0 -19
- package/test/Domain/Utility/Intersect.ts +0 -54
- package/test/Domain/Utility/Numeric.ts +0 -30
- package/test/Domain/Utility/Winding.ts +0 -52
- package/test/README.ts +0 -123
- package/test/data/Distance.ts +0 -51
- package/test/data/HolySee.ts +0 -74
- package/test/data/Intersect.ts +0 -300
- package/test/data/Italy.ts +0 -2883
- package/test/data/SanMarino.ts +0 -83
- package/test/data/Shapes.ts +0 -107
- package/test/helper/geometry.ts +0 -76
- package/test/helper/malform.ts +0 -82
- package/test/main.ts +0 -4
- package/tsconfig.json +0 -12
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../source/main.ts","../node_modules/@konfirm/guard/dist/guard.es.js","../source/Domain/Guards/Tuple.ts","../source/Domain/Constants.ts","../source/Domain/Guards/Number.ts","../source/Domain/GeoJSON/Concept/Altitude.ts","../source/Domain/GeoJSON/Concept/Latitude.ts","../source/Domain/GeoJSON/Concept/Longitude.ts","../source/Domain/GeoJSON/Concept/Position.ts","../source/Domain/GeoJSON/Concept/BoundingBox.ts","../source/Domain/GeoJSON/Concept/GeoJSONObject.ts","../source/Domain/GeoJSON/GeometryObject.ts","../source/Domain/GeoJSON/Geometry/Point.ts","../source/Domain/GeoJSON/Geometry/MultiPoint.ts","../source/Domain/GeoJSON/Geometry/LineString.ts","../source/Domain/GeoJSON/Geometry/MultiLineString.ts","../source/Domain/Utility/Winding.ts","../source/Domain/GeoJSON/Concept/LinearRing.ts","../source/Domain/GeoJSON/Concept/ExteriorRing.ts","../source/Domain/GeoJSON/Concept/InteriorRing.ts","../source/Domain/GeoJSON/Geometry/Polygon.ts","../source/Domain/GeoJSON/Geometry/MultiPolygon.ts","../source/Domain/GeoJSON/Geometry.ts","../source/Domain/GeoJSON/GeometryCollection.ts","../source/Domain/GeoJSON/Feature.ts","../source/Domain/GeoJSON/FeatureCollection.ts","../source/Domain/GeoJSON/GeoJSON.ts","../source/Domain/Iterator/SimpleGeometry.ts","../source/Domain/Iterator/IterablePair.ts","../source/Domain/Utility/Box.ts","../source/Domain/Utility/Calculate.ts","../source/Domain/Utility/Segments.ts","../source/Domain/Utility/Distance.ts","../source/Domain/Utility/Intersect.ts"],"sourcesContent":["// intersect and distance functions\n\n// the individual GeoJSON types and type guards\nexport {\n\tisPosition,\n\tisStrictPosition,\n\tPosition,\n} from './Domain/GeoJSON/Concept/Position';\nexport { Feature, isFeature, isStrictFeature } from './Domain/GeoJSON/Feature';\nexport {\n\tFeatureCollection,\n\tisFeatureCollection,\n\tisStrictFeatureCollection,\n} from './Domain/GeoJSON/FeatureCollection';\nexport { GeoJSON, isGeoJSON, isStrictGeoJSON } from './Domain/GeoJSON/GeoJSON';\nexport {\n\tGeometry,\n\tisGeometry,\n\tisStrictGeometry,\n} from './Domain/GeoJSON/Geometry';\nexport {\n\tisLineString,\n\tisStrictLineString,\n\tLineString,\n} from './Domain/GeoJSON/Geometry/LineString';\nexport {\n\tisMultiLineString,\n\tisStrictMultiLineString,\n\tMultiLineString,\n} from './Domain/GeoJSON/Geometry/MultiLineString';\nexport {\n\tisMultiPoint,\n\tisStrictMultiPoint,\n\tMultiPoint,\n} from './Domain/GeoJSON/Geometry/MultiPoint';\nexport {\n\tisMultiPolygon,\n\tisStrictMultiPolygon,\n\tMultiPolygon,\n} from './Domain/GeoJSON/Geometry/MultiPolygon';\nexport { isPoint, isStrictPoint, Point } from './Domain/GeoJSON/Geometry/Point';\nexport {\n\tisPolygon,\n\tisStrictPolygon,\n\tPolygon,\n} from './Domain/GeoJSON/Geometry/Polygon';\nexport {\n\tGeometryCollection,\n\tisGeometryCollection,\n\tisStrictGeometryCollection,\n} from './Domain/GeoJSON/GeometryCollection';\n// SimpleGeometryIterator\nexport { SimpleGeometryIterator } from './Domain/Iterator/SimpleGeometry';\nexport { distance } from './Domain/Utility/Distance';\nexport { intersect } from './Domain/Utility/Intersect';\n","class TypeMapper {\n constructor(mapping = {}) {\n this.mapping = Object.keys(mapping)\n .map((key) => (value) => mapping[key](value) ? key : undefined)\n .concat((value) => typeof value);\n }\n map(value) {\n return this.mapping.reduce((carry, map) => carry || map(value), undefined);\n }\n}\n\nclass ValueMapper {\n constructor(types = new TypeMapper(), mapping = {}) {\n this.types = types;\n this.mapping = mapping;\n }\n map(value) {\n const type = this.types.map(value);\n const map = (value) => this.map(value);\n return type in this.mapping\n ? this.mapping[type](value, map)\n : (value === null || value === void 0 ? void 0 : value.toString()) || 'undefined';\n }\n}\n\nconst types = new TypeMapper({\n date: (value) => value instanceof Date,\n regexp: (value) => value instanceof RegExp,\n array: (value) => Array.isArray(value),\n null: (value) => value === null,\n});\nconst stringifier = new ValueMapper(types, {\n string: (value) => value ? `\"${value}\"` : 'EmptyString',\n date: (value, map) => map(value.toISOString()),\n object: (value, map) => {\n const string = String(value);\n if (/^\\[([a-z]+) \\1\\]$/i.test(string)) {\n const mapped = Object.keys(value)\n .map((key) => `${key}:${map(value[key])}`);\n return `{${mapped.join(',')}}`;\n }\n return string;\n },\n array: (value, map) => `[${value.map(map).join(',')}]`,\n null: () => 'NULL',\n undefined: () => 'Undefined',\n function: (value) => {\n const { constructor: { name: cname }, name } = value;\n const [, async, generator, func] = cname.match(/^(async)?(generator)?(function)$/i);\n const [, stype, sname] = value.toString().match(/^(?:async)?(?:[\\s\\*]+)?(class|function)?(?:[\\s\\*]+)?([a-z_]\\w*)?\\s*[\\(\\{]?/i);\n const parts = []\n .concat(stype && !(name || sname) ? 'anonymous' : [])\n .concat(name && !stype && sname ? 'shorthand' : [])\n .concat(async || [], generator || [])\n .concat(!(stype || sname) ? 'arrow' : [])\n .concat(stype || func)\n .map((key) => key[0].toUpperCase() + key.slice(1));\n return [parts.join('')].concat(name || []).join(' ');\n },\n});\nconst stringify = (value) => stringifier.map(value);\n\nclass AssertionError extends Error {\n constructor(message, value, trigger) {\n super(message);\n this.value = value;\n this.trigger = trigger;\n Object.setPrototypeOf(this, new.target.prototype);\n }\n get reasons() {\n const { message, value, trigger } = this;\n return ((trigger === null || trigger === void 0 ? void 0 : trigger.reasons) || []).concat(`${stringify(value)} ${message}`);\n }\n get cause() {\n const { message, value, trigger } = this;\n return [{ value, message }].concat((trigger === null || trigger === void 0 ? void 0 : trigger.cause) || []);\n }\n get reason() {\n return String(this);\n }\n toString(separator = '\\u200b\\u2190\\u200b') {\n return this.reasons\n .reverse()\n .join(separator);\n }\n}\n\n/**\n * Create a guard verifying the given value matches the specified type\n */\nfunction is(type) {\n return (value) => typeof value === type;\n}\n/**\n * Create a guard verifying the given value matches any of the validators\n */\nfunction any(...checks) {\n return (value) => checks.some((check) => check(value));\n}\n/**\n * Create a guard verifying the given value matches all of the validators\n */\nfunction all(...checks) {\n return (value) => checks.every((check) => check(value));\n}\n/**\n * Create a guard verifying the given value matches none of the validators\n */\nfunction not(...checks) {\n return (value) => checks.every((check) => !check(value));\n}\n\n/**\n * Guard verifying the value is a array\n */\nconst isArray = (value) => Array.isArray(value);\n/**\n * Guard verifying the value is a bigint\n */\nconst isBigInt = is('bigint');\n/**\n * Guard verifying the value is a boolean\n */\nconst isBoolean = is('boolean');\n/**\n * Guard verifying the value is a function\n */\nconst isFunction = is('function');\n/**\n * Guard verifying the value is a null\n */\nconst isNULL = (value) => value === null;\n/**\n * Guard verifying the value is a number\n */\nconst isNumber = is('number');\n/**\n * Guard verifying the value is a object\n */\nconst isObject = all(not(isArray), not(isNULL), is('object'));\n/**\n * Guard verifying the value is a string\n */\nconst isString = is('string');\n/**\n * Guard verifying the value is a symbol\n */\nconst isSymbol = is('symbol');\n/**\n * Guard verifying the value is a undefined\n */\nconst isUndefined = is('undefined');\n\n/**\n * Guard verifying the value to be an array containing only elements matching the validators\n */\nfunction isArrayOfType(...validators) {\n const check = all(...validators);\n return all(isArray, (value) => value.every(check));\n}\n/**\n * Guard verifying the value to be an array with a length between the given boundaries\n */\nfunction isArrayOfSize(min, max = Infinity) {\n return all(isArray, (value) => value.length >= min && value.length <= max);\n}\n\n/**\n * Create an assertion guard, throwing an AssertionError with the provided message if any validator failes\n */\nfunction assertion(message, ...rules) {\n const valid = all(...rules);\n // create an extend of AssertionError which is a unique value for each assertion\n // this allows for easy recognition whether the AssertionError was thrown from this\n // or other assertions\n class InnerAssertionError extends AssertionError {\n }\n return (value) => {\n try {\n // validity may throw an error and end up in the catch block\n if (!valid(value)) {\n // if not valid (and not thrown) throw an InnerAssertionError\n throw new InnerAssertionError(message, value);\n }\n }\n catch (error) {\n // the caught error is passed on as origin to a new AssertionError only\n // if it was thrown from the valid checker function\n const rest = error instanceof InnerAssertionError || !(error instanceof AssertionError)\n ? []\n : [error];\n throw new AssertionError(message, value, ...rest);\n }\n return true;\n };\n}\n/**\n * Guard asserting the given value to match the conditions or throw an AssertionError otherwise\n */\nfunction assert(value, message, ...rules) {\n const validate = assertion(message, ...rules);\n return validate(value);\n}\n\n/**\n * Guard verifying the value to be an integer number\n */\nfunction isInteger(value) {\n return Number.isSafeInteger(value);\n}\n/**\n * Guard verifying the value to be a float number\n */\nfunction isFloat(value) {\n return !Number.isInteger(value);\n}\n/**\n * Guard verifying the value to be a positive number\n */\nfunction isPositive(value) {\n return isNumber(value) && value > 0;\n}\n/**\n * Guard verifying the value to be a negative number\n */\nfunction isNegative(value) {\n return isNumber(value) && value < 0;\n}\n/**\n * Create a guard matching numbers greater than the provided value\n */\nfunction isGreater(than) {\n return (value) => isNumber(value) && value > than;\n}\n/**\n * Create a guard matching numbers less than the provided value\n */\nfunction isLess(than) {\n return (value) => isNumber(value) && value < than;\n}\n/**\n * Create a guard matching numbers greater than or equal to the provided value\n */\nfunction isGreaterOrEqual(than) {\n return (value) => isNumber(value) && value >= than;\n}\n/**\n * Create a guard matching numbers less than or equal to the provided value\n */\nfunction isLessOrEqual(than) {\n return (value) => isNumber(value) && value <= than;\n}\n\n/**\n * Creates a guard verifying the value is an object and has the given key\n */\nfunction isKey(key) {\n return all(isObject, (value) => key in value);\n}\n/**\n * Creates a guard verifying the value is an object and has the given key matching the validators\n */\nfunction isKeyOfType(key, ...validators) {\n return all(isKey(key), (value) => validators.every((check) => check(value[key])));\n}\n/**\n * Creates a guard verifying the value is an object and doesn't have the key or has the given key matching the validators\n */\nfunction isOptionalKeyOfType(key, ...validators) {\n return any(all(isObject, not(isKey(key))), isKeyOfType(key, ...validators));\n}\n/**\n * Creates a guard verifying the value is an object matching at least the structure\n */\nfunction isStructure(struct, ...options) {\n const optional = options.reduce((carry, key) => carry.concat(key), []);\n const validators = Object.keys(struct)\n .map((key) => (optional.includes(key) ? isOptionalKeyOfType : isKeyOfType)(key, struct[key]));\n return all(isObject, ...validators);\n}\n/**\n * Creates a guard verifying the value is an object matching exactly the structure\n */\nfunction isStrictStructure(struct, ...options) {\n const keys = Object.keys(struct);\n return all(\n // do the keys present match the given structure conditions\n isStructure(struct, ...options), \n // every key should be part of the structure\n (value) => Object.keys(value).every((key) => keys.includes(key)));\n}\n/**\n * Creates a guard verifying the value is an object and an instance of the given class\n */\nfunction isInstanceOf(type) {\n return (value) => value instanceof type;\n}\n\n/**\n * Guard verifying the value to be a string which matches the given pattern\n */\nfunction isStringWithPattern(pattern) {\n return all(isString, (value) => pattern.test(value));\n}\n\nexport { AssertionError, all, any, assert, assertion, is, isArray, isArrayOfSize, isArrayOfType, isBigInt, isBoolean, isFloat, isFunction, isGreater, isGreaterOrEqual, isInstanceOf, isInteger, isKey, isKeyOfType, isLess, isLessOrEqual, isNULL, isNegative, isNumber, isObject, isOptionalKeyOfType, isPositive, isStrictStructure, isString, isStringWithPattern, isStructure, isSymbol, isUndefined, not };\n","import { type Guard, isArray, type Validator } from '@konfirm/guard';\n\nexport function isTuple<T extends Array<unknown>>(\n\t...rules: Array<Validator>\n): Guard<T> {\n\treturn (value: unknown): value is T =>\n\t\tisArray(value) &&\n\t\tvalue.length === rules.length &&\n\t\trules.every((rule, index) => rule(value[index]));\n}\n","export const EARTH_RADIUS = 6_371_008.7714; // mean radius\nexport const EARTH_RADIUS_MAJOR = 6_378_137; // equatorial radius\nexport const EARTH_RADIUS_MINOR = 6_356_752.314_245; // semiminor axis\nexport const EARTH_FLATTENING = 298.257_223_563;\nexport const GPS_SATELLITE_ORBIT = 20_180_000;\n","import { type Guard, isNumber } from '@konfirm/guard';\n\nexport function isNumberValue<T extends number>(value: unknown): value is T {\n\treturn isNumber(value) && Number.isFinite(value);\n}\n\nexport function isNumberBetween<T extends number>(\n\ta: number,\n\tb: number = Infinity,\n): Guard<T> {\n\tconst min = Math.min(a, b);\n\tconst max = Math.max(a, b);\n\n\treturn (value: unknown): value is T =>\n\t\tisNumberValue(value) && value >= min && value <= max;\n}\n","import { EARTH_RADIUS, GPS_SATELLITE_ORBIT } from '../../Constants';\nimport { isNumberBetween, isNumberValue } from '../../Guards/Number';\n\nexport type Altitude = number;\nexport function isAltitude(value: unknown): value is Altitude {\n\treturn isNumberValue(value);\n}\n\nexport const isStrictAltitude = isNumberBetween<Altitude>(\n\t-EARTH_RADIUS,\n\tGPS_SATELLITE_ORBIT,\n);\n","import { isNumberBetween, isNumberValue } from '../../Guards/Number';\n\nexport type Latitude = number;\nexport function isLatitude(value: unknown): value is Latitude {\n\treturn isNumberValue(value);\n}\nexport const isStrictLatitude = isNumberBetween<Latitude>(-90, 90);\n","import { isNumberBetween, isNumberValue } from '../../Guards/Number';\n\nexport type Longitude = number;\nexport function isLongitude(value: unknown): value is Longitude {\n\treturn isNumberValue(value);\n}\nexport const isStrictLongitude = isNumberBetween<Longitude>(-180, 180);\n","import { any } from '@konfirm/guard';\nimport { isTuple } from '../../Guards/Tuple';\nimport { type Altitude, isAltitude, isStrictAltitude } from './Altitude';\nimport { isLatitude, isStrictLatitude, type Latitude } from './Latitude';\nimport { isLongitude, isStrictLongitude, type Longitude } from './Longitude';\n\nexport type Position = [Longitude, Latitude, Altitude?];\nexport const isPosition = any<Position>(\n\tisTuple(isLongitude, isLatitude),\n\tisTuple(isLongitude, isLatitude, isAltitude),\n);\nexport const isStrictPosition = any<Position>(\n\tisTuple(isStrictLongitude, isStrictLatitude),\n\tisTuple(isStrictLongitude, isStrictLatitude, isStrictAltitude),\n);\nexport function isEquivalentPosition(one: unknown, two: unknown): boolean {\n\treturn (\n\t\tisPosition(one) &&\n\t\tisPosition(two) &&\n\t\tone.length === two.length &&\n\t\tone.every((v, i) => v === two[i])\n\t);\n}\n","import { all, any } from '@konfirm/guard';\nimport { isTuple } from '../../Guards/Tuple';\nimport { type Altitude, isAltitude, isStrictAltitude } from './Altitude';\nimport { isLatitude, isStrictLatitude, type Latitude } from './Latitude';\nimport { isLongitude, isStrictLongitude, type Longitude } from './Longitude';\n\nexport type BoundingBox =\n\t| [Longitude, Latitude, Altitude, Longitude, Latitude, Altitude]\n\t| [Longitude, Latitude, Longitude, Latitude];\nconst isBoundingBoxWithAltitude = all(\n\tisTuple(\n\t\tisLongitude,\n\t\tisLatitude,\n\t\tisAltitude,\n\t\tisLongitude,\n\t\tisLatitude,\n\t\tisAltitude,\n\t),\n\t([, s, , , n]) => s <= n,\n);\nconst isBoundingBoxWithoutAltitude = all(\n\tisTuple(isLongitude, isLatitude, isLongitude, isLatitude),\n\t([, s, , n]) => s <= n,\n);\nexport const isBoundingBox = any<BoundingBox>(\n\tisBoundingBoxWithAltitude,\n\tisBoundingBoxWithoutAltitude,\n);\nexport const isStrictBoundingBox = any<BoundingBox>(\n\tall(\n\t\tisTuple(\n\t\t\tisStrictLongitude,\n\t\t\tisStrictLatitude,\n\t\t\tisStrictAltitude,\n\t\t\tisStrictLongitude,\n\t\t\tisStrictLatitude,\n\t\t\tisStrictAltitude,\n\t\t),\n\t\tisBoundingBoxWithAltitude,\n\t),\n\tall(\n\t\tisTuple(\n\t\t\tisStrictLongitude,\n\t\t\tisStrictLatitude,\n\t\t\tisStrictLongitude,\n\t\t\tisStrictLatitude,\n\t\t),\n\t\tisBoundingBoxWithoutAltitude,\n\t),\n);\n","import { all, type Guard, isString, isStructure } from '@konfirm/guard';\nimport {\n\ttype BoundingBox,\n\tisBoundingBox,\n\tisStrictBoundingBox,\n} from './BoundingBox';\n\ntype GeoJSONBase = {\n\ttype: string;\n\tbbox?: BoundingBox;\n\t[key: string]: unknown;\n};\nexport type GeoJSONObject<T extends GeoJSONBase = GeoJSONBase> = GeoJSONBase &\n\tT;\nexport function isGeoJSONObject<T extends GeoJSONBase>(type: string): Guard<T> {\n\treturn isStructure<T>(\n\t\t{\n\t\t\ttype: all(isString, (value: unknown) => value === type),\n\t\t\tbbox: isBoundingBox,\n\t\t},\n\t\t'bbox',\n\t);\n}\nexport function isStrictGeoJSONObject<T extends GeoJSONBase>(\n\ttype: string,\n): Guard<T> {\n\treturn isStructure<T>(\n\t\t{\n\t\t\ttype: all(isString, (value: unknown) => value === type),\n\t\t\tbbox: isStrictBoundingBox,\n\t\t},\n\t\t'bbox',\n\t);\n}\n","import { all, type Guard, isKeyOfType, type Validator } from '@konfirm/guard';\nimport { type GeoJSONObject, isGeoJSONObject } from './Concept/GeoJSONObject';\n\ntype GeometryBase = GeoJSONObject & {\n\tcoordinates: Array<unknown>;\n};\n\nexport type GeometryObject<T extends GeometryBase> = Omit<\n\tGeometryBase,\n\t'coordinates'\n> &\n\tT;\nexport type MultiGeometryObject<T extends GeometryBase> = GeometryObject<{\n\ttype: `Multi${T['type']}`;\n\tcoordinates: Array<T['coordinates']>;\n}>;\nexport function isGeometryObject<T extends GeometryBase>(\n\ttype: string,\n\tisCoordinates: Validator,\n): Guard<T> {\n\treturn all<T>(\n\t\tisGeoJSONObject(type),\n\t\tisKeyOfType('coordinates', isCoordinates),\n\t);\n}\n","import type { Guard } from '@konfirm/guard';\nimport {\n\tisPosition,\n\tisStrictPosition,\n\ttype Position,\n} from '../Concept/Position';\nimport { type GeometryObject, isGeometryObject } from '../GeometryObject';\n\nexport type Point = GeometryObject<{\n\ttype: 'Point';\n\tcoordinates: Position;\n}>;\nexport const isPointCoordinates: Guard<Point['coordinates']> = isPosition;\nexport const isPoint: Guard<Point> = isGeometryObject<Point>(\n\t'Point',\n\tisPointCoordinates,\n);\nexport const isStrictPointCoordinates: Guard<Point['coordinates']> =\n\tisStrictPosition;\nexport const isStrictPoint: Guard<Point> = isGeometryObject<Point>(\n\t'Point',\n\tisStrictPointCoordinates,\n);\n","import { type Guard, isArrayOfType } from '@konfirm/guard';\nimport { isGeometryObject, type MultiGeometryObject } from '../GeometryObject';\nimport {\n\tisPointCoordinates,\n\tisStrictPointCoordinates,\n\ttype Point,\n} from './Point';\n\nexport type MultiPoint = MultiGeometryObject<Point>;\nexport const isMultiPointCoordinates: Guard<MultiPoint['coordinates']> =\n\tisArrayOfType(isPointCoordinates);\nexport const isMultiPoint = isGeometryObject<MultiPoint>(\n\t'MultiPoint',\n\tisMultiPointCoordinates,\n);\nexport const isStrictMultiPointCoordinates: Guard<MultiPoint['coordinates']> =\n\tisArrayOfType(isStrictPointCoordinates);\nexport const isStrictMultiPoint = isGeometryObject<MultiPoint>(\n\t'MultiPoint',\n\tisStrictMultiPointCoordinates,\n);\n","import type { Guard } from '@konfirm/guard';\nimport { type GeometryObject, isGeometryObject } from '../GeometryObject';\nimport {\n\tisMultiPointCoordinates,\n\tisStrictMultiPointCoordinates,\n\ttype MultiPoint,\n} from './MultiPoint';\n\nexport type LineString = GeometryObject<{\n\ttype: 'LineString';\n\tcoordinates: MultiPoint['coordinates'];\n}>;\nexport const isLineStringCoordinates = isMultiPointCoordinates;\nexport const isLineString: Guard<LineString> = isGeometryObject<LineString>(\n\t'LineString',\n\tisLineStringCoordinates,\n);\nexport const isStrictLineStringCoordinates = isStrictMultiPointCoordinates;\nexport const isStrictLineString: Guard<LineString> =\n\tisGeometryObject<LineString>('LineString', isStrictLineStringCoordinates);\n","import { isArrayOfType } from '@konfirm/guard';\nimport { isGeometryObject, type MultiGeometryObject } from '../GeometryObject';\nimport {\n\tisLineStringCoordinates,\n\tisStrictLineStringCoordinates,\n\ttype LineString,\n} from './LineString';\n\nexport type MultiLineString = MultiGeometryObject<LineString>;\nexport const isMultiLineStringCoordinates = isArrayOfType(\n\tisLineStringCoordinates,\n);\nexport const isMultiLineString = isGeometryObject<MultiLineString>(\n\t'MultiLineString',\n\tisMultiLineStringCoordinates,\n);\nexport const isStrictMultiLineStringCoordinates = isArrayOfType(\n\tisStrictLineStringCoordinates,\n);\nexport const isStrictMultiLineString = isGeometryObject<MultiLineString>(\n\t'MultiLineString',\n\tisStrictMultiLineStringCoordinates,\n);\n","import { isArrayOfType } from '@konfirm/guard';\nimport { isPosition, type Position } from '../GeoJSON/Concept/Position';\n\nfunction winding(positions: Array<Position>): number {\n\treturn positions.reduce((carry, [x, y], i, a) => {\n\t\tconst [nx, ny] = a[(i + 1) % a.length];\n\n\t\treturn carry + (nx - x) * (ny + y);\n\t}, 0);\n}\n\nconst isPositionArray = isArrayOfType<Array<Position>>(isPosition);\n\nexport function isClockwiseWinding<T extends Array<Position>>(\n\tvalue: unknown,\n): value is T {\n\treturn isPositionArray(value) && winding(value) <= 0;\n}\nexport function isCounterClockwiseWinding<T extends Array<Position>>(\n\tvalue: unknown,\n): value is T {\n\treturn isPositionArray(value) && winding(value) >= 0;\n}\n","import { all, isArrayOfSize, isArrayOfType } from '@konfirm/guard';\nimport { isPosition, isStrictPosition, type Position } from './Position';\n\nexport type LinearRing = Array<Position>;\nexport const isLinearRing = all<LinearRing>(\n\tisArrayOfType(isPosition),\n\tisArrayOfSize(4),\n\t(value: Array<Position>) =>\n\t\tvalue[value.length - 1].every((v, i) => v === value[0][i]),\n);\nexport const isStrictLinearRing = all<LinearRing>(\n\tisArrayOfType(isStrictPosition),\n\tisArrayOfSize(4),\n\t(value: Array<Position>) =>\n\t\tvalue[value.length - 1].every((v, i) => v === value[0][i]),\n);\n","import { all } from '@konfirm/guard';\nimport { isCounterClockwiseWinding } from '../../Utility/Winding';\nimport {\n\tisLinearRing,\n\tisStrictLinearRing,\n\ttype LinearRing,\n} from './LinearRing';\n\nexport type ExteriorRing = LinearRing;\nexport const isExteriorRing = all<ExteriorRing>(isLinearRing);\nexport const isStrictExteriorRing = all<ExteriorRing>(\n\tisStrictLinearRing,\n\tisCounterClockwiseWinding,\n);\n","import { all } from '@konfirm/guard';\nimport { isClockwiseWinding } from '../../Utility/Winding';\nimport {\n\tisLinearRing,\n\tisStrictLinearRing,\n\ttype LinearRing,\n} from './LinearRing';\n\nexport type InteriorRing = LinearRing;\nexport const isInteriorRing = all<InteriorRing>(isLinearRing);\nexport const isStrictInteriorRing = all<InteriorRing>(\n\tisStrictLinearRing,\n\tisClockwiseWinding,\n);\n","import { all, isArrayOfType } from '@konfirm/guard';\nimport { type ExteriorRing, isExteriorRing } from '../Concept/ExteriorRing';\nimport { type InteriorRing, isInteriorRing } from '../Concept/InteriorRing';\nimport { isLinearRing, isStrictLinearRing } from '../Concept/LinearRing';\nimport { type GeometryObject, isGeometryObject } from '../GeometryObject';\n\nexport type Polygon = GeometryObject<{\n\ttype: 'Polygon';\n\tcoordinates: [ExteriorRing, ...Array<InteriorRing>];\n}>;\nexport const isPolygonCoordinates = all(isArrayOfType(isLinearRing));\nexport const isPolygon = isGeometryObject<Polygon>(\n\t'Polygon',\n\tisPolygonCoordinates,\n);\nexport const isStrictPolygonCoordinates = all(\n\tisArrayOfType(isStrictLinearRing),\n\t(value: unknown) => isExteriorRing((<Array<unknown>>value)[0]),\n\t(value: unknown) => (<Array<unknown>>value).slice(1).every(isInteriorRing),\n);\nexport const isStrictPolygon = isGeometryObject<Polygon>(\n\t'Polygon',\n\tisStrictPolygonCoordinates,\n);\n","import { isArrayOfType } from '@konfirm/guard';\nimport { isGeometryObject, type MultiGeometryObject } from '../GeometryObject';\nimport {\n\tisPolygonCoordinates,\n\tisStrictPolygonCoordinates,\n\ttype Polygon,\n} from './Polygon';\n\nexport type MultiPolygon = MultiGeometryObject<Polygon>;\nexport const isMultiPolygonCoordinates = isArrayOfType(isPolygonCoordinates);\nexport const isMultiPolygon = isGeometryObject<MultiPolygon>(\n\t'MultiPolygon',\n\tisMultiPolygonCoordinates,\n);\nexport const isStrictMultiPolygonCoordinates = isArrayOfType(\n\tisStrictPolygonCoordinates,\n);\nexport const isStrictMultiPolygon = isGeometryObject<MultiPolygon>(\n\t'MultiPolygon',\n\tisStrictMultiPolygonCoordinates,\n);\n","import { any } from '@konfirm/guard';\nimport {\n\tisLineString,\n\tisStrictLineString,\n\ttype LineString,\n} from './Geometry/LineString';\nimport {\n\tisMultiLineString,\n\tisStrictMultiLineString,\n\ttype MultiLineString,\n} from './Geometry/MultiLineString';\nimport {\n\tisMultiPoint,\n\tisStrictMultiPoint,\n\ttype MultiPoint,\n} from './Geometry/MultiPoint';\nimport {\n\tisMultiPolygon,\n\tisStrictMultiPolygon,\n\ttype MultiPolygon,\n} from './Geometry/MultiPolygon';\nimport { isPoint, isStrictPoint, type Point } from './Geometry/Point';\nimport { isPolygon, isStrictPolygon, type Polygon } from './Geometry/Polygon';\n\nexport type Geometry =\n\t| Point\n\t| MultiPoint\n\t| LineString\n\t| MultiLineString\n\t| Polygon\n\t| MultiPolygon;\nexport const isGeometry = any<Geometry>(\n\tisPoint,\n\tisMultiPoint,\n\tisLineString,\n\tisMultiLineString,\n\tisPolygon,\n\tisMultiPolygon,\n);\nexport const isStrictGeometry = any<Geometry>(\n\tisStrictPoint,\n\tisStrictMultiPoint,\n\tisStrictLineString,\n\tisStrictMultiLineString,\n\tisStrictPolygon,\n\tisStrictMultiPolygon,\n);\n","import { all, any, isArrayOfType, isKeyOfType } from '@konfirm/guard';\nimport { type GeoJSONObject, isGeoJSONObject } from './Concept/GeoJSONObject';\nimport { type Geometry, isGeometry, isStrictGeometry } from './Geometry';\n\nexport type GeometryCollection = GeoJSONObject<{\n\ttype: 'GeometryCollection';\n\tgeometries: Array<Geometry | GeometryCollection>;\n}>;\n\nconst isGeometryCollectionObject = all<GeometryCollection>(\n\tisGeoJSONObject('GeometryCollection'),\n\tisKeyOfType(\n\t\t'geometries',\n\t\tisArrayOfType(any(isGeometry, isGeometryCollection)),\n\t),\n);\nconst isStrictGeometryCollectionObject = all<GeometryCollection>(\n\tisGeoJSONObject('GeometryCollection'),\n\tisKeyOfType(\n\t\t'geometries',\n\t\tisArrayOfType(any(isStrictGeometry, isStrictGeometryCollection)),\n\t),\n);\nexport function isGeometryCollection(\n\tvalue: unknown,\n): value is GeometryCollection {\n\treturn isGeometryCollectionObject(value);\n}\nexport function isStrictGeometryCollection(\n\tvalue: unknown,\n): value is GeometryCollection {\n\treturn isStrictGeometryCollectionObject(value);\n}\n","import { all, any, isNULL, isObject, isStructure } from '@konfirm/guard';\nimport { type GeoJSONObject, isGeoJSONObject } from './Concept/GeoJSONObject';\nimport { type Geometry, isGeometry, isStrictGeometry } from './Geometry';\nimport {\n\ttype GeometryCollection,\n\tisGeometryCollection,\n\tisStrictGeometryCollection,\n} from './GeometryCollection';\n\nexport type Feature = GeoJSONObject<{\n\ttype: 'Feature';\n\tgeometry: Geometry | GeometryCollection;\n\tproperties: { [key: string]: unknown } | null;\n}>;\nexport const isFeature = all<Feature>(\n\tisGeoJSONObject('Feature'),\n\tisStructure({\n\t\tgeometry: any(isGeometry, isGeometryCollection),\n\t\tproperties: any(isNULL, isObject),\n\t}),\n);\nexport const isStrictFeature = all<Feature>(\n\tisGeoJSONObject('Feature'),\n\tisStructure({\n\t\tgeometry: any(isStrictGeometry, isStrictGeometryCollection),\n\t\tproperties: any(isNULL, isObject),\n\t}),\n);\n","import { all, isArrayOfType, isKeyOfType } from '@konfirm/guard';\nimport { type GeoJSONObject, isGeoJSONObject } from './Concept/GeoJSONObject';\nimport { type Feature, isFeature, isStrictFeature } from './Feature';\n\nexport type FeatureCollection = GeoJSONObject<{\n\ttype: 'FeatureCollection';\n\tfeatures: Array<Feature>;\n}>;\nexport const isFeatureCollection = all<FeatureCollection>(\n\tisGeoJSONObject('FeatureCollection'),\n\tisKeyOfType('features', isArrayOfType(isFeature)),\n);\nexport const isStrictFeatureCollection = all<FeatureCollection>(\n\tisGeoJSONObject('FeatureCollection'),\n\tisKeyOfType('features', isArrayOfType(isStrictFeature)),\n);\n","import { any } from '@konfirm/guard';\nimport { type Feature, isFeature, isStrictFeature } from './Feature';\nimport {\n\ttype FeatureCollection,\n\tisFeatureCollection,\n\tisStrictFeatureCollection,\n} from './FeatureCollection';\nimport { type Geometry, isGeometry, isStrictGeometry } from './Geometry';\nimport {\n\ttype GeometryCollection,\n\tisGeometryCollection,\n\tisStrictGeometryCollection,\n} from './GeometryCollection';\n\nexport type GeoJSON =\n\t| Geometry\n\t| GeometryCollection\n\t| Feature\n\t| FeatureCollection;\nexport const isGeoJSON = any<GeoJSON>(\n\tisGeometry,\n\tisGeometryCollection,\n\tisFeature,\n\tisFeatureCollection,\n);\nexport const isStrictGeoJSON = any<GeoJSON>(\n\tisStrictGeometry,\n\tisStrictGeometryCollection,\n\tisStrictFeature,\n\tisStrictFeatureCollection,\n);\n","import type {\n\tLineString,\n\tMultiLineString,\n\tMultiPoint,\n\tMultiPolygon,\n\tPoint,\n\tPolygon,\n} from '../../main';\nimport type { Feature } from '../GeoJSON/Feature';\nimport type { FeatureCollection } from '../GeoJSON/FeatureCollection';\nimport type { GeoJSON } from '../GeoJSON/GeoJSON';\nimport type { GeometryCollection } from '../GeoJSON/GeometryCollection';\n\ntype SimpleGeometry = Point | LineString | Polygon;\ntype UnwrapGeometry = Exclude<GeoJSON, SimpleGeometry>;\n\ntype Reducer = {\n\t[K in UnwrapGeometry['type']]: (\n\t\tgeo: Extract<UnwrapGeometry, { type: K }>,\n\t\tunwrap: (geo: GeoJSON) => Iterable<SimpleGeometry>,\n\t) => Iterable<SimpleGeometry>;\n};\n\nconst reducers: Reducer = {\n\t*MultiPoint(\n\t\t{ coordinates, ...rest }: MultiPoint,\n\t\tunwrap,\n\t): Iterable<SimpleGeometry> {\n\t\tfor (const pair of coordinates) {\n\t\t\tyield* unwrap(<Point>{\n\t\t\t\tcoordinates: pair,\n\t\t\t\t...rest,\n\t\t\t\ttype: 'Point',\n\t\t\t});\n\t\t}\n\t},\n\t*MultiLineString(\n\t\t{ coordinates, ...rest }: MultiLineString,\n\t\tunwrap,\n\t): Iterable<SimpleGeometry> {\n\t\tfor (const pair of coordinates) {\n\t\t\tyield* unwrap(<LineString>{\n\t\t\t\tcoordinates: pair,\n\t\t\t\t...rest,\n\t\t\t\ttype: 'LineString',\n\t\t\t});\n\t\t}\n\t},\n\t*MultiPolygon(\n\t\t{ coordinates, ...rest }: MultiPolygon,\n\t\tunwrap,\n\t): Iterable<SimpleGeometry> {\n\t\tfor (const pair of coordinates) {\n\t\t\tyield* unwrap(<Polygon>{\n\t\t\t\tcoordinates: pair,\n\t\t\t\t...rest,\n\t\t\t\ttype: 'Polygon',\n\t\t\t});\n\t\t}\n\t},\n\t*GeometryCollection(\n\t\t{ geometries }: GeometryCollection,\n\t\tunwrap,\n\t): Iterable<SimpleGeometry> {\n\t\tfor (const geometry of geometries) {\n\t\t\tyield* unwrap(geometry);\n\t\t}\n\t},\n\t*Feature({ geometry }: Feature, unwrap): Iterable<SimpleGeometry> {\n\t\tyield* unwrap(geometry);\n\t},\n\t*FeatureCollection(\n\t\t{ features }: FeatureCollection,\n\t\tunwrap,\n\t): Iterable<SimpleGeometry> {\n\t\tfor (const { geometry } of features) {\n\t\t\tyield* unwrap(geometry);\n\t\t}\n\t},\n};\n\n/**\n * Iterator class to turn any GeoJSON structure into one or more SimpleGeometry (Point | LineString | Polygon) objects\n *\n * @export\n * @class SimpleGeometryIterator\n */\nexport class SimpleGeometryIterator {\n\tprivate readonly inputs: Array<GeoJSON> = [];\n\n\tconstructor(...inputs: [GeoJSON, ...Array<GeoJSON>]) {\n\t\tthis.inputs = inputs;\n\t}\n\n\t/**\n\t * Generator yielding all SimpleGeometry objects from the provided GeoJSON structure(s)\n\t *\n\t * @return {*} {Iterator<SimpleGeometry>}\n\t * @memberof SimpleGeometryIterator\n\t */\n\t*[Symbol.iterator](): Iterator<SimpleGeometry> {\n\t\tfor (const input of this.inputs) {\n\t\t\tfor (const simple of this.unwrap(input)) {\n\t\t\t\tyield simple;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * unwrap any GeoJSON object into one or more SimpleGeometry object\n\t *\n\t * @private\n\t * @param {GeoJSON} geo\n\t * @return {*} {Iterable<SimpleGeometry>}\n\t * @memberof SimpleGeometryIterator\n\t */\n\tprivate *unwrap(geo: GeoJSON): Iterable<SimpleGeometry> {\n\t\ttype Invoke = (\n\t\t\tgeo: GeoJSON,\n\t\t\tunwrap: (geo: GeoJSON) => Iterable<SimpleGeometry>,\n\t\t) => Iterable<SimpleGeometry>;\n\t\tgeo.type in reducers\n\t\t\t? yield* (<Invoke>reducers[<keyof Reducer>geo.type])(\n\t\t\t\t\tgeo,\n\t\t\t\t\t(g: GeoJSON): Iterable<SimpleGeometry> => this.unwrap(g),\n\t\t\t\t)\n\t\t\t: yield <SimpleGeometry>geo;\n\t}\n}\n","/**\n * Iterator class which traverses all value pairs of two or more Iterable instances\n *\n * @export\n * @class IterablePairIterator\n * @template T\n */\nexport class IterablePairIterator<T = unknown> {\n\tprivate readonly iterators: Array<Iterable<T>> = [];\n\n\t/**\n\t * Constructs a new instance of IterablePairIterator\n\t *\n\t * @param iterators\n\t */\n\tconstructor(\n\t\t...iterators: [Iterable<T>, Iterable<T>, ...Array<Iterable<T>>]\n\t) {\n\t\tthis.iterators = iterators;\n\t}\n\n\t/**\n\t * Generator yielding all value pairs from the provided iterators\n\t *\n\t * @return {*} {Iterator<[T, T]>}\n\t * @memberof IterablePairIterator\n\t */\n\t*[Symbol.iterator](): Iterator<[T, T]> {\n\t\tfor (const [a, b] of this.pairs(this.iterators)) {\n\t\t\tfor (const one of a) {\n\t\t\t\tfor (const two of b) {\n\t\t\t\t\tyield [one, two];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Create unique Iterator<T> combinations to traverse over\n\t *\n\t * @private\n\t * @param {Array<Iterable<T>>} source\n\t * @return {*} {Array<[Iterable<T>, Iterable<T>]>}\n\t * @memberof IterablePairIterator\n\t */\n\tprivate pairs(\n\t\tsource: Array<Iterable<T>>,\n\t): Array<[Iterable<T>, Iterable<T>]> {\n\t\treturn source.flatMap((a, i) =>\n\t\t\tsource.slice(i + 1).map((b) => [a, b]),\n\t\t) as Array<[Iterable<T>, Iterable<T>]>;\n\t}\n}\n","import type { GeoJSON } from '../GeoJSON/GeoJSON';\nimport type { Point } from '../GeoJSON/Geometry/Point';\nimport { SimpleGeometryIterator } from '../Iterator/SimpleGeometry';\n\nexport type Box = [\n\tminLon: number,\n\tminLat: number,\n\tmaxLon: number,\n\tmaxLat: number,\n];\n\nfunction* positions(\n\tcoordinates: Array<unknown>,\n): Generator<Point['coordinates']> {\n\tif (typeof coordinates[0] === 'number') {\n\t\tyield coordinates as Point['coordinates'];\n\t} else {\n\t\tfor (const child of coordinates as Array<Array<unknown>>) {\n\t\t\tyield* positions(child);\n\t\t}\n\t}\n}\n\nfunction boxFromPositions(source: Iterable<Point['coordinates']>): Box {\n\tlet minLon = Infinity,\n\t\tminLat = Infinity,\n\t\tmaxLon = -Infinity,\n\t\tmaxLat = -Infinity;\n\n\tfor (const [lon, lat] of source) {\n\t\tif (lon < minLon) minLon = lon;\n\t\tif (lat < minLat) minLat = lat;\n\t\tif (lon > maxLon) maxLon = lon;\n\t\tif (lat > maxLat) maxLat = lat;\n\t}\n\n\treturn [minLon, minLat, maxLon, maxLat];\n}\n\nexport function createBoxFromCoordinates(coordinates: Array<unknown>): Box {\n\treturn boxFromPositions(positions(coordinates));\n}\n\nexport function createBox(shape: GeoJSON): Box {\n\treturn boxFromPositions(\n\t\t(function* () {\n\t\t\tfor (const geometry of new SimpleGeometryIterator(shape)) {\n\t\t\t\tyield* positions(\n\t\t\t\t\t(geometry as unknown as { coordinates: Array<unknown> })\n\t\t\t\t\t\t.coordinates,\n\t\t\t\t);\n\t\t\t}\n\t\t})(),\n\t);\n}\n\nexport function isWithinBox(\n\t[lon, lat]: Point['coordinates'],\n\t[minLon, minLat, maxLon, maxLat]: Box,\n): boolean {\n\treturn lon >= minLon && lon <= maxLon && lat >= minLat && lat <= maxLat;\n}\n","import {\n\tEARTH_FLATTENING,\n\tEARTH_RADIUS,\n\tEARTH_RADIUS_MAJOR,\n\tEARTH_RADIUS_MINOR,\n} from '../Constants';\nimport type { Point } from '../GeoJSON/Geometry/Point';\nimport { createBoxFromCoordinates, isWithinBox } from './Box';\n\nconst D2R = Math.PI / 180;\nconst π = Math.PI;\n\nfunction constrain(value: number, min: number, max: number): number {\n\treturn Math.max(Math.min(value, max), min);\n}\n\nfunction squared(n: number): number {\n\treturn n * n;\n}\n\nfunction rad(n: number): number {\n\treturn n * D2R;\n}\n\nconst EARTH_RADIUS_MAJOR_SQUARED = squared(EARTH_RADIUS_MAJOR);\nconst EARTH_RADIUS_MINOR_SQUARED = squared(EARTH_RADIUS_MINOR);\nconst EARTH_RADIUS_FACTOR =\n\t(EARTH_RADIUS_MAJOR_SQUARED - EARTH_RADIUS_MINOR_SQUARED) /\n\tEARTH_RADIUS_MINOR_SQUARED;\nconst EARTH_INVERSE_FLATTENING = 1 / EARTH_FLATTENING;\n\nconst PointToPoint: {\n\t[key: string]: (\n\t\t...positions: [Point['coordinates'], Point['coordinates']]\n\t) => number;\n} = {\n\tcartesian([λa, φa], [λb, φb]) {\n\t\treturn (\n\t\t\tEARTH_RADIUS * rad(Math.sqrt(squared(λb - λa) + squared(φb - φa)))\n\t\t);\n\t},\n\thaversine([λa, φa], [λb, φb]) {\n\t\t//https://www.movable-type.co.uk/scripts/latlong.html\n\t\tconst Δ =\n\t\t\tsquared(Math.sin(rad(φb - φa) / 2)) +\n\t\t\tMath.cos(rad(φa)) *\n\t\t\t\tMath.cos(rad(φb)) *\n\t\t\t\tsquared(Math.sin(rad(λb - λa) / 2));\n\n\t\treturn EARTH_RADIUS * Math.atan2(Math.sqrt(Δ), Math.sqrt(1 - Δ)) * 2;\n\t},\n\tvincenty(...points) {\n\t\t//https://www.movable-type.co.uk/scripts/latlong-vincenty.html\n\t\tconst [[λ1, φ1], [λ2, φ2]] = points.map((p) =>\n\t\t\t(<Array<number>>p).map(rad),\n\t\t);\n\t\tconst L = λ2 - λ1; // L = difference in longitude, U = reduced latitude, defined by tan U = (1-f)·tanφ.\n\t\tconst tanU1 = (1 - EARTH_INVERSE_FLATTENING) * Math.tan(φ1),\n\t\t\tcosU1 = 1 / Math.sqrt(1 + tanU1 * tanU1),\n\t\t\tsinU1 = tanU1 * cosU1;\n\t\tconst tanU2 = (1 - EARTH_INVERSE_FLATTENING) * Math.tan(φ2),\n\t\t\tcosU2 = 1 / Math.sqrt(1 + tanU2 * tanU2),\n\t\t\tsinU2 = tanU2 * cosU2;\n\n\t\tconst antipodal = Math.abs(L) > π / 2 || Math.abs(φ2 - φ1) > π / 2;\n\n\t\tlet λ = L;\n\t\tlet sinλ = null;\n\t\tlet cosλ = null; // λ = difference in longitude on an auxiliary sphere\n\t\tlet σ = antipodal ? π : 0;\n\t\tlet sinσ = 0;\n\t\tlet cosσ = antipodal ? -1 : 1;\n\t\tlet sinSqσ = null; // σ = angular distance P₁ P₂ on the sphere\n\t\tlet cos2σₘ = 1; // σₘ = angular distance on the sphere from the equator to the midpoint of the line\n\t\tlet cosSqα = 1; // α = azimuth of the geodesic at the equator\n\t\tlet λʹ = null;\n\t\tlet iterations = 0;\n\n\t\tdo {\n\t\t\tsinλ = Math.sin(λ);\n\t\t\tcosλ = Math.cos(λ);\n\t\t\tsinSqσ =\n\t\t\t\t(cosU2 * sinλ) ** 2 +\n\t\t\t\t(cosU1 * sinU2 - sinU1 * cosU2 * cosλ) ** 2;\n\t\t\tif (Math.abs(sinSqσ) < 1e-24) break; // co-incident/antipodal points (σ < ≈0.006mm)\n\t\t\tsinσ = Math.sqrt(sinSqσ);\n\t\t\tcosσ = sinU1 * sinU2 + cosU1 * cosU2 * cosλ;\n\t\t\tσ = Math.atan2(sinσ, cosσ);\n\t\t\tconst sinα = (cosU1 * cosU2 * sinλ) / sinσ;\n\t\t\tcosSqα = 1 - sinα * sinα;\n\t\t\tcos2σₘ = cosSqα !== 0 ? cosσ - (2 * sinU1 * sinU2) / cosSqα : 0; // on equatorial line cos²α = 0 (§6)\n\t\t\tconst C =\n\t\t\t\t(EARTH_INVERSE_FLATTENING / 16) *\n\t\t\t\tcosSqα *\n\t\t\t\t(4 + EARTH_INVERSE_FLATTENING * (4 - 3 * cosSqα));\n\t\t\tλʹ = λ;\n\t\t\tλ =\n\t\t\t\tL +\n\t\t\t\t(1 - C) *\n\t\t\t\t\tEARTH_INVERSE_FLATTENING *\n\t\t\t\t\tsinα *\n\t\t\t\t\t(σ +\n\t\t\t\t\t\tC *\n\t\t\t\t\t\t\tsinσ *\n\t\t\t\t\t\t\t(cos2σₘ + C * cosσ * (-1 + 2 * cos2σₘ * cos2σₘ)));\n\t\t\t// TODO: add tests\n\t\t\t// const iterationCheck = antipodal ? Math.abs(λ) - π : Math.abs(λ);\n\t\t\t// if (iterationCheck > π) throw new EvalError('λ > π');\n\t\t} while (Math.abs(λ - λʹ) > 1e-12 && ++iterations < 1000); // TV: 'iterate until negligible change in λ' (≈0.006mm)\n\t\t// TODO: add tests\n\t\t// if (iterations >= 1000) throw new EvalError('Vincenty formula failed to converge');\n\n\t\tconst uSq = cosSqα * EARTH_RADIUS_FACTOR;\n\t\tconst A =\n\t\t\t1 + (uSq / 16384) * (4096 + uSq * (-768 + uSq * (320 - 175 * uSq)));\n\t\tconst B = (uSq / 1024) * (256 + uSq * (-128 + uSq * (74 - 47 * uSq)));\n\t\tconst Δσ =\n\t\t\tB *\n\t\t\tsinσ *\n\t\t\t(cos2σₘ +\n\t\t\t\t(B / 4) *\n\t\t\t\t\t(cosσ * (-1 + 2 * cos2σₘ * cos2σₘ) -\n\t\t\t\t\t\t(B / 6) *\n\t\t\t\t\t\t\tcos2σₘ *\n\t\t\t\t\t\t\t(-3 + 4 * sinσ * sinσ) *\n\t\t\t\t\t\t\t(-3 + 4 * cos2σₘ * cos2σₘ)));\n\n\t\treturn EARTH_RADIUS_MINOR * A * (σ - Δσ);\n\t},\n};\n\nexport type PointToPointCalculation =\n\t| 'cartesian'\n\t| 'haversine'\n\t| 'vincenty'\n\t| ((a: Point['coordinates'], b: Point['coordinates']) => number);\n\nexport function getClosestPointOnLineByPoint(\n\tpoint: Point['coordinates'],\n\tline: [Point['coordinates'], Point['coordinates']],\n): Point['coordinates'] {\n\tconst [[px, py], [ax, ay], [bx, by]] = [point, ...line];\n\tconst [abx, aby] = [bx - ax, by - ay];\n\tconst [apx, apy] = [px - ax, py - ay];\n\tconst t = constrain(\n\t\t(apx * abx + apy * aby) / (abx * abx + aby * aby),\n\t\t0,\n\t\t1,\n\t);\n\n\treturn t === 0 || t === 1 ? line[t] : [ax + abx * t, ay + aby * t];\n}\n\nexport function getDistanceOfPointToPoint(\n\ta: Point['coordinates'],\n\tb: Point['coordinates'],\n\tcalculation: PointToPointCalculation,\n): number {\n\tconst calc =\n\t\ttypeof calculation === 'function'\n\t\t\t? calculation\n\t\t\t: PointToPoint[calculation];\n\n\tif (typeof calc === 'function') {\n\t\treturn calc(a, b);\n\t}\n\n\tthrow new Error(`Not a PointToPoint calculation function ${calculation}`);\n}\n\nexport function getDistanceOfPointToLine(\n\tpoint: Point['coordinates'],\n\tline: [Point['coordinates'], Point['coordinates']],\n\tcalculation: PointToPointCalculation,\n): number {\n\treturn getDistanceOfPointToPoint(\n\t\tpoint,\n\t\tgetClosestPointOnLineByPoint(point, line),\n\t\tcalculation,\n\t);\n}\n\nexport function getDistanceOfLineToLine(\n\ta: [Point['coordinates'], Point['coordinates']],\n\tb: [Point['coordinates'], Point['coordinates']],\n\tcalculation: PointToPointCalculation,\n): number {\n\treturn isLinesCrossing(a, b)\n\t\t? 0\n\t\t: Math.min(\n\t\t\t\t...a.map((a) => getDistanceOfPointToLine(a, b, calculation)),\n\t\t\t\t...b.map((b) => getDistanceOfPointToLine(b, a, calculation)),\n\t\t\t);\n}\n\nexport function isLinesCrossing(\n\ta: [Point['coordinates'], Point['coordinates']],\n\tb: [Point['coordinates'], Point['coordinates']],\n): boolean {\n\tconst [[a1x, a1y], [a2x, a2y]] = a;\n\tconst [[b1x, b1y], [b2x, b2y]] = b;\n\tconst [s1x, s1y, s2x, s2y] = [a2x - a1x, a2y - a1y, b2x - b1x, b2y - b1y];\n\tconst s =\n\t\t(-s1y * (a1x - b1x) + s1x * (a1y - b1y)) / (-s2x * s1y + s1x * s2y);\n\tconst t =\n\t\t(s2x * (a1y - b1y) - s2y * (a1x - b1x)) / (-s2x * s1y + s1x * s2y);\n\n\treturn s >= 0 && s <= 1 && t >= 0 && t <= 1;\n}\n\nexport function isPointOnLine(\n\tpoint: Point['coordinates'],\n\tline: [Point['coordinates'], Point['coordinates']],\n\tthreshold: number = 1e-14,\n): boolean {\n\treturn getDistanceOfPointToLine(point, line, 'cartesian') < threshold;\n}\n\nexport function isPointInRing(\n\tp: Point['coordinates'],\n\tring: Array<Point['coordinates']>,\n): boolean {\n\tif (!isWithinBox(p, createBoxFromCoordinates(ring))) {\n\t\treturn false;\n\t}\n\n\tconst { length } = ring;\n\tconst odd = ring.reduce((odd, a, i) => {\n\t\tconst b = ring[(length + i - 1) % length];\n\n\t\treturn ((a[1] < p[1] && b[1] >= p[1]) ||\n\t\t\t(b[1] < p[1] && a[1] >= p[1])) &&\n\t\t\t(a[0] <= p[0] || b[0] <= p[0])\n\t\t\t? odd ^\n\t\t\t\t\tNumber(\n\t\t\t\t\t\ta[0] + ((p[1] - a[1]) / (b[1] - a[1])) * (b[0] - a[0]) <\n\t\t\t\t\t\t\tp[0],\n\t\t\t\t\t)\n\t\t\t: odd;\n\t}, 0);\n\n\treturn (\n\t\todd !== 0 ||\n\t\tring.slice(1).some((a, index) => isPointOnLine(p, [ring[index], a]))\n\t);\n}\n","import type { Point } from '../GeoJSON/Geometry/Point';\n\nexport function segments(\n\tline: Array<Point['coordinates']>,\n): Array<[Point['coordinates'], Point['coordinates']]> {\n\treturn line.slice(1).map((point, index) => [line[index], point]);\n}\n","import type { GeoJSON } from '../GeoJSON/GeoJSON';\nimport type { LineString } from '../GeoJSON/Geometry/LineString';\nimport type { Point } from '../GeoJSON/Geometry/Point';\nimport type { Polygon } from '../GeoJSON/Geometry/Polygon';\nimport { IterablePairIterator } from '../Iterator/IterablePair';\nimport { SimpleGeometryIterator } from '../Iterator/SimpleGeometry';\nimport {\n\tgetDistanceOfLineToLine,\n\tgetDistanceOfPointToLine,\n\tgetDistanceOfPointToPoint,\n\tisPointInRing,\n\ttype PointToPointCalculation,\n} from './Calculate';\nimport { segments } from './Segments';\n\nconst geometries = {\n\tPointPoint(\n\t\ta: Point['coordinates'],\n\t\tb: Point['coordinates'],\n\t\tcalculation: PointToPointCalculation,\n\t): number {\n\t\treturn getDistanceOfPointToPoint(a, b, calculation);\n\t},\n\tLineStringPoint(\n\t\ta: LineString['coordinates'],\n\t\tb: Point['coordinates'],\n\t\tcalculation: PointToPointCalculation,\n\t): number {\n\t\treturn Math.min(\n\t\t\t...segments(a).map((line) =>\n\t\t\t\tgetDistanceOfPointToLine(b, line, calculation),\n\t\t\t),\n\t\t);\n\t},\n\tLineStringLineString(\n\t\ta: LineString['coordinates'],\n\t\tb: LineString['coordinates'],\n\t\tcalculation: PointToPointCalculation,\n\t): number {\n\t\tconst sa = segments(a);\n\t\tconst sb = segments(b);\n\n\t\treturn sa.reduce(\n\t\t\t(carry, a) =>\n\t\t\t\tsb.reduce(\n\t\t\t\t\t(carry, b) =>\n\t\t\t\t\t\tcarry > 0\n\t\t\t\t\t\t\t? Math.min(\n\t\t\t\t\t\t\t\t\tcarry,\n\t\t\t\t\t\t\t\t\tgetDistanceOfLineToLine(a, b, calculation),\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t: carry,\n\t\t\t\t\tcarry,\n\t\t\t\t),\n\t\t\tInfinity,\n\t\t);\n\t},\n\tPolygonPoint(\n\t\t[exterior, ...interior]: Polygon['coordinates'],\n\t\tb: Point['coordinates'],\n\t\tcalculation: PointToPointCalculation,\n\t): number {\n\t\tif (isPointInRing(b, exterior)) {\n\t\t\tconst [excluded] = interior.filter((ring) =>\n\t\t\t\tisPointInRing(b, ring),\n\t\t\t);\n\n\t\t\treturn excluded\n\t\t\t\t? this.LineStringPoint(excluded, b, calculation)\n\t\t\t\t: 0;\n\t\t}\n\n\t\treturn this.LineStringPoint(exterior, b, calculation);\n\t},\n\tPolygonLineString(\n\t\ta: Polygon['coordinates'],\n\t\tb: LineString['coordinates'],\n\t\tcalculation: PointToPointCalculation,\n\t): number {\n\t\tconst [exterior, ...interior] = a;\n\t\tconst line = segments(b);\n\t\tconst ring = b.some((b) => isPointInRing(b, exterior))\n\t\t\t? interior.find((a) => b.every((b) => isPointInRing(b, a)))\n\t\t\t: exterior;\n\n\t\treturn ring\n\t\t\t? Math.min(\n\t\t\t\t\t...segments(ring).map((a) =>\n\t\t\t\t\t\tMath.min(\n\t\t\t\t\t\t\t...line.map((b) =>\n\t\t\t\t\t\t\t\tgetDistanceOfLineToLine(a, b, calculation),\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: 0;\n\t},\n\tPolygonPolygon(\n\t\ta: Polygon['coordinates'],\n\t\tb: Polygon['coordinates'],\n\t\tcalculation: PointToPointCalculation,\n\t): number {\n\t\treturn Math.min(\n\t\t\tthis.PolygonLineString(a, b[0], calculation),\n\t\t\tthis.PolygonLineString(b, a[0], calculation),\n\t\t);\n\t},\n};\n\nexport function distance(\n\ta: GeoJSON,\n\tb: GeoJSON,\n\tcalculation: PointToPointCalculation = 'cartesian',\n): number {\n\tconst lookup = <\n\t\tRecord<\n\t\t\tstring,\n\t\t\t(\n\t\t\t\ta: unknown,\n\t\t\t\tb: unknown,\n\t\t\t\tcalculation: PointToPointCalculation,\n\t\t\t) => number\n\t\t>\n\t>geometries;\n\treturn Math.min(\n\t\t...[\n\t\t\t...new IterablePairIterator(\n\t\t\t\tnew SimpleGeometryIterator(a),\n\t\t\t\tnew SimpleGeometryIterator(b),\n\t\t\t),\n\t\t].map(([a, b]) => {\n\t\t\treturn a.type + b.type in lookup\n\t\t\t\t? lookup[a.type + b.type](\n\t\t\t\t\t\ta.coordinates,\n\t\t\t\t\t\tb.coordinates,\n\t\t\t\t\t\tcalculation,\n\t\t\t\t\t)\n\t\t\t\t: b.type + a.type in lookup\n\t\t\t\t\t? lookup[b.type + a.type](\n\t\t\t\t\t\t\tb.coordinates,\n\t\t\t\t\t\t\ta.coordinates,\n\t\t\t\t\t\t\tcalculation,\n\t\t\t\t\t\t)\n\t\t\t\t\t: Infinity;\n\t\t}),\n\t);\n}\n","import type { GeoJSON } from '../GeoJSON/GeoJSON';\nimport type { LineString } from '../GeoJSON/Geometry/LineString';\nimport type { Point } from '../GeoJSON/Geometry/Point';\nimport type { Polygon } from '../GeoJSON/Geometry/Polygon';\nimport { IterablePairIterator } from '../Iterator/IterablePair';\nimport { SimpleGeometryIterator } from '../Iterator/SimpleGeometry';\nimport { isLinesCrossing, isPointInRing, isPointOnLine } from './Calculate';\nimport { segments } from './Segments';\n\nconst geometries = {\n\tPointPoint(a: Point['coordinates'], b: Point['coordinates']): boolean {\n\t\treturn (\n\t\t\ta.length >= 2 &&\n\t\t\tb.length >= 2 &&\n\t\t\ta.slice(0, 2).every((v, i) => v === b[i])\n\t\t);\n\t},\n\tLineStringPoint(\n\t\ta: LineString['coordinates'],\n\t\tb: Point['coordinates'],\n\t): boolean {\n\t\treturn (\n\t\t\ta.some((a) => this.PointPoint(a, b)) ||\n\t\t\tsegments(a).some((line) => isPointOnLine(b, line))\n\t\t);\n\t},\n\tLineStringLineString(\n\t\ta: LineString['coordinates'],\n\t\tb: LineString['coordinates'],\n\t): boolean {\n\t\tconst lines = segments(b);\n\n\t\treturn segments(a).some((a) =>\n\t\t\tlines.some((b) => isLinesCrossing(a, b)),\n\t\t);\n\t},\n\tPolygonPoint(\n\t\t[exterior, ...interior]: Polygon['coordinates'],\n\t\tb: Point['coordinates'],\n\t): boolean {\n\t\treturn (\n\t\t\t(this.LineStringPoint(exterior, b) || isPointInRing(b, exterior)) &&\n\t\t\t(!interior.length ||\n\t\t\t\tinterior.every((ring) => !isPointInRing(b, ring)))\n\t\t);\n\t},\n\tPolygonLineString(\n\t\ta: Polygon['coordinates'],\n\t\tb: LineString['coordinates'],\n\t): boolean {\n\t\treturn (\n\t\t\ta.some((ring) => this.LineStringLineString(ring, b)) ||\n\t\t\tb.some((point) => this.PolygonPoint(a, point))\n\t\t);\n\t},\n\tPolygonPolygon(\n\t\ta: Polygon['coordinates'],\n\t\tb: Polygon['coordinates'],\n\t): boolean {\n\t\treturn (\n\t\t\tb.some(\n\t\t\t\t(b1) =>\n\t\t\t\t\tthis.PolygonLineString(a, b1) ||\n\t\t\t\t\tb1.some((b2) => this.PolygonPoint(a, b2)),\n\t\t\t) ||\n\t\t\ta.some(\n\t\t\t\t(a1) =>\n\t\t\t\t\tthis.PolygonLineString(b, a1) ||\n\t\t\t\t\ta1.some((a2) => this.PolygonPoint(b, a2)),\n\t\t\t)\n\t\t);\n\t},\n};\n\nexport function intersect(a: GeoJSON, b: GeoJSON): boolean {\n\tconst lookup = <Record<string, (a: unknown, b: unknown) => boolean>>(\n\t\tgeometries\n\t);\n\tfor (const [itA, itB] of new IterablePairIterator(\n\t\tnew SimpleGeometryIterator(a),\n\t\tnew SimpleGeometryIterator(b),\n\t)) {\n\t\tif (\n\t\t\t(itA.type + itB.type in lookup &&\n\t\t\t\tlookup[itA.type + itB.type](\n\t\t\t\t\titA.coordinates,\n\t\t\t\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