@wemap/routers 13.2.3 → 14.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/index.d.ts +45 -37
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9924 -11
- package/dist/src/ItineraryInfoManager.d.ts +14 -14
- package/dist/src/ItineraryInfoManager.d.ts.map +1 -0
- package/dist/src/RoutingError.d.ts +7 -7
- package/dist/src/RoutingError.d.ts.map +1 -0
- package/dist/src/StatusCode.d.ts +13 -11
- package/dist/src/StatusCode.d.ts.map +1 -0
- package/dist/src/Utils.d.ts +1 -0
- package/dist/src/Utils.d.ts.map +1 -0
- package/dist/src/graph/Edge.d.ts +7 -12
- package/dist/src/graph/Edge.d.ts.map +1 -0
- package/dist/src/graph/Graph.d.ts +12 -11
- package/dist/src/graph/Graph.d.ts.map +1 -0
- package/dist/src/graph/GraphProjection.d.ts +4 -3
- package/dist/src/graph/GraphProjection.d.ts.map +1 -0
- package/dist/src/graph/{GraphProjectionOptions.d.ts → GraphProjectionRules.d.ts} +2 -1
- package/dist/src/graph/GraphProjectionRules.d.ts.map +1 -0
- package/dist/src/graph/GraphRoute.d.ts +4 -3
- package/dist/src/graph/GraphRoute.d.ts.map +1 -0
- package/dist/src/graph/GraphRouter.d.ts +9 -8
- package/dist/src/graph/GraphRouter.d.ts.map +1 -0
- package/dist/src/graph/GraphRouterEngine.d.ts +19 -26
- package/dist/src/graph/GraphRouterEngine.d.ts.map +1 -0
- package/dist/src/graph/GraphRouterRules.d.ts +32 -0
- package/dist/src/graph/GraphRouterRules.d.ts.map +1 -0
- package/dist/src/graph/GraphRouterRulesBuilder.d.ts +19 -0
- package/dist/src/graph/GraphRouterRulesBuilder.d.ts.map +1 -0
- package/dist/src/graph/GraphRouterRulesMerger.d.ts +4 -0
- package/dist/src/graph/GraphRouterRulesMerger.d.ts.map +1 -0
- package/dist/src/graph/GraphRouterRulesTyping.d.ts +26 -0
- package/dist/src/graph/GraphRouterRulesTyping.d.ts.map +1 -0
- package/dist/src/graph/NoRouteFoundError.d.ts +3 -2
- package/dist/src/graph/NoRouteFoundError.d.ts.map +1 -0
- package/dist/src/graph/Vertex.d.ts +6 -8
- package/dist/src/graph/Vertex.d.ts.map +1 -0
- package/dist/src/import/geojson/GeoJsonGraphUtils.d.ts +5 -4
- package/dist/src/import/geojson/GeoJsonGraphUtils.d.ts.map +1 -0
- package/dist/src/import/geojson/GeoJsonUtils.d.ts +1 -0
- package/dist/src/import/geojson/GeoJsonUtils.d.ts.map +1 -0
- package/dist/src/import/osm/OsmGraphUtils.d.ts +5 -4
- package/dist/src/import/osm/OsmGraphUtils.d.ts.map +1 -0
- package/dist/src/model/Itinerary.d.ts +8 -7
- package/dist/src/model/Itinerary.d.ts.map +1 -0
- package/dist/src/model/Leg.d.ts +6 -5
- package/dist/src/model/Leg.d.ts.map +1 -0
- package/dist/src/model/RouterRequest.d.ts +18 -19
- package/dist/src/model/RouterRequest.d.ts.map +1 -0
- package/dist/src/model/Step.d.ts +2 -1
- package/dist/src/model/Step.d.ts.map +1 -0
- package/dist/src/model/StepExtra.d.ts +1 -0
- package/dist/src/model/StepExtra.d.ts.map +1 -0
- package/dist/src/model/StepsBuilder.d.ts +4 -3
- package/dist/src/model/StepsBuilder.d.ts.map +1 -0
- package/dist/src/model/TransitMode.d.ts +1 -0
- package/dist/src/model/TransitMode.d.ts.map +1 -0
- package/dist/src/model/TravelMode.d.ts +1 -0
- package/dist/src/model/TravelMode.d.ts.map +1 -0
- package/dist/src/model/generateSteps.d.ts +2 -0
- package/dist/src/model/generateSteps.d.ts.map +1 -0
- package/dist/src/remote/RemoteRouter.d.ts +3 -2
- package/dist/src/remote/RemoteRouter.d.ts.map +1 -0
- package/dist/src/remote/RemoteRouterManager.d.ts +120 -119
- package/dist/src/remote/RemoteRouterManager.d.ts.map +1 -0
- package/dist/src/remote/RemoteRouterUtils.d.ts +1 -0
- package/dist/src/remote/RemoteRouterUtils.d.ts.map +1 -0
- package/dist/src/remote/cityway/CitywayRemoteRouter.d.ts +4 -3
- package/dist/src/remote/cityway/CitywayRemoteRouter.d.ts.map +1 -0
- package/dist/src/remote/deutsche-bahn/DeutscheBahnRemoteRouter.d.ts +5 -4
- package/dist/src/remote/deutsche-bahn/DeutscheBahnRemoteRouter.d.ts.map +1 -0
- package/dist/src/remote/geovelo/GeoveloRemoteRouter.d.ts +4 -3
- package/dist/src/remote/geovelo/GeoveloRemoteRouter.d.ts.map +1 -0
- package/dist/src/remote/idfm/IdfmRemoteRouter.d.ts +5 -4
- package/dist/src/remote/idfm/IdfmRemoteRouter.d.ts.map +1 -0
- package/dist/src/remote/navitia/NavitiaRemoteRouter.d.ts +5 -4
- package/dist/src/remote/navitia/NavitiaRemoteRouter.d.ts.map +1 -0
- package/dist/src/remote/navitia/types.d.ts +1 -0
- package/dist/src/remote/navitia/types.d.ts.map +1 -0
- package/dist/src/remote/osrm/OsrmRemoteRouter.d.ts +7 -6
- package/dist/src/remote/osrm/OsrmRemoteRouter.d.ts.map +1 -0
- package/dist/src/remote/otp/OtpRemoteRouter.d.ts +4 -3
- package/dist/src/remote/otp/OtpRemoteRouter.d.ts.map +1 -0
- package/dist/src/remote/tictactrip/TictactripRemoteRouter.d.ts +6 -5
- package/dist/src/remote/tictactrip/TictactripRemoteRouter.d.ts.map +1 -0
- package/dist/src/remote/tictactrip/type.d.ts +1 -0
- package/dist/src/remote/tictactrip/type.d.ts.map +1 -0
- package/dist/src/remote/wemap-multi/WemapMultiRemoteRouter.d.ts +5 -4
- package/dist/src/remote/wemap-multi/WemapMultiRemoteRouter.d.ts.map +1 -0
- package/dist/src/types.d.ts +4 -3
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/wemap-multi/CustomGraphMap.d.ts +16 -13
- package/dist/src/wemap-multi/CustomGraphMap.d.ts.map +1 -0
- package/dist/src/wemap-multi/CustomGraphMapTester.d.ts +4 -3
- package/dist/src/wemap-multi/CustomGraphMapTester.d.ts.map +1 -0
- package/dist/src/wemap-multi/WemapMultiRouter.d.ts +5 -4
- package/dist/src/wemap-multi/WemapMultiRouter.d.ts.map +1 -0
- package/dist/tests/CommonTest.d.ts +4 -3
- package/dist/tests/CommonTest.d.ts.map +1 -0
- package/dist/vitest.config.d.ts +3 -0
- package/dist/vitest.config.d.ts.map +1 -0
- package/package.json +39 -64
- package/dist/helpers/InstructionManager.d.ts +0 -19
- package/dist/helpers/InstructionManagerV1.d.ts +0 -6
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -14184
- package/dist/index.mjs.map +0 -1
- package/dist/src/graph/GraphRouterOptions.d.ts +0 -19
- package/dist/src/graph/GraphRouterOptionsBuilder.d.ts +0 -23
- package/dist/src/graph/GraphRouterOptionsFactors.d.ts +0 -8
- package/helpers/InstructionManager.ts +0 -184
- package/helpers/InstructionManagerV1.ts +0 -93
package/dist/index.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../src/model/RouterRequest.ts","../src/graph/Edge.ts","../src/graph/GraphProjection.ts","../src/graph/Vertex.ts","../src/graph/Graph.ts","../src/Utils.ts","../src/model/TransitMode.ts","../src/model/Step.ts","../src/graph/GraphRoute.ts","../src/model/StepsBuilder.ts","../src/model/Leg.ts","../src/model/Itinerary.ts","../../../node_modules/ua-parser-js/src/ua-parser.js","../../utils/dist/index.mjs","../src/graph/GraphRouterOptionsFactors.ts","../src/graph/GraphRouterOptionsBuilder.ts","../src/graph/GraphRouterEngine.ts","../src/graph/GraphRouter.ts","../src/graph/NoRouteFoundError.ts","../src/remote/RemoteRouter.ts","../src/StatusCode.ts","../src/RoutingError.ts","../src/remote/RemoteRouterUtils.ts","../src/remote/cityway/CitywayRemoteRouter.ts","../src/remote/navitia/NavitiaRemoteRouter.ts","../src/remote/deutsche-bahn/DeutscheBahnRemoteRouter.ts","../src/remote/geovelo/GeoveloRemoteRouter.ts","../src/remote/idfm/IdfmRemoteRouter.ts","../src/remote/osrm/OsrmRemoteRouter.ts","../src/remote/otp/OtpRemoteRouter.ts","../src/remote/wemap-multi/WemapMultiRemoteRouter.ts","../src/remote/tictactrip/TictactripRemoteRouter.ts","../src/remote/RemoteRouterManager.ts","../src/wemap-multi/WemapMultiRouter.ts","../src/wemap-multi/CustomGraphMap.ts","../../../node_modules/osmtogeojson/lodash.custom.js","../../../node_modules/@mapbox/geojson-rewind/index.js","../../../node_modules/osm-polygon-features/index.js","../../../node_modules/osmtogeojson/index.js","../../../node_modules/@xmldom/xmldom/lib/conventions.js","../../../node_modules/@xmldom/xmldom/lib/errors.js","../../../node_modules/@xmldom/xmldom/lib/grammar.js","../../../node_modules/@xmldom/xmldom/lib/dom.js","../../../node_modules/@xmldom/xmldom/lib/entities.js","../../../node_modules/@xmldom/xmldom/lib/sax.js","../../../node_modules/@xmldom/xmldom/lib/dom-parser.js","../../../node_modules/@xmldom/xmldom/lib/index.js","../src/import/geojson/GeoJsonUtils.ts","../src/import/geojson/GeoJsonGraphUtils.ts","../src/import/osm/OsmGraphUtils.ts","../src/wemap-multi/CustomGraphMapTester.ts","../src/ItineraryInfoManager.ts"],"sourcesContent":["import { Coordinates } from \"@wemap/geo\"\n\nimport { TravelMode, TravelModePreference } from \"./TravelMode\"\n\nexport type RouterRequest = {\n origin: Coordinates,\n destination: Coordinates,\n travelMode: TravelMode,\n travelModePreference?: TravelModePreference,\n provideItineraryAlternatives?: boolean,\n waypoints?: Coordinates[],\n optimizeWaypoints?: boolean,\n departureTime?: string,\n itineraryModifiers?: {\n avoidStairs?: boolean,\n avoidEscalators?: boolean,\n avoidElevators?: boolean,\n avoidMovingWalkways?: boolean,\n avoidTicketRestrictedAreas?: boolean,\n isWheelchair?: boolean\n }\n output?: {\n distanceAndDurationOnly?: boolean\n }\n}\n\nexport function routerRequestToJson(routerRequest: RouterRequest) {\n const { origin, destination, waypoints, ...rest } = routerRequest;\n return {\n origin: origin.toJson(),\n destination: destination.toJson(),\n ...(waypoints && { waypoints: waypoints.map(w => w.toJson()) }),\n ...rest\n }\n}","import { Level, type Level_t } from '@wemap/geo';\n\nimport Vertex from './Vertex.js';\n\nexport type EdgeSmoothness = 'excellent' | 'good' | 'intermediate' | 'bad' | 'horrible';\nexport type EdgeSurface = 'asphalt' | 'compacted' | 'concrete' | 'grass' | 'gravel' | 'ground' | 'metal' | 'paving_stones' | 'wood' | 'paved';\nexport type EdgeWheelchair = 'yes' | 'no' | 'limited' | 'designated'; // Default is 'yes'\n\nexport type EdgeProperties = {\n \n name?: string;\n externalId?: string | number;\n\n isOneway?: boolean;\n areStairs?: boolean;\n isElevator?: boolean;\n areEscalators?: boolean;\n isMovingWalkway?: boolean;\n needTicket?: boolean;\n incline?: 'up' | 'down';\n wheelchair?: EdgeWheelchair;\n smoothness?: EdgeSmoothness;\n surface?: EdgeSurface;\n}\n\n/**\n * An Edge is a segment composed of two Vertex\n * An edge is mostly issued from an OsmWay, but this is not always the case.\n * For example, edges created by mapmatching.\n */\nexport default class Edge {\n\n static currentUniqueId = 0;\n\n public readonly level: Level_t;\n\n /** Edge bearing from vertex1 to vertex2 */\n public readonly bearing: number;\n public readonly length: number;\n\n constructor(\n public vertex1: Vertex,\n public vertex2: Vertex,\n public properties: EdgeProperties = {},\n public readonly id: number = Edge.currentUniqueId++\n ) {\n this.level = Level.union(vertex1.coords.level, vertex2.coords.level)\n this.length = this.vertex1.distanceTo(this.vertex2);\n this.bearing = this.vertex1.bearingTo(this.vertex2);\n }\n\n static getEdgeByVertices(\n edges: Edge[],\n vertex1: Vertex,\n vertex2: Vertex\n ) {\n return edges.find(edge => vertex1 === edge.vertex1 && vertex2 === edge.vertex2\n || vertex2 === edge.vertex1 && vertex1 === edge.vertex2\n );\n }\n\n reverseProperties() {\n const { properties } = this;\n if (properties.incline) {\n properties.incline = properties.incline === 'up' ? 'down' : 'up';\n }\n if (properties.isOneway) {\n properties.isOneway = false;\n }\n }\n}\n","import { Coordinates, UserPosition } from '@wemap/geo';\n\nimport Edge from './Edge.js';\nimport Vertex from './Vertex.js';\n\nclass GraphProjection<U extends Coordinates | UserPosition = Coordinates> {\n constructor(\n public readonly origin: U,\n public readonly distanceFromNearestElement: number,\n public readonly coords: U,\n public readonly nearestElement: Vertex | Edge\n ) { }\n}\n\nexport default GraphProjection;\n","import { Coordinates } from '@wemap/geo';\n\nimport { GraphVertexJson } from '../types.js';\n\nexport type VertexProperties = {\n\n name?: string;\n externalId?: string | number;\n\n isTurnstile?: boolean;\n isGate?: boolean;\n isSubwayEntrance?: boolean;\n subwayEntranceRef?: string;\n}\n\nexport default class Vertex {\n\n public id = -1;\n\n constructor(public coords: Coordinates, public properties: VertexProperties = {}) { }\n\n distanceTo(other: Vertex) {\n return this.coords.distanceTo(other.coords);\n }\n\n bearingTo(other: Vertex) {\n return this.coords.bearingTo(other.coords);\n }\n\n toJson(): GraphVertexJson {\n return {\n id: this.id,\n coords: this.coords.toCompressedJson(),\n ...(Object.keys(this.properties).length > 0 && { properties: this.properties })\n }\n }\n\n /**\n * Check if two vertices are equal. It only checks the coordinates (not the properties)\n * @param other - The other vertex to compare to\n * @returns True if the vertices are equal, false otherwise\n */\n equals(other: Vertex) {\n return this.coords.equals(other.coords);\n }\n\n static fromJson(json: GraphVertexJson) {\n const v = new Vertex(\n Coordinates.fromCompressedJson(json.coords),\n json.properties\n );\n v.id = json.id;\n return v;\n }\n}\n","import { MultiPolygon } from 'geojson';\nimport { diffAngleLines } from '@wemap/maths';\nimport { BoundingBox, Coordinates, Level, UserPosition, Level_t, Constants as GeoConstants } from '@wemap/geo';\n\nimport Edge from './Edge.js';\nimport GraphProjection from './GraphProjection.js';\nimport Vertex from './Vertex.js';\nimport { type CompressedGeoGraphJson, type GeoGraphJson } from '../types.js';\nimport { type GraphProjectionOptions } from './GraphProjectionOptions.js';\n\n\nclass Graph {\n\n /**\n * exitVertices are vertices that have at least one indoor edge and one outdoor edge\n * They are stored because the Level model cannot handle an indoor and outdoor state like [null, 1] or [null, [1,2]]\n * This vertices are used to cover the projection case:\n * - if projection origin is null, an exit vertex can be used\n * - if projection origin is not null, the intersection level with an exit vertex can be used\n */\n public readonly exitVertices: Set<Vertex>;\n\n constructor(\n public readonly vertices: Vertex[],\n public readonly edges: Edge[],\n public readonly routingBounds: MultiPolygon | null = null,\n public readonly routingBoundsEntryPoints: Vertex[] = []\n ) {\n const nullVertices = edges.filter(e => e.level === null).map(e => [e.vertex1, e.vertex2]).flat();\n const levelVertices = edges.filter(e => e.level !== null).map(e => [e.vertex1, e.vertex2]).flat();\n this.exitVertices = new Set(nullVertices.filter(v1 => levelVertices.includes(v1)));\n routingBoundsEntryPoints?.forEach(v => this.exitVertices.add(v));\n }\n\n getEdgeByVertices(vertex1: Vertex, vertex2: Vertex) {\n return Edge.getEdgeByVertices(this.edges, vertex1, vertex2);\n }\n\n getVertexByCoords(coords: Coordinates) {\n return Graph.getVertexByCoords(this.vertices, coords);\n }\n\n static getVertexByCoords(vertices: Vertex[], coords: Coordinates) {\n return vertices.find(vertex => vertex.coords.equals(coords));\n }\n\n getVertexByName(name: string) {\n return this.vertices.find(vertex => vertex.properties.name === name);\n }\n\n getVerticesByName(name: string) {\n return this.vertices.filter(vertex => vertex.properties.name === name);\n }\n\n getEdgeByName(name: string) {\n return this.edges.find(edge => edge.properties.name === name);\n }\n\n getEdgesByName(name: string) {\n return this.edges.filter(edge => edge.properties.name === name);\n }\n\n getBoundingBox(extendedMeasure?: number) {\n if (!this.vertices.length) {\n return null;\n }\n const boundingBox = BoundingBox.fromCoordinates(this.vertices.map(vertex => vertex.coords)) as BoundingBox;\n if (extendedMeasure) {\n boundingBox.extendsWithMeasure(extendedMeasure);\n }\n return boundingBox;\n }\n\n getProjection<U extends (Coordinates | UserPosition)>(\n origin: U,\n options: GraphProjectionOptions = {}\n ): GraphProjection<U> | null {\n\n const useMaxDistance = 'maxDistance' in options;\n const maxDistance = options.maxDistance!\n\n const useMaxBearingAngle = 'maxBearingAngle' in options;\n if (useMaxBearingAngle && (!(origin instanceof UserPosition) || origin.bearing === null)) return null;\n const maxBearingAngle = options.maxBearingAngle!;\n\n const useAcceptEdgeFn = 'acceptEdgeFn' in options;\n\n const useMultiLevelSegments = !('useMultiLevelSegments' in options) || options.useMultiLevelSegments;\n\n let bestProjection: GraphProjection<U> | null = null;\n\n // (for as any) See. https://www.totaltypescript.com/any-considered-harmful#returning-conditional-types-from-generic-functions\n const adaptProjectionCoords = (projCoords: Coordinates): U => {\n if (!(origin instanceof UserPosition)) return projCoords as any;\n const p = origin.clone();\n p.lat = projCoords.lat;\n p.lng = projCoords.lng;\n p.level = projCoords.level;\n p.alt = projCoords.alt;\n p.heightFromFloor = projCoords.heightFromFloor;\n p.heightFromGround = projCoords.heightFromGround;\n return p as any;\n }\n\n this.edges.forEach(edge => {\n\n if (useAcceptEdgeFn && !options.acceptEdgeFn!(edge)) return;\n if (!useMultiLevelSegments && Level.isRange(edge.level)) return;\n if (!Level.intersect(edge.level, origin.level)) return;\n\n if (useMaxBearingAngle) {\n // Do not try to project if angle is greater than the threshold\n if (diffAngleLines(edge.bearing, (origin as UserPosition).bearing!) > maxBearingAngle) return;\n }\n\n const segmentProjection = origin.getSegmentProjection(edge.vertex1.coords, edge.vertex2.coords);\n if (!segmentProjection) return;\n const distanceToSegment = segmentProjection.distanceTo(origin);\n\n if (useMaxDistance && distanceToSegment > maxDistance) return;\n\n if (distanceToSegment < (bestProjection?.distanceFromNearestElement ?? Number.MAX_VALUE)) {\n bestProjection = new GraphProjection(origin, distanceToSegment, adaptProjectionCoords(segmentProjection), edge);\n }\n });\n\n // if mapmatching bearing is enabled do not use vertices matching\n if (useMaxBearingAngle) {\n return bestProjection;\n }\n\n this.vertices.forEach(vertex => {\n let vertexCoords = vertex.coords;\n\n // Specific case of io nodes that have a non-null level but can be matched to a null origin level\n if (this.exitVertices.has(vertex) && origin.level === null) {\n vertexCoords = vertex.coords.clone();\n vertexCoords.level = null;\n }\n\n if (!useMultiLevelSegments && Level.isRange(vertexCoords.level)) return;\n if (!Level.intersect(vertexCoords.level, origin.level)) return;\n\n const distanceToVertex = vertexCoords.distanceTo(origin);\n\n // If distance below epsilon consider it as best projection\n if (distanceToVertex < GeoConstants.EPS_MM) {\n bestProjection = new GraphProjection(origin, 0, adaptProjectionCoords(vertexCoords), vertex);\n return;\n }\n\n if (useMaxDistance && distanceToVertex > maxDistance) return;\n\n if (distanceToVertex < (bestProjection?.distanceFromNearestElement ?? Number.MAX_VALUE)) {\n bestProjection = new GraphProjection(origin, distanceToVertex, adaptProjectionCoords(vertexCoords), vertex);\n }\n });\n\n return bestProjection;\n }\n\n\n toJson(): GeoGraphJson {\n return {\n vertices: this.vertices.map(vertex => vertex.toJson()),\n edges: this.edges.map(edge => ({\n id: edge.id,\n vertex1Idx: this.vertices.indexOf(edge.vertex1),\n vertex2Idx: this.vertices.indexOf(edge.vertex2),\n ...(Object.keys(edge.properties).length > 0 && { properties: edge.properties })\n })),\n ...(this.routingBounds && { routingBounds: this.routingBounds }),\n ...(this.routingBoundsEntryPoints.length > 0 && { routingBoundsEntryPoints: this.routingBoundsEntryPoints.map(vertex => vertex.id) })\n };\n }\n\n static fromJson(json: GeoGraphJson) {\n\n const vertices = json.vertices.map(vertex => Vertex.fromJson(vertex));\n const edges = json.edges.map(jsonEdge => new Edge(\n vertices[jsonEdge.vertex1Idx],\n vertices[jsonEdge.vertex2Idx],\n jsonEdge.properties,\n jsonEdge.id\n ));\n\n return new Graph(vertices, edges, json.routingBounds, json.routingBoundsEntryPoints?.map(id => vertices[id]));\n }\n\n /** @deprecated */\n toCompressedJson(): CompressedGeoGraphJson {\n return {\n vertices: this.vertices.map(vertex => vertex.coords.toCompressedJson()),\n verticesIds: this.vertices.map(vertex => vertex.id),\n edges: this.edges.map(edge => {\n const vertex1Idx = this.vertices.indexOf(edge.vertex1);\n const vertex2Idx = this.vertices.indexOf(edge.vertex2);\n const edgeExtras = edge.properties;\n if (Object.keys(edgeExtras).length > 0) {\n return [vertex1Idx, vertex2Idx, edgeExtras];\n }\n return [vertex1Idx, vertex2Idx];\n })\n };\n }\n\n /** @deprecated */\n static fromCompressedJson(json: CompressedGeoGraphJson) {\n const vertices = json.vertices.map(vertex => new Vertex(Coordinates.fromCompressedJson(vertex)));\n const edges = json.edges.map(jsonEdge => new Edge(\n vertices[jsonEdge[0]],\n vertices[jsonEdge[1]],\n jsonEdge.length > 2 ? jsonEdge[2] : {}\n ));\n\n return new Graph(vertices, edges);\n }\n\n\n static fromCoordinatesSegments(segments: Coordinates[][]) {\n\n const vertices: Vertex[] = [];\n const edges: Edge[] = [];\n\n const getOrCreateVertex = (coords: Coordinates) => {\n const vertex = vertices.find(otherVertex => otherVertex.coords.equals(coords));\n if (vertex) {\n return vertex;\n }\n const newVertex = new Vertex(coords);\n vertices.push(newVertex);\n return newVertex;\n };\n\n for (const segment of segments) {\n\n let previousVertex = null;\n for (const coords of segment) {\n const currentVertex = getOrCreateVertex(coords);\n\n if (previousVertex) {\n edges.push(new Edge(currentVertex, previousVertex));\n }\n\n previousVertex = currentVertex;\n }\n }\n\n return new Graph(vertices, edges);\n }\n\n /**\n * Create edges From MultiLevel Itinerary for a given level\n * @param useMultiLevelEdges use segments which intersect both levels (stairs, elevators...)\n */\n getEdgesAtLevel(targetLevel: Level_t, useMultiLevelEdges = true) {\n return this.edges.filter(\n ({ level }) => useMultiLevelEdges\n ? Level.intersect(targetLevel, level)\n : Level.contains(targetLevel, level)\n );\n }\n\n\n toDetailedString() {\n let output\n = '--- Network ---\\n'\n + `Vertices: ${this.vertices.length}\\n`\n + `Edges: ${this.edges.length}\\n`\n + '---\\n'\n + 'Vertices\\n';\n this.vertices.forEach(vertex => {\n output += vertex.id;\n const vertexProps = vertex.properties;\n if (Object.keys(vertexProps).length !== 0) { output += ` ${vertexProps}` }\n });\n output += '---\\n'\n + 'Edges\\n';\n this.edges.forEach(edge => {\n output += `${edge.id} - [v1: ${edge.vertex1.id}, v2: ${edge.vertex2.id}]`;\n const edgeProps = edge.properties;\n if (Object.keys(edgeProps).length !== 0) { output += ` ${edgeProps}` }\n });\n output += '---';\n return output;\n }\n}\n\nexport default Graph;\n","import { positiveMod, rad2deg } from \"@wemap/maths\";\nimport { StepDirection } from \"./model/Step\";\n\n/**\n * Get route duration\n * @param {Number} speed in km/h\n * @returns {Number} duration in seconds\n */\nexport function getDurationFromLength(length: number, speed = 5) {\n return length / (speed * 1000 / 3600);\n}\n\n/**\n * Get direction from angle (radians)\n * @param {Number} angle in radians\n * @returns {String} direction\n */\nexport function getDirectionFromAngle(_angle: number): StepDirection {\n const angle = positiveMod(rad2deg(_angle), 360);\n\n if (angle > 0 && angle < 60) {\n return 'sharp-right';\n }\n if (angle >= 60 && angle < 140) {\n return 'right';\n }\n if (angle >= 140 && angle < 160) {\n return 'slight-right';\n }\n if (angle >= 160 && angle <= 200) {\n return 'straight';\n }\n if (angle > 200 && angle <= 220) {\n return 'slight-left';\n }\n if (angle > 220 && angle <= 300) {\n return 'left';\n }\n if (angle > 300 && angle < 360) {\n return 'sharp-left';\n }\n\n return 'u-turn';\n}\n","import { TravelMode } from \"./TravelMode\";\n\nexport type TransitMode = 'AIRPLANE' | 'BOAT' | 'BIKE' | 'BUS' | 'CAR' |\n 'FERRY' | 'FUNICULAR' | 'METRO' | 'MOTO' | 'TRAIN' | 'TAXI' |\n 'TRAM' | 'WALK' | 'MULTI' | 'UNKNOWN';\n\nexport type PublicTransport = 'AIRPLANE' | 'BOAT' | 'BUS' |\n 'FERRY' | 'FUNICULAR' | 'METRO' | 'MULTI' | 'TRAIN' | 'TRAM';\n\nexport function isTransitModePublicTransport(transitMode: TransitMode): transitMode is PublicTransport {\n return [\n 'AIRPLANE', 'BOAT', 'BUS', 'FERRY',\n 'FUNICULAR', 'METRO', 'MULTI', 'TRAIN', 'TRAM'\n ].includes(transitMode);\n}\n\n// Check if the transit mode and the travel mode are consistent\n// If they are strictly equal\n// Edge cases:\n// If the transit mode is public transport and the travel mode is 'TRANSIT'\n// If the transit mode is 'WALK' and the travel mode is 'TRANSIT'\nexport function areTransitAndTravelModeConsistent(transitMode: TransitMode, travelMode: TravelMode): boolean {\n return (\n transitMode === travelMode\n || (isTransitModePublicTransport(transitMode) && travelMode === 'TRANSIT')\n || (transitMode === 'WALK' && travelMode === 'TRANSIT')\n );\n}\n","import { Coordinates, CoordinatesCompressedJson } from '@wemap/geo';\n\ntype AtLeast<T, K extends keyof T> = Partial<T> & Pick<T, K>;\n\nexport const SHARED_STEP_TYPE = ['moving-walkway'] as const;\nexport type SharedStepType = typeof SHARED_STEP_TYPE[number];\n\nexport const VERTICAL_STEP_TYPE = [\n ...SHARED_STEP_TYPE,\n 'elevator',\n 'escalator',\n 'stairs',\n 'incline-plane'\n] as const;\nexport type VerticalStepType = typeof VERTICAL_STEP_TYPE[number];\n\nexport const VERTICAL_DIRECTION = ['up', 'down'] as const;\nexport type VerticalDirection = typeof VERTICAL_DIRECTION[number];\n\nexport const HORIZONTAL_STEP_TYPE = [\n ...SHARED_STEP_TYPE,\n 'depart',\n 'turn',\n 'continue',\n 'roundabout',\n 'exit-roundabout',\n 'arrive',\n 'subway-entrance',\n 'gate',\n 'transit'\n] as const;\nexport type HorizontalStepType = typeof HORIZONTAL_STEP_TYPE[number];\n\nexport const HORIZONTAL_DIRECTION = [\n 'straight',\n 'right',\n 'slight-right',\n 'sharp-right',\n 'left',\n 'slight-left',\n 'sharp-left',\n 'u-turn'\n] as const;\nexport type HorizontalDirection = typeof HORIZONTAL_DIRECTION[number];\n\n\nexport type StepDirection = VerticalDirection | HorizontalDirection;\nexport type StepType = VerticalStepType | HorizontalStepType;\n\ninterface BaseStep {\n firstStep: boolean;\n lastStep: boolean;\n number: number;\n\n levelDifference?: number | null;\n\n angle: number;\n previousBearing: number;\n nextBearing: number;\n distance: number;\n duration: number;\n\n readonly coords: Coordinates;\n readonly name: string | null;\n}\n\ninterface VerticalStep extends BaseStep {\n type: VerticalStepType | null;\n direction: VerticalDirection;\n}\n\ninterface HorizontalStep extends BaseStep {\n type: HorizontalStepType | null;\n direction: HorizontalDirection | null;\n}\n\nexport type Step = VerticalStep | HorizontalStep;\n\nexport type StepJson = {\n firstStep?: boolean,\n lastStep?: boolean\n number: number,\n coords: CoordinatesCompressedJson,\n name?: string,\n type: StepType | null,\n angle: number,\n direction: StepDirection | null,\n previousBearing: number,\n nextBearing: number,\n distance: number,\n duration: number,\n levelDifference?: number | null;\n};\n\nexport type MinStepInfo = AtLeast<Step, 'coords'>;\n\nexport function stepToJson(step: Step): StepJson {\n return {\n ...(step.firstStep && { firstStep: true }),\n ...(step.lastStep && { lastStep: true }),\n number: step.number,\n type: step.type,\n coords: step.coords.toCompressedJson(),\n ...(step.name !== null && { name: step.name }),\n ...(step.levelDifference !== null && { levelDifference: step.levelDifference }),\n angle: Number(step.angle.toFixed(2)),\n previousBearing: Number(step.previousBearing.toFixed(2)),\n nextBearing: Number(step.nextBearing.toFixed(2)),\n distance: Number(step.distance.toFixed(1)),\n duration: Number(step.duration.toFixed(1)),\n direction: step.direction\n };\n}\n\nexport function jsonToStep(json: StepJson): Step {\n return {\n ...json,\n coords: Coordinates.fromCompressedJson(json.coords),\n firstStep: Boolean(json.firstStep),\n lastStep: Boolean(json.lastStep),\n name: json.name || null,\n levelDifference: json.levelDifference || null,\n } as Step;\n}\n\nexport function stepEquals(step1: Step, step2: Step) {\n return step1.coords.equals(step2.coords)\n && Math.abs(step1.angle - step2.angle) <= 0.005\n && Math.abs(step1.distance - step2.distance) <= 0.05\n && Math.abs(step1.duration - step2.duration) <= 0.05\n && step1.firstStep === step2.firstStep\n && step1.lastStep === step2.lastStep\n && step1.levelDifference === step2.levelDifference\n && step1.type === step2.type\n && step1.direction === step2.direction\n && step1.name === step2.name\n && Math.abs(step1.nextBearing - step2.nextBearing) <= 0.005\n && step1.number === step2.number\n && Math.abs(step1.previousBearing - step2.previousBearing) <= 0.005\n}\n\nexport function isStepLevelChange(step?: Step | MinStepInfo | null): step is VerticalStep {\n if (!step) {\n return false;\n }\n\n return step.direction === 'up' || step.direction === 'down';\n}","import { Coordinates } from '@wemap/geo';\n\nimport Graph from \"./Graph.js\";\nimport Edge from './Edge.js';\nimport Vertex from './Vertex.js';\nimport { getDurationFromLength } from '../Utils.js';\n\n\n/**\n * GraphRoute is an oriented graph\n */\nclass GraphRoute extends Graph {\n constructor(\n public start: Coordinates,\n public end: Coordinates,\n public vertices: Vertex[],\n public edges: Edge[],\n public edgesWeights: number[]\n ) {\n super(vertices, edges);\n }\n\n // /!\\ Does not clone vertices\n // /!\\ Create new Edges but does not deep clone properties\n // /!\\ Does not revert edge oneway property\n reverse() {\n const vertices = this.vertices.slice().reverse();\n const edges = this.edges.slice().reverse();\n const edgesWeights = this.edgesWeights.slice().reverse();\n edges.map(oldEdge => new Edge(oldEdge.vertex2, oldEdge.vertex1, oldEdge.properties));\n return new GraphRoute(this.start, this.end, vertices, edges, edgesWeights);\n }\n\n static fromCoordinates(start: Coordinates, end: Coordinates, coordinates: Coordinates[]) {\n const graph = Graph.fromCoordinatesSegments([coordinates]);\n const edgesWeights = graph.edges.map(e => getDurationFromLength(e.length));\n return new GraphRoute(start, end, graph.vertices, graph.edges, edgesWeights);\n }\n\n get hasRoute() { return Boolean(this.vertices.length) }\n}\n\nexport default GraphRoute;\n","import { Coordinates, Level } from '@wemap/geo';\nimport Logger from '@wemap/logger';\nimport { diffAngle, deg2rad } from '@wemap/maths';\n\nimport { type Step, type MinStepInfo, StepType, isStepLevelChange } from './Step.js';\nimport { getDirectionFromAngle, getDurationFromLength } from '../Utils.js';\nimport GraphRoute from '../graph/GraphRoute.js';\n\nconst SKIP_STEP_ANGLE_MAX = deg2rad(20);\n\nexport default class StepsBuilder {\n\n private start: Coordinates | null = null;\n private end: Coordinates | null = null;\n private pathCoords: Coordinates[] | null = null;\n private stepsInfo: MinStepInfo[] = [];\n\n setStart(start: Coordinates) {\n this.start = start;\n return this;\n }\n\n setEnd(end: Coordinates) {\n this.end = end;\n return this;\n }\n\n setPathCoords(pathCoords: Coordinates[]) {\n this.pathCoords = pathCoords;\n return this;\n }\n\n setStepsInfo(stepsInfo: MinStepInfo[]) {\n this.stepsInfo = stepsInfo;\n return this;\n }\n\n addStepInfo(stepInfo: MinStepInfo) {\n this.stepsInfo.push(stepInfo);\n return this;\n }\n\n setGraphRoute(graphRoute: GraphRoute) {\n\n const stepsInfo: MinStepInfo[] = [];\n\n const { start, end } = graphRoute;\n\n if (!graphRoute.hasRoute) { return this; }\n\n let currentStep: MinStepInfo | null = null;\n let previousBearing = start.bearingTo(graphRoute.vertices[0].coords);\n\n for (let i = 0; i < graphRoute.vertices.length - 1; i++) {\n const vertex = graphRoute.vertices[i];\n const currentCoords = vertex.coords;\n const nextVertex = graphRoute.vertices[i + 1];\n const nextCoords = nextVertex.coords;\n\n const edge = graphRoute.edges[i];\n\n const nextBearing = vertex.bearingTo(nextVertex);\n const angle = diffAngle(previousBearing, nextBearing + Math.PI);\n\n const previousStep = stepsInfo.length ? stepsInfo[stepsInfo.length - 1] : null;\n\n const { isSubwayEntrance, isGate, subwayEntranceRef } = vertex.properties;\n const { isElevator, areEscalators, areStairs, isMovingWalkway, incline } = edge.properties;\n\n // Handle stairs/elevators/escalators/moving walkway without change in level coordinates\n let forceLevelChange: 'up' | 'down' | undefined;\n if (\n (areStairs || isElevator)\n && incline\n && (previousStep?.levelDifference === null || previousStep?.levelDifference === undefined)\n ) {\n forceLevelChange = incline;\n }\n\n const previousEdge = i > 0 ? graphRoute.edges[i - 1] : null;\n const previousEdgeProperties = previousEdge?.properties || {};\n const forceEndOfLevelChange = Boolean(\n previousEdgeProperties.incline && previousEdgeProperties.areStairs\n && (!incline || !areStairs)\n );\n const isEntrance = vertex.properties.isSubwayEntrance;\n\n const stepName = edge.properties.name || subwayEntranceRef || null;\n const duration = graphRoute.edgesWeights[i];\n\n let splitByAngle = Math.abs(diffAngle(Math.PI, angle)) >= SKIP_STEP_ANGLE_MAX;\n\n const splitByLevel = Level.isRange(edge.level) && !Level.isRange(currentCoords.level) || forceLevelChange;\n splitByAngle = splitByAngle && !(currentCoords.level && Level.isRange(currentCoords.level));\n\n const splitByEndOfLevelChange = isStepLevelChange(previousStep) && !Level.isRange(currentCoords.level)\n || forceEndOfLevelChange;\n\n const splitStepCondition = splitByAngle || splitByLevel || splitByEndOfLevelChange || isEntrance;\n\n // New step creation\n if (!currentStep || splitStepCondition) {\n\n let levelDifference: number | null = null;\n \n let type: StepType = 'turn';\n if (isElevator) {\n type = 'elevator';\n } else if (areEscalators) {\n type = 'escalator';\n } else if (areStairs) {\n type = 'stairs';\n } else if (isSubwayEntrance) {\n type = 'subway-entrance';\n } else if (isGate) {\n type = 'gate';\n } else if (isMovingWalkway) {\n type = 'moving-walkway';\n } else if (splitByLevel) {\n type = 'incline-plane';\n }\n\n let direction = getDirectionFromAngle(angle);\n if (splitByLevel) {\n levelDifference = Level.diff(currentCoords.level, nextCoords.level) || 0;\n direction = levelDifference > 0 ? 'up' : 'down'; \n if (forceLevelChange) {\n direction = forceLevelChange;\n }\n }\n\n currentStep = {\n coords: currentCoords,\n ...(stepName && { name: stepName }),\n type,\n direction,\n levelDifference,\n distance: 0,\n duration: 0\n } as Step;\n\n stepsInfo.push(currentStep);\n }\n\n currentStep.distance! += currentCoords.distanceTo(nextCoords);\n currentStep.duration! += duration;\n\n previousBearing = nextBearing;\n }\n\n const lastCoords = graphRoute.vertices[graphRoute.vertices.length - 1].coords;\n\n // Create a last step if end is not on the graph\n if (!Coordinates.equals(lastCoords, end)) {\n stepsInfo.push({ coords: lastCoords, type: 'arrive', direction: null });\n }\n\n this.setStart(start);\n this.setEnd(end);\n this.setPathCoords(graphRoute.vertices.map(v => v.coords));\n this.setStepsInfo(stepsInfo);\n\n return this;\n }\n\n build(): Step[] {\n\n const { pathCoords, start, end } = this;\n\n if (!pathCoords) {\n Logger.warn(`StepsBuilder: Missing \"pathCoords\" property to build steps`);\n return [];\n }\n\n if (!start) {\n Logger.warn(`StepsBuilder: Missing \"from\" property to build steps`);\n return [];\n }\n\n if (!end) {\n Logger.warn(`StepsBuilder: Missing \"to\" property to build steps`);\n return [];\n }\n\n if (this.stepsInfo.length === 0) {\n // If there is no steps info, steps coordinates are calculated using our steps calculation algorithm above.\n this.setGraphRoute(GraphRoute.fromCoordinates(start, end, pathCoords));\n }\n\n const { stepsInfo } = this;\n\n return stepsInfo.map((stepInfo, stepId) => {\n const coordsId = pathCoords.findIndex(coords => coords.equals(stepInfo.coords));\n if (coordsId === -1) {\n throw new Error('Cannot find step coordinates in itinerary coordinates.');\n }\n\n \n const coordsBeforeStep = coordsId === 0 ? start : pathCoords[coordsId - 1];\n const coordsAfterStep = coordsId === pathCoords.length - 1\n ? end\n : pathCoords[coordsId + 1];\n \n const previousBearing = coordsBeforeStep.bearingTo(stepInfo.coords);\n const nextBearing = stepInfo.coords.bearingTo(coordsAfterStep);\n const angle = diffAngle(previousBearing, nextBearing + Math.PI);\n\n let type = stepInfo.type;\n const direction = stepInfo.direction || getDirectionFromAngle(angle);\n\n const isFirstStep = stepId === 0;\n\n let distance = 0;\n const isLastStep = stepId === stepsInfo.length - 1;\n const coordsToStopCalculation = isLastStep\n ? pathCoords[pathCoords.length - 1]\n : stepsInfo[stepId + 1].coords;\n\n let currentCoordsId = coordsId;\n while (!pathCoords[currentCoordsId].equals(coordsToStopCalculation)) {\n distance += pathCoords[currentCoordsId].distanceTo(pathCoords[currentCoordsId + 1]);\n currentCoordsId++;\n }\n\n // Try to find the type of the step\n if (!type) {\n if (direction === 'straight') {\n type = 'continue';\n } else if (direction.includes('left') || direction.includes('right') || direction === 'u-turn') {\n type = 'turn';\n } else if (isFirstStep) {\n type = 'depart';\n } else if (isLastStep) {\n type = 'arrive';\n } else {\n type = null;\n }\n }\n\n\n return {\n coords: stepInfo.coords,\n direction: type === 'transit' ? null : direction,\n type: type,\n levelDifference: stepInfo.levelDifference !== undefined ? stepInfo.levelDifference : null,\n name: stepInfo.name || null,\n number: stepId + 1,\n previousBearing,\n nextBearing,\n angle,\n firstStep: isFirstStep,\n lastStep: isLastStep,\n distance, // stepInfo.distance is overwritten\n duration: stepInfo.duration || getDurationFromLength(distance)\n } as Step;\n });\n }\n\n}\n","import {\n Coordinates, CoordinatesCompressedJson, Level, Utils as GeoUtils\n} from '@wemap/geo';\n\nimport Graph from '../graph/Graph.js';\nimport GraphRoute from '../graph/GraphRoute.js';\nimport { getDurationFromLength } from '../Utils.js';\nimport { TransitMode, isTransitModePublicTransport } from './TransitMode.js';\n\nimport { jsonToStep, Step, stepEquals, StepJson, stepToJson } from './Step.js'\nimport StepsBuilder from './StepsBuilder.js';\n\nexport type Destination = {\n name: string | null,\n coords: Coordinates\n};\n\nexport type DestinationConstructor = {\n name?: string,\n coords: Coordinates\n};\n\nexport type DestinationJson = {\n name?: string,\n coords: CoordinatesCompressedJson\n};\n\nexport type TransportInfo = {\n name: string,\n routeColor?: string,\n routeTextColor?: string,\n directionName?: string,\n price?: number,\n}\n\ntype LegCommon = {\n transitMode: TransitMode,\n startTime?: number,\n endTime?: number,\n transportInfo?: TransportInfo,\n}\n\ntype LegConstructor =\n {\n start: DestinationConstructor,\n end: DestinationConstructor,\n coords: Coordinates[],\n steps?: Step[],\n duration?: number\n }\n & LegCommon;\n\nexport type LegJson = {\n start: DestinationJson,\n end: DestinationJson,\n coords: CoordinatesCompressedJson[],\n steps: StepJson[],\n distance: number,\n duration: number\n} & LegCommon;\n\nexport default class Leg {\n\n start: Destination;\n end: Destination;\n coords: Coordinates[];\n distance: number;\n transitMode: TransitMode;\n\n duration: number;\n startTime: number | null;\n endTime: number | null;\n\n steps: Step[];\n transportInfo: TransportInfo | null;\n\n constructor({\n start, end, coords, transitMode, duration,\n startTime, endTime, transportInfo, steps\n }: LegConstructor) {\n this.start = {\n name: start.name || null,\n coords: start.coords\n };\n this.end = {\n name: end.name || null,\n coords: end.coords\n };\n this.coords = coords;\n this.transitMode = transitMode;\n this.distance = GeoUtils.calcDistance(coords)\n this.duration = typeof duration === 'number' ? duration : getDurationFromLength(this.distance);\n this.startTime = typeof startTime === 'number' ? startTime : null;\n this.endTime = typeof endTime === 'number' ? endTime : null;\n this.transportInfo = transportInfo || null;\n this.steps = Array.isArray(steps)\n ? steps\n : new StepsBuilder().setStart(start.coords).setEnd(end.coords).setPathCoords(coords).build();\n }\n\n isPublicTransport() {\n return isTransitModePublicTransport(this.transitMode);\n }\n\n toGraph() {\n return Graph.fromCoordinatesSegments([this.coords]);\n }\n\n static equals(obj1: Leg, obj2: Leg) {\n const intermediate = obj1.transitMode === obj2.transitMode\n && Math.abs(obj1.duration - obj2.duration) <= 0.05\n && obj1.startTime === obj2.startTime\n && obj1.endTime === obj2.endTime\n && obj1.start.name === obj2.start.name\n && obj1.start.coords.equals(obj2.start.coords)\n && obj1.end.name === obj2.end.name\n && obj1.end.coords.equals(obj2.end.coords)\n && obj1.coords.length === obj2.coords.length\n && (\n obj1.steps === obj2.steps\n || obj1.steps?.length === obj2.steps?.length\n );\n\n if (!intermediate) {\n return false;\n }\n\n let i;\n for (i = 0; i < obj1.coords.length; i++) {\n if (!obj1.coords[i].equals(obj2.coords[i])) {\n return false;\n }\n }\n for (i = 0; i < obj1.steps.length; i++) {\n if (!stepEquals(obj1.steps[i], obj2.steps[i])) {\n return false;\n }\n }\n\n if (obj1.transportInfo !== obj2.transportInfo) {\n if (obj1.transportInfo === null || obj2.transportInfo === null) {\n return false;\n }\n if (\n obj1.transportInfo.name !== obj2.transportInfo.name\n || obj1.transportInfo.routeColor !== obj2.transportInfo.routeColor\n || obj1.transportInfo.routeTextColor !== obj2.transportInfo.routeTextColor\n || obj1.transportInfo.directionName !== obj2.transportInfo.directionName\n ) {\n return false;\n }\n }\n\n return true;\n }\n\n equals(obj: Leg) {\n return Leg.equals(this, obj);\n }\n\n toJson(): LegJson {\n return {\n transitMode: this.transitMode,\n start: {\n coords: this.start.coords.toCompressedJson(),\n ...(this.start.name && { name: this.start.name }),\n },\n end: {\n coords: this.end.coords.toCompressedJson(),\n ...(this.end.name && { name: this.end.name }),\n },\n distance: Number(this.distance.toFixed(1)),\n duration: Number(this.duration.toFixed(1)),\n coords: this.coords.map(coords => coords.toCompressedJson()),\n steps: this.steps.map(stepToJson),\n ...(this.startTime !== null && { startTime: this.startTime }),\n ...(this.endTime !== null && { endTime: this.endTime }),\n ...(this.transportInfo !== null && { transportInfo: this.transportInfo }),\n };\n }\n\n static fromJson(json: LegJson) {\n const leg = new Leg(Object.assign({}, json, {\n start: {\n coords: Coordinates.fromCompressedJson(json.start.coords),\n name: json.start.name || null\n },\n end: {\n coords: Coordinates.fromCompressedJson(json.end.coords),\n name: json.end.name || null\n },\n coords: json.coords.map(Coordinates.fromCompressedJson),\n steps: json.steps?.map(jsonToStep) || null,\n }));\n\n return leg;\n }\n\n static fromGraphRoute(\n graphRoute: GraphRoute,\n transitMode: TransitMode = 'WALK'\n ) {\n return new Leg({\n start: { coords: graphRoute.start },\n end: { coords: graphRoute.end },\n coords: graphRoute.vertices.map(vertex => vertex.coords),\n duration: graphRoute.edgesWeights.reduce((acc, weight) => acc + weight, 0),\n transitMode,\n steps: new StepsBuilder().setGraphRoute(graphRoute).build()\n });\n }\n\n // TODO: Remove when possible...\n // Livemap specific\n multiplyLevel(levelFactor: number) {\n this.start.coords.level = Level.multiplyBy(this.start.coords.level, levelFactor);\n this.end.coords.level = Level.multiplyBy(this.end.coords.level, levelFactor);\n for (const coords of this.coords) {\n coords.level = Level.multiplyBy(coords.level, levelFactor);\n }\n this.steps.forEach(step => {\n step.coords.level = Level.multiplyBy(step.coords.level, levelFactor);\n });\n }\n}\n","import { Feature, FeatureCollection, MultiLineString, Point } from 'geojson';\nimport { Coordinates, Level, Utils as GeoUtils, CoordinatesJson, Level_t } from '@wemap/geo';\nimport { diffAngle, Point2_t, Vector3_t } from '@wemap/maths';\n\nimport Graph from '../graph/Graph.js';\nimport Leg, { type LegJson } from './Leg.js';\nimport { isTransitModePublicTransport, type TransitMode } from './TransitMode.js';\nimport { Step } from './Step.js';\nimport { getDirectionFromAngle, getDurationFromLength } from '../Utils.js';\nimport StepsBuilder from './StepsBuilder.js';\nimport GraphRoute from '../graph/GraphRoute.js';\n\n\nexport type ItineraryCommon = {\n startTime?: number,\n endTime?: number\n};\n\nexport type ItineraryJson = {\n transitMode: TransitMode,\n origin: CoordinatesJson,\n destination: CoordinatesJson,\n distance: number,\n duration: number,\n legs: LegJson[]\n} & ItineraryCommon;\n\n\nexport type ItineraryConstructor = {\n origin: Coordinates,\n destination: Coordinates,\n duration?: number\n legs: Leg[],\n} & ItineraryCommon;\n\n/**\n * Main attributes are:\n * nodes: the ordered list of Node\n * edges: the ordered list of Edge\n * start: the start point (Coordinates)\n * end: the end point (Coordinates)\n * length: the route length\n */\nexport default class Itinerary {\n\n origin: Coordinates;\n destination: Coordinates;\n duration: number;\n readonly legs: Leg[];\n\n private _transitMode: TransitMode | null = null;\n startTime: number | null;\n endTime: number | null;\n\n private _coords: Coordinates[] | null = null;\n private _distance: number | null = null;\n\n constructor({\n origin, destination, duration, legs, startTime, endTime\n }: ItineraryConstructor) {\n this.origin = origin;\n this.destination = destination;\n this.legs = legs;\n if (typeof duration === 'number') {\n this.duration = duration;\n } else {\n this.duration = this.legs.reduce((dur, leg) => dur + leg.duration, 0);\n }\n this.startTime = typeof startTime === 'number' ? startTime : null;\n this.endTime = typeof endTime === 'number' ? endTime : null;\n\n this.updateStepsFromLegs();\n }\n\n set coords(_) {\n throw new Error('Itinerary.coords cannot be set. They are calculated from Itinerary.legs.');\n }\n\n public get coords() {\n if (!this._coords) {\n this._coords = this.legs.map(leg => leg.coords)\n .flat()\n // Remove duplicates\n .filter((coords, idx, arr) => idx === 0 || !arr[idx - 1].equals(coords));\n }\n return this._coords;\n }\n\n set steps(_) {\n throw new Error('Itinerary.step cannot be set. They are calculated from Itinerary.legs.');\n }\n\n get steps(): Step[] {\n return this.legs.map(leg => leg.steps).flat();\n }\n\n set price(_) {\n throw new Error('Itinerary.price cannot be set. They are calculated from Itinerary.legs.');\n }\n\n get price() {\n return this.legs.reduce((price, leg) => price + (leg.transportInfo?.price || 0), 0);\n }\n\n set transitMode(_) {\n throw new Error('Itinerary.transitMode cannot be set. They are calculated from Itinerary.legs.');\n }\n\n // Transit mode will return MULTI if there are several transit modes except WALK\n // Else it will return the only transit mode\n // fallback to WALK if no transit mode\n get transitMode() {\n if (!this._transitMode) {\n const legTransitModes = new Set(this.legs.map(leg => leg.transitMode));\n\n // Remove WALK from transit modes\n legTransitModes.delete('WALK');\n\n if (legTransitModes.size > 1) {\n this._transitMode = 'MULTI';\n\n return this._transitMode;\n }\n\n if (legTransitModes.size === 1) {\n this._transitMode = legTransitModes.values().next().value as TransitMode;\n\n return this._transitMode;\n }\n\n this._transitMode = 'WALK';\n }\n\n return this._transitMode;\n\n }\n\n set distance(_) {\n throw new Error('Itinerary.distance cannot be set. They are calculated from Itinerary.legs.');\n }\n\n get distance() {\n if (this._distance === null) {\n this._distance = GeoUtils.calcDistance(this.coords);\n }\n return this._distance;\n\n // Does not work if legs does not intersect\n // return this.legs.reduce((dist, leg) => dist + leg.distance, 0);\n }\n\n toGraph() {\n return Graph.fromCoordinatesSegments([this.coords]);\n }\n\n static fromItineraries(...itineraries: Itinerary[]) {\n return new Itinerary({\n origin: itineraries[0].origin,\n destination: itineraries[itineraries.length - 1].destination,\n legs: itineraries.map(itinerary => itinerary.legs).flat(),\n });\n }\n\n /**\n * Convert lat/lng/level? points to Itinerary\n */\n static fromOrderedPointsArray(\n points: (Point2_t | Vector3_t)[],\n start: (Point2_t | Vector3_t),\n end: (Point2_t | Vector3_t)) {\n\n const pointToCoordinates = (point: Point2_t | Vector3_t) =>\n new Coordinates(point[0], point[1], null, point[2]);\n\n return this.fromOrderedCoordinates(\n points.map(pointToCoordinates),\n pointToCoordinates(start),\n pointToCoordinates(end)\n );\n }\n\n /**\n * Convert ordered Coordinates to Itinerary\n */\n static fromOrderedCoordinates(\n coords: Coordinates[],\n origin: Coordinates,\n destination: Coordinates,\n transitMode: TransitMode = 'WALK'\n ) {\n\n const steps = new StepsBuilder().setPathCoords(coords).setStart(origin).setEnd(destination).build();\n\n const leg = new Leg({\n start: { coords: origin },\n end: { coords: destination },\n coords,\n transitMode,\n steps\n });\n\n return new Itinerary({ origin, destination, legs: [leg] });\n }\n\n\n static equals(obj1: Itinerary, obj2: Itinerary) {\n const intermediate = obj1.origin.equals(obj2.origin)\n && obj1.destination.equals(obj2.destination)\n && Math.abs(obj1.distance - obj2.distance) <= 0.05\n && Math.abs(obj1.duration - obj2.duration) <= 0.05\n && obj1.startTime === obj2.startTime\n && obj1.endTime === obj2.endTime\n && obj1.legs.length === obj2.legs.length;\n\n if (!intermediate) {\n return false;\n }\n\n for (let i = 0; i < obj1.legs.length; i++) {\n if (!obj1.legs[i].equals(obj2.legs[i])) {\n return false;\n }\n }\n\n return true;\n }\n\n equals(obj: Itinerary) {\n return Itinerary.equals(this, obj);\n }\n\n toJson(): ItineraryJson {\n return {\n origin: this.origin.toJson(),\n destination: this.destination.toJson(),\n distance: Number(this.distance.toFixed(1)),\n duration: Number(this.duration.toFixed(1)),\n transitMode: this.transitMode,\n legs: this.legs.map(leg => leg.toJson()),\n ...(this.startTime !== null && { startTime: this.startTime }),\n ...(this.endTime !== null && { endTime: this.endTime })\n };\n }\n\n static fromJson(json: ItineraryJson) {\n return new Itinerary({\n origin: Coordinates.fromJson(json.origin),\n destination: Coordinates.fromJson(json.destination),\n duration: json.duration,\n legs: json.legs.map(Leg.fromJson),\n startTime: json.startTime,\n endTime: json.endTime\n });\n }\n\n static fromGraphRoute(graphRoute: GraphRoute, transitMode: TransitMode = 'WALK') {\n const leg = Leg.fromGraphRoute(graphRoute, transitMode);\n return new Itinerary({\n origin: graphRoute.start,\n destination: graphRoute.end,\n legs: [leg]\n });\n }\n\n // TODO: Remove when possible...\n // Livemap specific\n multiplyLevel(levelFactor: number) {\n\n this.origin.level = Level.multiplyBy(this.origin.level, levelFactor);\n this.destination.level = Level.multiplyBy(this.destination.level, levelFactor);\n\n this.legs.forEach(leg => leg.multiplyLevel(levelFactor));\n\n // It is not necessary to multiply this._coords because \n // coords are not cloned between legs and itinerary\n }\n\n // TODO: Remove when possible...\n // Livemap specific\n forceUnknownLevelTo0() {\n\n this.origin.level = this.origin.level || 0;\n this.destination.level = this.destination.level || 0;\n\n for (const leg of this.legs) {\n leg.start.coords.level = leg.start.coords.level || 0;\n leg.end.coords.level = leg.end.coords.level || 0;\n for (const coords of leg.coords) {\n coords.level = coords.level || 0;\n }\n if (leg.steps) {\n for (const step of leg.steps) {\n step.coords.level = step.coords.level || 0;\n }\n }\n }\n\n if (this._coords) {\n for (const coords of this._coords) {\n coords.level = coords.level || 0;\n }\n }\n }\n\n toGeoJson(): FeatureCollection {\n const transformToPoint = (point: Coordinates, name?: string, type?: string): Feature<Point> => ({\n type: \"Feature\",\n properties: { name, level: point.level, ...(type && { type }) },\n geometry: {\n type: 'Point',\n coordinates: [point.lng, point.lat]\n }\n });\n const transformToMultiLineStrings = (segments: Coordinates[][], level: Level_t): Feature<MultiLineString> => ({\n type: \"Feature\",\n properties: { level, name: level?.toString() },\n geometry: {\n type: 'MultiLineString',\n coordinates: segments.map(s => s.map(({ lat, lng }) => [lng, lat]))\n }\n });\n\n const levelsOfItinerary = [...new Set(this.coords.map(c => Level.toString(c.level)))].map(Level.fromString);\n const segmentsSplitted: [Level_t, Coordinates[][]][] = levelsOfItinerary.map(loi => [loi, GeoUtils.createSegmentsAtLevel(this.coords, loi, true)]);\n const multiLineStrings = segmentsSplitted.map(([loi, segments]) => transformToMultiLineStrings(segments, loi))\n const legsStarts = this.legs.map((leg, idx) => transformToPoint(leg.start.coords, `Leg ${idx} start`, 'leg-start'));\n const legsEnds = this.legs.map((leg, idx) => transformToPoint(leg.end.coords, `Leg ${idx} end`, 'leg-end'));\n const steps = this.steps.map(step => transformToPoint(step.coords, `Step ${step.number}`, 'step'))\n return {\n type: \"FeatureCollection\",\n features: [\n transformToPoint(this.origin, 'origin', 'origin'),\n transformToPoint(this.destination, 'destination', 'destination'),\n ...multiLineStrings,\n ...legsStarts,\n ...legsEnds,\n ...steps\n ]\n };\n }\n\n /**\n * TODO: Remove it in router v3\n * Update steps info thanks to the coordinates of the whole itinerary.\n * This method will update:\n * - all steps number\n * - first/last steps\n * - previousBearing/nextBearing/angle of first and last step of each leg\n * - distance/duration of first and last step of each leg\n * - remove type depart | arrive if step is not first or last\n */\n updateStepsFromLegs() {\n\n const itineraryCoords = this.coords\n // Remove duplicates\n .filter((coords, idx, arr) => idx === 0 || !arr[idx - 1].equals(coords));\n const steps = this.legs.map(leg => leg.steps).flat();\n\n\n steps.map((step, stepId) => {\n const coordsId = itineraryCoords.findIndex(coords => coords.equals(step.coords));\n if (coordsId === -1) {\n throw new Error('Cannot find step coordinates in itinerary coordinates.');\n }\n\n const coordsBeforeStep = coordsId === 0 ? this.origin : itineraryCoords[coordsId - 1];\n const coordsAfterStep = coordsId === itineraryCoords.length - 1\n ? this.destination\n : itineraryCoords[coordsId + 1];\n\n step.previousBearing = coordsBeforeStep.bearingTo(step.coords);\n step.nextBearing = step.coords.bearingTo(coordsAfterStep);\n step.angle = diffAngle(step.previousBearing, step.nextBearing + Math.PI);\n\n const stepDistanceBefore = step.distance;\n step.distance = 0;\n const coordsToStopCalculation = stepId !== steps.length - 1\n ? steps[stepId + 1].coords\n : itineraryCoords[itineraryCoords.length - 1];\n let currentCoordsId = coordsId;\n while (!itineraryCoords[currentCoordsId].equals(coordsToStopCalculation)) {\n step.distance += itineraryCoords[currentCoordsId].distanceTo(itineraryCoords[currentCoordsId + 1]);\n currentCoordsId++;\n }\n if (currentCoordsId === itineraryCoords.length - 1) {\n step.distance += itineraryCoords[currentCoordsId].distanceTo(this.destination);\n }\n\n step.number = stepId + 1;\n step.firstStep = stepId === 0;\n step.lastStep = stepId === steps.length - 1;\n\n if ((step.type === 'arrive' && !step.lastStep) || (step.type === 'depart' && !step.firstStep)) {\n const direction = step.direction;\n if (direction && (direction.includes('left') || direction.includes('right') || direction === 'u-turn')) {\n step.type = 'turn';\n } else {\n step.type = 'continue';\n }\n }\n\n step.duration += getDurationFromLength(step.distance - stepDistanceBefore)\n });\n }\n}\n","/////////////////////////////////////////////////////////////////////////////////\n/* UAParser.js v1.0.35\n Copyright © 2012-2021 Faisal Salman <f@faisalman.com>\n MIT License *//*\n Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data.\n Supports browser & node.js environment. \n Demo : https://faisalman.github.io/ua-parser-js\n Source : https://github.com/faisalman/ua-parser-js */\n/////////////////////////////////////////////////////////////////////////////////\n\n(function (window, undefined) {\n\n 'use strict';\n\n //////////////\n // Constants\n /////////////\n\n\n var LIBVERSION = '1.0.35',\n EMPTY = '',\n UNKNOWN = '?',\n FUNC_TYPE = 'function',\n UNDEF_TYPE = 'undefined',\n OBJ_TYPE = 'object',\n STR_TYPE = 'string',\n MAJOR = 'major',\n MODEL = 'model',\n NAME = 'name',\n TYPE = 'type',\n VENDOR = 'vendor',\n VERSION = 'version',\n ARCHITECTURE= 'architecture',\n CONSOLE = 'console',\n MOBILE = 'mobile',\n TABLET = 'tablet',\n SMARTTV = 'smarttv',\n WEARABLE = 'wearable',\n EMBEDDED = 'embedded',\n UA_MAX_LENGTH = 350;\n\n var AMAZON = 'Amazon',\n APPLE = 'Apple',\n ASUS = 'ASUS',\n BLACKBERRY = 'BlackBerry',\n BROWSER = 'Browser',\n CHROME = 'Chrome',\n EDGE = 'Edge',\n FIREFOX = 'Firefox',\n GOOGLE = 'Google',\n HUAWEI = 'Huawei',\n LG = 'LG',\n MICROSOFT = 'Microsoft',\n MOTOROLA = 'Motorola',\n OPERA = 'Opera',\n SAMSUNG = 'Samsung',\n SHARP = 'Sharp',\n SONY = 'Sony',\n VIERA = 'Viera',\n XIAOMI = 'Xiaomi',\n ZEBRA = 'Zebra',\n FACEBOOK = 'Facebook',\n CHROMIUM_OS = 'Chromium OS',\n MAC_OS = 'Mac OS';\n\n ///////////\n // Helper\n //////////\n\n var extend = function (regexes, extensions) {\n var mergedRegexes = {};\n for (var i in regexes) {\n if (extensions[i] && extensions[i].length % 2 === 0) {\n mergedRegexes[i] = extensions[i].concat(regexes[i]);\n } else {\n mergedRegexes[i] = regexes[i];\n }\n }\n return mergedRegexes;\n },\n enumerize = function (arr) {\n var enums = {};\n for (var i=0; i<arr.length; i++) {\n enums[arr[i].toUpperCase()] = arr[i];\n }\n return enums;\n },\n has = function (str1, str2) {\n return typeof str1 === STR_TYPE ? lowerize(str2).indexOf(lowerize(str1)) !== -1 : false;\n },\n lowerize = function (str) {\n return str.toLowerCase();\n },\n majorize = function (version) {\n return typeof(version) === STR_TYPE ? version.replace(/[^\\d\\.]/g, EMPTY).split('.')[0] : undefined;\n },\n trim = function (str, len) {\n if (typeof(str) === STR_TYPE) {\n str = str.replace(/^\\s\\s*/, EMPTY);\n return typeof(len) === UNDEF_TYPE ? str : str.substring(0, UA_MAX_LENGTH);\n }\n };\n\n ///////////////\n // Map helper\n //////////////\n\n var rgxMapper = function (ua, arrays) {\n\n var i = 0, j, k, p, q, matches, match;\n\n // loop through all regexes maps\n while (i < arrays.length && !matches) {\n\n var regex = arrays[i], // even sequence (0,2,4,..)\n props = arrays[i + 1]; // odd sequence (1,3,5,..)\n j = k = 0;\n\n // try matching uastring with regexes\n while (j < regex.length && !matches) {\n\n if (!regex[j]) { break; }\n matches = regex[j++].exec(ua);\n\n if (!!matches) {\n for (p = 0; p < props.length; p++) {\n match = matches[++k];\n q = props[p];\n // check if given property is actually array\n if (typeof q === OBJ_TYPE && q.length > 0) {\n if (q.length === 2) {\n if (typeof q[1] == FUNC_TYPE) {\n // assign modified match\n this[q[0]] = q[1].call(this, match);\n } else {\n // assign given value, ignore regex match\n this[q[0]] = q[1];\n }\n } else if (q.length === 3) {\n // check whether function or regex\n if (typeof q[1] === FUNC_TYPE && !(q[1].exec && q[1].test)) {\n // call function (usually string mapper)\n this[q[0]] = match ? q[1].call(this, match, q[2]) : undefined;\n } else {\n // sanitize match using given regex\n this[q[0]] = match ? match.replace(q[1], q[2]) : undefined;\n }\n } else if (q.length === 4) {\n this[q[0]] = match ? q[3].call(this, match.replace(q[1], q[2])) : undefined;\n }\n } else {\n this[q] = match ? match : undefined;\n }\n }\n }\n }\n i += 2;\n }\n },\n\n strMapper = function (str, map) {\n\n for (var i in map) {\n // check if current value is array\n if (typeof map[i] === OBJ_TYPE && map[i].length > 0) {\n for (var j = 0; j < map[i].length; j++) {\n if (has(map[i][j], str)) {\n return (i === UNKNOWN) ? undefined : i;\n }\n }\n } else if (has(map[i], str)) {\n return (i === UNKNOWN) ? undefined : i;\n }\n }\n return str;\n };\n\n ///////////////\n // String map\n //////////////\n\n // Safari < 3.0\n var oldSafariMap = {\n '1.0' : '/8',\n '1.2' : '/1',\n '1.3' : '/3',\n '2.0' : '/412',\n '2.0.2' : '/416',\n '2.0.3' : '/417',\n '2.0.4' : '/419',\n '?' : '/'\n },\n windowsVersionMap = {\n 'ME' : '4.90',\n 'NT 3.11' : 'NT3.51',\n 'NT 4.0' : 'NT4.0',\n '2000' : 'NT 5.0',\n 'XP' : ['NT 5.1', 'NT 5.2'],\n 'Vista' : 'NT 6.0',\n '7' : 'NT 6.1',\n '8' : 'NT 6.2',\n '8.1' : 'NT 6.3',\n '10' : ['NT 6.4', 'NT 10.0'],\n 'RT' : 'ARM'\n };\n\n //////////////\n // Regex map\n /////////////\n\n var regexes = {\n\n browser : [[\n\n /\\b(?:crmo|crios)\\/([\\w\\.]+)/i // Chrome for Android/iOS\n ], [VERSION, [NAME, 'Chrome']], [\n /edg(?:e|ios|a)?\\/([\\w\\.]+)/i // Microsoft Edge\n ], [VERSION, [NAME, 'Edge']], [\n\n // Presto based\n /(opera mini)\\/([-\\w\\.]+)/i, // Opera Mini\n /(opera [mobiletab]{3,6})\\b.+version\\/([-\\w\\.]+)/i, // Opera Mobi/Tablet\n /(opera)(?:.+version\\/|[\\/ ]+)([\\w\\.]+)/i // Opera\n ], [NAME, VERSION], [\n /opios[\\/ ]+([\\w\\.]+)/i // Opera mini on iphone >= 8.0\n ], [VERSION, [NAME, OPERA+' Mini']], [\n /\\bopr\\/([\\w\\.]+)/i // Opera Webkit\n ], [VERSION, [NAME, OPERA]], [\n\n // Mixed\n /(kindle)\\/([\\w\\.]+)/i, // Kindle\n /(lunascape|maxthon|netfront|jasmine|blazer)[\\/ ]?([\\w\\.]*)/i, // Lunascape/Maxthon/Netfront/Jasmine/Blazer\n // Trident based\n /(avant |iemobile|slim)(?:browser)?[\\/ ]?([\\w\\.]*)/i, // Avant/IEMobile/SlimBrowser\n /(ba?idubrowser)[\\/ ]?([\\w\\.]+)/i, // Baidu Browser\n /(?:ms|\\()(ie) ([\\w\\.]+)/i, // Internet Explorer\n\n // Webkit/KHTML based // Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron/Iridium/PhantomJS/Bowser/QupZilla/Falkon\n /(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\\/([-\\w\\.]+)/i,\n // Rekonq/Puffin/Brave/Whale/QQBrowserLite/QQ, aka ShouQ\n /(heytap|ovi)browser\\/([\\d\\.]+)/i, // Heytap/Ovi\n /(weibo)__([\\d\\.]+)/i // Weibo\n ], [NAME, VERSION], [\n /(?:\\buc? ?browser|(?:juc.+)ucweb)[\\/ ]?([\\w\\.]+)/i // UCBrowser\n ], [VERSION, [NAME, 'UC'+BROWSER]], [\n /microm.+\\bqbcore\\/([\\w\\.]+)/i, // WeChat Desktop for Windows Built-in Browser\n /\\bqbcore\\/([\\w\\.]+).+microm/i\n ], [VERSION, [NAME, 'WeChat(Win) Desktop']], [\n /micromessenger\\/([\\w\\.]+)/i // WeChat\n ], [VERSION, [NAME, 'WeChat']], [\n /konqueror\\/([\\w\\.]+)/i // Konqueror\n ], [VERSION, [NAME, 'Konqueror']], [\n /trident.+rv[: ]([\\w\\.]{1,9})\\b.+like gecko/i // IE11\n ], [VERSION, [NAME, 'IE']], [\n /ya(?:search)?browser\\/([\\w\\.]+)/i // Yandex\n ], [VERSION, [NAME, 'Yandex']], [\n /(avast|avg)\\/([\\w\\.]+)/i // Avast/AVG Secure Browser\n ], [[NAME, /(.+)/, '$1 Secure '+BROWSER], VERSION], [\n /\\bfocus\\/([\\w\\.]+)/i // Firefox Focus\n ], [VERSION, [NAME, FIREFOX+' Focus']], [\n /\\bopt\\/([\\w\\.]+)/i // Opera Touch\n ], [VERSION, [NAME, OPERA+' Touch']], [\n /coc_coc\\w+\\/([\\w\\.]+)/i // Coc Coc Browser\n ], [VERSION, [NAME, 'Coc Coc']], [\n /dolfin\\/([\\w\\.]+)/i // Dolphin\n ], [VERSION, [NAME, 'Dolphin']], [\n /coast\\/([\\w\\.]+)/i // Opera Coast\n ], [VERSION, [NAME, OPERA+' Coast']], [\n /miuibrowser\\/([\\w\\.]+)/i // MIUI Browser\n ], [VERSION, [NAME, 'MIUI '+BROWSER]], [\n /fxios\\/([-\\w\\.]+)/i // Firefox for iOS\n ], [VERSION, [NAME, FIREFOX]], [\n /\\bqihu|(qi?ho?o?|360)browser/i // 360\n ], [[NAME, '360 '+BROWSER]], [\n /(oculus|samsung|sailfish|huawei)browser\\/([\\w\\.]+)/i\n ], [[NAME, /(.+)/, '$1 '+BROWSER], VERSION], [ // Oculus/Samsung/Sailfish/Huawei Browser\n /(comodo_dragon)\\/([\\w\\.]+)/i // Comodo Dragon\n ], [[NAME, /_/g, ' '], VERSION], [\n /(electron)\\/([\\w\\.]+) safari/i, // Electron-based App\n /(tesla)(?: qtcarbrowser|\\/(20\\d\\d\\.[-\\w\\.]+))/i, // Tesla\n /m?(qqbrowser|baiduboxapp|2345Explorer)[\\/ ]?([\\w\\.]+)/i // QQBrowser/Baidu App/2345 Browser\n ], [NAME, VERSION], [\n /(metasr)[\\/ ]?([\\w\\.]+)/i, // SouGouBrowser\n /(lbbrowser)/i, // LieBao Browser\n /\\[(linkedin)app\\]/i // LinkedIn App for iOS & Android\n ], [NAME], [\n\n // WebView\n /((?:fban\\/fbios|fb_iab\\/fb4a)(?!.+fbav)|;fbav\\/([\\w\\.]+);)/i // Facebook App for iOS & Android\n ], [[NAME, FACEBOOK], VERSION], [\n /(kakao(?:talk|story))[\\/ ]([\\w\\.]+)/i, // Kakao App\n /(naver)\\(.*?(\\d+\\.[\\w\\.]+).*\\)/i, // Naver InApp\n /safari (line)\\/([\\w\\.]+)/i, // Line App for iOS\n /\\b(line)\\/([\\w\\.]+)\\/iab/i, // Line App for Android\n /(chromium|instagram)[\\/ ]([-\\w\\.]+)/i // Chromium/Instagram\n ], [NAME, VERSION], [\n /\\bgsa\\/([\\w\\.]+) .*safari\\//i // Google Search Appliance on iOS\n ], [VERSION, [NAME, 'GSA']], [\n /musical_ly(?:.+app_?version\\/|_)([\\w\\.]+)/i // TikTok\n ], [VERSION, [NAME, 'TikTok']], [\n\n /headlesschrome(?:\\/([\\w\\.]+)| )/i // Chrome Headless\n ], [VERSION, [NAME, CHROME+' Headless']], [\n\n / wv\\).+(chrome)\\/([\\w\\.]+)/i // Chrome WebView\n ], [[NAME, CHROME+' WebView'], VERSION], [\n\n /droid.+ version\\/([\\w\\.]+)\\b.+(?:mobile safari|safari)/i // Android Browser\n ], [VERSION, [NAME, 'Android '+BROWSER]], [\n\n /(chrome|omniweb|arora|[tizenoka]{5} ?browser)\\/v?([\\w\\.]+)/i // Chrome/OmniWeb/Arora/Tizen/Nokia\n ], [NAME, VERSION], [\n\n /version\\/([\\w\\.\\,]+) .*mobile\\/\\w+ (safari)/i // Mobile Safari\n ], [VERSION, [NAME, 'Mobile Safari']], [\n /version\\/([\\w(\\.|\\,)]+) .*(mobile ?safari|safari)/i // Safari & Safari Mobile\n ], [VERSION, NAME], [\n /webkit.+?(mobile ?safari|safari)(\\/[\\w\\.]+)/i // Safari < 3.0\n ], [NAME, [VERSION, strMapper, oldSafariMap]], [\n\n /(webkit|khtml)\\/([\\w\\.]+)/i\n ], [NAME, VERSION], [\n\n // Gecko based\n /(navigator|netscape\\d?)\\/([-\\w\\.]+)/i // Netscape\n ], [[NAME, 'Netscape'], VERSION], [\n /mobile vr; rv:([\\w\\.]+)\\).+firefox/i // Firefox Reality\n ], [VERSION, [NAME, FIREFOX+' Reality']], [\n /ekiohf.+(flow)\\/([\\w\\.]+)/i, // Flow\n /(swiftfox)/i, // Swiftfox\n /(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\\/ ]?([\\w\\.\\+]+)/i,\n // IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror/Klar\n /(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\\/([-\\w\\.]+)$/i,\n // Firefox/SeaMonkey/K-Meleon/IceCat/IceApe/Firebird/Phoenix\n /(firefox)\\/([\\w\\.]+)/i, // Other Firefox-based\n /(mozilla)\\/([\\w\\.]+) .+rv\\:.+gecko\\/\\d+/i, // Mozilla\n\n // Other\n /(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\\. ]?browser)[-\\/ ]?v?([\\w\\.]+)/i,\n // Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/Sleipnir/Obigo/Mosaic/Go/ICE/UP.Browser\n /(links) \\(([\\w\\.]+)/i, // Links\n /panasonic;(viera)/i // Panasonic Viera\n ], [NAME, VERSION], [\n \n /(cobalt)\\/([\\w\\.]+)/i // Cobalt\n ], [NAME, [VERSION, /master.|lts./, \"\"]]\n ],\n\n cpu : [[\n\n /(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\\)]/i // AMD64 (x64)\n ], [[ARCHITECTURE, 'amd64']], [\n\n /(ia32(?=;))/i // IA32 (quicktime)\n ], [[ARCHITECTURE, lowerize]], [\n\n /((?:i[346]|x)86)[;\\)]/i // IA32 (x86)\n ], [[ARCHITECTURE, 'ia32']], [\n\n /\\b(aarch64|arm(v?8e?l?|_?64))\\b/i // ARM64\n ], [[ARCHITECTURE, 'arm64']], [\n\n /\\b(arm(?:v[67])?ht?n?[fl]p?)\\b/i // ARMHF\n ], [[ARCHITECTURE, 'armhf']], [\n\n // PocketPC mistakenly identified as PowerPC\n /windows (ce|mobile); ppc;/i\n ], [[ARCHITECTURE, 'arm']], [\n\n /((?:ppc|powerpc)(?:64)?)(?: mac|;|\\))/i // PowerPC\n ], [[ARCHITECTURE, /ower/, EMPTY, lowerize]], [\n\n /(sun4\\w)[;\\)]/i // SPARC\n ], [[ARCHITECTURE, 'sparc']], [\n\n /((?:avr32|ia64(?=;))|68k(?=\\))|\\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\\b|pa-risc)/i\n // IA64, 68K, ARM/64, AVR/32, IRIX/64, MIPS/64, SPARC/64, PA-RISC\n ], [[ARCHITECTURE, lowerize]]\n ],\n\n device : [[\n\n //////////////////////////\n // MOBILES & TABLETS\n /////////////////////////\n\n // Samsung\n /\\b(sch-i[89]0\\d|shw-m380s|sm-[ptx]\\w{2,4}|gt-[pn]\\d{2,4}|sgh-t8[56]9|nexus 10)/i\n ], [MODEL, [VENDOR, SAMSUNG], [TYPE, TABLET]], [\n /\\b((?:s[cgp]h|gt|sm)-\\w+|sc[g-]?[\\d]+a?|galaxy nexus)/i,\n /samsung[- ]([-\\w]+)/i,\n /sec-(sgh\\w+)/i\n ], [MODEL, [VENDOR, SAMSUNG], [TYPE, MOBILE]], [\n\n // Apple\n /(?:\\/|\\()(ip(?:hone|od)[\\w, ]*)(?:\\/|;)/i // iPod/iPhone\n ], [MODEL, [VENDOR, APPLE], [TYPE, MOBILE]], [\n /\\((ipad);[-\\w\\),; ]+apple/i, // iPad\n /applecoremedia\\/[\\w\\.]+ \\((ipad)/i,\n /\\b(ipad)\\d\\d?,\\d\\d?[;\\]].+ios/i\n ], [MODEL, [VENDOR, APPLE], [TYPE, TABLET]], [\n /(macintosh);/i\n ], [MODEL, [VENDOR, APPLE]], [\n\n // Sharp\n /\\b(sh-?[altvz]?\\d\\d[a-ekm]?)/i\n ], [MODEL, [VENDOR, SHARP], [TYPE, MOBILE]], [\n\n // Huawei\n /\\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\\d{2})\\b(?!.+d\\/s)/i\n ], [MODEL, [VENDOR, HUAWEI], [TYPE, TABLET]], [\n /(?:huawei|honor)([-\\w ]+)[;\\)]/i,\n /\\b(nexus 6p|\\w{2,4}e?-[atu]?[ln][\\dx][012359c][adn]?)\\b(?!.+d\\/s)/i\n ], [MODEL, [VENDOR, HUAWEI], [TYPE, MOBILE]], [\n\n // Xiaomi\n /\\b(poco[\\w ]+)(?: bui|\\))/i, // Xiaomi POCO\n /\\b; (\\w+) build\\/hm\\1/i, // Xiaomi Hongmi 'numeric' models\n /\\b(hm[-_ ]?note?[_ ]?(?:\\d\\w)?) bui/i, // Xiaomi Hongmi\n /\\b(redmi[\\-_ ]?(?:note|k)?[\\w_ ]+)(?: bui|\\))/i, // Xiaomi Redmi\n /\\b(mi[-_ ]?(?:a\\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\\d?\\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\\))/i // Xiaomi Mi\n ], [[MODEL, /_/g, ' '], [VENDOR, XIAOMI], [TYPE, MOBILE]], [\n /\\b(mi[-_ ]?(?:pad)(?:[\\w_ ]+))(?: bui|\\))/i // Mi Pad tablets\n ],[[MODEL, /_/g, ' '], [VENDOR, XIAOMI], [TYPE, TABLET]], [\n\n // OPPO\n /; (\\w+) bui.+ oppo/i,\n /\\b(cph[12]\\d{3}|p(?:af|c[al]|d\\w|e[ar])[mt]\\d0|x9007|a101op)\\b/i\n ], [MODEL, [VENDOR, 'OPPO'], [TYPE, MOBILE]], [\n\n // Vivo\n /vivo (\\w+)(?: bui|\\))/i,\n /\\b(v[12]\\d{3}\\w?[at])(?: bui|;)/i\n ], [MODEL, [VENDOR, 'Vivo'], [TYPE, MOBILE]], [\n\n // Realme\n /\\b(rmx[12]\\d{3})(?: bui|;|\\))/i\n ], [MODEL, [VENDOR, 'Realme'], [TYPE, MOBILE]], [\n\n // Motorola\n /\\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\\b[\\w ]+build\\//i,\n /\\bmot(?:orola)?[- ](\\w*)/i,\n /((?:moto[\\w\\(\\) ]+|xt\\d{3,4}|nexus 6)(?= bui|\\)))/i\n ], [MODEL, [VENDOR, MOTOROLA], [TYPE, MOBILE]], [\n /\\b(mz60\\d|xoom[2 ]{0,2}) build\\//i\n ], [MODEL, [VENDOR, MOTOROLA], [TYPE, TABLET]], [\n\n // LG\n /((?=lg)?[vl]k\\-?\\d{3}) bui| 3\\.[-\\w; ]{10}lg?-([06cv9]{3,4})/i\n ], [MODEL, [VENDOR, LG], [TYPE, TABLET]], [\n /(lm(?:-?f100[nv]?|-[\\w\\.]+)(?= bui|\\))|nexus [45])/i,\n /\\blg[-e;\\/ ]+((?!browser|netcast|android tv)\\w+)/i,\n /\\blg-?([\\d\\w]+) bui/i\n ], [MODEL, [VENDOR, LG], [TYPE, MOBILE]], [\n\n // Lenovo\n /(ideatab[-\\w ]+)/i,\n /lenovo ?(s[56]000[-\\w]+|tab(?:[\\w ]+)|yt[-\\d\\w]{6}|tb[-\\d\\w]{6})/i\n ], [MODEL, [VENDOR, 'Lenovo'], [TYPE, TABLET]], [\n\n // Nokia\n /(?:maemo|nokia).*(n900|lumia \\d+)/i,\n /nokia[-_ ]?([-\\w\\.]*)/i\n ], [[MODEL, /_/g, ' '], [VENDOR, 'Nokia'], [TYPE, MOBILE]], [\n\n // Google\n /(pixel c)\\b/i // Google Pixel C\n ], [MODEL, [VENDOR, GOOGLE], [TYPE, TABLET]], [\n /droid.+; (pixel[\\daxl ]{0,6})(?: bui|\\))/i // Google Pixel\n ], [MODEL, [VENDOR, GOOGLE], [TYPE, MOBILE]], [\n\n // Sony\n /droid.+ (a?\\d[0-2]{2}so|[c-g]\\d{4}|so[-gl]\\w+|xq-a\\w[4-7][12])(?= bui|\\).+chrome\\/(?![1-6]{0,1}\\d\\.))/i\n ], [MODEL, [VENDOR, SONY], [TYPE, MOBILE]], [\n /sony tablet [ps]/i,\n /\\b(?:sony)?sgp\\w+(?: bui|\\))/i\n ], [[MODEL, 'Xperia Tablet'], [VENDOR, SONY], [TYPE, TABLET]], [\n\n // OnePlus\n / (kb2005|in20[12]5|be20[12][59])\\b/i,\n /(?:one)?(?:plus)? (a\\d0\\d\\d)(?: b|\\))/i\n ], [MODEL, [VENDOR, 'OnePlus'], [TYPE, MOBILE]], [\n\n // Amazon\n /(alexa)webm/i,\n /(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\\))/i, // Kindle Fire without Silk / Echo Show\n /(kf[a-z]+)( bui|\\)).+silk\\//i // Kindle Fire HD\n ], [MODEL, [VENDOR, AMAZON], [TYPE, TABLET]], [\n /((?:sd|kf)[0349hijorstuw]+)( bui|\\)).+silk\\//i // Fire Phone\n ], [[MODEL, /(.+)/g, 'Fire Phone $1'], [VENDOR, AMAZON], [TYPE, MOBILE]], [\n\n // BlackBerry\n /(playbook);[-\\w\\),; ]+(rim)/i // BlackBerry PlayBook\n ], [MODEL, VENDOR, [TYPE, TABLET]], [\n /\\b((?:bb[a-f]|st[hv])100-\\d)/i,\n /\\(bb10; (\\w+)/i // BlackBerry 10\n ], [MODEL, [VENDOR, BLACKBERRY], [TYPE, MOBILE]], [\n\n // Asus\n /(?:\\b|asus_)(transfo[prime ]{4,10} \\w+|eeepc|slider \\w+|nexus 7|padfone|p00[cj])/i\n ], [MODEL, [VENDOR, ASUS], [TYPE, TABLET]], [\n / (z[bes]6[027][012][km][ls]|zenfone \\d\\w?)\\b/i\n ], [MODEL, [VENDOR, ASUS], [TYPE, MOBILE]], [\n\n // HTC\n /(nexus 9)/i // HTC Nexus 9\n ], [MODEL, [VENDOR, 'HTC'], [TYPE, TABLET]], [\n /(htc)[-;_ ]{1,2}([\\w ]+(?=\\)| bui)|\\w+)/i, // HTC\n\n // ZTE\n /(zte)[- ]([\\w ]+?)(?: bui|\\/|\\))/i,\n /(alcatel|geeksphone|nexian|panasonic(?!(?:;|\\.))|sony(?!-bra))[-_ ]?([-\\w]*)/i // Alcatel/GeeksPhone/Nexian/Panasonic/Sony\n ], [VENDOR, [MODEL, /_/g, ' '], [TYPE, MOBILE]], [\n\n // Acer\n /droid.+; ([ab][1-7]-?[0178a]\\d\\d?)/i\n ], [MODEL, [VENDOR, 'Acer'], [TYPE, TABLET]], [\n\n // Meizu\n /droid.+; (m[1-5] note) bui/i,\n /\\bmz-([-\\w]{2,})/i\n ], [MODEL, [VENDOR, 'Meizu'], [TYPE, MOBILE]], [\n\n // MIXED\n /(blackberry|benq|palm(?=\\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\\w]*)/i,\n // BlackBerry/BenQ/Palm/Sony-Ericsson/Acer/Asus/Dell/Meizu/Motorola/Polytron\n /(hp) ([\\w ]+\\w)/i, // HP iPAQ\n /(asus)-?(\\w+)/i, // Asus\n /(microsoft); (lumia[\\w ]+)/i, // Microsoft Lumia\n /(lenovo)[-_ ]?([-\\w]+)/i, // Lenovo\n /(jolla)/i, // Jolla\n /(oppo) ?([\\w ]+) bui/i // OPPO\n ], [VENDOR, MODEL, [TYPE, MOBILE]], [\n\n /(kobo)\\s(ereader|touch)/i, // Kobo\n /(archos) (gamepad2?)/i, // Archos\n /(hp).+(touchpad(?!.+tablet)|tablet)/i, // HP TouchPad\n /(kindle)\\/([\\w\\.]+)/i, // Kindle\n /(nook)[\\w ]+build\\/(\\w+)/i, // Nook\n /(dell) (strea[kpr\\d ]*[\\dko])/i, // Dell Streak\n /(le[- ]+pan)[- ]+(\\w{1,9}) bui/i, // Le Pan Tablets\n /(trinity)[- ]*(t\\d{3}) bui/i, // Trinity Tablets\n /(gigaset)[- ]+(q\\w{1,9}) bui/i, // Gigaset Tablets\n /(vodafone) ([\\w ]+)(?:\\)| bui)/i // Vodafone\n ], [VENDOR, MODEL, [TYPE, TABLET]], [\n\n /(surface duo)/i // Surface Duo\n ], [MODEL, [VENDOR, MICROSOFT], [TYPE, TABLET]], [\n /droid [\\d\\.]+; (fp\\du?)(?: b|\\))/i // Fairphone\n ], [MODEL, [VENDOR, 'Fairphone'], [TYPE, MOBILE]], [\n /(u304aa)/i // AT&T\n ], [MODEL, [VENDOR, 'AT&T'], [TYPE, MOBILE]], [\n /\\bsie-(\\w*)/i // Siemens\n ], [MODEL, [VENDOR, 'Siemens'], [TYPE, MOBILE]], [\n /\\b(rct\\w+) b/i // RCA Tablets\n ], [MODEL, [VENDOR, 'RCA'], [TYPE, TABLET]], [\n /\\b(venue[\\d ]{2,7}) b/i // Dell Venue Tablets\n ], [MODEL, [VENDOR, 'Dell'], [TYPE, TABLET]], [\n /\\b(q(?:mv|ta)\\w+) b/i // Verizon Tablet\n ], [MODEL, [VENDOR, 'Verizon'], [TYPE, TABLET]], [\n /\\b(?:barnes[& ]+noble |bn[rt])([\\w\\+ ]*) b/i // Barnes & Noble Tablet\n ], [MODEL, [VENDOR, 'Barnes & Noble'], [TYPE, TABLET]], [\n /\\b(tm\\d{3}\\w+) b/i\n ], [MODEL, [VENDOR, 'NuVision'], [TYPE, TABLET]], [\n /\\b(k88) b/i // ZTE K Series Tablet\n ], [MODEL, [VENDOR, 'ZTE'], [TYPE, TABLET]], [\n /\\b(nx\\d{3}j) b/i // ZTE Nubia\n ], [MODEL, [VENDOR, 'ZTE'], [TYPE, MOBILE]], [\n /\\b(gen\\d{3}) b.+49h/i // Swiss GEN Mobile\n ], [MODEL, [VENDOR, 'Swiss'], [TYPE, MOBILE]], [\n /\\b(zur\\d{3}) b/i // Swiss ZUR Tablet\n ], [MODEL, [VENDOR, 'Swiss'], [TYPE, TABLET]], [\n /\\b((zeki)?tb.*\\b) b/i // Zeki Tablets\n ], [MODEL, [VENDOR, 'Zeki'], [TYPE, TABLET]], [\n /\\b([yr]\\d{2}) b/i,\n /\\b(dragon[- ]+touch |dt)(\\w{5}) b/i // Dragon Touch Tablet\n ], [[VENDOR, 'Dragon Touch'], MODEL, [TYPE, TABLET]], [\n /\\b(ns-?\\w{0,9}) b/i // Insignia Tablets\n ], [MODEL, [VENDOR, 'Insignia'], [TYPE, TABLET]], [\n /\\b((nxa|next)-?\\w{0,9}) b/i // NextBook Tablets\n ], [MODEL, [VENDOR, 'NextBook'], [TYPE, TABLET]], [\n /\\b(xtreme\\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i // Voice Xtreme Phones\n ], [[VENDOR, 'Voice'], MODEL, [TYPE, MOBILE]], [\n /\\b(lvtel\\-)?(v1[12]) b/i // LvTel Phones\n ], [[VENDOR, 'LvTel'], MODEL, [TYPE, MOBILE]], [\n /\\b(ph-1) /i // Essential PH-1\n ], [MODEL, [VENDOR, 'Essential'], [TYPE, MOBILE]], [\n /\\b(v(100md|700na|7011|917g).*\\b) b/i // Envizen Tablets\n ], [MODEL, [VENDOR, 'Envizen'], [TYPE, TABLET]], [\n /\\b(trio[-\\w\\. ]+) b/i // MachSpeed Tablets\n ], [MODEL, [VENDOR, 'MachSpeed'], [TYPE, TABLET]], [\n /\\btu_(1491) b/i // Rotor Tablets\n ], [MODEL, [VENDOR, 'Rotor'], [TYPE, TABLET]], [\n /(shield[\\w ]+) b/i // Nvidia Shield Tablets\n ], [MODEL, [VENDOR, 'Nvidia'], [TYPE, TABLET]], [\n /(sprint) (\\w+)/i // Sprint Phones\n ], [VENDOR, MODEL, [TYPE, MOBILE]], [\n /(kin\\.[onetw]{3})/i // Microsoft Kin\n ], [[MODEL, /\\./g, ' '], [VENDOR, MICROSOFT], [TYPE, MOBILE]], [\n /droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\\)/i // Zebra\n ], [MODEL, [VENDOR, ZEBRA], [TYPE, TABLET]], [\n /droid.+; (ec30|ps20|tc[2-8]\\d[kx])\\)/i\n ], [MODEL, [VENDOR, ZEBRA], [TYPE, MOBILE]], [\n\n ///////////////////\n // SMARTTVS\n ///////////////////\n\n /smart-tv.+(samsung)/i // Samsung\n ], [VENDOR, [TYPE, SMARTTV]], [\n /hbbtv.+maple;(\\d+)/i\n ], [[MODEL, /^/, 'SmartTV'], [VENDOR, SAMSUNG], [TYPE, SMARTTV]], [\n /(nux; netcast.+smarttv|lg (netcast\\.tv-201\\d|android tv))/i // LG SmartTV\n ], [[VENDOR, LG], [TYPE, SMARTTV]], [\n /(apple) ?tv/i // Apple TV\n ], [VENDOR, [MODEL, APPLE+' TV'], [TYPE, SMARTTV]], [\n /crkey/i // Google Chromecast\n ], [[MODEL, CHROME+'cast'], [VENDOR, GOOGLE], [TYPE, SMARTTV]], [\n /droid.+aft(\\w)( bui|\\))/i // Fire TV\n ], [MODEL, [VENDOR, AMAZON], [TYPE, SMARTTV]], [\n /\\(dtv[\\);].+(aquos)/i,\n /(aquos-tv[\\w ]+)\\)/i // Sharp\n ], [MODEL, [VENDOR, SHARP], [TYPE, SMARTTV]],[\n /(bravia[\\w ]+)( bui|\\))/i // Sony\n ], [MODEL, [VENDOR, SONY], [TYPE, SMARTTV]], [\n /(mitv-\\w{5}) bui/i // Xiaomi\n ], [MODEL, [VENDOR, XIAOMI], [TYPE, SMARTTV]], [\n /Hbbtv.*(technisat) (.*);/i // TechniSAT\n ], [VENDOR, MODEL, [TYPE, SMARTTV]], [\n /\\b(roku)[\\dx]*[\\)\\/]((?:dvp-)?[\\d\\.]*)/i, // Roku\n /hbbtv\\/\\d+\\.\\d+\\.\\d+ +\\([\\w\\+ ]*; *([\\w\\d][^;]*);([^;]*)/i // HbbTV devices\n ], [[VENDOR, trim], [MODEL, trim], [TYPE, SMARTTV]], [\n /\\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\\b/i // SmartTV from Unidentified Vendors\n ], [[TYPE, SMARTTV]], [\n\n ///////////////////\n // CONSOLES\n ///////////////////\n\n /(ouya)/i, // Ouya\n /(nintendo) ([wids3utch]+)/i // Nintendo\n ], [VENDOR, MODEL, [TYPE, CONSOLE]], [\n /droid.+; (shield) bui/i // Nvidia\n ], [MODEL, [VENDOR, 'Nvidia'], [TYPE, CONSOLE]], [\n /(playstation [345portablevi]+)/i // Playstation\n ], [MODEL, [VENDOR, SONY], [TYPE, CONSOLE]], [\n /\\b(xbox(?: one)?(?!; xbox))[\\); ]/i // Microsoft Xbox\n ], [MODEL, [VENDOR, MICROSOFT], [TYPE, CONSOLE]], [\n\n ///////////////////\n // WEARABLES\n ///////////////////\n\n /((pebble))app/i // Pebble\n ], [VENDOR, MODEL, [TYPE, WEARABLE]], [\n /(watch)(?: ?os[,\\/]|\\d,\\d\\/)[\\d\\.]+/i // Apple Watch\n ], [MODEL, [VENDOR, APPLE], [TYPE, WEARABLE]], [\n /droid.+; (glass) \\d/i // Google Glass\n ], [MODEL, [VENDOR, GOOGLE], [TYPE, WEARABLE]], [\n /droid.+; (wt63?0{2,3})\\)/i\n ], [MODEL, [VENDOR, ZEBRA], [TYPE, WEARABLE]], [\n /(quest( 2| pro)?)/i // Oculus Quest\n ], [MODEL, [VENDOR, FACEBOOK], [TYPE, WEARABLE]], [\n\n ///////////////////\n // EMBEDDED\n ///////////////////\n\n /(tesla)(?: qtcarbrowser|\\/[-\\w\\.]+)/i // Tesla\n ], [VENDOR, [TYPE, EMBEDDED]], [\n /(aeobc)\\b/i // Echo Dot\n ], [MODEL, [VENDOR, AMAZON], [TYPE, EMBEDDED]], [\n\n ////////////////////\n // MIXED (GENERIC)\n ///////////////////\n\n /droid .+?; ([^;]+?)(?: bui|\\) applew).+? mobile safari/i // Android Phones from Unidentified Vendors\n ], [MODEL, [TYPE, MOBILE]], [\n /droid .+?; ([^;]+?)(?: bui|\\) applew).+?(?! mobile) safari/i // Android Tablets from Unidentified Vendors\n ], [MODEL, [TYPE, TABLET]], [\n /\\b((tablet|tab)[;\\/]|focus\\/\\d(?!.+mobile))/i // Unidentifiable Tablet\n ], [[TYPE, TABLET]], [\n /(phone|mobile(?:[;\\/]| [ \\w\\/\\.]*safari)|pda(?=.+windows ce))/i // Unidentifiable Mobile\n ], [[TYPE, MOBILE]], [\n /(android[-\\w\\. ]{0,9});.+buil/i // Generic Android Device\n ], [MODEL, [VENDOR, 'Generic']]\n ],\n\n engine : [[\n\n /windows.+ edge\\/([\\w\\.]+)/i // EdgeHTML\n ], [VERSION, [NAME, EDGE+'HTML']], [\n\n /webkit\\/537\\.36.+chrome\\/(?!27)([\\w\\.]+)/i // Blink\n ], [VERSION, [NAME, 'Blink']], [\n\n /(presto)\\/([\\w\\.]+)/i, // Presto\n /(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\\/([\\w\\.]+)/i, // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m/Goanna\n /ekioh(flow)\\/([\\w\\.]+)/i, // Flow\n /(khtml|tasman|links)[\\/ ]\\(?([\\w\\.]+)/i, // KHTML/Tasman/Links\n /(icab)[\\/ ]([23]\\.[\\d\\.]+)/i, // iCab\n /\\b(libweb)/i\n ], [NAME, VERSION], [\n\n /rv\\:([\\w\\.]{1,9})\\b.+(gecko)/i // Gecko\n ], [VERSION, NAME]\n ],\n\n os : [[\n\n // Windows\n /microsoft (windows) (vista|xp)/i // Windows (iTunes)\n ], [NAME, VERSION], [\n /(windows) nt 6\\.2; (arm)/i, // Windows RT\n /(windows (?:phone(?: os)?|mobile))[\\/ ]?([\\d\\.\\w ]*)/i, // Windows Phone\n /(windows)[\\/ ]?([ntce\\d\\. ]+\\w)(?!.+xbox)/i\n ], [NAME, [VERSION, strMapper, windowsVersionMap]], [\n /(win(?=3|9|n)|win 9x )([nt\\d\\.]+)/i\n ], [[NAME, 'Windows'], [VERSION, strMapper, windowsVersionMap]], [\n\n // iOS/macOS\n /ip[honead]{2,4}\\b(?:.*os ([\\w]+) like mac|; opera)/i, // iOS\n /ios;fbsv\\/([\\d\\.]+)/i,\n /cfnetwork\\/.+darwin/i\n ], [[VERSION, /_/g, '.'], [NAME, 'iOS']], [\n /(mac os x) ?([\\w\\. ]*)/i,\n /(macintosh|mac_powerpc\\b)(?!.+haiku)/i // Mac OS\n ], [[NAME, MAC_OS], [VERSION, /_/g, '.']], [\n\n // Mobile OSes\n /droid ([\\w\\.]+)\\b.+(android[- ]x86|harmonyos)/i // Android-x86/HarmonyOS\n ], [VERSION, NAME], [ // Android/WebOS/QNX/Bada/RIM/Maemo/MeeGo/Sailfish OS\n /(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\\/ ]?([\\w\\.]*)/i,\n /(blackberry)\\w*\\/([\\w\\.]*)/i, // Blackberry\n /(tizen|kaios)[\\/ ]([\\w\\.]+)/i, // Tizen/KaiOS\n /\\((series40);/i // Series 40\n ], [NAME, VERSION], [\n /\\(bb(10);/i // BlackBerry 10\n ], [VERSION, [NAME, BLACKBERRY]], [\n /(?:symbian ?os|symbos|s60(?=;)|series60)[-\\/ ]?([\\w\\.]*)/i // Symbian\n ], [VERSION, [NAME, 'Symbian']], [\n /mozilla\\/[\\d\\.]+ \\((?:mobile|tablet|tv|mobile; [\\w ]+); rv:.+ gecko\\/([\\w\\.]+)/i // Firefox OS\n ], [VERSION, [NAME, FIREFOX+' OS']], [\n /web0s;.+rt(tv)/i,\n /\\b(?:hp)?wos(?:browser)?\\/([\\w\\.]+)/i // WebOS\n ], [VERSION, [NAME, 'webOS']], [\n /watch(?: ?os[,\\/]|\\d,\\d\\/)([\\d\\.]+)/i // watchOS\n ], [VERSION, [NAME, 'watchOS']], [\n\n // Google Chromecast\n /crkey\\/([\\d\\.]+)/i // Google Chromecast\n ], [VERSION, [NAME, CHROME+'cast']], [\n /(cros) [\\w]+(?:\\)| ([\\w\\.]+)\\b)/i // Chromium OS\n ], [[NAME, CHROMIUM_OS], VERSION],[\n\n // Smart TVs\n /panasonic;(viera)/i, // Panasonic Viera\n /(netrange)mmh/i, // Netrange\n /(nettv)\\/(\\d+\\.[\\w\\.]+)/i, // NetTV\n\n // Console\n /(nintendo|playstation) ([wids345portablevuch]+)/i, // Nintendo/Playstation\n /(xbox); +xbox ([^\\);]+)/i, // Microsoft Xbox (360, One, X, S, Series X, Series S)\n\n // Other\n /\\b(joli|palm)\\b ?(?:os)?\\/?([\\w\\.]*)/i, // Joli/Palm\n /(mint)[\\/\\(\\) ]?(\\w*)/i, // Mint\n /(mageia|vectorlinux)[; ]/i, // Mageia/VectorLinux\n /([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\\/ ]?(?!chrom|package)([-\\w\\.]*)/i,\n // Ubuntu/Debian/SUSE/Gentoo/Arch/Slackware/Fedora/Mandriva/CentOS/PCLinuxOS/RedHat/Zenwalk/Linpus/Raspbian/Plan9/Minix/RISCOS/Contiki/Deepin/Manjaro/elementary/Sabayon/Linspire\n /(hurd|linux) ?([\\w\\.]*)/i, // Hurd/Linux\n /(gnu) ?([\\w\\.]*)/i, // GNU\n /\\b([-frentopcghs]{0,5}bsd|dragonfly)[\\/ ]?(?!amd|[ix346]{1,2}86)([\\w\\.]*)/i, // FreeBSD/NetBSD/OpenBSD/PC-BSD/GhostBSD/DragonFly\n /(haiku) (\\w+)/i // Haiku\n ], [NAME, VERSION], [\n /(sunos) ?([\\w\\.\\d]*)/i // Solaris\n ], [[NAME, 'Solaris'], VERSION], [\n /((?:open)?solaris)[-\\/ ]?([\\w\\.]*)/i, // Solaris\n /(aix) ((\\d)(?=\\.|\\)| )[\\w\\.])*/i, // AIX\n /\\b(beos|os\\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i, // BeOS/OS2/AmigaOS/MorphOS/OpenVMS/Fuchsia/HP-UX/SerenityOS\n /(unix) ?([\\w\\.]*)/i // UNIX\n ], [NAME, VERSION]\n ]\n };\n\n /////////////////\n // Constructor\n ////////////////\n\n var UAParser = function (ua, extensions) {\n\n if (typeof ua === OBJ_TYPE) {\n extensions = ua;\n ua = undefined;\n }\n\n if (!(this instanceof UAParser)) {\n return new UAParser(ua, extensions).getResult();\n }\n\n var _navigator = (typeof window !== UNDEF_TYPE && window.navigator) ? window.navigator : undefined;\n var _ua = ua || ((_navigator && _navigator.userAgent) ? _navigator.userAgent : EMPTY);\n var _uach = (_navigator && _navigator.userAgentData) ? _navigator.userAgentData : undefined;\n var _rgxmap = extensions ? extend(regexes, extensions) : regexes;\n var _isSelfNav = _navigator && _navigator.userAgent == _ua;\n\n this.getBrowser = function () {\n var _browser = {};\n _browser[NAME] = undefined;\n _browser[VERSION] = undefined;\n rgxMapper.call(_browser, _ua, _rgxmap.browser);\n _browser[MAJOR] = majorize(_browser[VERSION]);\n // Brave-specific detection\n if (_isSelfNav && _navigator && _navigator.brave && typeof _navigator.brave.isBrave == FUNC_TYPE) {\n _browser[NAME] = 'Brave';\n }\n return _browser;\n };\n this.getCPU = function () {\n var _cpu = {};\n _cpu[ARCHITECTURE] = undefined;\n rgxMapper.call(_cpu, _ua, _rgxmap.cpu);\n return _cpu;\n };\n this.getDevice = function () {\n var _device = {};\n _device[VENDOR] = undefined;\n _device[MODEL] = undefined;\n _device[TYPE] = undefined;\n rgxMapper.call(_device, _ua, _rgxmap.device);\n if (_isSelfNav && !_device[TYPE] && _uach && _uach.mobile) {\n _device[TYPE] = MOBILE;\n }\n // iPadOS-specific detection: identified as Mac, but has some iOS-only properties\n if (_isSelfNav && _device[MODEL] == 'Macintosh' && _navigator && typeof _navigator.standalone !== UNDEF_TYPE && _navigator.maxTouchPoints && _navigator.maxTouchPoints > 2) {\n _device[MODEL] = 'iPad';\n _device[TYPE] = TABLET;\n }\n return _device;\n };\n this.getEngine = function () {\n var _engine = {};\n _engine[NAME] = undefined;\n _engine[VERSION] = undefined;\n rgxMapper.call(_engine, _ua, _rgxmap.engine);\n return _engine;\n };\n this.getOS = function () {\n var _os = {};\n _os[NAME] = undefined;\n _os[VERSION] = undefined;\n rgxMapper.call(_os, _ua, _rgxmap.os);\n if (_isSelfNav && !_os[NAME] && _uach && _uach.platform != 'Unknown') {\n _os[NAME] = _uach.platform \n .replace(/chrome os/i, CHROMIUM_OS)\n .replace(/macos/i, MAC_OS); // backward compatibility\n }\n return _os;\n };\n this.getResult = function () {\n return {\n ua : this.getUA(),\n browser : this.getBrowser(),\n engine : this.getEngine(),\n os : this.getOS(),\n device : this.getDevice(),\n cpu : this.getCPU()\n };\n };\n this.getUA = function () {\n return _ua;\n };\n this.setUA = function (ua) {\n _ua = (typeof ua === STR_TYPE && ua.length > UA_MAX_LENGTH) ? trim(ua, UA_MAX_LENGTH) : ua;\n return this;\n };\n this.setUA(_ua);\n return this;\n };\n\n UAParser.VERSION = LIBVERSION;\n UAParser.BROWSER = enumerize([NAME, VERSION, MAJOR]);\n UAParser.CPU = enumerize([ARCHITECTURE]);\n UAParser.DEVICE = enumerize([MODEL, VENDOR, TYPE, CONSOLE, MOBILE, SMARTTV, TABLET, WEARABLE, EMBEDDED]);\n UAParser.ENGINE = UAParser.OS = enumerize([NAME, VERSION]);\n\n ///////////\n // Export\n //////////\n\n // check js environment\n if (typeof(exports) !== UNDEF_TYPE) {\n // nodejs env\n if (typeof module !== UNDEF_TYPE && module.exports) {\n exports = module.exports = UAParser;\n }\n exports.UAParser = UAParser;\n } else {\n // requirejs env (optional)\n if (typeof(define) === FUNC_TYPE && define.amd) {\n define(function () {\n return UAParser;\n });\n } else if (typeof window !== UNDEF_TYPE) {\n // browser env\n window.UAParser = UAParser;\n }\n }\n\n // jQuery/Zepto specific (optional)\n // Note:\n // In AMD env the global scope should be kept clean, but jQuery is an exception.\n // jQuery always exports to global scope, unless jQuery.noConflict(true) is used,\n // and we should catch that.\n var $ = typeof window !== UNDEF_TYPE && (window.jQuery || window.Zepto);\n if ($ && !$.ua) {\n var parser = new UAParser();\n $.ua = parser.getResult();\n $.ua.get = function () {\n return parser.getUA();\n };\n $.ua.set = function (ua) {\n parser.setUA(ua);\n var result = parser.getResult();\n for (var prop in result) {\n $.ua[prop] = result[prop];\n }\n };\n }\n\n})(typeof window === 'object' ? window : this);\n","var __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => {\n __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n return value;\n};\nimport UAParser from \"ua-parser-js\";\nconst Browser = {\n UNKNOWN: \"Unknown\",\n SAFARI: \"Safari\",\n FIREFOX: \"Firefox\",\n OPERA: \"Opera\",\n CHROME: \"Chrome\",\n IOS_WEBVIEW: \"iOS-webview\"\n};\nclass BrowserUtils {\n static getName() {\n if (!this._name) {\n if (typeof navigator === \"undefined\" || !navigator) {\n this._name = Browser.UNKNOWN;\n } else {\n const { userAgent } = navigator;\n if (userAgent.match(/Firefox/i)) {\n this._name = Browser.FIREFOX;\n } else if (userAgent.match(/(Opera|OPR)/i)) {\n this._name = Browser.OPERA;\n } else if (userAgent.match(/Chrome/i)) {\n this._name = Browser.CHROME;\n } else if (userAgent.match(/Safari/i)) {\n this._name = Browser.SAFARI;\n } else if (userAgent.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Version)/i)) {\n this._name = Browser.IOS_WEBVIEW;\n } else {\n this._name = Browser.UNKNOWN;\n }\n }\n }\n return this._name;\n }\n static get isMobile() {\n if (this._isMobile === null) {\n this._isMobile = false;\n if (typeof navigator !== \"undefined\" && navigator) {\n const userAgent = navigator.userAgent || navigator.vendor;\n if (userAgent && (/(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(userAgent) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(userAgent.substr(0, 4)))) {\n this._isMobile = true;\n }\n }\n }\n return this._isMobile;\n }\n static clearCache() {\n this._name = null;\n this._isMobile = null;\n }\n}\n__publicField(BrowserUtils, \"_name\", null);\n__publicField(BrowserUtils, \"_isMobile\", null);\nconst QUALITATIVE_COLORS = [\n 4215763,\n 14529296,\n 11869460,\n 48895,\n 16468400,\n 45661,\n 13290186\n];\nfunction getQualitativeColor(number) {\n return QUALITATIVE_COLORS[number % QUALITATIVE_COLORS.length];\n}\nconst ColorUtils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({\n __proto__: null,\n getQualitativeColor\n}, Symbol.toStringTag, { value: \"Module\" }));\nfunction getDeviceFromUserAgent() {\n const info = new UAParser().getResult();\n if (!info) {\n return null;\n }\n const res = {\n vendor: info.device.vendor,\n model: info.device.model\n };\n if (!res.vendor && !res.model && info.os.name === \"Mac OS\") {\n res.vendor = \"Apple\";\n res.model = \"Mac\";\n }\n return res;\n}\nconst UserAgentUtils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({\n __proto__: null,\n getDeviceFromUserAgent\n}, Symbol.toStringTag, { value: \"Module\" }));\nfunction any(promises) {\n return new Promise((resolve, reject) => {\n let count = promises.length, resolved = false;\n const reasons = [];\n promises.forEach((p) => {\n Promise.resolve(p).then((value) => {\n resolved = true;\n count--;\n resolve(value);\n }, (reason) => {\n count--;\n reasons.push(reason);\n if (count === 0 && !resolved) {\n reject(new Error(reasons.join(\"\\n\")));\n }\n });\n });\n });\n}\nconst PromiseUtils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({\n __proto__: null,\n any\n}, Symbol.toStringTag, { value: \"Module\" }));\nfunction generateString(strLength) {\n return Math.random().toString(36).substring(2, strLength + 2);\n}\nconst RandomUtils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({\n __proto__: null,\n generateString\n}, Symbol.toStringTag, { value: \"Module\" }));\nfunction formatSO(value, ...xargs) {\n let str = value.toString();\n if (xargs.length) {\n const t = typeof xargs[0];\n const args = t === \"string\" || t === \"number\" ? xargs.slice() : xargs[0];\n for (const key in args) {\n str = str.replace(new RegExp(\"\\\\{\" + key + \"\\\\}\", \"gi\"), args[key]);\n }\n }\n return str;\n}\nfunction toUpperCase(str) {\n return str.toUpperCase();\n}\nconst StringUtils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({\n __proto__: null,\n formatSO,\n toUpperCase\n}, Symbol.toStringTag, { value: \"Module\" }));\nfunction preciseTime() {\n if (typeof window !== \"undefined\" && window.performance) {\n return window.performance.now();\n }\n const hrtime = process.hrtime();\n return Math.round(hrtime[0] * 1e3 + hrtime[1] / 1e6);\n}\nfunction unixTimestampToPreciseTime(timestamp) {\n return preciseTime() + timestamp - (/* @__PURE__ */ new Date()).getTime();\n}\nfunction preciseTimeToUnixTimestamp(_preciseTime) {\n return (/* @__PURE__ */ new Date()).getTime() + _preciseTime - preciseTime();\n}\nconst TimeUtils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({\n __proto__: null,\n preciseTime,\n preciseTimeToUnixTimestamp,\n unixTimestampToPreciseTime\n}, Symbol.toStringTag, { value: \"Module\" }));\nexport {\n Browser,\n BrowserUtils,\n ColorUtils,\n PromiseUtils,\n RandomUtils,\n StringUtils,\n TimeUtils,\n UserAgentUtils\n};\n//# sourceMappingURL=index.mjs.map\n","import { type EdgeSmoothness, type EdgeSurface } from './Edge.js';\n\nexport type ProfileType = 'wheelchair' | 'default';\n\nexport const SPEEDS = {\n DEFAULT: 4,\n WHEELCHAIR: 3\n} as const;\n\nexport const SMOOTHNESS_FACTORS: Record<ProfileType, Record<EdgeSmoothness, number>> = {\n wheelchair: {\n horrible: 0.1,\n bad: 0.5,\n intermediate: 0.7,\n good: 0.9,\n excellent: 1.0\n },\n default: {\n horrible: 0.4,\n bad: 0.7,\n intermediate: 0.8,\n good: 0.9,\n excellent: 1.0\n }\n};\n\nexport const SURFACE_FACTORS: Record<ProfileType, Record<EdgeSurface, number>> = {\n wheelchair: {\n asphalt: 1.0, // Smooth, ideal surface\n concrete: 1.0, // Equally good as asphalt, but slightly slower\n paved: 1.0, // Paved surface - ideal for wheelchairs\n paving_stones: 0.8, // Slightly slower due to joints/gaps\n compacted: 0.7, // Well-compacted surfaces like crushed stone\n wood: 0.6, // Boardwalks - can be uneven and slippery when wet\n metal: 0.5, // Metal gratings - challenging for wheels\n gravel: 0.3, // Very difficult for wheelchairs\n grass: 0.2, // Very challenging - soft and uneven\n ground: 0.2 // Unpaved/natural ground - very difficult\n },\n default: {\n asphalt: 1.0, // Ideal walking surface\n concrete: 1.0, // Equally good as asphalt\n paved: 1.0, // Paved surface - ideal for wheelchairs\n paving_stones: 0.9, // Slightly slower but good for walking\n compacted: 0.8, // Still good for walking\n wood: 0.8, // Good when dry, slower when wet\n metal: 0.7, // Requires more attention\n gravel: 0.6, // Slower but manageable\n grass: 0.5, // Significantly slower\n ground: 0.4 // Unpaved/natural - requires more effort\n }\n}; ","import Edge from './Edge.js';\nimport Vertex from './Vertex.js';\n\nimport { getDurationFromLength } from '../Utils.js';\nimport { GraphRouterOptionsJson, type GraphRouterOptions } from './GraphRouterOptions.js';\nimport { SMOOTHNESS_FACTORS, SURFACE_FACTORS, SPEEDS, type ProfileType } from './GraphRouterOptionsFactors.js';\n\nexport default class GraphRouterOptionsBuilder {\n\n public avoidStairs = false;\n public avoidEscalators = false;\n public avoidElevators = false;\n public avoidMovingWalkways = false;\n public avoidTicketRestrictedAreas = false;\n public useMultiLevelSegments = false;\n public projectionMaxDistance?: number;\n public isWheelchair = false;\n \n static DEFAULT = new GraphRouterOptionsBuilder().build();\n static WITHOUT_STAIRS = new GraphRouterOptionsBuilder().setAvoidStairs(true).build();\n static WHEELCHAIR = new GraphRouterOptionsBuilder().setIsWheelchair(true).build();\n\n setAvoidStairs(avoidStairs: boolean) {\n this.avoidStairs = avoidStairs;\n return this;\n }\n\n setAvoidEscalators(avoidEscalators: boolean) {\n this.avoidEscalators = avoidEscalators;\n return this;\n }\n\n setAvoidElevators(avoidElevators: boolean) {\n this.avoidElevators = avoidElevators;\n return this;\n }\n\n setAvoidMovingWalkways(avoidMovingWalkways: boolean) {\n this.avoidMovingWalkways = avoidMovingWalkways;\n return this;\n }\n\n setAvoidTicketRestrictedAreas(avoidTicketRestrictedAreas: boolean) {\n this.avoidTicketRestrictedAreas = avoidTicketRestrictedAreas;\n return this;\n }\n\n setUseMultiLevelSegments(useMultiLevelSegments: boolean) {\n this.useMultiLevelSegments = useMultiLevelSegments;\n return this;\n }\n\n setIsWheelchair(isWheelchair: boolean) {\n this.isWheelchair = isWheelchair;\n return this;\n }\n\n static fromJson(options: GraphRouterOptionsJson) {\n const builder = new GraphRouterOptionsBuilder();\n Object.assign(builder, options);\n return builder.build();\n }\n\n build(): GraphRouterOptions {\n\n const weightEdgeFn = (edge: Edge) => {\n if (edge.properties.isElevator) {\n return 90;\n }\n const speed = this.isWheelchair ? SPEEDS.WHEELCHAIR : SPEEDS.DEFAULT;\n let duration = getDurationFromLength(edge.length, speed);\n if (edge.properties.areStairs) {\n duration *= 3;\n } \n else if (edge.properties.areEscalators) {\n duration *= 1.5;\n } \n else if (edge.properties.isMovingWalkway) {\n duration *= 0.8;\n }\n else if (edge.properties.smoothness) {\n const profile: ProfileType = this.isWheelchair ? 'wheelchair' : 'default';\n const factor = SMOOTHNESS_FACTORS[profile][edge.properties.smoothness] ?? 1;\n duration *= factor;\n } else if (edge.properties.surface) {\n const profile: ProfileType = this.isWheelchair ? 'wheelchair' : 'default';\n const factor = SURFACE_FACTORS[profile][edge.properties.surface] ?? 1;\n duration *= factor;\n } else if (edge.properties.wheelchair === 'limited') {\n duration *= 0.5;\n }\n\n return duration;\n }\n\n const weightVertexFn = (vertex: Vertex) => {\n if (vertex.properties.isTurnstile) {\n return 10;\n }\n return 0;\n }\n\n const acceptEdgeFn = (edge: Edge) => {\n\n // Wheelchair handling\n if (edge.properties.wheelchair) {\n if (this.isWheelchair && edge.properties.wheelchair === 'no') return false;\n if (!this.isWheelchair && edge.properties.wheelchair === 'designated') return false;\n }\n if (this.isWheelchair) {\n if (edge.properties.areStairs) return false;\n if (edge.properties.areEscalators) return false;\n if (edge.properties.isMovingWalkway) return false;\n }\n\n if (this.avoidStairs && edge.properties.areStairs) return false;\n if (this.avoidEscalators && edge.properties.areEscalators) return false;\n if (this.avoidElevators && edge.properties.isElevator) return false;\n if (this.avoidMovingWalkways && edge.properties.isMovingWalkway) return false;\n if (this.avoidTicketRestrictedAreas && edge.properties.needTicket) return false;\n \n return true;\n };\n\n return {\n input: {\n avoidStairs: this.avoidStairs,\n avoidEscalators: this.avoidEscalators,\n avoidElevators: this.avoidElevators,\n avoidMovingWalkways: this.avoidMovingWalkways,\n avoidTicketRestrictedAreas: this.avoidTicketRestrictedAreas,\n isWheelchair: this.isWheelchair,\n projectionMaxDistance: this.projectionMaxDistance\n },\n weightEdgeFn,\n weightVertexFn,\n acceptEdgeFn,\n projectionMaxDistance: this.projectionMaxDistance,\n useMultiLevelSegments: this.useMultiLevelSegments\n };\n }\n\n}\n","\nimport { ColorUtils } from '@wemap/utils';\nimport Edge from './Edge.js';\nimport Graph from './Graph.js';\nimport GraphRoute from './GraphRoute.js';\nimport { type GraphRouterOptions } from './GraphRouterOptions.js';\nimport GraphRouterOptionsBuilder from './GraphRouterOptionsBuilder.js';\nimport Vertex from './Vertex.js';\n\nexport class GraphRouterEngineResults {\n constructor(\n public prev: Array<Vertex | null>,\n public dist: number[],\n public source: Vertex,\n public targets: Vertex[],\n public edges: Edge[]\n ) { }\n\n routeVertices(to = this.targets[0], list: Vertex[] = []): Vertex[] {\n const last = this.prev[to.id];\n if (last === null) return this.source === to ? [...list, to] : [];\n return [...this.routeVertices(last, list), to];\n }\n\n weightedDistance(to = this.targets[0]) {\n const distance = this.dist[to.id];\n return distance === Number.MAX_VALUE ? null : distance;\n }\n\n route(to = this.targets[0]) {\n\n const path = this.routeVertices(to);\n\n const edges = [];\n const edgesWeights = [];\n for (let i = 1; i < path.length; i++) {\n const v1 = path[i - 1];\n const v2 = path[i];\n const graphEdge = Edge.getEdgeByVertices(this.edges, v1, v2)!;\n const clonedEdge = new Edge(v1, v2, Object.assign({}, graphEdge.properties));\n const isReversed = graphEdge.vertex1 === clonedEdge.vertex2;\n if (isReversed) {\n clonedEdge.reverseProperties();\n }\n edges.push(clonedEdge);\n edgesWeights.push(this.dist[v2.id] - this.dist[v1.id]);\n }\n return new GraphRoute(this.source.coords, to.coords, path, edges, edgesWeights);\n }\n\n toGeoJson(graph: Graph) {\n return {\n type: \"FeatureCollection\",\n features: [\n ...graph.vertices.map(v => {\n const prev = this.prev[v.id];\n const dist = this.dist[v.id];\n const isSource = v === this.source;\n const isTarget = this.targets.includes(v);\n const level = v.coords.level;\n return {\n type: \"Feature\",\n properties: {\n id: v.id,\n ...(prev && { prev: prev.id }),\n dist: dist === Number.MAX_VALUE ? 'infinity' : dist,\n ...(isSource && { name: 'source' }),\n ...(isTarget && { name: 'target' }),\n ...(level !== null && { level }),\n ...v.properties\n },\n geometry: {\n type: 'Point',\n coordinates: [v.coords.lng, v.coords.lat]\n }\n }\n }),\n ...graph.edges.map(e => {\n const level = e.level;\n return {\n type: \"Feature\",\n properties: {\n id: e.id,\n ...(level !== null && { level }),\n ...e.properties\n },\n geometry: {\n type: 'LineString',\n coordinates: [\n [e.vertex1.coords.lng, e.vertex1.coords.lat],\n [e.vertex2.coords.lng, e.vertex2.coords.lat]\n ]\n }\n }\n })\n ]\n };\n }\n}\n\nexport default class GraphRouterEngine {\n\n disabledEdges: Set<Edge> = new Set();\n\n constructor(public readonly graph: Graph) {\n let vertexId = 0;\n graph.vertices.forEach(vertex => vertex.id = vertexId++);\n }\n\n calculateShortestPathToMultipleDestinationsByVertex(\n source: Vertex,\n targets: Vertex[],\n options: GraphRouterOptions = GraphRouterOptionsBuilder.DEFAULT,\n inputVertices = this.graph.vertices,\n inputEdges = this.graph.edges\n ): GraphRouterEngineResults {\n\n const q = new Set(inputVertices);\n const dist = Array(q.size).fill(Number.MAX_VALUE);\n const prev = new Array<Vertex | null>(q.size).fill(null);\n const edges = inputEdges.filter(e => (options.acceptEdgeFn?.(e) ?? true) && !this.disabledEdges.has(e));\n const weightEdgeFn = options.weightEdgeFn || ((edge: Edge) => edge.length);\n const weightVertexFn = options.weightVertexFn || ((vertex: Vertex) => 0);\n\n const getVertexWithMinDistance = (vertices: Set<Vertex>): Vertex | null => {\n let minDistance = Number.MAX_VALUE;\n let vertex: Vertex | null = null;\n vertices.forEach(_vertex => {\n const distance = dist[_vertex.id];\n if (distance <= minDistance) {\n minDistance = distance;\n vertex = _vertex;\n }\n });\n return vertex;\n }\n\n\n const remainingNodesToFind = new Set(targets);\n\n dist[source.id] = 0;\n\n while (q.size > 0) {\n const u = getVertexWithMinDistance(q)!;\n q.delete(u);\n\n if (targets.includes(u)) {\n remainingNodesToFind.delete(u);\n if (remainingNodesToFind.size === 0) {\n break;\n }\n }\n\n edges\n .filter(edge => edge.vertex1 == u || !edge.properties.isOneway && edge.vertex2 == u)\n .forEach(edge => {\n const v = u === edge.vertex1 ? edge.vertex2 : edge.vertex1;\n const distance = weightEdgeFn(edge) + weightVertexFn(v);\n const alt = dist[u.id] + distance;\n if (alt < dist[v.id]) {\n dist[v.id] = alt;\n prev[v.id] = u\n }\n });\n }\n\n return new GraphRouterEngineResults(prev, dist, source, targets, edges);\n }\n\n calculateShortestPathByVertex(\n source: Vertex,\n target: Vertex,\n options: GraphRouterOptions = GraphRouterOptionsBuilder.DEFAULT,\n inputVertices = this.graph.vertices,\n inputEdges = this.graph.edges\n ): GraphRouterEngineResults {\n return this.calculateShortestPathToMultipleDestinationsByVertex(source, [target], options, inputVertices, inputEdges);\n }\n\n // https://en.wikipedia.org/wiki/Component_(graph_theory)\n calculateComponents() {\n\n function shiftSet<T>(set: Set<T>): T {\n const firstValue = set.values().next().value as T;\n set.delete(firstValue);\n return firstValue;\n }\n\n const verticesToTest = new Set<Vertex>(this.graph.vertices);\n let components: Vertex[][] = [];\n\n while (verticesToTest.size > 0) {\n const vertexToTest = shiftSet(verticesToTest);\n const otherVertices = this.graph.vertices.filter(v => v.id !== vertexToTest.id);\n const result = this.calculateShortestPathToMultipleDestinationsByVertex(vertexToTest, otherVertices);\n const reachedVertices = otherVertices.filter(ov => result.weightedDistance(ov) !== null);\n\n components.push([vertexToTest, ...reachedVertices]);\n reachedVertices.forEach(rv => verticesToTest.delete(rv));\n }\n\n // As graph is ordered, fuse components with same vertices\n let hasChanged;\n do {\n hasChanged = false;\n for (let i = 0; i < components.length - 1; i++) {\n const component1 = components[i];\n for (let j = i + 1; j < components.length; j++) {\n const component2 = components[j];\n const componentsIntersect = component2.some(v => component1.includes(v));\n if (componentsIntersect) {\n component1.push(...component2);\n components = components.filter(component => component !== component2);\n hasChanged = true;\n }\n }\n }\n } while (hasChanged)\n\n return components.map(c => [... new Set(c)]);\n }\n\n toGeoJson() {\n const components = this.calculateComponents();\n const features = components.map((component, i) => {\n const edges = this.graph.edges.filter(edge => component.includes(edge.vertex1) && component.includes(edge.vertex2));\n return {\n \"type\": \"Feature\",\n \"geometry\": {\n \"type\": \"MultiLineString\",\n \"coordinates\":\n edges.map(e => [\n [e.vertex1.coords.lng, e.vertex1.coords.lat],\n [e.vertex2.coords.lng, e.vertex2.coords.lat],\n ])\n },\n \"properties\": {\n \"stroke\": '#' + ColorUtils.getQualitativeColor(i).toString(16)\n }\n }\n });\n\n return {\n \"type\": \"FeatureCollection\",\n \"features\": features\n };\n }\n\n}\n","import salesman from '@wemap/salesman.js';\n\nimport { Coordinates } from '@wemap/geo';\n\nimport Vertex from './Vertex.js';\nimport Edge, { EdgeProperties } from './Edge.js';\nimport GraphRoute from './GraphRoute.js';\nimport GraphRouterEngine, { GraphRouterEngineResults } from './GraphRouterEngine.js';\nimport { type GraphRouterOptions } from './GraphRouterOptions.js';\nimport GraphRouterOptionsBuilder from './GraphRouterOptionsBuilder.js';\n\nexport class GraphRouterResults extends GraphRouterEngineResults {\n\n constructor(\n engineResults: GraphRouterEngineResults,\n public sourceProjection: [Coordinates, Vertex | null],\n public targetsProjections: [Coordinates, Vertex | null][]\n\n ) {\n super(engineResults.prev, engineResults.dist, engineResults.source, engineResults.targets, engineResults.edges);\n }\n\n static createEmpty(source: Coordinates, targets: Coordinates[]) {\n const length = targets.length;\n const engineResults = new GraphRouterEngineResults(\n new Array(length).fill(null),\n new Array(length).fill(Number.MAX_VALUE),\n new Vertex(source),\n targets.map(target => new Vertex(target)),\n []\n );\n const sourceProjection: [Coordinates, null] = [source, null];\n const targetsProjections: [Coordinates, null][] = targets.map(target => [target, null]);\n return new GraphRouterResults(engineResults, sourceProjection, targetsProjections);\n }\n\n routeVertices(to: Coordinates | Vertex = this.targetsProjections[0][0]): Vertex[] {\n\n if (to instanceof Vertex) {\n return super.routeVertices(to);\n }\n\n const sourceVertex = this.sourceProjection[1];\n if (!sourceVertex) return [];\n\n const toVertex = this.targetsProjections.find(([coord]) => coord === to)?.[1];\n if (!toVertex) return [];\n\n return super.routeVertices(toVertex);\n }\n\n weightedDistance(to: Coordinates | Vertex = this.targetsProjections[0][0]) {\n\n if (to instanceof Vertex) {\n return super.weightedDistance(to);\n }\n\n const sourceVertex = this.sourceProjection[1];\n if (!sourceVertex) return null;\n\n const toVertex = this.targetsProjections.find(([coord]) => coord === to)?.[1];\n if (!toVertex) return null;\n\n return super.weightedDistance(toVertex);\n }\n\n route(to: Coordinates | Vertex = this.targetsProjections[0][0]) {\n\n if (to instanceof Vertex) {\n return super.route(to);\n }\n\n const toVertex = this.targetsProjections.find(([coord]) => coord === to)?.[1];\n if (!toVertex) return new GraphRoute(this.sourceProjection[0], to, [], [], []);\n\n const route = super.route(toVertex);\n route.start = this.sourceProjection[0];\n route.end = to;\n return route;\n }\n}\n\n\nclass GraphRouter extends GraphRouterEngine {\n\n calculateShortestPathToMultipleDestinations(\n source: Coordinates,\n targets: Coordinates[],\n options: GraphRouterOptions = GraphRouterOptionsBuilder.DEFAULT,\n ): GraphRouterResults {\n\n const createdVertices = new Set<Vertex>();\n const createdEdges = new Set<Edge>();\n const createdVerticesByOriginalEdges: [Edge, Vertex[]][] = []\n\n const projectionsOptions = {\n maxDistance: options.projectionMaxDistance,\n acceptEdgeFn: options.acceptEdgeFn,\n useMultiLevelSegments: options.useMultiLevelSegments,\n };\n\n const getOrCreateVertex = (coords: Coordinates): Vertex | null => {\n const projection = this.graph.getProjection(coords, projectionsOptions);\n if (projection === null) return null;\n if (projection.nearestElement instanceof Vertex) {\n return projection.nearestElement;\n }\n if (projection.nearestElement instanceof Edge) {\n const edge = projection.nearestElement;\n const newVertex = new Vertex(projection.coords, {\n name: `proj on ${edge.properties.name || null} (tmp)`,\n ...(typeof edge.properties.externalId !== 'undefined' && { externalId: edge.properties.externalId })\n });\n newVertex.id = this.graph.vertices.length + createdVertices.size;\n const newEdgesOptions: EdgeProperties = {\n ...edge.properties,\n ...(typeof edge.properties.externalId !== 'undefined' && { externalId: edge.properties.externalId })\n };\n const newEdge1 = new Edge(edge.vertex1, newVertex, newEdgesOptions);\n const newEdge2 = new Edge(newVertex, edge.vertex2, newEdgesOptions);\n\n createdVertices.add(newVertex);\n createdEdges.add(newEdge1);\n createdEdges.add(newEdge2);\n\n const createdVerticesByOriginalEdge = createdVerticesByOriginalEdges.find(p => p[0] === edge)\n if (!createdVerticesByOriginalEdge) {\n createdVerticesByOriginalEdges.push([edge, [newVertex]])\n } else {\n createdVerticesByOriginalEdge[1].push(newVertex);\n }\n return newVertex;\n }\n\n return null; // Should never happens\n }\n\n const sourceVertex = getOrCreateVertex(source);\n if (!sourceVertex) return GraphRouterResults.createEmpty(source, targets);\n\n const targetsProjections: [Coordinates, Vertex | null][] = targets.map(target => [target, getOrCreateVertex(target)]);\n const targetsVertices = targetsProjections.map(([, vertex]) => vertex).filter(p => p !== null) as Vertex[];\n\n // In some specific cases, more than one vertex is created from an original edge.\n // And this vertices need to be connected together.\n createdVerticesByOriginalEdges.filter(pair => pair[1].length >= 2);\n createdVerticesByOriginalEdges.forEach(([edge, vertices]) => {\n const newEdgesOptions: EdgeProperties = {\n ...edge.properties,\n name: `splitted ${edge.properties.name || null} (tmp)`,\n };\n for (let i = 0; i < vertices.length; i++) {\n const vertexA = vertices[i];\n const distVertexAVertex1 = vertexA.distanceTo(edge.vertex1)\n for (let j = i + 1; j < vertices.length; j++) {\n const vertexB = vertices[j];\n const distVertexBVertex1 = vertexB.distanceTo(edge.vertex1)\n const reverse = distVertexBVertex1 < distVertexAVertex1;\n const newEdge = !reverse\n ? new Edge(vertexA, vertexB, newEdgesOptions)\n : new Edge(vertexB, vertexA, newEdgesOptions);\n createdEdges.add(newEdge);\n }\n }\n })\n\n\n const engineResults = this.calculateShortestPathToMultipleDestinationsByVertex(\n sourceVertex, targetsVertices, options,\n [...this.graph.vertices, ...createdVertices],\n [...this.graph.edges, ...createdEdges],\n );\n\n return new GraphRouterResults(engineResults, [source, sourceVertex], targetsProjections);\n }\n\n calculateShortestPath(\n source: Coordinates,\n target: Coordinates,\n options: GraphRouterOptions = GraphRouterOptionsBuilder.DEFAULT,\n ): GraphRouterResults {\n return this.calculateShortestPathToMultipleDestinations(source, [target], options);\n }\n\n\n // TODO: Verify if it works well with oneway edges\n getShortestTrip(waypoints: Coordinates[], options?: GraphRouterOptions, tspTempCoeff = 0.99) {\n type CustomPoint = salesman.Point & { coords: Coordinates };\n\n const points = waypoints.map(waypoint => {\n const point = new salesman.Point(0, 0) as CustomPoint;\n point.coords = waypoint;\n return point;\n });\n const graphRoutesCache: GraphRoute[] = [];\n const solution = salesman.solve(points, tspTempCoeff, undefined, (p: salesman.Point, q: salesman.Point) => {\n const route = this.calculateShortestPath(\n (p as CustomPoint).coords,\n (q as CustomPoint).coords,\n options\n ).route();\n graphRoutesCache.push(route);\n if (!route.hasRoute) { return Number.MAX_VALUE }\n return route.edgesWeights.reduce((acc, weight) => acc + weight, 0);\n });\n\n const orderedPoints = solution.map(i => points[i]);\n const orderedRoutes = [];\n for (let i = 0; i < orderedPoints.length; i++) {\n const p = orderedPoints[i] as CustomPoint;\n const q = orderedPoints[(i + 1) % orderedPoints.length] as CustomPoint;\n let cachedRoute = graphRoutesCache.find(route => route.start === p.coords && route.end === q.coords || route.end === p.coords && route.start === q.coords);\n if (cachedRoute?.end === p.coords) {\n // Need to revert route due to salesman bijectivity\n cachedRoute = cachedRoute.reverse();\n }\n if (cachedRoute) {\n orderedRoutes.push(cachedRoute);\n }\n }\n\n if (orderedRoutes.some(route => !route.hasRoute)) return [];\n\n return orderedRoutes;\n }\n\n\n}\nexport default GraphRouter;\n","import { Coordinates } from '@wemap/geo';\n\nimport Vertex from './Vertex.js';\n\nclass NoRouteFoundError extends Error {\n\n constructor(\n public start: Vertex | Coordinates,\n public end: Vertex | Coordinates | (Coordinates | Vertex)[],\n public details: string | null = null\n ) { super(); }\n\n get startStr() {\n if (this.start instanceof Vertex) {\n return `Vertex ${this.start.coords.toString()}`;\n }\n return this.start.toString();\n }\n\n get endStr() {\n if (this.end instanceof Vertex) {\n return `Vertex ${this.end.coords.toString()}`;\n }\n if (Array.isArray(this.end)) {\n return this.end.map(p => p instanceof Vertex ? p.coords.toString() : p.toString()).join(',');\n }\n return this.end.toString();\n }\n\n get message() {\n let message = `No route found from ${this.startStr} to ${this.endStr}.`;\n if (this.details) {\n message += ` Details: ${this.details}`;\n }\n return message;\n }\n}\n\nexport default NoRouteFoundError;\n","import { RouterRequest } from '../model/RouterRequest.js';\nimport Itinerary from '../model/Itinerary.js';\n\nabstract class RemoteRouter {\n\n /**\n * Get the router name\n */\n abstract get rname(): string;\n\n abstract getItineraries(endpointUrl: string, routerRequest: RouterRequest): Promise<Itinerary[]>;\n\n}\n\nexport default RemoteRouter;\n","// https://developers.google.com/actions-center/reference/grpc-api/status_codes\nexport enum StatusCode {\n OK = 0,\n CANCELLED = 1,\n UNKNOWN = 2,\n INVALID_ARGUMENT = 3,\n NOT_FOUND = 5,\n UNIMPLEMENTED = 12,\n INTERNAL = 13,\n UNAVAILABLE = 14,\n UNAUTHENTICATED = 16\n}","// Based on GRPC status code\n\nimport { StatusCode } from \"./StatusCode\";\nimport { TravelMode } from \"./model/TravelMode\";\n\n\nexport class RoutingError extends Error {\n\n public customMapName?: string | null;\n\n constructor(public code = StatusCode.UNKNOWN, message?: string) {\n super(message)\n }\n\n static notFound(details?: string) {\n return new RoutingError(StatusCode.NOT_FOUND, `Cannot found an itinerary. Details: ${details}`)\n }\n}\n\n\nexport class WemapMultiRoutingError extends RoutingError {\n \n constructor(public code = StatusCode.UNKNOWN, public mapName: string | null, message?: string) {\n super(code, message);\n this.mapName = mapName;\n }\n\n static notFound(mapName: string, details?: string) {\n return new WemapMultiRoutingError(StatusCode.NOT_FOUND, mapName, `Cannot found an itinerary in map ${mapName}. Details: ${details || 'No details'}`)\n }\n\n}\n\nexport class RemoteRoutingError extends RoutingError {\n \n constructor(public code = StatusCode.UNKNOWN, public routerName: string, message?: string) {\n super(code, message);\n this.routerName = routerName;\n }\n\n static notFound(routerName: string, details?: string) {\n return new RemoteRoutingError(StatusCode.NOT_FOUND, routerName, `Cannot found an itinerary with ${routerName}. Details: ${details || 'No details'}`)\n }\n\n static missingApiKey(routerName: string, details?: string) {\n return new RemoteRoutingError(StatusCode.UNAUTHENTICATED, routerName, `API key is missing for ${routerName}. Details: ${details}`)\n }\n\n static unreachableServer(routerName: string, url: string) {\n return new RemoteRoutingError(StatusCode.NOT_FOUND, routerName, `Remote router server ${routerName} is unreachable. URL: ${url}`)\n }\n\n static responseNotParsing(routerName: string, url: string) {\n return new RemoteRoutingError(StatusCode.NOT_FOUND, routerName, `Remote router server response ${routerName} cannot be parsed. URL: ${url}`)\n }\n\n static travelModeUnimplemented(routerName: string, travelMode: TravelMode) {\n return new RemoteRoutingError(StatusCode.UNIMPLEMENTED, routerName, `Travel mode \"${travelMode}\" is not implemented for ${routerName}`)\n }\n}","import { RoutingError } from \"../RoutingError\";\n\n/**\n * Create and return a date with a given timezone\n * timeZone - timezone name (e.g. 'Europe/Paris')\n */\nexport function dateWithTimeZone(\n year: number, month: number, day: number,\n hour: number, minute: number, second: number,\n timeZone = 'Europe/Paris'\n) {\n const date = new Date(Date.UTC(year, month, day, hour, minute, second));\n\n const utcDate = new Date(date.toLocaleString('en-US', { timeZone: 'UTC' }));\n const tzDate = new Date(date.toLocaleString('en-US', { timeZone: timeZone }));\n const offset = utcDate.getTime() - tzDate.getTime();\n\n date.setTime(date.getTime() + offset);\n\n return date;\n}\n\nexport function isRoutingError(e: unknown): e is Error {\n return e instanceof RoutingError;\n}\n","import { Coordinates } from '@wemap/geo';\nimport Logger from '@wemap/logger';\n\nimport RemoteRouter from '../RemoteRouter.js';\nimport Itinerary from '../../model/Itinerary.js';\nimport Leg, { TransportInfo } from '../../model/Leg.js';\nimport { dateWithTimeZone } from '../RemoteRouterUtils.js';\nimport { TransitMode, isTransitModePublicTransport } from '../../model/TransitMode.js';\nimport StepsBuilder from '../../model/StepsBuilder.js';\nimport { type TravelMode } from '../../model/TravelMode.js';\nimport { type RouterRequest } from '../../model/RouterRequest.js';\nimport { RemoteRoutingError } from '../../RoutingError.js';\n\ntype CitywayCoordinates = { Lat: number, Long: number };\ntype CitywayLeg = {\n TransportMode: string,\n Duration: string,\n Departure: {\n Time: string,\n Site: {\n Name: string,\n Position: CitywayCoordinates\n },\n StopPlace: {\n Name: string,\n Position: CitywayCoordinates\n }\n },\n Arrival: {\n Time: string,\n Site: {\n Name: string,\n Position: CitywayCoordinates\n },\n StopPlace: {\n Name: string,\n Position: CitywayCoordinates\n }\n },\n Line: {\n Name: string,\n Number: string,\n Color: string,\n TextColor: string,\n },\n Destination: string,\n Distance: number,\n steps: {\n Step: {\n Geometry: string\n }[]\n },\n pathLinks: {\n PathLink: {\n Departure: {\n Site: {\n Name: string\n }\n },\n Distance: number,\n Geometry: string | 'Null'\n }[]\n }\n};\ntype CitywayJson = {\n StatusCode: number,\n Message: string,\n Data: {\n response: {\n trips: {\n Trip: {\n Duration: string,\n Departure: {\n Time: string,\n Site: {\n Position: CitywayCoordinates\n }\n },\n Arrival: {\n Time: string,\n Site: {\n Position: CitywayCoordinates\n }\n },\n sections: {\n Section: {\n Leg?: CitywayLeg,\n PTRide: CitywayLeg\n }[]\n }\n }[]\n }\n },\n PlanTripType?: string\n }[],\n};\n\n\n\nfunction jsonToCoordinates(json: CitywayCoordinates) {\n return new Coordinates(json.Lat, json.Long);\n}\n\nfunction jsonDateToTimestamp(jsonDate: string) {\n const [dateStr, timeStr] = jsonDate.split(' ');\n const [dayStr, monthStr, yearStr] = dateStr.split('/');\n const [hoursStr, minutesStr, secondsStr] = timeStr.split(':');\n\n return dateWithTimeZone(\n Number(yearStr),\n Number(monthStr) - 1,\n Number(dayStr),\n Number(hoursStr),\n Number(minutesStr),\n Number(secondsStr)\n ).getTime();\n}\n\n/**\n * Input mode correspondance\n */\nconst inputModeCorrespondance = new Map<TravelMode, string>();\ninputModeCorrespondance.set('CAR', 'Car');\ninputModeCorrespondance.set('WALK', 'Walk');\ninputModeCorrespondance.set('BIKE', 'Bike');\ninputModeCorrespondance.set('TRANSIT', 'PT');\n\n\n/**\n * List of all routing modes supported by the API\n */\nconst transitModeCorrespondance = new Map<string, TransitMode>();\ntransitModeCorrespondance.set('WALK', 'WALK');\ntransitModeCorrespondance.set('BICYCLE', 'BIKE');\ntransitModeCorrespondance.set('TRAMWAY', 'TRAM');\ntransitModeCorrespondance.set('METRO', 'METRO');\ntransitModeCorrespondance.set('FUNICULAR', 'FUNICULAR');\ntransitModeCorrespondance.set('BUS', 'BUS');\ntransitModeCorrespondance.set('COACH', 'BUS');\ntransitModeCorrespondance.set('SCHOOL', 'BUS');\ntransitModeCorrespondance.set('BUS_PMR', 'BUS');\ntransitModeCorrespondance.set('MINIBUS', 'BUS');\ntransitModeCorrespondance.set('TROLLEY_BUS', 'BUS');\ntransitModeCorrespondance.set('TAXIBUS', 'BUS');\ntransitModeCorrespondance.set('SHUTTLE', 'BUS');\ntransitModeCorrespondance.set('TRAIN', 'TRAIN');\ntransitModeCorrespondance.set('HST', 'TRAIN');\ntransitModeCorrespondance.set('LOCAL_TRAIN', 'TRAIN');\ntransitModeCorrespondance.set('AIR', 'AIRPLANE');\ntransitModeCorrespondance.set('FERRY', 'BOAT');\ntransitModeCorrespondance.set('TAXI', 'UNKNOWN');\ntransitModeCorrespondance.set('CAR_POOL', 'UNKNOWN');\ntransitModeCorrespondance.set('PRIVATE_VEHICLE', 'CAR');\ntransitModeCorrespondance.set('SCOOTER', 'MOTO');\n\n/**\n * List of all plan trip supported by the API\n * Routing mode UNKNOWN means that the itinerary will not be parsed by the router\n */\nconst planTripType = new Map();\nplanTripType.set(0, 'BUS');\nplanTripType.set(1, 'WALK');\nplanTripType.set(2, 'BIKE');\nplanTripType.set(3, 'CAR');\nplanTripType.set(4, 'UNKNOWN');\nplanTripType.set(5, 'UNKNOWN');\nplanTripType.set(6, 'UNKNOWN');\nplanTripType.set(7, 'UNKNOWN');\nplanTripType.set(8, 'UNKNOWN');\nplanTripType.set(9, 'UNKNOWN');\nplanTripType.set(10, 'UNKNOWN');\nplanTripType.set(11, 'UNKNOWN');\nplanTripType.set(12, 'UNKNOWN');\nplanTripType.set(13, 'UNKNOWN');\nplanTripType.set(14, 'UNKNOWN');\n\nfunction parseWKTGeometry(wktGeometry: string) {\n const tmpCoordsStr = wktGeometry.match(/LINESTRING ?\\((.*)\\)/i);\n const tmpCoordsPt = wktGeometry.match(/POINT ?\\((.*)\\)/i);\n\n if (tmpCoordsPt) {\n const [lng, lat] = tmpCoordsPt[1].split(' ');\n return [new Coordinates(Number(lat), Number(lng))];\n }\n\n return (tmpCoordsStr as RegExpMatchArray)[1].split(',').map(str => {\n const sp = str.trim().split(' ');\n return new Coordinates(Number(sp[1]), Number(sp[0]));\n });\n}\n\n/**\n * Singleton.\n */\nclass CitywayRemoteRouter extends RemoteRouter {\n\n get rname() { return 'cityway' as const; }\n\n async getItineraries(endpointUrl: string, routerRequest: RouterRequest) {\n const url = this.getURL(endpointUrl, routerRequest);\n const res = await (fetch(url).catch(() => {\n throw RemoteRoutingError.unreachableServer(this.rname, url);\n }));\n\n const jsonResponse = await res.json().catch(() => {\n throw RemoteRoutingError.responseNotParsing(this.rname, url);\n });\n return this.parseResponse(jsonResponse);\n }\n\n\n getURL(endpointUrl: string, routerRequest: RouterRequest) {\n\n const { origin, destination, travelMode, waypoints } = routerRequest;\n const citywayMode = inputModeCorrespondance.get(travelMode);\n if (!citywayMode) {\n throw RemoteRoutingError.travelModeUnimplemented(this.rname, travelMode);\n }\n\n if ((waypoints || []).length > 0) {\n Logger.warn(`${this.rname} router uses only the first 2 waypoints (asked ${waypoints?.length})`);\n }\n\n const fromPlace = `DepartureLatitude=${origin.latitude}&DepartureLongitude=${origin.longitude}`;\n const toPlace = `ArrivalLatitude=${destination.latitude}&ArrivalLongitude=${destination.longitude}`;\n const queryMode = `TripModes=${citywayMode}`;\n\n const url = new URL(endpointUrl);\n\n if (routerRequest.departureTime) {\n url.searchParams.set('Date', routerRequest.departureTime);\n url.searchParams.set('TypeDate', 'Departure');\n }\n let { search } = url;\n search = (search ? `${search}&` : '?') + `${fromPlace}&${toPlace}&${queryMode}`;\n\n return `${url.origin}${url.pathname}${search}`;\n }\n\n /**\n * Generate multi itineraries from Cityway JSON\n * @example https://preprod.api.lia2.cityway.fr/journeyplanner/api/opt/PlanTrips/json?DepartureLatitude=49.51509388236216&DepartureLongitude=0.09341749619366316&ArrivalLatitude=49.5067090188444&ArrivalLongitude=0.1694842115417831&DepartureType=COORDINATES&ArrivalType=COORDINATES\n */\n parseResponse(json: CitywayJson) {\n\n if (json.StatusCode !== 200 || !json.Data || !json.Data.length) {\n throw RemoteRoutingError.notFound(this.rname, json.Message);\n }\n\n const itineraries = [];\n\n const allJsonTrips = json.Data.map(dataObj =>\n dataObj.response.trips.Trip.map(trip => ({\n ...trip,\n ...(dataObj.hasOwnProperty('PlanTripType') && { PlanTripType: dataObj.PlanTripType })\n }))\n ).flat();\n\n // eslint-disable-next-line no-labels\n itineraryLoop:\n for (const trip of allJsonTrips) {\n\n if (trip.hasOwnProperty('PlanTripType') && planTripType.get(trip.PlanTripType) === 'UNKNOWN') {\n continue;\n }\n\n const legs = []\n for (const jsonSection of trip.sections.Section) {\n\n const jsonLeg = jsonSection.Leg ? jsonSection.Leg : jsonSection.PTRide;\n\n const legMode = transitModeCorrespondance.get(jsonLeg.TransportMode)!;\n const legCoords: Coordinates[] = [];\n let legStart, legEnd;\n let transportInfo: TransportInfo | undefined;\n const stepsBuilder = new StepsBuilder();\n\n if (legMode === 'UNKNOWN') {\n // eslint-disable-next-line\n continue itineraryLoop;\n }\n\n if (legMode === 'WALK'\n || legMode === 'BIKE'\n || legMode === 'CAR') {\n\n legStart = {\n name: jsonLeg.Departure.Site.Name,\n coords: jsonToCoordinates(jsonLeg.Departure.Site.Position)\n };\n legEnd = {\n name: jsonLeg.Arrival.Site.Name,\n coords: jsonToCoordinates(jsonLeg.Arrival.Site.Position)\n };\n\n for (const jsonPathLink of jsonLeg.pathLinks.PathLink) {\n let stepCoords;\n // jsonPathLink.Geometry is either a POINT or a LINESTRING\n // or it can also be 'Null' as string\n if (jsonPathLink.Geometry && jsonPathLink.Geometry !== 'Null') {\n stepCoords = parseWKTGeometry(jsonPathLink.Geometry);\n } else {\n stepCoords = [legStart.coords, legEnd.coords];\n }\n\n stepCoords.forEach((coords, idx) => {\n if (\n idx !== 0\n || legCoords.length === 0\n || !legCoords[legCoords.length - 1].equals(coords)\n ) {\n legCoords.push(coords);\n }\n });\n\n stepsBuilder.addStepInfo({\n coords: stepCoords[0],\n distance: jsonPathLink.Distance,\n name: jsonPathLink.Departure.Site.Name\n });\n }\n\n // If it's last leg, create a last step because cityway doesn't use the end of itinerary as step\n if (jsonSection === trip.sections.Section[trip.sections.Section.length - 1]) {\n stepsBuilder.addStepInfo({\n coords: legCoords[legCoords.length - 1]\n });\n }\n\n } else if (isTransitModePublicTransport(legMode)) {\n\n legStart = {\n name: jsonLeg.Departure.StopPlace.Name,\n coords: jsonToCoordinates(jsonLeg.Departure.StopPlace.Position)\n };\n legEnd = {\n name: jsonLeg.Arrival.StopPlace.Name,\n coords: jsonToCoordinates(jsonLeg.Arrival.StopPlace.Position)\n };\n\n let transportName = jsonLeg.Line.Number;\n if (legMode === 'TRAM' && transportName.toLowerCase().includes('tram')) {\n // In order to remove the \"TRAM \" prefix.\n transportName = transportName.substr(5);\n }\n\n transportInfo = {\n name: transportName,\n routeColor: jsonLeg.Line.Color,\n routeTextColor: jsonLeg.Line.TextColor,\n directionName: jsonLeg.Destination\n };\n\n for (const jsonStep of jsonLeg.steps.Step) {\n const stepCoords = parseWKTGeometry(jsonStep.Geometry);\n stepCoords.forEach((coords, idx) => {\n if (\n idx !== 0\n || legCoords.length === 0\n || !legCoords[legCoords.length - 1].equals(coords)\n ) {\n legCoords.push(coords);\n }\n });\n }\n\n stepsBuilder.addStepInfo({\n coords: legCoords[0],\n name: jsonLeg.Line.Name,\n distance: jsonLeg.Distance,\n type: 'transit'\n });\n } else {\n Logger.warn(`[CitywayParser] Unknown leg mode: ${jsonLeg.TransportMode}`);\n continue;\n }\n\n stepsBuilder.setStart(legStart.coords);\n stepsBuilder.setEnd(legEnd.coords);\n stepsBuilder.setPathCoords(legCoords);\n\n const leg = new Leg({\n transitMode: legMode,\n duration: this.parseDuration(jsonLeg.Duration),\n startTime: jsonDateToTimestamp(jsonLeg.Departure.Time),\n endTime: jsonDateToTimestamp(jsonLeg.Arrival.Time),\n coords: legCoords,\n start: legStart,\n end: legEnd,\n transportInfo,\n steps: stepsBuilder.build()\n });\n\n legs.push(leg);\n }\n\n const itinerary = new Itinerary({\n duration: this.parseDuration(trip.Duration),\n startTime: jsonDateToTimestamp(trip.Departure.Time),\n origin: jsonToCoordinates(trip.Departure.Site.Position),\n endTime: jsonDateToTimestamp(trip.Arrival.Time),\n destination: jsonToCoordinates(trip.Arrival.Site.Position),\n legs\n });\n\n itineraries.push(itinerary);\n }\n\n return itineraries;\n }\n\n\n /**\n * @param {string} iso8601Duration\n * @see https://stackoverflow.com/a/29153059/2239938\n */\n parseDuration(iso8601Duration: string) {\n const iso8601DurationRegex = /(-)?P(?:([.,\\d]+)Y)?(?:([.,\\d]+)M)?(?:([.,\\d]+)W)?(?:([.,\\d]+)D)?T(?:([.,\\d]+)H)?(?:([.,\\d]+)M)?(?:([.,\\d]+)S)?/;\n\n const matches = iso8601Duration.match(iso8601DurationRegex)!;\n\n // const sign = typeof matches[1] === 'undefined' ? '+' : '-',\n const years = typeof matches[2] === 'undefined' ? 0 : Number(matches[2]);\n const months = typeof matches[3] === 'undefined' ? 0 : Number(matches[3]);\n const weeks = typeof matches[4] === 'undefined' ? 0 : Number(matches[4]);\n const days = typeof matches[5] === 'undefined' ? 0 : Number(matches[5]);\n const hours = typeof matches[6] === 'undefined' ? 0 : Number(matches[6]);\n const minutes = typeof matches[7] === 'undefined' ? 0 : Number(matches[7]);\n const seconds = typeof matches[8] === 'undefined' ? 0 : Number(matches[8]);\n\n return seconds\n + minutes * 60\n + hours * 3600\n + days * 86400\n + weeks * (86400 * 7)\n + months * (86400 * 30)\n + years * (86400 * 365.25);\n }\n}\n\nexport default new CitywayRemoteRouter();","import { Coordinates, Utils as GeoUtils } from '@wemap/geo';\nimport Logger from '@wemap/logger';\n\nimport RemoteRouter from '../RemoteRouter.js';\nimport Itinerary from '../../model/Itinerary.js';\nimport Leg, { TransportInfo } from '../../model/Leg.js';\nimport { dateWithTimeZone } from '../RemoteRouterUtils.js';\nimport { TransitMode, areTransitAndTravelModeConsistent } from '../../model/TransitMode.js';\nimport StepsBuilder from '../../model/StepsBuilder.js';\nimport { type MinStepInfo } from '../../model/Step.js';\nimport { type RouterRequest } from '../../model/RouterRequest.js';\nimport { RemoteRoutingError } from '../../RoutingError.js';\nimport { NavitiaJson, NavitiaCoordinates, NavitiaSection, NavitiaIntermediateStep } from './types';\n\n/**\n * List of all modes supported by the API\n * http://doc.navitia.io/#physical-mode\n */\n\nconst transitModeCorrespondance = new Map<string, TransitMode>();\ntransitModeCorrespondance.set('Air', 'AIRPLANE');\ntransitModeCorrespondance.set('Boat', 'BOAT');\ntransitModeCorrespondance.set('Bus', 'BUS');\ntransitModeCorrespondance.set('BusRapidTransit', 'BUS');\ntransitModeCorrespondance.set('Coach', 'BUS');\ntransitModeCorrespondance.set('Ferry', 'FERRY');\ntransitModeCorrespondance.set('Funicular', 'FUNICULAR');\ntransitModeCorrespondance.set('LocalTrain', 'TRAIN');\ntransitModeCorrespondance.set('LongDistanceTrain', 'TRAIN');\ntransitModeCorrespondance.set('Metro', 'METRO');\ntransitModeCorrespondance.set('Métro', 'METRO');\ntransitModeCorrespondance.set('RailShuttle', 'TRAIN');\ntransitModeCorrespondance.set('RapidTransit', 'BUS');\ntransitModeCorrespondance.set('Shuttle', 'BUS');\ntransitModeCorrespondance.set('SuspendedCableCar', 'FUNICULAR');\ntransitModeCorrespondance.set('Taxi', 'TAXI');\ntransitModeCorrespondance.set('Train', 'TRAIN');\ntransitModeCorrespondance.set('RER', 'TRAIN');\ntransitModeCorrespondance.set('Tramway', 'TRAM');\ntransitModeCorrespondance.set('walking', 'WALK');\ntransitModeCorrespondance.set('bike', 'BIKE');\n\n/**\n * List of transports modes\n */\nconst TRANSPORT_IDS = [\n 'physical_mode:Air',\n 'physical_mode:Boat',\n 'physical_mode:Bus',\n 'physical_mode:BusRapidTransit',\n 'physical_mode:Coach',\n 'physical_mode:Ferry',\n 'physical_mode:Funicular',\n 'physical_mode:LocalTrain',\n 'physical_mode:LongDistanceTrain',\n 'physical_mode:Metro',\n 'physical_mode:RailShuttle',\n 'physical_mode:RapidTransit',\n 'physical_mode:Shuttle',\n 'physical_mode:SuspendedCableCar',\n 'physical_mode:Taxi',\n 'physical_mode:Train',\n 'physical_mode:Tramway'\n];\n\nfunction jsonToCoordinates(json: NavitiaCoordinates) {\n return new Coordinates(Number(json.lat), Number(json.lon));\n}\n\nfunction last<T>(array: T[]) {\n return array[array.length - 1];\n}\n\n/**\n * stringDate (e.g. 20211117T104516)\n */\nfunction dateStringToTimestamp(stringDate: string, timeZone: string) {\n const yearStr = stringDate.substr(0, 4);\n const monthStr = stringDate.substr(4, 2);\n const dayStr = stringDate.substr(6, 2);\n const hoursStr = stringDate.substr(9, 2);\n const minutesStr = stringDate.substr(11, 2);\n const secondsStr = stringDate.substr(13, 2);\n\n return dateWithTimeZone(\n Number(yearStr),\n Number(monthStr) - 1,\n Number(dayStr),\n Number(hoursStr),\n Number(minutesStr),\n Number(secondsStr),\n timeZone\n ).getTime();\n}\n\n// The api key should be defined in the routingurl as api_key=XXXXXXXX\n\n/**\n * Singleton.\n */\nclass NavitiaRemoteRouter extends RemoteRouter {\n\n get rname() { return 'navitia' as const; }\n\n async getItineraries(endpointUrl: string, routerRequest: RouterRequest) {\n const url = this.getURL(endpointUrl, routerRequest);\n\n // The api key should be defined in the routingurl as api_key=XXXXXXXX\n const api_key = url.searchParams.get('api_key');\n if (!api_key) {\n throw RemoteRoutingError.missingApiKey(this.rname);\n }\n\n const res = await (fetch(url, {\n method: 'GET',\n headers: { \n 'Authorization': api_key,\n }\n }).catch(() => {\n throw RemoteRoutingError.unreachableServer(this.rname, url.toString());\n }));\n\n\n const jsonResponse: NavitiaJson = await res.json().catch(() => {\n throw RemoteRoutingError.responseNotParsing(this.rname, url.toString());\n });\n\n // When Navitia failed to calculate an itinerary (ie. start or end\n // point is far from network), it respond a 404 with an error message\n // or a 200 with an error message\n if (jsonResponse && jsonResponse.error) {\n throw RemoteRoutingError.notFound(this.rname, jsonResponse.error.message);\n }\n\n const itineraries = this.parseResponse(jsonResponse);\n\n const sameModeFound = itineraries.some((itinerary) => areTransitAndTravelModeConsistent(itinerary.transitMode, routerRequest.travelMode));\n\n if (!sameModeFound) {\n throw RemoteRoutingError.notFound(\n this.rname,\n 'Selected mode of transport was not found for this itinerary.'\n )\n }\n\n return itineraries;\n }\n\n getURL(endpointUrl: string, routerRequest: RouterRequest) {\n const { origin, destination, waypoints, travelMode } = routerRequest;\n\n if ((waypoints || []).length > 0) {\n Logger.warn(`${this.rname} router uses only the first 2 waypoints (asked ${waypoints?.length})`);\n }\n\n const url = new URL(endpointUrl);\n\n const coreParams = new URLSearchParams();\n coreParams.set('from', `${origin.longitude};${origin.latitude}`);\n coreParams.set('to', `${destination.longitude};${destination.latitude}`);\n coreParams.set('data_freshness', 'realtime');\n\n if (routerRequest.itineraryModifiers?.isWheelchair) {\n coreParams.set('wheelchair', 'true')\n }\n\n let queryParams: URLSearchParams = new URLSearchParams();\n switch (travelMode) {\n case 'WALK':\n queryParams = this.getWalkingQuery();\n break;\n case 'BIKE':\n queryParams = this.getBikeQuery();\n break;\n case 'CAR':\n queryParams = this.getCarQuery();\n break;\n default:\n break;\n }\n\n [coreParams, queryParams].map(params => {\n for (const pair of params.entries()) {\n url.searchParams.append(pair[0], pair[1]);\n }\n });\n\n return url;\n }\n\n getCarQuery() {\n const urlSearchParams = new URLSearchParams();\n\n TRANSPORT_IDS.forEach((id) => {\n urlSearchParams.append('forbidden_uris[]', id);\n });\n\n urlSearchParams.append('first_section_mode[]', 'walking');\n urlSearchParams.append('first_section_mode[]', 'car');\n urlSearchParams.append('last_section_mode[]', 'walking');\n urlSearchParams.append('last_section_mode[]', 'car');\n\n return urlSearchParams;\n }\n\n getWalkingQuery() {\n const urlSearchParams = new URLSearchParams();\n\n TRANSPORT_IDS.forEach((id) => {\n urlSearchParams.append('forbidden_uris[]', id);\n });\n\n urlSearchParams.append('first_section_mode[]', 'walking');\n urlSearchParams.append('last_section_mode[]', 'walking');\n\n return urlSearchParams;\n }\n\n getBikeQuery() {\n const urlSearchParams = new URLSearchParams();\n\n TRANSPORT_IDS.forEach((id) => {\n urlSearchParams.append('forbidden_uris[]', id);\n });\n\n urlSearchParams.append('first_section_mode[]', 'bike');\n urlSearchParams.append('last_section_mode[]', 'bike');\n\n return urlSearchParams;\n }\n\n\n getSectionCoords(section: NavitiaSection) {\n let from: NavitiaCoordinates | undefined;\n let to: NavitiaCoordinates | undefined;\n\n if ('stop_point' in section.from) {\n from = section.from.stop_point.coord;\n } else if ('address' in section.from) {\n from = section.from.address.coord;\n } else {\n from = section.from.poi.coord;\n }\n\n if ('stop_point' in section.to) {\n to = section.to.stop_point.coord;\n } else if ('address' in section.to) {\n to = section.to.address.coord;\n } else {\n to = section.to.poi.coord;\n }\n\n return {\n from: jsonToCoordinates(from),\n to: jsonToCoordinates(to)\n };\n }\n\n /**\n * Since the navitia API does not provide coords for each step, we need to compute them\n * We trim the coordinates of the leg with the distance of each step and keep the last result as the coords of the step\n * @param {Leg} leg\n */\n findStepsCoord(legCoords: Coordinates[], steps: NavitiaIntermediateStep[]) {\n const coords = legCoords;\n\n const duplicatedCoords = [...coords];\n let previousStep = steps[0];\n let accumulatedIndex = 0;\n const outputSteps = [];\n\n for (const [idx, step] of steps.entries()) {\n let newCoords: Coordinates;\n\n let _idCoordsInLeg;\n\n if (idx === 0) {\n _idCoordsInLeg = 0;\n newCoords = coords[0];\n } else if (idx === steps.length - 1) {\n _idCoordsInLeg = coords.length - 1;\n newCoords = last(coords);\n } else if (duplicatedCoords.length === 1) {\n accumulatedIndex++;\n\n _idCoordsInLeg = accumulatedIndex;\n\n newCoords = duplicatedCoords[0];\n\n coords[_idCoordsInLeg] = newCoords;\n } else {\n const result = GeoUtils.trimRoute(duplicatedCoords, duplicatedCoords[0], previousStep.distance);\n accumulatedIndex += result.length - 1;\n\n duplicatedCoords.splice(0, result.length - 1);\n\n _idCoordsInLeg = accumulatedIndex;\n\n newCoords = last(result);\n\n coords[_idCoordsInLeg] = newCoords;\n }\n\n outputSteps.push({\n ...step,\n coords: newCoords\n });\n\n previousStep = step;\n }\n\n return outputSteps;\n }\n\n findStepCoords(step: NavitiaSection['path'][number], section: NavitiaSection) {\n if ('instruction_start_coordinate' in step) {\n return jsonToCoordinates(step.instruction_start_coordinate);\n }\n\n const via = section.vias?.find(via => via.id === step.via_uri);\n if (via) {\n return jsonToCoordinates(via.access_point.coord);\n }\n }\n\n parseResponse(json: NavitiaJson) {\n\n if (!json || !json.journeys) {\n throw RemoteRoutingError.notFound(this.rname, json.error?.message);\n }\n\n const itineraries = [];\n\n const timeZone = json.context.timezone;\n\n for (const jsonItinerary of json.journeys) {\n\n const legs = [];\n\n for (const jsonSection of jsonItinerary.sections) {\n\n if (jsonSection.type === 'waiting' || jsonSection.type === 'transfer') {\n continue;\n }\n\n const { from: startSection, to: endSection } = this.getSectionCoords(jsonSection);\n\n // A section can have multiple same coordinates, we need to remove them\n let existingCoords: string[] = [];\n const legCoords = jsonSection.geojson.coordinates.reduce((acc, [lon, lat]) => {\n if (!existingCoords.includes(`${lon}-${lat}`)) {\n existingCoords = existingCoords.concat(`${lon}-${lat}`);\n acc.push(new Coordinates(lat, lon));\n }\n return acc;\n }, [] as Coordinates[]);\n\n const stepsBuilder = new StepsBuilder().setStart(startSection).setEnd(endSection).setPathCoords(legCoords);\n let transportInfo: TransportInfo | undefined;\n let transitMode = transitModeCorrespondance.get(jsonSection.mode) as TransitMode;\n\n if (jsonSection.path) {\n const useNavitiaSteps = jsonSection.path.every(step => 'instruction_start_coordinate' in step || step.via_uri);\n const navitiaIntermediateSteps: {name: string; distance: number;}[] = [];\n\n for (const jsonPathLink of jsonSection.path) {\n let coords: Coordinates;\n if (useNavitiaSteps) {\n coords = this.findStepCoords(jsonPathLink, jsonSection)!;\n\n stepsBuilder.addStepInfo({\n name: jsonPathLink.name,\n distance: jsonPathLink.length,\n coords,\n type: 'turn'\n });\n } else {\n navitiaIntermediateSteps.push({\n name: jsonPathLink.name,\n distance: jsonPathLink.length,\n });\n }\n }\n\n if (!useNavitiaSteps) {\n stepsBuilder.setStepsInfo(this.findStepsCoord(legCoords, navitiaIntermediateSteps));\n }\n }\n\n if (jsonSection.type === 'public_transport') {\n transportInfo = {\n name: jsonSection.display_informations.code,\n routeColor: jsonSection.display_informations.color,\n routeTextColor: jsonSection.display_informations.text_color,\n directionName: jsonSection.display_informations.direction\n };\n\n transitMode = transitModeCorrespondance.get(jsonSection.display_informations.physical_mode) as TransitMode;\n\n const legStep: MinStepInfo = {\n coords: legCoords[0],\n name: transportInfo.directionName,\n distance: jsonSection.geojson.properties[0].length,\n type: 'transit'\n };\n stepsBuilder.setStepsInfo([legStep]);\n }\n\n const leg = new Leg({\n transitMode,\n duration: jsonSection.duration,\n startTime: dateStringToTimestamp(jsonSection.departure_date_time, timeZone),\n endTime: dateStringToTimestamp(jsonSection.arrival_date_time, timeZone),\n start: {\n name: jsonSection.from.name,\n coords: startSection\n },\n end: {\n name: jsonSection.to.name,\n coords: endSection\n },\n coords: legCoords,\n transportInfo,\n steps: stepsBuilder.build()\n });\n legs.push(leg);\n }\n\n const itinerary = new Itinerary({\n duration: jsonItinerary.duration,\n startTime: dateStringToTimestamp(jsonItinerary.departure_date_time, timeZone),\n endTime: dateStringToTimestamp(jsonItinerary.arrival_date_time, timeZone),\n origin: this.getSectionCoords(jsonItinerary.sections[0]).from,\n destination: this.getSectionCoords(last(jsonItinerary.sections)).to,\n legs\n });\n\n itineraries.push(itinerary);\n }\n\n return itineraries;\n }\n}\n\nexport default new NavitiaRemoteRouter();","import { Coordinates, Level } from '@wemap/geo';\n\nimport RemoteRouter from '../RemoteRouter.js';\nimport Itinerary from '../../model/Itinerary.js';\nimport Leg from '../../model/Leg.js';\nimport { type RouterRequest } from '../../model/RouterRequest.js';\nimport { RemoteRoutingError } from '../../RoutingError.js';\n\ntype DBJson = {\n segments: {\n fromLevel: number,\n toLevel: number,\n polyline: {\n lat: number,\n lon: number\n }[]\n }[]\n};\n\n/**\n * Singleton.\n */\nclass DeutscheBahnRemoteRouter extends RemoteRouter {\n\n /**\n * @override\n */\n get rname() { return 'deutsche-bahn' as const; }\n\n /**\n * @override\n */\n async getItineraries(endpointUrl: string, routerRequest: RouterRequest) {\n const url = this.getURL(endpointUrl, routerRequest);\n const res = await (fetch(url).catch(() => {\n throw RemoteRoutingError.unreachableServer(this.rname, url);\n }));\n\n const jsonResponse = await res.json().catch(() => {\n throw RemoteRoutingError.responseNotParsing(this.rname, url);\n });\n return this.parseResponse(jsonResponse, routerRequest.origin, routerRequest.destination);\n }\n\n getURL(endpointUrl: string, routerRequest: RouterRequest) {\n let url = endpointUrl + '/route/v1/walking/';\n const waypoints = [routerRequest.origin, ...routerRequest.waypoints || [], routerRequest.destination];\n\n url += waypoints.map(waypoint => {\n if (waypoint.level !== null) {\n const altitude = Level.isRange(waypoint.level) ? waypoint.level[0] : waypoint.level;\n return waypoint.longitude + ',' + waypoint.latitude + ',' + altitude;\n }\n return waypoint.longitude + ',' + waypoint.latitude;\n }).join(';');\n\n url += '?geometries=geojson&overview=full&steps=true';\n\n return url;\n }\n\n parseResponse(json: DBJson, origin: Coordinates, destination: Coordinates) {\n\n if (!json.segments) {\n throw RemoteRoutingError.notFound(this.rname);\n }\n\n const legs = json.segments.map(segment => {\n const level = Level.union(segment.fromLevel, segment.toLevel);\n const coords = segment.polyline.map(({ lon, lat }) =>\n new Coordinates(lat, lon, null, level)\n );\n return new Leg({\n transitMode: 'WALK',\n coords,\n start: { coords: coords[0] },\n end: { coords: coords[coords.length - 1] },\n })\n });\n\n return [new Itinerary({ origin, destination, legs })];\n }\n}\n\nexport default new DeutscheBahnRemoteRouter();\n","/* eslint-disable max-statements */\nimport polyline from '@mapbox/polyline';\nimport { Coordinates } from '@wemap/geo';\n\nimport Itinerary from '../../model/Itinerary.js';\nimport Leg, { TransportInfo } from '../../model/Leg.js';\nimport StepsBuilder from '../../model/StepsBuilder.js';\nimport RemoteRouter from '../RemoteRouter.js';\nimport type { TransitMode } from '../../model/TransitMode.js';\nimport { RouterRequest } from '../../model/RouterRequest.js';\nimport { RemoteRoutingError } from '../../RoutingError.js';\n\ntype DistanceDetails = {\n total: number;\n normalRoads: number;\n recommendedRoads: number;\n discouragedRoads: number;\n cycleway: number;\n greenway: number;\n lane: number;\n livingstreet: number;\n sharebusway: number;\n footway: number;\n pedestrian: number;\n opposite: number;\n steps: number;\n zone30: number;\n residential: number;\n};\n\ntype Waypoint = {\n longitude: number;\n latitude: number;\n title?: string | null;\n};\n\ntype Instruction = Array<string | number>;\n\ntype SectionWithInstructions = {\n transportMode: 'BIKE' | 'PEDESTRIAN';\n duration: number;\n waypointsIndices: number[] | null;\n geometry: string;\n estimatedDatetimeOfDeparture: string;\n estimatedDatetimeOfArrival: string;\n details: SectionDetails;\n waypoints: Waypoint[];\n};\n\ntype SectionDetails = {\n distances: DistanceDetails;\n instructions: Instruction[];\n profile: string;\n direction: string;\n verticalGain: number;\n verticalLoss: number;\n calories: number;\n elevations: string | null;\n ridesets: any[];\n averageSpeed: number;\n bikeType: string;\n};\n\ntype Route = {\n sections: SectionWithInstructions[];\n distances: {\n total: number;\n normalRoads: number;\n recommendedRoads: number;\n discouragedRoads: number;\n };\n title: string;\n waypoints: Waypoint[];\n estimatedDatetimeOfDeparture: string;\n estimatedDatetimeOfArrival: string;\n duration: number;\n id: string;\n};\n\ntype Routes = Route[];\n\ntype QueryParams = {\n instructions: boolean;\n elevations: boolean;\n geometry: boolean;\n single_result: boolean;\n bike_stations: boolean;\n objects_as_ids: boolean;\n merge_instructions: boolean;\n show_pushing_bike_instructions: boolean;\n}\n\ntype RequestBodyParams = {\n datetimeOfDeparture?: string;\n datetimeOfArrival?: string;\n bikeDetails?: {\n profile: string;\n bikeType: string;\n averageSpeed: number;\n eBike: boolean;\n bikeStations: Array<{ from: number; to: number }>;\n };\n transportModes: Array<'BIKE' | 'PEDESTRIAN'>;\n waypoints: Waypoint[];\n}\n\nfunction unpackJSON(data: any[][]) {\n const headers = data[0];\n\n return data.slice(1).map(row => {\n const obj: any = {};\n headers.forEach((header, index) => {\n obj[header] = row[index];\n });\n return obj;\n });\n}\n\nconst transitModeCorrespondance = new Map<string, TransitMode>();\ntransitModeCorrespondance.set('BIKE', 'BIKE');\ntransitModeCorrespondance.set('PEDESTRIAN', 'WALK');\n\nconst apiKey = 'qWHj6ax6DMttG8DX6tH9CQARaiTgQ1Di';\n\nfunction waypointToCoordinates(waypoint: Waypoint) {\n return new Coordinates(waypoint.latitude, waypoint.longitude);\n}\n\nfunction last<T>(array: T[]) {\n return array[array.length - 1];\n}\n\n/**\n * Singleton.\n */\nclass GeoveloRemoteRouter extends RemoteRouter {\n\n /**\n * @override\n */\n get rname() { return 'geovelo' as const; }\n\n\n async getItineraries(endpointUrl: string, routerRequest: RouterRequest) {\n const queryParams = this.getQueryParams();\n const bodyParams = this.getBodyParams(routerRequest);\n\n const url = new URL(endpointUrl);\n\n for (const [key, value] of Object.entries(queryParams)) {\n url.searchParams.append(key, value.toString());\n }\n\n const res = await (fetch(url, {\n method: 'POST',\n headers: {\n apiKey,\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(bodyParams)\n }).catch(() => {\n throw RemoteRoutingError.unreachableServer(this.rname, url.toString());\n }));\n\n\n const jsonResponse: Routes = await res.json().catch(() => {\n throw RemoteRoutingError.responseNotParsing(this.rname, url.toString());\n });\n\n // When Geovélo failed to calculate an itinerary (ie. start or end\n // point is far from network), it respond with empty routes\n if (!jsonResponse || jsonResponse.length === 0) {\n throw RemoteRoutingError.notFound(this.rname, 'No itineraries found.');\n }\n\n const itineraries = this.parseResponse(jsonResponse);\n\n return itineraries;\n }\n\n getQueryParams(): QueryParams {\n return {\n instructions: true,\n elevations: false,\n geometry: true,\n single_result: false,\n bike_stations: false,\n objects_as_ids: false,\n merge_instructions: true,\n show_pushing_bike_instructions: false\n };\n }\n\n getBodyParams(routerRequest: RouterRequest): RequestBodyParams {\n const { origin, destination, waypoints } = routerRequest;\n let computedWaypoints: Waypoint[] = [];\n if (waypoints && waypoints.length > 1) {\n computedWaypoints = waypoints.map((waypoint) => ({\n longitude: waypoint.longitude,\n latitude: waypoint.latitude\n }));\n } else {\n computedWaypoints = [\n { latitude: origin.latitude, longitude: origin.longitude },\n { latitude: destination.latitude, longitude: destination.longitude }\n ]\n }\n\n return {\n transportModes: ['BIKE'],\n waypoints: computedWaypoints\n };\n }\n\n parseResponse(json: Routes) {\n if (!json || !json.length) {\n throw RemoteRoutingError.notFound(this.rname);\n }\n\n const itineraries = [];\n\n for (const route of json) {\n\n const legs = [];\n\n for (const section of route.sections) {\n const from = waypointToCoordinates(section.waypoints[0]);\n const to = waypointToCoordinates(last(section.waypoints));\n const geometry = polyline.toGeoJSON(section.geometry, 6);\n\n // A section can have multiple same coordinates, we need to remove them\n let existingCoords: string[] = [];\n const legCoords = geometry.coordinates.reduce((acc, [lon, lat]) => {\n if (!existingCoords.includes(`${lon}-${lat}`)) {\n existingCoords = existingCoords.concat(`${lon}-${lat}`);\n acc.push(new Coordinates(lat, lon));\n }\n return acc;\n }, [] as Coordinates[]);\n\n const stepsBuilder = new StepsBuilder().setStart(from).setEnd(to).setPathCoords(legCoords);\n const transitMode = transitModeCorrespondance.get(section.transportMode) as TransitMode;\n\n const unpackedIntructions = unpackJSON(section.details.instructions);\n\n for (const instruction of unpackedIntructions) {\n const { geometryIndex, roadLength, roadName } = instruction;\n const coordinates = geometry.coordinates[geometryIndex];\n\n const intermediateStep = {\n name: roadName,\n distance: roadLength,\n coords: new Coordinates(coordinates[1], coordinates[0])\n };\n\n stepsBuilder.addStepInfo(intermediateStep);\n }\n\n\n const leg = new Leg({\n transitMode,\n duration: section.duration,\n startTime: new Date(section.estimatedDatetimeOfDeparture).getTime(),\n endTime: new Date(section.estimatedDatetimeOfArrival).getTime(),\n start: {\n coords: from\n },\n end: {\n coords: to\n },\n coords: legCoords,\n steps: stepsBuilder.build()\n });\n legs.push(leg);\n }\n\n const itinerary = new Itinerary({\n duration: route.duration,\n startTime: new Date(route.estimatedDatetimeOfDeparture).getTime(),\n endTime: new Date(route.estimatedDatetimeOfArrival).getTime(),\n origin: waypointToCoordinates(route.waypoints[0]),\n destination: waypointToCoordinates(last(route.waypoints)),\n legs\n });\n\n itineraries.push(itinerary);\n }\n\n return itineraries;\n }\n}\n\nexport default new GeoveloRemoteRouter();","/* eslint-disable max-statements */\nimport { Coordinates, Utils as GeoUtils } from '@wemap/geo';\nimport Logger from '@wemap/logger';\n\nimport Itinerary from '../../model/Itinerary.js';\nimport Leg, { TransportInfo } from '../../model/Leg.js';\nimport { dateWithTimeZone } from '../RemoteRouterUtils.js';\nimport StepsBuilder from '../../model/StepsBuilder.js';\nimport RemoteRouter from '../RemoteRouter.js';\nimport { areTransitAndTravelModeConsistent, type TransitMode } from '../../model/TransitMode.js';\nimport { type MinStepInfo } from '../../model/Step.js';\nimport { RouterRequest } from '../../model/RouterRequest.js';\nimport { RemoteRoutingError } from '../../RoutingError.js';\nimport GeoveloRemoteRouter from '../geovelo/GeoveloRemoteRouter.js';\n\ntype IdfmCoordinates = { lat: number | string, lon: number | string };\ntype IdfmPath = {\n name: string,\n length: number\n} & ({ instruction_start_coordinate: IdfmCoordinates } | { via_uri: string });\n\ntype IdfmWaypoint = { name: string }\n & (\n { stop_point: { coord: IdfmCoordinates } } |\n { address: { coord: IdfmCoordinates } } |\n { poi: { coord: IdfmCoordinates } }\n )\n\ntype IdfmSection = {\n id: string;\n type: 'waiting' | 'transfer' | string,\n mode: string,\n departure_date_time: string,\n arrival_date_time: string,\n duration: number,\n geojson: {\n coordinates: [number, number][],\n properties: { length: number }[]\n },\n path: IdfmPath[],\n display_informations: {\n code: string,\n color: string,\n text_color: string,\n direction: string,\n physical_mode: string\n },\n from: IdfmWaypoint,\n to: IdfmWaypoint,\n vias?: {\n id: string;\n name: string;\n access_point: {\n id: string;\n name: string;\n coord: {\n lon: string;\n lat: string;\n },\n embedded_type: string;\n },\n is_entrance: boolean,\n is_exit: boolean,\n length: number,\n traversal_time: number,\n pathway_mode: number\n }[]\n}\ntype IdfmJson = {\n journeys: {\n duration: number,\n departure_date_time: string,\n arrival_date_time: string,\n sections: IdfmSection[]\n }[],\n context: {\n timezone: string\n };\n error: {\n message?: string;\n }\n};\n\ntype IdfmIntermediateStep = {\n name: string,\n distance: number\n};\n\n/**\n * List of all modes supported by the API\n * http://doc.navitia.io/#physical-mode\n */\n\nconst transitModeCorrespondance = new Map<string, TransitMode>();\ntransitModeCorrespondance.set('Air', 'AIRPLANE');\ntransitModeCorrespondance.set('Boat', 'BOAT');\ntransitModeCorrespondance.set('Bus', 'BUS');\ntransitModeCorrespondance.set('BusRapidTransit', 'BUS');\ntransitModeCorrespondance.set('Coach', 'BUS');\ntransitModeCorrespondance.set('Ferry', 'FERRY');\ntransitModeCorrespondance.set('Funicular', 'FUNICULAR');\ntransitModeCorrespondance.set('LocalTrain', 'TRAIN');\ntransitModeCorrespondance.set('LongDistanceTrain', 'TRAIN');\ntransitModeCorrespondance.set('Metro', 'METRO');\ntransitModeCorrespondance.set('Métro', 'METRO');\ntransitModeCorrespondance.set('RailShuttle', 'TRAIN');\ntransitModeCorrespondance.set('RapidTransit', 'BUS');\ntransitModeCorrespondance.set('Shuttle', 'BUS');\ntransitModeCorrespondance.set('SuspendedCableCar', 'FUNICULAR');\ntransitModeCorrespondance.set('Taxi', 'TAXI');\ntransitModeCorrespondance.set('Train', 'TRAIN');\ntransitModeCorrespondance.set('RER', 'TRAIN');\ntransitModeCorrespondance.set('Tramway', 'TRAM');\ntransitModeCorrespondance.set('walking', 'WALK');\ntransitModeCorrespondance.set('bike', 'BIKE');\n\n/**\n * List of transports modes\n */\nconst TRANSPORT_IDS = [\n 'physical_mode:Air',\n 'physical_mode:Boat',\n 'physical_mode:Bus',\n 'physical_mode:BusRapidTransit',\n 'physical_mode:Coach',\n 'physical_mode:Ferry',\n 'physical_mode:Funicular',\n 'physical_mode:LocalTrain',\n 'physical_mode:LongDistanceTrain',\n 'physical_mode:Metro',\n 'physical_mode:RailShuttle',\n 'physical_mode:RapidTransit',\n 'physical_mode:Shuttle',\n 'physical_mode:SuspendedCableCar',\n 'physical_mode:Taxi',\n 'physical_mode:Train',\n 'physical_mode:Tramway'\n];\n\nconst apiKey = 'qWHj6ax6DMttG8DX6tH9CQARaiTgQ1Di';\n\n\nfunction jsonToCoordinates(json: IdfmCoordinates) {\n return new Coordinates(Number(json.lat), Number(json.lon));\n}\n\nfunction last<T>(array: T[]) {\n return array[array.length - 1];\n}\n\n/**\n * stringDate (e.g. 20211117T104516)\n */\nfunction dateStringToTimestamp(stringDate: string, timeZone: string) {\n const yearStr = stringDate.substr(0, 4);\n const monthStr = stringDate.substr(4, 2);\n const dayStr = stringDate.substr(6, 2);\n const hoursStr = stringDate.substr(9, 2);\n const minutesStr = stringDate.substr(11, 2);\n const secondsStr = stringDate.substr(13, 2);\n\n return dateWithTimeZone(\n Number(yearStr),\n Number(monthStr) - 1,\n Number(dayStr),\n Number(hoursStr),\n Number(minutesStr),\n Number(secondsStr),\n timeZone\n ).getTime();\n}\n\n\n/**\n * Singleton.\n */\nclass IdfmRemoteRouter extends RemoteRouter {\n\n /**\n * @override\n */\n get rname() { return 'idfm' as const; }\n\n\n async getItineraries(endpointUrl: string, routerRequest: RouterRequest) {\n const { travelMode } = routerRequest;\n if (travelMode === 'BIKE') {\n // IDFM does not support bike routing, we use Geovelo instead\n return GeoveloRemoteRouter.getItineraries('https://idfm.getwemap.com/marketplace/computedroutes', routerRequest);\n }\n\n const url = this.getURL(endpointUrl, routerRequest);\n\n const res = await (fetch(url, {\n method: 'GET',\n headers: { apiKey }\n }).catch(() => {\n throw RemoteRoutingError.unreachableServer(this.rname, url);\n }));\n\n\n const jsonResponse: IdfmJson = await res.json().catch(() => {\n throw RemoteRoutingError.responseNotParsing(this.rname, url);\n });\n\n // When IDFM failed to calculate an itinerary (ie. start or end\n // point is far from network), it respond a 404 with an error message\n // or a 200 with an error message\n if (jsonResponse && jsonResponse.error) {\n throw RemoteRoutingError.notFound(this.rname, jsonResponse.error.message);\n }\n\n const itineraries = this.parseResponse(jsonResponse);\n\n const sameModeFound = itineraries.some((itinerary) => areTransitAndTravelModeConsistent(itinerary.transitMode, routerRequest.travelMode));\n\n if (!sameModeFound) {\n throw RemoteRoutingError.notFound(\n this.rname,\n 'Selected mode of transport was not found for this itinerary.'\n )\n }\n\n return itineraries;\n }\n\n getURL(endpointUrl: string, routerRequest: RouterRequest) {\n const { origin, destination, waypoints, travelMode } = routerRequest;\n\n if ((waypoints || []).length > 0) {\n Logger.warn(`${this.rname} router uses only the first 2 waypoints (asked ${waypoints?.length})`);\n }\n\n const url = new URL(endpointUrl);\n\n const coreParams = new URLSearchParams();\n coreParams.set('from', `${origin.longitude};${origin.latitude}`);\n coreParams.set('to', `${destination.longitude};${destination.latitude}`);\n coreParams.set('data_freshness', 'realtime');\n\n if (routerRequest.itineraryModifiers?.isWheelchair) {\n coreParams.set('wheelchair', 'true')\n }\n\n if (routerRequest.departureTime) {\n coreParams.set('datetime', routerRequest.departureTime);\n coreParams.set('datetime_represents', 'departure');\n }\n\n let queryParams: URLSearchParams = new URLSearchParams();\n switch (travelMode) {\n case 'WALK':\n queryParams = this.getWalkingQuery();\n break;\n case 'BIKE':\n queryParams = this.getBikeQuery();\n break;\n case 'CAR':\n queryParams = this.getCarQuery();\n break;\n default:\n break;\n }\n\n [coreParams, queryParams].map(params => {\n for (const pair of params.entries()) {\n url.searchParams.append(pair[0], pair[1]);\n }\n });\n\n return url.toString();\n }\n\n getCarQuery() {\n const urlSearchParams = new URLSearchParams();\n\n TRANSPORT_IDS.forEach((id) => {\n urlSearchParams.append('forbidden_uris[]', id);\n });\n\n urlSearchParams.append('first_section_mode[]', 'walking');\n urlSearchParams.append('first_section_mode[]', 'car');\n urlSearchParams.append('last_section_mode[]', 'walking');\n urlSearchParams.append('last_section_mode[]', 'car');\n\n return urlSearchParams;\n }\n\n getWalkingQuery() {\n const urlSearchParams = new URLSearchParams();\n\n TRANSPORT_IDS.forEach((id) => {\n urlSearchParams.append('forbidden_uris[]', id);\n });\n\n urlSearchParams.append('first_section_mode[]', 'walking');\n urlSearchParams.append('last_section_mode[]', 'walking');\n\n return urlSearchParams;\n }\n\n getBikeQuery() {\n const urlSearchParams = new URLSearchParams();\n\n TRANSPORT_IDS.forEach((id) => {\n urlSearchParams.append('forbidden_uris[]', id);\n });\n\n urlSearchParams.append('first_section_mode[]', 'bike');\n urlSearchParams.append('last_section_mode[]', 'bike');\n\n return urlSearchParams;\n }\n\n\n getSectionCoords(section: IdfmSection) {\n let from: IdfmCoordinates | undefined;\n let to: IdfmCoordinates | undefined;\n\n if ('stop_point' in section.from) {\n from = section.from.stop_point.coord;\n } else if ('address' in section.from) {\n from = section.from.address.coord;\n } else {\n from = section.from.poi.coord;\n }\n\n if ('stop_point' in section.to) {\n to = section.to.stop_point.coord;\n } else if ('address' in section.to) {\n to = section.to.address.coord;\n } else {\n to = section.to.poi.coord;\n }\n\n return {\n from: jsonToCoordinates(from),\n to: jsonToCoordinates(to)\n };\n }\n\n /**\n * Since the IDFM API does not provide coords for each step, we need to compute them\n * We trim the coordinates of the leg with the distance of each step and keep the last result as the coords of the step\n * @param {Leg} leg\n */\n findStepsCoord(legCoords: Coordinates[], steps: IdfmIntermediateStep[]) {\n const coords = legCoords;\n\n const duplicatedCoords = [...coords];\n let previousStep = steps[0];\n let accumulatedIndex = 0;\n const outputSteps = [];\n\n for (const [idx, step] of steps.entries()) {\n let newCoords: Coordinates;\n\n let _idCoordsInLeg;\n\n if (idx === 0) {\n _idCoordsInLeg = 0;\n newCoords = coords[0];\n } else if (idx === steps.length - 1) {\n _idCoordsInLeg = coords.length - 1;\n newCoords = last(coords);\n } else if (duplicatedCoords.length === 1) {\n accumulatedIndex++;\n\n _idCoordsInLeg = accumulatedIndex;\n\n newCoords = duplicatedCoords[0];\n\n coords[_idCoordsInLeg] = newCoords;\n } else {\n const result = GeoUtils.trimRoute(duplicatedCoords, duplicatedCoords[0], previousStep.distance);\n accumulatedIndex += result.length - 1;\n\n duplicatedCoords.splice(0, result.length - 1);\n\n _idCoordsInLeg = accumulatedIndex;\n\n newCoords = last(result);\n\n coords[_idCoordsInLeg] = newCoords;\n }\n\n outputSteps.push({\n ...step,\n coords: newCoords\n });\n\n previousStep = step;\n }\n\n return outputSteps;\n }\n\n findStepCoords(step: IdfmSection['path'][number], section: IdfmSection) {\n if ('instruction_start_coordinate' in step) {\n return jsonToCoordinates(step.instruction_start_coordinate);\n }\n\n const via = section.vias?.find(via => via.id === step.via_uri);\n if (via) {\n return jsonToCoordinates(via.access_point.coord);\n }\n }\n\n parseResponse(json: IdfmJson) {\n\n if (!json || !json.journeys) {\n throw RemoteRoutingError.notFound(this.rname, json.error?.message);\n }\n\n const itineraries = [];\n\n const timeZone = json.context.timezone;\n\n for (const jsonItinerary of json.journeys) {\n\n const legs = [];\n\n for (const jsonSection of jsonItinerary.sections) {\n\n if (jsonSection.type === 'waiting' || jsonSection.type === 'transfer') {\n continue;\n }\n\n const { from: startSection, to: endSection } = this.getSectionCoords(jsonSection);\n\n // A section can have multiple same coordinates, we need to remove them\n let existingCoords: string[] = [];\n const legCoords = jsonSection.geojson.coordinates.reduce((acc, [lon, lat]) => {\n if (!existingCoords.includes(`${lon}-${lat}`)) {\n existingCoords = existingCoords.concat(`${lon}-${lat}`);\n acc.push(new Coordinates(lat, lon));\n }\n return acc;\n }, [] as Coordinates[]);\n\n const stepsBuilder = new StepsBuilder().setStart(startSection).setEnd(endSection).setPathCoords(legCoords);\n let transportInfo: TransportInfo | undefined;\n let transitMode = transitModeCorrespondance.get(jsonSection.mode) as TransitMode;\n\n if (jsonSection.path) {\n const useIDFMSteps = jsonSection.path.every(step => 'instruction_start_coordinate' in step || step.via_uri);\n const idfmIntermediateSteps = [];\n\n for (const jsonPathLink of jsonSection.path) {\n let coords: Coordinates;\n if (useIDFMSteps) {\n coords = this.findStepCoords(jsonPathLink, jsonSection)!;\n\n const intermediateStep = {\n name: jsonPathLink.name,\n distance: jsonPathLink.length,\n coords\n };\n\n stepsBuilder.addStepInfo(intermediateStep);\n } else {\n idfmIntermediateSteps.push({\n name: jsonPathLink.name,\n distance: jsonPathLink.length,\n });\n }\n }\n\n if (!useIDFMSteps) {\n stepsBuilder.setStepsInfo(this.findStepsCoord(legCoords, idfmIntermediateSteps));\n }\n }\n\n if (jsonSection.type === 'public_transport') {\n transportInfo = {\n name: jsonSection.display_informations.code,\n routeColor: jsonSection.display_informations.color,\n routeTextColor: jsonSection.display_informations.text_color,\n directionName: jsonSection.display_informations.direction\n };\n\n transitMode = transitModeCorrespondance.get(jsonSection.display_informations.physical_mode) as TransitMode;\n\n const legStep: MinStepInfo = {\n coords: legCoords[0],\n name: transportInfo.directionName,\n distance: jsonSection.geojson.properties[0].length,\n type: 'transit'\n };\n stepsBuilder.setStepsInfo([legStep]);\n }\n\n const leg = new Leg({\n transitMode,\n duration: jsonSection.duration,\n startTime: dateStringToTimestamp(jsonSection.departure_date_time, timeZone),\n endTime: dateStringToTimestamp(jsonSection.arrival_date_time, timeZone),\n start: {\n name: jsonSection.from.name,\n coords: startSection\n },\n end: {\n name: jsonSection.to.name,\n coords: endSection\n },\n coords: legCoords,\n transportInfo,\n steps: stepsBuilder.build()\n });\n legs.push(leg);\n }\n\n const itinerary = new Itinerary({\n duration: jsonItinerary.duration,\n startTime: dateStringToTimestamp(jsonItinerary.departure_date_time, timeZone),\n endTime: dateStringToTimestamp(jsonItinerary.arrival_date_time, timeZone),\n origin: this.getSectionCoords(jsonItinerary.sections[0]).from,\n destination: this.getSectionCoords(last(jsonItinerary.sections)).to,\n legs\n });\n\n itineraries.push(itinerary);\n }\n\n return itineraries;\n }\n}\n\nexport default new IdfmRemoteRouter();","/* eslint-disable max-statements */\n\nimport { Coordinates, Level } from '@wemap/geo';\nimport { rad2deg, positiveMod } from '@wemap/maths';\nimport { LineString, Position } from 'geojson';\n\nimport Itinerary from '../../model/Itinerary.js';\nimport Leg from '../../model/Leg.js';\nimport StepsBuilder from '../../model/StepsBuilder.js';\nimport RemoteRouter from '../RemoteRouter.js';\nimport { type TravelMode } from '../../model/TravelMode.js';\nimport { type TransitMode } from '../../model/TransitMode.js';\nimport { type RouterRequest } from '../../model/RouterRequest.js';\nimport { RemoteRoutingError } from '../../RoutingError.js';\nimport { HorizontalDirection, HorizontalStepType } from '../../model/Step.js';\n\ntype OsrmCoordinates = Position;\ntype OsrmModifier = 'sharp right' | 'sharp left' | 'slight right'\n | 'slight left' | 'right' | 'left' | 'u turn' | 'straight';\ntype OsrmManeuverType = 'depart' | 'turn' | 'roundabout' | 'exit roundabout' | 'arrive';\ntype OsrmStep = {\n geometry: LineString,\n distance: number,\n duration: number,\n name?: string,\n maneuver: {\n bearing_before: number,\n bearing_after: number,\n location: OsrmCoordinates,\n modifier: OsrmModifier,\n type: OsrmManeuverType\n exit?: number\n }\n};\ntype OsrmJson = {\n code?: string,\n message?: string,\n routes?: {\n geometry: LineString,\n legs: {\n distance: number,\n duration: number,\n steps: OsrmStep[]\n }[],\n distance: number,\n duration: number,\n weight_name: string,\n weight: number\n }[],\n waypoints?: []\n};\n\ntype OsrmMode = 'driving' | 'walking' | 'bike' | 'pmr' | 'bike-safest' | 'bike-fastest';\n\nconst outputModeCorrespondance = new Map<TravelMode, TransitMode>();\noutputModeCorrespondance.set('CAR', 'CAR');\noutputModeCorrespondance.set('WALK', 'WALK');\noutputModeCorrespondance.set('BIKE', 'BIKE');\n\n/**\n * Singleton.\n */\nclass OsrmRemoteRouter extends RemoteRouter {\n\n get rname() { return 'osrm' as const; }\n\n async getItineraries(endpointUrl: string, routerRequest: RouterRequest) {\n const url = this.getURL(endpointUrl, routerRequest);\n\n const res = await (fetch(url).catch(() => {\n throw RemoteRoutingError.unreachableServer(this.rname, url);\n }));\n\n const jsonResponse = await res.json().catch(() => {\n throw RemoteRoutingError.responseNotParsing(this.rname, url);\n });\n\n return this.parseResponse(jsonResponse, routerRequest.origin, routerRequest.destination, routerRequest.travelMode);\n }\n\n /**\n * @throws {TravelModeCorrespondanceNotFound}\n */\n getURL(endpointUrl: string, routerRequest: RouterRequest) {\n const { origin, destination } = routerRequest;\n\n const osrmMode = this.inputModeCorrespondance(routerRequest);\n const waypoints = [origin, ...routerRequest.waypoints || [], destination];\n\n let url = endpointUrl + '/route/v1/' + osrmMode + '/';\n url += waypoints.map(waypoint => [waypoint.longitude + ',' + waypoint.latitude]).join(';');\n url += '?geometries=geojson&overview=full&steps=true';\n routerRequest.provideItineraryAlternatives && (url += '&alternatives=true')\n return url;\n }\n\n inputModeCorrespondance = (routerRequest: RouterRequest): OsrmMode => {\n const { travelMode, travelModePreference: preference } = routerRequest;\n if (travelMode === 'WALK' && routerRequest.itineraryModifiers?.isWheelchair) return 'pmr';\n if (travelMode === 'WALK') return 'walking';\n if (travelMode === 'BIKE') {\n if (preference === 'FASTEST') return 'bike-fastest';\n if (preference === 'SAFEST') return 'bike-safest';\n if (preference === 'TOURISM') return 'bike-safest';\n return 'bike-safest';\n }\n if (travelMode === 'CAR') return 'driving';\n throw RemoteRoutingError.travelModeUnimplemented(this.rname, travelMode);\n }\n\n osrmTypeToStepType(type: OsrmManeuverType): HorizontalStepType {\n switch (type) {\n case 'depart':\n return 'depart';\n case 'turn':\n return 'turn';\n case 'roundabout':\n return 'roundabout';\n case 'exit roundabout':\n return 'exit-roundabout';\n case 'arrive':\n return 'arrive';\n default:\n return 'turn';\n }\n }\n\n osrmModifierToStepDirection(modifier: OsrmModifier): HorizontalDirection {\n switch (modifier) {\n case 'sharp right':\n return 'sharp-right';\n case 'sharp left':\n return 'sharp-left';\n case 'slight right':\n return 'slight-right';\n case 'slight left':\n return 'slight-left';\n case 'u turn':\n return 'u-turn';\n default:\n return modifier;\n }\n }\n\n coordinatesToJson({ lat, lng, level }: Coordinates): OsrmCoordinates {\n if (level === null) {\n return [lng, lat];\n }\n if (Level.isRange(level)) {\n return [lng, lat, level[0]];\n }\n return [lng, lat, level];\n }\n\n /**\n * @param {object} json\n * @returns {Coordinates}\n */\n jsonToCoordinates(json: OsrmCoordinates): Coordinates {\n const coords = new Coordinates(json[1], json[0]);\n if (json.length > 2) {\n coords.level = json[2] as number;\n }\n return coords;\n }\n\n getModifierFromAngle(_angle: number): OsrmModifier {\n\n const angle = positiveMod(rad2deg(_angle), 360);\n\n if (angle > 0 && angle < 60) {\n return 'sharp right';\n }\n if (angle >= 60 && angle < 140) {\n return 'right';\n }\n if (angle >= 140 && angle < 160) {\n return 'slight right';\n }\n if (angle >= 160 && angle <= 200) {\n return 'straight';\n }\n if (angle > 200 && angle <= 220) {\n return 'slight left';\n }\n if (angle > 220 && angle <= 300) {\n return 'left';\n }\n if (angle > 300 && angle < 360) {\n return 'sharp left';\n }\n return 'u turn';\n }\n\n noRouteFoundJson(message: object) {\n return {\n 'code': 'NoRoute',\n message\n };\n }\n\n /**\n * @deprecated\n */\n itineraryToOsrmJson(itinerary: Itinerary): OsrmJson {\n\n const lastLegId = itinerary.legs.length - 1;\n const itinerarySteps = itinerary.steps;\n\n const jsonLegs = itinerary.legs.map(({ distance, duration, coords }, idLeg) => {\n\n // Filter steps which are in leg\n const legSteps = itinerarySteps.filter(step =>\n coords.find(_coords => _coords.equals(step.coords))\n );\n\n const lastStepId = legSteps.length - 1;\n\n return {\n distance,\n duration: duration || 0,\n steps: legSteps.map((step, idStep, arr) => {\n\n let type: OsrmManeuverType = idStep === 0 && idLeg === 0 ? 'depart' : 'turn';\n type = idStep === lastStepId && idLeg === lastLegId ? 'arrive' : type;\n\n const stepCoordsIdx = coords.findIndex(p => p.equals(step.coords));\n const nextStepCoordsIdx = idStep === lastStepId\n ? stepCoordsIdx\n : coords.findIndex(p => p.equals(arr[idStep + 1].coords));\n\n const osrmStep: OsrmStep = {\n geometry: {\n type: 'LineString',\n coordinates: coords.slice(stepCoordsIdx, nextStepCoordsIdx + 1).map(this.coordinatesToJson)\n },\n distance: step.distance,\n duration: step.duration || 0,\n ...(step.name && { name: step.name }),\n maneuver: {\n bearing_before: rad2deg(step.previousBearing),\n bearing_after: rad2deg(step.nextBearing),\n location: this.coordinatesToJson(step.coords),\n modifier: this.getModifierFromAngle(step.angle),\n type\n },\n };\n return osrmStep;\n })\n };\n });\n\n return {\n 'code': 'Ok',\n 'routes': [\n {\n 'geometry': {\n 'type': 'LineString',\n 'coordinates': itinerary.coords.map(this.coordinatesToJson)\n },\n 'legs': jsonLegs,\n 'distance': itinerary.distance,\n 'duration': itinerary.duration,\n 'weight_name': 'routability',\n 'weight': 0\n }\n ],\n 'waypoints': []\n };\n }\n\n parseResponse(json: OsrmJson, origin: Coordinates, destination: Coordinates, travelMode: TravelMode) {\n\n const transitMode = outputModeCorrespondance.get(travelMode)!;\n\n const { routes: jsonRoutes } = json;\n if (!jsonRoutes) {\n throw RemoteRoutingError.notFound(this.rname, json.message);\n }\n\n return jsonRoutes.map(jsonItinerary => {\n\n const legs = jsonItinerary.legs.map((jsonLeg) => {\n const legCoords = jsonLeg.steps\n .map(step => step.geometry.coordinates.map(this.jsonToCoordinates))\n .flat()\n // Remove duplicates\n .filter((coords, idx, arr) => idx === 0 || !arr[idx - 1].equals(coords));\n\n const startCoords = legCoords[0];\n const endCoords = legCoords[legCoords.length - 1];\n\n const stepsBuilder = new StepsBuilder().setPathCoords(legCoords).setStart(startCoords).setEnd(endCoords);\n jsonLeg.steps?.forEach(({ maneuver, name: stepName, distance, duration }) => {\n\n const stepCoords = this.jsonToCoordinates(maneuver.location);\n\n // Sometimes, OSRM step does not have the same coordinates than a point in legCoords.\n // ex: first step of https://routing-orsm.getwemap.com/route/v1/walking/2.33222164147,48.87084765712;2.3320734,48.8730212?geometries=geojson&overview=full&steps=true\n // That is why we look for the closest point.\n const distances = legCoords.map(coords => coords.distanceTo(stepCoords));\n const idStepCoordsInLeg = distances.indexOf(Math.min(...distances));\n if (idStepCoordsInLeg < 0) {\n throw new Error('Osrm Parser: Cannot find step coords in leg coordinates');\n }\n\n const name = maneuver.exit !== undefined ? maneuver.exit.toString() : stepName;\n\n stepsBuilder.addStepInfo({\n coords: legCoords[idStepCoordsInLeg],\n name,\n distance,\n duration,\n type: this.osrmTypeToStepType(maneuver.type),\n direction: this.osrmModifierToStepDirection(maneuver.modifier)\n });\n })\n\n return new Leg({\n transitMode,\n duration: jsonLeg.duration,\n coords: legCoords,\n start: {\n coords: startCoords\n },\n end: {\n coords: endCoords\n },\n steps: stepsBuilder.build()\n });\n });\n\n return new Itinerary({\n duration: jsonItinerary.duration,\n origin,\n destination,\n legs\n });\n });\n }\n}\n\nexport default new OsrmRemoteRouter();","import Polyline from '@mapbox/polyline';\n\nimport { Coordinates } from '@wemap/geo';\nimport Logger from '@wemap/logger';\n\nimport Itinerary from '../../model/Itinerary.js';\nimport Leg, { type TransportInfo } from '../../model/Leg.js';\nimport StepsBuilder from '../../model/StepsBuilder.js';\nimport RemoteRouter from '../RemoteRouter.js';\nimport { type TravelMode } from '../../model/TravelMode.js';\nimport { type RouterRequest } from '../../model/RouterRequest.js';\nimport { RemoteRoutingError } from '../../RoutingError.js';\n\ntype OtpCoordinates = { lat: number, lon: number };\ntype FromTo = OtpCoordinates & { name: string };\ntype FromToPT = FromTo & { stopId: string, stopCode: string };\n\ntype CommonLeg = {\n startTime: number,\n endTime: number,\n legGeometry: {\n points: string,\n length: number\n },\n duration: number,\n};\n\ntype LegWalk = CommonLeg & {\n mode: 'WALK',\n from: FromTo,\n to: FromTo,\n steps: (OtpCoordinates & {\n distance: number,\n streetName: string\n })[]\n}\n\ntype LegPT = CommonLeg & {\n mode: 'BUS' | 'TRAM',\n from: FromToPT,\n to: FromToPT,\n intermediateStops: FromToPT,\n routeShortName: 'string',\n routeColor?: 'string',\n routeTextColor?: 'string',\n headsign: 'string'\n}\n\ntype OtpJson = {\n plan: {\n from: FromTo,\n to: FromTo,\n itineraries: {\n duration: number,\n startTime: number,\n endTime: number,\n walkDistance: number,\n legs: (LegWalk | LegPT)[]\n }[]\n }\n}\n\nfunction isLegPT(leg: LegPT | LegWalk): leg is LegPT {\n return leg.mode === 'BUS' || leg.mode === 'TRAM';\n}\n\nfunction jsonToCoordinates(json: OtpCoordinates) {\n return new Coordinates(json.lat, json.lon);\n}\n\n\n/**\n * Input mode correspondance\n */\nconst inputModeCorrespondance = new Map<TravelMode, string>();\ninputModeCorrespondance.set('CAR', 'CAR');\ninputModeCorrespondance.set('WALK', 'WALK');\ninputModeCorrespondance.set('BIKE', 'BICYCLE');\ninputModeCorrespondance.set('TRANSIT', 'WALK,TRANSIT');\n\n/**\n * Singleton.\n */\nclass OtpRemoteRouter extends RemoteRouter {\n\n get rname() { return 'otp' as const; }\n\n async getItineraries(endpointUrl: string, routerRequest: RouterRequest) {\n const url = this.getURL(endpointUrl, routerRequest);\n const res = await (fetch(url).catch(() => {\n throw RemoteRoutingError.unreachableServer(this.rname, url);\n }));\n\n const jsonResponse = await res.json().catch(() => {\n throw RemoteRoutingError.responseNotParsing(this.rname, url);\n });\n return this.parseResponse(jsonResponse);\n }\n\n getURL(endpointUrl: string, routerRequest: RouterRequest) {\n const { origin, destination, waypoints, travelMode } = routerRequest;\n\n const otpMode = inputModeCorrespondance.get(travelMode);\n if (!otpMode) {\n throw RemoteRoutingError.travelModeUnimplemented(this.rname, travelMode);\n }\n\n if ((waypoints || []).length > 0) {\n Logger.warn(`${this.rname} router uses only the first 2 waypoints (asked ${waypoints?.length})`);\n }\n\n const fromPlace = `fromPlace=${origin.latitude},${origin.longitude}`;\n const toPlace = `toPlace=${destination.latitude},${destination.longitude}`;\n const queryMode = `mode=${otpMode}`;\n\n const url = new URL(endpointUrl);\n let { search } = url;\n search = (search ? `${search}&` : '?') + `${fromPlace}&${toPlace}&${queryMode}`;\n\n return `${url.origin}${url.pathname}${search}`;\n }\n\n\n /**\n * Generate multi itineraries from OTP JSON\n */\n parseResponse(json: OtpJson) {\n\n const { plan: jsonPlan } = json;\n if (!jsonPlan) {\n throw RemoteRoutingError.notFound(this.rname);\n }\n\n const itineraries = [];\n\n const itinerariesOrigin = jsonToCoordinates(jsonPlan.from);\n const itinerariesDestination = jsonToCoordinates(jsonPlan.to);\n\n for (const jsonItinerary of jsonPlan.itineraries) {\n\n const legs: Leg[] = [];\n\n for (const jsonLeg of jsonItinerary.legs) {\n\n const startCoordinates = jsonToCoordinates(jsonLeg.from);\n const endCoordinates = jsonToCoordinates(jsonLeg.to);\n\n const legCoords = Polyline.decode(jsonLeg.legGeometry.points)\n .map(([lat, lon]) => new Coordinates(lat, lon));\n\n let transportInfo: TransportInfo | undefined;\n const stepsBuilder = new StepsBuilder().setStart(startCoordinates).setEnd(endCoordinates).setPathCoords(legCoords);\n\n if (isLegPT(jsonLeg)) {\n\n transportInfo = {\n name: jsonLeg.routeShortName,\n routeColor: jsonLeg.routeColor,\n routeTextColor: jsonLeg.routeTextColor,\n directionName: jsonLeg.headsign\n };\n\n stepsBuilder.addStepInfo({\n coords: legCoords[0],\n name: jsonLeg.headsign,\n type: 'transit'\n });\n\n } else {\n\n jsonLeg.steps.forEach(jsonStep => {\n // OTP step does not have the same coordinates than a point in legCoords.\n // That is why we look for the closest point.\n const distances = legCoords.map(coords => coords.distanceTo(jsonToCoordinates(jsonStep)));\n const idStepCoordsInLeg = distances.indexOf(Math.min(...distances));\n if (idStepCoordsInLeg < 0) {\n throw new Error('OTP Parser: Cannot find closest step');\n }\n\n stepsBuilder.addStepInfo({\n coords: legCoords[idStepCoordsInLeg],\n name: jsonStep.streetName,\n type: 'turn'\n });\n })\n }\n\n\n const leg = new Leg({\n transitMode: jsonLeg.mode,\n duration: jsonLeg.duration,\n startTime: jsonLeg.startTime,\n endTime: jsonLeg.endTime,\n start: {\n name: jsonLeg.from.name,\n coords: jsonToCoordinates(jsonLeg.from)\n },\n end: {\n name: jsonLeg.to.name,\n coords: jsonToCoordinates(jsonLeg.to)\n },\n coords: legCoords,\n transportInfo,\n steps: stepsBuilder.build()\n });\n\n legs.push(leg);\n\n }\n const itinerary = new Itinerary({\n duration: jsonItinerary.duration,\n startTime: jsonItinerary.startTime,\n endTime: jsonItinerary.endTime,\n origin: itinerariesOrigin,\n destination: itinerariesDestination,\n legs\n });\n itineraries.push(itinerary);\n }\n\n return itineraries;\n }\n}\n\nexport default new OtpRemoteRouter();\n","import { Coordinates } from '@wemap/geo';\n\nimport RemoteRouter from '../RemoteRouter.js';\nimport { RouterRequest } from '../../model/RouterRequest.js';\nimport Itinerary from '../../model/Itinerary.js';\nimport { RemoteRoutingError } from '../../RoutingError.js';\n\n\ntype WemapRouterRequest = Omit<RouterRequest, 'origin' | 'destination' | 'waypoints'> & {\n mapId?: number,\n origin: Coordinates | number | string\n destination: Coordinates | number | string\n waypoints?: (Coordinates | number | string)[]\n}\n\n/**\n * Singleton.\n */\nclass WemapMultiRemoteRouter extends RemoteRouter {\n\n get rname() { return 'wemap-multi' as const; }\n\n async getItineraries(endpointUrl: string, routerRequest: WemapRouterRequest) {\n const { origin, destination, waypoints } = routerRequest;\n const payload = {\n ...routerRequest,\n origin: origin instanceof Coordinates ? origin.toJson() : origin,\n destination: destination instanceof Coordinates ? destination.toJson() : destination,\n ...(waypoints && {waypoints: waypoints.map(w => w instanceof Coordinates ? w.toJson() : w)})\n };\n\n const res = await (fetch(endpointUrl, {\n method: 'POST',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(payload)\n }).catch(() => {\n throw RemoteRoutingError.unreachableServer(this.rname, endpointUrl);\n }));\n\n const jsonResponse = await res.json().catch(() => {\n throw RemoteRoutingError.responseNotParsing(this.rname, endpointUrl);\n });\n\n if (jsonResponse.error) {\n throw RemoteRoutingError.notFound(this.rname, jsonResponse.error)\n }\n\n return (jsonResponse.itineraries || []).map(Itinerary.fromJson) as Itinerary[];\n }\n\n}\n\nexport default new WemapMultiRemoteRouter();\n","/* eslint-disable max-statements */\nimport { Coordinates } from '@wemap/geo';\nimport { StringUtils } from '@wemap/utils';\n\nimport Itinerary from '../../model/Itinerary.js';\nimport Leg from '../../model/Leg.js';\nimport RemoteRouter from '../RemoteRouter.js';\nimport StepsBuilder from '../../model/StepsBuilder.js';\nimport { RouterRequest } from '../../model/RouterRequest.js';\nimport { RemoteRoutingError } from '../../RoutingError.js';\nimport { TictactripResponse, TictactripRequest } from './type.js';\nimport { getDurationFromLength } from '../../Utils.js';\nimport OsrmRemoteRouter from '../osrm/OsrmRemoteRouter.js';\n\nconst OsrmEndpointUrl = 'https://routing-osrm.getwemap.com';\n\n/**\n * Singleton.\n */\nclass TictactripRemoteRouter extends RemoteRouter {\n\n /**\n * @override\n */\n get rname() { return 'tictactrip' as const; }\n\n\n async getSegmentItinerary(origin: Coordinates, destination: Coordinates) {\n const duration = getDurationFromLength(origin.distanceTo(destination));\n\n // If the origin is less than 5 minutes away, do not fetch itinerary\n if (duration < 5 * 60) {\n return null;\n }\n\n let itinerary: Itinerary | null = null;\n // If the origin is less than 30 minutes away \n if (duration < 30 * 60) {\n itinerary = (await OsrmRemoteRouter.getItineraries(OsrmEndpointUrl, {\n origin: origin,\n destination: destination,\n travelMode: 'WALK' as const,\n provideItineraryAlternatives: false,\n optimizeWaypoints: false\n }))[0];\n \n } else {\n itinerary = (await OsrmRemoteRouter.getItineraries(OsrmEndpointUrl, {\n origin: origin,\n destination: destination,\n travelMode: 'CAR' as const,\n provideItineraryAlternatives: false,\n optimizeWaypoints: false\n }))[0];\n }\n\n\n return itinerary;\n }\n\n\n getItineraryFromStation(origin: Coordinates, destination: Coordinates) {\n return OsrmRemoteRouter.getItineraries(OsrmEndpointUrl, {\n origin: origin,\n destination: destination,\n travelMode: 'WALK' as const,\n });\n }\n async getItineraries(endpointUrl: string, routerRequest: RouterRequest) {\n const bodyParams = this.getBodyParams(routerRequest);\n\n const url = new URL(endpointUrl);\n\n const res = await (fetch(url, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(bodyParams)\n }).catch(() => {\n throw RemoteRoutingError.unreachableServer(this.rname, url.toString());\n }));\n\n\n const jsonResponse: TictactripResponse = await res.json().catch(() => {\n throw RemoteRoutingError.responseNotParsing(this.rname, url.toString());\n });\n\n const itineraries = await this.parseResponse(jsonResponse, routerRequest);\n\n return itineraries;\n }\n\n getBodyParams(routerRequest: RouterRequest): TictactripRequest {\n const { origin, destination } = routerRequest;\n return {\n origin: {\n latitude: origin.lat,\n longitude: origin.lng,\n },\n destination: {\n latitude: destination.lat,\n longitude: destination.lng,\n },\n outbound_date: routerRequest.departureTime || new Date().toISOString(),\n passengers: [{ age: 30 }],\n };\n }\n\n async parseResponse(json: TictactripResponse, routerRequest: RouterRequest) {\n if (!json || !json.trips) return [];\n return await Promise.all(Object.values(json.trips).filter((trip) => trip.transportType === 'TRAIN').map(async trip => {\n const legs = trip.segments.map(segment => {\n const transitMode = StringUtils.toUpperCase(segment.transportType);\n const startSection = new Coordinates(segment.origin.latitude, segment.origin.longitude);\n const endSection = new Coordinates(segment.destination.latitude, segment.destination.longitude);\n\n const legCoords = [startSection, endSection];\n const stepsBuilder = new StepsBuilder().setStart(startSection).setEnd(endSection).setPathCoords(legCoords);\n stepsBuilder.setStepsInfo([{\n coords: startSection,\n type: 'depart',\n direction: null,\n }, {\n coords: endSection,\n type: 'arrive',\n direction: null,\n }]);\n\n return new Leg({\n start: {\n name: segment.origin.name,\n coords: startSection,\n },\n end: {\n name: segment.destination.name,\n coords: endSection,\n },\n coords: [\n startSection,\n endSection,\n ],\n transitMode: transitMode,\n duration: segment.durationMinutes * 60,\n startTime: new Date(segment.departureLocalISO).getTime(),\n endTime: new Date(segment.arrivalLocalISO).getTime(),\n transportInfo: {\n name: segment.provider.name,\n price: segment.priceCents / 100,\n directionName: segment.destination.name,\n },\n steps: stepsBuilder.build()\n });\n });\n \n let startItinerary: Itinerary | null = null;\n let endItinerary: Itinerary | null = null;\n const mergedLegs: Leg[] = [];\n \n // Get itinerary from origin to first station\n const firstStation = trip.segments[0]?.origin;\n if (firstStation) {\n const firstStationCoords = new Coordinates(firstStation.latitude, firstStation.longitude);\n const origin = routerRequest.origin;\n\n startItinerary = await this.getSegmentItinerary(origin, firstStationCoords).catch(() => null);\n\n if (startItinerary) {\n startItinerary.legs[0].start.name = firstStation.name;\n mergedLegs.push(...startItinerary.legs);\n }\n }\n\n // Put main train legs\n mergedLegs.push(...legs);\n \n // Get itinerary from last station to destination\n const lastStation = trip.segments[trip.segments.length - 1]?.destination;\n if (lastStation) {\n const lastStationCoords = new Coordinates(lastStation.latitude, lastStation.longitude);\n const destination = routerRequest.destination;\n\n endItinerary = await this.getSegmentItinerary(lastStationCoords, destination).catch(() => null);\n\n if (endItinerary) {\n endItinerary.legs[endItinerary.legs.length - 1].end.name = lastStation.name;\n mergedLegs.push(...endItinerary.legs);\n }\n }\n\n // Merge legs\n return new Itinerary({\n origin: new Coordinates(trip.origin.latitude, trip.origin.longitude),\n destination: new Coordinates(trip.destination.latitude, trip.destination.longitude),\n duration: trip.durationMinutes * 60,\n startTime: new Date(trip.departureLocalISO).getTime(),\n endTime: new Date(trip.arrivalLocalISO).getTime(),\n legs: mergedLegs,\n });\n }));\n }\n}\n\nexport default new TictactripRemoteRouter();","import RemoteRouter from './RemoteRouter.js';\nimport CitywayRemoteRouter from './cityway/CitywayRemoteRouter.js';\nimport NavitiaRemoteRouter from './navitia/NavitiaRemoteRouter.js';\nimport DeutscheBahnRemoteRouter from './deutsche-bahn/DeutscheBahnRemoteRouter.js';\nimport IdfmRemoteRouter from './idfm/IdfmRemoteRouter.js';\nimport OsrmRemoteRouter from './osrm/OsrmRemoteRouter.js';\nimport OtpRemoteRouter from './otp/OtpRemoteRouter.js';\nimport WemapMultiRemoteRouter from './wemap-multi/WemapMultiRemoteRouter.js';\nimport { RouterRequest } from '../model/RouterRequest.js';\nimport { RemoteRoutingError } from '../RoutingError.js';\nimport TictactripRemoteRouter from './tictactrip/TictactripRemoteRouter.js';\n\nconst remoteRouters = [\n CitywayRemoteRouter,\n NavitiaRemoteRouter,\n DeutscheBahnRemoteRouter,\n IdfmRemoteRouter,\n OsrmRemoteRouter,\n OtpRemoteRouter,\n TictactripRemoteRouter,\n WemapMultiRemoteRouter\n] as const;\n\nexport type RemoteRouterName = typeof remoteRouters[number]['rname'];\n\nexport type RoutingFallbackStrategy = { name: RemoteRouterName, endpointUrl: string }[];\n\n/**\n * Singleton\n */\nclass RemoteRouterManager {\n\n getRouterByName(name: RemoteRouterName): RemoteRouter {\n return remoteRouters.find(remoteRouter => remoteRouter.rname === name) as RemoteRouter;\n }\n\n async getItineraries(name: RemoteRouterName, endpointUrl: string, routerRequest: RouterRequest) {\n const router = this.getRouterByName(name);\n if (!router) {\n throw RemoteRoutingError.notFound(name, `Unknown \"${name}\" remote router`);\n }\n return router.getItineraries(endpointUrl, routerRequest);\n }\n\n async getItinerariesWithFallback(routerRequest: RouterRequest, fallbackStrategy: RoutingFallbackStrategy) {\n let itineraries;\n const errors = [];\n for (const { name, endpointUrl } of fallbackStrategy) {\n try {\n itineraries = await this.getItineraries(name, endpointUrl, routerRequest);\n if (itineraries.length) {\n return itineraries;\n }\n } catch (error) {\n if (error instanceof RemoteRoutingError) {\n errors.push({\n name,\n endpointUrl,\n error\n });\n } else {\n throw error;\n }\n }\n }\n\n const routersNames = fallbackStrategy.map(({ name }) => name).join(', ');\n const errorsMessages = errors.map(routerError => `(${routerError.name}) Could not find an itinerary on endpoint: ${routerError.endpointUrl}. Details: ${routerError.error.message}`).join('\\n');\n\n throw RemoteRoutingError.notFound(routersNames, errorsMessages)\n }\n}\n\nexport default new RemoteRouterManager();\n","/* eslint-disable complexity */\n/* eslint-disable max-statements */\n\nimport CustomGraphMap from './CustomGraphMap.js';\nimport RemoteRouterManager, { type RoutingFallbackStrategy } from '../remote/RemoteRouterManager.js';\nimport Itinerary from '../model/Itinerary.js';\nimport WemapMultiRemoteRouter from '../remote/wemap-multi/WemapMultiRemoteRouter.js';\nimport GraphRoute from '../graph/GraphRoute.js';\nimport GraphRouterOptionsBuilder from '../graph/GraphRouterOptionsBuilder.js';\nimport { type RouterRequest } from '../model/RouterRequest.js';\nimport { RemoteRoutingError, WemapMultiRoutingError } from '../RoutingError.js';\n\n\nclass WemapMultiRouter {\n\n maps: CustomGraphMap[] = [];\n\n get rname() {\n return 'wemap-multi';\n }\n\n addIOMap(customGraphMap: CustomGraphMap) {\n this.maps.push(customGraphMap);\n }\n\n removeIOMap(customGraphMap: CustomGraphMap) {\n this.maps = this.maps.filter(map => map !== customGraphMap);\n }\n\n removeAllMaps() {\n this.maps = [];\n }\n\n getMapByName(mapId: string) {\n return this.maps.find(map => map.name === mapId);\n }\n\n async getItineraries(routerRequest: RouterRequest, fallbackStrategy: RoutingFallbackStrategy = [], targetMaps = this.maps): Promise<Itinerary[]> {\n\n const { origin, destination } = routerRequest;\n\n /*\n * Here, we try to get the shortest path using io maps networks and a remote router server.\n */\n\n /**\n * ----- 1 -----\n * Parse function params\n * -------------\n */\n\n // Avoid cycles on remoteRouters\n fallbackStrategy = fallbackStrategy.filter(({ name }) => name !== WemapMultiRemoteRouter.rname) || [];\n\n /*\n * ----- 2 -----\n * Retrieve the IO maps to consider for this itinerary\n * -------------\n *\n * By default, all maps in this.maps are considered\n * If options.targetMaps is defined, only use this subset\n */\n // const ioMapsToTest = this.getIoMapsFromOptions(options);\n // TODO: map it with Wemap backend\n const ioMapsToTest = targetMaps;\n\n /*\n * If there is no local map to test, use remote router directly.\n * This should happen:\n * 1 - this.maps is empty\n * 2 - options.targetMaps is defined but empty\n * 3 - intersection of this.maps and options.targetMaps is empty\n */\n if (!ioMapsToTest.length) {\n return await RemoteRouterManager.getItinerariesWithFallback(routerRequest, fallbackStrategy);\n }\n\n\n /**\n * ----- 3 -----\n * Run the IO Maps - Remote Routers logic\n * -------------\n *\n * For this purpose we have to consider 5 use cases\n *\n */\n\n let ioMapRoute: GraphRoute | null;\n let ioMapItinerary: Itinerary;\n\n // Find the first map where the \"origin\" is inside.\n const mapWithOrigin = ioMapsToTest.find(map => map.isPointInside(origin));\n\n\n // Create GraphRouterOptions from request\n const routerOptions = GraphRouterOptionsBuilder.fromJson(routerRequest.itineraryModifiers || {});\n\n /*\n * Case 1\n *\n * If \"origin\" and \"destination\" are in the same map, use the local router.\n */\n if (mapWithOrigin && mapWithOrigin.isPointInside(destination)) {\n\n ioMapRoute = mapWithOrigin.getRouteInsideMap(origin, destination, routerOptions);\n if (!ioMapRoute) {\n throw WemapMultiRoutingError.notFound(mapWithOrigin.name || \"\")\n }\n\n return [Itinerary.fromGraphRoute(ioMapRoute)];\n }\n\n // Find the first map where the \"destination\" is inside.\n // Note: At this step, mapWithDestination is necessarily different from mapWithOrigin\n const mapWithDestination = ioMapsToTest.find(map => map.isPointInside(destination));\n\n\n let remoteRouterItineraries: Itinerary[];\n\n /*\n * Case 2\n *\n * If no io map have been found for \"origin\" and \"destination\", therefore use remote router.\n */\n if (!mapWithOrigin && !mapWithDestination) {\n return await RemoteRouterManager.getItinerariesWithFallback(routerRequest, fallbackStrategy);\n }\n\n /**\n * Case 3\n *\n * If a map has been found for the \"origin\" but not for the \"destination\", so:\n * - A first itinerary (firstRoute) is calculated from \"origin\" to an \"entrypoint\"\n * of the IO map network using the wemap router.\n * - A second itinerary (secondRoute) is calculated from an \"entrypoint\" to the\n * \"destination\" using remote routers.\n * Itinerary returned is the concatenation of the both itineraries.\n *\n * Note: Check the mapWithDestination.getBestItineraryFromEntryPointsToDestination to understand\n * which \"entrypoint\" is chosen by the algorithm\n */\n if (mapWithOrigin && !mapWithDestination) {\n\n if (!mapWithOrigin.entryPoints.length) {\n throw WemapMultiRoutingError.notFound(mapWithOrigin.name || '',\n `A map including the \"origin\" but the \"destination\" has been \n found (${mapWithOrigin.name}), however, no \"entrypoints\" have been found to go out`\n )\n }\n\n const customError = (details: string) => 'Tried to calculate an itinerary from \"origin\" '\n + `to \"entrypoints\" using wemap router on local map \"${mapWithOrigin.name}\" and `\n + 'an itinerary from \"entrypoints\" to \"destination\" using remote routers '\n + `(${fallbackStrategy.map(r => r.name).join(', ')}), but failed. `\n + `Details: ${details}.`;\n\n ioMapRoute = mapWithOrigin.getBestRouteFromOriginToEntryPoints(origin, destination, routerOptions);\n if (!ioMapRoute) {\n const details = `No route found from ${origin.toString()} to entry points in map: ${mapWithOrigin.name}`;\n throw WemapMultiRoutingError.notFound(mapWithOrigin.name || \"\", customError(details))\n }\n\n const newRouterRequest: RouterRequest = {\n ...routerRequest,\n origin: ioMapRoute.end,\n destination,\n waypoints: []\n };\n try {\n remoteRouterItineraries = await RemoteRouterManager.getItinerariesWithFallback(newRouterRequest, fallbackStrategy);\n } catch (e) {\n if (e instanceof RemoteRoutingError) {\n e.message = customError(e.message);\n }\n throw e;\n }\n\n // Concat the the IO map itinerary with the remote router response (for each itinerary)\n ioMapItinerary = Itinerary.fromGraphRoute(ioMapRoute);\n return remoteRouterItineraries.map(\n remoteRouterItinerary => Itinerary.fromItineraries(ioMapItinerary, remoteRouterItinerary)\n );\n }\n\n /*\n * Case 4\n *\n * If a map has been found for the \"destination\" but not for the \"origin\", so:\n * - A first itinerary (remoteRouterResponse) is calculated from \"origin\" to an \"entrypoint\"\n * of the IO map network using remote routers.\n * - A second itinerary (ioMapItinerary) is calculated from an \"entrypoint\" to the\n * \"destination\" using the wemap router.\n * Itinerary returned is the concatenation of the both itineraries.\n *\n * Note: Check the mapWithDestination.getBestItineraryFromEntryPointsToDestination to understand\n * which \"entrypoint\" is chosen by the algorithm\n */\n if (!mapWithOrigin && mapWithDestination) {\n\n if (!mapWithDestination.entryPoints.length) {\n throw WemapMultiRoutingError.notFound(mapWithDestination.name || '',\n `A map including the \"destination\" but the \"origin\" has been \n found (${mapWithDestination.name}), however, no \"entrypoints\" have been found to go in`\n )\n }\n\n const customError = (details: string) => 'Tried to calculate an itinerary from \"origin\" to \"entrypoints\" '\n + `using remote routers (${fallbackStrategy.map(r => r.name).join(', ')}) and an `\n + 'itinerary from \"entrypoints\" to \"destination\" using wemap router on local map '\n + `\"${mapWithDestination.name}\", but failed. `\n + `Details: ${details}.`\n\n /*\n * ioMapItinerary is computed before the remoteRouterResponse because it is less expensive to\n * calculate all the routes to entrypoints using local router than all the routes with the\n * remote router.\n */\n ioMapRoute = mapWithDestination.getBestRouteFromEntryPointsToDestination(origin, destination, routerOptions);\n if (!ioMapRoute) {\n const details = `No route found from entry points to ${destination.toString()} in map: ${mapWithDestination.name}`;\n throw WemapMultiRoutingError.notFound(mapWithDestination.name || \"\", customError(details))\n }\n\n const newRouterRequest: RouterRequest = {\n ...routerRequest,\n origin,\n destination: ioMapRoute.start,\n waypoints: []\n };\n try {\n remoteRouterItineraries = await RemoteRouterManager.getItinerariesWithFallback(newRouterRequest, fallbackStrategy);\n } catch (e) {\n if (e instanceof RemoteRoutingError) {\n e.message = customError(e.message);\n }\n throw e;\n }\n\n // Concat the remote router response (for each itinerary) with the IO map itinerary\n ioMapItinerary = Itinerary.fromGraphRoute(ioMapRoute);\n return remoteRouterItineraries.map(\n remoteRouterItinerary => Itinerary.fromItineraries(remoteRouterItinerary, ioMapItinerary)\n );\n }\n\n /**\n * Case 5\n *\n * If maps have been found for the \"origin\" and the \"destination\" but they are different, so:\n * - A first itinerary (ioMapItinerary1) is calculated from \"origin\" to an \"entrypoint\" of\n * the mapWithOrigin using the wemap router.\n * - A second itinerary (remoteRouterResponse) is calculated from an \"entrypoint\" of the\n * mapWithOrigin to an \"entrypoint\" of the destinationWithMap using remote routers.\n * - A third itinerary (ioMapItinerary2) is calculated from an \"entrypoint\" of the mapWithDestination\n * to the \"destination\" using the wemap router.\n * Itinerary returned is the concatenation of the three itineraries.\n */\n if (mapWithOrigin && mapWithDestination) {\n\n if (!mapWithOrigin.entryPoints.length) {\n throw WemapMultiRoutingError.notFound(mapWithOrigin.name || '',\n `One map including the \"origin\" (${mapWithOrigin.name}) and another \n including the \"destination\" (${mapWithDestination.name}) has been found, however, no \"entrypoints\" have \n been found to go out of the origin map`\n );\n }\n\n if (!mapWithDestination.entryPoints.length) {\n throw WemapMultiRoutingError.notFound(mapWithDestination.name || '',\n `One map including the \"origin\" (${mapWithOrigin.name}) and another \n including the \"destination\" (${mapWithDestination.name}) has been found, however, no \"entrypoints\" have \n been found to go in the second map`\n );\n }\n\n const customError = (details: string) => 'Tried to calculate an itinerary from \"origin\" to \"entrypoints1\" '\n + `using wemap router on local map \"${mapWithOrigin.name}\", an itinerary from `\n + '\"entrypoints1\" to \"entrypoints2\" using remote routers '\n + `(${fallbackStrategy.map(r => r.name).join(', ')}) and an itinerary from \"entrypoints2\" `\n + `to \"destination\" using wemap router on local map \"${mapWithDestination.name}\", but failed. `\n + `Details: ${details}.`;\n\n\n const ioMapRoute1 = mapWithOrigin.getBestRouteFromOriginToEntryPoints(origin, destination, routerOptions);\n if (!ioMapRoute1) {\n const details = `No route found from ${origin.toString()} to entry points in map: ${mapWithOrigin.name}`;\n throw WemapMultiRoutingError.notFound(mapWithOrigin.name || \"\", customError(details))\n }\n\n const ioMapRoute2 = mapWithDestination.getBestRouteFromEntryPointsToDestination(origin, destination, routerOptions);\n if (!ioMapRoute2) {\n const details = `No route found from entry points to ${destination.toString()} in map: ${mapWithDestination.name}`;\n throw WemapMultiRoutingError.notFound(mapWithDestination.name || \"\", customError(details))\n }\n\n const newRouterRequest: RouterRequest = {\n ...routerRequest,\n origin: ioMapRoute1.end,\n destination: ioMapRoute2.start,\n waypoints: []\n };\n try {\n remoteRouterItineraries = await RemoteRouterManager.getItinerariesWithFallback(newRouterRequest, fallbackStrategy);\n } catch (e) {\n if (e instanceof RemoteRoutingError) {\n e.message = customError(e.message);\n }\n throw e;\n }\n\n\n // Concat the IO map itinerary 2 with the remote router response (for each itinerary)\n // and the IO map itinerary 2\n return remoteRouterItineraries.map(remoteRouterItinerary =>\n Itinerary.fromItineraries(\n Itinerary.fromGraphRoute(ioMapRoute1),\n remoteRouterItinerary,\n Itinerary.fromGraphRoute(ioMapRoute2)\n )\n );\n\n }\n\n throw new Error('Should never happen');\n }\n\n}\n\nexport default WemapMultiRouter;\n","import pointInPolygon from '@turf/boolean-point-in-polygon';\n\nimport { Coordinates, Level } from '@wemap/geo';\n\nimport Graph from '../graph/Graph.js';\nimport GraphRouter from '../graph/GraphRouter.js';\nimport { GraphRouterOptions } from '../graph/GraphRouterOptions.js';\n\n\nexport default class CustomGraphMap {\n\n router: GraphRouter;\n\n get routingBounds() {\n return this.graph.routingBounds;\n }\n\n get entryPoints() {\n return this.graph.routingBoundsEntryPoints;\n }\n\n constructor(public graph: Graph, public name: string | null = null) {\n\n this.name = name;\n this.graph = graph;\n this.router = new GraphRouter(graph);\n\n // // Bounds\n // if (bounds) {\n // this.bounds = bounds;\n // } else {\n // const polygon = [graph.vertices.map(vertex => [vertex.coords.lng, vertex.coords.lat] as Position)];\n // const convexHull = convexHullFn({ type: 'polygon', coordinates: polygon });\n // if (!convexHull) {\n // throw new Error(`Cannot calculate convexHull of graph \"${name}\"`);\n // }\n // this.bounds = {\n // type: 'MultiPolygon',\n // coordinates: [convexHull.geometry.coordinates]\n // };\n // }\n }\n\n\n isPointInside(coordinates: Coordinates) {\n if (!this.routingBounds) {\n return false;\n }\n return pointInPolygon([coordinates.lng, coordinates.lat], this.routingBounds);\n }\n\n /**\n * Get the list of entry points sorted by the lowest distance between:\n * start -> entry point -> end\n * (as the crow flies)\n *\n */\n getOrderedEntryPointsSortedByDistance(start: Coordinates, end: Coordinates) {\n const entryPointsCopy = [...this.entryPoints];\n const levelDiffFactor = 50; // in meters\n return entryPointsCopy.sort((ep1, ep2) => {\n\n const distance2D = Number(ep1.coords.distanceTo(start)) + ep1.coords.distanceTo(end)\n - (ep2.coords.distanceTo(start) + ep2.coords.distanceTo(end))\n\n const levelDiffEp1Start = Math.abs(Level.diff(start.level, ep1.coords.level) || 0);\n const levelDiffEp1End = Math.abs(Level.diff(end.level, ep1.coords.level) || 0);\n const levelDiffEp2Start = Math.abs(Level.diff(start.level, ep2.coords.level) || 0);\n const levelDiffEp2End = Math.abs(Level.diff(end.level, ep2.coords.level) || 0);\n const levelDiff = levelDiffEp1Start + levelDiffEp1End - (levelDiffEp2Start + levelDiffEp2End);\n\n return distance2D + levelDiff * levelDiffFactor;\n });\n }\n\n /**\n * Get the best itinerary from any entry point to an end coordinates.\n *\n * The algorithm works as following:\n * 1 - Entry points are sorted using distance (as the crow flies) between start - entry point - end\n * 2 - Try to calculate an itinerary from the first entry point to the end coordinates.\n * 3 - If an itinerary is found, it is returned. Otherwise it tries from the next entry point.\n *\n * /!\\ start is only used to sort the entry points (step 1).\n *\n */\n getBestRouteFromEntryPointsToDestination(start: Coordinates, end: Coordinates, options: GraphRouterOptions) {\n // TODO: use multiple-destinations algorithm\n const sortedEntryPoints = this.getOrderedEntryPointsSortedByDistance(start, end);\n for (const entryPoint of sortedEntryPoints) {\n const route = this.router.calculateShortestPath(entryPoint.coords, end, options).route();\n if (route.hasRoute) {\n return route;\n }\n // no route found\n }\n return null;\n }\n\n\n /**\n * Get the best itinerary from start coordinates to any entry point.\n *\n * The algorithm works as following:\n * 1 - Entry points are sorted using distance (as the crow flies) between start - entry point - end\n * 2 - Try to calculate an itinerary from the start coordinates to the first entry point.\n * 3 - If an itinerary is found, it is returned. Otherwise it tries to the next entry point.\n *\n * /!\\ end is only used to sort the entry points (step 1).\n *\n */\n getBestRouteFromOriginToEntryPoints(start: Coordinates, end: Coordinates, options: GraphRouterOptions) {\n // TODO: use multiple-destinations algorithm\n const sortedEntryPoints = this.getOrderedEntryPointsSortedByDistance(start, end);\n for (const entryPoint of sortedEntryPoints) {\n const route = this.router.calculateShortestPath(start, entryPoint.coords, options).route();\n if (route.hasRoute) {\n return route;\n }\n // no route found\n }\n return null;\n }\n\n getRouteInsideMap(start: Coordinates, end: Coordinates, options: GraphRouterOptions) {\n // Call the Wemap router to get the shortest path\n const route = this.router.calculateShortestPath(start, end, options).route();\n return route.hasRoute ? route : null;\n }\n\n getTripInsideMap(waypoints: Coordinates[], options: GraphRouterOptions) {\n // Call the Wemap router to get the shortest trip itinerary\n return this.router.getShortestTrip(waypoints, options);\n }\n\n getRoutesMultipleDestinationsInsideMap(start: Coordinates, ends: Coordinates[], options: GraphRouterOptions) {\n // Call the Wemap router to get the shortest path for all the input destinations\n return this.router.calculateShortestPathToMultipleDestinations(start, ends, options);\n }\n\n}\n","/**\n * @license\n * lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash exports=\"node\" include=\"clone,merge,isEmpty,isArray,compact,each\" -d`\n * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n;(function() {\n\n /** Used as a safe reference for `undefined` in pre-ES5 environments. */\n var undefined;\n\n /** Used as the semantic version number. */\n var VERSION = '4.15.0';\n\n /** Used as the size to enable large array optimizations. */\n var LARGE_ARRAY_SIZE = 200;\n\n /** Used as the `TypeError` message for \"Functions\" methods. */\n var FUNC_ERROR_TEXT = 'Expected a function';\n\n /** Used to stand-in for `undefined` hash values. */\n var HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n /** Used to compose bitmasks for comparison styles. */\n var UNORDERED_COMPARE_FLAG = 1,\n PARTIAL_COMPARE_FLAG = 2;\n\n /** Used as references for various `Number` constants. */\n var INFINITY = 1 / 0,\n MAX_SAFE_INTEGER = 9007199254740991;\n\n /** `Object#toString` result references. */\n var argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\n var arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n /** Used to match property names within property paths. */\n var reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/,\n reLeadingDot = /^\\./,\n rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n /**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\n var reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n /** Used to match backslashes in property paths. */\n var reEscapeChar = /\\\\(\\\\)?/g;\n\n /** Used to match `RegExp` flags from their coerced string values. */\n var reFlags = /\\w*$/;\n\n /** Used to detect host constructors (Safari). */\n var reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n /** Used to detect unsigned integer values. */\n var reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n /** Used to identify `toStringTag` values of typed arrays. */\n var typedArrayTags = {};\n typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\n typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\n typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\n typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\n typedArrayTags[uint32Tag] = true;\n typedArrayTags[argsTag] = typedArrayTags[arrayTag] =\n typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\n typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\n typedArrayTags[errorTag] = typedArrayTags[funcTag] =\n typedArrayTags[mapTag] = typedArrayTags[numberTag] =\n typedArrayTags[objectTag] = typedArrayTags[regexpTag] =\n typedArrayTags[setTag] = typedArrayTags[stringTag] =\n typedArrayTags[weakMapTag] = false;\n\n /** Used to identify `toStringTag` values supported by `_.clone`. */\n var cloneableTags = {};\n cloneableTags[argsTag] = cloneableTags[arrayTag] =\n cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\n cloneableTags[boolTag] = cloneableTags[dateTag] =\n cloneableTags[float32Tag] = cloneableTags[float64Tag] =\n cloneableTags[int8Tag] = cloneableTags[int16Tag] =\n cloneableTags[int32Tag] = cloneableTags[mapTag] =\n cloneableTags[numberTag] = cloneableTags[objectTag] =\n cloneableTags[regexpTag] = cloneableTags[setTag] =\n cloneableTags[stringTag] = cloneableTags[symbolTag] =\n cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\n cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\n cloneableTags[errorTag] = cloneableTags[funcTag] =\n cloneableTags[weakMapTag] = false;\n\n /** Detect free variable `global` from Node.js. */\n var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n /** Detect free variable `self`. */\n var freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n /** Used as a reference to the global object. */\n var root = freeGlobal || freeSelf || Function('return this')();\n\n /** Detect free variable `exports`. */\n var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n /** Detect free variable `module`. */\n var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n /** Detect the popular CommonJS extension `module.exports`. */\n var moduleExports = freeModule && freeModule.exports === freeExports;\n\n /** Detect free variable `process` from Node.js. */\n var freeProcess = moduleExports && freeGlobal.process;\n\n /** Used to access faster Node.js helpers. */\n var nodeUtil = (function() {\n try {\n return freeProcess && freeProcess.binding('util');\n } catch (e) {}\n }());\n\n /* Node.js helper references. */\n var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n /*--------------------------------------------------------------------------*/\n\n /**\n * Adds the key-value `pair` to `map`.\n *\n * @private\n * @param {Object} map The map to modify.\n * @param {Array} pair The key-value pair to add.\n * @returns {Object} Returns `map`.\n */\n function addMapEntry(map, pair) {\n // Don't return `map.set` because it's not chainable in IE 11.\n map.set(pair[0], pair[1]);\n return map;\n }\n\n /**\n * Adds `value` to `set`.\n *\n * @private\n * @param {Object} set The set to modify.\n * @param {*} value The value to add.\n * @returns {Object} Returns `set`.\n */\n function addSetEntry(set, value) {\n // Don't return `set.add` because it's not chainable in IE 11.\n set.add(value);\n return set;\n }\n\n /**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\n function apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n }\n\n /**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\n function arrayEach(array, iteratee) {\n var index = -1,\n length = array ? array.length : 0;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n }\n\n /**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\n function arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n }\n\n /**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\n function arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array ? array.length : 0;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\n function arraySome(array, predicate) {\n var index = -1,\n length = array ? array.length : 0;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\n function baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n }\n\n /**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\n function baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n }\n\n /**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\n function baseUnary(func) {\n return function(value) {\n return func(value);\n };\n }\n\n /**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\n function getValue(object, key) {\n return object == null ? undefined : object[key];\n }\n\n /**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\n function isHostObject(value) {\n // Many host objects are `Object` objects that can coerce to strings\n // despite having improperly defined `toString` methods.\n var result = false;\n if (value != null && typeof value.toString != 'function') {\n try {\n result = !!(value + '');\n } catch (e) {}\n }\n return result;\n }\n\n /**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\n function mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n }\n\n /**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\n function overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n }\n\n /**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\n function setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n }\n\n /*--------------------------------------------------------------------------*/\n\n /** Used for built-in method references. */\n var arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n /** Used to detect overreaching core-js shims. */\n var coreJsData = root['__core-js_shared__'];\n\n /** Used to detect methods masquerading as native. */\n var maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n }());\n\n /** Used to resolve the decompiled source of functions. */\n var funcToString = funcProto.toString;\n\n /** Used to check objects for own properties. */\n var hasOwnProperty = objectProto.hasOwnProperty;\n\n /** Used to infer the `Object` constructor. */\n var objectCtorString = funcToString.call(Object);\n\n /**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\n var objectToString = objectProto.toString;\n\n /** Used to detect if a method is native. */\n var reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n );\n\n /** Built-in value references. */\n var Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n getPrototype = overArg(Object.getPrototypeOf, Object),\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice;\n\n /* Built-in method references for those with the same name as other `lodash` methods. */\n var nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeKeys = overArg(Object.keys, Object),\n nativeMax = Math.max;\n\n /* Built-in method references that are verified to be native. */\n var DataView = getNative(root, 'DataView'),\n Map = getNative(root, 'Map'),\n Promise = getNative(root, 'Promise'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n /** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */\n var nonEnumShadows = !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf');\n\n /** Used to lookup unminified function names. */\n var realNames = {};\n\n /** Used to detect maps, sets, and weakmaps. */\n var dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n /** Used to convert symbols to primitives and strings. */\n var symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a `lodash` object which wraps `value` to enable implicit method\n * chain sequences. Methods that operate on and return arrays, collections,\n * and functions can be chained together. Methods that retrieve a single value\n * or may return a primitive value will automatically end the chain sequence\n * and return the unwrapped value. Otherwise, the value must be unwrapped\n * with `_#value`.\n *\n * Explicit chain sequences, which must be unwrapped with `_#value`, may be\n * enabled using `_.chain`.\n *\n * The execution of chained methods is lazy, that is, it's deferred until\n * `_#value` is implicitly or explicitly called.\n *\n * Lazy evaluation allows several methods to support shortcut fusion.\n * Shortcut fusion is an optimization to merge iteratee calls; this avoids\n * the creation of intermediate arrays and can greatly reduce the number of\n * iteratee executions. Sections of a chain sequence qualify for shortcut\n * fusion if the section is applied to an array of at least `200` elements\n * and any iteratees accept only one argument. The heuristic for whether a\n * section qualifies for shortcut fusion is subject to change.\n *\n * Chaining is supported in custom builds as long as the `_#value` method is\n * directly or indirectly included in the build.\n *\n * In addition to lodash methods, wrappers have `Array` and `String` methods.\n *\n * The wrapper `Array` methods are:\n * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`\n *\n * The wrapper `String` methods are:\n * `replace` and `split`\n *\n * The wrapper methods that support shortcut fusion are:\n * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,\n * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,\n * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`\n *\n * The chainable wrapper methods are:\n * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,\n * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,\n * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,\n * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,\n * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,\n * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,\n * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,\n * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,\n * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,\n * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,\n * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,\n * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,\n * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,\n * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,\n * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,\n * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,\n * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,\n * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,\n * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,\n * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,\n * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,\n * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,\n * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,\n * `zipObject`, `zipObjectDeep`, and `zipWith`\n *\n * The wrapper methods that are **not** chainable by default are:\n * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,\n * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,\n * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,\n * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,\n * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,\n * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,\n * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,\n * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,\n * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,\n * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,\n * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,\n * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,\n * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,\n * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,\n * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,\n * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,\n * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,\n * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,\n * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,\n * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,\n * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,\n * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,\n * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,\n * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,\n * `upperFirst`, `value`, and `words`\n *\n * @name _\n * @constructor\n * @category Seq\n * @param {*} value The value to wrap in a `lodash` instance.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2, 3]);\n *\n * // Returns an unwrapped value.\n * wrapped.reduce(_.add);\n * // => 6\n *\n * // Returns a wrapped value.\n * var squares = wrapped.map(square);\n *\n * _.isArray(squares);\n * // => false\n *\n * _.isArray(squares.value());\n * // => true\n */\n function lodash() {\n // No operation performed.\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function Hash(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\n function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n }\n\n /**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function hashDelete(key) {\n return this.has(key) && delete this.__data__[key];\n }\n\n /**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n }\n\n /**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);\n }\n\n /**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\n function hashSet(key, value) {\n var data = this.__data__;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n }\n\n // Add methods to `Hash`.\n Hash.prototype.clear = hashClear;\n Hash.prototype['delete'] = hashDelete;\n Hash.prototype.get = hashGet;\n Hash.prototype.has = hashHas;\n Hash.prototype.set = hashSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function ListCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\n function listCacheClear() {\n this.__data__ = [];\n }\n\n /**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n return true;\n }\n\n /**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n }\n\n /**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n }\n\n /**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\n function listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n }\n\n // Add methods to `ListCache`.\n ListCache.prototype.clear = listCacheClear;\n ListCache.prototype['delete'] = listCacheDelete;\n ListCache.prototype.get = listCacheGet;\n ListCache.prototype.has = listCacheHas;\n ListCache.prototype.set = listCacheSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function MapCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\n function mapCacheClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }\n\n /**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function mapCacheDelete(key) {\n return getMapData(this, key)['delete'](key);\n }\n\n /**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function mapCacheGet(key) {\n return getMapData(this, key).get(key);\n }\n\n /**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function mapCacheHas(key) {\n return getMapData(this, key).has(key);\n }\n\n /**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\n function mapCacheSet(key, value) {\n getMapData(this, key).set(key, value);\n return this;\n }\n\n // Add methods to `MapCache`.\n MapCache.prototype.clear = mapCacheClear;\n MapCache.prototype['delete'] = mapCacheDelete;\n MapCache.prototype.get = mapCacheGet;\n MapCache.prototype.has = mapCacheHas;\n MapCache.prototype.set = mapCacheSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\n function SetCache(values) {\n var index = -1,\n length = values ? values.length : 0;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n }\n\n /**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\n function setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n }\n\n /**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\n function setCacheHas(value) {\n return this.__data__.has(value);\n }\n\n // Add methods to `SetCache`.\n SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\n SetCache.prototype.has = setCacheHas;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function Stack(entries) {\n this.__data__ = new ListCache(entries);\n }\n\n /**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\n function stackClear() {\n this.__data__ = new ListCache;\n }\n\n /**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function stackDelete(key) {\n return this.__data__['delete'](key);\n }\n\n /**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function stackGet(key) {\n return this.__data__.get(key);\n }\n\n /**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function stackHas(key) {\n return this.__data__.has(key);\n }\n\n /**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\n function stackSet(key, value) {\n var cache = this.__data__;\n if (cache instanceof ListCache) {\n var pairs = cache.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n return this;\n }\n cache = this.__data__ = new MapCache(pairs);\n }\n cache.set(key, value);\n return this;\n }\n\n // Add methods to `Stack`.\n Stack.prototype.clear = stackClear;\n Stack.prototype['delete'] = stackDelete;\n Stack.prototype.get = stackGet;\n Stack.prototype.has = stackHas;\n Stack.prototype.set = stackSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\n function arrayLikeKeys(value, inherited) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n // Safari 9 makes `arguments.length` enumerable in strict mode.\n var result = (isArray(value) || isArguments(value))\n ? baseTimes(value.length, String)\n : [];\n\n var length = result.length,\n skipIndexes = !!length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (key == 'length' || isIndex(key, length)))) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (typeof key == 'number' && value === undefined && !(key in object))) {\n object[key] = value;\n }\n }\n\n /**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n object[key] = value;\n }\n }\n\n /**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n }\n\n /**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\n function baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n }\n\n /**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @param {boolean} [isFull] Specify a clone including symbols.\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\n function baseClone(value, isDeep, isFull, customizer, key, object, stack) {\n var result;\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n if (isHostObject(value)) {\n return object ? value : {};\n }\n result = initCloneObject(isFunc ? {} : value);\n if (!isDeep) {\n return copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, baseClone, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (!isArr) {\n var props = isFull ? getAllKeys(value) : keys(value);\n }\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));\n });\n return result;\n }\n\n /**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} prototype The object to inherit from.\n * @returns {Object} Returns the new object.\n */\n function baseCreate(proto) {\n return isObject(proto) ? objectCreate(proto) : {};\n }\n\n /**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\n var baseEach = createBaseEach(baseForOwn);\n\n /**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\n var baseFor = createBaseFor();\n\n /**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\n function baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n }\n\n /**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\n function baseGet(object, path) {\n path = isKey(path, object) ? [path] : castPath(path);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n }\n\n /**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n }\n\n /**\n * The base implementation of `getTag`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n function baseGetTag(value) {\n return objectToString.call(value);\n }\n\n /**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n function baseHasIn(object, key) {\n return object != null && key in Object(object);\n }\n\n /**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {boolean} [bitmask] The bitmask of comparison flags.\n * The bitmask may be composed of the following flags:\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\n function baseIsEqual(value, other, customizer, bitmask, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack);\n }\n\n /**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual`\n * for more details.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = arrayTag,\n othTag = arrayTag;\n\n if (!objIsArr) {\n objTag = getTag(object);\n objTag = objTag == argsTag ? objectTag : objTag;\n }\n if (!othIsArr) {\n othTag = getTag(other);\n othTag = othTag == argsTag ? objectTag : othTag;\n }\n var objIsObj = objTag == objectTag && !isHostObject(object),\n othIsObj = othTag == objectTag && !isHostObject(other),\n isSameTag = objTag == othTag;\n\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, equalFunc, customizer, bitmask, stack)\n : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack);\n }\n if (!(bitmask & PARTIAL_COMPARE_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, equalFunc, customizer, bitmask, stack);\n }\n\n /**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\n function baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack;\n if (customizer) {\n var result = customizer(objValue, srcValue, key, object, source, stack);\n }\n if (!(result === undefined\n ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack)\n : result\n )) {\n return false;\n }\n }\n }\n return true;\n }\n\n /**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\n function baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n }\n\n /**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\n function baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[objectToString.call(value)];\n }\n\n /**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\n function baseIteratee(value) {\n // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n if (typeof value == 'function') {\n return value;\n }\n if (value == null) {\n return identity;\n }\n if (typeof value == 'object') {\n return isArray(value)\n ? baseMatchesProperty(value[0], value[1])\n : baseMatches(value);\n }\n return property(value);\n }\n\n /**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\n function baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n }\n\n /**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\n function baseMatchesProperty(path, srcValue) {\n if (isKey(path) && isStrictComparable(srcValue)) {\n return matchesStrictComparable(toKey(path), srcValue);\n }\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG);\n };\n }\n\n /**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\n function baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n if (!(isArray(source) || isTypedArray(source))) {\n var props = baseKeysIn(source);\n }\n arrayEach(props || source, function(srcValue, key) {\n if (props) {\n key = srcValue;\n srcValue = source[key];\n }\n if (isObject(srcValue)) {\n stack || (stack = new Stack);\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(object[key], srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n });\n }\n\n /**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\n function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = object[key],\n srcValue = source[key],\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n newValue = srcValue;\n if (isArray(srcValue) || isTypedArray(srcValue)) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else {\n isCommon = false;\n newValue = baseClone(srcValue, true);\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) {\n isCommon = false;\n newValue = baseClone(srcValue, true);\n }\n else {\n newValue = objValue;\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n }\n\n /**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\n function basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n }\n\n /**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\n function baseRest(func, start) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = array;\n return apply(func, this, otherArgs);\n };\n }\n\n /**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\n function baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n }\n\n /**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the cast property path array.\n */\n function castPath(value) {\n return isArray(value) ? value : stringToPath(value);\n }\n\n /**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\n function cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var result = new buffer.constructor(buffer.length);\n buffer.copy(result);\n return result;\n }\n\n /**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\n function cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n }\n\n /**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\n function cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n }\n\n /**\n * Creates a clone of `map`.\n *\n * @private\n * @param {Object} map The map to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned map.\n */\n function cloneMap(map, isDeep, cloneFunc) {\n var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map);\n return arrayReduce(array, addMapEntry, new map.constructor);\n }\n\n /**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\n function cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n }\n\n /**\n * Creates a clone of `set`.\n *\n * @private\n * @param {Object} set The set to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned set.\n */\n function cloneSet(set, isDeep, cloneFunc) {\n var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set);\n return arrayReduce(array, addSetEntry, new set.constructor);\n }\n\n /**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\n function cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n }\n\n /**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\n function cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n }\n\n /**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\n function copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n }\n\n /**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\n function copyObject(source, props, object, customizer) {\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n assignValue(object, key, newValue === undefined ? source[key] : newValue);\n }\n return object;\n }\n\n /**\n * Copies own symbol properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\n function copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n }\n\n /**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\n function createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n }\n\n /**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n }\n\n /**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`\n * for more details.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\n function equalArrays(array, other, equalFunc, customizer, bitmask, stack) {\n var isPartial = bitmask & PARTIAL_COMPARE_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(array);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var index = -1,\n result = true,\n seen = (bitmask & UNORDERED_COMPARE_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!seen.has(othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) {\n return seen.add(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, customizer, bitmask, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`\n * for more details.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & PARTIAL_COMPARE_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= UNORDERED_COMPARE_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`\n * for more details.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {\n var isPartial = bitmask & PARTIAL_COMPARE_FLAG,\n objProps = keys(object),\n objLength = objProps.length,\n othProps = keys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n }\n\n /**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n }\n\n /**\n * Gets the appropriate \"iteratee\" function. If `_.iteratee` is customized,\n * this function returns the custom method, otherwise it returns `baseIteratee`.\n * If arguments are provided, the chosen function is invoked with them and\n * its result is returned.\n *\n * @private\n * @param {*} [value] The value to convert to an iteratee.\n * @param {number} [arity] The arity of the created iteratee.\n * @returns {Function} Returns the chosen function or its result.\n */\n function getIteratee() {\n var result = lodash.iteratee || iteratee;\n result = result === iteratee ? baseIteratee : result;\n return arguments.length ? result(arguments[0], arguments[1]) : result;\n }\n\n /**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\n function getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n }\n\n /**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\n function getMatchData(object) {\n var result = keys(object),\n length = result.length;\n\n while (length--) {\n var key = result[length],\n value = object[key];\n\n result[length] = [key, value, isStrictComparable(value)];\n }\n return result;\n }\n\n /**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\n function getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n }\n\n /**\n * Creates an array of the own enumerable symbol properties of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\n var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray;\n\n /**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n var getTag = baseGetTag;\n\n // Fallback for data views, maps, sets, and weak maps in IE 11,\n // for data views in Edge < 14, and promises in Node.js.\n if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = objectToString.call(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : undefined;\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n }\n\n /**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\n function hasPath(object, path, hasFunc) {\n path = isKey(path, object) ? [path] : castPath(path);\n\n var result,\n index = -1,\n length = path.length;\n\n while (++index < length) {\n var key = toKey(path[index]);\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n object = object[key];\n }\n if (result) {\n return result;\n }\n var length = object ? object.length : 0;\n return !!length && isLength(length) && isIndex(key, length) &&\n (isArray(object) || isArguments(object));\n }\n\n /**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\n function initCloneArray(array) {\n var length = array.length,\n result = array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n }\n\n /**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n }\n\n /**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneByTag(object, tag, cloneFunc, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return cloneMap(object, isDeep, cloneFunc);\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return cloneSet(object, isDeep, cloneFunc);\n\n case symbolTag:\n return cloneSymbol(object);\n }\n }\n\n /**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\n function isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n }\n\n /**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\n function isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n }\n\n /**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\n function isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n }\n\n /**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\n function isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n }\n\n /**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\n function isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n }\n\n /**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\n function isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n }\n\n /**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\n function isStrictComparable(value) {\n return value === value && !isObject(value);\n }\n\n /**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\n function matchesStrictComparable(key, srcValue) {\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === srcValue &&\n (srcValue !== undefined || (key in Object(object)));\n };\n }\n\n /**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\n var stringToPath = memoize(function(string) {\n string = toString(string);\n\n var result = [];\n if (reLeadingDot.test(string)) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, string) {\n result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n });\n\n /**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\n function toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n }\n\n /**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to process.\n * @returns {string} Returns the source code.\n */\n function toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an array with all falsey values removed. The values `false`, `null`,\n * `0`, `\"\"`, `undefined`, and `NaN` are falsey.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to compact.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.compact([0, 1, false, 2, '', 3]);\n * // => [1, 2, 3]\n */\n function compact(array) {\n var index = -1,\n length = array ? array.length : 0,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value) {\n result[resIndex++] = value;\n }\n }\n return result;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Iterates over elements of `collection` and invokes `iteratee` for each element.\n * The iteratee is invoked with three arguments: (value, index|key, collection).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * **Note:** As with other \"Collections\" methods, objects with a \"length\"\n * property are iterated like arrays. To avoid this behavior use `_.forIn`\n * or `_.forOwn` for object iteration.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias each\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEachRight\n * @example\n *\n * _([1, 2]).forEach(function(value) {\n * console.log(value);\n * });\n * // => Logs `1` then `2`.\n *\n * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\n function forEach(collection, iteratee) {\n var func = isArray(collection) ? arrayEach : baseEach;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\n function memoize(func, resolver) {\n if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result);\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n }\n\n // Assign cache to `_.memoize`.\n memoize.Cache = MapCache;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a shallow clone of `value`.\n *\n * **Note:** This method is loosely based on the\n * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)\n * and supports cloning arrays, array buffers, booleans, date objects, maps,\n * numbers, `Object` objects, regexes, sets, strings, symbols, and typed\n * arrays. The own enumerable properties of `arguments` objects are cloned\n * as plain objects. An empty object is returned for uncloneable values such\n * as error objects, functions, DOM nodes, and WeakMaps.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to clone.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeep\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var shallow = _.clone(objects);\n * console.log(shallow[0] === objects[0]);\n * // => true\n */\n function clone(value) {\n return baseClone(value, false, true);\n }\n\n /**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\n function eq(value, other) {\n return value === other || (value !== value && other !== other);\n }\n\n /**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\n function isArguments(value) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n }\n\n /**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\n var isArray = Array.isArray;\n\n /**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\n function isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n }\n\n /**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\n function isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n }\n\n /**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\n var isBuffer = nativeIsBuffer || stubFalse;\n\n /**\n * Checks if `value` is an empty object, collection, map, or set.\n *\n * Objects are considered empty if they have no own enumerable string keyed\n * properties.\n *\n * Array-like values such as `arguments` objects, arrays, buffers, strings, or\n * jQuery-like collections are considered empty if they have a `length` of `0`.\n * Similarly, maps and sets are considered empty if they have a `size` of `0`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is empty, else `false`.\n * @example\n *\n * _.isEmpty(null);\n * // => true\n *\n * _.isEmpty(true);\n * // => true\n *\n * _.isEmpty(1);\n * // => true\n *\n * _.isEmpty([1, 2, 3]);\n * // => false\n *\n * _.isEmpty({ 'a': 1 });\n * // => false\n */\n function isEmpty(value) {\n if (isArrayLike(value) &&\n (isArray(value) || typeof value == 'string' ||\n typeof value.splice == 'function' || isBuffer(value) || isArguments(value))) {\n return !value.length;\n }\n var tag = getTag(value);\n if (tag == mapTag || tag == setTag) {\n return !value.size;\n }\n if (nonEnumShadows || isPrototype(value)) {\n return !nativeKeys(value).length;\n }\n for (var key in value) {\n if (hasOwnProperty.call(value, key)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\n function isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8-9 which returns 'object' for typed array and other constructors.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n }\n\n /**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\n function isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n }\n\n /**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\n function isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n }\n\n /**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\n function isObjectLike(value) {\n return !!value && typeof value == 'object';\n }\n\n /**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\n function isPlainObject(value) {\n if (!isObjectLike(value) ||\n objectToString.call(value) != objectTag || isHostObject(value)) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return (typeof Ctor == 'function' &&\n Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString);\n }\n\n /**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\n function isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n }\n\n /**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\n var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n /**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\n function toPlainObject(value) {\n return copyObject(value, keysIn(value));\n }\n\n /**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\n function toString(value) {\n return value == null ? '' : baseToString(value);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\n function get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n }\n\n /**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\n function hasIn(object, path) {\n return object != null && hasPath(object, path, baseHasIn);\n }\n\n /**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\n function keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n }\n\n /**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\n function keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n }\n\n /**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\n var merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n });\n\n /*------------------------------------------------------------------------*/\n\n /**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\n function identity(value) {\n return value;\n }\n\n /**\n * Creates a function that invokes `func` with the arguments of the created\n * function. If `func` is a property name, the created function returns the\n * property value for a given element. If `func` is an array or object, the\n * created function returns `true` for elements that contain the equivalent\n * source properties, otherwise it returns `false`.\n *\n * @static\n * @since 4.0.0\n * @memberOf _\n * @category Util\n * @param {*} [func=_.identity] The value to convert to a callback.\n * @returns {Function} Returns the callback.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));\n * // => [{ 'user': 'barney', 'age': 36, 'active': true }]\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.filter(users, _.iteratee(['user', 'fred']));\n * // => [{ 'user': 'fred', 'age': 40 }]\n *\n * // The `_.property` iteratee shorthand.\n * _.map(users, _.iteratee('user'));\n * // => ['barney', 'fred']\n *\n * // Create custom iteratee shorthands.\n * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {\n * return !_.isRegExp(func) ? iteratee(func) : function(string) {\n * return func.test(string);\n * };\n * });\n *\n * _.filter(['abc', 'def'], /ef/);\n * // => ['def']\n */\n function iteratee(func) {\n return baseIteratee(typeof func == 'function' ? func : baseClone(func, true));\n }\n\n /**\n * Creates a function that returns the value at `path` of a given object.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n * @example\n *\n * var objects = [\n * { 'a': { 'b': 2 } },\n * { 'a': { 'b': 1 } }\n * ];\n *\n * _.map(objects, _.property('a.b'));\n * // => [2, 1]\n *\n * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');\n * // => [1, 2]\n */\n function property(path) {\n return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);\n }\n\n /**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\n function stubArray() {\n return [];\n }\n\n /**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\n function stubFalse() {\n return false;\n }\n\n /*------------------------------------------------------------------------*/\n\n // Add methods that return wrapped values in chain sequences.\n lodash.compact = compact;\n lodash.iteratee = iteratee;\n lodash.keys = keys;\n lodash.keysIn = keysIn;\n lodash.memoize = memoize;\n lodash.merge = merge;\n lodash.property = property;\n lodash.toPlainObject = toPlainObject;\n\n /*------------------------------------------------------------------------*/\n\n // Add methods that return unwrapped values in chain sequences.\n lodash.clone = clone;\n lodash.eq = eq;\n lodash.forEach = forEach;\n lodash.get = get;\n lodash.hasIn = hasIn;\n lodash.identity = identity;\n lodash.isArguments = isArguments;\n lodash.isArray = isArray;\n lodash.isArrayLike = isArrayLike;\n lodash.isArrayLikeObject = isArrayLikeObject;\n lodash.isBuffer = isBuffer;\n lodash.isEmpty = isEmpty;\n lodash.isFunction = isFunction;\n lodash.isLength = isLength;\n lodash.isObject = isObject;\n lodash.isObjectLike = isObjectLike;\n lodash.isPlainObject = isPlainObject;\n lodash.isSymbol = isSymbol;\n lodash.isTypedArray = isTypedArray;\n lodash.stubArray = stubArray;\n lodash.stubFalse = stubFalse;\n lodash.toString = toString;\n\n // Add aliases.\n lodash.each = forEach;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * The semantic version number.\n *\n * @static\n * @memberOf _\n * @type {string}\n */\n lodash.VERSION = VERSION;\n\n /*--------------------------------------------------------------------------*/\n\n if (freeModule) {\n // Export for Node.js.\n (freeModule.exports = lodash)._ = lodash;\n // Export for CommonJS support.\n freeExports._ = lodash;\n }\n}.call(this));\n","\nmodule.exports = rewind;\n\nfunction rewind(gj, outer) {\n var type = gj && gj.type, i;\n\n if (type === 'FeatureCollection') {\n for (i = 0; i < gj.features.length; i++) rewind(gj.features[i], outer);\n\n } else if (type === 'GeometryCollection') {\n for (i = 0; i < gj.geometries.length; i++) rewind(gj.geometries[i], outer);\n\n } else if (type === 'Feature') {\n rewind(gj.geometry, outer);\n\n } else if (type === 'Polygon') {\n rewindRings(gj.coordinates, outer);\n\n } else if (type === 'MultiPolygon') {\n for (i = 0; i < gj.coordinates.length; i++) rewindRings(gj.coordinates[i], outer);\n }\n\n return gj;\n}\n\nfunction rewindRings(rings, outer) {\n if (rings.length === 0) return;\n\n rewindRing(rings[0], outer);\n for (var i = 1; i < rings.length; i++) {\n rewindRing(rings[i], !outer);\n }\n}\n\nfunction rewindRing(ring, dir) {\n var area = 0, err = 0;\n for (var i = 0, len = ring.length, j = len - 1; i < len; j = i++) {\n var k = (ring[i][0] - ring[j][0]) * (ring[j][1] + ring[i][1]);\n var m = area + k;\n err += Math.abs(area) >= Math.abs(k) ? area - m + k : k - m + area;\n area = m;\n }\n if (area + err >= 0 !== !!dir) ring.reverse();\n}\n","module.exports = require('./polygon-features.json')\n","var _ = require(\"./lodash.custom.js\");\nvar rewind = require(\"@mapbox/geojson-rewind\");\n\n// see https://wiki.openstreetmap.org/wiki/Overpass_turbo/Polygon_Features\nvar polygonFeatures = {};\nrequire(\"osm-polygon-features\").forEach(function(tags) {\n if (tags.polygon === \"all\")\n polygonFeatures[tags.key] = true;\n else {\n var list = (tags.polygon === \"whitelist\") ? \"included_values\" : \"excluded_values\",\n tagValuesObj = {};\n tags.values.forEach(function(value) { tagValuesObj[value] = true; });\n polygonFeatures[tags.key] = {};\n polygonFeatures[tags.key][list] = tagValuesObj;\n }\n});\n\n// default deduplication helper function\nfunction default_deduplicator(objectA, objectB) {\n // default deduplication handler:\n // if object versions differ, use highest available version\n if ((objectA.version || objectB.version) &&\n (objectA.version !== objectB.version)) {\n return (+objectA.version || 0) > (+objectB.version || 0)\n ? objectA\n : objectB;\n }\n // otherwise: return merged obj properties\n return _.merge(objectA, objectB);\n}\n\nvar osmtogeojson = {};\n\nosmtogeojson = function( data, options, featureCallback ) {\n\n options = _.merge(\n {\n verbose: false,\n flatProperties: true,\n uninterestingTags: {\n \"source\": true,\n \"source_ref\": true,\n \"source:ref\": true,\n \"history\": true,\n \"attribution\": true,\n \"created_by\": true,\n \"tiger:county\": true,\n \"tiger:tlid\": true,\n \"tiger:upload_uuid\": true\n },\n polygonFeatures: polygonFeatures,\n deduplicator: default_deduplicator\n },\n options\n );\n\n var result;\n if ( ((typeof XMLDocument !== \"undefined\") && data instanceof XMLDocument ||\n (typeof XMLDocument === \"undefined\") && data.childNodes) )\n result = _osmXML2geoJSON(data);\n else\n result = _overpassJSON2geoJSON(data);\n return result;\n\n function _overpassJSON2geoJSON(json) {\n // sort elements\n var nodes = new Array();\n var ways = new Array();\n var rels = new Array();\n // helper functions\n function centerGeometry(object) {\n var pseudoNode = _.clone(object);\n pseudoNode.lat = object.center.lat;\n pseudoNode.lon = object.center.lon;\n pseudoNode.__is_center_placeholder = true;\n nodes.push(pseudoNode);\n }\n function boundsGeometry(object) {\n var pseudoWay = _.clone(object);\n pseudoWay.nodes = [];\n function addPseudoNode(lat,lon,i) {\n var pseudoNode = {\n type:\"node\",\n id: \"_\"+pseudoWay.type+\"/\"+pseudoWay.id+\"bounds\"+i,\n lat: lat,\n lon: lon\n }\n pseudoWay.nodes.push(pseudoNode.id);\n nodes.push(pseudoNode);\n }\n addPseudoNode(pseudoWay.bounds.minlat,pseudoWay.bounds.minlon,1);\n addPseudoNode(pseudoWay.bounds.maxlat,pseudoWay.bounds.minlon,2);\n addPseudoNode(pseudoWay.bounds.maxlat,pseudoWay.bounds.maxlon,3);\n addPseudoNode(pseudoWay.bounds.minlat,pseudoWay.bounds.maxlon,4);\n pseudoWay.nodes.push(pseudoWay.nodes[0]);\n pseudoWay.__is_bounds_placeholder = true;\n ways.push(pseudoWay);\n }\n function fullGeometryWay(way) {\n function addFullGeometryNode(lat,lon,id) {\n var geometryNode = {\n type:\"node\",\n id: id,\n lat: lat,\n lon: lon\n }\n nodes.push(geometryNode);\n }\n if (!_.isArray(way.nodes)) {\n way.nodes = way.geometry.map(function(nd) {\n if (nd !== null) // have to skip ref-less nodes\n return \"_anonymous@\"+nd.lat+\"/\"+nd.lon;\n else\n return \"_anonymous@unknown_location\";\n });\n }\n way.geometry.forEach(function(nd, i) {\n if (nd) {\n addFullGeometryNode(\n nd.lat,\n nd.lon,\n way.nodes[i]\n );\n }\n });\n }\n function fullGeometryRelation(rel) {\n function addFullGeometryNode(lat,lon,id) {\n var geometryNode = {\n type:\"node\",\n id: id,\n lat: lat,\n lon: lon\n }\n nodes.push(geometryNode);\n }\n function addFullGeometryWay(geometry,id) {\n // shared multipolygon ways cannot be defined multiple times with the same id.\n if (ways.some(function (way) { // todo: this is slow :(\n return way.type == \"way\" && way.id == id;\n })) return;\n var geometryWay = {\n type: \"way\",\n id: id,\n nodes:[]\n }\n function addFullGeometryWayPseudoNode(lat,lon) {\n // todo? do not save the same pseudo node multiple times\n var geometryPseudoNode = {\n type:\"node\",\n id: \"_anonymous@\"+lat+\"/\"+lon,\n lat: lat,\n lon: lon\n }\n geometryWay.nodes.push(geometryPseudoNode.id);\n nodes.push(geometryPseudoNode);\n }\n geometry.forEach(function(nd) {\n if (nd) {\n addFullGeometryWayPseudoNode(\n nd.lat,\n nd.lon\n );\n } else {\n geometryWay.nodes.push(undefined);\n }\n });\n ways.push(geometryWay);\n }\n rel.members.forEach(function(member, i) {\n if (member.type == \"node\") {\n if (member.lat) {\n addFullGeometryNode(\n member.lat,\n member.lon,\n member.ref\n );\n }\n } else if (member.type == \"way\") {\n if (member.geometry) {\n member.ref = \"_fullGeom\"+member.ref;\n addFullGeometryWay(\n member.geometry,\n member.ref\n );\n }\n }\n });\n }\n // create copies of individual json objects to make sure the original data doesn't get altered\n // todo: cloning is slow: see if this can be done differently!\n for (var i=0;i<json.elements.length;i++) {\n switch (json.elements[i].type) {\n case \"node\":\n var node = json.elements[i];\n nodes.push(node);\n break;\n case \"way\":\n var way = _.clone(json.elements[i]);\n way.nodes = _.clone(way.nodes);\n ways.push(way);\n if (way.center)\n centerGeometry(way);\n if (way.geometry)\n fullGeometryWay(way);\n else if (way.bounds)\n boundsGeometry(way);\n break;\n case \"relation\":\n var rel = _.clone(json.elements[i]);\n rel.members = _.clone(rel.members);\n rels.push(rel);\n var has_full_geometry = rel.members && rel.members.some(function (member) {\n return member.type == \"node\" && member.lat ||\n member.type == \"way\" && member.geometry && member.geometry.length > 0\n });\n if (rel.center)\n centerGeometry(rel);\n if (has_full_geometry)\n fullGeometryRelation(rel);\n else if (rel.bounds)\n boundsGeometry(rel);\n break;\n default:\n // type=area (from coord-query) is an example for this case.\n }\n }\n return _convert2geoJSON(nodes,ways,rels);\n }\n function _osmXML2geoJSON(xml) {\n // sort elements\n var nodes = new Array();\n var ways = new Array();\n var rels = new Array();\n // helper function\n function copy_attribute( x, o, attr ) {\n if (x.hasAttribute(attr))\n o[attr] = x.getAttribute(attr);\n }\n function centerGeometry(object, centroid) {\n var pseudoNode = _.clone(object);\n copy_attribute(centroid, pseudoNode, 'lat');\n copy_attribute(centroid, pseudoNode, 'lon');\n pseudoNode.__is_center_placeholder = true;\n nodes.push(pseudoNode);\n }\n function boundsGeometry(object, bounds) {\n var pseudoWay = _.clone(object);\n pseudoWay.nodes = [];\n function addPseudoNode(lat,lon,i) {\n var pseudoNode = {\n type:\"node\",\n id: \"_\"+pseudoWay.type+\"/\"+pseudoWay.id+\"bounds\"+i,\n lat: lat,\n lon: lon\n }\n pseudoWay.nodes.push(pseudoNode.id);\n nodes.push(pseudoNode);\n }\n addPseudoNode(bounds.getAttribute('minlat'),bounds.getAttribute('minlon'),1);\n addPseudoNode(bounds.getAttribute('maxlat'),bounds.getAttribute('minlon'),2);\n addPseudoNode(bounds.getAttribute('maxlat'),bounds.getAttribute('maxlon'),3);\n addPseudoNode(bounds.getAttribute('minlat'),bounds.getAttribute('maxlon'),4);\n pseudoWay.nodes.push(pseudoWay.nodes[0]);\n pseudoWay.__is_bounds_placeholder = true;\n ways.push(pseudoWay);\n }\n function fullGeometryWay(way, nds) {\n function addFullGeometryNode(lat,lon,id) {\n var geometryNode = {\n type:\"node\",\n id: id,\n lat: lat,\n lon: lon\n }\n nodes.push(geometryNode);\n return geometryNode.id;\n }\n if (!_.isArray(way.nodes)) {\n way.nodes = [];\n _.each( nds, function( nd, i ) {\n way.nodes.push(\"_anonymous@\"+nd.getAttribute('lat')+\"/\"+nd.getAttribute('lon'));\n });\n }\n _.each( nds, function( nd, i ) {\n if (nd.getAttribute('lat')) {\n addFullGeometryNode(\n nd.getAttribute('lat'),\n nd.getAttribute('lon'),\n way.nodes[i]\n );\n }\n });\n }\n function fullGeometryRelation(rel, members) {\n function addFullGeometryNode(lat,lon,id) {\n var geometryNode = {\n type:\"node\",\n id: id,\n lat: lat,\n lon: lon\n }\n nodes.push(geometryNode);\n }\n function addFullGeometryWay(nds,id) {\n // shared multipolygon ways cannot be defined multiple times with the same id.\n if (ways.some(function (way) { // todo: this is slow :(\n return way.type == \"way\" && way.id == id;\n })) return;\n var geometryWay = {\n type: \"way\",\n id: id,\n nodes:[]\n }\n function addFullGeometryWayPseudoNode(lat,lon) {\n // todo? do not save the same pseudo node multiple times\n var geometryPseudoNode = {\n type:\"node\",\n id: \"_anonymous@\"+lat+\"/\"+lon,\n lat: lat,\n lon: lon\n }\n geometryWay.nodes.push(geometryPseudoNode.id);\n nodes.push(geometryPseudoNode);\n }\n _.each(nds, function(nd) {\n if (nd.getAttribute('lat')) {\n addFullGeometryWayPseudoNode(\n nd.getAttribute('lat'),\n nd.getAttribute('lon')\n );\n } else {\n geometryWay.nodes.push(undefined);\n }\n });\n ways.push(geometryWay);\n }\n _.each( members, function( member, i ) {\n if (rel.members[i].type == \"node\") {\n if (member.getAttribute('lat')) {\n addFullGeometryNode(\n member.getAttribute('lat'),\n member.getAttribute('lon'),\n rel.members[i].ref\n );\n }\n } else if (rel.members[i].type == \"way\") {\n if (member.getElementsByTagName('nd').length > 0) {\n rel.members[i].ref = \"_fullGeom\"+rel.members[i].ref;\n addFullGeometryWay(\n member.getElementsByTagName('nd'),\n rel.members[i].ref\n );\n }\n }\n });\n }\n // nodes\n _.each( xml.getElementsByTagName('node'), function( node, i ) {\n var tags = {};\n _.each( node.getElementsByTagName('tag'), function( tag ) {\n tags[tag.getAttribute('k')] = tag.getAttribute('v');\n });\n var nodeObject = {\n 'type': 'node'\n };\n copy_attribute( node, nodeObject, 'id' );\n copy_attribute( node, nodeObject, 'lat' );\n copy_attribute( node, nodeObject, 'lon' );\n copy_attribute( node, nodeObject, 'version' );\n copy_attribute( node, nodeObject, 'timestamp' );\n copy_attribute( node, nodeObject, 'changeset' );\n copy_attribute( node, nodeObject, 'uid' );\n copy_attribute( node, nodeObject, 'user' );\n if (!_.isEmpty(tags))\n nodeObject.tags = tags;\n nodes.push(nodeObject);\n });\n // ways\n var centroid,bounds;\n _.each( xml.getElementsByTagName('way'), function( way, i ) {\n var tags = {};\n var wnodes = [];\n _.each( way.getElementsByTagName('tag'), function( tag ) {\n tags[tag.getAttribute('k')] = tag.getAttribute('v');\n });\n var has_full_geometry = false;\n _.each( way.getElementsByTagName('nd'), function( nd, i ) {\n var id;\n if (id = nd.getAttribute('ref'))\n wnodes[i] = id;\n if (!has_full_geometry && nd.getAttribute('lat'))\n has_full_geometry = true;\n });\n var wayObject = {\n \"type\": \"way\"\n };\n copy_attribute( way, wayObject, 'id' );\n copy_attribute( way, wayObject, 'version' );\n copy_attribute( way, wayObject, 'timestamp' );\n copy_attribute( way, wayObject, 'changeset' );\n copy_attribute( way, wayObject, 'uid' );\n copy_attribute( way, wayObject, 'user' );\n if (wnodes.length > 0)\n wayObject.nodes = wnodes;\n if (!_.isEmpty(tags))\n wayObject.tags = tags;\n if (centroid = way.getElementsByTagName('center')[0])\n centerGeometry(wayObject,centroid);\n if (has_full_geometry)\n fullGeometryWay(wayObject, way.getElementsByTagName('nd'));\n else if (bounds = way.getElementsByTagName('bounds')[0])\n boundsGeometry(wayObject,bounds);\n ways.push(wayObject);\n });\n // relations\n _.each( xml.getElementsByTagName('relation'), function( relation, i ) {\n var tags = {};\n var members = [];\n _.each( relation.getElementsByTagName('tag'), function( tag ) {\n tags[tag.getAttribute('k')] = tag.getAttribute('v');\n });\n var has_full_geometry = false;\n _.each( relation.getElementsByTagName('member'), function( member, i ) {\n members[i] = {};\n copy_attribute( member, members[i], 'ref' );\n copy_attribute( member, members[i], 'role' );\n copy_attribute( member, members[i], 'type' );\n if (!has_full_geometry &&\n (members[i].type == 'node' && member.getAttribute('lat')) ||\n (members[i].type == 'way' && member.getElementsByTagName('nd').length>0) )\n has_full_geometry = true;\n });\n var relObject = {\n \"type\": \"relation\"\n }\n copy_attribute( relation, relObject, 'id' );\n copy_attribute( relation, relObject, 'version' );\n copy_attribute( relation, relObject, 'timestamp' );\n copy_attribute( relation, relObject, 'changeset' );\n copy_attribute( relation, relObject, 'uid' );\n copy_attribute( relation, relObject, 'user' );\n if (members.length > 0)\n relObject.members = members;\n if (!_.isEmpty(tags))\n relObject.tags = tags;\n if (centroid = relation.getElementsByTagName('center')[0])\n centerGeometry(relObject,centroid);\n if (has_full_geometry)\n fullGeometryRelation(relObject, relation.getElementsByTagName('member'));\n else if (bounds = relation.getElementsByTagName('bounds')[0])\n boundsGeometry(relObject,bounds);\n rels.push(relObject);\n });\n return _convert2geoJSON(nodes,ways,rels);\n }\n function _convert2geoJSON(nodes,ways,rels) {\n\n // helper function that checks if there are any tags other than \"created_by\", \"source\", etc. or any tag provided in ignore_tags\n function has_interesting_tags(t, ignore_tags) {\n if (typeof ignore_tags !== \"object\")\n ignore_tags={};\n if (typeof options.uninterestingTags === \"function\")\n return !options.uninterestingTags(t, ignore_tags);\n for (var k in t)\n if (!(options.uninterestingTags[k]===true) &&\n !(ignore_tags[k]===true || ignore_tags[k]===t[k]))\n return true;\n return false;\n };\n // helper function to extract meta information\n function build_meta_information(object) {\n var res = {\n \"timestamp\": object.timestamp,\n \"version\": object.version,\n \"changeset\": object.changeset,\n \"user\": object.user,\n \"uid\": object.uid\n };\n for (var k in res)\n if (res[k] === undefined)\n delete res[k];\n return res;\n }\n\n // some data processing (e.g. filter nodes only used for ways)\n var nodeids = new Object();\n var poinids = new Object();\n for (var i=0;i<nodes.length;i++) {\n var node = nodes[i];\n if (nodeids[node.id] !== undefined) {\n // handle input data duplication\n node = options.deduplicator(node, nodeids[node.id]);\n }\n nodeids[node.id] = node;\n if (typeof node.tags != 'undefined' &&\n has_interesting_tags(node.tags)) // this checks if the node has any tags other than \"created_by\"\n poinids[node.id] = true;\n }\n // todo -> after deduplication of relations??\n for (var i=0;i<rels.length;i++) {\n if (_.isArray(rels[i].members)) {\n for (var j=0;j<rels[i].members.length;j++) {\n if (rels[i].members[j].type == \"node\")\n poinids[rels[i].members[j].ref] = true;\n }\n }\n }\n var wayids = new Object();\n var waynids = new Object();\n for (var i=0;i<ways.length;i++) {\n var way = ways[i];\n if (wayids[way.id]) {\n // handle input data duplication\n way = options.deduplicator(way, wayids[way.id]);\n }\n wayids[way.id] = way;\n if (_.isArray(way.nodes)) {\n for (var j=0;j<way.nodes.length;j++) {\n if (typeof way.nodes[j] === \"object\") continue; // ignore already replaced way node objects\n waynids[way.nodes[j]] = true;\n way.nodes[j] = nodeids[way.nodes[j]];\n }\n }\n }\n var pois = new Array();\n for (var id in nodeids) {\n var node = nodeids[id];\n if (!waynids[id] || poinids[id])\n pois.push(node);\n }\n var relids = new Array();\n for (var i=0;i<rels.length;i++) {\n var rel = rels[i];\n if (relids[rel.id]) {\n // handle input data duplication\n rel = options.deduplicator(rel, relids[rel.id]);\n }\n relids[rel.id] = rel;\n }\n var relsmap = {node: {}, way: {}, relation: {}};\n for (var id in relids) {\n var rel = relids[id];\n if (!_.isArray(rel.members)) {\n if (options.verbose) console.warn('Relation',rel.type+'/'+rel.id,'ignored because it has no members');\n continue; // ignore relations without members (e.g. returned by an ids_only query)\n }\n for (var j=0;j<rel.members.length;j++) {\n var m_type = rel.members[j].type;\n var m_ref = rel.members[j].ref;\n if (typeof m_ref !== \"number\") {\n // de-namespace full geometry content\n m_ref = m_ref.replace(\"_fullGeom\", \"\");\n }\n if (!relsmap[m_type]) {\n if (options.verbose) console.warn('Relation',rel.type+'/'+rel.id,'member',m_type+'/'+m_ref,'ignored because it has an invalid type');\n continue;\n }\n if (typeof relsmap[m_type][m_ref] === \"undefined\")\n relsmap[m_type][m_ref] = [];\n relsmap[m_type][m_ref].push({\n \"role\" : rel.members[j].role,\n \"rel\" : rel.id,\n \"reltags\" : rel.tags,\n });\n }\n }\n // construct geojson\n var geojson;\n var geojsonnodes = [];\n for (i=0;i<pois.length;i++) {\n if (typeof pois[i].lon == \"undefined\" || typeof pois[i].lat == \"undefined\") {\n if (options.verbose) console.warn('POI',pois[i].type+'/'+pois[i].id,'ignored because it lacks coordinates');\n continue; // lon and lat are required for showing a point\n }\n var feature = {\n \"type\" : \"Feature\",\n \"id\" : pois[i].type+\"/\"+pois[i].id,\n \"properties\" : {\n \"type\" : pois[i].type,\n \"id\" : pois[i].id,\n \"tags\" : pois[i].tags || {},\n \"relations\" : relsmap[\"node\"][pois[i].id] || [],\n \"meta\": build_meta_information(pois[i])\n },\n \"geometry\" : {\n \"type\" : \"Point\",\n \"coordinates\" : [+pois[i].lon, +pois[i].lat],\n }\n };\n if (pois[i].__is_center_placeholder)\n feature.properties[\"geometry\"] = \"center\";\n if (!featureCallback)\n geojsonnodes.push(feature);\n else\n featureCallback(feature);\n }\n var geojsonlines = [];\n var geojsonpolygons = [];\n // process multipolygons\n for (var i=0;i<rels.length;i++) {\n // todo: refactor such that this loops over relids instead of rels?\n if (relids[rels[i].id] !== rels[i]) {\n // skip relation because it's a deduplication artifact\n continue;\n }\n if ((typeof rels[i].tags != \"undefined\") &&\n (rels[i].tags[\"type\"] == \"route\" || rels[i].tags[\"type\"] == \"waterway\")) {\n if (!_.isArray(rels[i].members)) {\n if (options.verbose) console.warn('Route',rels[i].type+'/'+rels[i].id,'ignored because it has no members');\n continue; // ignore relations without members (e.g. returned by an ids_only query)\n }\n rels[i].members.forEach(function(m) {\n if (wayids[m.ref] && !has_interesting_tags(wayids[m.ref].tags))\n wayids[m.ref].is_skippablerelationmember = true;\n });\n feature = construct_multilinestring(rels[i]);\n if (feature === false) {\n if (options.verbose) console.warn('Route relation',rels[i].type+'/'+rels[i].id,'ignored because it has invalid geometry');\n continue; // abort if feature could not be constructed\n }\n if (!featureCallback)\n geojsonpolygons.push(feature);\n else\n featureCallback(rewind(feature));\n\n function construct_multilinestring(rel) {\n var is_tainted = false;\n // prepare route members\n var members;\n members = rel.members.filter(function(m) {return m.type === \"way\";});\n members = members.map(function(m) {\n var way = wayids[m.ref];\n if (way === undefined || way.nodes === undefined) { // check for missing ways\n if (options.verbose) console.warn('Route '+rel.type+'/'+rel.id, 'tainted by a missing or incomplete way', m.type+'/'+m.ref);\n is_tainted = true;\n return;\n }\n return { // TODO: this is slow! :(\n id: m.ref,\n role: m.role,\n way: way,\n nodes: way.nodes.filter(function(n) {\n if (n !== undefined)\n return true;\n is_tainted = true;\n if (options.verbose) console.warn('Route', rel.type+'/'+rel.id, 'tainted by a way', m.type+'/'+m.ref, 'with a missing node');\n return false;\n })\n };\n });\n members = _.compact(members);\n // construct connected linestrings\n var linestrings;\n linestrings = join(members);\n\n // sanitize mp-coordinates (remove empty clusters or rings, {lat,lon,...} to [lon,lat]\n var coords = [];\n coords = _.compact(linestrings.map(function(linestring) {\n return _.compact(linestring.map(function(node) {\n return [+node.lon,+node.lat];\n }));\n }));\n\n if (coords.length == 0) {\n if (options.verbose) console.warn('Route', rel.type+'/'+rel.id, 'contains no coordinates');\n return false; // ignore routes without coordinates\n }\n\n // mp parsed, now construct the geoJSON\n var feature = {\n \"type\" : \"Feature\",\n \"id\" : rel.type+\"/\"+rel.id,\n \"properties\" : {\n \"type\" : rel.type,\n \"id\" : rel.id,\n \"tags\" : rel.tags || {},\n \"relations\" : relsmap[rel.type][rel.id] || [],\n \"meta\": build_meta_information(rel)\n },\n \"geometry\" : {\n \"type\" : coords.length === 1 ? \"LineString\" : \"MultiLineString\",\n \"coordinates\" : coords.length === 1 ? coords[0] : coords,\n }\n }\n if (is_tainted) {\n if (options.verbose) console.warn('Route', rel.type+'/'+rel.id, 'is tainted');\n feature.properties[\"tainted\"] = true;\n }\n return feature;\n }\n } // end construct multilinestring for route relations\n if ((typeof rels[i].tags != \"undefined\") &&\n (rels[i].tags[\"type\"] == \"multipolygon\" || rels[i].tags[\"type\"] == \"boundary\")) {\n if (!_.isArray(rels[i].members)) {\n if (options.verbose) console.warn('Multipolygon',rels[i].type+'/'+rels[i].id,'ignored because it has no members');\n continue; // ignore relations without members (e.g. returned by an ids_only query)\n }\n var outer_count = 0;\n for (var j=0;j<rels[i].members.length;j++)\n if (rels[i].members[j].role == \"outer\")\n outer_count++;\n else if (options.verbose && rels[i].members[j].role != \"inner\")\n console.warn('Multipolygon',rels[i].type+'/'+rels[i].id,'member',rels[i].members[j].type+'/'+rels[i].members[j].ref,'ignored because it has an invalid role: \"' + rels[i].members[j].role + '\"');\n rels[i].members.forEach(function(m) {\n if (wayids[m.ref]) {\n // this even works in the following corner case:\n // a multipolygon amenity=xxx with outer line tagged amenity=yyy\n // see https://github.com/tyrasd/osmtogeojson/issues/7\n if (m.role===\"outer\" && !has_interesting_tags(wayids[m.ref].tags,rels[i].tags))\n wayids[m.ref].is_skippablerelationmember = true;\n if (m.role===\"inner\" && !has_interesting_tags(wayids[m.ref].tags))\n wayids[m.ref].is_skippablerelationmember = true;\n }\n });\n if (outer_count == 0) {\n if (options.verbose) console.warn('Multipolygon relation',rels[i].type+'/'+rels[i].id,'ignored because it has no outer ways');\n continue; // ignore multipolygons without outer ways\n }\n var simple_mp = false;\n if (outer_count == 1 && !has_interesting_tags(rels[i].tags, {\"type\":true}))\n simple_mp = true;\n var feature = null;\n if (!simple_mp) {\n feature = construct_multipolygon(rels[i], rels[i]);\n } else {\n // simple multipolygon\n var outer_way = rels[i].members.filter(function(m) {return m.role === \"outer\";})[0];\n outer_way = wayids[outer_way.ref];\n if (outer_way === undefined) {\n if (options.verbose) console.warn('Multipolygon relation',rels[i].type+'/'+rels[i].id,'ignored because outer way', outer_way.type+'/'+outer_way.ref,'is missing');\n continue; // abort if outer way object is not present\n }\n outer_way.is_skippablerelationmember = true;\n feature = construct_multipolygon(outer_way, rels[i]);\n }\n if (feature === false) {\n if (options.verbose) console.warn('Multipolygon relation',rels[i].type+'/'+rels[i].id,'ignored because it has invalid geometry');\n continue; // abort if feature could not be constructed\n }\n if (!featureCallback)\n geojsonpolygons.push(feature);\n else\n featureCallback(rewind(feature));\n\n function construct_multipolygon(tag_object, rel) {\n var is_tainted = false;\n var mp_geometry = simple_mp ? 'way' : 'relation',\n mp_id = typeof tag_object.id === \"number\" ? tag_object.id : +(tag_object.id.replace(\"_fullGeom\", \"\"));\n // prepare mp members\n var members;\n members = rel.members.filter(function(m) {return m.type === \"way\";});\n members = members.map(function(m) {\n var way = wayids[m.ref];\n if (way === undefined || way.nodes === undefined) { // check for missing ways\n if (options.verbose) console.warn('Multipolygon', mp_geometry+'/'+mp_id, 'tainted by a missing or incomplete way', m.type+'/'+m.ref);\n is_tainted = true;\n return;\n }\n return { // TODO: this is slow! :(\n id: m.ref,\n role: m.role || \"outer\",\n way: way,\n nodes: way.nodes.filter(function(n) {\n if (n !== undefined)\n return true;\n is_tainted = true;\n if (options.verbose) console.warn('Multipolygon', mp_geometry+'/'+mp_id, 'tainted by a way', m.type+'/'+m.ref, 'with a missing node');\n return false;\n })\n };\n });\n members = _.compact(members);\n // construct outer and inner rings\n var outers, inners;\n outers = join(members.filter(function(m) {return m.role===\"outer\";}));\n inners = join(members.filter(function(m) {return m.role===\"inner\";}));\n // sort rings\n var mp;\n function findOuter(inner) {\n var polygonIntersectsPolygon = function(outer, inner) {\n for (var i=0; i<inner.length; i++)\n if (pointInPolygon(inner[i], outer))\n return true;\n return false;\n }\n var mapCoordinates = function(from) {\n return from.map(function(n) {\n return [+n.lat,+n.lon];\n });\n }\n // stolen from iD/geo.js,\n // based on https://github.com/substack/point-in-polygon,\n // ray-casting algorithm based on http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html\n var pointInPolygon = function(point, polygon) {\n var x = point[0], y = point[1], inside = false;\n for (var i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {\n var xi = polygon[i][0], yi = polygon[i][1];\n var xj = polygon[j][0], yj = polygon[j][1];\n var intersect = ((yi > y) != (yj > y)) &&\n (x < (xj - xi) * (y - yi) / (yj - yi) + xi);\n if (intersect) inside = !inside;\n }\n return inside;\n };\n // stolen from iD/relation.js\n var o, outer;\n // todo: all this coordinate mapping makes this unneccesarily slow.\n // see the \"todo: this is slow! :(\" above.\n inner = mapCoordinates(inner);\n /*for (o = 0; o < outers.length; o++) {\n outer = mapCoordinates(outers[o]);\n if (polygonContainsPolygon(outer, inner))\n return o;\n }*/\n for (o = 0; o < outers.length; o++) {\n outer = mapCoordinates(outers[o]);\n if (polygonIntersectsPolygon(outer, inner))\n return o;\n }\n }\n mp = outers.map(function(o) {return [o];});\n for (var j=0; j<inners.length; j++) {\n var o = findOuter(inners[j]);\n if (o !== undefined)\n mp[o].push(inners[j]);\n else\n if (options.verbose) console.warn('Multipolygon', mp_geometry+'/'+mp_id, 'contains an inner ring with no containing outer');\n // so, no outer ring for this inner ring is found.\n // We're going to ignore holes in empty space.\n ;\n }\n // sanitize mp-coordinates (remove empty clusters or rings, {lat,lon,...} to [lon,lat]\n var mp_coords = [];\n mp_coords = _.compact(mp.map(function(cluster) {\n var cl = _.compact(cluster.map(function(ring) {\n if (ring.length < 4) { // todo: is this correct: ring.length < 4 ?\n if (options.verbose) console.warn('Multipolygon', mp_geometry+'/'+mp_id, 'contains a ring with less than four nodes');\n return;\n }\n return _.compact(ring.map(function(node) {\n return [+node.lon,+node.lat];\n }));\n }));\n if (cl.length == 0) {\n if (options.verbose) console.warn('Multipolygon', mp_geometry+'/'+mp_id, 'contains an empty ring cluster');\n return;\n }\n return cl;\n }));\n\n if (mp_coords.length == 0) {\n if (options.verbose) console.warn('Multipolygon', mp_geometry+'/'+mp_id, 'contains no coordinates');\n return false; // ignore multipolygons without coordinates\n }\n var mp_type = \"MultiPolygon\";\n if (mp_coords.length === 1) {\n mp_type = \"Polygon\";\n mp_coords = mp_coords[0];\n }\n // mp parsed, now construct the geoJSON\n var feature = {\n \"type\" : \"Feature\",\n \"id\" : tag_object.type+\"/\"+mp_id,\n \"properties\" : {\n \"type\" : tag_object.type,\n \"id\" : mp_id,\n \"tags\" : tag_object.tags || {},\n \"relations\" : relsmap[tag_object.type][tag_object.id] || [],\n \"meta\": build_meta_information(tag_object)\n },\n \"geometry\" : {\n \"type\" : mp_type,\n \"coordinates\" : mp_coords,\n }\n }\n if (is_tainted) {\n if (options.verbose) console.warn('Multipolygon', mp_geometry+'/'+mp_id, 'is tainted');\n feature.properties[\"tainted\"] = true;\n }\n return feature;\n }\n }\n }\n // process lines and polygons\n for (var i=0;i<ways.length;i++) {\n // todo: refactor such that this loops over wayids instead of ways?\n if (wayids[ways[i].id] !== ways[i]) {\n // skip way because it's a deduplication artifact\n continue;\n }\n if (!_.isArray(ways[i].nodes)) {\n if (options.verbose) console.warn('Way',ways[i].type+'/'+ways[i].id,'ignored because it has no nodes');\n continue; // ignore ways without nodes (e.g. returned by an ids_only query)\n }\n if (ways[i].is_skippablerelationmember)\n continue; // ignore ways which are already rendered as (part of) a multipolygon\n if (typeof ways[i].id !== \"number\") {\n // remove full geometry namespace for output\n ways[i].id = +ways[i].id.replace(\"_fullGeom\", \"\");\n }\n ways[i].tainted = false;\n ways[i].hidden = false;\n var coords = new Array();\n for (j=0;j<ways[i].nodes.length;j++) {\n if (typeof ways[i].nodes[j] == \"object\")\n coords.push([+ways[i].nodes[j].lon, +ways[i].nodes[j].lat]);\n else {\n if (options.verbose) console.warn('Way',ways[i].type+'/'+ways[i].id,'is tainted by an invalid node');\n ways[i].tainted = true;\n }\n }\n if (coords.length <= 1) { // invalid way geometry\n if (options.verbose) console.warn('Way',ways[i].type+'/'+ways[i].id,'ignored because it contains too few nodes');\n continue;\n }\n var way_type = \"LineString\"; // default\n if (typeof ways[i].nodes[0] != \"undefined\" && typeof ways[i].nodes[ways[i].nodes.length-1] != \"undefined\" && // way has its start/end nodes loaded\n ways[i].nodes[0].id === ways[i].nodes[ways[i].nodes.length-1].id && // ... and forms a closed ring\n (\n typeof ways[i].tags != \"undefined\" && // ... and has tags\n _isPolygonFeature(ways[i].tags) // ... and tags say it is a polygon\n || // or is a placeholder for a bounds geometry\n ways[i].__is_bounds_placeholder\n )\n ) {\n way_type = \"Polygon\";\n coords = [coords];\n }\n var feature = {\n \"type\" : \"Feature\",\n \"id\" : ways[i].type+\"/\"+ways[i].id,\n \"properties\" : {\n \"type\" : ways[i].type,\n \"id\" : ways[i].id,\n \"tags\" : ways[i].tags || {},\n \"relations\" : relsmap[\"way\"][ways[i].id] || [],\n \"meta\": build_meta_information(ways[i])\n },\n \"geometry\" : {\n \"type\" : way_type,\n \"coordinates\" : coords,\n }\n }\n if (ways[i].tainted) {\n if (options.verbose) console.warn('Way',ways[i].type+'/'+ways[i].id,'is tainted');\n feature.properties[\"tainted\"] = true;\n }\n if (ways[i].__is_bounds_placeholder)\n feature.properties[\"geometry\"] = \"bounds\";\n if (!featureCallback) {\n if (way_type == \"LineString\")\n geojsonlines.push(feature);\n else\n geojsonpolygons.push(feature);\n } else {\n featureCallback(rewind(feature));\n }\n }\n\n if (featureCallback)\n return true;\n\n geojson = {\n \"type\": \"FeatureCollection\",\n \"features\": []\n };\n geojson.features = geojson.features.concat(geojsonpolygons);\n geojson.features = geojson.features.concat(geojsonlines);\n geojson.features = geojson.features.concat(geojsonnodes);\n // optionally, flatten properties\n if (options.flatProperties) {\n geojson.features.forEach(function(f) {\n f.properties = _.merge(\n f.properties.meta,\n f.properties.tags,\n {id: f.properties.type+\"/\"+f.properties.id}\n );\n });\n }\n // fix polygon winding\n geojson = rewind(geojson);\n return geojson;\n }\n function _isPolygonFeature( tags ) {\n var polygonFeatures = options.polygonFeatures;\n if (typeof polygonFeatures === \"function\")\n return polygonFeatures(tags);\n // explicitely tagged non-areas\n if ( tags['area'] === 'no' )\n return false;\n // assuming that a typical OSM way has in average less tags than\n // the polygonFeatures list, this way around should be faster\n for ( var key in tags ) {\n var val = tags[key];\n var pfk = polygonFeatures[key];\n // continue with next if tag is unknown or not \"categorizing\"\n if ( typeof pfk === 'undefined' )\n continue;\n // continue with next if tag is explicitely un-set (\"building=no\")\n if ( val === 'no' )\n continue;\n // check polygon features for: general acceptance, included or excluded values\n if ( pfk === true )\n return true;\n if ( pfk.included_values && pfk.included_values[val] === true )\n return true;\n if ( pfk.excluded_values && pfk.excluded_values[val] !== true )\n return true;\n }\n // if no tags matched, this ain't no area.\n return false;\n }\n};\n\n// helper that joins adjacent osm ways into linestrings or linear rings\nfunction join(ways) {\n var _first = function(arr) {return arr[0]};\n var _last = function(arr) {return arr[arr.length-1]};\n var _fitTogether = function(n1, n2) {\n return n1 !== undefined && n2 !== undefined && n1.id === n2.id;\n }\n // stolen from iD/relation.js\n var joined = [], current, first, last, i, how, what;\n while (ways.length) {\n current = ways.pop().nodes.slice();\n joined.push(current);\n while (ways.length && !_fitTogether(_first(current), _last(current))) {\n first = _first(current);\n last = _last(current);\n for (i = 0; i < ways.length; i++) {\n what = ways[i].nodes;\n if (_fitTogether(last, _first(what))) {\n how = current.push;\n what = what.slice(1);\n break;\n } else if (_fitTogether(last, _last(what))) {\n how = current.push;\n what = what.slice(0, -1).reverse();\n break;\n } else if (_fitTogether(first, _last(what))) {\n how = current.unshift;\n what = what.slice(0, -1);\n break;\n } else if (_fitTogether(first, _first(what))) {\n how = current.unshift;\n what = what.slice(1).reverse();\n break;\n } else {\n what = how = null;\n }\n }\n if (!what)\n break; // Invalid geometry (dangling way, unclosed ring)\n ways.splice(i, 1);\n how.apply(current, what);\n }\n }\n return joined;\n}\n\n// for backwards compatibility\nosmtogeojson.toGeojson = osmtogeojson;\n\nmodule.exports = osmtogeojson;\n","'use strict';\n\n/**\n * Ponyfill for `Array.prototype.find` which is only available in ES6 runtimes.\n *\n * Works with anything that has a `length` property and index access properties,\n * including NodeList.\n *\n * @param {T[] | { length: number; [number]: T }} list\n * @param {function (item: T, index: number, list:T[]):boolean} predicate\n * @param {Partial<Pick<ArrayConstructor['prototype'], 'find'>>?} ac\n * Allows injecting a custom implementation in tests (`Array.prototype` by default).\n * @returns {T | undefined}\n * @template {unknown} T\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find\n * @see https://tc39.es/ecma262/multipage/indexed-collections.html#sec-array.prototype.find\n */\nfunction find(list, predicate, ac) {\n\tif (ac === undefined) {\n\t\tac = Array.prototype;\n\t}\n\tif (list && typeof ac.find === 'function') {\n\t\treturn ac.find.call(list, predicate);\n\t}\n\tfor (var i = 0; i < list.length; i++) {\n\t\tif (hasOwn(list, i)) {\n\t\t\tvar item = list[i];\n\t\t\tif (predicate.call(undefined, item, i, list)) {\n\t\t\t\treturn item;\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * \"Shallow freezes\" an object to render it immutable.\n * Uses `Object.freeze` if available,\n * otherwise the immutability is only in the type.\n *\n * Is used to create \"enum like\" objects.\n *\n * If `Object.getOwnPropertyDescriptors` is available,\n * a new object with all properties of object but without any prototype is created and returned\n * after freezing it.\n *\n * @param {T} object\n * The object to freeze.\n * @param {Pick<ObjectConstructor, 'create' | 'freeze' | 'getOwnPropertyDescriptors'>} [oc=Object]\n * `Object` by default,\n * allows to inject custom object constructor for tests.\n * @returns {Readonly<T>}\n * @template {Object} T\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze\n * @prettierignore\n */\nfunction freeze(object, oc) {\n\tif (oc === undefined) {\n\t\toc = Object;\n\t}\n\tif (oc && typeof oc.getOwnPropertyDescriptors === 'function') {\n\t\tobject = oc.create(null, oc.getOwnPropertyDescriptors(object));\n\t}\n\treturn oc && typeof oc.freeze === 'function' ? oc.freeze(object) : object;\n}\n\n/**\n * Implementation for `Object.hasOwn` but ES5 compatible.\n *\n * @param {any} object\n * @param {string | number} key\n * @returns {boolean}\n */\nfunction hasOwn(object, key) {\n\treturn Object.prototype.hasOwnProperty.call(object, key);\n}\n\n/**\n * Since xmldom can not rely on `Object.assign`,\n * it uses/provides a simplified version that is sufficient for its needs.\n *\n * @param {Object} target\n * @param {Object | null | undefined} source\n * @returns {Object}\n * The target with the merged/overridden properties.\n * @throws {TypeError}\n * If target is not an object.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\n * @see https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.assign\n */\nfunction assign(target, source) {\n\tif (target === null || typeof target !== 'object') {\n\t\tthrow new TypeError('target is not an object');\n\t}\n\tfor (var key in source) {\n\t\tif (hasOwn(source, key)) {\n\t\t\ttarget[key] = source[key];\n\t\t}\n\t}\n\treturn target;\n}\n\n/**\n * A number of attributes are boolean attributes.\n * The presence of a boolean attribute on an element represents the `true` value,\n * and the absence of the attribute represents the `false` value.\n *\n * If the attribute is present, its value must either be the empty string, or a value that is\n * an ASCII case-insensitive match for the attribute's canonical name,\n * with no leading or trailing whitespace.\n *\n * Note: The values `\"true\"` and `\"false\"` are not allowed on boolean attributes.\n * To represent a `false` value, the attribute has to be omitted altogether.\n *\n * @see https://html.spec.whatwg.org/#boolean-attributes\n * @see https://html.spec.whatwg.org/#attributes-3\n */\nvar HTML_BOOLEAN_ATTRIBUTES = freeze({\n\tallowfullscreen: true,\n\tasync: true,\n\tautofocus: true,\n\tautoplay: true,\n\tchecked: true,\n\tcontrols: true,\n\tdefault: true,\n\tdefer: true,\n\tdisabled: true,\n\tformnovalidate: true,\n\thidden: true,\n\tismap: true,\n\titemscope: true,\n\tloop: true,\n\tmultiple: true,\n\tmuted: true,\n\tnomodule: true,\n\tnovalidate: true,\n\topen: true,\n\tplaysinline: true,\n\treadonly: true,\n\trequired: true,\n\treversed: true,\n\tselected: true,\n});\n\n/**\n * Check if `name` is matching one of the HTML boolean attribute names.\n * This method doesn't check if such attributes are allowed in the context of the current\n * document/parsing.\n *\n * @param {string} name\n * @returns {boolean}\n * @see {@link HTML_BOOLEAN_ATTRIBUTES}\n * @see https://html.spec.whatwg.org/#boolean-attributes\n * @see https://html.spec.whatwg.org/#attributes-3\n */\nfunction isHTMLBooleanAttribute(name) {\n\treturn hasOwn(HTML_BOOLEAN_ATTRIBUTES, name.toLowerCase());\n}\n\n/**\n * Void elements only have a start tag; end tags must not be specified for void elements.\n * These elements should be written as self-closing like this: `<area />`.\n * This should not be confused with optional tags that HTML allows to omit the end tag for\n * (like `li`, `tr` and others), which can have content after them,\n * so they can not be written as self-closing.\n * xmldom does not have any logic for optional end tags cases,\n * and will report them as a warning.\n * Content that would go into the unopened element,\n * will instead be added as a sibling text node.\n *\n * @type {Readonly<{\n * \tarea: boolean;\n * \tcol: boolean;\n * \timg: boolean;\n * \twbr: boolean;\n * \tlink: boolean;\n * \thr: boolean;\n * \tsource: boolean;\n * \tbr: boolean;\n * \tinput: boolean;\n * \tparam: boolean;\n * \tmeta: boolean;\n * \tembed: boolean;\n * \ttrack: boolean;\n * \tbase: boolean;\n * }>}\n * @see https://html.spec.whatwg.org/#void-elements\n * @see https://html.spec.whatwg.org/#optional-tags\n */\nvar HTML_VOID_ELEMENTS = freeze({\n\tarea: true,\n\tbase: true,\n\tbr: true,\n\tcol: true,\n\tembed: true,\n\thr: true,\n\timg: true,\n\tinput: true,\n\tlink: true,\n\tmeta: true,\n\tparam: true,\n\tsource: true,\n\ttrack: true,\n\twbr: true,\n});\n\n/**\n * Check if `tagName` is matching one of the HTML void element names.\n * This method doesn't check if such tags are allowed in the context of the current\n * document/parsing.\n *\n * @param {string} tagName\n * @returns {boolean}\n * @see {@link HTML_VOID_ELEMENTS}\n * @see https://html.spec.whatwg.org/#void-elements\n */\nfunction isHTMLVoidElement(tagName) {\n\treturn hasOwn(HTML_VOID_ELEMENTS, tagName.toLowerCase());\n}\n\n/**\n * Tag names that are raw text elements according to HTML spec.\n * The value denotes whether they are escapable or not.\n *\n * @see {@link isHTMLEscapableRawTextElement}\n * @see {@link isHTMLRawTextElement}\n * @see https://html.spec.whatwg.org/#raw-text-elements\n * @see https://html.spec.whatwg.org/#escapable-raw-text-elements\n */\nvar HTML_RAW_TEXT_ELEMENTS = freeze({\n\tscript: false,\n\tstyle: false,\n\ttextarea: true,\n\ttitle: true,\n});\n\n/**\n * Check if `tagName` is matching one of the HTML raw text element names.\n * This method doesn't check if such tags are allowed in the context of the current\n * document/parsing.\n *\n * @param {string} tagName\n * @returns {boolean}\n * @see {@link isHTMLEscapableRawTextElement}\n * @see {@link HTML_RAW_TEXT_ELEMENTS}\n * @see https://html.spec.whatwg.org/#raw-text-elements\n * @see https://html.spec.whatwg.org/#escapable-raw-text-elements\n */\nfunction isHTMLRawTextElement(tagName) {\n\tvar key = tagName.toLowerCase();\n\treturn hasOwn(HTML_RAW_TEXT_ELEMENTS, key) && !HTML_RAW_TEXT_ELEMENTS[key];\n}\n/**\n * Check if `tagName` is matching one of the HTML escapable raw text element names.\n * This method doesn't check if such tags are allowed in the context of the current\n * document/parsing.\n *\n * @param {string} tagName\n * @returns {boolean}\n * @see {@link isHTMLRawTextElement}\n * @see {@link HTML_RAW_TEXT_ELEMENTS}\n * @see https://html.spec.whatwg.org/#raw-text-elements\n * @see https://html.spec.whatwg.org/#escapable-raw-text-elements\n */\nfunction isHTMLEscapableRawTextElement(tagName) {\n\tvar key = tagName.toLowerCase();\n\treturn hasOwn(HTML_RAW_TEXT_ELEMENTS, key) && HTML_RAW_TEXT_ELEMENTS[key];\n}\n/**\n * Only returns true if `value` matches MIME_TYPE.HTML, which indicates an HTML document.\n *\n * @param {string} mimeType\n * @returns {mimeType is 'text/html'}\n * @see https://www.iana.org/assignments/media-types/text/html\n * @see https://en.wikipedia.org/wiki/HTML\n * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString\n * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-domparser-parsefromstring\n */\nfunction isHTMLMimeType(mimeType) {\n\treturn mimeType === MIME_TYPE.HTML;\n}\n/**\n * For both the `text/html` and the `application/xhtml+xml` namespace the spec defines that the\n * HTML namespace is provided as the default.\n *\n * @param {string} mimeType\n * @returns {boolean}\n * @see https://dom.spec.whatwg.org/#dom-document-createelement\n * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocument\n * @see https://dom.spec.whatwg.org/#dom-domimplementation-createhtmldocument\n */\nfunction hasDefaultHTMLNamespace(mimeType) {\n\treturn isHTMLMimeType(mimeType) || mimeType === MIME_TYPE.XML_XHTML_APPLICATION;\n}\n\n/**\n * All mime types that are allowed as input to `DOMParser.parseFromString`\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString#Argument02\n * MDN\n * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#domparsersupportedtype\n * WHATWG HTML Spec\n * @see {@link DOMParser.prototype.parseFromString}\n */\nvar MIME_TYPE = freeze({\n\t/**\n\t * `text/html`, the only mime type that triggers treating an XML document as HTML.\n\t *\n\t * @see https://www.iana.org/assignments/media-types/text/html IANA MimeType registration\n\t * @see https://en.wikipedia.org/wiki/HTML Wikipedia\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString MDN\n\t * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-domparser-parsefromstring\n\t * WHATWG HTML Spec\n\t */\n\tHTML: 'text/html',\n\n\t/**\n\t * `application/xml`, the standard mime type for XML documents.\n\t *\n\t * @see https://www.iana.org/assignments/media-types/application/xml IANA MimeType\n\t * registration\n\t * @see https://tools.ietf.org/html/rfc7303#section-9.1 RFC 7303\n\t * @see https://en.wikipedia.org/wiki/XML_and_MIME Wikipedia\n\t */\n\tXML_APPLICATION: 'application/xml',\n\n\t/**\n\t * `text/xml`, an alias for `application/xml`.\n\t *\n\t * @see https://tools.ietf.org/html/rfc7303#section-9.2 RFC 7303\n\t * @see https://www.iana.org/assignments/media-types/text/xml IANA MimeType registration\n\t * @see https://en.wikipedia.org/wiki/XML_and_MIME Wikipedia\n\t */\n\tXML_TEXT: 'text/xml',\n\n\t/**\n\t * `application/xhtml+xml`, indicates an XML document that has the default HTML namespace,\n\t * but is parsed as an XML document.\n\t *\n\t * @see https://www.iana.org/assignments/media-types/application/xhtml+xml IANA MimeType\n\t * registration\n\t * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocument WHATWG DOM Spec\n\t * @see https://en.wikipedia.org/wiki/XHTML Wikipedia\n\t */\n\tXML_XHTML_APPLICATION: 'application/xhtml+xml',\n\n\t/**\n\t * `image/svg+xml`,\n\t *\n\t * @see https://www.iana.org/assignments/media-types/image/svg+xml IANA MimeType registration\n\t * @see https://www.w3.org/TR/SVG11/ W3C SVG 1.1\n\t * @see https://en.wikipedia.org/wiki/Scalable_Vector_Graphics Wikipedia\n\t */\n\tXML_SVG_IMAGE: 'image/svg+xml',\n});\n/**\n * @typedef {'application/xhtml+xml' | 'application/xml' | 'image/svg+xml' | 'text/html' | 'text/xml'}\n * MimeType\n */\n/**\n * @type {MimeType[]}\n * @private\n * Basically `Object.values`, which is not available in ES5.\n */\nvar _MIME_TYPES = Object.keys(MIME_TYPE).map(function (key) {\n\treturn MIME_TYPE[key];\n});\n\n/**\n * Only returns true if `mimeType` is one of the allowed values for\n * `DOMParser.parseFromString`.\n *\n * @param {string} mimeType\n * @returns {mimeType is 'application/xhtml+xml' | 'application/xml' | 'image/svg+xml' | 'text/html' | 'text/xml'}\n *\n */\nfunction isValidMimeType(mimeType) {\n\treturn _MIME_TYPES.indexOf(mimeType) > -1;\n}\n/**\n * Namespaces that are used in this code base.\n *\n * @see http://www.w3.org/TR/REC-xml-names\n */\nvar NAMESPACE = freeze({\n\t/**\n\t * The XHTML namespace.\n\t *\n\t * @see http://www.w3.org/1999/xhtml\n\t */\n\tHTML: 'http://www.w3.org/1999/xhtml',\n\n\t/**\n\t * The SVG namespace.\n\t *\n\t * @see http://www.w3.org/2000/svg\n\t */\n\tSVG: 'http://www.w3.org/2000/svg',\n\n\t/**\n\t * The `xml:` namespace.\n\t *\n\t * @see http://www.w3.org/XML/1998/namespace\n\t */\n\tXML: 'http://www.w3.org/XML/1998/namespace',\n\n\t/**\n\t * The `xmlns:` namespace.\n\t *\n\t * @see https://www.w3.org/2000/xmlns/\n\t */\n\tXMLNS: 'http://www.w3.org/2000/xmlns/',\n});\n\nexports.assign = assign;\nexports.find = find;\nexports.freeze = freeze;\nexports.HTML_BOOLEAN_ATTRIBUTES = HTML_BOOLEAN_ATTRIBUTES;\nexports.HTML_RAW_TEXT_ELEMENTS = HTML_RAW_TEXT_ELEMENTS;\nexports.HTML_VOID_ELEMENTS = HTML_VOID_ELEMENTS;\nexports.hasDefaultHTMLNamespace = hasDefaultHTMLNamespace;\nexports.hasOwn = hasOwn;\nexports.isHTMLBooleanAttribute = isHTMLBooleanAttribute;\nexports.isHTMLRawTextElement = isHTMLRawTextElement;\nexports.isHTMLEscapableRawTextElement = isHTMLEscapableRawTextElement;\nexports.isHTMLMimeType = isHTMLMimeType;\nexports.isHTMLVoidElement = isHTMLVoidElement;\nexports.isValidMimeType = isValidMimeType;\nexports.MIME_TYPE = MIME_TYPE;\nexports.NAMESPACE = NAMESPACE;\n","'use strict';\n\nvar conventions = require('./conventions');\n\nfunction extendError(constructor, writableName) {\n\tconstructor.prototype = Object.create(Error.prototype, {\n\t\tconstructor: { value: constructor },\n\t\tname: { value: constructor.name, enumerable: true, writable: writableName },\n\t});\n}\n\nvar DOMExceptionName = conventions.freeze({\n\t/**\n\t * the default value as defined by the spec\n\t */\n\tError: 'Error',\n\t/**\n\t * @deprecated\n\t * Use RangeError instead.\n\t */\n\tIndexSizeError: 'IndexSizeError',\n\t/**\n\t * @deprecated\n\t * Just to match the related static code, not part of the spec.\n\t */\n\tDomstringSizeError: 'DomstringSizeError',\n\tHierarchyRequestError: 'HierarchyRequestError',\n\tWrongDocumentError: 'WrongDocumentError',\n\tInvalidCharacterError: 'InvalidCharacterError',\n\t/**\n\t * @deprecated\n\t * Just to match the related static code, not part of the spec.\n\t */\n\tNoDataAllowedError: 'NoDataAllowedError',\n\tNoModificationAllowedError: 'NoModificationAllowedError',\n\tNotFoundError: 'NotFoundError',\n\tNotSupportedError: 'NotSupportedError',\n\tInUseAttributeError: 'InUseAttributeError',\n\tInvalidStateError: 'InvalidStateError',\n\tSyntaxError: 'SyntaxError',\n\tInvalidModificationError: 'InvalidModificationError',\n\tNamespaceError: 'NamespaceError',\n\t/**\n\t * @deprecated\n\t * Use TypeError for invalid arguments,\n\t * \"NotSupportedError\" DOMException for unsupported operations,\n\t * and \"NotAllowedError\" DOMException for denied requests instead.\n\t */\n\tInvalidAccessError: 'InvalidAccessError',\n\t/**\n\t * @deprecated\n\t * Just to match the related static code, not part of the spec.\n\t */\n\tValidationError: 'ValidationError',\n\t/**\n\t * @deprecated\n\t * Use TypeError instead.\n\t */\n\tTypeMismatchError: 'TypeMismatchError',\n\tSecurityError: 'SecurityError',\n\tNetworkError: 'NetworkError',\n\tAbortError: 'AbortError',\n\t/**\n\t * @deprecated\n\t * Just to match the related static code, not part of the spec.\n\t */\n\tURLMismatchError: 'URLMismatchError',\n\tQuotaExceededError: 'QuotaExceededError',\n\tTimeoutError: 'TimeoutError',\n\tInvalidNodeTypeError: 'InvalidNodeTypeError',\n\tDataCloneError: 'DataCloneError',\n\tEncodingError: 'EncodingError',\n\tNotReadableError: 'NotReadableError',\n\tUnknownError: 'UnknownError',\n\tConstraintError: 'ConstraintError',\n\tDataError: 'DataError',\n\tTransactionInactiveError: 'TransactionInactiveError',\n\tReadOnlyError: 'ReadOnlyError',\n\tVersionError: 'VersionError',\n\tOperationError: 'OperationError',\n\tNotAllowedError: 'NotAllowedError',\n\tOptOutError: 'OptOutError',\n});\nvar DOMExceptionNames = Object.keys(DOMExceptionName);\n\nfunction isValidDomExceptionCode(value) {\n\treturn typeof value === 'number' && value >= 1 && value <= 25;\n}\nfunction endsWithError(value) {\n\treturn typeof value === 'string' && value.substring(value.length - DOMExceptionName.Error.length) === DOMExceptionName.Error;\n}\n/**\n * DOM operations only raise exceptions in \"exceptional\" circumstances, i.e., when an operation\n * is impossible to perform (either for logical reasons, because data is lost, or because the\n * implementation has become unstable). In general, DOM methods return specific error values in\n * ordinary processing situations, such as out-of-bound errors when using NodeList.\n *\n * Implementations should raise other exceptions under other circumstances. For example,\n * implementations should raise an implementation-dependent exception if a null argument is\n * passed when null was not expected.\n *\n * This implementation supports the following usages:\n * 1. according to the living standard (both arguments are optional):\n * ```\n * new DOMException(\"message (can be empty)\", DOMExceptionNames.HierarchyRequestError)\n * ```\n * 2. according to previous xmldom implementation (only the first argument is required):\n * ```\n * new DOMException(DOMException.HIERARCHY_REQUEST_ERR, \"optional message\")\n * ```\n * both result in the proper name being set.\n *\n * @class DOMException\n * @param {number | string} messageOrCode\n * The reason why an operation is not acceptable.\n * If it is a number, it is used to determine the `name`, see\n * {@link https://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-258A00AF ExceptionCode}\n * @param {string | keyof typeof DOMExceptionName | Error} [nameOrMessage]\n * The `name` to use for the error.\n * If `messageOrCode` is a number, this arguments is used as the `message` instead.\n * @augments Error\n * @see https://webidl.spec.whatwg.org/#idl-DOMException\n * @see https://webidl.spec.whatwg.org/#dfn-error-names-table\n * @see https://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-17189187\n * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html\n * @see http://www.w3.org/TR/REC-DOM-Level-1/ecma-script-language-binding.html\n */\nfunction DOMException(messageOrCode, nameOrMessage) {\n\t// support old way of passing arguments: first argument is a valid number\n\tif (isValidDomExceptionCode(messageOrCode)) {\n\t\tthis.name = DOMExceptionNames[messageOrCode];\n\t\tthis.message = nameOrMessage || '';\n\t} else {\n\t\tthis.message = messageOrCode;\n\t\tthis.name = endsWithError(nameOrMessage) ? nameOrMessage : DOMExceptionName.Error;\n\t}\n\tif (Error.captureStackTrace) Error.captureStackTrace(this, DOMException);\n}\nextendError(DOMException, true);\nObject.defineProperties(DOMException.prototype, {\n\tcode: {\n\t\tenumerable: true,\n\t\tget: function () {\n\t\t\tvar code = DOMExceptionNames.indexOf(this.name);\n\t\t\tif (isValidDomExceptionCode(code)) return code;\n\t\t\treturn 0;\n\t\t},\n\t},\n});\n\nvar ExceptionCode = {\n\tINDEX_SIZE_ERR: 1,\n\tDOMSTRING_SIZE_ERR: 2,\n\tHIERARCHY_REQUEST_ERR: 3,\n\tWRONG_DOCUMENT_ERR: 4,\n\tINVALID_CHARACTER_ERR: 5,\n\tNO_DATA_ALLOWED_ERR: 6,\n\tNO_MODIFICATION_ALLOWED_ERR: 7,\n\tNOT_FOUND_ERR: 8,\n\tNOT_SUPPORTED_ERR: 9,\n\tINUSE_ATTRIBUTE_ERR: 10,\n\tINVALID_STATE_ERR: 11,\n\tSYNTAX_ERR: 12,\n\tINVALID_MODIFICATION_ERR: 13,\n\tNAMESPACE_ERR: 14,\n\tINVALID_ACCESS_ERR: 15,\n\tVALIDATION_ERR: 16,\n\tTYPE_MISMATCH_ERR: 17,\n\tSECURITY_ERR: 18,\n\tNETWORK_ERR: 19,\n\tABORT_ERR: 20,\n\tURL_MISMATCH_ERR: 21,\n\tQUOTA_EXCEEDED_ERR: 22,\n\tTIMEOUT_ERR: 23,\n\tINVALID_NODE_TYPE_ERR: 24,\n\tDATA_CLONE_ERR: 25,\n};\n\nvar entries = Object.entries(ExceptionCode);\nfor (var i = 0; i < entries.length; i++) {\n\tvar key = entries[i][0];\n\tDOMException[key] = entries[i][1];\n}\n\n/**\n * Creates an error that will not be caught by XMLReader aka the SAX parser.\n *\n * @class\n * @param {string} message\n * @param {any} [locator]\n */\nfunction ParseError(message, locator) {\n\tthis.message = message;\n\tthis.locator = locator;\n\tif (Error.captureStackTrace) Error.captureStackTrace(this, ParseError);\n}\nextendError(ParseError);\n\nexports.DOMException = DOMException;\nexports.DOMExceptionName = DOMExceptionName;\nexports.ExceptionCode = ExceptionCode;\nexports.ParseError = ParseError;\n","'use strict';\n\n/**\n * Detects relevant unicode support for regular expressions in the runtime.\n * Should the runtime not accepts the flag `u` or unicode ranges,\n * character classes without unicode handling will be used.\n *\n * @param {typeof RegExp} [RegExpImpl=RegExp]\n * For testing: the RegExp class.\n * @returns {boolean}\n * @see https://node.green/#ES2015-syntax-RegExp--y--and--u--flags\n */\nfunction detectUnicodeSupport(RegExpImpl) {\n\ttry {\n\t\tif (typeof RegExpImpl !== 'function') {\n\t\t\tRegExpImpl = RegExp;\n\t\t}\n\t\t// eslint-disable-next-line es5/no-unicode-regex,es5/no-unicode-code-point-escape\n\t\tvar match = new RegExpImpl('\\u{1d306}', 'u').exec('𝌆');\n\t\treturn !!match && match[0].length === 2;\n\t} catch (error) {}\n\treturn false;\n}\nvar UNICODE_SUPPORT = detectUnicodeSupport();\n\n/**\n * Removes `[`, `]` and any trailing quantifiers from the source of a RegExp.\n *\n * @param {RegExp} regexp\n */\nfunction chars(regexp) {\n\tif (regexp.source[0] !== '[') {\n\t\tthrow new Error(regexp + ' can not be used with chars');\n\t}\n\treturn regexp.source.slice(1, regexp.source.lastIndexOf(']'));\n}\n\n/**\n * Creates a new character list regular expression,\n * by removing `search` from the source of `regexp`.\n *\n * @param {RegExp} regexp\n * @param {string} search\n * The character(s) to remove.\n * @returns {RegExp}\n */\nfunction chars_without(regexp, search) {\n\tif (regexp.source[0] !== '[') {\n\t\tthrow new Error('/' + regexp.source + '/ can not be used with chars_without');\n\t}\n\tif (!search || typeof search !== 'string') {\n\t\tthrow new Error(JSON.stringify(search) + ' is not a valid search');\n\t}\n\tif (regexp.source.indexOf(search) === -1) {\n\t\tthrow new Error('\"' + search + '\" is not is /' + regexp.source + '/');\n\t}\n\tif (search === '-' && regexp.source.indexOf(search) !== 1) {\n\t\tthrow new Error('\"' + search + '\" is not at the first postion of /' + regexp.source + '/');\n\t}\n\treturn new RegExp(regexp.source.replace(search, ''), UNICODE_SUPPORT ? 'u' : '');\n}\n\n/**\n * Combines and Regular expressions correctly by using `RegExp.source`.\n *\n * @param {...(RegExp | string)[]} args\n * @returns {RegExp}\n */\nfunction reg(args) {\n\tvar self = this;\n\treturn new RegExp(\n\t\tArray.prototype.slice\n\t\t\t.call(arguments)\n\t\t\t.map(function (part) {\n\t\t\t\tvar isStr = typeof part === 'string';\n\t\t\t\tif (isStr && self === undefined && part === '|') {\n\t\t\t\t\tthrow new Error('use regg instead of reg to wrap expressions with `|`!');\n\t\t\t\t}\n\t\t\t\treturn isStr ? part : part.source;\n\t\t\t})\n\t\t\t.join(''),\n\t\tUNICODE_SUPPORT ? 'mu' : 'm'\n\t);\n}\n\n/**\n * Like `reg` but wraps the expression in `(?:`,`)` to create a non tracking group.\n *\n * @param {...(RegExp | string)[]} args\n * @returns {RegExp}\n */\nfunction regg(args) {\n\tif (arguments.length === 0) {\n\t\tthrow new Error('no parameters provided');\n\t}\n\treturn reg.apply(regg, ['(?:'].concat(Array.prototype.slice.call(arguments), [')']));\n}\n\n// /**\n// * Append ^ to the beginning of the expression.\n// * @param {...(RegExp | string)[]} args\n// * @returns {RegExp}\n// */\n// function reg_start(args) {\n// \tif (arguments.length === 0) {\n// \t\tthrow new Error('no parameters provided');\n// \t}\n// \treturn reg.apply(reg_start, ['^'].concat(Array.prototype.slice.call(arguments)));\n// }\n\n// https://www.w3.org/TR/xml/#document\n// `[1] document ::= prolog element Misc*`\n// https://www.w3.org/TR/xml11/#NT-document\n// `[1] document ::= ( prolog element Misc* ) - ( Char* RestrictedChar Char* )`\n\n/**\n * A character usually appearing in wrongly converted strings.\n *\n * @type {string}\n * @see https://en.wikipedia.org/wiki/Specials_(Unicode_block)#Replacement_character\n * @see https://nodejs.dev/en/api/v18/buffer/#buffers-and-character-encodings\n * @see https://www.unicode.org/faq/utf_bom.html#BOM\n * @readonly\n */\nvar UNICODE_REPLACEMENT_CHARACTER = '\\uFFFD';\n// https://www.w3.org/TR/xml/#NT-Char\n// any Unicode character, excluding the surrogate blocks, FFFE, and FFFF.\n// `[2] Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]`\n// https://www.w3.org/TR/xml11/#NT-Char\n// `[2] Char ::= [#x1-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]`\n// https://www.w3.org/TR/xml11/#NT-RestrictedChar\n// `[2a] RestrictedChar ::= [#x1-#x8] | [#xB-#xC] | [#xE-#x1F] | [#x7F-#x84] | [#x86-#x9F]`\n// https://www.w3.org/TR/xml11/#charsets\nvar Char = /[-\\x09\\x0A\\x0D\\x20-\\x2C\\x2E-\\uD7FF\\uE000-\\uFFFD]/; // without \\u10000-\\uEFFFF\nif (UNICODE_SUPPORT) {\n\t// eslint-disable-next-line es5/no-unicode-code-point-escape\n\tChar = reg('[', chars(Char), '\\\\u{10000}-\\\\u{10FFFF}', ']');\n}\n\nvar _SChar = /[\\x20\\x09\\x0D\\x0A]/;\nvar SChar_s = chars(_SChar);\n// https://www.w3.org/TR/xml11/#NT-S\n// `[3] S ::= (#x20 | #x9 | #xD | #xA)+`\nvar S = reg(_SChar, '+');\n// optional whitespace described as `S?` in the grammar,\n// simplified to 0-n occurrences of the character class\n// instead of 0-1 occurrences of a non-capturing group around S\nvar S_OPT = reg(_SChar, '*');\n\n// https://www.w3.org/TR/xml11/#NT-NameStartChar\n// `[4] NameStartChar ::= \":\" | [A-Z] | \"_\" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]`\nvar NameStartChar =\n\t/[:_a-zA-Z\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02FF\\u0370-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]/; // without \\u10000-\\uEFFFF\nif (UNICODE_SUPPORT) {\n\t// eslint-disable-next-line es5/no-unicode-code-point-escape\n\tNameStartChar = reg('[', chars(NameStartChar), '\\\\u{10000}-\\\\u{10FFFF}', ']');\n}\nvar NameStartChar_s = chars(NameStartChar);\n\n// https://www.w3.org/TR/xml11/#NT-NameChar\n// `[4a] NameChar ::= NameStartChar | \"-\" | \".\" | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040]`\nvar NameChar = reg('[', NameStartChar_s, chars(/[-.0-9\\xB7]/), chars(/[\\u0300-\\u036F\\u203F-\\u2040]/), ']');\n// https://www.w3.org/TR/xml11/#NT-Name\n// `[5] Name ::= NameStartChar (NameChar)*`\nvar Name = reg(NameStartChar, NameChar, '*');\n/*\nhttps://www.w3.org/TR/xml11/#NT-Names\n`[6] Names ::= Name (#x20 Name)*`\n*/\n\n// https://www.w3.org/TR/xml11/#NT-Nmtoken\n// `[7] Nmtoken ::= (NameChar)+`\nvar Nmtoken = reg(NameChar, '+');\n/*\nhttps://www.w3.org/TR/xml11/#NT-Nmtokens\n`[8] Nmtokens ::= Nmtoken (#x20 Nmtoken)*`\nvar Nmtokens = reg(Nmtoken, regg(/\\x20/, Nmtoken), '*');\n*/\n\n// https://www.w3.org/TR/xml11/#NT-EntityRef\n// `[68] EntityRef ::= '&' Name ';'` [WFC: Entity Declared] [VC: Entity Declared] [WFC: Parsed Entity] [WFC: No Recursion]\nvar EntityRef = reg('&', Name, ';');\n// https://www.w3.org/TR/xml11/#NT-CharRef\n// `[66] CharRef ::= '&#' [0-9]+ ';' | '&#x' [0-9a-fA-F]+ ';'` [WFC: Legal Character]\nvar CharRef = regg(/&#[0-9]+;|&#x[0-9a-fA-F]+;/);\n\n/*\nhttps://www.w3.org/TR/xml11/#NT-Reference\n- `[67] Reference ::= EntityRef | CharRef`\n- `[66] CharRef ::= '&#' [0-9]+ ';' | '&#x' [0-9a-fA-F]+ ';'` [WFC: Legal Character]\n- `[68] EntityRef ::= '&' Name ';'` [WFC: Entity Declared] [VC: Entity Declared] [WFC: Parsed Entity] [WFC: No Recursion]\n*/\nvar Reference = regg(EntityRef, '|', CharRef);\n\n// https://www.w3.org/TR/xml11/#NT-PEReference\n// `[69] PEReference ::= '%' Name ';'`\n// [VC: Entity Declared] [WFC: No Recursion] [WFC: In DTD]\nvar PEReference = reg('%', Name, ';');\n\n// https://www.w3.org/TR/xml11/#NT-EntityValue\n// `[9] EntityValue ::= '\"' ([^%&\"] | PEReference | Reference)* '\"' | \"'\" ([^%&'] | PEReference | Reference)* \"'\"`\nvar EntityValue = regg(\n\treg('\"', regg(/[^%&\"]/, '|', PEReference, '|', Reference), '*', '\"'),\n\t'|',\n\treg(\"'\", regg(/[^%&']/, '|', PEReference, '|', Reference), '*', \"'\")\n);\n\n// https://www.w3.org/TR/xml11/#NT-AttValue\n// `[10] AttValue ::= '\"' ([^<&\"] | Reference)* '\"' | \"'\" ([^<&'] | Reference)* \"'\"`\nvar AttValue = regg('\"', regg(/[^<&\"]/, '|', Reference), '*', '\"', '|', \"'\", regg(/[^<&']/, '|', Reference), '*', \"'\");\n\n// https://www.w3.org/TR/xml-names/#ns-decl\n// https://www.w3.org/TR/xml-names/#ns-qualnames\n// NameStartChar without \":\"\nvar NCNameStartChar = chars_without(NameStartChar, ':');\n// https://www.w3.org/TR/xml-names/#orphans\n// `[5] NCNameChar ::= NameChar - ':'`\n// An XML NameChar, minus the \":\"\nvar NCNameChar = chars_without(NameChar, ':');\n// https://www.w3.org/TR/xml-names/#NT-NCName\n// `[4] NCName ::= Name - (Char* ':' Char*)`\n// An XML Name, minus the \":\"\nvar NCName = reg(NCNameStartChar, NCNameChar, '*');\n\n/**\nhttps://www.w3.org/TR/xml-names/#ns-qualnames\n\n```\n[7] QName ::= PrefixedName | UnprefixedName\n\t\t\t\t === (NCName ':' NCName) | NCName\n\t\t\t\t === NCName (':' NCName)?\n[8] PrefixedName ::= Prefix ':' LocalPart\n\t\t\t\t\t\t\t\t === NCName ':' NCName\n[9] UnprefixedName ::= LocalPart\n\t\t\t\t\t\t\t\t\t === NCName\n[10] Prefix ::= NCName\n[11] LocalPart ::= NCName\n```\n*/\nvar QName = reg(NCName, regg(':', NCName), '?');\nvar QName_exact = reg('^', QName, '$');\nvar QName_group = reg('(', QName, ')');\n\n// https://www.w3.org/TR/xml11/#NT-SystemLiteral\n// `[11] SystemLiteral ::= ('\"' [^\"]* '\"') | (\"'\" [^']* \"'\")`\nvar SystemLiteral = regg(/\"[^\"]*\"|'[^']*'/);\n\n/*\n https://www.w3.org/TR/xml11/#NT-PI\n ```\n [17] PITarget ::= Name - (('X' | 'x') ('M' | 'm') ('L' | 'l'))\n [16] PI ::= '<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>'\n ```\n target /xml/i is not excluded!\n*/\nvar PI = reg(/^<\\?/, '(', Name, ')', regg(S, '(', Char, '*?)'), '?', /\\?>/);\n\n// https://www.w3.org/TR/xml11/#NT-PubidChar\n// `[13] PubidChar ::= #x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%]`\nvar PubidChar = /[\\x20\\x0D\\x0Aa-zA-Z0-9-'()+,./:=?;!*#@$_%]/;\n\n// https://www.w3.org/TR/xml11/#NT-PubidLiteral\n// `[12] PubidLiteral ::= '\"' PubidChar* '\"' | \"'\" (PubidChar - \"'\")* \"'\"`\nvar PubidLiteral = regg('\"', PubidChar, '*\"', '|', \"'\", chars_without(PubidChar, \"'\"), \"*'\");\n\n// https://www.w3.org/TR/xml11/#NT-CharData\n// `[14] CharData ::= [^<&]* - ([^<&]* ']]>' [^<&]*)`\n\nvar COMMENT_START = '<!--';\nvar COMMENT_END = '-->';\n// https://www.w3.org/TR/xml11/#NT-Comment\n// `[15] Comment ::= '<!--' ((Char - '-') | ('-' (Char - '-')))* '-->'`\nvar Comment = reg(COMMENT_START, regg(chars_without(Char, '-'), '|', reg('-', chars_without(Char, '-'))), '*', COMMENT_END);\n\nvar PCDATA = '#PCDATA';\n// https://www.w3.org/TR/xml11/#NT-Mixed\n// `[51] Mixed ::= '(' S? '#PCDATA' (S? '|' S? Name)* S? ')*' | '(' S? '#PCDATA' S? ')'`\n// https://www.w3.org/TR/xml-names/#NT-Mixed\n// `[51] Mixed ::= '(' S? '#PCDATA' (S? '|' S? QName)* S? ')*' | '(' S? '#PCDATA' S? ')'`\n// [VC: Proper Group/PE Nesting] [VC: No Duplicate Types]\nvar Mixed = regg(\n\treg(/\\(/, S_OPT, PCDATA, regg(S_OPT, /\\|/, S_OPT, QName), '*', S_OPT, /\\)\\*/),\n\t'|',\n\treg(/\\(/, S_OPT, PCDATA, S_OPT, /\\)/)\n);\n\nvar _children_quantity = /[?*+]?/;\n/*\n `[49] choice ::= '(' S? cp ( S? '|' S? cp )+ S? ')'` [VC: Proper Group/PE Nesting]\n `[50] seq ::= '(' S? cp ( S? ',' S? cp )* S? ')'` [VC: Proper Group/PE Nesting]\n simplification to solve circular referencing, but doesn't check validity constraint \"Proper Group/PE Nesting\"\n var _choice_or_seq = reg('[', NameChar_s, SChar_s, chars(_children_quantity), '()|,]*');\n ```\n [48] cp ::= (Name | choice | seq) ('?' | '*' | '+')?\n === (Name | '(' S? cp ( S? '|' S? cp )+ S? ')' | '(' S? cp ( S? ',' S? cp )* S? ')') ('?' | '*' | '+')?\n !== (Name | [_choice_or_seq]*) ('?' | '*' | '+')?\n ```\n simplification to solve circular referencing, but doesn't check validity constraint \"Proper Group/PE Nesting\"\n var cp = reg(regg(Name, '|', _choice_or_seq), _children_quantity);\n*/\n/*\nInefficient regular expression (High)\nThis part of the regular expression may cause exponential backtracking on strings starting with '(|' and containing many repetitions of '|'.\nhttps://github.com/xmldom/xmldom/security/code-scanning/91\nvar choice = regg(/\\(/, S_OPT, cp, regg(S_OPT, /\\|/, S_OPT, cp), '+', S_OPT, /\\)/);\n*/\n/*\nInefficient regular expression (High)\nThis part of the regular expression may cause exponential backtracking on strings starting with '(,' and containing many repetitions of ','.\nhttps://github.com/xmldom/xmldom/security/code-scanning/92\nvar seq = regg(/\\(/, S_OPT, cp, regg(S_OPT, /,/, S_OPT, cp), '*', S_OPT, /\\)/);\n*/\n\n// `[47] children ::= (choice | seq) ('?' | '*' | '+')?`\n// simplification to solve circular referencing, but doesn't check validity constraint \"Proper Group/PE Nesting\"\nvar children = reg(/\\([^>]+\\)/, _children_quantity /*regg(choice, '|', seq), _children_quantity*/);\n\n// https://www.w3.org/TR/xml11/#NT-contentspec\n// `[46] contentspec ::= 'EMPTY' | 'ANY' | Mixed | children`\nvar contentspec = regg('EMPTY', '|', 'ANY', '|', Mixed, '|', children);\n\nvar ELEMENTDECL_START = '<!ELEMENT';\n// https://www.w3.org/TR/xml11/#NT-elementdecl\n// `[45] elementdecl ::= '<!ELEMENT' S Name S contentspec S? '>'`\n// https://www.w3.org/TR/xml-names/#NT-elementdecl\n// `[17] elementdecl ::= '<!ELEMENT' S QName S contentspec S? '>'`\n// because of https://www.w3.org/TR/xml11/#NT-PEReference\n// since xmldom is not supporting replacements of PEReferences in the DTD\n// this also supports PEReference in the possible places\nvar elementdecl = reg(ELEMENTDECL_START, S, regg(QName, '|', PEReference), S, regg(contentspec, '|', PEReference), S_OPT, '>');\n\n// https://www.w3.org/TR/xml11/#NT-NotationType\n// `[58] NotationType ::= 'NOTATION' S '(' S? Name (S? '|' S? Name)* S? ')'`\n// [VC: Notation Attributes] [VC: One Notation Per Element Type] [VC: No Notation on Empty Element] [VC: No Duplicate Tokens]\nvar NotationType = reg('NOTATION', S, /\\(/, S_OPT, Name, regg(S_OPT, /\\|/, S_OPT, Name), '*', S_OPT, /\\)/);\n// https://www.w3.org/TR/xml11/#NT-Enumeration\n// `[59] Enumeration ::= '(' S? Nmtoken (S? '|' S? Nmtoken)* S? ')'`\n// [VC: Enumeration] [VC: No Duplicate Tokens]\nvar Enumeration = reg(/\\(/, S_OPT, Nmtoken, regg(S_OPT, /\\|/, S_OPT, Nmtoken), '*', S_OPT, /\\)/);\n\n// https://www.w3.org/TR/xml11/#NT-EnumeratedType\n// `[57] EnumeratedType ::= NotationType | Enumeration`\nvar EnumeratedType = regg(NotationType, '|', Enumeration);\n\n/*\n```\n[55] StringType ::= 'CDATA'\n[56] TokenizedType ::= 'ID' [VC: ID] [VC: One ID per Element Type] [VC: ID Attribute Default]\n | 'IDREF' [VC: IDREF]\n | 'IDREFS' [VC: IDREF]\n\t | 'ENTITY' [VC: Entity Name]\n\t | 'ENTITIES' [VC: Entity Name]\n\t | 'NMTOKEN' [VC: Name Token]\n\t | 'NMTOKENS' [VC: Name Token]\n [54] AttType ::= StringType | TokenizedType | EnumeratedType\n```*/\nvar AttType = regg(/CDATA|ID|IDREF|IDREFS|ENTITY|ENTITIES|NMTOKEN|NMTOKENS/, '|', EnumeratedType);\n\n// `[60] DefaultDecl ::= '#REQUIRED' | '#IMPLIED' | (('#FIXED' S)? AttValue)`\n// [WFC: No < in Attribute Values] [WFC: No External Entity References]\n// [VC: Fixed Attribute Default] [VC: Required Attribute] [VC: Attribute Default Value Syntactically Correct]\nvar DefaultDecl = regg(/#REQUIRED|#IMPLIED/, '|', regg(regg('#FIXED', S), '?', AttValue));\n\n// https://www.w3.org/TR/xml11/#NT-AttDef\n// [53] AttDef ::= S Name S AttType S DefaultDecl\n// https://www.w3.org/TR/xml-names/#NT-AttDef\n// [1] NSAttName ::= PrefixedAttName | DefaultAttName\n// [2] PrefixedAttName ::= 'xmlns:' NCName [NSC: Reserved Prefixes and Namespace Names]\n// [3] DefaultAttName ::= 'xmlns'\n// [21] AttDef ::= S (QName | NSAttName) S AttType S DefaultDecl\n// \t\t\t\t\t\t === S Name S AttType S DefaultDecl\n// xmldom is not distinguishing between QName and NSAttName on this level\n// to support XML without namespaces in DTD we can not restrict it to QName\nvar AttDef = regg(S, Name, S, AttType, S, DefaultDecl);\n\nvar ATTLIST_DECL_START = '<!ATTLIST';\n// https://www.w3.org/TR/xml11/#NT-AttlistDecl\n// `[52] AttlistDecl ::= '<!ATTLIST' S Name AttDef* S? '>'`\n// https://www.w3.org/TR/xml-names/#NT-AttlistDecl\n// `[20] AttlistDecl ::= '<!ATTLIST' S QName AttDef* S? '>'`\n// to support XML without namespaces in DTD we can not restrict it to QName\nvar AttlistDecl = reg(ATTLIST_DECL_START, S, Name, AttDef, '*', S_OPT, '>');\n\n// https://html.spec.whatwg.org/multipage/urls-and-fetching.html#about:legacy-compat\nvar ABOUT_LEGACY_COMPAT = 'about:legacy-compat';\nvar ABOUT_LEGACY_COMPAT_SystemLiteral = regg('\"' + ABOUT_LEGACY_COMPAT + '\"', '|', \"'\" + ABOUT_LEGACY_COMPAT + \"'\");\nvar SYSTEM = 'SYSTEM';\nvar PUBLIC = 'PUBLIC';\n// https://www.w3.org/TR/xml11/#NT-ExternalID\n// `[75] ExternalID ::= 'SYSTEM' S SystemLiteral | 'PUBLIC' S PubidLiteral S SystemLiteral`\nvar ExternalID = regg(regg(SYSTEM, S, SystemLiteral), '|', regg(PUBLIC, S, PubidLiteral, S, SystemLiteral));\nvar ExternalID_match = reg(\n\t'^',\n\tregg(\n\t\tregg(SYSTEM, S, '(?<SystemLiteralOnly>', SystemLiteral, ')'),\n\t\t'|',\n\t\tregg(PUBLIC, S, '(?<PubidLiteral>', PubidLiteral, ')', S, '(?<SystemLiteral>', SystemLiteral, ')')\n\t)\n);\n\n// https://www.w3.org/TR/xml11/#NT-NDataDecl\n// `[76] NDataDecl ::= S 'NDATA' S Name` [VC: Notation Declared]\nvar NDataDecl = regg(S, 'NDATA', S, Name);\n\n// https://www.w3.org/TR/xml11/#NT-EntityDef\n// `[73] EntityDef ::= EntityValue | (ExternalID NDataDecl?)`\nvar EntityDef = regg(EntityValue, '|', regg(ExternalID, NDataDecl, '?'));\n\nvar ENTITY_DECL_START = '<!ENTITY';\n// https://www.w3.org/TR/xml11/#NT-GEDecl\n// `[71] GEDecl ::= '<!ENTITY' S Name S EntityDef S? '>'`\nvar GEDecl = reg(ENTITY_DECL_START, S, Name, S, EntityDef, S_OPT, '>');\n// https://www.w3.org/TR/xml11/#NT-PEDef\n// `[74] PEDef ::= EntityValue | ExternalID`\nvar PEDef = regg(EntityValue, '|', ExternalID);\n// https://www.w3.org/TR/xml11/#NT-PEDecl\n// `[72] PEDecl ::= '<!ENTITY' S '%' S Name S PEDef S? '>'`\nvar PEDecl = reg(ENTITY_DECL_START, S, '%', S, Name, S, PEDef, S_OPT, '>');\n// https://www.w3.org/TR/xml11/#NT-EntityDecl\n// `[70] EntityDecl ::= GEDecl | PEDecl`\nvar EntityDecl = regg(GEDecl, '|', PEDecl);\n\n// https://www.w3.org/TR/xml11/#NT-PublicID\n// `[83] PublicID ::= 'PUBLIC' S PubidLiteral`\nvar PublicID = reg(PUBLIC, S, PubidLiteral);\n// https://www.w3.org/TR/xml11/#NT-NotationDecl\n// `[82] NotationDecl ::= '<!NOTATION' S Name S (ExternalID | PublicID) S? '>'` [VC: Unique Notation Name]\nvar NotationDecl = reg('<!NOTATION', S, Name, S, regg(ExternalID, '|', PublicID), S_OPT, '>');\n\n// https://www.w3.org/TR/xml11/#NT-Eq\n// `[25] Eq ::= S? '=' S?`\nvar Eq = reg(S_OPT, '=', S_OPT);\n// https://www.w3.org/TR/xml/#NT-VersionNum\n// `[26] VersionNum ::= '1.' [0-9]+`\n// https://www.w3.org/TR/xml11/#NT-VersionNum\n// `[26] VersionNum ::= '1.1'`\nvar VersionNum = /1[.]\\d+/;\n// https://www.w3.org/TR/xml11/#NT-VersionInfo\n// `[24] VersionInfo ::= S 'version' Eq (\"'\" VersionNum \"'\" | '\"' VersionNum '\"')`\nvar VersionInfo = reg(S, 'version', Eq, regg(\"'\", VersionNum, \"'\", '|', '\"', VersionNum, '\"'));\n// https://www.w3.org/TR/xml11/#NT-EncName\n// `[81] EncName ::= [A-Za-z] ([A-Za-z0-9._] | '-')*`\nvar EncName = /[A-Za-z][-A-Za-z0-9._]*/;\n// https://www.w3.org/TR/xml11/#NT-EncDecl\n// `[80] EncodingDecl ::= S 'encoding' Eq ('\"' EncName '\"' | \"'\" EncName \"'\" )`\nvar EncodingDecl = regg(S, 'encoding', Eq, regg('\"', EncName, '\"', '|', \"'\", EncName, \"'\"));\n// https://www.w3.org/TR/xml11/#NT-SDDecl\n// `[32] SDDecl ::= S 'standalone' Eq ((\"'\" ('yes' | 'no') \"'\") | ('\"' ('yes' | 'no') '\"'))`\nvar SDDecl = regg(S, 'standalone', Eq, regg(\"'\", regg('yes', '|', 'no'), \"'\", '|', '\"', regg('yes', '|', 'no'), '\"'));\n// https://www.w3.org/TR/xml11/#NT-XMLDecl\n// [23] XMLDecl ::= '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>'\nvar XMLDecl = reg(/^<\\?xml/, VersionInfo, EncodingDecl, '?', SDDecl, '?', S_OPT, /\\?>/);\n\n/*\n https://www.w3.org/TR/xml/#NT-markupdecl\n https://www.w3.org/TR/xml11/#NT-markupdecl\n `[29] markupdecl ::= elementdecl | AttlistDecl | EntityDecl | NotationDecl | PI | Comment`\n var markupdecl = regg(elementdecl, '|', AttlistDecl, '|', EntityDecl, '|', NotationDecl, '|', PI_unsafe, '|', Comment);\n*/\n/*\n https://www.w3.org/TR/xml-names/#NT-doctypedecl\n`[28a] DeclSep ::= PEReference | S`\n https://www.w3.org/TR/xml11/#NT-intSubset\n```\n [28b] intSubset ::= (markupdecl | DeclSep)*\n === (markupdecl | PEReference | S)*\n```\n [WFC: PE Between Declarations]\n var intSubset = reg(regg(markupdecl, '|', PEReference, '|', S), '*');\n*/\nvar DOCTYPE_DECL_START = '<!DOCTYPE';\n/*\n https://www.w3.org/TR/xml11/#NT-doctypedecl\n `[28] doctypedecl ::= '<!DOCTYPE' S Name (S ExternalID)? S? ('[' intSubset ']' S?)? '>'`\n https://www.afterwardsw3.org/TR/xml-names/#NT-doctypedecl\n `[16] doctypedecl ::= '<!DOCTYPE' S QName (S ExternalID)? S? ('[' (markupdecl | PEReference | S)* ']' S?)? '>'`\n var doctypedecl = reg('<!DOCTYPE', S, Name, regg(S, ExternalID), '?', S_OPT, regg(/\\[/, intSubset, /]/, S_OPT), '?', '>');\n*/\n\nvar CDATA_START = '<![CDATA[';\nvar CDATA_END = ']]>';\nvar CDStart = /<!\\[CDATA\\[/;\nvar CDEnd = /\\]\\]>/;\nvar CData = reg(Char, '*?', CDEnd);\n/*\n https://www.w3.org/TR/xml/#dt-cdsection\n `[18] \tCDSect\t ::= \tCDStart CData CDEnd`\n `[19] \tCDStart\t ::= \t'<![CDATA['`\n `[20] \tCData\t ::= \t(Char* - (Char* ']]>' Char*))`\n `[21] \tCDEnd\t ::= \t']]>'`\n*/\nvar CDSect = reg(CDStart, CData);\n\n// unit tested\nexports.chars = chars;\nexports.chars_without = chars_without;\nexports.detectUnicodeSupport = detectUnicodeSupport;\nexports.reg = reg;\nexports.regg = regg;\nexports.ABOUT_LEGACY_COMPAT = ABOUT_LEGACY_COMPAT;\nexports.ABOUT_LEGACY_COMPAT_SystemLiteral = ABOUT_LEGACY_COMPAT_SystemLiteral;\nexports.AttlistDecl = AttlistDecl;\nexports.CDATA_START = CDATA_START;\nexports.CDATA_END = CDATA_END;\nexports.CDSect = CDSect;\nexports.Char = Char;\nexports.Comment = Comment;\nexports.COMMENT_START = COMMENT_START;\nexports.COMMENT_END = COMMENT_END;\nexports.DOCTYPE_DECL_START = DOCTYPE_DECL_START;\nexports.elementdecl = elementdecl;\nexports.EntityDecl = EntityDecl;\nexports.EntityValue = EntityValue;\nexports.ExternalID = ExternalID;\nexports.ExternalID_match = ExternalID_match;\nexports.Name = Name;\nexports.NotationDecl = NotationDecl;\nexports.Reference = Reference;\nexports.PEReference = PEReference;\nexports.PI = PI;\nexports.PUBLIC = PUBLIC;\nexports.PubidLiteral = PubidLiteral;\nexports.QName = QName;\nexports.QName_exact = QName_exact;\nexports.QName_group = QName_group;\nexports.S = S;\nexports.SChar_s = SChar_s;\nexports.S_OPT = S_OPT;\nexports.SYSTEM = SYSTEM;\nexports.SystemLiteral = SystemLiteral;\nexports.UNICODE_REPLACEMENT_CHARACTER = UNICODE_REPLACEMENT_CHARACTER;\nexports.UNICODE_SUPPORT = UNICODE_SUPPORT;\nexports.XMLDecl = XMLDecl;\n","'use strict';\n\nvar conventions = require('./conventions');\nvar find = conventions.find;\nvar hasDefaultHTMLNamespace = conventions.hasDefaultHTMLNamespace;\nvar hasOwn = conventions.hasOwn;\nvar isHTMLMimeType = conventions.isHTMLMimeType;\nvar isHTMLRawTextElement = conventions.isHTMLRawTextElement;\nvar isHTMLVoidElement = conventions.isHTMLVoidElement;\nvar MIME_TYPE = conventions.MIME_TYPE;\nvar NAMESPACE = conventions.NAMESPACE;\n\n/**\n * Private DOM Constructor symbol\n *\n * Internal symbol used for construction of all classes whose constructors should be private.\n * Currently used for checks in `Node`, `Document`, `Element`, `Attr`, `CharacterData`, `Text`, `Comment`,\n * `CDATASection`, `DocumentType`, `Notation`, `Entity`, `EntityReference`, `DocumentFragment`, `ProcessingInstruction`\n * so the constructor can't be used from outside the module.\n */\nvar PDC = Symbol();\n\nvar errors = require('./errors');\nvar DOMException = errors.DOMException;\nvar DOMExceptionName = errors.DOMExceptionName;\n\nvar g = require('./grammar');\n\n/**\n * Checks if the given symbol equals the Private DOM Constructor symbol (PDC)\n * and throws an Illegal constructor exception when the symbols don't match.\n * This ensures that the constructor remains private and can't be used outside this module.\n */\nfunction checkSymbol(symbol) {\n\tif (symbol !== PDC) {\n\t\tthrow new TypeError('Illegal constructor');\n\t}\n}\n\n/**\n * A prerequisite for `[].filter`, to drop elements that are empty.\n *\n * @param {string} input\n * The string to be checked.\n * @returns {boolean}\n * Returns `true` if the input string is not empty, `false` otherwise.\n */\nfunction notEmptyString(input) {\n\treturn input !== '';\n}\n/**\n * Splits a string on ASCII whitespace characters (U+0009 TAB, U+000A LF, U+000C FF, U+000D CR,\n * U+0020 SPACE).\n * It follows the definition from the infra specification from WHATWG.\n *\n * @param {string} input\n * The string to be split.\n * @returns {string[]}\n * An array of the split strings. The array can be empty if the input string is empty or only\n * contains whitespace characters.\n * @see {@link https://infra.spec.whatwg.org/#split-on-ascii-whitespace}\n * @see {@link https://infra.spec.whatwg.org/#ascii-whitespace}\n */\nfunction splitOnASCIIWhitespace(input) {\n\t// U+0009 TAB, U+000A LF, U+000C FF, U+000D CR, U+0020 SPACE\n\treturn input ? input.split(/[\\t\\n\\f\\r ]+/).filter(notEmptyString) : [];\n}\n\n/**\n * Adds element as a key to current if it is not already present.\n *\n * @param {Record<string, boolean | undefined>} current\n * The current record object to which the element will be added as a key.\n * The object's keys are string types and values are either boolean or undefined.\n * @param {string} element\n * The string to be added as a key to the current record.\n * @returns {Record<string, boolean | undefined>}\n * The updated record object after the addition of the new element.\n */\nfunction orderedSetReducer(current, element) {\n\tif (!hasOwn(current, element)) {\n\t\tcurrent[element] = true;\n\t}\n\treturn current;\n}\n\n/**\n * Converts a string into an ordered set by splitting the input on ASCII whitespace and\n * ensuring uniqueness of elements.\n * This follows the definition of an ordered set from the infra specification by WHATWG.\n *\n * @param {string} input\n * The input string to be transformed into an ordered set.\n * @returns {string[]}\n * An array of unique strings obtained from the input, preserving the original order.\n * The array can be empty if the input string is empty or only contains whitespace characters.\n * @see {@link https://infra.spec.whatwg.org/#ordered-set}\n */\nfunction toOrderedSet(input) {\n\tif (!input) return [];\n\tvar list = splitOnASCIIWhitespace(input);\n\treturn Object.keys(list.reduce(orderedSetReducer, {}));\n}\n\n/**\n * Uses `list.indexOf` to implement a function that behaves like `Array.prototype.includes`.\n * This function is used in environments where `Array.prototype.includes` may not be available.\n *\n * @param {any[]} list\n * The array in which to search for the element.\n * @returns {function(any): boolean}\n * A function that accepts an element and returns a boolean indicating whether the element is\n * included in the provided list.\n */\nfunction arrayIncludes(list) {\n\treturn function (element) {\n\t\treturn list && list.indexOf(element) !== -1;\n\t};\n}\n\n/**\n * Validates a qualified name based on the criteria provided in the DOM specification by\n * WHATWG.\n *\n * @param {string} qualifiedName\n * The qualified name to be validated.\n * @throws {DOMException}\n * With code {@link DOMException.INVALID_CHARACTER_ERR} if the qualified name contains an\n * invalid character.\n * @see {@link https://dom.spec.whatwg.org/#validate}\n */\nfunction validateQualifiedName(qualifiedName) {\n\tif (!g.QName_exact.test(qualifiedName)) {\n\t\tthrow new DOMException(DOMException.INVALID_CHARACTER_ERR, 'invalid character in qualified name \"' + qualifiedName + '\"');\n\t}\n}\n\n/**\n * Validates a qualified name and the namespace associated with it,\n * based on the criteria provided in the DOM specification by WHATWG.\n *\n * @param {string | null} namespace\n * The namespace to be validated. It can be a string or null.\n * @param {string} qualifiedName\n * The qualified name to be validated.\n * @returns {[namespace: string | null, prefix: string | null, localName: string]}\n * Returns a tuple with the namespace,\n * prefix and local name of the qualified name.\n * @throws {DOMException}\n * Throws a DOMException if the qualified name or the namespace is not valid.\n * @see {@link https://dom.spec.whatwg.org/#validate-and-extract}\n */\nfunction validateAndExtract(namespace, qualifiedName) {\n\tvalidateQualifiedName(qualifiedName);\n\tnamespace = namespace || null;\n\t/**\n\t * @type {string | null}\n\t */\n\tvar prefix = null;\n\tvar localName = qualifiedName;\n\tif (qualifiedName.indexOf(':') >= 0) {\n\t\tvar splitResult = qualifiedName.split(':');\n\t\tprefix = splitResult[0];\n\t\tlocalName = splitResult[1];\n\t}\n\tif (prefix !== null && namespace === null) {\n\t\tthrow new DOMException(DOMException.NAMESPACE_ERR, 'prefix is non-null and namespace is null');\n\t}\n\tif (prefix === 'xml' && namespace !== conventions.NAMESPACE.XML) {\n\t\tthrow new DOMException(DOMException.NAMESPACE_ERR, 'prefix is \"xml\" and namespace is not the XML namespace');\n\t}\n\tif ((prefix === 'xmlns' || qualifiedName === 'xmlns') && namespace !== conventions.NAMESPACE.XMLNS) {\n\t\tthrow new DOMException(\n\t\t\tDOMException.NAMESPACE_ERR,\n\t\t\t'either qualifiedName or prefix is \"xmlns\" and namespace is not the XMLNS namespace'\n\t\t);\n\t}\n\tif (namespace === conventions.NAMESPACE.XMLNS && prefix !== 'xmlns' && qualifiedName !== 'xmlns') {\n\t\tthrow new DOMException(\n\t\t\tDOMException.NAMESPACE_ERR,\n\t\t\t'namespace is the XMLNS namespace and neither qualifiedName nor prefix is \"xmlns\"'\n\t\t);\n\t}\n\treturn [namespace, prefix, localName];\n}\n\n/**\n * Copies properties from one object to another.\n * It only copies the object's own (not inherited) properties.\n *\n * @param {Object} src\n * The source object from which properties are copied.\n * @param {Object} dest\n * The destination object to which properties are copied.\n */\nfunction copy(src, dest) {\n\tfor (var p in src) {\n\t\tif (hasOwn(src, p)) {\n\t\t\tdest[p] = src[p];\n\t\t}\n\t}\n}\n\n/**\n * Extends a class with the properties and methods of a super class.\n * It uses a form of prototypal inheritance, and establishes the `constructor` property\n * correctly(?).\n *\n * It is not clear to the current maintainers if this implementation is making sense,\n * since it creates an intermediate prototype function,\n * which all properties of `Super` are copied onto using `_copy`.\n *\n * @param {Object} Class\n * The class that is to be extended.\n * @param {Object} Super\n * The super class from which properties and methods are inherited.\n * @private\n */\nfunction _extends(Class, Super) {\n\tvar pt = Class.prototype;\n\tif (!(pt instanceof Super)) {\n\t\tfunction t() {}\n\t\tt.prototype = Super.prototype;\n\t\tt = new t();\n\t\tcopy(pt, t);\n\t\tClass.prototype = pt = t;\n\t}\n\tif (pt.constructor != Class) {\n\t\tif (typeof Class != 'function') {\n\t\t\tconsole.error('unknown Class:' + Class);\n\t\t}\n\t\tpt.constructor = Class;\n\t}\n}\n\nvar NodeType = {};\nvar ELEMENT_NODE = (NodeType.ELEMENT_NODE = 1);\nvar ATTRIBUTE_NODE = (NodeType.ATTRIBUTE_NODE = 2);\nvar TEXT_NODE = (NodeType.TEXT_NODE = 3);\nvar CDATA_SECTION_NODE = (NodeType.CDATA_SECTION_NODE = 4);\nvar ENTITY_REFERENCE_NODE = (NodeType.ENTITY_REFERENCE_NODE = 5);\nvar ENTITY_NODE = (NodeType.ENTITY_NODE = 6);\nvar PROCESSING_INSTRUCTION_NODE = (NodeType.PROCESSING_INSTRUCTION_NODE = 7);\nvar COMMENT_NODE = (NodeType.COMMENT_NODE = 8);\nvar DOCUMENT_NODE = (NodeType.DOCUMENT_NODE = 9);\nvar DOCUMENT_TYPE_NODE = (NodeType.DOCUMENT_TYPE_NODE = 10);\nvar DOCUMENT_FRAGMENT_NODE = (NodeType.DOCUMENT_FRAGMENT_NODE = 11);\nvar NOTATION_NODE = (NodeType.NOTATION_NODE = 12);\n\nvar DocumentPosition = conventions.freeze({\n\tDOCUMENT_POSITION_DISCONNECTED: 1,\n\tDOCUMENT_POSITION_PRECEDING: 2,\n\tDOCUMENT_POSITION_FOLLOWING: 4,\n\tDOCUMENT_POSITION_CONTAINS: 8,\n\tDOCUMENT_POSITION_CONTAINED_BY: 16,\n\tDOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: 32,\n});\n\n//helper functions for compareDocumentPosition\n/**\n * Finds the common ancestor in two parent chains.\n *\n * @param {Node[]} a\n * The first parent chain.\n * @param {Node[]} b\n * The second parent chain.\n * @returns {Node}\n * The common ancestor node if it exists. If there is no common ancestor, the function will\n * return `null`.\n */\nfunction commonAncestor(a, b) {\n\tif (b.length < a.length) return commonAncestor(b, a);\n\tvar c = null;\n\tfor (var n in a) {\n\t\tif (a[n] !== b[n]) return c;\n\t\tc = a[n];\n\t}\n\treturn c;\n}\n\n/**\n * Assigns a unique identifier to a document to ensure consistency while comparing unrelated\n * nodes.\n *\n * @param {Document} doc\n * The document to which a unique identifier is to be assigned.\n * @returns {string}\n * The unique identifier of the document. If the document already had a unique identifier, the\n * function will return the existing one.\n */\nfunction docGUID(doc) {\n\tif (!doc.guid) doc.guid = Math.random();\n\treturn doc.guid;\n}\n//-- end of helper functions\n\n/**\n * The NodeList interface provides the abstraction of an ordered collection of nodes,\n * without defining or constraining how this collection is implemented.\n * NodeList objects in the DOM are live.\n * The items in the NodeList are accessible via an integral index, starting from 0.\n * You can also access the items of the NodeList with a `for...of` loop.\n *\n * @class NodeList\n * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-536297177\n * @constructs NodeList\n */\nfunction NodeList() {}\nNodeList.prototype = {\n\t/**\n\t * The number of nodes in the list. The range of valid child node indices is 0 to length-1\n\t * inclusive.\n\t *\n\t * @type {number}\n\t */\n\tlength: 0,\n\t/**\n\t * Returns the item at `index`. If index is greater than or equal to the number of nodes in\n\t * the list, this returns null.\n\t *\n\t * @param index\n\t * Unsigned long Index into the collection.\n\t * @returns {Node | null}\n\t * The node at position `index` in the NodeList,\n\t * or null if that is not a valid index.\n\t */\n\titem: function (index) {\n\t\treturn index >= 0 && index < this.length ? this[index] : null;\n\t},\n\t/**\n\t * Returns a string representation of the NodeList.\n\t *\n\t * @param {unknown} nodeFilter\n\t * __A filter function? Not implemented according to the spec?__.\n\t * @returns {string}\n\t * A string representation of the NodeList.\n\t */\n\ttoString: function (nodeFilter) {\n\t\tfor (var buf = [], i = 0; i < this.length; i++) {\n\t\t\tserializeToString(this[i], buf, nodeFilter);\n\t\t}\n\t\treturn buf.join('');\n\t},\n\t/**\n\t * Filters the NodeList based on a predicate.\n\t *\n\t * @param {function(Node): boolean} predicate\n\t * - A predicate function to filter the NodeList.\n\t * @returns {Node[]}\n\t * An array of nodes that satisfy the predicate.\n\t * @private\n\t */\n\tfilter: function (predicate) {\n\t\treturn Array.prototype.filter.call(this, predicate);\n\t},\n\t/**\n\t * Returns the first index at which a given node can be found in the NodeList, or -1 if it is\n\t * not present.\n\t *\n\t * @param {Node} item\n\t * - The Node item to locate in the NodeList.\n\t * @returns {number}\n\t * The first index of the node in the NodeList; -1 if not found.\n\t * @private\n\t */\n\tindexOf: function (item) {\n\t\treturn Array.prototype.indexOf.call(this, item);\n\t},\n};\nNodeList.prototype[Symbol.iterator] = function () {\n\tvar me = this;\n\tvar index = 0;\n\n\treturn {\n\t\tnext: function () {\n\t\t\tif (index < me.length) {\n\t\t\t\treturn {\n\t\t\t\t\tvalue: me[index++],\n\t\t\t\t\tdone: false,\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\treturn {\n\t\t\t\t\tdone: true,\n\t\t\t\t};\n\t\t\t}\n\t\t},\n\t\treturn: function () {\n\t\t\treturn {\n\t\t\t\tdone: true,\n\t\t\t};\n\t\t},\n\t};\n};\n\n/**\n * Represents a live collection of nodes that is automatically updated when its associated\n * document changes.\n *\n * @class LiveNodeList\n * @param {Node} node\n * The associated node.\n * @param {function} refresh\n * The function to refresh the live node list.\n * @augments NodeList\n * @constructs LiveNodeList\n */\nfunction LiveNodeList(node, refresh) {\n\tthis._node = node;\n\tthis._refresh = refresh;\n\t_updateLiveList(this);\n}\n/**\n * Updates the live node list.\n *\n * @param {LiveNodeList} list\n * The live node list to update.\n * @private\n */\nfunction _updateLiveList(list) {\n\tvar inc = list._node._inc || list._node.ownerDocument._inc;\n\tif (list._inc !== inc) {\n\t\tvar ls = list._refresh(list._node);\n\t\t__set__(list, 'length', ls.length);\n\t\tif (!list.$$length || ls.length < list.$$length) {\n\t\t\tfor (var i = ls.length; i in list; i++) {\n\t\t\t\tif (hasOwn(list, i)) {\n\t\t\t\t\tdelete list[i];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcopy(ls, list);\n\t\tlist._inc = inc;\n\t}\n}\n/**\n * Returns the node at position `index` in the LiveNodeList, or null if that is not a valid\n * index.\n *\n * @param {number} i\n * Index into the collection.\n * @returns {Node | null}\n * The node at position `index` in the LiveNodeList, or null if that is not a valid index.\n */\nLiveNodeList.prototype.item = function (i) {\n\t_updateLiveList(this);\n\treturn this[i] || null;\n};\n\n_extends(LiveNodeList, NodeList);\n\n/**\n * Objects implementing the NamedNodeMap interface are used to represent collections of nodes\n * that can be accessed by name.\n * Note that NamedNodeMap does not inherit from NodeList;\n * NamedNodeMaps are not maintained in any particular order.\n * Objects contained in an object implementing NamedNodeMap may also be accessed by an ordinal\n * index,\n * but this is simply to allow convenient enumeration of the contents of a NamedNodeMap,\n * and does not imply that the DOM specifies an order to these Nodes.\n * NamedNodeMap objects in the DOM are live.\n * used for attributes or DocumentType entities\n *\n * This implementation only supports property indices, but does not support named properties,\n * as specified in the living standard.\n *\n * @class NamedNodeMap\n * @see https://dom.spec.whatwg.org/#interface-namednodemap\n * @see https://webidl.spec.whatwg.org/#dfn-supported-property-names\n * @constructs NamedNodeMap\n */\nfunction NamedNodeMap() {}\n/**\n * Returns the index of a node within the list.\n *\n * @param {Array} list\n * The list of nodes.\n * @param {Node} node\n * The node to find.\n * @returns {number}\n * The index of the node within the list, or -1 if not found.\n * @private\n */\nfunction _findNodeIndex(list, node) {\n\tvar i = 0;\n\twhile (i < list.length) {\n\t\tif (list[i] === node) {\n\t\t\treturn i;\n\t\t}\n\t\ti++;\n\t}\n}\n/**\n * Adds a new attribute to the list and updates the owner element of the attribute.\n *\n * @param {Element} el\n * The element which will become the owner of the new attribute.\n * @param {NamedNodeMap} list\n * The list to which the new attribute will be added.\n * @param {Attr} newAttr\n * The new attribute to be added.\n * @param {Attr} oldAttr\n * The old attribute to be replaced, or null if no attribute is to be replaced.\n * @returns {void}\n * @private\n */\nfunction _addNamedNode(el, list, newAttr, oldAttr) {\n\tif (oldAttr) {\n\t\tlist[_findNodeIndex(list, oldAttr)] = newAttr;\n\t} else {\n\t\tlist[list.length] = newAttr;\n\t\tlist.length++;\n\t}\n\tif (el) {\n\t\tnewAttr.ownerElement = el;\n\t\tvar doc = el.ownerDocument;\n\t\tif (doc) {\n\t\t\toldAttr && _onRemoveAttribute(doc, el, oldAttr);\n\t\t\t_onAddAttribute(doc, el, newAttr);\n\t\t}\n\t}\n}\n/**\n * Removes an attribute from the list and updates the owner element of the attribute.\n *\n * @param {Element} el\n * The element which is the current owner of the attribute.\n * @param {NamedNodeMap} list\n * The list from which the attribute will be removed.\n * @param {Attr} attr\n * The attribute to be removed.\n * @returns {void}\n * @private\n */\nfunction _removeNamedNode(el, list, attr) {\n\t//console.log('remove attr:'+attr)\n\tvar i = _findNodeIndex(list, attr);\n\tif (i >= 0) {\n\t\tvar lastIndex = list.length - 1;\n\t\twhile (i <= lastIndex) {\n\t\t\tlist[i] = list[++i];\n\t\t}\n\t\tlist.length = lastIndex;\n\t\tif (el) {\n\t\t\tvar doc = el.ownerDocument;\n\t\t\tif (doc) {\n\t\t\t\t_onRemoveAttribute(doc, el, attr);\n\t\t\t}\n\t\t\tattr.ownerElement = null;\n\t\t}\n\t}\n}\nNamedNodeMap.prototype = {\n\tlength: 0,\n\titem: NodeList.prototype.item,\n\n\t/**\n\t * Get an attribute by name. Note: Name is in lower case in case of HTML namespace and\n\t * document.\n\t *\n\t * @param {string} localName\n\t * The local name of the attribute.\n\t * @returns {Attr | null}\n\t * The attribute with the given local name, or null if no such attribute exists.\n\t * @see https://dom.spec.whatwg.org/#concept-element-attributes-get-by-name\n\t */\n\tgetNamedItem: function (localName) {\n\t\tif (this._ownerElement && this._ownerElement._isInHTMLDocumentAndNamespace()) {\n\t\t\tlocalName = localName.toLowerCase();\n\t\t}\n\t\tvar i = 0;\n\t\twhile (i < this.length) {\n\t\t\tvar attr = this[i];\n\t\t\tif (attr.nodeName === localName) {\n\t\t\t\treturn attr;\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\treturn null;\n\t},\n\n\t/**\n\t * Set an attribute.\n\t *\n\t * @param {Attr} attr\n\t * The attribute to set.\n\t * @returns {Attr | null}\n\t * The old attribute with the same local name and namespace URI as the new one, or null if no\n\t * such attribute exists.\n\t * @throws {DOMException}\n\t * With code:\n\t * - {@link INUSE_ATTRIBUTE_ERR} - If the attribute is already an attribute of another\n\t * element.\n\t * @see https://dom.spec.whatwg.org/#concept-element-attributes-set\n\t */\n\tsetNamedItem: function (attr) {\n\t\tvar el = attr.ownerElement;\n\t\tif (el && el !== this._ownerElement) {\n\t\t\tthrow new DOMException(DOMException.INUSE_ATTRIBUTE_ERR);\n\t\t}\n\t\tvar oldAttr = this.getNamedItemNS(attr.namespaceURI, attr.localName);\n\t\tif (oldAttr === attr) {\n\t\t\treturn attr;\n\t\t}\n\t\t_addNamedNode(this._ownerElement, this, attr, oldAttr);\n\t\treturn oldAttr;\n\t},\n\n\t/**\n\t * Set an attribute, replacing an existing attribute with the same local name and namespace\n\t * URI if one exists.\n\t *\n\t * @param {Attr} attr\n\t * The attribute to set.\n\t * @returns {Attr | null}\n\t * The old attribute with the same local name and namespace URI as the new one, or null if no\n\t * such attribute exists.\n\t * @throws {DOMException}\n\t * Throws a DOMException with the name \"InUseAttributeError\" if the attribute is already an\n\t * attribute of another element.\n\t * @see https://dom.spec.whatwg.org/#concept-element-attributes-set\n\t */\n\tsetNamedItemNS: function (attr) {\n\t\treturn this.setNamedItem(attr);\n\t},\n\n\t/**\n\t * Removes an attribute specified by the local name.\n\t *\n\t * @param {string} localName\n\t * The local name of the attribute to be removed.\n\t * @returns {Attr}\n\t * The attribute node that was removed.\n\t * @throws {DOMException}\n\t * With code:\n\t * - {@link DOMException.NOT_FOUND_ERR} if no attribute with the given name is found.\n\t * @see https://dom.spec.whatwg.org/#dom-namednodemap-removenameditem\n\t * @see https://dom.spec.whatwg.org/#concept-element-attributes-remove-by-name\n\t */\n\tremoveNamedItem: function (localName) {\n\t\tvar attr = this.getNamedItem(localName);\n\t\tif (!attr) {\n\t\t\tthrow new DOMException(DOMException.NOT_FOUND_ERR, localName);\n\t\t}\n\t\t_removeNamedNode(this._ownerElement, this, attr);\n\t\treturn attr;\n\t},\n\n\t/**\n\t * Removes an attribute specified by the namespace and local name.\n\t *\n\t * @param {string | null} namespaceURI\n\t * The namespace URI of the attribute to be removed.\n\t * @param {string} localName\n\t * The local name of the attribute to be removed.\n\t * @returns {Attr}\n\t * The attribute node that was removed.\n\t * @throws {DOMException}\n\t * With code:\n\t * - {@link DOMException.NOT_FOUND_ERR} if no attribute with the given namespace URI and local\n\t * name is found.\n\t * @see https://dom.spec.whatwg.org/#dom-namednodemap-removenameditemns\n\t * @see https://dom.spec.whatwg.org/#concept-element-attributes-remove-by-namespace\n\t */\n\tremoveNamedItemNS: function (namespaceURI, localName) {\n\t\tvar attr = this.getNamedItemNS(namespaceURI, localName);\n\t\tif (!attr) {\n\t\t\tthrow new DOMException(DOMException.NOT_FOUND_ERR, namespaceURI ? namespaceURI + ' : ' + localName : localName);\n\t\t}\n\t\t_removeNamedNode(this._ownerElement, this, attr);\n\t\treturn attr;\n\t},\n\n\t/**\n\t * Get an attribute by namespace and local name.\n\t *\n\t * @param {string | null} namespaceURI\n\t * The namespace URI of the attribute.\n\t * @param {string} localName\n\t * The local name of the attribute.\n\t * @returns {Attr | null}\n\t * The attribute with the given namespace URI and local name, or null if no such attribute\n\t * exists.\n\t * @see https://dom.spec.whatwg.org/#concept-element-attributes-get-by-namespace\n\t */\n\tgetNamedItemNS: function (namespaceURI, localName) {\n\t\tif (!namespaceURI) {\n\t\t\tnamespaceURI = null;\n\t\t}\n\t\tvar i = 0;\n\t\twhile (i < this.length) {\n\t\t\tvar node = this[i];\n\t\t\tif (node.localName === localName && node.namespaceURI === namespaceURI) {\n\t\t\t\treturn node;\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\treturn null;\n\t},\n};\nNamedNodeMap.prototype[Symbol.iterator] = function () {\n\tvar me = this;\n\tvar index = 0;\n\n\treturn {\n\t\tnext: function () {\n\t\t\tif (index < me.length) {\n\t\t\t\treturn {\n\t\t\t\t\tvalue: me[index++],\n\t\t\t\t\tdone: false,\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\treturn {\n\t\t\t\t\tdone: true,\n\t\t\t\t};\n\t\t\t}\n\t\t},\n\t\treturn: function () {\n\t\t\treturn {\n\t\t\t\tdone: true,\n\t\t\t};\n\t\t},\n\t};\n};\n\n/**\n * The DOMImplementation interface provides a number of methods for performing operations that\n * are independent of any particular instance of the document object model.\n *\n * The DOMImplementation interface represents an object providing methods which are not\n * dependent on any particular document.\n * Such an object is returned by the `Document.implementation` property.\n *\n * **The individual methods describe the differences compared to the specs**.\n *\n * @class DOMImplementation\n * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation MDN\n * @see https://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-102161490 DOM Level 1 Core\n * (Initial)\n * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-102161490 DOM Level 2 Core\n * @see https://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-102161490 DOM Level 3 Core\n * @see https://dom.spec.whatwg.org/#domimplementation DOM Living Standard\n * @constructs DOMImplementation\n */\nfunction DOMImplementation() {}\n\nDOMImplementation.prototype = {\n\t/**\n\t * Test if the DOM implementation implements a specific feature and version, as specified in\n\t * {@link https://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMFeatures DOM Features}.\n\t *\n\t * The DOMImplementation.hasFeature() method returns a Boolean flag indicating if a given\n\t * feature is supported. The different implementations fairly diverged in what kind of\n\t * features were reported. The latest version of the spec settled to force this method to\n\t * always return true, where the functionality was accurate and in use.\n\t *\n\t * @deprecated\n\t * It is deprecated and modern browsers return true in all cases.\n\t * @function DOMImplementation#hasFeature\n\t * @param {string} feature\n\t * The name of the feature to test.\n\t * @param {string} [version]\n\t * This is the version number of the feature to test.\n\t * @returns {boolean}\n\t * Always returns true.\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/hasFeature MDN\n\t * @see https://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-5CED94D7 DOM Level 1 Core\n\t * @see https://dom.spec.whatwg.org/#dom-domimplementation-hasfeature DOM Living Standard\n\t * @see https://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-5CED94D7 DOM Level 3 Core\n\t */\n\thasFeature: function (feature, version) {\n\t\treturn true;\n\t},\n\t/**\n\t * Creates a DOM Document object of the specified type with its document element. Note that\n\t * based on the {@link DocumentType}\n\t * given to create the document, the implementation may instantiate specialized\n\t * {@link Document} objects that support additional features than the \"Core\", such as \"HTML\"\n\t * {@link https://www.w3.org/TR/DOM-Level-3-Core/references.html#DOM2HTML DOM Level 2 HTML}.\n\t * On the other hand, setting the {@link DocumentType} after the document was created makes\n\t * this very unlikely to happen. Alternatively, specialized {@link Document} creation methods,\n\t * such as createHTMLDocument\n\t * {@link https://www.w3.org/TR/DOM-Level-3-Core/references.html#DOM2HTML DOM Level 2 HTML},\n\t * can be used to obtain specific types of {@link Document} objects.\n\t *\n\t * __It behaves slightly different from the description in the living standard__:\n\t * - There is no interface/class `XMLDocument`, it returns a `Document`\n\t * instance (with it's `type` set to `'xml'`).\n\t * - `encoding`, `mode`, `origin`, `url` fields are currently not declared.\n\t *\n\t * @function DOMImplementation.createDocument\n\t * @param {string | null} namespaceURI\n\t * The\n\t * {@link https://www.w3.org/TR/DOM-Level-3-Core/glossary.html#dt-namespaceURI namespace URI}\n\t * of the document element to create or null.\n\t * @param {string | null} qualifiedName\n\t * The\n\t * {@link https://www.w3.org/TR/DOM-Level-3-Core/glossary.html#dt-qualifiedname qualified name}\n\t * of the document element to be created or null.\n\t * @param {DocumentType | null} [doctype=null]\n\t * The type of document to be created or null. When doctype is not null, its\n\t * {@link Node#ownerDocument} attribute is set to the document being created. Default is\n\t * `null`\n\t * @returns {Document}\n\t * A new {@link Document} object with its document element. If the NamespaceURI,\n\t * qualifiedName, and doctype are null, the returned {@link Document} is empty with no\n\t * document element.\n\t * @throws {DOMException}\n\t * With code:\n\t *\n\t * - `INVALID_CHARACTER_ERR`: Raised if the specified qualified name is not an XML name\n\t * according to {@link https://www.w3.org/TR/DOM-Level-3-Core/references.html#XML XML 1.0}.\n\t * - `NAMESPACE_ERR`: Raised if the qualifiedName is malformed, if the qualifiedName has a\n\t * prefix and the namespaceURI is null, or if the qualifiedName is null and the namespaceURI\n\t * is different from null, or if the qualifiedName has a prefix that is \"xml\" and the\n\t * namespaceURI is different from \"{@link http://www.w3.org/XML/1998/namespace}\"\n\t * {@link https://www.w3.org/TR/DOM-Level-3-Core/references.html#Namespaces XML Namespaces},\n\t * or if the DOM implementation does not support the \"XML\" feature but a non-null namespace\n\t * URI was provided, since namespaces were defined by XML.\n\t * - `WRONG_DOCUMENT_ERR`: Raised if doctype has already been used with a different document\n\t * or was created from a different implementation.\n\t * - `NOT_SUPPORTED_ERR`: May be raised if the implementation does not support the feature\n\t * \"XML\" and the language exposed through the Document does not support XML Namespaces (such\n\t * as {@link https://www.w3.org/TR/DOM-Level-3-Core/references.html#HTML40 HTML 4.01}).\n\t * @since DOM Level 2.\n\t * @see {@link #createHTMLDocument}\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createDocument MDN\n\t * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocument DOM Living Standard\n\t * @see https://www.w3.org/TR/DOM-Level-3-Core/core.html#Level-2-Core-DOM-createDocument DOM\n\t * Level 3 Core\n\t * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#Level-2-Core-DOM-createDocument DOM\n\t * Level 2 Core (initial)\n\t */\n\tcreateDocument: function (namespaceURI, qualifiedName, doctype) {\n\t\tvar contentType = MIME_TYPE.XML_APPLICATION;\n\t\tif (namespaceURI === NAMESPACE.HTML) {\n\t\t\tcontentType = MIME_TYPE.XML_XHTML_APPLICATION;\n\t\t} else if (namespaceURI === NAMESPACE.SVG) {\n\t\t\tcontentType = MIME_TYPE.XML_SVG_IMAGE;\n\t\t}\n\t\tvar doc = new Document(PDC, { contentType: contentType });\n\t\tdoc.implementation = this;\n\t\tdoc.childNodes = new NodeList();\n\t\tdoc.doctype = doctype || null;\n\t\tif (doctype) {\n\t\t\tdoc.appendChild(doctype);\n\t\t}\n\t\tif (qualifiedName) {\n\t\t\tvar root = doc.createElementNS(namespaceURI, qualifiedName);\n\t\t\tdoc.appendChild(root);\n\t\t}\n\t\treturn doc;\n\t},\n\t/**\n\t * Creates an empty DocumentType node. Entity declarations and notations are not made\n\t * available. Entity reference expansions and default attribute additions do not occur.\n\t *\n\t * **This behavior is slightly different from the one in the specs**:\n\t * - `encoding`, `mode`, `origin`, `url` fields are currently not declared.\n\t * - `publicId` and `systemId` contain the raw data including any possible quotes,\n\t * so they can always be serialized back to the original value\n\t * - `internalSubset` contains the raw string between `[` and `]` if present,\n\t * but is not parsed or validated in any form.\n\t *\n\t * @function DOMImplementation#createDocumentType\n\t * @param {string} qualifiedName\n\t * The {@link https://www.w3.org/TR/DOM-Level-3-Core/glossary.html#dt-qualifiedname qualified\n\t * name} of the document type to be created.\n\t * @param {string} [publicId]\n\t * The external subset public identifier.\n\t * @param {string} [systemId]\n\t * The external subset system identifier.\n\t * @param {string} [internalSubset]\n\t * the internal subset or an empty string if it is not present\n\t * @returns {DocumentType}\n\t * A new {@link DocumentType} node with {@link Node#ownerDocument} set to null.\n\t * @throws {DOMException}\n\t * With code:\n\t *\n\t * - `INVALID_CHARACTER_ERR`: Raised if the specified qualified name is not an XML name\n\t * according to {@link https://www.w3.org/TR/DOM-Level-3-Core/references.html#XML XML 1.0}.\n\t * - `NAMESPACE_ERR`: Raised if the qualifiedName is malformed.\n\t * - `NOT_SUPPORTED_ERR`: May be raised if the implementation does not support the feature\n\t * \"XML\" and the language exposed through the Document does not support XML Namespaces (such\n\t * as {@link https://www.w3.org/TR/DOM-Level-3-Core/references.html#HTML40 HTML 4.01}).\n\t * @since DOM Level 2.\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createDocumentType\n\t * MDN\n\t * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocumenttype DOM Living\n\t * Standard\n\t * @see https://www.w3.org/TR/DOM-Level-3-Core/core.html#Level-3-Core-DOM-createDocType DOM\n\t * Level 3 Core\n\t * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#Level-2-Core-DOM-createDocType DOM\n\t * Level 2 Core\n\t * @see https://github.com/xmldom/xmldom/blob/master/CHANGELOG.md#050\n\t * @see https://www.w3.org/TR/DOM-Level-2-Core/#core-ID-Core-DocType-internalSubset\n\t * @prettierignore\n\t */\n\tcreateDocumentType: function (qualifiedName, publicId, systemId, internalSubset) {\n\t\tvalidateQualifiedName(qualifiedName);\n\t\tvar node = new DocumentType(PDC);\n\t\tnode.name = qualifiedName;\n\t\tnode.nodeName = qualifiedName;\n\t\tnode.publicId = publicId || '';\n\t\tnode.systemId = systemId || '';\n\t\tnode.internalSubset = internalSubset || '';\n\t\tnode.childNodes = new NodeList();\n\n\t\treturn node;\n\t},\n\t/**\n\t * Returns an HTML document, that might already have a basic DOM structure.\n\t *\n\t * __It behaves slightly different from the description in the living standard__:\n\t * - If the first argument is `false` no initial nodes are added (steps 3-7 in the specs are\n\t * omitted)\n\t * - `encoding`, `mode`, `origin`, `url` fields are currently not declared.\n\t *\n\t * @param {string | false} [title]\n\t * A string containing the title to give the new HTML document.\n\t * @returns {Document}\n\t * The HTML document.\n\t * @since WHATWG Living Standard.\n\t * @see {@link #createDocument}\n\t * @see https://dom.spec.whatwg.org/#dom-domimplementation-createhtmldocument\n\t * @see https://dom.spec.whatwg.org/#html-document\n\t */\n\tcreateHTMLDocument: function (title) {\n\t\tvar doc = new Document(PDC, { contentType: MIME_TYPE.HTML });\n\t\tdoc.implementation = this;\n\t\tdoc.childNodes = new NodeList();\n\t\tif (title !== false) {\n\t\t\tdoc.doctype = this.createDocumentType('html');\n\t\t\tdoc.doctype.ownerDocument = doc;\n\t\t\tdoc.appendChild(doc.doctype);\n\t\t\tvar htmlNode = doc.createElement('html');\n\t\t\tdoc.appendChild(htmlNode);\n\t\t\tvar headNode = doc.createElement('head');\n\t\t\thtmlNode.appendChild(headNode);\n\t\t\tif (typeof title === 'string') {\n\t\t\t\tvar titleNode = doc.createElement('title');\n\t\t\t\ttitleNode.appendChild(doc.createTextNode(title));\n\t\t\t\theadNode.appendChild(titleNode);\n\t\t\t}\n\t\t\thtmlNode.appendChild(doc.createElement('body'));\n\t\t}\n\t\treturn doc;\n\t},\n};\n\n/**\n * The DOM Node interface is an abstract base class upon which many other DOM API objects are\n * based, thus letting those object types to be used similarly and often interchangeably. As an\n * abstract class, there is no such thing as a plain Node object. All objects that implement\n * Node functionality are based on one of its subclasses. Most notable are Document, Element,\n * and DocumentFragment.\n *\n * In addition, every kind of DOM node is represented by an interface based on Node. These\n * include Attr, CharacterData (which Text, Comment, CDATASection and ProcessingInstruction are\n * all based on), and DocumentType.\n *\n * In some cases, a particular feature of the base Node interface may not apply to one of its\n * child interfaces; in that case, the inheriting node may return null or throw an exception,\n * depending on circumstances. For example, attempting to add children to a node type that\n * cannot have children will throw an exception.\n *\n * **This behavior is slightly different from the in the specs**:\n * - unimplemented interfaces: `EventTarget`\n *\n * @class\n * @abstract\n * @param {Symbol} symbol\n * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-1950641247\n * @see https://dom.spec.whatwg.org/#node\n * @prettierignore\n */\nfunction Node(symbol) {\n\tcheckSymbol(symbol);\n}\n\nNode.prototype = {\n\t/**\n\t * The first child of this node.\n\t *\n\t * @type {Node | null}\n\t */\n\tfirstChild: null,\n\t/**\n\t * The last child of this node.\n\t *\n\t * @type {Node | null}\n\t */\n\tlastChild: null,\n\t/**\n\t * The previous sibling of this node.\n\t *\n\t * @type {Node | null}\n\t */\n\tpreviousSibling: null,\n\t/**\n\t * The next sibling of this node.\n\t *\n\t * @type {Node | null}\n\t */\n\tnextSibling: null,\n\t/**\n\t * The parent node of this node.\n\t *\n\t * @type {Node | null}\n\t */\n\tparentNode: null,\n\t/**\n\t * The parent element of this node.\n\t *\n\t * @type {Element | null}\n\t */\n\tget parentElement() {\n\t\treturn this.parentNode && this.parentNode.nodeType === this.ELEMENT_NODE ? this.parentNode : null;\n\t},\n\t/**\n\t * The child nodes of this node.\n\t *\n\t * @type {NodeList}\n\t */\n\tchildNodes: null,\n\t/**\n\t * The document object associated with this node.\n\t *\n\t * @type {Document | null}\n\t */\n\townerDocument: null,\n\t/**\n\t * The value of this node.\n\t *\n\t * @type {string | null}\n\t */\n\tnodeValue: null,\n\t/**\n\t * The namespace URI of this node.\n\t *\n\t * @type {string | null}\n\t */\n\tnamespaceURI: null,\n\t/**\n\t * The prefix of the namespace for this node.\n\t *\n\t * @type {string | null}\n\t */\n\tprefix: null,\n\t/**\n\t * The local part of the qualified name of this node.\n\t *\n\t * @type {string | null}\n\t */\n\tlocalName: null,\n\t/**\n\t * The baseURI is currently always `about:blank`,\n\t * since that's what happens when you create a document from scratch.\n\t *\n\t * @type {'about:blank'}\n\t */\n\tbaseURI: 'about:blank',\n\t/**\n\t * Is true if this node is part of a document.\n\t *\n\t * @type {boolean}\n\t */\n\tget isConnected() {\n\t\tvar rootNode = this.getRootNode();\n\t\treturn rootNode && rootNode.nodeType === rootNode.DOCUMENT_NODE;\n\t},\n\t/**\n\t * Checks whether `other` is an inclusive descendant of this node.\n\t *\n\t * @param {Node | null | undefined} other\n\t * The node to check.\n\t * @returns {boolean}\n\t * True if `other` is an inclusive descendant of this node; false otherwise.\n\t * @see https://dom.spec.whatwg.org/#dom-node-contains\n\t */\n\tcontains: function (other) {\n\t\tif (!other) return false;\n\t\tvar parent = other;\n\t\tdo {\n\t\t\tif (this === parent) return true;\n\t\t\tparent = other.parentNode;\n\t\t} while (parent);\n\t\treturn false;\n\t},\n\t/**\n\t * @typedef GetRootNodeOptions\n\t * @property {boolean} [composed=false]\n\t */\n\t/**\n\t * Searches for the root node of this node.\n\t *\n\t * **This behavior is slightly different from the in the specs**:\n\t * - ignores `options.composed`, since `ShadowRoot`s are unsupported, always returns root.\n\t *\n\t * @param {GetRootNodeOptions} [options]\n\t * @returns {Node}\n\t * Root node.\n\t * @see https://dom.spec.whatwg.org/#dom-node-getrootnode\n\t * @see https://dom.spec.whatwg.org/#concept-shadow-including-root\n\t */\n\tgetRootNode: function (options) {\n\t\tvar parent = this;\n\t\tdo {\n\t\t\tif (!parent.parentNode) {\n\t\t\t\treturn parent;\n\t\t\t}\n\t\t\tparent = parent.parentNode;\n\t\t} while (parent);\n\t},\n\t/**\n\t * Checks whether the given node is equal to this node.\n\t *\n\t * @param {Node} [otherNode]\n\t * @see https://dom.spec.whatwg.org/#concept-node-equals\n\t */\n\tisEqualNode: function (otherNode) {\n\t\tif (!otherNode) return false;\n\n\t\tif (this.nodeType !== otherNode.nodeType) return false;\n\n\t\tswitch (this.nodeType) {\n\t\t\tcase this.DOCUMENT_TYPE_NODE:\n\t\t\t\tif (this.name !== otherNode.name) return false;\n\t\t\t\tif (this.publicId !== otherNode.publicId) return false;\n\t\t\t\tif (this.systemId !== otherNode.systemId) return false;\n\t\t\t\tbreak;\n\t\t\tcase this.ELEMENT_NODE:\n\t\t\t\tif (this.namespaceURI !== otherNode.namespaceURI) return false;\n\t\t\t\tif (this.prefix !== otherNode.prefix) return false;\n\t\t\t\tif (this.localName !== otherNode.localName) return false;\n\t\t\t\tif (this.attributes.length !== otherNode.attributes.length) return false;\n\t\t\t\tfor (var i = 0; i < this.attributes.length; i++) {\n\t\t\t\t\tvar attr = this.attributes.item(i);\n\t\t\t\t\tif (!attr.isEqualNode(otherNode.getAttributeNodeNS(attr.namespaceURI, attr.localName))) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase this.ATTRIBUTE_NODE:\n\t\t\t\tif (this.namespaceURI !== otherNode.namespaceURI) return false;\n\t\t\t\tif (this.localName !== otherNode.localName) return false;\n\t\t\t\tif (this.value !== otherNode.value) return false;\n\n\t\t\t\tbreak;\n\t\t\tcase this.PROCESSING_INSTRUCTION_NODE:\n\t\t\t\tif (this.target !== otherNode.target || this.data !== otherNode.data) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase this.TEXT_NODE:\n\t\t\tcase this.COMMENT_NODE:\n\t\t\t\tif (this.data !== otherNode.data) return false;\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif (this.childNodes.length !== otherNode.childNodes.length) {\n\t\t\treturn false;\n\t\t}\n\n\t\tfor (var i = 0; i < this.childNodes.length; i++) {\n\t\t\tif (!this.childNodes[i].isEqualNode(otherNode.childNodes[i])) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t},\n\t/**\n\t * Checks whether or not the given node is this node.\n\t *\n\t * @param {Node} [otherNode]\n\t */\n\tisSameNode: function (otherNode) {\n\t\treturn this === otherNode;\n\t},\n\t/**\n\t * Inserts a node before a reference node as a child of this node.\n\t *\n\t * @param {Node} newChild\n\t * The new child node to be inserted.\n\t * @param {Node | null} refChild\n\t * The reference node before which newChild will be inserted.\n\t * @returns {Node}\n\t * The new child node successfully inserted.\n\t * @throws {DOMException}\n\t * Throws a DOMException if inserting the node would result in a DOM tree that is not\n\t * well-formed, or if `child` is provided but is not a child of `parent`.\n\t * See {@link _insertBefore} for more details.\n\t * @since Modified in DOM L2\n\t */\n\tinsertBefore: function (newChild, refChild) {\n\t\treturn _insertBefore(this, newChild, refChild);\n\t},\n\t/**\n\t * Replaces an old child node with a new child node within this node.\n\t *\n\t * @param {Node} newChild\n\t * The new node that is to replace the old node.\n\t * If it already exists in the DOM, it is removed from its original position.\n\t * @param {Node} oldChild\n\t * The existing child node to be replaced.\n\t * @returns {Node}\n\t * Returns the replaced child node.\n\t * @throws {DOMException}\n\t * Throws a DOMException if replacing the node would result in a DOM tree that is not\n\t * well-formed, or if `oldChild` is not a child of `this`.\n\t * This can also occur if the pre-replacement validity assertion fails.\n\t * See {@link _insertBefore}, {@link Node.removeChild}, and\n\t * {@link assertPreReplacementValidityInDocument} for more details.\n\t * @see https://dom.spec.whatwg.org/#concept-node-replace\n\t */\n\treplaceChild: function (newChild, oldChild) {\n\t\t_insertBefore(this, newChild, oldChild, assertPreReplacementValidityInDocument);\n\t\tif (oldChild) {\n\t\t\tthis.removeChild(oldChild);\n\t\t}\n\t},\n\t/**\n\t * Removes an existing child node from this node.\n\t *\n\t * @param {Node} oldChild\n\t * The child node to be removed.\n\t * @returns {Node}\n\t * Returns the removed child node.\n\t * @throws {DOMException}\n\t * Throws a DOMException if `oldChild` is not a child of `this`.\n\t * See {@link _removeChild} for more details.\n\t */\n\tremoveChild: function (oldChild) {\n\t\treturn _removeChild(this, oldChild);\n\t},\n\t/**\n\t * Appends a child node to this node.\n\t *\n\t * @param {Node} newChild\n\t * The child node to be appended to this node.\n\t * If it already exists in the DOM, it is removed from its original position.\n\t * @returns {Node}\n\t * Returns the appended child node.\n\t * @throws {DOMException}\n\t * Throws a DOMException if appending the node would result in a DOM tree that is not\n\t * well-formed, or if `newChild` is not a valid Node.\n\t * See {@link insertBefore} for more details.\n\t */\n\tappendChild: function (newChild) {\n\t\treturn this.insertBefore(newChild, null);\n\t},\n\t/**\n\t * Determines whether this node has any child nodes.\n\t *\n\t * @returns {boolean}\n\t * Returns true if this node has any child nodes, and false otherwise.\n\t */\n\thasChildNodes: function () {\n\t\treturn this.firstChild != null;\n\t},\n\t/**\n\t * Creates a copy of the calling node.\n\t *\n\t * @param {boolean} deep\n\t * If true, the contents of the node are recursively copied.\n\t * If false, only the node itself (and its attributes, if it is an element) are copied.\n\t * @returns {Node}\n\t * Returns the newly created copy of the node.\n\t * @throws {DOMException}\n\t * May throw a DOMException if operations within {@link Element#setAttributeNode} or\n\t * {@link Node#appendChild} (which are potentially invoked in this method) do not meet their\n\t * specific constraints.\n\t * @see {@link cloneNode}\n\t */\n\tcloneNode: function (deep) {\n\t\treturn cloneNode(this.ownerDocument || this, this, deep);\n\t},\n\t/**\n\t * Puts the specified node and all of its subtree into a \"normalized\" form. In a normalized\n\t * subtree, no text nodes in the subtree are empty and there are no adjacent text nodes.\n\t *\n\t * Specifically, this method merges any adjacent text nodes (i.e., nodes for which `nodeType`\n\t * is `TEXT_NODE`) into a single node with the combined data. It also removes any empty text\n\t * nodes.\n\t *\n\t * This method operates recursively, so it also normalizes any and all descendent nodes within\n\t * the subtree.\n\t *\n\t * @throws {DOMException}\n\t * May throw a DOMException if operations within removeChild or appendData (which are\n\t * potentially invoked in this method) do not meet their specific constraints.\n\t * @since Modified in DOM Level 2\n\t * @see {@link Node.removeChild}\n\t * @see {@link CharacterData.appendData}\n\t */\n\tnormalize: function () {\n\t\tvar child = this.firstChild;\n\t\twhile (child) {\n\t\t\tvar next = child.nextSibling;\n\t\t\tif (next && next.nodeType == TEXT_NODE && child.nodeType == TEXT_NODE) {\n\t\t\t\tthis.removeChild(next);\n\t\t\t\tchild.appendData(next.data);\n\t\t\t} else {\n\t\t\t\tchild.normalize();\n\t\t\t\tchild = next;\n\t\t\t}\n\t\t}\n\t},\n\t/**\n\t * Checks whether the DOM implementation implements a specific feature and its version.\n\t *\n\t * @deprecated\n\t * Since `DOMImplementation.hasFeature` is deprecated and always returns true.\n\t * @param {string} feature\n\t * The package name of the feature to test. This is the same name that can be passed to the\n\t * method `hasFeature` on `DOMImplementation`.\n\t * @param {string} version\n\t * This is the version number of the package name to test.\n\t * @returns {boolean}\n\t * Returns true in all cases in the current implementation.\n\t * @since Introduced in DOM Level 2\n\t * @see {@link DOMImplementation.hasFeature}\n\t */\n\tisSupported: function (feature, version) {\n\t\treturn this.ownerDocument.implementation.hasFeature(feature, version);\n\t},\n\t/**\n\t * Look up the prefix associated to the given namespace URI, starting from this node.\n\t * **The default namespace declarations are ignored by this method.**\n\t * See Namespace Prefix Lookup for details on the algorithm used by this method.\n\t *\n\t * **This behavior is different from the in the specs**:\n\t * - no node type specific handling\n\t * - uses the internal attribute _nsMap for resolving namespaces that is updated when changing attributes\n\t *\n\t * @param {string | null} namespaceURI\n\t * The namespace URI for which to find the associated prefix.\n\t * @returns {string | null}\n\t * The associated prefix, if found; otherwise, null.\n\t * @see https://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-lookupNamespacePrefix\n\t * @see https://www.w3.org/TR/DOM-Level-3-Core/namespaces-algorithms.html#lookupNamespacePrefixAlgo\n\t * @see https://dom.spec.whatwg.org/#dom-node-lookupprefix\n\t * @see https://github.com/xmldom/xmldom/issues/322\n\t * @prettierignore\n\t */\n\tlookupPrefix: function (namespaceURI) {\n\t\tvar el = this;\n\t\twhile (el) {\n\t\t\tvar map = el._nsMap;\n\t\t\t//console.dir(map)\n\t\t\tif (map) {\n\t\t\t\tfor (var n in map) {\n\t\t\t\t\tif (hasOwn(map, n) && map[n] === namespaceURI) {\n\t\t\t\t\t\treturn n;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tel = el.nodeType == ATTRIBUTE_NODE ? el.ownerDocument : el.parentNode;\n\t\t}\n\t\treturn null;\n\t},\n\t/**\n\t * This function is used to look up the namespace URI associated with the given prefix,\n\t * starting from this node.\n\t *\n\t * **This behavior is different from the in the specs**:\n\t * - no node type specific handling\n\t * - uses the internal attribute _nsMap for resolving namespaces that is updated when changing attributes\n\t *\n\t * @param {string | null} prefix\n\t * The prefix for which to find the associated namespace URI.\n\t * @returns {string | null}\n\t * The associated namespace URI, if found; otherwise, null.\n\t * @since DOM Level 3\n\t * @see https://dom.spec.whatwg.org/#dom-node-lookupnamespaceuri\n\t * @see https://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-lookupNamespaceURI\n\t * @prettierignore\n\t */\n\tlookupNamespaceURI: function (prefix) {\n\t\tvar el = this;\n\t\twhile (el) {\n\t\t\tvar map = el._nsMap;\n\t\t\t//console.dir(map)\n\t\t\tif (map) {\n\t\t\t\tif (hasOwn(map, prefix)) {\n\t\t\t\t\treturn map[prefix];\n\t\t\t\t}\n\t\t\t}\n\t\t\tel = el.nodeType == ATTRIBUTE_NODE ? el.ownerDocument : el.parentNode;\n\t\t}\n\t\treturn null;\n\t},\n\t/**\n\t * Determines whether the given namespace URI is the default namespace.\n\t *\n\t * The function works by looking up the prefix associated with the given namespace URI. If no\n\t * prefix is found (i.e., the namespace URI is not registered in the namespace map of this\n\t * node or any of its ancestors), it returns `true`, implying the namespace URI is considered\n\t * the default.\n\t *\n\t * **This behavior is different from the in the specs**:\n\t * - no node type specific handling\n\t * - uses the internal attribute _nsMap for resolving namespaces that is updated when changing attributes\n\t *\n\t * @param {string | null} namespaceURI\n\t * The namespace URI to be checked.\n\t * @returns {boolean}\n\t * Returns true if the given namespace URI is the default namespace, false otherwise.\n\t * @since DOM Level 3\n\t * @see https://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-isDefaultNamespace\n\t * @see https://dom.spec.whatwg.org/#dom-node-isdefaultnamespace\n\t * @prettierignore\n\t */\n\tisDefaultNamespace: function (namespaceURI) {\n\t\tvar prefix = this.lookupPrefix(namespaceURI);\n\t\treturn prefix == null;\n\t},\n\t/**\n\t * Compares the reference node with a node with regard to their position in the document and\n\t * according to the document order.\n\t *\n\t * @param {Node} other\n\t * The node to compare the reference node to.\n\t * @returns {number}\n\t * Returns how the node is positioned relatively to the reference node according to the\n\t * bitmask. 0 if reference node and given node are the same.\n\t * @since DOM Level 3\n\t * @see https://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#Node3-compare\n\t * @see https://dom.spec.whatwg.org/#dom-node-comparedocumentposition\n\t */\n\tcompareDocumentPosition: function (other) {\n\t\tif (this === other) return 0;\n\t\tvar node1 = other;\n\t\tvar node2 = this;\n\t\tvar attr1 = null;\n\t\tvar attr2 = null;\n\t\tif (node1 instanceof Attr) {\n\t\t\tattr1 = node1;\n\t\t\tnode1 = attr1.ownerElement;\n\t\t}\n\t\tif (node2 instanceof Attr) {\n\t\t\tattr2 = node2;\n\t\t\tnode2 = attr2.ownerElement;\n\t\t\tif (attr1 && node1 && node2 === node1) {\n\t\t\t\tfor (var i = 0, attr; (attr = node2.attributes[i]); i++) {\n\t\t\t\t\tif (attr === attr1)\n\t\t\t\t\t\treturn DocumentPosition.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC + DocumentPosition.DOCUMENT_POSITION_PRECEDING;\n\t\t\t\t\tif (attr === attr2)\n\t\t\t\t\t\treturn DocumentPosition.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC + DocumentPosition.DOCUMENT_POSITION_FOLLOWING;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (!node1 || !node2 || node2.ownerDocument !== node1.ownerDocument) {\n\t\t\treturn (\n\t\t\t\tDocumentPosition.DOCUMENT_POSITION_DISCONNECTED +\n\t\t\t\tDocumentPosition.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC +\n\t\t\t\t(docGUID(node2.ownerDocument) > docGUID(node1.ownerDocument)\n\t\t\t\t\t? DocumentPosition.DOCUMENT_POSITION_FOLLOWING\n\t\t\t\t\t: DocumentPosition.DOCUMENT_POSITION_PRECEDING)\n\t\t\t);\n\t\t}\n\t\tif (attr2 && node1 === node2) {\n\t\t\treturn DocumentPosition.DOCUMENT_POSITION_CONTAINS + DocumentPosition.DOCUMENT_POSITION_PRECEDING;\n\t\t}\n\t\tif (attr1 && node1 === node2) {\n\t\t\treturn DocumentPosition.DOCUMENT_POSITION_CONTAINED_BY + DocumentPosition.DOCUMENT_POSITION_FOLLOWING;\n\t\t}\n\n\t\tvar chain1 = [];\n\t\tvar ancestor1 = node1.parentNode;\n\t\twhile (ancestor1) {\n\t\t\tif (!attr2 && ancestor1 === node2) {\n\t\t\t\treturn DocumentPosition.DOCUMENT_POSITION_CONTAINED_BY + DocumentPosition.DOCUMENT_POSITION_FOLLOWING;\n\t\t\t}\n\t\t\tchain1.push(ancestor1);\n\t\t\tancestor1 = ancestor1.parentNode;\n\t\t}\n\t\tchain1.reverse();\n\n\t\tvar chain2 = [];\n\t\tvar ancestor2 = node2.parentNode;\n\t\twhile (ancestor2) {\n\t\t\tif (!attr1 && ancestor2 === node1) {\n\t\t\t\treturn DocumentPosition.DOCUMENT_POSITION_CONTAINS + DocumentPosition.DOCUMENT_POSITION_PRECEDING;\n\t\t\t}\n\t\t\tchain2.push(ancestor2);\n\t\t\tancestor2 = ancestor2.parentNode;\n\t\t}\n\t\tchain2.reverse();\n\n\t\tvar ca = commonAncestor(chain1, chain2);\n\t\tfor (var n in ca.childNodes) {\n\t\t\tvar child = ca.childNodes[n];\n\t\t\tif (child === node2) return DocumentPosition.DOCUMENT_POSITION_FOLLOWING;\n\t\t\tif (child === node1) return DocumentPosition.DOCUMENT_POSITION_PRECEDING;\n\t\t\tif (chain2.indexOf(child) >= 0) return DocumentPosition.DOCUMENT_POSITION_FOLLOWING;\n\t\t\tif (chain1.indexOf(child) >= 0) return DocumentPosition.DOCUMENT_POSITION_PRECEDING;\n\t\t}\n\t\treturn 0;\n\t},\n};\n\n/**\n * Encodes special XML characters to their corresponding entities.\n *\n * @param {string} c\n * The character to be encoded.\n * @returns {string}\n * The encoded character.\n * @private\n */\nfunction _xmlEncoder(c) {\n\treturn (\n\t\t(c == '<' && '<') || (c == '>' && '>') || (c == '&' && '&') || (c == '\"' && '"') || '&#' + c.charCodeAt() + ';'\n\t);\n}\n\ncopy(NodeType, Node);\ncopy(NodeType, Node.prototype);\ncopy(DocumentPosition, Node);\ncopy(DocumentPosition, Node.prototype);\n\n/**\n * @param callback\n * Return true for continue,false for break.\n * @returns\n * boolean true: break visit;\n */\nfunction _visitNode(node, callback) {\n\tif (callback(node)) {\n\t\treturn true;\n\t}\n\tif ((node = node.firstChild)) {\n\t\tdo {\n\t\t\tif (_visitNode(node, callback)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} while ((node = node.nextSibling));\n\t}\n}\n\n/**\n * @typedef DocumentOptions\n * @property {string} [contentType=MIME_TYPE.XML_APPLICATION]\n */\n/**\n * The Document interface describes the common properties and methods for any kind of document.\n *\n * It should usually be created using `new DOMImplementation().createDocument(...)`\n * or `new DOMImplementation().createHTMLDocument(...)`.\n *\n * The constructor is considered a private API and offers to initially set the `contentType`\n * property via it's options parameter.\n *\n * @class\n * @param {Symbol} symbol\n * @param {DocumentOptions} [options]\n * @augments Node\n * @private\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Document\n * @see https://dom.spec.whatwg.org/#interface-document\n */\nfunction Document(symbol, options) {\n\tcheckSymbol(symbol);\n\n\tvar opt = options || {};\n\tthis.ownerDocument = this;\n\t/**\n\t * The mime type of the document is determined at creation time and can not be modified.\n\t *\n\t * @type {string}\n\t * @see https://dom.spec.whatwg.org/#concept-document-content-type\n\t * @see {@link DOMImplementation}\n\t * @see {@link MIME_TYPE}\n\t * @readonly\n\t */\n\tthis.contentType = opt.contentType || MIME_TYPE.XML_APPLICATION;\n\t/**\n\t * @type {'html' | 'xml'}\n\t * @see https://dom.spec.whatwg.org/#concept-document-type\n\t * @see {@link DOMImplementation}\n\t * @readonly\n\t */\n\tthis.type = isHTMLMimeType(this.contentType) ? 'html' : 'xml';\n}\n\n/**\n * Updates the namespace mapping of an element when a new attribute is added.\n *\n * @param {Document} doc\n * The document that the element belongs to.\n * @param {Element} el\n * The element to which the attribute is being added.\n * @param {Attr} newAttr\n * The new attribute being added.\n * @private\n */\nfunction _onAddAttribute(doc, el, newAttr) {\n\tdoc && doc._inc++;\n\tvar ns = newAttr.namespaceURI;\n\tif (ns === NAMESPACE.XMLNS) {\n\t\t//update namespace\n\t\tel._nsMap[newAttr.prefix ? newAttr.localName : ''] = newAttr.value;\n\t}\n}\n\n/**\n * Updates the namespace mapping of an element when an attribute is removed.\n *\n * @param {Document} doc\n * The document that the element belongs to.\n * @param {Element} el\n * The element from which the attribute is being removed.\n * @param {Attr} newAttr\n * The attribute being removed.\n * @param {boolean} remove\n * Indicates whether the attribute is to be removed.\n * @private\n */\nfunction _onRemoveAttribute(doc, el, newAttr, remove) {\n\tdoc && doc._inc++;\n\tvar ns = newAttr.namespaceURI;\n\tif (ns === NAMESPACE.XMLNS) {\n\t\t//update namespace\n\t\tdelete el._nsMap[newAttr.prefix ? newAttr.localName : ''];\n\t}\n}\n\n/**\n * Updates `parent.childNodes`, adjusting the indexed items and its `length`.\n * If `newChild` is provided and has no nextSibling, it will be appended.\n * Otherwise, it's assumed that an item has been removed or inserted,\n * and `parent.firstNode` and its `.nextSibling` to re-indexing all child nodes of `parent`.\n *\n * @param {Document} doc\n * The parent document of `el`.\n * @param {Node} parent\n * The parent node whose childNodes list needs to be updated.\n * @param {Node} [newChild]\n * The new child node to be appended. If not provided, the function assumes a node has been\n * removed.\n * @private\n */\nfunction _onUpdateChild(doc, parent, newChild) {\n\tif (doc && doc._inc) {\n\t\tdoc._inc++;\n\t\tvar childNodes = parent.childNodes;\n\t\t// assumes nextSibling and previousSibling were already configured upfront\n\t\tif (newChild && !newChild.nextSibling) {\n\t\t\t// if an item has been appended, we only need to update the last index and the length\n\t\t\tchildNodes[childNodes.length++] = newChild;\n\t\t} else {\n\t\t\t// otherwise we need to reindex all items,\n\t\t\t// which can take a while when processing nodes with a lot of children\n\t\t\tvar child = parent.firstChild;\n\t\t\tvar i = 0;\n\t\t\twhile (child) {\n\t\t\t\tchildNodes[i++] = child;\n\t\t\t\tchild = child.nextSibling;\n\t\t\t}\n\t\t\tchildNodes.length = i;\n\t\t\tdelete childNodes[childNodes.length];\n\t\t}\n\t}\n}\n\n/**\n * Removes the connections between `parentNode` and `child`\n * and any existing `child.previousSibling` or `child.nextSibling`.\n *\n * @param {Node} parentNode\n * The parent node from which the child node is to be removed.\n * @param {Node} child\n * The child node to be removed from the parentNode.\n * @returns {Node}\n * Returns the child node that was removed.\n * @throws {DOMException}\n * With code:\n * - {@link DOMException.NOT_FOUND_ERR} If the parentNode is not the parent of the child node.\n * @private\n * @see https://github.com/xmldom/xmldom/issues/135\n * @see https://github.com/xmldom/xmldom/issues/145\n */\nfunction _removeChild(parentNode, child) {\n\tif (parentNode !== child.parentNode) {\n\t\tthrow new DOMException(DOMException.NOT_FOUND_ERR, \"child's parent is not parent\");\n\t}\n\tvar oldPreviousSibling = child.previousSibling;\n\tvar oldNextSibling = child.nextSibling;\n\tif (oldPreviousSibling) {\n\t\toldPreviousSibling.nextSibling = oldNextSibling;\n\t} else {\n\t\tparentNode.firstChild = oldNextSibling;\n\t}\n\tif (oldNextSibling) {\n\t\toldNextSibling.previousSibling = oldPreviousSibling;\n\t} else {\n\t\tparentNode.lastChild = oldPreviousSibling;\n\t}\n\t_onUpdateChild(parentNode.ownerDocument, parentNode);\n\tchild.parentNode = null;\n\tchild.previousSibling = null;\n\tchild.nextSibling = null;\n\treturn child;\n}\n\n/**\n * Returns `true` if `node` can be a parent for insertion.\n *\n * @param {Node} node\n * @returns {boolean}\n */\nfunction hasValidParentNodeType(node) {\n\treturn (\n\t\tnode &&\n\t\t(node.nodeType === Node.DOCUMENT_NODE || node.nodeType === Node.DOCUMENT_FRAGMENT_NODE || node.nodeType === Node.ELEMENT_NODE)\n\t);\n}\n\n/**\n * Returns `true` if `node` can be inserted according to it's `nodeType`.\n *\n * @param {Node} node\n * @returns {boolean}\n */\nfunction hasInsertableNodeType(node) {\n\treturn (\n\t\tnode &&\n\t\t(node.nodeType === Node.CDATA_SECTION_NODE ||\n\t\t\tnode.nodeType === Node.COMMENT_NODE ||\n\t\t\tnode.nodeType === Node.DOCUMENT_FRAGMENT_NODE ||\n\t\t\tnode.nodeType === Node.DOCUMENT_TYPE_NODE ||\n\t\t\tnode.nodeType === Node.ELEMENT_NODE ||\n\t\t\tnode.nodeType === Node.PROCESSING_INSTRUCTION_NODE ||\n\t\t\tnode.nodeType === Node.TEXT_NODE)\n\t);\n}\n\n/**\n * Returns true if `node` is a DOCTYPE node.\n *\n * @param {Node} node\n * @returns {boolean}\n */\nfunction isDocTypeNode(node) {\n\treturn node && node.nodeType === Node.DOCUMENT_TYPE_NODE;\n}\n\n/**\n * Returns true if the node is an element.\n *\n * @param {Node} node\n * @returns {boolean}\n */\nfunction isElementNode(node) {\n\treturn node && node.nodeType === Node.ELEMENT_NODE;\n}\n/**\n * Returns true if `node` is a text node.\n *\n * @param {Node} node\n * @returns {boolean}\n */\nfunction isTextNode(node) {\n\treturn node && node.nodeType === Node.TEXT_NODE;\n}\n\n/**\n * Check if en element node can be inserted before `child`, or at the end if child is falsy,\n * according to the presence and position of a doctype node on the same level.\n *\n * @param {Document} doc\n * The document node.\n * @param {Node} child\n * The node that would become the nextSibling if the element would be inserted.\n * @returns {boolean}\n * `true` if an element can be inserted before child.\n * @private\n */\nfunction isElementInsertionPossible(doc, child) {\n\tvar parentChildNodes = doc.childNodes || [];\n\tif (find(parentChildNodes, isElementNode) || isDocTypeNode(child)) {\n\t\treturn false;\n\t}\n\tvar docTypeNode = find(parentChildNodes, isDocTypeNode);\n\treturn !(child && docTypeNode && parentChildNodes.indexOf(docTypeNode) > parentChildNodes.indexOf(child));\n}\n\n/**\n * Check if en element node can be inserted before `child`, or at the end if child is falsy,\n * according to the presence and position of a doctype node on the same level.\n *\n * @param {Node} doc\n * The document node.\n * @param {Node} child\n * The node that would become the nextSibling if the element would be inserted.\n * @returns {boolean}\n * `true` if an element can be inserted before child.\n * @private\n */\nfunction isElementReplacementPossible(doc, child) {\n\tvar parentChildNodes = doc.childNodes || [];\n\n\tfunction hasElementChildThatIsNotChild(node) {\n\t\treturn isElementNode(node) && node !== child;\n\t}\n\n\tif (find(parentChildNodes, hasElementChildThatIsNotChild)) {\n\t\treturn false;\n\t}\n\tvar docTypeNode = find(parentChildNodes, isDocTypeNode);\n\treturn !(child && docTypeNode && parentChildNodes.indexOf(docTypeNode) > parentChildNodes.indexOf(child));\n}\n\n/**\n * Asserts pre-insertion validity of a node into a parent before a child.\n * Throws errors for invalid node combinations that would result in an ill-formed DOM.\n *\n * @param {Node} parent\n * The parent node to insert `node` into.\n * @param {Node} node\n * The node to insert.\n * @param {Node | null} child\n * The node that should become the `nextSibling` of `node`. If null, no sibling is considered.\n * @throws {DOMException}\n * With code:\n * - {@link DOMException.HIERARCHY_REQUEST_ERR} If `parent` is not a Document,\n * DocumentFragment, or Element node.\n * - {@link DOMException.HIERARCHY_REQUEST_ERR} If `node` is a host-including inclusive\n * ancestor of `parent`. (Currently not implemented)\n * - {@link DOMException.NOT_FOUND_ERR} If `child` is non-null and its `parent` is not\n * `parent`.\n * - {@link DOMException.HIERARCHY_REQUEST_ERR} If `node` is not a DocumentFragment,\n * DocumentType, Element, or CharacterData node.\n * - {@link DOMException.HIERARCHY_REQUEST_ERR} If either `node` is a Text node and `parent` is\n * a document, or if `node` is a doctype and `parent` is not a document.\n * @private\n * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity\n * @see https://dom.spec.whatwg.org/#concept-node-replace\n */\nfunction assertPreInsertionValidity1to5(parent, node, child) {\n\t// 1. If `parent` is not a Document, DocumentFragment, or Element node, then throw a \"HierarchyRequestError\" DOMException.\n\tif (!hasValidParentNodeType(parent)) {\n\t\tthrow new DOMException(DOMException.HIERARCHY_REQUEST_ERR, 'Unexpected parent node type ' + parent.nodeType);\n\t}\n\t// 2. If `node` is a host-including inclusive ancestor of `parent`, then throw a \"HierarchyRequestError\" DOMException.\n\t// not implemented!\n\t// 3. If `child` is non-null and its parent is not `parent`, then throw a \"NotFoundError\" DOMException.\n\tif (child && child.parentNode !== parent) {\n\t\tthrow new DOMException(DOMException.NOT_FOUND_ERR, 'child not in parent');\n\t}\n\tif (\n\t\t// 4. If `node` is not a DocumentFragment, DocumentType, Element, or CharacterData node, then throw a \"HierarchyRequestError\" DOMException.\n\t\t!hasInsertableNodeType(node) ||\n\t\t// 5. If either `node` is a Text node and `parent` is a document,\n\t\t// the sax parser currently adds top level text nodes, this will be fixed in 0.9.0\n\t\t// || (node.nodeType === Node.TEXT_NODE && parent.nodeType === Node.DOCUMENT_NODE)\n\t\t// or `node` is a doctype and `parent` is not a document, then throw a \"HierarchyRequestError\" DOMException.\n\t\t(isDocTypeNode(node) && parent.nodeType !== Node.DOCUMENT_NODE)\n\t) {\n\t\tthrow new DOMException(\n\t\t\tDOMException.HIERARCHY_REQUEST_ERR,\n\t\t\t'Unexpected node type ' + node.nodeType + ' for parent node type ' + parent.nodeType\n\t\t);\n\t}\n}\n\n/**\n * Asserts pre-insertion validity of a node into a document before a child.\n * Throws errors for invalid node combinations that would result in an ill-formed DOM.\n *\n * @param {Document} parent\n * The parent node to insert `node` into.\n * @param {Node} node\n * The node to insert.\n * @param {Node | undefined} child\n * The node that should become the `nextSibling` of `node`. If undefined, no sibling is\n * considered.\n * @returns {Node}\n * @throws {DOMException}\n * With code:\n * - {@link DOMException.HIERARCHY_REQUEST_ERR} If `node` is a DocumentFragment with more than\n * one element child or has a Text node child.\n * - {@link DOMException.HIERARCHY_REQUEST_ERR} If `node` is a DocumentFragment with one\n * element child and either `parent` has an element child, `child` is a doctype, or `child` is\n * non-null and a doctype is following `child`.\n * - {@link DOMException.HIERARCHY_REQUEST_ERR} If `node` is an Element and `parent` has an\n * element child, `child` is a doctype, or `child` is non-null and a doctype is following\n * `child`.\n * - {@link DOMException.HIERARCHY_REQUEST_ERR} If `node` is a DocumentType and `parent` has a\n * doctype child, `child` is non-null and an element is preceding `child`, or `child` is null\n * and `parent` has an element child.\n * @private\n * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity\n * @see https://dom.spec.whatwg.org/#concept-node-replace\n */\nfunction assertPreInsertionValidityInDocument(parent, node, child) {\n\tvar parentChildNodes = parent.childNodes || [];\n\tvar nodeChildNodes = node.childNodes || [];\n\n\t// DocumentFragment\n\tif (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n\t\tvar nodeChildElements = nodeChildNodes.filter(isElementNode);\n\t\t// If node has more than one element child or has a Text node child.\n\t\tif (nodeChildElements.length > 1 || find(nodeChildNodes, isTextNode)) {\n\t\t\tthrow new DOMException(DOMException.HIERARCHY_REQUEST_ERR, 'More than one element or text in fragment');\n\t\t}\n\t\t// Otherwise, if `node` has one element child and either `parent` has an element child,\n\t\t// `child` is a doctype, or `child` is non-null and a doctype is following `child`.\n\t\tif (nodeChildElements.length === 1 && !isElementInsertionPossible(parent, child)) {\n\t\t\tthrow new DOMException(DOMException.HIERARCHY_REQUEST_ERR, 'Element in fragment can not be inserted before doctype');\n\t\t}\n\t}\n\t// Element\n\tif (isElementNode(node)) {\n\t\t// `parent` has an element child, `child` is a doctype,\n\t\t// or `child` is non-null and a doctype is following `child`.\n\t\tif (!isElementInsertionPossible(parent, child)) {\n\t\t\tthrow new DOMException(DOMException.HIERARCHY_REQUEST_ERR, 'Only one element can be added and only after doctype');\n\t\t}\n\t}\n\t// DocumentType\n\tif (isDocTypeNode(node)) {\n\t\t// `parent` has a doctype child,\n\t\tif (find(parentChildNodes, isDocTypeNode)) {\n\t\t\tthrow new DOMException(DOMException.HIERARCHY_REQUEST_ERR, 'Only one doctype is allowed');\n\t\t}\n\t\tvar parentElementChild = find(parentChildNodes, isElementNode);\n\t\t// `child` is non-null and an element is preceding `child`,\n\t\tif (child && parentChildNodes.indexOf(parentElementChild) < parentChildNodes.indexOf(child)) {\n\t\t\tthrow new DOMException(DOMException.HIERARCHY_REQUEST_ERR, 'Doctype can only be inserted before an element');\n\t\t}\n\t\t// or `child` is null and `parent` has an element child.\n\t\tif (!child && parentElementChild) {\n\t\t\tthrow new DOMException(DOMException.HIERARCHY_REQUEST_ERR, 'Doctype can not be appended since element is present');\n\t\t}\n\t}\n}\n\n/**\n * @param {Document} parent\n * The parent node to insert `node` into.\n * @param {Node} node\n * The node to insert.\n * @param {Node | undefined} child\n * the node that should become the `nextSibling` of `node`\n * @returns {Node}\n * @throws {DOMException}\n * For several node combinations that would create a DOM that is not well-formed.\n * @throws {DOMException}\n * If `child` is provided but is not a child of `parent`.\n * @private\n * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity\n * @see https://dom.spec.whatwg.org/#concept-node-replace\n */\nfunction assertPreReplacementValidityInDocument(parent, node, child) {\n\tvar parentChildNodes = parent.childNodes || [];\n\tvar nodeChildNodes = node.childNodes || [];\n\n\t// DocumentFragment\n\tif (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n\t\tvar nodeChildElements = nodeChildNodes.filter(isElementNode);\n\t\t// If `node` has more than one element child or has a Text node child.\n\t\tif (nodeChildElements.length > 1 || find(nodeChildNodes, isTextNode)) {\n\t\t\tthrow new DOMException(DOMException.HIERARCHY_REQUEST_ERR, 'More than one element or text in fragment');\n\t\t}\n\t\t// Otherwise, if `node` has one element child and either `parent` has an element child that is not `child` or a doctype is following `child`.\n\t\tif (nodeChildElements.length === 1 && !isElementReplacementPossible(parent, child)) {\n\t\t\tthrow new DOMException(DOMException.HIERARCHY_REQUEST_ERR, 'Element in fragment can not be inserted before doctype');\n\t\t}\n\t}\n\t// Element\n\tif (isElementNode(node)) {\n\t\t// `parent` has an element child that is not `child` or a doctype is following `child`.\n\t\tif (!isElementReplacementPossible(parent, child)) {\n\t\t\tthrow new DOMException(DOMException.HIERARCHY_REQUEST_ERR, 'Only one element can be added and only after doctype');\n\t\t}\n\t}\n\t// DocumentType\n\tif (isDocTypeNode(node)) {\n\t\tfunction hasDoctypeChildThatIsNotChild(node) {\n\t\t\treturn isDocTypeNode(node) && node !== child;\n\t\t}\n\n\t\t// `parent` has a doctype child that is not `child`,\n\t\tif (find(parentChildNodes, hasDoctypeChildThatIsNotChild)) {\n\t\t\tthrow new DOMException(DOMException.HIERARCHY_REQUEST_ERR, 'Only one doctype is allowed');\n\t\t}\n\t\tvar parentElementChild = find(parentChildNodes, isElementNode);\n\t\t// or an element is preceding `child`.\n\t\tif (child && parentChildNodes.indexOf(parentElementChild) < parentChildNodes.indexOf(child)) {\n\t\t\tthrow new DOMException(DOMException.HIERARCHY_REQUEST_ERR, 'Doctype can only be inserted before an element');\n\t\t}\n\t}\n}\n\n/**\n * Inserts a node into a parent node before a child node.\n *\n * @param {Node} parent\n * The parent node to insert the node into.\n * @param {Node} node\n * The node to insert into the parent.\n * @param {Node | null} child\n * The node that should become the next sibling of the node.\n * If null, the function inserts the node at the end of the children of the parent node.\n * @param {Function} [_inDocumentAssertion]\n * An optional function to check pre-insertion validity if parent is a document node.\n * Defaults to {@link assertPreInsertionValidityInDocument}\n * @returns {Node}\n * Returns the inserted node.\n * @throws {DOMException}\n * Throws a DOMException if inserting the node would result in a DOM tree that is not\n * well-formed. See {@link assertPreInsertionValidity1to5},\n * {@link assertPreInsertionValidityInDocument}.\n * @throws {DOMException}\n * Throws a DOMException if child is provided but is not a child of the parent. See\n * {@link Node.removeChild}\n * @private\n * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity\n */\nfunction _insertBefore(parent, node, child, _inDocumentAssertion) {\n\t// To ensure pre-insertion validity of a node into a parent before a child, run these steps:\n\tassertPreInsertionValidity1to5(parent, node, child);\n\n\t// If parent is a document, and any of the statements below, switched on the interface node implements,\n\t// are true, then throw a \"HierarchyRequestError\" DOMException.\n\tif (parent.nodeType === Node.DOCUMENT_NODE) {\n\t\t(_inDocumentAssertion || assertPreInsertionValidityInDocument)(parent, node, child);\n\t}\n\n\tvar cp = node.parentNode;\n\tif (cp) {\n\t\tcp.removeChild(node); //remove and update\n\t}\n\tif (node.nodeType === DOCUMENT_FRAGMENT_NODE) {\n\t\tvar newFirst = node.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn node;\n\t\t}\n\t\tvar newLast = node.lastChild;\n\t} else {\n\t\tnewFirst = newLast = node;\n\t}\n\tvar pre = child ? child.previousSibling : parent.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = child;\n\n\tif (pre) {\n\t\tpre.nextSibling = newFirst;\n\t} else {\n\t\tparent.firstChild = newFirst;\n\t}\n\tif (child == null) {\n\t\tparent.lastChild = newLast;\n\t} else {\n\t\tchild.previousSibling = newLast;\n\t}\n\tdo {\n\t\tnewFirst.parentNode = parent;\n\t} while (newFirst !== newLast && (newFirst = newFirst.nextSibling));\n\t_onUpdateChild(parent.ownerDocument || parent, parent, node);\n\tif (node.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnode.firstChild = node.lastChild = null;\n\t}\n\n\treturn node;\n}\n\nDocument.prototype = {\n\t/**\n\t * The implementation that created this document.\n\t *\n\t * @type DOMImplementation\n\t * @readonly\n\t */\n\timplementation: null,\n\tnodeName: '#document',\n\tnodeType: DOCUMENT_NODE,\n\t/**\n\t * The DocumentType node of the document.\n\t *\n\t * @type DocumentType\n\t * @readonly\n\t */\n\tdoctype: null,\n\tdocumentElement: null,\n\t_inc: 1,\n\n\tinsertBefore: function (newChild, refChild) {\n\t\t//raises\n\t\tif (newChild.nodeType === DOCUMENT_FRAGMENT_NODE) {\n\t\t\tvar child = newChild.firstChild;\n\t\t\twhile (child) {\n\t\t\t\tvar next = child.nextSibling;\n\t\t\t\tthis.insertBefore(child, refChild);\n\t\t\t\tchild = next;\n\t\t\t}\n\t\t\treturn newChild;\n\t\t}\n\t\t_insertBefore(this, newChild, refChild);\n\t\tnewChild.ownerDocument = this;\n\t\tif (this.documentElement === null && newChild.nodeType === ELEMENT_NODE) {\n\t\t\tthis.documentElement = newChild;\n\t\t}\n\n\t\treturn newChild;\n\t},\n\tremoveChild: function (oldChild) {\n\t\tvar removed = _removeChild(this, oldChild);\n\t\tif (removed === this.documentElement) {\n\t\t\tthis.documentElement = null;\n\t\t}\n\t\treturn removed;\n\t},\n\treplaceChild: function (newChild, oldChild) {\n\t\t//raises\n\t\t_insertBefore(this, newChild, oldChild, assertPreReplacementValidityInDocument);\n\t\tnewChild.ownerDocument = this;\n\t\tif (oldChild) {\n\t\t\tthis.removeChild(oldChild);\n\t\t}\n\t\tif (isElementNode(newChild)) {\n\t\t\tthis.documentElement = newChild;\n\t\t}\n\t},\n\t// Introduced in DOM Level 2:\n\timportNode: function (importedNode, deep) {\n\t\treturn importNode(this, importedNode, deep);\n\t},\n\t// Introduced in DOM Level 2:\n\tgetElementById: function (id) {\n\t\tvar rtv = null;\n\t\t_visitNode(this.documentElement, function (node) {\n\t\t\tif (node.nodeType == ELEMENT_NODE) {\n\t\t\t\tif (node.getAttribute('id') == id) {\n\t\t\t\t\trtv = node;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\treturn rtv;\n\t},\n\n\t/**\n\t * Creates a new `Element` that is owned by this `Document`.\n\t * In HTML Documents `localName` is the lower cased `tagName`,\n\t * otherwise no transformation is being applied.\n\t * When `contentType` implies the HTML namespace, it will be set as `namespaceURI`.\n\t *\n\t * __This implementation differs from the specification:__ - The provided name is not checked\n\t * against the `Name` production,\n\t * so no related error will be thrown.\n\t * - There is no interface `HTMLElement`, it is always an `Element`.\n\t * - There is no support for a second argument to indicate using custom elements.\n\t *\n\t * @param {string} tagName\n\t * @returns {Element}\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/createElement\n\t * @see https://dom.spec.whatwg.org/#dom-document-createelement\n\t * @see https://dom.spec.whatwg.org/#concept-create-element\n\t */\n\tcreateElement: function (tagName) {\n\t\tvar node = new Element(PDC);\n\t\tnode.ownerDocument = this;\n\t\tif (this.type === 'html') {\n\t\t\ttagName = tagName.toLowerCase();\n\t\t}\n\t\tif (hasDefaultHTMLNamespace(this.contentType)) {\n\t\t\tnode.namespaceURI = NAMESPACE.HTML;\n\t\t}\n\t\tnode.nodeName = tagName;\n\t\tnode.tagName = tagName;\n\t\tnode.localName = tagName;\n\t\tnode.childNodes = new NodeList();\n\t\tvar attrs = (node.attributes = new NamedNodeMap());\n\t\tattrs._ownerElement = node;\n\t\treturn node;\n\t},\n\t/**\n\t * @returns {DocumentFragment}\n\t */\n\tcreateDocumentFragment: function () {\n\t\tvar node = new DocumentFragment(PDC);\n\t\tnode.ownerDocument = this;\n\t\tnode.childNodes = new NodeList();\n\t\treturn node;\n\t},\n\t/**\n\t * @param {string} data\n\t * @returns {Text}\n\t */\n\tcreateTextNode: function (data) {\n\t\tvar node = new Text(PDC);\n\t\tnode.ownerDocument = this;\n\t\tnode.childNodes = new NodeList();\n\t\tnode.appendData(data);\n\t\treturn node;\n\t},\n\t/**\n\t * @param {string} data\n\t * @returns {Comment}\n\t */\n\tcreateComment: function (data) {\n\t\tvar node = new Comment(PDC);\n\t\tnode.ownerDocument = this;\n\t\tnode.childNodes = new NodeList();\n\t\tnode.appendData(data);\n\t\treturn node;\n\t},\n\t/**\n\t * @param {string} data\n\t * @returns {CDATASection}\n\t */\n\tcreateCDATASection: function (data) {\n\t\tvar node = new CDATASection(PDC);\n\t\tnode.ownerDocument = this;\n\t\tnode.childNodes = new NodeList();\n\t\tnode.appendData(data);\n\t\treturn node;\n\t},\n\t/**\n\t * @param {string} target\n\t * @param {string} data\n\t * @returns {ProcessingInstruction}\n\t */\n\tcreateProcessingInstruction: function (target, data) {\n\t\tvar node = new ProcessingInstruction(PDC);\n\t\tnode.ownerDocument = this;\n\t\tnode.childNodes = new NodeList();\n\t\tnode.nodeName = node.target = target;\n\t\tnode.nodeValue = node.data = data;\n\t\treturn node;\n\t},\n\t/**\n\t * Creates an `Attr` node that is owned by this document.\n\t * In HTML Documents `localName` is the lower cased `name`,\n\t * otherwise no transformation is being applied.\n\t *\n\t * __This implementation differs from the specification:__ - The provided name is not checked\n\t * against the `Name` production,\n\t * so no related error will be thrown.\n\t *\n\t * @param {string} name\n\t * @returns {Attr}\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/createAttribute\n\t * @see https://dom.spec.whatwg.org/#dom-document-createattribute\n\t */\n\tcreateAttribute: function (name) {\n\t\tif (!g.QName_exact.test(name)) {\n\t\t\tthrow new DOMException(DOMException.INVALID_CHARACTER_ERR, 'invalid character in name \"' + name + '\"');\n\t\t}\n\t\tif (this.type === 'html') {\n\t\t\tname = name.toLowerCase();\n\t\t}\n\t\treturn this._createAttribute(name);\n\t},\n\t_createAttribute: function (name) {\n\t\tvar node = new Attr(PDC);\n\t\tnode.ownerDocument = this;\n\t\tnode.childNodes = new NodeList();\n\t\tnode.name = name;\n\t\tnode.nodeName = name;\n\t\tnode.localName = name;\n\t\tnode.specified = true;\n\t\treturn node;\n\t},\n\t/**\n\t * Creates an EntityReference object.\n\t * The current implementation does not fill the `childNodes` with those of the corresponding\n\t * `Entity`\n\t *\n\t * @deprecated\n\t * In DOM Level 4.\n\t * @param {string} name\n\t * The name of the entity to reference. No namespace well-formedness checks are performed.\n\t * @returns {EntityReference}\n\t * @throws {DOMException}\n\t * With code `INVALID_CHARACTER_ERR` when `name` is not valid.\n\t * @throws {DOMException}\n\t * with code `NOT_SUPPORTED_ERR` when the document is of type `html`\n\t * @see https://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-392B75AE\n\t */\n\tcreateEntityReference: function (name) {\n\t\tif (!g.Name.test(name)) {\n\t\t\tthrow new DOMException(DOMException.INVALID_CHARACTER_ERR, 'not a valid xml name \"' + name + '\"');\n\t\t}\n\t\tif (this.type === 'html') {\n\t\t\tthrow new DOMException('document is an html document', DOMExceptionName.NotSupportedError);\n\t\t}\n\n\t\tvar node = new EntityReference(PDC);\n\t\tnode.ownerDocument = this;\n\t\tnode.childNodes = new NodeList();\n\t\tnode.nodeName = name;\n\t\treturn node;\n\t},\n\t// Introduced in DOM Level 2:\n\t/**\n\t * @param {string} namespaceURI\n\t * @param {string} qualifiedName\n\t * @returns {Element}\n\t */\n\tcreateElementNS: function (namespaceURI, qualifiedName) {\n\t\tvar validated = validateAndExtract(namespaceURI, qualifiedName);\n\t\tvar node = new Element(PDC);\n\t\tvar attrs = (node.attributes = new NamedNodeMap());\n\t\tnode.childNodes = new NodeList();\n\t\tnode.ownerDocument = this;\n\t\tnode.nodeName = qualifiedName;\n\t\tnode.tagName = qualifiedName;\n\t\tnode.namespaceURI = validated[0];\n\t\tnode.prefix = validated[1];\n\t\tnode.localName = validated[2];\n\t\tattrs._ownerElement = node;\n\t\treturn node;\n\t},\n\t// Introduced in DOM Level 2:\n\t/**\n\t * @param {string} namespaceURI\n\t * @param {string} qualifiedName\n\t * @returns {Attr}\n\t */\n\tcreateAttributeNS: function (namespaceURI, qualifiedName) {\n\t\tvar validated = validateAndExtract(namespaceURI, qualifiedName);\n\t\tvar node = new Attr(PDC);\n\t\tnode.ownerDocument = this;\n\t\tnode.childNodes = new NodeList();\n\t\tnode.nodeName = qualifiedName;\n\t\tnode.name = qualifiedName;\n\t\tnode.specified = true;\n\t\tnode.namespaceURI = validated[0];\n\t\tnode.prefix = validated[1];\n\t\tnode.localName = validated[2];\n\t\treturn node;\n\t},\n};\n_extends(Document, Node);\n\nfunction Element(symbol) {\n\tcheckSymbol(symbol);\n\n\tthis._nsMap = Object.create(null);\n}\nElement.prototype = {\n\tnodeType: ELEMENT_NODE,\n\t/**\n\t * The attributes of this element.\n\t *\n\t * @type {NamedNodeMap | null}\n\t */\n\tattributes: null,\n\tgetQualifiedName: function () {\n\t\treturn this.prefix ? this.prefix + ':' + this.localName : this.localName;\n\t},\n\t_isInHTMLDocumentAndNamespace: function () {\n\t\treturn this.ownerDocument.type === 'html' && this.namespaceURI === NAMESPACE.HTML;\n\t},\n\t/**\n\t * Implementaton of Level2 Core function hasAttributes.\n\t *\n\t * @returns {boolean}\n\t * True if attribute list is not empty.\n\t * @see https://www.w3.org/TR/DOM-Level-2-Core/#core-ID-NodeHasAttrs\n\t */\n\thasAttributes: function () {\n\t\treturn !!(this.attributes && this.attributes.length);\n\t},\n\thasAttribute: function (name) {\n\t\treturn !!this.getAttributeNode(name);\n\t},\n\t/**\n\t * Returns element’s first attribute whose qualified name is `name`, and `null`\n\t * if there is no such attribute.\n\t *\n\t * @param {string} name\n\t * @returns {string | null}\n\t */\n\tgetAttribute: function (name) {\n\t\tvar attr = this.getAttributeNode(name);\n\t\treturn attr ? attr.value : null;\n\t},\n\tgetAttributeNode: function (name) {\n\t\tif (this._isInHTMLDocumentAndNamespace()) {\n\t\t\tname = name.toLowerCase();\n\t\t}\n\t\treturn this.attributes.getNamedItem(name);\n\t},\n\t/**\n\t * Sets the value of element’s first attribute whose qualified name is qualifiedName to value.\n\t *\n\t * @param {string} name\n\t * @param {string} value\n\t */\n\tsetAttribute: function (name, value) {\n\t\tif (this._isInHTMLDocumentAndNamespace()) {\n\t\t\tname = name.toLowerCase();\n\t\t}\n\t\tvar attr = this.getAttributeNode(name);\n\t\tif (attr) {\n\t\t\tattr.value = attr.nodeValue = '' + value;\n\t\t} else {\n\t\t\tattr = this.ownerDocument._createAttribute(name);\n\t\t\tattr.value = attr.nodeValue = '' + value;\n\t\t\tthis.setAttributeNode(attr);\n\t\t}\n\t},\n\tremoveAttribute: function (name) {\n\t\tvar attr = this.getAttributeNode(name);\n\t\tattr && this.removeAttributeNode(attr);\n\t},\n\tsetAttributeNode: function (newAttr) {\n\t\treturn this.attributes.setNamedItem(newAttr);\n\t},\n\tsetAttributeNodeNS: function (newAttr) {\n\t\treturn this.attributes.setNamedItemNS(newAttr);\n\t},\n\tremoveAttributeNode: function (oldAttr) {\n\t\t//console.log(this == oldAttr.ownerElement)\n\t\treturn this.attributes.removeNamedItem(oldAttr.nodeName);\n\t},\n\t//get real attribute name,and remove it by removeAttributeNode\n\tremoveAttributeNS: function (namespaceURI, localName) {\n\t\tvar old = this.getAttributeNodeNS(namespaceURI, localName);\n\t\told && this.removeAttributeNode(old);\n\t},\n\n\thasAttributeNS: function (namespaceURI, localName) {\n\t\treturn this.getAttributeNodeNS(namespaceURI, localName) != null;\n\t},\n\t/**\n\t * Returns element’s attribute whose namespace is `namespaceURI` and local name is\n\t * `localName`,\n\t * or `null` if there is no such attribute.\n\t *\n\t * @param {string} namespaceURI\n\t * @param {string} localName\n\t * @returns {string | null}\n\t */\n\tgetAttributeNS: function (namespaceURI, localName) {\n\t\tvar attr = this.getAttributeNodeNS(namespaceURI, localName);\n\t\treturn attr ? attr.value : null;\n\t},\n\t/**\n\t * Sets the value of element’s attribute whose namespace is `namespaceURI` and local name is\n\t * `localName` to value.\n\t *\n\t * @param {string} namespaceURI\n\t * @param {string} qualifiedName\n\t * @param {string} value\n\t * @see https://dom.spec.whatwg.org/#dom-element-setattributens\n\t */\n\tsetAttributeNS: function (namespaceURI, qualifiedName, value) {\n\t\tvar validated = validateAndExtract(namespaceURI, qualifiedName);\n\t\tvar localName = validated[2];\n\t\tvar attr = this.getAttributeNodeNS(namespaceURI, localName);\n\t\tif (attr) {\n\t\t\tattr.value = attr.nodeValue = '' + value;\n\t\t} else {\n\t\t\tattr = this.ownerDocument.createAttributeNS(namespaceURI, qualifiedName);\n\t\t\tattr.value = attr.nodeValue = '' + value;\n\t\t\tthis.setAttributeNode(attr);\n\t\t}\n\t},\n\tgetAttributeNodeNS: function (namespaceURI, localName) {\n\t\treturn this.attributes.getNamedItemNS(namespaceURI, localName);\n\t},\n\n\t/**\n\t * Returns a LiveNodeList of all child elements which have **all** of the given class name(s).\n\t *\n\t * Returns an empty list if `classNames` is an empty string or only contains HTML white space\n\t * characters.\n\t *\n\t * Warning: This returns a live LiveNodeList.\n\t * Changes in the DOM will reflect in the array as the changes occur.\n\t * If an element selected by this array no longer qualifies for the selector,\n\t * it will automatically be removed. Be aware of this for iteration purposes.\n\t *\n\t * @param {string} classNames\n\t * Is a string representing the class name(s) to match; multiple class names are separated by\n\t * (ASCII-)whitespace.\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/getElementsByClassName\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementsByClassName\n\t * @see https://dom.spec.whatwg.org/#concept-getelementsbyclassname\n\t */\n\tgetElementsByClassName: function (classNames) {\n\t\tvar classNamesSet = toOrderedSet(classNames);\n\t\treturn new LiveNodeList(this, function (base) {\n\t\t\tvar ls = [];\n\t\t\tif (classNamesSet.length > 0) {\n\t\t\t\t_visitNode(base, function (node) {\n\t\t\t\t\tif (node !== base && node.nodeType === ELEMENT_NODE) {\n\t\t\t\t\t\tvar nodeClassNames = node.getAttribute('class');\n\t\t\t\t\t\t// can be null if the attribute does not exist\n\t\t\t\t\t\tif (nodeClassNames) {\n\t\t\t\t\t\t\t// before splitting and iterating just compare them for the most common case\n\t\t\t\t\t\t\tvar matches = classNames === nodeClassNames;\n\t\t\t\t\t\t\tif (!matches) {\n\t\t\t\t\t\t\t\tvar nodeClassNamesSet = toOrderedSet(nodeClassNames);\n\t\t\t\t\t\t\t\tmatches = classNamesSet.every(arrayIncludes(nodeClassNamesSet));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (matches) {\n\t\t\t\t\t\t\t\tls.push(node);\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\treturn ls;\n\t\t});\n\t},\n\n\t/**\n\t * Returns a LiveNodeList of elements with the given qualifiedName.\n\t * Searching for all descendants can be done by passing `*` as `qualifiedName`.\n\t *\n\t * All descendants of the specified element are searched, but not the element itself.\n\t * The returned list is live, which means it updates itself with the DOM tree automatically.\n\t * Therefore, there is no need to call `Element.getElementsByTagName()`\n\t * with the same element and arguments repeatedly if the DOM changes in between calls.\n\t *\n\t * When called on an HTML element in an HTML document,\n\t * `getElementsByTagName` lower-cases the argument before searching for it.\n\t * This is undesirable when trying to match camel-cased SVG elements (such as\n\t * `<linearGradient>`) in an HTML document.\n\t * Instead, use `Element.getElementsByTagNameNS()`,\n\t * which preserves the capitalization of the tag name.\n\t *\n\t * `Element.getElementsByTagName` is similar to `Document.getElementsByTagName()`,\n\t * except that it only searches for elements that are descendants of the specified element.\n\t *\n\t * @param {string} qualifiedName\n\t * @returns {LiveNodeList}\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/getElementsByTagName\n\t * @see https://dom.spec.whatwg.org/#concept-getelementsbytagname\n\t */\n\tgetElementsByTagName: function (qualifiedName) {\n\t\tvar isHTMLDocument = (this.nodeType === DOCUMENT_NODE ? this : this.ownerDocument).type === 'html';\n\t\tvar lowerQualifiedName = qualifiedName.toLowerCase();\n\t\treturn new LiveNodeList(this, function (base) {\n\t\t\tvar ls = [];\n\t\t\t_visitNode(base, function (node) {\n\t\t\t\tif (node === base || node.nodeType !== ELEMENT_NODE) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (qualifiedName === '*') {\n\t\t\t\t\tls.push(node);\n\t\t\t\t} else {\n\t\t\t\t\tvar nodeQualifiedName = node.getQualifiedName();\n\t\t\t\t\tvar matchingQName = isHTMLDocument && node.namespaceURI === NAMESPACE.HTML ? lowerQualifiedName : qualifiedName;\n\t\t\t\t\tif (nodeQualifiedName === matchingQName) {\n\t\t\t\t\t\tls.push(node);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn ls;\n\t\t});\n\t},\n\tgetElementsByTagNameNS: function (namespaceURI, localName) {\n\t\treturn new LiveNodeList(this, function (base) {\n\t\t\tvar ls = [];\n\t\t\t_visitNode(base, function (node) {\n\t\t\t\tif (\n\t\t\t\t\tnode !== base &&\n\t\t\t\t\tnode.nodeType === ELEMENT_NODE &&\n\t\t\t\t\t(namespaceURI === '*' || node.namespaceURI === namespaceURI) &&\n\t\t\t\t\t(localName === '*' || node.localName == localName)\n\t\t\t\t) {\n\t\t\t\t\tls.push(node);\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn ls;\n\t\t});\n\t},\n};\nDocument.prototype.getElementsByClassName = Element.prototype.getElementsByClassName;\nDocument.prototype.getElementsByTagName = Element.prototype.getElementsByTagName;\nDocument.prototype.getElementsByTagNameNS = Element.prototype.getElementsByTagNameNS;\n\n_extends(Element, Node);\nfunction Attr(symbol) {\n\tcheckSymbol(symbol);\n\n\tthis.namespaceURI = null;\n\tthis.prefix = null;\n\tthis.ownerElement = null;\n}\nAttr.prototype.nodeType = ATTRIBUTE_NODE;\n_extends(Attr, Node);\n\nfunction CharacterData(symbol) {\n\tcheckSymbol(symbol);\n}\nCharacterData.prototype = {\n\tdata: '',\n\tsubstringData: function (offset, count) {\n\t\treturn this.data.substring(offset, offset + count);\n\t},\n\tappendData: function (text) {\n\t\ttext = this.data + text;\n\t\tthis.nodeValue = this.data = text;\n\t\tthis.length = text.length;\n\t},\n\tinsertData: function (offset, text) {\n\t\tthis.replaceData(offset, 0, text);\n\t},\n\tdeleteData: function (offset, count) {\n\t\tthis.replaceData(offset, count, '');\n\t},\n\treplaceData: function (offset, count, text) {\n\t\tvar start = this.data.substring(0, offset);\n\t\tvar end = this.data.substring(offset + count);\n\t\ttext = start + text + end;\n\t\tthis.nodeValue = this.data = text;\n\t\tthis.length = text.length;\n\t},\n};\n_extends(CharacterData, Node);\nfunction Text(symbol) {\n\tcheckSymbol(symbol);\n}\nText.prototype = {\n\tnodeName: '#text',\n\tnodeType: TEXT_NODE,\n\tsplitText: function (offset) {\n\t\tvar text = this.data;\n\t\tvar newText = text.substring(offset);\n\t\ttext = text.substring(0, offset);\n\t\tthis.data = this.nodeValue = text;\n\t\tthis.length = text.length;\n\t\tvar newNode = this.ownerDocument.createTextNode(newText);\n\t\tif (this.parentNode) {\n\t\t\tthis.parentNode.insertBefore(newNode, this.nextSibling);\n\t\t}\n\t\treturn newNode;\n\t},\n};\n_extends(Text, CharacterData);\nfunction Comment(symbol) {\n\tcheckSymbol(symbol);\n}\nComment.prototype = {\n\tnodeName: '#comment',\n\tnodeType: COMMENT_NODE,\n};\n_extends(Comment, CharacterData);\n\nfunction CDATASection(symbol) {\n\tcheckSymbol(symbol);\n}\nCDATASection.prototype = {\n\tnodeName: '#cdata-section',\n\tnodeType: CDATA_SECTION_NODE,\n};\n_extends(CDATASection, Text);\n\nfunction DocumentType(symbol) {\n\tcheckSymbol(symbol);\n}\nDocumentType.prototype.nodeType = DOCUMENT_TYPE_NODE;\n_extends(DocumentType, Node);\n\nfunction Notation(symbol) {\n\tcheckSymbol(symbol);\n}\nNotation.prototype.nodeType = NOTATION_NODE;\n_extends(Notation, Node);\n\nfunction Entity(symbol) {\n\tcheckSymbol(symbol);\n}\nEntity.prototype.nodeType = ENTITY_NODE;\n_extends(Entity, Node);\n\nfunction EntityReference(symbol) {\n\tcheckSymbol(symbol);\n}\nEntityReference.prototype.nodeType = ENTITY_REFERENCE_NODE;\n_extends(EntityReference, Node);\n\nfunction DocumentFragment(symbol) {\n\tcheckSymbol(symbol);\n}\nDocumentFragment.prototype.nodeName = '#document-fragment';\nDocumentFragment.prototype.nodeType = DOCUMENT_FRAGMENT_NODE;\n_extends(DocumentFragment, Node);\n\nfunction ProcessingInstruction(symbol) {\n\tcheckSymbol(symbol);\n}\nProcessingInstruction.prototype.nodeType = PROCESSING_INSTRUCTION_NODE;\n_extends(ProcessingInstruction, CharacterData);\nfunction XMLSerializer() {}\nXMLSerializer.prototype.serializeToString = function (node, nodeFilter) {\n\treturn nodeSerializeToString.call(node, nodeFilter);\n};\nNode.prototype.toString = nodeSerializeToString;\nfunction nodeSerializeToString(nodeFilter) {\n\tvar buf = [];\n\tvar refNode = (this.nodeType === DOCUMENT_NODE && this.documentElement) || this;\n\tvar prefix = refNode.prefix;\n\tvar uri = refNode.namespaceURI;\n\n\tif (uri && prefix == null) {\n\t\tvar prefix = refNode.lookupPrefix(uri);\n\t\tif (prefix == null) {\n\t\t\tvar visibleNamespaces = [\n\t\t\t\t{ namespace: uri, prefix: null },\n\t\t\t\t//{namespace:uri,prefix:''}\n\t\t\t];\n\t\t}\n\t}\n\tserializeToString(this, buf, nodeFilter, visibleNamespaces);\n\treturn buf.join('');\n}\n\nfunction needNamespaceDefine(node, isHTML, visibleNamespaces) {\n\tvar prefix = node.prefix || '';\n\tvar uri = node.namespaceURI;\n\t// According to [Namespaces in XML 1.0](https://www.w3.org/TR/REC-xml-names/#ns-using) ,\n\t// and more specifically https://www.w3.org/TR/REC-xml-names/#nsc-NoPrefixUndecl :\n\t// > In a namespace declaration for a prefix [...], the attribute value MUST NOT be empty.\n\t// in a similar manner [Namespaces in XML 1.1](https://www.w3.org/TR/xml-names11/#ns-using)\n\t// and more specifically https://www.w3.org/TR/xml-names11/#nsc-NSDeclared :\n\t// > [...] Furthermore, the attribute value [...] must not be an empty string.\n\t// so serializing empty namespace value like xmlns:ds=\"\" would produce an invalid XML document.\n\tif (!uri) {\n\t\treturn false;\n\t}\n\tif ((prefix === 'xml' && uri === NAMESPACE.XML) || uri === NAMESPACE.XMLNS) {\n\t\treturn false;\n\t}\n\n\tvar i = visibleNamespaces.length;\n\twhile (i--) {\n\t\tvar ns = visibleNamespaces[i];\n\t\t// get namespace prefix\n\t\tif (ns.prefix === prefix) {\n\t\t\treturn ns.namespace !== uri;\n\t\t}\n\t}\n\treturn true;\n}\n/**\n * Literal whitespace other than space that appear in attribute values are serialized as\n * their entity references, so they will be preserved.\n * (In contrast to whitespace literals in the input which are normalized to spaces).\n *\n * Well-formed constraint: No < in Attribute Values:\n * > The replacement text of any entity referred to directly or indirectly\n * > in an attribute value must not contain a <.\n *\n * @see https://www.w3.org/TR/xml11/#CleanAttrVals\n * @see https://www.w3.org/TR/xml11/#NT-AttValue\n * @see https://www.w3.org/TR/xml11/#AVNormalize\n * @see https://w3c.github.io/DOM-Parsing/#serializing-an-element-s-attributes\n * @prettierignore\n */\nfunction addSerializedAttribute(buf, qualifiedName, value) {\n\tbuf.push(' ', qualifiedName, '=\"', value.replace(/[<>&\"\\t\\n\\r]/g, _xmlEncoder), '\"');\n}\n\nfunction serializeToString(node, buf, nodeFilter, visibleNamespaces) {\n\tif (!visibleNamespaces) {\n\t\tvisibleNamespaces = [];\n\t}\n\tvar doc = node.nodeType === DOCUMENT_NODE ? node : node.ownerDocument;\n\tvar isHTML = doc.type === 'html';\n\n\tif (nodeFilter) {\n\t\tnode = nodeFilter(node);\n\t\tif (node) {\n\t\t\tif (typeof node == 'string') {\n\t\t\t\tbuf.push(node);\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\t\t//buf.sort.apply(attrs, attributeSorter);\n\t}\n\n\tswitch (node.nodeType) {\n\t\tcase ELEMENT_NODE:\n\t\t\tvar attrs = node.attributes;\n\t\t\tvar len = attrs.length;\n\t\t\tvar child = node.firstChild;\n\t\t\tvar nodeName = node.tagName;\n\n\t\t\tvar prefixedNodeName = nodeName;\n\t\t\tif (!isHTML && !node.prefix && node.namespaceURI) {\n\t\t\t\tvar defaultNS;\n\t\t\t\t// lookup current default ns from `xmlns` attribute\n\t\t\t\tfor (var ai = 0; ai < attrs.length; ai++) {\n\t\t\t\t\tif (attrs.item(ai).name === 'xmlns') {\n\t\t\t\t\t\tdefaultNS = attrs.item(ai).value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!defaultNS) {\n\t\t\t\t\t// lookup current default ns in visibleNamespaces\n\t\t\t\t\tfor (var nsi = visibleNamespaces.length - 1; nsi >= 0; nsi--) {\n\t\t\t\t\t\tvar namespace = visibleNamespaces[nsi];\n\t\t\t\t\t\tif (namespace.prefix === '' && namespace.namespace === node.namespaceURI) {\n\t\t\t\t\t\t\tdefaultNS = namespace.namespace;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (defaultNS !== node.namespaceURI) {\n\t\t\t\t\tfor (var nsi = visibleNamespaces.length - 1; nsi >= 0; nsi--) {\n\t\t\t\t\t\tvar namespace = visibleNamespaces[nsi];\n\t\t\t\t\t\tif (namespace.namespace === node.namespaceURI) {\n\t\t\t\t\t\t\tif (namespace.prefix) {\n\t\t\t\t\t\t\t\tprefixedNodeName = namespace.prefix + ':' + nodeName;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\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\tbuf.push('<', prefixedNodeName);\n\n\t\t\tfor (var i = 0; i < len; i++) {\n\t\t\t\t// add namespaces for attributes\n\t\t\t\tvar attr = attrs.item(i);\n\t\t\t\tif (attr.prefix == 'xmlns') {\n\t\t\t\t\tvisibleNamespaces.push({\n\t\t\t\t\t\tprefix: attr.localName,\n\t\t\t\t\t\tnamespace: attr.value,\n\t\t\t\t\t});\n\t\t\t\t} else if (attr.nodeName == 'xmlns') {\n\t\t\t\t\tvisibleNamespaces.push({ prefix: '', namespace: attr.value });\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (var i = 0; i < len; i++) {\n\t\t\t\tvar attr = attrs.item(i);\n\t\t\t\tif (needNamespaceDefine(attr, isHTML, visibleNamespaces)) {\n\t\t\t\t\tvar prefix = attr.prefix || '';\n\t\t\t\t\tvar uri = attr.namespaceURI;\n\t\t\t\t\taddSerializedAttribute(buf, prefix ? 'xmlns:' + prefix : 'xmlns', uri);\n\t\t\t\t\tvisibleNamespaces.push({ prefix: prefix, namespace: uri });\n\t\t\t\t}\n\t\t\t\tserializeToString(attr, buf, nodeFilter, visibleNamespaces);\n\t\t\t}\n\n\t\t\t// add namespace for current node\n\t\t\tif (nodeName === prefixedNodeName && needNamespaceDefine(node, isHTML, visibleNamespaces)) {\n\t\t\t\tvar prefix = node.prefix || '';\n\t\t\t\tvar uri = node.namespaceURI;\n\t\t\t\taddSerializedAttribute(buf, prefix ? 'xmlns:' + prefix : 'xmlns', uri);\n\t\t\t\tvisibleNamespaces.push({ prefix: prefix, namespace: uri });\n\t\t\t}\n\t\t\t// in XML elements can be closed when they have no children\n\t\t\tvar canCloseTag = !child;\n\t\t\tif (canCloseTag && (isHTML || node.namespaceURI === NAMESPACE.HTML)) {\n\t\t\t\t// in HTML (doc or ns) only void elements can be closed right away\n\t\t\t\tcanCloseTag = isHTMLVoidElement(nodeName);\n\t\t\t}\n\t\t\tif (canCloseTag) {\n\t\t\t\tbuf.push('/>');\n\t\t\t} else {\n\t\t\t\tbuf.push('>');\n\t\t\t\t//if is cdata child node\n\t\t\t\tif (isHTML && isHTMLRawTextElement(nodeName)) {\n\t\t\t\t\twhile (child) {\n\t\t\t\t\t\tif (child.data) {\n\t\t\t\t\t\t\tbuf.push(child.data);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tserializeToString(child, buf, nodeFilter, visibleNamespaces.slice());\n\t\t\t\t\t\t}\n\t\t\t\t\t\tchild = child.nextSibling;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\twhile (child) {\n\t\t\t\t\t\tserializeToString(child, buf, nodeFilter, visibleNamespaces.slice());\n\t\t\t\t\t\tchild = child.nextSibling;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbuf.push('</', prefixedNodeName, '>');\n\t\t\t}\n\t\t\t// remove added visible namespaces\n\t\t\t//visibleNamespaces.length = startVisibleNamespaces;\n\t\t\treturn;\n\t\tcase DOCUMENT_NODE:\n\t\tcase DOCUMENT_FRAGMENT_NODE:\n\t\t\tvar child = node.firstChild;\n\t\t\twhile (child) {\n\t\t\t\tserializeToString(child, buf, nodeFilter, visibleNamespaces.slice());\n\t\t\t\tchild = child.nextSibling;\n\t\t\t}\n\t\t\treturn;\n\t\tcase ATTRIBUTE_NODE:\n\t\t\treturn addSerializedAttribute(buf, node.name, node.value);\n\t\tcase TEXT_NODE:\n\t\t\t/*\n\t\t\t * The ampersand character (&) and the left angle bracket (<) must not appear in their literal form,\n\t\t\t * except when used as markup delimiters, or within a comment, a processing instruction,\n\t\t\t * or a CDATA section.\n\t\t\t * If they are needed elsewhere, they must be escaped using either numeric character\n\t\t\t * references or the strings `&` and `<` respectively.\n\t\t\t * The right angle bracket (>) may be represented using the string \" > \",\n\t\t\t * and must, for compatibility, be escaped using either `>`,\n\t\t\t * or a character reference when it appears in the string `]]>` in content,\n\t\t\t * when that string is not marking the end of a CDATA section.\n\t\t\t *\n\t\t\t * In the content of elements, character data is any string of characters which does not\n\t\t\t * contain the start-delimiter of any markup and does not include the CDATA-section-close\n\t\t\t * delimiter, `]]>`.\n\t\t\t *\n\t\t\t * @see https://www.w3.org/TR/xml/#NT-CharData\n\t\t\t * @see https://w3c.github.io/DOM-Parsing/#xml-serializing-a-text-node\n\t\t\t */\n\t\t\treturn buf.push(node.data.replace(/[<&>]/g, _xmlEncoder));\n\t\tcase CDATA_SECTION_NODE:\n\t\t\treturn buf.push(g.CDATA_START, node.data, g.CDATA_END);\n\t\tcase COMMENT_NODE:\n\t\t\treturn buf.push(g.COMMENT_START, node.data, g.COMMENT_END);\n\t\tcase DOCUMENT_TYPE_NODE:\n\t\t\tvar pubid = node.publicId;\n\t\t\tvar sysid = node.systemId;\n\t\t\tbuf.push(g.DOCTYPE_DECL_START, ' ', node.name);\n\t\t\tif (pubid) {\n\t\t\t\tbuf.push(' ', g.PUBLIC, ' ', pubid);\n\t\t\t\tif (sysid && sysid !== '.') {\n\t\t\t\t\tbuf.push(' ', sysid);\n\t\t\t\t}\n\t\t\t} else if (sysid && sysid !== '.') {\n\t\t\t\tbuf.push(' ', g.SYSTEM, ' ', sysid);\n\t\t\t}\n\t\t\tif (node.internalSubset) {\n\t\t\t\tbuf.push(' [', node.internalSubset, ']');\n\t\t\t}\n\t\t\tbuf.push('>');\n\t\t\treturn;\n\t\tcase PROCESSING_INSTRUCTION_NODE:\n\t\t\treturn buf.push('<?', node.target, ' ', node.data, '?>');\n\t\tcase ENTITY_REFERENCE_NODE:\n\t\t\treturn buf.push('&', node.nodeName, ';');\n\t\t//case ENTITY_NODE:\n\t\t//case NOTATION_NODE:\n\t\tdefault:\n\t\t\tbuf.push('??', node.nodeName);\n\t}\n}\nfunction importNode(doc, node, deep) {\n\tvar node2;\n\tswitch (node.nodeType) {\n\t\tcase ELEMENT_NODE:\n\t\t\tnode2 = node.cloneNode(false);\n\t\t\tnode2.ownerDocument = doc;\n\t\t//var attrs = node2.attributes;\n\t\t//var len = attrs.length;\n\t\t//for(var i=0;i<len;i++){\n\t\t//node2.setAttributeNodeNS(importNode(doc,attrs.item(i),deep));\n\t\t//}\n\t\tcase DOCUMENT_FRAGMENT_NODE:\n\t\t\tbreak;\n\t\tcase ATTRIBUTE_NODE:\n\t\t\tdeep = true;\n\t\t\tbreak;\n\t\t//case ENTITY_REFERENCE_NODE:\n\t\t//case PROCESSING_INSTRUCTION_NODE:\n\t\t////case TEXT_NODE:\n\t\t//case CDATA_SECTION_NODE:\n\t\t//case COMMENT_NODE:\n\t\t//\tdeep = false;\n\t\t//\tbreak;\n\t\t//case DOCUMENT_NODE:\n\t\t//case DOCUMENT_TYPE_NODE:\n\t\t//cannot be imported.\n\t\t//case ENTITY_NODE:\n\t\t//case NOTATION_NODE:\n\t\t//can not hit in level3\n\t\t//default:throw e;\n\t}\n\tif (!node2) {\n\t\tnode2 = node.cloneNode(false); //false\n\t}\n\tnode2.ownerDocument = doc;\n\tnode2.parentNode = null;\n\tif (deep) {\n\t\tvar child = node.firstChild;\n\t\twhile (child) {\n\t\t\tnode2.appendChild(importNode(doc, child, deep));\n\t\t\tchild = child.nextSibling;\n\t\t}\n\t}\n\treturn node2;\n}\n\n/**\n * Creates a copy of a node from an existing one.\n *\n * @param {Document} doc\n * The Document object representing the document that the new node will belong to.\n * @param {Node} node\n * The node to clone.\n * @param {boolean} deep\n * If true, the contents of the node are recursively copied.\n * If false, only the node itself (and its attributes, if it is an element) are copied.\n * @returns {Node}\n * Returns the newly created copy of the node.\n * @throws {DOMException}\n * May throw a DOMException if operations within setAttributeNode or appendChild (which are\n * potentially invoked in this function) do not meet their specific constraints.\n */\nfunction cloneNode(doc, node, deep) {\n\tvar node2 = new node.constructor(PDC);\n\tfor (var n in node) {\n\t\tif (hasOwn(node, n)) {\n\t\t\tvar v = node[n];\n\t\t\tif (typeof v != 'object') {\n\t\t\t\tif (v != node2[n]) {\n\t\t\t\t\tnode2[n] = v;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif (node.childNodes) {\n\t\tnode2.childNodes = new NodeList();\n\t}\n\tnode2.ownerDocument = doc;\n\tswitch (node2.nodeType) {\n\t\tcase ELEMENT_NODE:\n\t\t\tvar attrs = node.attributes;\n\t\t\tvar attrs2 = (node2.attributes = new NamedNodeMap());\n\t\t\tvar len = attrs.length;\n\t\t\tattrs2._ownerElement = node2;\n\t\t\tfor (var i = 0; i < len; i++) {\n\t\t\t\tnode2.setAttributeNode(cloneNode(doc, attrs.item(i), true));\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ATTRIBUTE_NODE:\n\t\t\tdeep = true;\n\t}\n\tif (deep) {\n\t\tvar child = node.firstChild;\n\t\twhile (child) {\n\t\t\tnode2.appendChild(cloneNode(doc, child, deep));\n\t\t\tchild = child.nextSibling;\n\t\t}\n\t}\n\treturn node2;\n}\n\nfunction __set__(object, key, value) {\n\tobject[key] = value;\n}\n//do dynamic\ntry {\n\tif (Object.defineProperty) {\n\t\tObject.defineProperty(LiveNodeList.prototype, 'length', {\n\t\t\tget: function () {\n\t\t\t\t_updateLiveList(this);\n\t\t\t\treturn this.$$length;\n\t\t\t},\n\t\t});\n\n\t\tObject.defineProperty(Node.prototype, 'textContent', {\n\t\t\tget: function () {\n\t\t\t\treturn getTextContent(this);\n\t\t\t},\n\n\t\t\tset: function (data) {\n\t\t\t\tswitch (this.nodeType) {\n\t\t\t\t\tcase ELEMENT_NODE:\n\t\t\t\t\tcase DOCUMENT_FRAGMENT_NODE:\n\t\t\t\t\t\twhile (this.firstChild) {\n\t\t\t\t\t\t\tthis.removeChild(this.firstChild);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (data || String(data)) {\n\t\t\t\t\t\t\tthis.appendChild(this.ownerDocument.createTextNode(data));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tthis.data = data;\n\t\t\t\t\t\tthis.value = data;\n\t\t\t\t\t\tthis.nodeValue = data;\n\t\t\t\t}\n\t\t\t},\n\t\t});\n\n\t\tfunction getTextContent(node) {\n\t\t\tswitch (node.nodeType) {\n\t\t\t\tcase ELEMENT_NODE:\n\t\t\t\tcase DOCUMENT_FRAGMENT_NODE:\n\t\t\t\t\tvar buf = [];\n\t\t\t\t\tnode = node.firstChild;\n\t\t\t\t\twhile (node) {\n\t\t\t\t\t\tif (node.nodeType !== 7 && node.nodeType !== 8) {\n\t\t\t\t\t\t\tbuf.push(getTextContent(node));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnode = node.nextSibling;\n\t\t\t\t\t}\n\t\t\t\t\treturn buf.join('');\n\t\t\t\tdefault:\n\t\t\t\t\treturn node.nodeValue;\n\t\t\t}\n\t\t}\n\n\t\t__set__ = function (object, key, value) {\n\t\t\t//console.log(value)\n\t\t\tobject['$$' + key] = value;\n\t\t};\n\t}\n} catch (e) {\n\t//ie8\n}\n\nexports._updateLiveList = _updateLiveList;\nexports.Attr = Attr;\nexports.CDATASection = CDATASection;\nexports.CharacterData = CharacterData;\nexports.Comment = Comment;\nexports.Document = Document;\nexports.DocumentFragment = DocumentFragment;\nexports.DocumentType = DocumentType;\nexports.DOMImplementation = DOMImplementation;\nexports.Element = Element;\nexports.Entity = Entity;\nexports.EntityReference = EntityReference;\nexports.LiveNodeList = LiveNodeList;\nexports.NamedNodeMap = NamedNodeMap;\nexports.Node = Node;\nexports.NodeList = NodeList;\nexports.Notation = Notation;\nexports.Text = Text;\nexports.ProcessingInstruction = ProcessingInstruction;\nexports.XMLSerializer = XMLSerializer;\n","'use strict';\n\nvar freeze = require('./conventions').freeze;\n\n/**\n * The entities that are predefined in every XML document.\n *\n * @see https://www.w3.org/TR/2006/REC-xml11-20060816/#sec-predefined-ent W3C XML 1.1\n * @see https://www.w3.org/TR/2008/REC-xml-20081126/#sec-predefined-ent W3C XML 1.0\n * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Predefined_entities_in_XML\n * Wikipedia\n */\nexports.XML_ENTITIES = freeze({\n\tamp: '&',\n\tapos: \"'\",\n\tgt: '>',\n\tlt: '<',\n\tquot: '\"',\n});\n\n/**\n * A map of all entities that are detected in an HTML document.\n * They contain all entries from `XML_ENTITIES`.\n *\n * @see {@link XML_ENTITIES}\n * @see {@link DOMParser.parseFromString}\n * @see {@link DOMImplementation.prototype.createHTMLDocument}\n * @see https://html.spec.whatwg.org/#named-character-references WHATWG HTML(5)\n * Spec\n * @see https://html.spec.whatwg.org/entities.json JSON\n * @see https://www.w3.org/TR/xml-entity-names/ W3C XML Entity Names\n * @see https://www.w3.org/TR/html4/sgml/entities.html W3C HTML4/SGML\n * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Character_entity_references_in_HTML\n * Wikipedia (HTML)\n * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Entities_representing_special_characters_in_XHTML\n * Wikpedia (XHTML)\n */\nexports.HTML_ENTITIES = freeze({\n\tAacute: '\\u00C1',\n\taacute: '\\u00E1',\n\tAbreve: '\\u0102',\n\tabreve: '\\u0103',\n\tac: '\\u223E',\n\tacd: '\\u223F',\n\tacE: '\\u223E\\u0333',\n\tAcirc: '\\u00C2',\n\tacirc: '\\u00E2',\n\tacute: '\\u00B4',\n\tAcy: '\\u0410',\n\tacy: '\\u0430',\n\tAElig: '\\u00C6',\n\taelig: '\\u00E6',\n\taf: '\\u2061',\n\tAfr: '\\uD835\\uDD04',\n\tafr: '\\uD835\\uDD1E',\n\tAgrave: '\\u00C0',\n\tagrave: '\\u00E0',\n\talefsym: '\\u2135',\n\taleph: '\\u2135',\n\tAlpha: '\\u0391',\n\talpha: '\\u03B1',\n\tAmacr: '\\u0100',\n\tamacr: '\\u0101',\n\tamalg: '\\u2A3F',\n\tAMP: '\\u0026',\n\tamp: '\\u0026',\n\tAnd: '\\u2A53',\n\tand: '\\u2227',\n\tandand: '\\u2A55',\n\tandd: '\\u2A5C',\n\tandslope: '\\u2A58',\n\tandv: '\\u2A5A',\n\tang: '\\u2220',\n\tange: '\\u29A4',\n\tangle: '\\u2220',\n\tangmsd: '\\u2221',\n\tangmsdaa: '\\u29A8',\n\tangmsdab: '\\u29A9',\n\tangmsdac: '\\u29AA',\n\tangmsdad: '\\u29AB',\n\tangmsdae: '\\u29AC',\n\tangmsdaf: '\\u29AD',\n\tangmsdag: '\\u29AE',\n\tangmsdah: '\\u29AF',\n\tangrt: '\\u221F',\n\tangrtvb: '\\u22BE',\n\tangrtvbd: '\\u299D',\n\tangsph: '\\u2222',\n\tangst: '\\u00C5',\n\tangzarr: '\\u237C',\n\tAogon: '\\u0104',\n\taogon: '\\u0105',\n\tAopf: '\\uD835\\uDD38',\n\taopf: '\\uD835\\uDD52',\n\tap: '\\u2248',\n\tapacir: '\\u2A6F',\n\tapE: '\\u2A70',\n\tape: '\\u224A',\n\tapid: '\\u224B',\n\tapos: '\\u0027',\n\tApplyFunction: '\\u2061',\n\tapprox: '\\u2248',\n\tapproxeq: '\\u224A',\n\tAring: '\\u00C5',\n\taring: '\\u00E5',\n\tAscr: '\\uD835\\uDC9C',\n\tascr: '\\uD835\\uDCB6',\n\tAssign: '\\u2254',\n\tast: '\\u002A',\n\tasymp: '\\u2248',\n\tasympeq: '\\u224D',\n\tAtilde: '\\u00C3',\n\tatilde: '\\u00E3',\n\tAuml: '\\u00C4',\n\tauml: '\\u00E4',\n\tawconint: '\\u2233',\n\tawint: '\\u2A11',\n\tbackcong: '\\u224C',\n\tbackepsilon: '\\u03F6',\n\tbackprime: '\\u2035',\n\tbacksim: '\\u223D',\n\tbacksimeq: '\\u22CD',\n\tBackslash: '\\u2216',\n\tBarv: '\\u2AE7',\n\tbarvee: '\\u22BD',\n\tBarwed: '\\u2306',\n\tbarwed: '\\u2305',\n\tbarwedge: '\\u2305',\n\tbbrk: '\\u23B5',\n\tbbrktbrk: '\\u23B6',\n\tbcong: '\\u224C',\n\tBcy: '\\u0411',\n\tbcy: '\\u0431',\n\tbdquo: '\\u201E',\n\tbecaus: '\\u2235',\n\tBecause: '\\u2235',\n\tbecause: '\\u2235',\n\tbemptyv: '\\u29B0',\n\tbepsi: '\\u03F6',\n\tbernou: '\\u212C',\n\tBernoullis: '\\u212C',\n\tBeta: '\\u0392',\n\tbeta: '\\u03B2',\n\tbeth: '\\u2136',\n\tbetween: '\\u226C',\n\tBfr: '\\uD835\\uDD05',\n\tbfr: '\\uD835\\uDD1F',\n\tbigcap: '\\u22C2',\n\tbigcirc: '\\u25EF',\n\tbigcup: '\\u22C3',\n\tbigodot: '\\u2A00',\n\tbigoplus: '\\u2A01',\n\tbigotimes: '\\u2A02',\n\tbigsqcup: '\\u2A06',\n\tbigstar: '\\u2605',\n\tbigtriangledown: '\\u25BD',\n\tbigtriangleup: '\\u25B3',\n\tbiguplus: '\\u2A04',\n\tbigvee: '\\u22C1',\n\tbigwedge: '\\u22C0',\n\tbkarow: '\\u290D',\n\tblacklozenge: '\\u29EB',\n\tblacksquare: '\\u25AA',\n\tblacktriangle: '\\u25B4',\n\tblacktriangledown: '\\u25BE',\n\tblacktriangleleft: '\\u25C2',\n\tblacktriangleright: '\\u25B8',\n\tblank: '\\u2423',\n\tblk12: '\\u2592',\n\tblk14: '\\u2591',\n\tblk34: '\\u2593',\n\tblock: '\\u2588',\n\tbne: '\\u003D\\u20E5',\n\tbnequiv: '\\u2261\\u20E5',\n\tbNot: '\\u2AED',\n\tbnot: '\\u2310',\n\tBopf: '\\uD835\\uDD39',\n\tbopf: '\\uD835\\uDD53',\n\tbot: '\\u22A5',\n\tbottom: '\\u22A5',\n\tbowtie: '\\u22C8',\n\tboxbox: '\\u29C9',\n\tboxDL: '\\u2557',\n\tboxDl: '\\u2556',\n\tboxdL: '\\u2555',\n\tboxdl: '\\u2510',\n\tboxDR: '\\u2554',\n\tboxDr: '\\u2553',\n\tboxdR: '\\u2552',\n\tboxdr: '\\u250C',\n\tboxH: '\\u2550',\n\tboxh: '\\u2500',\n\tboxHD: '\\u2566',\n\tboxHd: '\\u2564',\n\tboxhD: '\\u2565',\n\tboxhd: '\\u252C',\n\tboxHU: '\\u2569',\n\tboxHu: '\\u2567',\n\tboxhU: '\\u2568',\n\tboxhu: '\\u2534',\n\tboxminus: '\\u229F',\n\tboxplus: '\\u229E',\n\tboxtimes: '\\u22A0',\n\tboxUL: '\\u255D',\n\tboxUl: '\\u255C',\n\tboxuL: '\\u255B',\n\tboxul: '\\u2518',\n\tboxUR: '\\u255A',\n\tboxUr: '\\u2559',\n\tboxuR: '\\u2558',\n\tboxur: '\\u2514',\n\tboxV: '\\u2551',\n\tboxv: '\\u2502',\n\tboxVH: '\\u256C',\n\tboxVh: '\\u256B',\n\tboxvH: '\\u256A',\n\tboxvh: '\\u253C',\n\tboxVL: '\\u2563',\n\tboxVl: '\\u2562',\n\tboxvL: '\\u2561',\n\tboxvl: '\\u2524',\n\tboxVR: '\\u2560',\n\tboxVr: '\\u255F',\n\tboxvR: '\\u255E',\n\tboxvr: '\\u251C',\n\tbprime: '\\u2035',\n\tBreve: '\\u02D8',\n\tbreve: '\\u02D8',\n\tbrvbar: '\\u00A6',\n\tBscr: '\\u212C',\n\tbscr: '\\uD835\\uDCB7',\n\tbsemi: '\\u204F',\n\tbsim: '\\u223D',\n\tbsime: '\\u22CD',\n\tbsol: '\\u005C',\n\tbsolb: '\\u29C5',\n\tbsolhsub: '\\u27C8',\n\tbull: '\\u2022',\n\tbullet: '\\u2022',\n\tbump: '\\u224E',\n\tbumpE: '\\u2AAE',\n\tbumpe: '\\u224F',\n\tBumpeq: '\\u224E',\n\tbumpeq: '\\u224F',\n\tCacute: '\\u0106',\n\tcacute: '\\u0107',\n\tCap: '\\u22D2',\n\tcap: '\\u2229',\n\tcapand: '\\u2A44',\n\tcapbrcup: '\\u2A49',\n\tcapcap: '\\u2A4B',\n\tcapcup: '\\u2A47',\n\tcapdot: '\\u2A40',\n\tCapitalDifferentialD: '\\u2145',\n\tcaps: '\\u2229\\uFE00',\n\tcaret: '\\u2041',\n\tcaron: '\\u02C7',\n\tCayleys: '\\u212D',\n\tccaps: '\\u2A4D',\n\tCcaron: '\\u010C',\n\tccaron: '\\u010D',\n\tCcedil: '\\u00C7',\n\tccedil: '\\u00E7',\n\tCcirc: '\\u0108',\n\tccirc: '\\u0109',\n\tCconint: '\\u2230',\n\tccups: '\\u2A4C',\n\tccupssm: '\\u2A50',\n\tCdot: '\\u010A',\n\tcdot: '\\u010B',\n\tcedil: '\\u00B8',\n\tCedilla: '\\u00B8',\n\tcemptyv: '\\u29B2',\n\tcent: '\\u00A2',\n\tCenterDot: '\\u00B7',\n\tcenterdot: '\\u00B7',\n\tCfr: '\\u212D',\n\tcfr: '\\uD835\\uDD20',\n\tCHcy: '\\u0427',\n\tchcy: '\\u0447',\n\tcheck: '\\u2713',\n\tcheckmark: '\\u2713',\n\tChi: '\\u03A7',\n\tchi: '\\u03C7',\n\tcir: '\\u25CB',\n\tcirc: '\\u02C6',\n\tcirceq: '\\u2257',\n\tcirclearrowleft: '\\u21BA',\n\tcirclearrowright: '\\u21BB',\n\tcircledast: '\\u229B',\n\tcircledcirc: '\\u229A',\n\tcircleddash: '\\u229D',\n\tCircleDot: '\\u2299',\n\tcircledR: '\\u00AE',\n\tcircledS: '\\u24C8',\n\tCircleMinus: '\\u2296',\n\tCirclePlus: '\\u2295',\n\tCircleTimes: '\\u2297',\n\tcirE: '\\u29C3',\n\tcire: '\\u2257',\n\tcirfnint: '\\u2A10',\n\tcirmid: '\\u2AEF',\n\tcirscir: '\\u29C2',\n\tClockwiseContourIntegral: '\\u2232',\n\tCloseCurlyDoubleQuote: '\\u201D',\n\tCloseCurlyQuote: '\\u2019',\n\tclubs: '\\u2663',\n\tclubsuit: '\\u2663',\n\tColon: '\\u2237',\n\tcolon: '\\u003A',\n\tColone: '\\u2A74',\n\tcolone: '\\u2254',\n\tcoloneq: '\\u2254',\n\tcomma: '\\u002C',\n\tcommat: '\\u0040',\n\tcomp: '\\u2201',\n\tcompfn: '\\u2218',\n\tcomplement: '\\u2201',\n\tcomplexes: '\\u2102',\n\tcong: '\\u2245',\n\tcongdot: '\\u2A6D',\n\tCongruent: '\\u2261',\n\tConint: '\\u222F',\n\tconint: '\\u222E',\n\tContourIntegral: '\\u222E',\n\tCopf: '\\u2102',\n\tcopf: '\\uD835\\uDD54',\n\tcoprod: '\\u2210',\n\tCoproduct: '\\u2210',\n\tCOPY: '\\u00A9',\n\tcopy: '\\u00A9',\n\tcopysr: '\\u2117',\n\tCounterClockwiseContourIntegral: '\\u2233',\n\tcrarr: '\\u21B5',\n\tCross: '\\u2A2F',\n\tcross: '\\u2717',\n\tCscr: '\\uD835\\uDC9E',\n\tcscr: '\\uD835\\uDCB8',\n\tcsub: '\\u2ACF',\n\tcsube: '\\u2AD1',\n\tcsup: '\\u2AD0',\n\tcsupe: '\\u2AD2',\n\tctdot: '\\u22EF',\n\tcudarrl: '\\u2938',\n\tcudarrr: '\\u2935',\n\tcuepr: '\\u22DE',\n\tcuesc: '\\u22DF',\n\tcularr: '\\u21B6',\n\tcularrp: '\\u293D',\n\tCup: '\\u22D3',\n\tcup: '\\u222A',\n\tcupbrcap: '\\u2A48',\n\tCupCap: '\\u224D',\n\tcupcap: '\\u2A46',\n\tcupcup: '\\u2A4A',\n\tcupdot: '\\u228D',\n\tcupor: '\\u2A45',\n\tcups: '\\u222A\\uFE00',\n\tcurarr: '\\u21B7',\n\tcurarrm: '\\u293C',\n\tcurlyeqprec: '\\u22DE',\n\tcurlyeqsucc: '\\u22DF',\n\tcurlyvee: '\\u22CE',\n\tcurlywedge: '\\u22CF',\n\tcurren: '\\u00A4',\n\tcurvearrowleft: '\\u21B6',\n\tcurvearrowright: '\\u21B7',\n\tcuvee: '\\u22CE',\n\tcuwed: '\\u22CF',\n\tcwconint: '\\u2232',\n\tcwint: '\\u2231',\n\tcylcty: '\\u232D',\n\tDagger: '\\u2021',\n\tdagger: '\\u2020',\n\tdaleth: '\\u2138',\n\tDarr: '\\u21A1',\n\tdArr: '\\u21D3',\n\tdarr: '\\u2193',\n\tdash: '\\u2010',\n\tDashv: '\\u2AE4',\n\tdashv: '\\u22A3',\n\tdbkarow: '\\u290F',\n\tdblac: '\\u02DD',\n\tDcaron: '\\u010E',\n\tdcaron: '\\u010F',\n\tDcy: '\\u0414',\n\tdcy: '\\u0434',\n\tDD: '\\u2145',\n\tdd: '\\u2146',\n\tddagger: '\\u2021',\n\tddarr: '\\u21CA',\n\tDDotrahd: '\\u2911',\n\tddotseq: '\\u2A77',\n\tdeg: '\\u00B0',\n\tDel: '\\u2207',\n\tDelta: '\\u0394',\n\tdelta: '\\u03B4',\n\tdemptyv: '\\u29B1',\n\tdfisht: '\\u297F',\n\tDfr: '\\uD835\\uDD07',\n\tdfr: '\\uD835\\uDD21',\n\tdHar: '\\u2965',\n\tdharl: '\\u21C3',\n\tdharr: '\\u21C2',\n\tDiacriticalAcute: '\\u00B4',\n\tDiacriticalDot: '\\u02D9',\n\tDiacriticalDoubleAcute: '\\u02DD',\n\tDiacriticalGrave: '\\u0060',\n\tDiacriticalTilde: '\\u02DC',\n\tdiam: '\\u22C4',\n\tDiamond: '\\u22C4',\n\tdiamond: '\\u22C4',\n\tdiamondsuit: '\\u2666',\n\tdiams: '\\u2666',\n\tdie: '\\u00A8',\n\tDifferentialD: '\\u2146',\n\tdigamma: '\\u03DD',\n\tdisin: '\\u22F2',\n\tdiv: '\\u00F7',\n\tdivide: '\\u00F7',\n\tdivideontimes: '\\u22C7',\n\tdivonx: '\\u22C7',\n\tDJcy: '\\u0402',\n\tdjcy: '\\u0452',\n\tdlcorn: '\\u231E',\n\tdlcrop: '\\u230D',\n\tdollar: '\\u0024',\n\tDopf: '\\uD835\\uDD3B',\n\tdopf: '\\uD835\\uDD55',\n\tDot: '\\u00A8',\n\tdot: '\\u02D9',\n\tDotDot: '\\u20DC',\n\tdoteq: '\\u2250',\n\tdoteqdot: '\\u2251',\n\tDotEqual: '\\u2250',\n\tdotminus: '\\u2238',\n\tdotplus: '\\u2214',\n\tdotsquare: '\\u22A1',\n\tdoublebarwedge: '\\u2306',\n\tDoubleContourIntegral: '\\u222F',\n\tDoubleDot: '\\u00A8',\n\tDoubleDownArrow: '\\u21D3',\n\tDoubleLeftArrow: '\\u21D0',\n\tDoubleLeftRightArrow: '\\u21D4',\n\tDoubleLeftTee: '\\u2AE4',\n\tDoubleLongLeftArrow: '\\u27F8',\n\tDoubleLongLeftRightArrow: '\\u27FA',\n\tDoubleLongRightArrow: '\\u27F9',\n\tDoubleRightArrow: '\\u21D2',\n\tDoubleRightTee: '\\u22A8',\n\tDoubleUpArrow: '\\u21D1',\n\tDoubleUpDownArrow: '\\u21D5',\n\tDoubleVerticalBar: '\\u2225',\n\tDownArrow: '\\u2193',\n\tDownarrow: '\\u21D3',\n\tdownarrow: '\\u2193',\n\tDownArrowBar: '\\u2913',\n\tDownArrowUpArrow: '\\u21F5',\n\tDownBreve: '\\u0311',\n\tdowndownarrows: '\\u21CA',\n\tdownharpoonleft: '\\u21C3',\n\tdownharpoonright: '\\u21C2',\n\tDownLeftRightVector: '\\u2950',\n\tDownLeftTeeVector: '\\u295E',\n\tDownLeftVector: '\\u21BD',\n\tDownLeftVectorBar: '\\u2956',\n\tDownRightTeeVector: '\\u295F',\n\tDownRightVector: '\\u21C1',\n\tDownRightVectorBar: '\\u2957',\n\tDownTee: '\\u22A4',\n\tDownTeeArrow: '\\u21A7',\n\tdrbkarow: '\\u2910',\n\tdrcorn: '\\u231F',\n\tdrcrop: '\\u230C',\n\tDscr: '\\uD835\\uDC9F',\n\tdscr: '\\uD835\\uDCB9',\n\tDScy: '\\u0405',\n\tdscy: '\\u0455',\n\tdsol: '\\u29F6',\n\tDstrok: '\\u0110',\n\tdstrok: '\\u0111',\n\tdtdot: '\\u22F1',\n\tdtri: '\\u25BF',\n\tdtrif: '\\u25BE',\n\tduarr: '\\u21F5',\n\tduhar: '\\u296F',\n\tdwangle: '\\u29A6',\n\tDZcy: '\\u040F',\n\tdzcy: '\\u045F',\n\tdzigrarr: '\\u27FF',\n\tEacute: '\\u00C9',\n\teacute: '\\u00E9',\n\teaster: '\\u2A6E',\n\tEcaron: '\\u011A',\n\tecaron: '\\u011B',\n\tecir: '\\u2256',\n\tEcirc: '\\u00CA',\n\tecirc: '\\u00EA',\n\tecolon: '\\u2255',\n\tEcy: '\\u042D',\n\tecy: '\\u044D',\n\teDDot: '\\u2A77',\n\tEdot: '\\u0116',\n\teDot: '\\u2251',\n\tedot: '\\u0117',\n\tee: '\\u2147',\n\tefDot: '\\u2252',\n\tEfr: '\\uD835\\uDD08',\n\tefr: '\\uD835\\uDD22',\n\teg: '\\u2A9A',\n\tEgrave: '\\u00C8',\n\tegrave: '\\u00E8',\n\tegs: '\\u2A96',\n\tegsdot: '\\u2A98',\n\tel: '\\u2A99',\n\tElement: '\\u2208',\n\telinters: '\\u23E7',\n\tell: '\\u2113',\n\tels: '\\u2A95',\n\telsdot: '\\u2A97',\n\tEmacr: '\\u0112',\n\temacr: '\\u0113',\n\tempty: '\\u2205',\n\temptyset: '\\u2205',\n\tEmptySmallSquare: '\\u25FB',\n\temptyv: '\\u2205',\n\tEmptyVerySmallSquare: '\\u25AB',\n\temsp: '\\u2003',\n\temsp13: '\\u2004',\n\temsp14: '\\u2005',\n\tENG: '\\u014A',\n\teng: '\\u014B',\n\tensp: '\\u2002',\n\tEogon: '\\u0118',\n\teogon: '\\u0119',\n\tEopf: '\\uD835\\uDD3C',\n\teopf: '\\uD835\\uDD56',\n\tepar: '\\u22D5',\n\teparsl: '\\u29E3',\n\teplus: '\\u2A71',\n\tepsi: '\\u03B5',\n\tEpsilon: '\\u0395',\n\tepsilon: '\\u03B5',\n\tepsiv: '\\u03F5',\n\teqcirc: '\\u2256',\n\teqcolon: '\\u2255',\n\teqsim: '\\u2242',\n\teqslantgtr: '\\u2A96',\n\teqslantless: '\\u2A95',\n\tEqual: '\\u2A75',\n\tequals: '\\u003D',\n\tEqualTilde: '\\u2242',\n\tequest: '\\u225F',\n\tEquilibrium: '\\u21CC',\n\tequiv: '\\u2261',\n\tequivDD: '\\u2A78',\n\teqvparsl: '\\u29E5',\n\terarr: '\\u2971',\n\terDot: '\\u2253',\n\tEscr: '\\u2130',\n\tescr: '\\u212F',\n\tesdot: '\\u2250',\n\tEsim: '\\u2A73',\n\tesim: '\\u2242',\n\tEta: '\\u0397',\n\teta: '\\u03B7',\n\tETH: '\\u00D0',\n\teth: '\\u00F0',\n\tEuml: '\\u00CB',\n\teuml: '\\u00EB',\n\teuro: '\\u20AC',\n\texcl: '\\u0021',\n\texist: '\\u2203',\n\tExists: '\\u2203',\n\texpectation: '\\u2130',\n\tExponentialE: '\\u2147',\n\texponentiale: '\\u2147',\n\tfallingdotseq: '\\u2252',\n\tFcy: '\\u0424',\n\tfcy: '\\u0444',\n\tfemale: '\\u2640',\n\tffilig: '\\uFB03',\n\tfflig: '\\uFB00',\n\tffllig: '\\uFB04',\n\tFfr: '\\uD835\\uDD09',\n\tffr: '\\uD835\\uDD23',\n\tfilig: '\\uFB01',\n\tFilledSmallSquare: '\\u25FC',\n\tFilledVerySmallSquare: '\\u25AA',\n\tfjlig: '\\u0066\\u006A',\n\tflat: '\\u266D',\n\tfllig: '\\uFB02',\n\tfltns: '\\u25B1',\n\tfnof: '\\u0192',\n\tFopf: '\\uD835\\uDD3D',\n\tfopf: '\\uD835\\uDD57',\n\tForAll: '\\u2200',\n\tforall: '\\u2200',\n\tfork: '\\u22D4',\n\tforkv: '\\u2AD9',\n\tFouriertrf: '\\u2131',\n\tfpartint: '\\u2A0D',\n\tfrac12: '\\u00BD',\n\tfrac13: '\\u2153',\n\tfrac14: '\\u00BC',\n\tfrac15: '\\u2155',\n\tfrac16: '\\u2159',\n\tfrac18: '\\u215B',\n\tfrac23: '\\u2154',\n\tfrac25: '\\u2156',\n\tfrac34: '\\u00BE',\n\tfrac35: '\\u2157',\n\tfrac38: '\\u215C',\n\tfrac45: '\\u2158',\n\tfrac56: '\\u215A',\n\tfrac58: '\\u215D',\n\tfrac78: '\\u215E',\n\tfrasl: '\\u2044',\n\tfrown: '\\u2322',\n\tFscr: '\\u2131',\n\tfscr: '\\uD835\\uDCBB',\n\tgacute: '\\u01F5',\n\tGamma: '\\u0393',\n\tgamma: '\\u03B3',\n\tGammad: '\\u03DC',\n\tgammad: '\\u03DD',\n\tgap: '\\u2A86',\n\tGbreve: '\\u011E',\n\tgbreve: '\\u011F',\n\tGcedil: '\\u0122',\n\tGcirc: '\\u011C',\n\tgcirc: '\\u011D',\n\tGcy: '\\u0413',\n\tgcy: '\\u0433',\n\tGdot: '\\u0120',\n\tgdot: '\\u0121',\n\tgE: '\\u2267',\n\tge: '\\u2265',\n\tgEl: '\\u2A8C',\n\tgel: '\\u22DB',\n\tgeq: '\\u2265',\n\tgeqq: '\\u2267',\n\tgeqslant: '\\u2A7E',\n\tges: '\\u2A7E',\n\tgescc: '\\u2AA9',\n\tgesdot: '\\u2A80',\n\tgesdoto: '\\u2A82',\n\tgesdotol: '\\u2A84',\n\tgesl: '\\u22DB\\uFE00',\n\tgesles: '\\u2A94',\n\tGfr: '\\uD835\\uDD0A',\n\tgfr: '\\uD835\\uDD24',\n\tGg: '\\u22D9',\n\tgg: '\\u226B',\n\tggg: '\\u22D9',\n\tgimel: '\\u2137',\n\tGJcy: '\\u0403',\n\tgjcy: '\\u0453',\n\tgl: '\\u2277',\n\tgla: '\\u2AA5',\n\tglE: '\\u2A92',\n\tglj: '\\u2AA4',\n\tgnap: '\\u2A8A',\n\tgnapprox: '\\u2A8A',\n\tgnE: '\\u2269',\n\tgne: '\\u2A88',\n\tgneq: '\\u2A88',\n\tgneqq: '\\u2269',\n\tgnsim: '\\u22E7',\n\tGopf: '\\uD835\\uDD3E',\n\tgopf: '\\uD835\\uDD58',\n\tgrave: '\\u0060',\n\tGreaterEqual: '\\u2265',\n\tGreaterEqualLess: '\\u22DB',\n\tGreaterFullEqual: '\\u2267',\n\tGreaterGreater: '\\u2AA2',\n\tGreaterLess: '\\u2277',\n\tGreaterSlantEqual: '\\u2A7E',\n\tGreaterTilde: '\\u2273',\n\tGscr: '\\uD835\\uDCA2',\n\tgscr: '\\u210A',\n\tgsim: '\\u2273',\n\tgsime: '\\u2A8E',\n\tgsiml: '\\u2A90',\n\tGt: '\\u226B',\n\tGT: '\\u003E',\n\tgt: '\\u003E',\n\tgtcc: '\\u2AA7',\n\tgtcir: '\\u2A7A',\n\tgtdot: '\\u22D7',\n\tgtlPar: '\\u2995',\n\tgtquest: '\\u2A7C',\n\tgtrapprox: '\\u2A86',\n\tgtrarr: '\\u2978',\n\tgtrdot: '\\u22D7',\n\tgtreqless: '\\u22DB',\n\tgtreqqless: '\\u2A8C',\n\tgtrless: '\\u2277',\n\tgtrsim: '\\u2273',\n\tgvertneqq: '\\u2269\\uFE00',\n\tgvnE: '\\u2269\\uFE00',\n\tHacek: '\\u02C7',\n\thairsp: '\\u200A',\n\thalf: '\\u00BD',\n\thamilt: '\\u210B',\n\tHARDcy: '\\u042A',\n\thardcy: '\\u044A',\n\thArr: '\\u21D4',\n\tharr: '\\u2194',\n\tharrcir: '\\u2948',\n\tharrw: '\\u21AD',\n\tHat: '\\u005E',\n\thbar: '\\u210F',\n\tHcirc: '\\u0124',\n\thcirc: '\\u0125',\n\thearts: '\\u2665',\n\theartsuit: '\\u2665',\n\thellip: '\\u2026',\n\thercon: '\\u22B9',\n\tHfr: '\\u210C',\n\thfr: '\\uD835\\uDD25',\n\tHilbertSpace: '\\u210B',\n\thksearow: '\\u2925',\n\thkswarow: '\\u2926',\n\thoarr: '\\u21FF',\n\thomtht: '\\u223B',\n\thookleftarrow: '\\u21A9',\n\thookrightarrow: '\\u21AA',\n\tHopf: '\\u210D',\n\thopf: '\\uD835\\uDD59',\n\thorbar: '\\u2015',\n\tHorizontalLine: '\\u2500',\n\tHscr: '\\u210B',\n\thscr: '\\uD835\\uDCBD',\n\thslash: '\\u210F',\n\tHstrok: '\\u0126',\n\thstrok: '\\u0127',\n\tHumpDownHump: '\\u224E',\n\tHumpEqual: '\\u224F',\n\thybull: '\\u2043',\n\thyphen: '\\u2010',\n\tIacute: '\\u00CD',\n\tiacute: '\\u00ED',\n\tic: '\\u2063',\n\tIcirc: '\\u00CE',\n\ticirc: '\\u00EE',\n\tIcy: '\\u0418',\n\ticy: '\\u0438',\n\tIdot: '\\u0130',\n\tIEcy: '\\u0415',\n\tiecy: '\\u0435',\n\tiexcl: '\\u00A1',\n\tiff: '\\u21D4',\n\tIfr: '\\u2111',\n\tifr: '\\uD835\\uDD26',\n\tIgrave: '\\u00CC',\n\tigrave: '\\u00EC',\n\tii: '\\u2148',\n\tiiiint: '\\u2A0C',\n\tiiint: '\\u222D',\n\tiinfin: '\\u29DC',\n\tiiota: '\\u2129',\n\tIJlig: '\\u0132',\n\tijlig: '\\u0133',\n\tIm: '\\u2111',\n\tImacr: '\\u012A',\n\timacr: '\\u012B',\n\timage: '\\u2111',\n\tImaginaryI: '\\u2148',\n\timagline: '\\u2110',\n\timagpart: '\\u2111',\n\timath: '\\u0131',\n\timof: '\\u22B7',\n\timped: '\\u01B5',\n\tImplies: '\\u21D2',\n\tin: '\\u2208',\n\tincare: '\\u2105',\n\tinfin: '\\u221E',\n\tinfintie: '\\u29DD',\n\tinodot: '\\u0131',\n\tInt: '\\u222C',\n\tint: '\\u222B',\n\tintcal: '\\u22BA',\n\tintegers: '\\u2124',\n\tIntegral: '\\u222B',\n\tintercal: '\\u22BA',\n\tIntersection: '\\u22C2',\n\tintlarhk: '\\u2A17',\n\tintprod: '\\u2A3C',\n\tInvisibleComma: '\\u2063',\n\tInvisibleTimes: '\\u2062',\n\tIOcy: '\\u0401',\n\tiocy: '\\u0451',\n\tIogon: '\\u012E',\n\tiogon: '\\u012F',\n\tIopf: '\\uD835\\uDD40',\n\tiopf: '\\uD835\\uDD5A',\n\tIota: '\\u0399',\n\tiota: '\\u03B9',\n\tiprod: '\\u2A3C',\n\tiquest: '\\u00BF',\n\tIscr: '\\u2110',\n\tiscr: '\\uD835\\uDCBE',\n\tisin: '\\u2208',\n\tisindot: '\\u22F5',\n\tisinE: '\\u22F9',\n\tisins: '\\u22F4',\n\tisinsv: '\\u22F3',\n\tisinv: '\\u2208',\n\tit: '\\u2062',\n\tItilde: '\\u0128',\n\titilde: '\\u0129',\n\tIukcy: '\\u0406',\n\tiukcy: '\\u0456',\n\tIuml: '\\u00CF',\n\tiuml: '\\u00EF',\n\tJcirc: '\\u0134',\n\tjcirc: '\\u0135',\n\tJcy: '\\u0419',\n\tjcy: '\\u0439',\n\tJfr: '\\uD835\\uDD0D',\n\tjfr: '\\uD835\\uDD27',\n\tjmath: '\\u0237',\n\tJopf: '\\uD835\\uDD41',\n\tjopf: '\\uD835\\uDD5B',\n\tJscr: '\\uD835\\uDCA5',\n\tjscr: '\\uD835\\uDCBF',\n\tJsercy: '\\u0408',\n\tjsercy: '\\u0458',\n\tJukcy: '\\u0404',\n\tjukcy: '\\u0454',\n\tKappa: '\\u039A',\n\tkappa: '\\u03BA',\n\tkappav: '\\u03F0',\n\tKcedil: '\\u0136',\n\tkcedil: '\\u0137',\n\tKcy: '\\u041A',\n\tkcy: '\\u043A',\n\tKfr: '\\uD835\\uDD0E',\n\tkfr: '\\uD835\\uDD28',\n\tkgreen: '\\u0138',\n\tKHcy: '\\u0425',\n\tkhcy: '\\u0445',\n\tKJcy: '\\u040C',\n\tkjcy: '\\u045C',\n\tKopf: '\\uD835\\uDD42',\n\tkopf: '\\uD835\\uDD5C',\n\tKscr: '\\uD835\\uDCA6',\n\tkscr: '\\uD835\\uDCC0',\n\tlAarr: '\\u21DA',\n\tLacute: '\\u0139',\n\tlacute: '\\u013A',\n\tlaemptyv: '\\u29B4',\n\tlagran: '\\u2112',\n\tLambda: '\\u039B',\n\tlambda: '\\u03BB',\n\tLang: '\\u27EA',\n\tlang: '\\u27E8',\n\tlangd: '\\u2991',\n\tlangle: '\\u27E8',\n\tlap: '\\u2A85',\n\tLaplacetrf: '\\u2112',\n\tlaquo: '\\u00AB',\n\tLarr: '\\u219E',\n\tlArr: '\\u21D0',\n\tlarr: '\\u2190',\n\tlarrb: '\\u21E4',\n\tlarrbfs: '\\u291F',\n\tlarrfs: '\\u291D',\n\tlarrhk: '\\u21A9',\n\tlarrlp: '\\u21AB',\n\tlarrpl: '\\u2939',\n\tlarrsim: '\\u2973',\n\tlarrtl: '\\u21A2',\n\tlat: '\\u2AAB',\n\tlAtail: '\\u291B',\n\tlatail: '\\u2919',\n\tlate: '\\u2AAD',\n\tlates: '\\u2AAD\\uFE00',\n\tlBarr: '\\u290E',\n\tlbarr: '\\u290C',\n\tlbbrk: '\\u2772',\n\tlbrace: '\\u007B',\n\tlbrack: '\\u005B',\n\tlbrke: '\\u298B',\n\tlbrksld: '\\u298F',\n\tlbrkslu: '\\u298D',\n\tLcaron: '\\u013D',\n\tlcaron: '\\u013E',\n\tLcedil: '\\u013B',\n\tlcedil: '\\u013C',\n\tlceil: '\\u2308',\n\tlcub: '\\u007B',\n\tLcy: '\\u041B',\n\tlcy: '\\u043B',\n\tldca: '\\u2936',\n\tldquo: '\\u201C',\n\tldquor: '\\u201E',\n\tldrdhar: '\\u2967',\n\tldrushar: '\\u294B',\n\tldsh: '\\u21B2',\n\tlE: '\\u2266',\n\tle: '\\u2264',\n\tLeftAngleBracket: '\\u27E8',\n\tLeftArrow: '\\u2190',\n\tLeftarrow: '\\u21D0',\n\tleftarrow: '\\u2190',\n\tLeftArrowBar: '\\u21E4',\n\tLeftArrowRightArrow: '\\u21C6',\n\tleftarrowtail: '\\u21A2',\n\tLeftCeiling: '\\u2308',\n\tLeftDoubleBracket: '\\u27E6',\n\tLeftDownTeeVector: '\\u2961',\n\tLeftDownVector: '\\u21C3',\n\tLeftDownVectorBar: '\\u2959',\n\tLeftFloor: '\\u230A',\n\tleftharpoondown: '\\u21BD',\n\tleftharpoonup: '\\u21BC',\n\tleftleftarrows: '\\u21C7',\n\tLeftRightArrow: '\\u2194',\n\tLeftrightarrow: '\\u21D4',\n\tleftrightarrow: '\\u2194',\n\tleftrightarrows: '\\u21C6',\n\tleftrightharpoons: '\\u21CB',\n\tleftrightsquigarrow: '\\u21AD',\n\tLeftRightVector: '\\u294E',\n\tLeftTee: '\\u22A3',\n\tLeftTeeArrow: '\\u21A4',\n\tLeftTeeVector: '\\u295A',\n\tleftthreetimes: '\\u22CB',\n\tLeftTriangle: '\\u22B2',\n\tLeftTriangleBar: '\\u29CF',\n\tLeftTriangleEqual: '\\u22B4',\n\tLeftUpDownVector: '\\u2951',\n\tLeftUpTeeVector: '\\u2960',\n\tLeftUpVector: '\\u21BF',\n\tLeftUpVectorBar: '\\u2958',\n\tLeftVector: '\\u21BC',\n\tLeftVectorBar: '\\u2952',\n\tlEg: '\\u2A8B',\n\tleg: '\\u22DA',\n\tleq: '\\u2264',\n\tleqq: '\\u2266',\n\tleqslant: '\\u2A7D',\n\tles: '\\u2A7D',\n\tlescc: '\\u2AA8',\n\tlesdot: '\\u2A7F',\n\tlesdoto: '\\u2A81',\n\tlesdotor: '\\u2A83',\n\tlesg: '\\u22DA\\uFE00',\n\tlesges: '\\u2A93',\n\tlessapprox: '\\u2A85',\n\tlessdot: '\\u22D6',\n\tlesseqgtr: '\\u22DA',\n\tlesseqqgtr: '\\u2A8B',\n\tLessEqualGreater: '\\u22DA',\n\tLessFullEqual: '\\u2266',\n\tLessGreater: '\\u2276',\n\tlessgtr: '\\u2276',\n\tLessLess: '\\u2AA1',\n\tlesssim: '\\u2272',\n\tLessSlantEqual: '\\u2A7D',\n\tLessTilde: '\\u2272',\n\tlfisht: '\\u297C',\n\tlfloor: '\\u230A',\n\tLfr: '\\uD835\\uDD0F',\n\tlfr: '\\uD835\\uDD29',\n\tlg: '\\u2276',\n\tlgE: '\\u2A91',\n\tlHar: '\\u2962',\n\tlhard: '\\u21BD',\n\tlharu: '\\u21BC',\n\tlharul: '\\u296A',\n\tlhblk: '\\u2584',\n\tLJcy: '\\u0409',\n\tljcy: '\\u0459',\n\tLl: '\\u22D8',\n\tll: '\\u226A',\n\tllarr: '\\u21C7',\n\tllcorner: '\\u231E',\n\tLleftarrow: '\\u21DA',\n\tllhard: '\\u296B',\n\tlltri: '\\u25FA',\n\tLmidot: '\\u013F',\n\tlmidot: '\\u0140',\n\tlmoust: '\\u23B0',\n\tlmoustache: '\\u23B0',\n\tlnap: '\\u2A89',\n\tlnapprox: '\\u2A89',\n\tlnE: '\\u2268',\n\tlne: '\\u2A87',\n\tlneq: '\\u2A87',\n\tlneqq: '\\u2268',\n\tlnsim: '\\u22E6',\n\tloang: '\\u27EC',\n\tloarr: '\\u21FD',\n\tlobrk: '\\u27E6',\n\tLongLeftArrow: '\\u27F5',\n\tLongleftarrow: '\\u27F8',\n\tlongleftarrow: '\\u27F5',\n\tLongLeftRightArrow: '\\u27F7',\n\tLongleftrightarrow: '\\u27FA',\n\tlongleftrightarrow: '\\u27F7',\n\tlongmapsto: '\\u27FC',\n\tLongRightArrow: '\\u27F6',\n\tLongrightarrow: '\\u27F9',\n\tlongrightarrow: '\\u27F6',\n\tlooparrowleft: '\\u21AB',\n\tlooparrowright: '\\u21AC',\n\tlopar: '\\u2985',\n\tLopf: '\\uD835\\uDD43',\n\tlopf: '\\uD835\\uDD5D',\n\tloplus: '\\u2A2D',\n\tlotimes: '\\u2A34',\n\tlowast: '\\u2217',\n\tlowbar: '\\u005F',\n\tLowerLeftArrow: '\\u2199',\n\tLowerRightArrow: '\\u2198',\n\tloz: '\\u25CA',\n\tlozenge: '\\u25CA',\n\tlozf: '\\u29EB',\n\tlpar: '\\u0028',\n\tlparlt: '\\u2993',\n\tlrarr: '\\u21C6',\n\tlrcorner: '\\u231F',\n\tlrhar: '\\u21CB',\n\tlrhard: '\\u296D',\n\tlrm: '\\u200E',\n\tlrtri: '\\u22BF',\n\tlsaquo: '\\u2039',\n\tLscr: '\\u2112',\n\tlscr: '\\uD835\\uDCC1',\n\tLsh: '\\u21B0',\n\tlsh: '\\u21B0',\n\tlsim: '\\u2272',\n\tlsime: '\\u2A8D',\n\tlsimg: '\\u2A8F',\n\tlsqb: '\\u005B',\n\tlsquo: '\\u2018',\n\tlsquor: '\\u201A',\n\tLstrok: '\\u0141',\n\tlstrok: '\\u0142',\n\tLt: '\\u226A',\n\tLT: '\\u003C',\n\tlt: '\\u003C',\n\tltcc: '\\u2AA6',\n\tltcir: '\\u2A79',\n\tltdot: '\\u22D6',\n\tlthree: '\\u22CB',\n\tltimes: '\\u22C9',\n\tltlarr: '\\u2976',\n\tltquest: '\\u2A7B',\n\tltri: '\\u25C3',\n\tltrie: '\\u22B4',\n\tltrif: '\\u25C2',\n\tltrPar: '\\u2996',\n\tlurdshar: '\\u294A',\n\tluruhar: '\\u2966',\n\tlvertneqq: '\\u2268\\uFE00',\n\tlvnE: '\\u2268\\uFE00',\n\tmacr: '\\u00AF',\n\tmale: '\\u2642',\n\tmalt: '\\u2720',\n\tmaltese: '\\u2720',\n\tMap: '\\u2905',\n\tmap: '\\u21A6',\n\tmapsto: '\\u21A6',\n\tmapstodown: '\\u21A7',\n\tmapstoleft: '\\u21A4',\n\tmapstoup: '\\u21A5',\n\tmarker: '\\u25AE',\n\tmcomma: '\\u2A29',\n\tMcy: '\\u041C',\n\tmcy: '\\u043C',\n\tmdash: '\\u2014',\n\tmDDot: '\\u223A',\n\tmeasuredangle: '\\u2221',\n\tMediumSpace: '\\u205F',\n\tMellintrf: '\\u2133',\n\tMfr: '\\uD835\\uDD10',\n\tmfr: '\\uD835\\uDD2A',\n\tmho: '\\u2127',\n\tmicro: '\\u00B5',\n\tmid: '\\u2223',\n\tmidast: '\\u002A',\n\tmidcir: '\\u2AF0',\n\tmiddot: '\\u00B7',\n\tminus: '\\u2212',\n\tminusb: '\\u229F',\n\tminusd: '\\u2238',\n\tminusdu: '\\u2A2A',\n\tMinusPlus: '\\u2213',\n\tmlcp: '\\u2ADB',\n\tmldr: '\\u2026',\n\tmnplus: '\\u2213',\n\tmodels: '\\u22A7',\n\tMopf: '\\uD835\\uDD44',\n\tmopf: '\\uD835\\uDD5E',\n\tmp: '\\u2213',\n\tMscr: '\\u2133',\n\tmscr: '\\uD835\\uDCC2',\n\tmstpos: '\\u223E',\n\tMu: '\\u039C',\n\tmu: '\\u03BC',\n\tmultimap: '\\u22B8',\n\tmumap: '\\u22B8',\n\tnabla: '\\u2207',\n\tNacute: '\\u0143',\n\tnacute: '\\u0144',\n\tnang: '\\u2220\\u20D2',\n\tnap: '\\u2249',\n\tnapE: '\\u2A70\\u0338',\n\tnapid: '\\u224B\\u0338',\n\tnapos: '\\u0149',\n\tnapprox: '\\u2249',\n\tnatur: '\\u266E',\n\tnatural: '\\u266E',\n\tnaturals: '\\u2115',\n\tnbsp: '\\u00A0',\n\tnbump: '\\u224E\\u0338',\n\tnbumpe: '\\u224F\\u0338',\n\tncap: '\\u2A43',\n\tNcaron: '\\u0147',\n\tncaron: '\\u0148',\n\tNcedil: '\\u0145',\n\tncedil: '\\u0146',\n\tncong: '\\u2247',\n\tncongdot: '\\u2A6D\\u0338',\n\tncup: '\\u2A42',\n\tNcy: '\\u041D',\n\tncy: '\\u043D',\n\tndash: '\\u2013',\n\tne: '\\u2260',\n\tnearhk: '\\u2924',\n\tneArr: '\\u21D7',\n\tnearr: '\\u2197',\n\tnearrow: '\\u2197',\n\tnedot: '\\u2250\\u0338',\n\tNegativeMediumSpace: '\\u200B',\n\tNegativeThickSpace: '\\u200B',\n\tNegativeThinSpace: '\\u200B',\n\tNegativeVeryThinSpace: '\\u200B',\n\tnequiv: '\\u2262',\n\tnesear: '\\u2928',\n\tnesim: '\\u2242\\u0338',\n\tNestedGreaterGreater: '\\u226B',\n\tNestedLessLess: '\\u226A',\n\tNewLine: '\\u000A',\n\tnexist: '\\u2204',\n\tnexists: '\\u2204',\n\tNfr: '\\uD835\\uDD11',\n\tnfr: '\\uD835\\uDD2B',\n\tngE: '\\u2267\\u0338',\n\tnge: '\\u2271',\n\tngeq: '\\u2271',\n\tngeqq: '\\u2267\\u0338',\n\tngeqslant: '\\u2A7E\\u0338',\n\tnges: '\\u2A7E\\u0338',\n\tnGg: '\\u22D9\\u0338',\n\tngsim: '\\u2275',\n\tnGt: '\\u226B\\u20D2',\n\tngt: '\\u226F',\n\tngtr: '\\u226F',\n\tnGtv: '\\u226B\\u0338',\n\tnhArr: '\\u21CE',\n\tnharr: '\\u21AE',\n\tnhpar: '\\u2AF2',\n\tni: '\\u220B',\n\tnis: '\\u22FC',\n\tnisd: '\\u22FA',\n\tniv: '\\u220B',\n\tNJcy: '\\u040A',\n\tnjcy: '\\u045A',\n\tnlArr: '\\u21CD',\n\tnlarr: '\\u219A',\n\tnldr: '\\u2025',\n\tnlE: '\\u2266\\u0338',\n\tnle: '\\u2270',\n\tnLeftarrow: '\\u21CD',\n\tnleftarrow: '\\u219A',\n\tnLeftrightarrow: '\\u21CE',\n\tnleftrightarrow: '\\u21AE',\n\tnleq: '\\u2270',\n\tnleqq: '\\u2266\\u0338',\n\tnleqslant: '\\u2A7D\\u0338',\n\tnles: '\\u2A7D\\u0338',\n\tnless: '\\u226E',\n\tnLl: '\\u22D8\\u0338',\n\tnlsim: '\\u2274',\n\tnLt: '\\u226A\\u20D2',\n\tnlt: '\\u226E',\n\tnltri: '\\u22EA',\n\tnltrie: '\\u22EC',\n\tnLtv: '\\u226A\\u0338',\n\tnmid: '\\u2224',\n\tNoBreak: '\\u2060',\n\tNonBreakingSpace: '\\u00A0',\n\tNopf: '\\u2115',\n\tnopf: '\\uD835\\uDD5F',\n\tNot: '\\u2AEC',\n\tnot: '\\u00AC',\n\tNotCongruent: '\\u2262',\n\tNotCupCap: '\\u226D',\n\tNotDoubleVerticalBar: '\\u2226',\n\tNotElement: '\\u2209',\n\tNotEqual: '\\u2260',\n\tNotEqualTilde: '\\u2242\\u0338',\n\tNotExists: '\\u2204',\n\tNotGreater: '\\u226F',\n\tNotGreaterEqual: '\\u2271',\n\tNotGreaterFullEqual: '\\u2267\\u0338',\n\tNotGreaterGreater: '\\u226B\\u0338',\n\tNotGreaterLess: '\\u2279',\n\tNotGreaterSlantEqual: '\\u2A7E\\u0338',\n\tNotGreaterTilde: '\\u2275',\n\tNotHumpDownHump: '\\u224E\\u0338',\n\tNotHumpEqual: '\\u224F\\u0338',\n\tnotin: '\\u2209',\n\tnotindot: '\\u22F5\\u0338',\n\tnotinE: '\\u22F9\\u0338',\n\tnotinva: '\\u2209',\n\tnotinvb: '\\u22F7',\n\tnotinvc: '\\u22F6',\n\tNotLeftTriangle: '\\u22EA',\n\tNotLeftTriangleBar: '\\u29CF\\u0338',\n\tNotLeftTriangleEqual: '\\u22EC',\n\tNotLess: '\\u226E',\n\tNotLessEqual: '\\u2270',\n\tNotLessGreater: '\\u2278',\n\tNotLessLess: '\\u226A\\u0338',\n\tNotLessSlantEqual: '\\u2A7D\\u0338',\n\tNotLessTilde: '\\u2274',\n\tNotNestedGreaterGreater: '\\u2AA2\\u0338',\n\tNotNestedLessLess: '\\u2AA1\\u0338',\n\tnotni: '\\u220C',\n\tnotniva: '\\u220C',\n\tnotnivb: '\\u22FE',\n\tnotnivc: '\\u22FD',\n\tNotPrecedes: '\\u2280',\n\tNotPrecedesEqual: '\\u2AAF\\u0338',\n\tNotPrecedesSlantEqual: '\\u22E0',\n\tNotReverseElement: '\\u220C',\n\tNotRightTriangle: '\\u22EB',\n\tNotRightTriangleBar: '\\u29D0\\u0338',\n\tNotRightTriangleEqual: '\\u22ED',\n\tNotSquareSubset: '\\u228F\\u0338',\n\tNotSquareSubsetEqual: '\\u22E2',\n\tNotSquareSuperset: '\\u2290\\u0338',\n\tNotSquareSupersetEqual: '\\u22E3',\n\tNotSubset: '\\u2282\\u20D2',\n\tNotSubsetEqual: '\\u2288',\n\tNotSucceeds: '\\u2281',\n\tNotSucceedsEqual: '\\u2AB0\\u0338',\n\tNotSucceedsSlantEqual: '\\u22E1',\n\tNotSucceedsTilde: '\\u227F\\u0338',\n\tNotSuperset: '\\u2283\\u20D2',\n\tNotSupersetEqual: '\\u2289',\n\tNotTilde: '\\u2241',\n\tNotTildeEqual: '\\u2244',\n\tNotTildeFullEqual: '\\u2247',\n\tNotTildeTilde: '\\u2249',\n\tNotVerticalBar: '\\u2224',\n\tnpar: '\\u2226',\n\tnparallel: '\\u2226',\n\tnparsl: '\\u2AFD\\u20E5',\n\tnpart: '\\u2202\\u0338',\n\tnpolint: '\\u2A14',\n\tnpr: '\\u2280',\n\tnprcue: '\\u22E0',\n\tnpre: '\\u2AAF\\u0338',\n\tnprec: '\\u2280',\n\tnpreceq: '\\u2AAF\\u0338',\n\tnrArr: '\\u21CF',\n\tnrarr: '\\u219B',\n\tnrarrc: '\\u2933\\u0338',\n\tnrarrw: '\\u219D\\u0338',\n\tnRightarrow: '\\u21CF',\n\tnrightarrow: '\\u219B',\n\tnrtri: '\\u22EB',\n\tnrtrie: '\\u22ED',\n\tnsc: '\\u2281',\n\tnsccue: '\\u22E1',\n\tnsce: '\\u2AB0\\u0338',\n\tNscr: '\\uD835\\uDCA9',\n\tnscr: '\\uD835\\uDCC3',\n\tnshortmid: '\\u2224',\n\tnshortparallel: '\\u2226',\n\tnsim: '\\u2241',\n\tnsime: '\\u2244',\n\tnsimeq: '\\u2244',\n\tnsmid: '\\u2224',\n\tnspar: '\\u2226',\n\tnsqsube: '\\u22E2',\n\tnsqsupe: '\\u22E3',\n\tnsub: '\\u2284',\n\tnsubE: '\\u2AC5\\u0338',\n\tnsube: '\\u2288',\n\tnsubset: '\\u2282\\u20D2',\n\tnsubseteq: '\\u2288',\n\tnsubseteqq: '\\u2AC5\\u0338',\n\tnsucc: '\\u2281',\n\tnsucceq: '\\u2AB0\\u0338',\n\tnsup: '\\u2285',\n\tnsupE: '\\u2AC6\\u0338',\n\tnsupe: '\\u2289',\n\tnsupset: '\\u2283\\u20D2',\n\tnsupseteq: '\\u2289',\n\tnsupseteqq: '\\u2AC6\\u0338',\n\tntgl: '\\u2279',\n\tNtilde: '\\u00D1',\n\tntilde: '\\u00F1',\n\tntlg: '\\u2278',\n\tntriangleleft: '\\u22EA',\n\tntrianglelefteq: '\\u22EC',\n\tntriangleright: '\\u22EB',\n\tntrianglerighteq: '\\u22ED',\n\tNu: '\\u039D',\n\tnu: '\\u03BD',\n\tnum: '\\u0023',\n\tnumero: '\\u2116',\n\tnumsp: '\\u2007',\n\tnvap: '\\u224D\\u20D2',\n\tnVDash: '\\u22AF',\n\tnVdash: '\\u22AE',\n\tnvDash: '\\u22AD',\n\tnvdash: '\\u22AC',\n\tnvge: '\\u2265\\u20D2',\n\tnvgt: '\\u003E\\u20D2',\n\tnvHarr: '\\u2904',\n\tnvinfin: '\\u29DE',\n\tnvlArr: '\\u2902',\n\tnvle: '\\u2264\\u20D2',\n\tnvlt: '\\u003C\\u20D2',\n\tnvltrie: '\\u22B4\\u20D2',\n\tnvrArr: '\\u2903',\n\tnvrtrie: '\\u22B5\\u20D2',\n\tnvsim: '\\u223C\\u20D2',\n\tnwarhk: '\\u2923',\n\tnwArr: '\\u21D6',\n\tnwarr: '\\u2196',\n\tnwarrow: '\\u2196',\n\tnwnear: '\\u2927',\n\tOacute: '\\u00D3',\n\toacute: '\\u00F3',\n\toast: '\\u229B',\n\tocir: '\\u229A',\n\tOcirc: '\\u00D4',\n\tocirc: '\\u00F4',\n\tOcy: '\\u041E',\n\tocy: '\\u043E',\n\todash: '\\u229D',\n\tOdblac: '\\u0150',\n\todblac: '\\u0151',\n\todiv: '\\u2A38',\n\todot: '\\u2299',\n\todsold: '\\u29BC',\n\tOElig: '\\u0152',\n\toelig: '\\u0153',\n\tofcir: '\\u29BF',\n\tOfr: '\\uD835\\uDD12',\n\tofr: '\\uD835\\uDD2C',\n\togon: '\\u02DB',\n\tOgrave: '\\u00D2',\n\tograve: '\\u00F2',\n\togt: '\\u29C1',\n\tohbar: '\\u29B5',\n\tohm: '\\u03A9',\n\toint: '\\u222E',\n\tolarr: '\\u21BA',\n\tolcir: '\\u29BE',\n\tolcross: '\\u29BB',\n\toline: '\\u203E',\n\tolt: '\\u29C0',\n\tOmacr: '\\u014C',\n\tomacr: '\\u014D',\n\tOmega: '\\u03A9',\n\tomega: '\\u03C9',\n\tOmicron: '\\u039F',\n\tomicron: '\\u03BF',\n\tomid: '\\u29B6',\n\tominus: '\\u2296',\n\tOopf: '\\uD835\\uDD46',\n\toopf: '\\uD835\\uDD60',\n\topar: '\\u29B7',\n\tOpenCurlyDoubleQuote: '\\u201C',\n\tOpenCurlyQuote: '\\u2018',\n\toperp: '\\u29B9',\n\toplus: '\\u2295',\n\tOr: '\\u2A54',\n\tor: '\\u2228',\n\torarr: '\\u21BB',\n\tord: '\\u2A5D',\n\torder: '\\u2134',\n\torderof: '\\u2134',\n\tordf: '\\u00AA',\n\tordm: '\\u00BA',\n\torigof: '\\u22B6',\n\toror: '\\u2A56',\n\torslope: '\\u2A57',\n\torv: '\\u2A5B',\n\toS: '\\u24C8',\n\tOscr: '\\uD835\\uDCAA',\n\toscr: '\\u2134',\n\tOslash: '\\u00D8',\n\toslash: '\\u00F8',\n\tosol: '\\u2298',\n\tOtilde: '\\u00D5',\n\totilde: '\\u00F5',\n\tOtimes: '\\u2A37',\n\totimes: '\\u2297',\n\totimesas: '\\u2A36',\n\tOuml: '\\u00D6',\n\touml: '\\u00F6',\n\tovbar: '\\u233D',\n\tOverBar: '\\u203E',\n\tOverBrace: '\\u23DE',\n\tOverBracket: '\\u23B4',\n\tOverParenthesis: '\\u23DC',\n\tpar: '\\u2225',\n\tpara: '\\u00B6',\n\tparallel: '\\u2225',\n\tparsim: '\\u2AF3',\n\tparsl: '\\u2AFD',\n\tpart: '\\u2202',\n\tPartialD: '\\u2202',\n\tPcy: '\\u041F',\n\tpcy: '\\u043F',\n\tpercnt: '\\u0025',\n\tperiod: '\\u002E',\n\tpermil: '\\u2030',\n\tperp: '\\u22A5',\n\tpertenk: '\\u2031',\n\tPfr: '\\uD835\\uDD13',\n\tpfr: '\\uD835\\uDD2D',\n\tPhi: '\\u03A6',\n\tphi: '\\u03C6',\n\tphiv: '\\u03D5',\n\tphmmat: '\\u2133',\n\tphone: '\\u260E',\n\tPi: '\\u03A0',\n\tpi: '\\u03C0',\n\tpitchfork: '\\u22D4',\n\tpiv: '\\u03D6',\n\tplanck: '\\u210F',\n\tplanckh: '\\u210E',\n\tplankv: '\\u210F',\n\tplus: '\\u002B',\n\tplusacir: '\\u2A23',\n\tplusb: '\\u229E',\n\tpluscir: '\\u2A22',\n\tplusdo: '\\u2214',\n\tplusdu: '\\u2A25',\n\tpluse: '\\u2A72',\n\tPlusMinus: '\\u00B1',\n\tplusmn: '\\u00B1',\n\tplussim: '\\u2A26',\n\tplustwo: '\\u2A27',\n\tpm: '\\u00B1',\n\tPoincareplane: '\\u210C',\n\tpointint: '\\u2A15',\n\tPopf: '\\u2119',\n\tpopf: '\\uD835\\uDD61',\n\tpound: '\\u00A3',\n\tPr: '\\u2ABB',\n\tpr: '\\u227A',\n\tprap: '\\u2AB7',\n\tprcue: '\\u227C',\n\tprE: '\\u2AB3',\n\tpre: '\\u2AAF',\n\tprec: '\\u227A',\n\tprecapprox: '\\u2AB7',\n\tpreccurlyeq: '\\u227C',\n\tPrecedes: '\\u227A',\n\tPrecedesEqual: '\\u2AAF',\n\tPrecedesSlantEqual: '\\u227C',\n\tPrecedesTilde: '\\u227E',\n\tpreceq: '\\u2AAF',\n\tprecnapprox: '\\u2AB9',\n\tprecneqq: '\\u2AB5',\n\tprecnsim: '\\u22E8',\n\tprecsim: '\\u227E',\n\tPrime: '\\u2033',\n\tprime: '\\u2032',\n\tprimes: '\\u2119',\n\tprnap: '\\u2AB9',\n\tprnE: '\\u2AB5',\n\tprnsim: '\\u22E8',\n\tprod: '\\u220F',\n\tProduct: '\\u220F',\n\tprofalar: '\\u232E',\n\tprofline: '\\u2312',\n\tprofsurf: '\\u2313',\n\tprop: '\\u221D',\n\tProportion: '\\u2237',\n\tProportional: '\\u221D',\n\tpropto: '\\u221D',\n\tprsim: '\\u227E',\n\tprurel: '\\u22B0',\n\tPscr: '\\uD835\\uDCAB',\n\tpscr: '\\uD835\\uDCC5',\n\tPsi: '\\u03A8',\n\tpsi: '\\u03C8',\n\tpuncsp: '\\u2008',\n\tQfr: '\\uD835\\uDD14',\n\tqfr: '\\uD835\\uDD2E',\n\tqint: '\\u2A0C',\n\tQopf: '\\u211A',\n\tqopf: '\\uD835\\uDD62',\n\tqprime: '\\u2057',\n\tQscr: '\\uD835\\uDCAC',\n\tqscr: '\\uD835\\uDCC6',\n\tquaternions: '\\u210D',\n\tquatint: '\\u2A16',\n\tquest: '\\u003F',\n\tquesteq: '\\u225F',\n\tQUOT: '\\u0022',\n\tquot: '\\u0022',\n\trAarr: '\\u21DB',\n\trace: '\\u223D\\u0331',\n\tRacute: '\\u0154',\n\tracute: '\\u0155',\n\tradic: '\\u221A',\n\traemptyv: '\\u29B3',\n\tRang: '\\u27EB',\n\trang: '\\u27E9',\n\trangd: '\\u2992',\n\trange: '\\u29A5',\n\trangle: '\\u27E9',\n\traquo: '\\u00BB',\n\tRarr: '\\u21A0',\n\trArr: '\\u21D2',\n\trarr: '\\u2192',\n\trarrap: '\\u2975',\n\trarrb: '\\u21E5',\n\trarrbfs: '\\u2920',\n\trarrc: '\\u2933',\n\trarrfs: '\\u291E',\n\trarrhk: '\\u21AA',\n\trarrlp: '\\u21AC',\n\trarrpl: '\\u2945',\n\trarrsim: '\\u2974',\n\tRarrtl: '\\u2916',\n\trarrtl: '\\u21A3',\n\trarrw: '\\u219D',\n\trAtail: '\\u291C',\n\tratail: '\\u291A',\n\tratio: '\\u2236',\n\trationals: '\\u211A',\n\tRBarr: '\\u2910',\n\trBarr: '\\u290F',\n\trbarr: '\\u290D',\n\trbbrk: '\\u2773',\n\trbrace: '\\u007D',\n\trbrack: '\\u005D',\n\trbrke: '\\u298C',\n\trbrksld: '\\u298E',\n\trbrkslu: '\\u2990',\n\tRcaron: '\\u0158',\n\trcaron: '\\u0159',\n\tRcedil: '\\u0156',\n\trcedil: '\\u0157',\n\trceil: '\\u2309',\n\trcub: '\\u007D',\n\tRcy: '\\u0420',\n\trcy: '\\u0440',\n\trdca: '\\u2937',\n\trdldhar: '\\u2969',\n\trdquo: '\\u201D',\n\trdquor: '\\u201D',\n\trdsh: '\\u21B3',\n\tRe: '\\u211C',\n\treal: '\\u211C',\n\trealine: '\\u211B',\n\trealpart: '\\u211C',\n\treals: '\\u211D',\n\trect: '\\u25AD',\n\tREG: '\\u00AE',\n\treg: '\\u00AE',\n\tReverseElement: '\\u220B',\n\tReverseEquilibrium: '\\u21CB',\n\tReverseUpEquilibrium: '\\u296F',\n\trfisht: '\\u297D',\n\trfloor: '\\u230B',\n\tRfr: '\\u211C',\n\trfr: '\\uD835\\uDD2F',\n\trHar: '\\u2964',\n\trhard: '\\u21C1',\n\trharu: '\\u21C0',\n\trharul: '\\u296C',\n\tRho: '\\u03A1',\n\trho: '\\u03C1',\n\trhov: '\\u03F1',\n\tRightAngleBracket: '\\u27E9',\n\tRightArrow: '\\u2192',\n\tRightarrow: '\\u21D2',\n\trightarrow: '\\u2192',\n\tRightArrowBar: '\\u21E5',\n\tRightArrowLeftArrow: '\\u21C4',\n\trightarrowtail: '\\u21A3',\n\tRightCeiling: '\\u2309',\n\tRightDoubleBracket: '\\u27E7',\n\tRightDownTeeVector: '\\u295D',\n\tRightDownVector: '\\u21C2',\n\tRightDownVectorBar: '\\u2955',\n\tRightFloor: '\\u230B',\n\trightharpoondown: '\\u21C1',\n\trightharpoonup: '\\u21C0',\n\trightleftarrows: '\\u21C4',\n\trightleftharpoons: '\\u21CC',\n\trightrightarrows: '\\u21C9',\n\trightsquigarrow: '\\u219D',\n\tRightTee: '\\u22A2',\n\tRightTeeArrow: '\\u21A6',\n\tRightTeeVector: '\\u295B',\n\trightthreetimes: '\\u22CC',\n\tRightTriangle: '\\u22B3',\n\tRightTriangleBar: '\\u29D0',\n\tRightTriangleEqual: '\\u22B5',\n\tRightUpDownVector: '\\u294F',\n\tRightUpTeeVector: '\\u295C',\n\tRightUpVector: '\\u21BE',\n\tRightUpVectorBar: '\\u2954',\n\tRightVector: '\\u21C0',\n\tRightVectorBar: '\\u2953',\n\tring: '\\u02DA',\n\trisingdotseq: '\\u2253',\n\trlarr: '\\u21C4',\n\trlhar: '\\u21CC',\n\trlm: '\\u200F',\n\trmoust: '\\u23B1',\n\trmoustache: '\\u23B1',\n\trnmid: '\\u2AEE',\n\troang: '\\u27ED',\n\troarr: '\\u21FE',\n\trobrk: '\\u27E7',\n\tropar: '\\u2986',\n\tRopf: '\\u211D',\n\tropf: '\\uD835\\uDD63',\n\troplus: '\\u2A2E',\n\trotimes: '\\u2A35',\n\tRoundImplies: '\\u2970',\n\trpar: '\\u0029',\n\trpargt: '\\u2994',\n\trppolint: '\\u2A12',\n\trrarr: '\\u21C9',\n\tRrightarrow: '\\u21DB',\n\trsaquo: '\\u203A',\n\tRscr: '\\u211B',\n\trscr: '\\uD835\\uDCC7',\n\tRsh: '\\u21B1',\n\trsh: '\\u21B1',\n\trsqb: '\\u005D',\n\trsquo: '\\u2019',\n\trsquor: '\\u2019',\n\trthree: '\\u22CC',\n\trtimes: '\\u22CA',\n\trtri: '\\u25B9',\n\trtrie: '\\u22B5',\n\trtrif: '\\u25B8',\n\trtriltri: '\\u29CE',\n\tRuleDelayed: '\\u29F4',\n\truluhar: '\\u2968',\n\trx: '\\u211E',\n\tSacute: '\\u015A',\n\tsacute: '\\u015B',\n\tsbquo: '\\u201A',\n\tSc: '\\u2ABC',\n\tsc: '\\u227B',\n\tscap: '\\u2AB8',\n\tScaron: '\\u0160',\n\tscaron: '\\u0161',\n\tsccue: '\\u227D',\n\tscE: '\\u2AB4',\n\tsce: '\\u2AB0',\n\tScedil: '\\u015E',\n\tscedil: '\\u015F',\n\tScirc: '\\u015C',\n\tscirc: '\\u015D',\n\tscnap: '\\u2ABA',\n\tscnE: '\\u2AB6',\n\tscnsim: '\\u22E9',\n\tscpolint: '\\u2A13',\n\tscsim: '\\u227F',\n\tScy: '\\u0421',\n\tscy: '\\u0441',\n\tsdot: '\\u22C5',\n\tsdotb: '\\u22A1',\n\tsdote: '\\u2A66',\n\tsearhk: '\\u2925',\n\tseArr: '\\u21D8',\n\tsearr: '\\u2198',\n\tsearrow: '\\u2198',\n\tsect: '\\u00A7',\n\tsemi: '\\u003B',\n\tseswar: '\\u2929',\n\tsetminus: '\\u2216',\n\tsetmn: '\\u2216',\n\tsext: '\\u2736',\n\tSfr: '\\uD835\\uDD16',\n\tsfr: '\\uD835\\uDD30',\n\tsfrown: '\\u2322',\n\tsharp: '\\u266F',\n\tSHCHcy: '\\u0429',\n\tshchcy: '\\u0449',\n\tSHcy: '\\u0428',\n\tshcy: '\\u0448',\n\tShortDownArrow: '\\u2193',\n\tShortLeftArrow: '\\u2190',\n\tshortmid: '\\u2223',\n\tshortparallel: '\\u2225',\n\tShortRightArrow: '\\u2192',\n\tShortUpArrow: '\\u2191',\n\tshy: '\\u00AD',\n\tSigma: '\\u03A3',\n\tsigma: '\\u03C3',\n\tsigmaf: '\\u03C2',\n\tsigmav: '\\u03C2',\n\tsim: '\\u223C',\n\tsimdot: '\\u2A6A',\n\tsime: '\\u2243',\n\tsimeq: '\\u2243',\n\tsimg: '\\u2A9E',\n\tsimgE: '\\u2AA0',\n\tsiml: '\\u2A9D',\n\tsimlE: '\\u2A9F',\n\tsimne: '\\u2246',\n\tsimplus: '\\u2A24',\n\tsimrarr: '\\u2972',\n\tslarr: '\\u2190',\n\tSmallCircle: '\\u2218',\n\tsmallsetminus: '\\u2216',\n\tsmashp: '\\u2A33',\n\tsmeparsl: '\\u29E4',\n\tsmid: '\\u2223',\n\tsmile: '\\u2323',\n\tsmt: '\\u2AAA',\n\tsmte: '\\u2AAC',\n\tsmtes: '\\u2AAC\\uFE00',\n\tSOFTcy: '\\u042C',\n\tsoftcy: '\\u044C',\n\tsol: '\\u002F',\n\tsolb: '\\u29C4',\n\tsolbar: '\\u233F',\n\tSopf: '\\uD835\\uDD4A',\n\tsopf: '\\uD835\\uDD64',\n\tspades: '\\u2660',\n\tspadesuit: '\\u2660',\n\tspar: '\\u2225',\n\tsqcap: '\\u2293',\n\tsqcaps: '\\u2293\\uFE00',\n\tsqcup: '\\u2294',\n\tsqcups: '\\u2294\\uFE00',\n\tSqrt: '\\u221A',\n\tsqsub: '\\u228F',\n\tsqsube: '\\u2291',\n\tsqsubset: '\\u228F',\n\tsqsubseteq: '\\u2291',\n\tsqsup: '\\u2290',\n\tsqsupe: '\\u2292',\n\tsqsupset: '\\u2290',\n\tsqsupseteq: '\\u2292',\n\tsqu: '\\u25A1',\n\tSquare: '\\u25A1',\n\tsquare: '\\u25A1',\n\tSquareIntersection: '\\u2293',\n\tSquareSubset: '\\u228F',\n\tSquareSubsetEqual: '\\u2291',\n\tSquareSuperset: '\\u2290',\n\tSquareSupersetEqual: '\\u2292',\n\tSquareUnion: '\\u2294',\n\tsquarf: '\\u25AA',\n\tsquf: '\\u25AA',\n\tsrarr: '\\u2192',\n\tSscr: '\\uD835\\uDCAE',\n\tsscr: '\\uD835\\uDCC8',\n\tssetmn: '\\u2216',\n\tssmile: '\\u2323',\n\tsstarf: '\\u22C6',\n\tStar: '\\u22C6',\n\tstar: '\\u2606',\n\tstarf: '\\u2605',\n\tstraightepsilon: '\\u03F5',\n\tstraightphi: '\\u03D5',\n\tstrns: '\\u00AF',\n\tSub: '\\u22D0',\n\tsub: '\\u2282',\n\tsubdot: '\\u2ABD',\n\tsubE: '\\u2AC5',\n\tsube: '\\u2286',\n\tsubedot: '\\u2AC3',\n\tsubmult: '\\u2AC1',\n\tsubnE: '\\u2ACB',\n\tsubne: '\\u228A',\n\tsubplus: '\\u2ABF',\n\tsubrarr: '\\u2979',\n\tSubset: '\\u22D0',\n\tsubset: '\\u2282',\n\tsubseteq: '\\u2286',\n\tsubseteqq: '\\u2AC5',\n\tSubsetEqual: '\\u2286',\n\tsubsetneq: '\\u228A',\n\tsubsetneqq: '\\u2ACB',\n\tsubsim: '\\u2AC7',\n\tsubsub: '\\u2AD5',\n\tsubsup: '\\u2AD3',\n\tsucc: '\\u227B',\n\tsuccapprox: '\\u2AB8',\n\tsucccurlyeq: '\\u227D',\n\tSucceeds: '\\u227B',\n\tSucceedsEqual: '\\u2AB0',\n\tSucceedsSlantEqual: '\\u227D',\n\tSucceedsTilde: '\\u227F',\n\tsucceq: '\\u2AB0',\n\tsuccnapprox: '\\u2ABA',\n\tsuccneqq: '\\u2AB6',\n\tsuccnsim: '\\u22E9',\n\tsuccsim: '\\u227F',\n\tSuchThat: '\\u220B',\n\tSum: '\\u2211',\n\tsum: '\\u2211',\n\tsung: '\\u266A',\n\tSup: '\\u22D1',\n\tsup: '\\u2283',\n\tsup1: '\\u00B9',\n\tsup2: '\\u00B2',\n\tsup3: '\\u00B3',\n\tsupdot: '\\u2ABE',\n\tsupdsub: '\\u2AD8',\n\tsupE: '\\u2AC6',\n\tsupe: '\\u2287',\n\tsupedot: '\\u2AC4',\n\tSuperset: '\\u2283',\n\tSupersetEqual: '\\u2287',\n\tsuphsol: '\\u27C9',\n\tsuphsub: '\\u2AD7',\n\tsuplarr: '\\u297B',\n\tsupmult: '\\u2AC2',\n\tsupnE: '\\u2ACC',\n\tsupne: '\\u228B',\n\tsupplus: '\\u2AC0',\n\tSupset: '\\u22D1',\n\tsupset: '\\u2283',\n\tsupseteq: '\\u2287',\n\tsupseteqq: '\\u2AC6',\n\tsupsetneq: '\\u228B',\n\tsupsetneqq: '\\u2ACC',\n\tsupsim: '\\u2AC8',\n\tsupsub: '\\u2AD4',\n\tsupsup: '\\u2AD6',\n\tswarhk: '\\u2926',\n\tswArr: '\\u21D9',\n\tswarr: '\\u2199',\n\tswarrow: '\\u2199',\n\tswnwar: '\\u292A',\n\tszlig: '\\u00DF',\n\tTab: '\\u0009',\n\ttarget: '\\u2316',\n\tTau: '\\u03A4',\n\ttau: '\\u03C4',\n\ttbrk: '\\u23B4',\n\tTcaron: '\\u0164',\n\ttcaron: '\\u0165',\n\tTcedil: '\\u0162',\n\ttcedil: '\\u0163',\n\tTcy: '\\u0422',\n\ttcy: '\\u0442',\n\ttdot: '\\u20DB',\n\ttelrec: '\\u2315',\n\tTfr: '\\uD835\\uDD17',\n\ttfr: '\\uD835\\uDD31',\n\tthere4: '\\u2234',\n\tTherefore: '\\u2234',\n\ttherefore: '\\u2234',\n\tTheta: '\\u0398',\n\ttheta: '\\u03B8',\n\tthetasym: '\\u03D1',\n\tthetav: '\\u03D1',\n\tthickapprox: '\\u2248',\n\tthicksim: '\\u223C',\n\tThickSpace: '\\u205F\\u200A',\n\tthinsp: '\\u2009',\n\tThinSpace: '\\u2009',\n\tthkap: '\\u2248',\n\tthksim: '\\u223C',\n\tTHORN: '\\u00DE',\n\tthorn: '\\u00FE',\n\tTilde: '\\u223C',\n\ttilde: '\\u02DC',\n\tTildeEqual: '\\u2243',\n\tTildeFullEqual: '\\u2245',\n\tTildeTilde: '\\u2248',\n\ttimes: '\\u00D7',\n\ttimesb: '\\u22A0',\n\ttimesbar: '\\u2A31',\n\ttimesd: '\\u2A30',\n\ttint: '\\u222D',\n\ttoea: '\\u2928',\n\ttop: '\\u22A4',\n\ttopbot: '\\u2336',\n\ttopcir: '\\u2AF1',\n\tTopf: '\\uD835\\uDD4B',\n\ttopf: '\\uD835\\uDD65',\n\ttopfork: '\\u2ADA',\n\ttosa: '\\u2929',\n\ttprime: '\\u2034',\n\tTRADE: '\\u2122',\n\ttrade: '\\u2122',\n\ttriangle: '\\u25B5',\n\ttriangledown: '\\u25BF',\n\ttriangleleft: '\\u25C3',\n\ttrianglelefteq: '\\u22B4',\n\ttriangleq: '\\u225C',\n\ttriangleright: '\\u25B9',\n\ttrianglerighteq: '\\u22B5',\n\ttridot: '\\u25EC',\n\ttrie: '\\u225C',\n\ttriminus: '\\u2A3A',\n\tTripleDot: '\\u20DB',\n\ttriplus: '\\u2A39',\n\ttrisb: '\\u29CD',\n\ttritime: '\\u2A3B',\n\ttrpezium: '\\u23E2',\n\tTscr: '\\uD835\\uDCAF',\n\ttscr: '\\uD835\\uDCC9',\n\tTScy: '\\u0426',\n\ttscy: '\\u0446',\n\tTSHcy: '\\u040B',\n\ttshcy: '\\u045B',\n\tTstrok: '\\u0166',\n\ttstrok: '\\u0167',\n\ttwixt: '\\u226C',\n\ttwoheadleftarrow: '\\u219E',\n\ttwoheadrightarrow: '\\u21A0',\n\tUacute: '\\u00DA',\n\tuacute: '\\u00FA',\n\tUarr: '\\u219F',\n\tuArr: '\\u21D1',\n\tuarr: '\\u2191',\n\tUarrocir: '\\u2949',\n\tUbrcy: '\\u040E',\n\tubrcy: '\\u045E',\n\tUbreve: '\\u016C',\n\tubreve: '\\u016D',\n\tUcirc: '\\u00DB',\n\tucirc: '\\u00FB',\n\tUcy: '\\u0423',\n\tucy: '\\u0443',\n\tudarr: '\\u21C5',\n\tUdblac: '\\u0170',\n\tudblac: '\\u0171',\n\tudhar: '\\u296E',\n\tufisht: '\\u297E',\n\tUfr: '\\uD835\\uDD18',\n\tufr: '\\uD835\\uDD32',\n\tUgrave: '\\u00D9',\n\tugrave: '\\u00F9',\n\tuHar: '\\u2963',\n\tuharl: '\\u21BF',\n\tuharr: '\\u21BE',\n\tuhblk: '\\u2580',\n\tulcorn: '\\u231C',\n\tulcorner: '\\u231C',\n\tulcrop: '\\u230F',\n\tultri: '\\u25F8',\n\tUmacr: '\\u016A',\n\tumacr: '\\u016B',\n\tuml: '\\u00A8',\n\tUnderBar: '\\u005F',\n\tUnderBrace: '\\u23DF',\n\tUnderBracket: '\\u23B5',\n\tUnderParenthesis: '\\u23DD',\n\tUnion: '\\u22C3',\n\tUnionPlus: '\\u228E',\n\tUogon: '\\u0172',\n\tuogon: '\\u0173',\n\tUopf: '\\uD835\\uDD4C',\n\tuopf: '\\uD835\\uDD66',\n\tUpArrow: '\\u2191',\n\tUparrow: '\\u21D1',\n\tuparrow: '\\u2191',\n\tUpArrowBar: '\\u2912',\n\tUpArrowDownArrow: '\\u21C5',\n\tUpDownArrow: '\\u2195',\n\tUpdownarrow: '\\u21D5',\n\tupdownarrow: '\\u2195',\n\tUpEquilibrium: '\\u296E',\n\tupharpoonleft: '\\u21BF',\n\tupharpoonright: '\\u21BE',\n\tuplus: '\\u228E',\n\tUpperLeftArrow: '\\u2196',\n\tUpperRightArrow: '\\u2197',\n\tUpsi: '\\u03D2',\n\tupsi: '\\u03C5',\n\tupsih: '\\u03D2',\n\tUpsilon: '\\u03A5',\n\tupsilon: '\\u03C5',\n\tUpTee: '\\u22A5',\n\tUpTeeArrow: '\\u21A5',\n\tupuparrows: '\\u21C8',\n\turcorn: '\\u231D',\n\turcorner: '\\u231D',\n\turcrop: '\\u230E',\n\tUring: '\\u016E',\n\turing: '\\u016F',\n\turtri: '\\u25F9',\n\tUscr: '\\uD835\\uDCB0',\n\tuscr: '\\uD835\\uDCCA',\n\tutdot: '\\u22F0',\n\tUtilde: '\\u0168',\n\tutilde: '\\u0169',\n\tutri: '\\u25B5',\n\tutrif: '\\u25B4',\n\tuuarr: '\\u21C8',\n\tUuml: '\\u00DC',\n\tuuml: '\\u00FC',\n\tuwangle: '\\u29A7',\n\tvangrt: '\\u299C',\n\tvarepsilon: '\\u03F5',\n\tvarkappa: '\\u03F0',\n\tvarnothing: '\\u2205',\n\tvarphi: '\\u03D5',\n\tvarpi: '\\u03D6',\n\tvarpropto: '\\u221D',\n\tvArr: '\\u21D5',\n\tvarr: '\\u2195',\n\tvarrho: '\\u03F1',\n\tvarsigma: '\\u03C2',\n\tvarsubsetneq: '\\u228A\\uFE00',\n\tvarsubsetneqq: '\\u2ACB\\uFE00',\n\tvarsupsetneq: '\\u228B\\uFE00',\n\tvarsupsetneqq: '\\u2ACC\\uFE00',\n\tvartheta: '\\u03D1',\n\tvartriangleleft: '\\u22B2',\n\tvartriangleright: '\\u22B3',\n\tVbar: '\\u2AEB',\n\tvBar: '\\u2AE8',\n\tvBarv: '\\u2AE9',\n\tVcy: '\\u0412',\n\tvcy: '\\u0432',\n\tVDash: '\\u22AB',\n\tVdash: '\\u22A9',\n\tvDash: '\\u22A8',\n\tvdash: '\\u22A2',\n\tVdashl: '\\u2AE6',\n\tVee: '\\u22C1',\n\tvee: '\\u2228',\n\tveebar: '\\u22BB',\n\tveeeq: '\\u225A',\n\tvellip: '\\u22EE',\n\tVerbar: '\\u2016',\n\tverbar: '\\u007C',\n\tVert: '\\u2016',\n\tvert: '\\u007C',\n\tVerticalBar: '\\u2223',\n\tVerticalLine: '\\u007C',\n\tVerticalSeparator: '\\u2758',\n\tVerticalTilde: '\\u2240',\n\tVeryThinSpace: '\\u200A',\n\tVfr: '\\uD835\\uDD19',\n\tvfr: '\\uD835\\uDD33',\n\tvltri: '\\u22B2',\n\tvnsub: '\\u2282\\u20D2',\n\tvnsup: '\\u2283\\u20D2',\n\tVopf: '\\uD835\\uDD4D',\n\tvopf: '\\uD835\\uDD67',\n\tvprop: '\\u221D',\n\tvrtri: '\\u22B3',\n\tVscr: '\\uD835\\uDCB1',\n\tvscr: '\\uD835\\uDCCB',\n\tvsubnE: '\\u2ACB\\uFE00',\n\tvsubne: '\\u228A\\uFE00',\n\tvsupnE: '\\u2ACC\\uFE00',\n\tvsupne: '\\u228B\\uFE00',\n\tVvdash: '\\u22AA',\n\tvzigzag: '\\u299A',\n\tWcirc: '\\u0174',\n\twcirc: '\\u0175',\n\twedbar: '\\u2A5F',\n\tWedge: '\\u22C0',\n\twedge: '\\u2227',\n\twedgeq: '\\u2259',\n\tweierp: '\\u2118',\n\tWfr: '\\uD835\\uDD1A',\n\twfr: '\\uD835\\uDD34',\n\tWopf: '\\uD835\\uDD4E',\n\twopf: '\\uD835\\uDD68',\n\twp: '\\u2118',\n\twr: '\\u2240',\n\twreath: '\\u2240',\n\tWscr: '\\uD835\\uDCB2',\n\twscr: '\\uD835\\uDCCC',\n\txcap: '\\u22C2',\n\txcirc: '\\u25EF',\n\txcup: '\\u22C3',\n\txdtri: '\\u25BD',\n\tXfr: '\\uD835\\uDD1B',\n\txfr: '\\uD835\\uDD35',\n\txhArr: '\\u27FA',\n\txharr: '\\u27F7',\n\tXi: '\\u039E',\n\txi: '\\u03BE',\n\txlArr: '\\u27F8',\n\txlarr: '\\u27F5',\n\txmap: '\\u27FC',\n\txnis: '\\u22FB',\n\txodot: '\\u2A00',\n\tXopf: '\\uD835\\uDD4F',\n\txopf: '\\uD835\\uDD69',\n\txoplus: '\\u2A01',\n\txotime: '\\u2A02',\n\txrArr: '\\u27F9',\n\txrarr: '\\u27F6',\n\tXscr: '\\uD835\\uDCB3',\n\txscr: '\\uD835\\uDCCD',\n\txsqcup: '\\u2A06',\n\txuplus: '\\u2A04',\n\txutri: '\\u25B3',\n\txvee: '\\u22C1',\n\txwedge: '\\u22C0',\n\tYacute: '\\u00DD',\n\tyacute: '\\u00FD',\n\tYAcy: '\\u042F',\n\tyacy: '\\u044F',\n\tYcirc: '\\u0176',\n\tycirc: '\\u0177',\n\tYcy: '\\u042B',\n\tycy: '\\u044B',\n\tyen: '\\u00A5',\n\tYfr: '\\uD835\\uDD1C',\n\tyfr: '\\uD835\\uDD36',\n\tYIcy: '\\u0407',\n\tyicy: '\\u0457',\n\tYopf: '\\uD835\\uDD50',\n\tyopf: '\\uD835\\uDD6A',\n\tYscr: '\\uD835\\uDCB4',\n\tyscr: '\\uD835\\uDCCE',\n\tYUcy: '\\u042E',\n\tyucy: '\\u044E',\n\tYuml: '\\u0178',\n\tyuml: '\\u00FF',\n\tZacute: '\\u0179',\n\tzacute: '\\u017A',\n\tZcaron: '\\u017D',\n\tzcaron: '\\u017E',\n\tZcy: '\\u0417',\n\tzcy: '\\u0437',\n\tZdot: '\\u017B',\n\tzdot: '\\u017C',\n\tzeetrf: '\\u2128',\n\tZeroWidthSpace: '\\u200B',\n\tZeta: '\\u0396',\n\tzeta: '\\u03B6',\n\tZfr: '\\u2128',\n\tzfr: '\\uD835\\uDD37',\n\tZHcy: '\\u0416',\n\tzhcy: '\\u0436',\n\tzigrarr: '\\u21DD',\n\tZopf: '\\u2124',\n\tzopf: '\\uD835\\uDD6B',\n\tZscr: '\\uD835\\uDCB5',\n\tzscr: '\\uD835\\uDCCF',\n\tzwj: '\\u200D',\n\tzwnj: '\\u200C',\n});\n\n/**\n * @deprecated\n * Use `HTML_ENTITIES` instead.\n * @see {@link HTML_ENTITIES}\n */\nexports.entityMap = exports.HTML_ENTITIES;\n","'use strict';\n\nvar conventions = require('./conventions');\nvar g = require('./grammar');\nvar errors = require('./errors');\n\nvar isHTMLEscapableRawTextElement = conventions.isHTMLEscapableRawTextElement;\nvar isHTMLMimeType = conventions.isHTMLMimeType;\nvar isHTMLRawTextElement = conventions.isHTMLRawTextElement;\nvar hasOwn = conventions.hasOwn;\nvar NAMESPACE = conventions.NAMESPACE;\nvar ParseError = errors.ParseError;\nvar DOMException = errors.DOMException;\n\n//var handlers = 'resolveEntity,getExternalSubset,characters,endDocument,endElement,endPrefixMapping,ignorableWhitespace,processingInstruction,setDocumentLocator,skippedEntity,startDocument,startElement,startPrefixMapping,notationDecl,unparsedEntityDecl,error,fatalError,warning,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,comment,endCDATA,endDTD,endEntity,startCDATA,startDTD,startEntity'.split(',')\n\n//S_TAG,\tS_ATTR,\tS_EQ,\tS_ATTR_NOQUOT_VALUE\n//S_ATTR_SPACE,\tS_ATTR_END,\tS_TAG_SPACE, S_TAG_CLOSE\nvar S_TAG = 0; //tag name offerring\nvar S_ATTR = 1; //attr name offerring\nvar S_ATTR_SPACE = 2; //attr name end and space offer\nvar S_EQ = 3; //=space?\nvar S_ATTR_NOQUOT_VALUE = 4; //attr value(no quot value only)\nvar S_ATTR_END = 5; //attr value end and no space(quot end)\nvar S_TAG_SPACE = 6; //(attr value end || tag end ) && (space offer)\nvar S_TAG_CLOSE = 7; //closed el<el />\n\nfunction XMLReader() {}\n\nXMLReader.prototype = {\n\tparse: function (source, defaultNSMap, entityMap) {\n\t\tvar domBuilder = this.domBuilder;\n\t\tdomBuilder.startDocument();\n\t\t_copy(defaultNSMap, (defaultNSMap = Object.create(null)));\n\t\tparse(source, defaultNSMap, entityMap, domBuilder, this.errorHandler);\n\t\tdomBuilder.endDocument();\n\t},\n};\n\n/**\n * Detecting everything that might be a reference,\n * including those without ending `;`, since those are allowed in HTML.\n * The entityReplacer takes care of verifying and transforming each occurrence,\n * and reports to the errorHandler on those that are not OK,\n * depending on the context.\n */\nvar ENTITY_REG = /&#?\\w+;?/g;\n\nfunction parse(source, defaultNSMapCopy, entityMap, domBuilder, errorHandler) {\n\tvar isHTML = isHTMLMimeType(domBuilder.mimeType);\n\tif (source.indexOf(g.UNICODE_REPLACEMENT_CHARACTER) >= 0) {\n\t\terrorHandler.warning('Unicode replacement character detected, source encoding issues?');\n\t}\n\n\tfunction fixedFromCharCode(code) {\n\t\t// String.prototype.fromCharCode does not supports\n\t\t// > 2 bytes unicode chars directly\n\t\tif (code > 0xffff) {\n\t\t\tcode -= 0x10000;\n\t\t\tvar surrogate1 = 0xd800 + (code >> 10),\n\t\t\t\tsurrogate2 = 0xdc00 + (code & 0x3ff);\n\n\t\t\treturn String.fromCharCode(surrogate1, surrogate2);\n\t\t} else {\n\t\t\treturn String.fromCharCode(code);\n\t\t}\n\t}\n\n\tfunction entityReplacer(a) {\n\t\tvar complete = a[a.length - 1] === ';' ? a : a + ';';\n\t\tif (!isHTML && complete !== a) {\n\t\t\terrorHandler.error('EntityRef: expecting ;');\n\t\t\treturn a;\n\t\t}\n\t\tvar match = g.Reference.exec(complete);\n\t\tif (!match || match[0].length !== complete.length) {\n\t\t\terrorHandler.error('entity not matching Reference production: ' + a);\n\t\t\treturn a;\n\t\t}\n\t\tvar k = complete.slice(1, -1);\n\t\tif (hasOwn(entityMap, k)) {\n\t\t\treturn entityMap[k];\n\t\t} else if (k.charAt(0) === '#') {\n\t\t\treturn fixedFromCharCode(parseInt(k.substring(1).replace('x', '0x')));\n\t\t} else {\n\t\t\terrorHandler.error('entity not found:' + a);\n\t\t\treturn a;\n\t\t}\n\t}\n\n\tfunction appendText(end) {\n\t\t//has some bugs\n\t\tif (end > start) {\n\t\t\tvar xt = source.substring(start, end).replace(ENTITY_REG, entityReplacer);\n\t\t\tlocator && position(start);\n\t\t\tdomBuilder.characters(xt, 0, end - start);\n\t\t\tstart = end;\n\t\t}\n\t}\n\n\tvar lineStart = 0;\n\tvar lineEnd = 0;\n\tvar linePattern = /\\r\\n?|\\n|$/g;\n\tvar locator = domBuilder.locator;\n\n\tfunction position(p, m) {\n\t\twhile (p >= lineEnd && (m = linePattern.exec(source))) {\n\t\t\tlineStart = lineEnd;\n\t\t\tlineEnd = m.index + m[0].length;\n\t\t\tlocator.lineNumber++;\n\t\t}\n\t\tlocator.columnNumber = p - lineStart + 1;\n\t}\n\n\tvar parseStack = [{ currentNSMap: defaultNSMapCopy }];\n\tvar unclosedTags = [];\n\tvar start = 0;\n\twhile (true) {\n\t\ttry {\n\t\t\tvar tagStart = source.indexOf('<', start);\n\t\t\tif (tagStart < 0) {\n\t\t\t\tif (!isHTML && unclosedTags.length > 0) {\n\t\t\t\t\treturn errorHandler.fatalError('unclosed xml tag(s): ' + unclosedTags.join(', '));\n\t\t\t\t}\n\t\t\t\tif (!source.substring(start).match(/^\\s*$/)) {\n\t\t\t\t\tvar doc = domBuilder.doc;\n\t\t\t\t\tvar text = doc.createTextNode(source.substring(start));\n\t\t\t\t\tif (doc.documentElement) {\n\t\t\t\t\t\treturn errorHandler.error('Extra content at the end of the document');\n\t\t\t\t\t}\n\t\t\t\t\tdoc.appendChild(text);\n\t\t\t\t\tdomBuilder.currentElement = text;\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (tagStart > start) {\n\t\t\t\tvar fromSource = source.substring(start, tagStart);\n\t\t\t\tif (!isHTML && unclosedTags.length === 0) {\n\t\t\t\t\tfromSource = fromSource.replace(new RegExp(g.S_OPT.source, 'g'), '');\n\t\t\t\t\tfromSource && errorHandler.error(\"Unexpected content outside root element: '\" + fromSource + \"'\");\n\t\t\t\t}\n\t\t\t\tappendText(tagStart);\n\t\t\t}\n\t\t\tswitch (source.charAt(tagStart + 1)) {\n\t\t\t\tcase '/':\n\t\t\t\t\tvar end = source.indexOf('>', tagStart + 2);\n\t\t\t\t\tvar tagNameRaw = source.substring(tagStart + 2, end > 0 ? end : undefined);\n\t\t\t\t\tif (!tagNameRaw) {\n\t\t\t\t\t\treturn errorHandler.fatalError('end tag name missing');\n\t\t\t\t\t}\n\t\t\t\t\tvar tagNameMatch = end > 0 && g.reg('^', g.QName_group, g.S_OPT, '$').exec(tagNameRaw);\n\t\t\t\t\tif (!tagNameMatch) {\n\t\t\t\t\t\treturn errorHandler.fatalError('end tag name contains invalid characters: \"' + tagNameRaw + '\"');\n\t\t\t\t\t}\n\t\t\t\t\tif (!domBuilder.currentElement && !domBuilder.doc.documentElement) {\n\t\t\t\t\t\t// not enough information to provide a helpful error message,\n\t\t\t\t\t\t// but parsing will throw since there is no root element\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tvar currentTagName =\n\t\t\t\t\t\tunclosedTags[unclosedTags.length - 1] ||\n\t\t\t\t\t\tdomBuilder.currentElement.tagName ||\n\t\t\t\t\t\tdomBuilder.doc.documentElement.tagName ||\n\t\t\t\t\t\t'';\n\t\t\t\t\tif (currentTagName !== tagNameMatch[1]) {\n\t\t\t\t\t\tvar tagNameLower = tagNameMatch[1].toLowerCase();\n\t\t\t\t\t\tif (!isHTML || currentTagName.toLowerCase() !== tagNameLower) {\n\t\t\t\t\t\t\treturn errorHandler.fatalError('Opening and ending tag mismatch: \"' + currentTagName + '\" != \"' + tagNameRaw + '\"');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tvar config = parseStack.pop();\n\t\t\t\t\tunclosedTags.pop();\n\t\t\t\t\tvar localNSMap = config.localNSMap;\n\t\t\t\t\tdomBuilder.endElement(config.uri, config.localName, currentTagName);\n\t\t\t\t\tif (localNSMap) {\n\t\t\t\t\t\tfor (var prefix in localNSMap) {\n\t\t\t\t\t\t\tif (hasOwn(localNSMap, prefix)) {\n\t\t\t\t\t\t\t\tdomBuilder.endPrefixMapping(prefix);\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\tend++;\n\t\t\t\t\tbreak;\n\t\t\t\t// end element\n\t\t\t\tcase '?': // <?...?>\n\t\t\t\t\tlocator && position(tagStart);\n\t\t\t\t\tend = parseProcessingInstruction(source, tagStart, domBuilder, errorHandler);\n\t\t\t\t\tbreak;\n\t\t\t\tcase '!': // <!doctype,<![CDATA,<!--\n\t\t\t\t\tlocator && position(tagStart);\n\t\t\t\t\tend = parseDoctypeCommentOrCData(source, tagStart, domBuilder, errorHandler, isHTML);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tlocator && position(tagStart);\n\t\t\t\t\tvar el = new ElementAttributes();\n\t\t\t\t\tvar currentNSMap = parseStack[parseStack.length - 1].currentNSMap;\n\t\t\t\t\t//elStartEnd\n\t\t\t\t\tvar end = parseElementStartPart(source, tagStart, el, currentNSMap, entityReplacer, errorHandler, isHTML);\n\t\t\t\t\tvar len = el.length;\n\n\t\t\t\t\tif (!el.closed) {\n\t\t\t\t\t\tif (isHTML && conventions.isHTMLVoidElement(el.tagName)) {\n\t\t\t\t\t\t\tel.closed = true;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tunclosedTags.push(el.tagName);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (locator && len) {\n\t\t\t\t\t\tvar locator2 = copyLocator(locator, {});\n\t\t\t\t\t\t//try{//attribute position fixed\n\t\t\t\t\t\tfor (var i = 0; i < len; i++) {\n\t\t\t\t\t\t\tvar a = el[i];\n\t\t\t\t\t\t\tposition(a.offset);\n\t\t\t\t\t\t\ta.locator = copyLocator(locator, {});\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdomBuilder.locator = locator2;\n\t\t\t\t\t\tif (appendElement(el, domBuilder, currentNSMap)) {\n\t\t\t\t\t\t\tparseStack.push(el);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdomBuilder.locator = locator;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (appendElement(el, domBuilder, currentNSMap)) {\n\t\t\t\t\t\t\tparseStack.push(el);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (isHTML && !el.closed) {\n\t\t\t\t\t\tend = parseHtmlSpecialContent(source, end, el.tagName, entityReplacer, domBuilder);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tend++;\n\t\t\t\t\t}\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tif (e instanceof ParseError) {\n\t\t\t\tthrow e;\n\t\t\t} else if (e instanceof DOMException) {\n\t\t\t\tthrow new ParseError(e.name + ': ' + e.message, domBuilder.locator, e);\n\t\t\t}\n\t\t\terrorHandler.error('element parse error: ' + e);\n\t\t\tend = -1;\n\t\t}\n\t\tif (end > start) {\n\t\t\tstart = end;\n\t\t} else {\n\t\t\t//Possible sax fallback here, risk of positional error\n\t\t\tappendText(Math.max(tagStart, start) + 1);\n\t\t}\n\t}\n}\n\nfunction copyLocator(f, t) {\n\tt.lineNumber = f.lineNumber;\n\tt.columnNumber = f.columnNumber;\n\treturn t;\n}\n\n/**\n * @returns\n * end of the elementStartPart(end of elementEndPart for selfClosed el)\n * @see {@link #appendElement}\n */\nfunction parseElementStartPart(source, start, el, currentNSMap, entityReplacer, errorHandler, isHTML) {\n\t/**\n\t * @param {string} qname\n\t * @param {string} value\n\t * @param {number} startIndex\n\t */\n\tfunction addAttribute(qname, value, startIndex) {\n\t\tif (hasOwn(el.attributeNames, qname)) {\n\t\t\treturn errorHandler.fatalError('Attribute ' + qname + ' redefined');\n\t\t}\n\t\tif (!isHTML && value.indexOf('<') >= 0) {\n\t\t\treturn errorHandler.fatalError(\"Unescaped '<' not allowed in attributes values\");\n\t\t}\n\t\tel.addValue(\n\t\t\tqname,\n\t\t\t// @see https://www.w3.org/TR/xml/#AVNormalize\n\t\t\t// since the xmldom sax parser does not \"interpret\" DTD the following is not implemented:\n\t\t\t// - recursive replacement of (DTD) entity references\n\t\t\t// - trimming and collapsing multiple spaces into a single one for attributes that are not of type CDATA\n\t\t\tvalue.replace(/[\\t\\n\\r]/g, ' ').replace(ENTITY_REG, entityReplacer),\n\t\t\tstartIndex\n\t\t);\n\t}\n\n\tvar attrName;\n\tvar value;\n\tvar p = ++start;\n\tvar s = S_TAG; //status\n\twhile (true) {\n\t\tvar c = source.charAt(p);\n\t\tswitch (c) {\n\t\t\tcase '=':\n\t\t\t\tif (s === S_ATTR) {\n\t\t\t\t\t//attrName\n\t\t\t\t\tattrName = source.slice(start, p);\n\t\t\t\t\ts = S_EQ;\n\t\t\t\t} else if (s === S_ATTR_SPACE) {\n\t\t\t\t\ts = S_EQ;\n\t\t\t\t} else {\n\t\t\t\t\t//fatalError: equal must after attrName or space after attrName\n\t\t\t\t\tthrow new Error('attribute equal must after attrName'); // No known test case\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"'\":\n\t\t\tcase '\"':\n\t\t\t\tif (\n\t\t\t\t\ts === S_EQ ||\n\t\t\t\t\ts === S_ATTR //|| s == S_ATTR_SPACE\n\t\t\t\t) {\n\t\t\t\t\t//equal\n\t\t\t\t\tif (s === S_ATTR) {\n\t\t\t\t\t\terrorHandler.warning('attribute value must after \"=\"');\n\t\t\t\t\t\tattrName = source.slice(start, p);\n\t\t\t\t\t}\n\t\t\t\t\tstart = p + 1;\n\t\t\t\t\tp = source.indexOf(c, start);\n\t\t\t\t\tif (p > 0) {\n\t\t\t\t\t\tvalue = source.slice(start, p);\n\t\t\t\t\t\taddAttribute(attrName, value, start - 1);\n\t\t\t\t\t\ts = S_ATTR_END;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//fatalError: no end quot match\n\t\t\t\t\t\tthrow new Error(\"attribute value no end '\" + c + \"' match\");\n\t\t\t\t\t}\n\t\t\t\t} else if (s == S_ATTR_NOQUOT_VALUE) {\n\t\t\t\t\tvalue = source.slice(start, p);\n\t\t\t\t\taddAttribute(attrName, value, start);\n\t\t\t\t\terrorHandler.warning('attribute \"' + attrName + '\" missed start quot(' + c + ')!!');\n\t\t\t\t\tstart = p + 1;\n\t\t\t\t\ts = S_ATTR_END;\n\t\t\t\t} else {\n\t\t\t\t\t//fatalError: no equal before\n\t\t\t\t\tthrow new Error('attribute value must after \"=\"'); // No known test case\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase '/':\n\t\t\t\tswitch (s) {\n\t\t\t\t\tcase S_TAG:\n\t\t\t\t\t\tel.setTagName(source.slice(start, p));\n\t\t\t\t\tcase S_ATTR_END:\n\t\t\t\t\tcase S_TAG_SPACE:\n\t\t\t\t\tcase S_TAG_CLOSE:\n\t\t\t\t\t\ts = S_TAG_CLOSE;\n\t\t\t\t\t\tel.closed = true;\n\t\t\t\t\tcase S_ATTR_NOQUOT_VALUE:\n\t\t\t\t\tcase S_ATTR:\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase S_ATTR_SPACE:\n\t\t\t\t\t\tel.closed = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t//case S_EQ:\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tthrow new Error(\"attribute invalid close char('/')\"); // No known test case\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase '': //end document\n\t\t\t\terrorHandler.error('unexpected end of input');\n\t\t\t\tif (s == S_TAG) {\n\t\t\t\t\tel.setTagName(source.slice(start, p));\n\t\t\t\t}\n\t\t\t\treturn p;\n\t\t\tcase '>':\n\t\t\t\tswitch (s) {\n\t\t\t\t\tcase S_TAG:\n\t\t\t\t\t\tel.setTagName(source.slice(start, p));\n\t\t\t\t\tcase S_ATTR_END:\n\t\t\t\t\tcase S_TAG_SPACE:\n\t\t\t\t\tcase S_TAG_CLOSE:\n\t\t\t\t\t\tbreak; //normal\n\t\t\t\t\tcase S_ATTR_NOQUOT_VALUE: //Compatible state\n\t\t\t\t\tcase S_ATTR:\n\t\t\t\t\t\tvalue = source.slice(start, p);\n\t\t\t\t\t\tif (value.slice(-1) === '/') {\n\t\t\t\t\t\t\tel.closed = true;\n\t\t\t\t\t\t\tvalue = value.slice(0, -1);\n\t\t\t\t\t\t}\n\t\t\t\t\tcase S_ATTR_SPACE:\n\t\t\t\t\t\tif (s === S_ATTR_SPACE) {\n\t\t\t\t\t\t\tvalue = attrName;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (s == S_ATTR_NOQUOT_VALUE) {\n\t\t\t\t\t\t\terrorHandler.warning('attribute \"' + value + '\" missed quot(\")!');\n\t\t\t\t\t\t\taddAttribute(attrName, value, start);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (!isHTML) {\n\t\t\t\t\t\t\t\terrorHandler.warning('attribute \"' + value + '\" missed value!! \"' + value + '\" instead!!');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\taddAttribute(value, value, start);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase S_EQ:\n\t\t\t\t\t\tif (!isHTML) {\n\t\t\t\t\t\t\treturn errorHandler.fatalError('AttValue: \\' or \" expected');\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn p;\n\t\t\t/*xml space '\\x20' | #x9 | #xD | #xA; */\n\t\t\tcase '\\u0080':\n\t\t\t\tc = ' ';\n\t\t\tdefault:\n\t\t\t\tif (c <= ' ') {\n\t\t\t\t\t//space\n\t\t\t\t\tswitch (s) {\n\t\t\t\t\t\tcase S_TAG:\n\t\t\t\t\t\t\tel.setTagName(source.slice(start, p)); //tagName\n\t\t\t\t\t\t\ts = S_TAG_SPACE;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase S_ATTR:\n\t\t\t\t\t\t\tattrName = source.slice(start, p);\n\t\t\t\t\t\t\ts = S_ATTR_SPACE;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase S_ATTR_NOQUOT_VALUE:\n\t\t\t\t\t\t\tvar value = source.slice(start, p);\n\t\t\t\t\t\t\terrorHandler.warning('attribute \"' + value + '\" missed quot(\")!!');\n\t\t\t\t\t\t\taddAttribute(attrName, value, start);\n\t\t\t\t\t\tcase S_ATTR_END:\n\t\t\t\t\t\t\ts = S_TAG_SPACE;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t//case S_TAG_SPACE:\n\t\t\t\t\t\t//case S_EQ:\n\t\t\t\t\t\t//case S_ATTR_SPACE:\n\t\t\t\t\t\t//\tvoid();break;\n\t\t\t\t\t\t//case S_TAG_CLOSE:\n\t\t\t\t\t\t//ignore warning\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t//not space\n\t\t\t\t\t//S_TAG,\tS_ATTR,\tS_EQ,\tS_ATTR_NOQUOT_VALUE\n\t\t\t\t\t//S_ATTR_SPACE,\tS_ATTR_END,\tS_TAG_SPACE, S_TAG_CLOSE\n\t\t\t\t\tswitch (s) {\n\t\t\t\t\t\t//case S_TAG:void();break;\n\t\t\t\t\t\t//case S_ATTR:void();break;\n\t\t\t\t\t\t//case S_ATTR_NOQUOT_VALUE:void();break;\n\t\t\t\t\t\tcase S_ATTR_SPACE:\n\t\t\t\t\t\t\tif (!isHTML) {\n\t\t\t\t\t\t\t\terrorHandler.warning('attribute \"' + attrName + '\" missed value!! \"' + attrName + '\" instead2!!');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\taddAttribute(attrName, attrName, start);\n\t\t\t\t\t\t\tstart = p;\n\t\t\t\t\t\t\ts = S_ATTR;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase S_ATTR_END:\n\t\t\t\t\t\t\terrorHandler.warning('attribute space is required\"' + attrName + '\"!!');\n\t\t\t\t\t\tcase S_TAG_SPACE:\n\t\t\t\t\t\t\ts = S_ATTR;\n\t\t\t\t\t\t\tstart = p;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase S_EQ:\n\t\t\t\t\t\t\ts = S_ATTR_NOQUOT_VALUE;\n\t\t\t\t\t\t\tstart = p;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase S_TAG_CLOSE:\n\t\t\t\t\t\t\tthrow new Error(\"elements closed character '/' and '>' must be connected to\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t} //end outer switch\n\t\tp++;\n\t}\n}\n\n/**\n * @returns\n * `true` if a new namespace has been defined.\n */\nfunction appendElement(el, domBuilder, currentNSMap) {\n\tvar tagName = el.tagName;\n\tvar localNSMap = null;\n\tvar i = el.length;\n\twhile (i--) {\n\t\tvar a = el[i];\n\t\tvar qName = a.qName;\n\t\tvar value = a.value;\n\t\tvar nsp = qName.indexOf(':');\n\t\tif (nsp > 0) {\n\t\t\tvar prefix = (a.prefix = qName.slice(0, nsp));\n\t\t\tvar localName = qName.slice(nsp + 1);\n\t\t\tvar nsPrefix = prefix === 'xmlns' && localName;\n\t\t} else {\n\t\t\tlocalName = qName;\n\t\t\tprefix = null;\n\t\t\tnsPrefix = qName === 'xmlns' && '';\n\t\t}\n\t\t//can not set prefix,because prefix !== ''\n\t\ta.localName = localName;\n\t\t//prefix == null for no ns prefix attribute\n\t\tif (nsPrefix !== false) {\n\t\t\t//hack!!\n\t\t\tif (localNSMap == null) {\n\t\t\t\tlocalNSMap = Object.create(null);\n\t\t\t\t_copy(currentNSMap, (currentNSMap = Object.create(null)));\n\t\t\t}\n\t\t\tcurrentNSMap[nsPrefix] = localNSMap[nsPrefix] = value;\n\t\t\ta.uri = NAMESPACE.XMLNS;\n\t\t\tdomBuilder.startPrefixMapping(nsPrefix, value);\n\t\t}\n\t}\n\tvar i = el.length;\n\twhile (i--) {\n\t\ta = el[i];\n\t\tif (a.prefix) {\n\t\t\t//no prefix attribute has no namespace\n\t\t\tif (a.prefix === 'xml') {\n\t\t\t\ta.uri = NAMESPACE.XML;\n\t\t\t}\n\t\t\tif (a.prefix !== 'xmlns') {\n\t\t\t\ta.uri = currentNSMap[a.prefix];\n\t\t\t}\n\t\t}\n\t}\n\tvar nsp = tagName.indexOf(':');\n\tif (nsp > 0) {\n\t\tprefix = el.prefix = tagName.slice(0, nsp);\n\t\tlocalName = el.localName = tagName.slice(nsp + 1);\n\t} else {\n\t\tprefix = null; //important!!\n\t\tlocalName = el.localName = tagName;\n\t}\n\t//no prefix element has default namespace\n\tvar ns = (el.uri = currentNSMap[prefix || '']);\n\tdomBuilder.startElement(ns, localName, tagName, el);\n\t//endPrefixMapping and startPrefixMapping have not any help for dom builder\n\t//localNSMap = null\n\tif (el.closed) {\n\t\tdomBuilder.endElement(ns, localName, tagName);\n\t\tif (localNSMap) {\n\t\t\tfor (prefix in localNSMap) {\n\t\t\t\tif (hasOwn(localNSMap, prefix)) {\n\t\t\t\t\tdomBuilder.endPrefixMapping(prefix);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\tel.currentNSMap = currentNSMap;\n\t\tel.localNSMap = localNSMap;\n\t\t//parseStack.push(el);\n\t\treturn true;\n\t}\n}\n\nfunction parseHtmlSpecialContent(source, elStartEnd, tagName, entityReplacer, domBuilder) {\n\t// https://html.spec.whatwg.org/#raw-text-elements\n\t// https://html.spec.whatwg.org/#escapable-raw-text-elements\n\t// https://html.spec.whatwg.org/#cdata-rcdata-restrictions:raw-text-elements\n\t// TODO: https://html.spec.whatwg.org/#cdata-rcdata-restrictions\n\tvar isEscapableRaw = isHTMLEscapableRawTextElement(tagName);\n\tif (isEscapableRaw || isHTMLRawTextElement(tagName)) {\n\t\tvar elEndStart = source.indexOf('</' + tagName + '>', elStartEnd);\n\t\tvar text = source.substring(elStartEnd + 1, elEndStart);\n\n\t\tif (isEscapableRaw) {\n\t\t\ttext = text.replace(ENTITY_REG, entityReplacer);\n\t\t}\n\t\tdomBuilder.characters(text, 0, text.length);\n\t\treturn elEndStart;\n\t}\n\treturn elStartEnd + 1;\n}\n\nfunction _copy(source, target) {\n\tfor (var n in source) {\n\t\tif (hasOwn(source, n)) {\n\t\t\ttarget[n] = source[n];\n\t\t}\n\t}\n}\n\n/**\n * @typedef ParseUtils\n * @property {function(relativeIndex: number?): string | undefined} char\n * Provides look ahead access to a singe character relative to the current index.\n * @property {function(): number} getIndex\n * Provides read-only access to the current index.\n * @property {function(reg: RegExp): string | null} getMatch\n * Applies the provided regular expression enforcing that it starts at the current index and\n * returns the complete matching string,\n * and moves the current index by the length of the matching string.\n * @property {function(): string} getSource\n * Provides read-only access to the complete source.\n * @property {function(places: number?): void} skip\n * moves the current index by places (defaults to 1)\n * @property {function(): number} skipBlanks\n * Moves the current index by the amount of white space that directly follows the current index\n * and returns the amount of whitespace chars skipped (0..n),\n * or -1 if the end of the source was reached.\n * @property {function(): string} substringFromIndex\n * creates a substring from the current index to the end of `source`\n * @property {function(compareWith: string): boolean} substringStartsWith\n * Checks if `source` contains `compareWith`, starting from the current index.\n * @property {function(compareWith: string): boolean} substringStartsWithCaseInsensitive\n * Checks if `source` contains `compareWith`, starting from the current index,\n * comparing the upper case of both sides.\n * @see {@link parseUtils}\n */\n\n/**\n * A temporary scope for parsing and look ahead operations in `source`,\n * starting from index `start`.\n *\n * Some operations move the current index by a number of positions,\n * after which `getIndex` returns the new index.\n *\n * @param {string} source\n * @param {number} start\n * @returns {ParseUtils}\n */\nfunction parseUtils(source, start) {\n\tvar index = start;\n\n\tfunction char(n) {\n\t\tn = n || 0;\n\t\treturn source.charAt(index + n);\n\t}\n\n\tfunction skip(n) {\n\t\tn = n || 1;\n\t\tindex += n;\n\t}\n\n\tfunction skipBlanks() {\n\t\tvar blanks = 0;\n\t\twhile (index < source.length) {\n\t\t\tvar c = char();\n\t\t\tif (c !== ' ' && c !== '\\n' && c !== '\\t' && c !== '\\r') {\n\t\t\t\treturn blanks;\n\t\t\t}\n\t\t\tblanks++;\n\t\t\tskip();\n\t\t}\n\t\treturn -1;\n\t}\n\tfunction substringFromIndex() {\n\t\treturn source.substring(index);\n\t}\n\tfunction substringStartsWith(text) {\n\t\treturn source.substring(index, index + text.length) === text;\n\t}\n\tfunction substringStartsWithCaseInsensitive(text) {\n\t\treturn source.substring(index, index + text.length).toUpperCase() === text.toUpperCase();\n\t}\n\n\tfunction getMatch(args) {\n\t\tvar expr = g.reg('^', args);\n\t\tvar match = expr.exec(substringFromIndex());\n\t\tif (match) {\n\t\t\tskip(match[0].length);\n\t\t\treturn match[0];\n\t\t}\n\t\treturn null;\n\t}\n\treturn {\n\t\tchar: char,\n\t\tgetIndex: function () {\n\t\t\treturn index;\n\t\t},\n\t\tgetMatch: getMatch,\n\t\tgetSource: function () {\n\t\t\treturn source;\n\t\t},\n\t\tskip: skip,\n\t\tskipBlanks: skipBlanks,\n\t\tsubstringFromIndex: substringFromIndex,\n\t\tsubstringStartsWith: substringStartsWith,\n\t\tsubstringStartsWithCaseInsensitive: substringStartsWithCaseInsensitive,\n\t};\n}\n\n/**\n * @param {ParseUtils} p\n * @param {DOMHandler} errorHandler\n * @returns {string}\n */\nfunction parseDoctypeInternalSubset(p, errorHandler) {\n\t/**\n\t * @param {ParseUtils} p\n\t * @param {DOMHandler} errorHandler\n\t * @returns {string}\n\t */\n\tfunction parsePI(p, errorHandler) {\n\t\tvar match = g.PI.exec(p.substringFromIndex());\n\t\tif (!match) {\n\t\t\treturn errorHandler.fatalError('processing instruction is not well-formed at position ' + p.getIndex());\n\t\t}\n\t\tif (match[1].toLowerCase() === 'xml') {\n\t\t\treturn errorHandler.fatalError(\n\t\t\t\t'xml declaration is only allowed at the start of the document, but found at position ' + p.getIndex()\n\t\t\t);\n\t\t}\n\t\tp.skip(match[0].length);\n\t\treturn match[0];\n\t}\n\t// Parse internal subset\n\tvar source = p.getSource();\n\tif (p.char() === '[') {\n\t\tp.skip(1);\n\t\tvar intSubsetStart = p.getIndex();\n\t\twhile (p.getIndex() < source.length) {\n\t\t\tp.skipBlanks();\n\t\t\tif (p.char() === ']') {\n\t\t\t\tvar internalSubset = source.substring(intSubsetStart, p.getIndex());\n\t\t\t\tp.skip(1);\n\t\t\t\treturn internalSubset;\n\t\t\t}\n\t\t\tvar current = null;\n\t\t\t// Only in external subset\n\t\t\t// if (char() === '<' && char(1) === '!' && char(2) === '[') {\n\t\t\t// \tparseConditionalSections(p, errorHandler);\n\t\t\t// } else\n\t\t\tif (p.char() === '<' && p.char(1) === '!') {\n\t\t\t\tswitch (p.char(2)) {\n\t\t\t\t\tcase 'E': // ELEMENT | ENTITY\n\t\t\t\t\t\tif (p.char(3) === 'L') {\n\t\t\t\t\t\t\tcurrent = p.getMatch(g.elementdecl);\n\t\t\t\t\t\t} else if (p.char(3) === 'N') {\n\t\t\t\t\t\t\tcurrent = p.getMatch(g.EntityDecl);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'A': // ATTRIBUTE\n\t\t\t\t\t\tcurrent = p.getMatch(g.AttlistDecl);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'N': // NOTATION\n\t\t\t\t\t\tcurrent = p.getMatch(g.NotationDecl);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '-': // COMMENT\n\t\t\t\t\t\tcurrent = p.getMatch(g.Comment);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else if (p.char() === '<' && p.char(1) === '?') {\n\t\t\t\tcurrent = parsePI(p, errorHandler);\n\t\t\t} else if (p.char() === '%') {\n\t\t\t\tcurrent = p.getMatch(g.PEReference);\n\t\t\t} else {\n\t\t\t\treturn errorHandler.fatalError('Error detected in Markup declaration');\n\t\t\t}\n\t\t\tif (!current) {\n\t\t\t\treturn errorHandler.fatalError('Error in internal subset at position ' + p.getIndex());\n\t\t\t}\n\t\t}\n\t\treturn errorHandler.fatalError('doctype internal subset is not well-formed, missing ]');\n\t}\n}\n\n/**\n * Called when the parser encounters an element starting with '<!'.\n *\n * @param {string} source\n * The xml.\n * @param {number} start\n * the start index of the '<!'\n * @param {DOMHandler} domBuilder\n * @param {DOMHandler} errorHandler\n * @param {boolean} isHTML\n * @returns {number | never}\n * The end index of the element.\n * @throws {ParseError}\n * In case the element is not well-formed.\n */\nfunction parseDoctypeCommentOrCData(source, start, domBuilder, errorHandler, isHTML) {\n\tvar p = parseUtils(source, start);\n\n\tswitch (isHTML ? p.char(2).toUpperCase() : p.char(2)) {\n\t\tcase '-':\n\t\t\t// should be a comment\n\t\t\tvar comment = p.getMatch(g.Comment);\n\t\t\tif (comment) {\n\t\t\t\tdomBuilder.comment(comment, g.COMMENT_START.length, comment.length - g.COMMENT_START.length - g.COMMENT_END.length);\n\t\t\t\treturn p.getIndex();\n\t\t\t} else {\n\t\t\t\treturn errorHandler.fatalError('comment is not well-formed at position ' + p.getIndex());\n\t\t\t}\n\t\tcase '[':\n\t\t\t// should be CDATA\n\t\t\tvar cdata = p.getMatch(g.CDSect);\n\t\t\tif (cdata) {\n\t\t\t\tif (!isHTML && !domBuilder.currentElement) {\n\t\t\t\t\treturn errorHandler.fatalError('CDATA outside of element');\n\t\t\t\t}\n\t\t\t\tdomBuilder.startCDATA();\n\t\t\t\tdomBuilder.characters(cdata, g.CDATA_START.length, cdata.length - g.CDATA_START.length - g.CDATA_END.length);\n\t\t\t\tdomBuilder.endCDATA();\n\t\t\t\treturn p.getIndex();\n\t\t\t} else {\n\t\t\t\treturn errorHandler.fatalError('Invalid CDATA starting at position ' + start);\n\t\t\t}\n\t\tcase 'D': {\n\t\t\t// should be DOCTYPE\n\t\t\tif (domBuilder.doc && domBuilder.doc.documentElement) {\n\t\t\t\treturn errorHandler.fatalError('Doctype not allowed inside or after documentElement at position ' + p.getIndex());\n\t\t\t}\n\t\t\tif (isHTML ? !p.substringStartsWithCaseInsensitive(g.DOCTYPE_DECL_START) : !p.substringStartsWith(g.DOCTYPE_DECL_START)) {\n\t\t\t\treturn errorHandler.fatalError('Expected ' + g.DOCTYPE_DECL_START + ' at position ' + p.getIndex());\n\t\t\t}\n\t\t\tp.skip(g.DOCTYPE_DECL_START.length);\n\t\t\tif (p.skipBlanks() < 1) {\n\t\t\t\treturn errorHandler.fatalError('Expected whitespace after ' + g.DOCTYPE_DECL_START + ' at position ' + p.getIndex());\n\t\t\t}\n\n\t\t\tvar doctype = {\n\t\t\t\tname: undefined,\n\t\t\t\tpublicId: undefined,\n\t\t\t\tsystemId: undefined,\n\t\t\t\tinternalSubset: undefined,\n\t\t\t};\n\t\t\t// Parse the DOCTYPE name\n\t\t\tdoctype.name = p.getMatch(g.Name);\n\t\t\tif (!doctype.name)\n\t\t\t\treturn errorHandler.fatalError('doctype name missing or contains unexpected characters at position ' + p.getIndex());\n\n\t\t\tif (isHTML && doctype.name.toLowerCase() !== 'html') {\n\t\t\t\terrorHandler.warning('Unexpected DOCTYPE in HTML document at position ' + p.getIndex());\n\t\t\t}\n\t\t\tp.skipBlanks();\n\n\t\t\t// Check for ExternalID\n\t\t\tif (p.substringStartsWith(g.PUBLIC) || p.substringStartsWith(g.SYSTEM)) {\n\t\t\t\tvar match = g.ExternalID_match.exec(p.substringFromIndex());\n\t\t\t\tif (!match) {\n\t\t\t\t\treturn errorHandler.fatalError('doctype external id is not well-formed at position ' + p.getIndex());\n\t\t\t\t}\n\t\t\t\tif (match.groups.SystemLiteralOnly !== undefined) {\n\t\t\t\t\tdoctype.systemId = match.groups.SystemLiteralOnly;\n\t\t\t\t} else {\n\t\t\t\t\tdoctype.systemId = match.groups.SystemLiteral;\n\t\t\t\t\tdoctype.publicId = match.groups.PubidLiteral;\n\t\t\t\t}\n\t\t\t\tp.skip(match[0].length);\n\t\t\t} else if (isHTML && p.substringStartsWithCaseInsensitive(g.SYSTEM)) {\n\t\t\t\t// https://html.spec.whatwg.org/multipage/syntax.html#doctype-legacy-string\n\t\t\t\tp.skip(g.SYSTEM.length);\n\t\t\t\tif (p.skipBlanks() < 1) {\n\t\t\t\t\treturn errorHandler.fatalError('Expected whitespace after ' + g.SYSTEM + ' at position ' + p.getIndex());\n\t\t\t\t}\n\t\t\t\tdoctype.systemId = p.getMatch(g.ABOUT_LEGACY_COMPAT_SystemLiteral);\n\t\t\t\tif (!doctype.systemId) {\n\t\t\t\t\treturn errorHandler.fatalError(\n\t\t\t\t\t\t'Expected ' + g.ABOUT_LEGACY_COMPAT + ' in single or double quotes after ' + g.SYSTEM + ' at position ' + p.getIndex()\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isHTML && doctype.systemId && !g.ABOUT_LEGACY_COMPAT_SystemLiteral.test(doctype.systemId)) {\n\t\t\t\terrorHandler.warning('Unexpected doctype.systemId in HTML document at position ' + p.getIndex());\n\t\t\t}\n\t\t\tif (!isHTML) {\n\t\t\t\tp.skipBlanks();\n\t\t\t\tdoctype.internalSubset = parseDoctypeInternalSubset(p, errorHandler);\n\t\t\t}\n\t\t\tp.skipBlanks();\n\t\t\tif (p.char() !== '>') {\n\t\t\t\treturn errorHandler.fatalError('doctype not terminated with > at position ' + p.getIndex());\n\t\t\t}\n\t\t\tp.skip(1);\n\t\t\tdomBuilder.startDTD(doctype.name, doctype.publicId, doctype.systemId, doctype.internalSubset);\n\t\t\tdomBuilder.endDTD();\n\t\t\treturn p.getIndex();\n\t\t}\n\t\tdefault:\n\t\t\treturn errorHandler.fatalError('Not well-formed XML starting with \"<!\" at position ' + start);\n\t}\n}\n\nfunction parseProcessingInstruction(source, start, domBuilder, errorHandler) {\n\tvar match = source.substring(start).match(g.PI);\n\tif (!match) {\n\t\treturn errorHandler.fatalError('Invalid processing instruction starting at position ' + start);\n\t}\n\tif (match[1].toLowerCase() === 'xml') {\n\t\tif (start > 0) {\n\t\t\treturn errorHandler.fatalError(\n\t\t\t\t'processing instruction at position ' + start + ' is an xml declaration which is only at the start of the document'\n\t\t\t);\n\t\t}\n\t\tif (!g.XMLDecl.test(source.substring(start))) {\n\t\t\treturn errorHandler.fatalError('xml declaration is not well-formed');\n\t\t}\n\t}\n\tdomBuilder.processingInstruction(match[1], match[2]);\n\treturn start + match[0].length;\n}\n\nfunction ElementAttributes() {\n\tthis.attributeNames = Object.create(null);\n}\n\nElementAttributes.prototype = {\n\tsetTagName: function (tagName) {\n\t\tif (!g.QName_exact.test(tagName)) {\n\t\t\tthrow new Error('invalid tagName:' + tagName);\n\t\t}\n\t\tthis.tagName = tagName;\n\t},\n\taddValue: function (qName, value, offset) {\n\t\tif (!g.QName_exact.test(qName)) {\n\t\t\tthrow new Error('invalid attribute:' + qName);\n\t\t}\n\t\tthis.attributeNames[qName] = this.length;\n\t\tthis[this.length++] = { qName: qName, value: value, offset: offset };\n\t},\n\tlength: 0,\n\tgetLocalName: function (i) {\n\t\treturn this[i].localName;\n\t},\n\tgetLocator: function (i) {\n\t\treturn this[i].locator;\n\t},\n\tgetQName: function (i) {\n\t\treturn this[i].qName;\n\t},\n\tgetURI: function (i) {\n\t\treturn this[i].uri;\n\t},\n\tgetValue: function (i) {\n\t\treturn this[i].value;\n\t},\n\t//\t,getIndex:function(uri, localName)){\n\t//\t\tif(localName){\n\t//\n\t//\t\t}else{\n\t//\t\t\tvar qName = uri\n\t//\t\t}\n\t//\t},\n\t//\tgetValue:function(){return this.getValue(this.getIndex.apply(this,arguments))},\n\t//\tgetType:function(uri,localName){}\n\t//\tgetType:function(i){},\n};\n\nexports.XMLReader = XMLReader;\nexports.parseUtils = parseUtils;\nexports.parseDoctypeCommentOrCData = parseDoctypeCommentOrCData;\n","'use strict';\n\nvar conventions = require('./conventions');\nvar dom = require('./dom');\nvar errors = require('./errors');\nvar entities = require('./entities');\nvar sax = require('./sax');\n\nvar DOMImplementation = dom.DOMImplementation;\n\nvar hasDefaultHTMLNamespace = conventions.hasDefaultHTMLNamespace;\nvar isHTMLMimeType = conventions.isHTMLMimeType;\nvar isValidMimeType = conventions.isValidMimeType;\nvar MIME_TYPE = conventions.MIME_TYPE;\nvar NAMESPACE = conventions.NAMESPACE;\nvar ParseError = errors.ParseError;\n\nvar XMLReader = sax.XMLReader;\n\n/**\n * Normalizes line ending according to <https://www.w3.org/TR/xml11/#sec-line-ends>,\n * including some Unicode \"newline\" characters:\n *\n * > XML parsed entities are often stored in computer files which,\n * > for editing convenience, are organized into lines.\n * > These lines are typically separated by some combination\n * > of the characters CARRIAGE RETURN (#xD) and LINE FEED (#xA).\n * >\n * > To simplify the tasks of applications, the XML processor must behave\n * > as if it normalized all line breaks in external parsed entities (including the document entity)\n * > on input, before parsing, by translating the following to a single #xA character:\n * >\n * > 1. the two-character sequence #xD #xA,\n * > 2. the two-character sequence #xD #x85,\n * > 3. the single character #x85,\n * > 4. the single character #x2028,\n * > 5. the single character #x2029,\n * > 6. any #xD character that is not immediately followed by #xA or #x85.\n *\n * @param {string} input\n * @returns {string}\n * @prettierignore\n */\nfunction normalizeLineEndings(input) {\n\treturn input.replace(/\\r[\\n\\u0085]/g, '\\n').replace(/[\\r\\u0085\\u2028\\u2029]/g, '\\n');\n}\n\n/**\n * @typedef Locator\n * @property {number} [columnNumber]\n * @property {number} [lineNumber]\n */\n\n/**\n * @typedef DOMParserOptions\n * @property {typeof assign} [assign]\n * The method to use instead of `conventions.assign`, which is used to copy values from\n * `options` before they are used for parsing.\n * @property {typeof DOMHandler} [domHandler]\n * For internal testing: The class for creating an instance for handling events from the SAX\n * parser.\n * *****Warning: By configuring a faulty implementation, the specified behavior can completely\n * be broken.*****.\n * @property {Function} [errorHandler]\n * DEPRECATED! use `onError` instead.\n * @property {function(level:ErrorLevel, message:string, context: DOMHandler):void}\n * [onError]\n * A function invoked for every error that occurs during parsing.\n *\n * If it is not provided, all errors are reported to `console.error`\n * and only `fatalError`s are thrown as a `ParseError`,\n * which prevents any further processing.\n * If the provided method throws, a `ParserError` is thrown,\n * which prevents any further processing.\n *\n * Be aware that many `warning`s are considered an error that prevents further processing in\n * most implementations.\n * @property {boolean} [locator=true]\n * Configures if the nodes created during parsing will have a `lineNumber` and a `columnNumber`\n * attribute describing their location in the XML string.\n * Default is true.\n * @property {(string) => string} [normalizeLineEndings]\n * used to replace line endings before parsing, defaults to exported `normalizeLineEndings`,\n * which normalizes line endings according to <https://www.w3.org/TR/xml11/#sec-line-ends>,\n * including some Unicode \"newline\" characters.\n * @property {Object} [xmlns]\n * The XML namespaces that should be assumed when parsing.\n * The default namespace can be provided by the key that is the empty string.\n * When the `mimeType` for HTML, XHTML or SVG are passed to `parseFromString`,\n * the default namespace that will be used,\n * will be overridden according to the specification.\n * @see {@link normalizeLineEndings}\n */\n\n/**\n * The DOMParser interface provides the ability to parse XML or HTML source code from a string\n * into a DOM `Document`.\n *\n * ***xmldom is different from the spec in that it allows an `options` parameter,\n * to control the behavior***.\n *\n * @class\n * @param {DOMParserOptions} [options]\n * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser\n * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-parsing-and-serialization\n */\nfunction DOMParser(options) {\n\toptions = options || {};\n\tif (options.locator === undefined) {\n\t\toptions.locator = true;\n\t}\n\n\t/**\n\t * The method to use instead of `conventions.assign`, which is used to copy values from\n\t * `options`\n\t * before they are used for parsing.\n\t *\n\t * @type {conventions.assign}\n\t * @private\n\t * @see {@link conventions.assign}\n\t * @readonly\n\t */\n\tthis.assign = options.assign || conventions.assign;\n\n\t/**\n\t * For internal testing: The class for creating an instance for handling events from the SAX\n\t * parser.\n\t * *****Warning: By configuring a faulty implementation, the specified behavior can completely\n\t * be broken*****.\n\t *\n\t * @type {typeof DOMHandler}\n\t * @private\n\t * @readonly\n\t */\n\tthis.domHandler = options.domHandler || DOMHandler;\n\n\t/**\n\t * A function that is invoked for every error that occurs during parsing.\n\t *\n\t * If it is not provided, all errors are reported to `console.error`\n\t * and only `fatalError`s are thrown as a `ParseError`,\n\t * which prevents any further processing.\n\t * If the provided method throws, a `ParserError` is thrown,\n\t * which prevents any further processing.\n\t *\n\t * Be aware that many `warning`s are considered an error that prevents further processing in\n\t * most implementations.\n\t *\n\t * @type {function(level:ErrorLevel, message:string, context: DOMHandler):void}\n\t * @see {@link onErrorStopParsing}\n\t * @see {@link onWarningStopParsing}\n\t */\n\tthis.onError = options.onError || options.errorHandler;\n\tif (options.errorHandler && typeof options.errorHandler !== 'function') {\n\t\tthrow new TypeError('errorHandler object is no longer supported, switch to onError!');\n\t} else if (options.errorHandler) {\n\t\toptions.errorHandler('warning', 'The `errorHandler` option has been deprecated, use `onError` instead!', this);\n\t}\n\n\t/**\n\t * used to replace line endings before parsing, defaults to `normalizeLineEndings`\n\t *\n\t * @type {(string) => string}\n\t * @readonly\n\t */\n\tthis.normalizeLineEndings = options.normalizeLineEndings || normalizeLineEndings;\n\n\t/**\n\t * Configures if the nodes created during parsing will have a `lineNumber` and a\n\t * `columnNumber`\n\t * attribute describing their location in the XML string.\n\t * Default is true.\n\t *\n\t * @type {boolean}\n\t * @readonly\n\t */\n\tthis.locator = !!options.locator;\n\n\t/**\n\t * The default namespace can be provided by the key that is the empty string.\n\t * When the `mimeType` for HTML, XHTML or SVG are passed to `parseFromString`,\n\t * the default namespace that will be used,\n\t * will be overridden according to the specification.\n\t *\n\t * @type {Readonly<Object>}\n\t * @readonly\n\t */\n\tthis.xmlns = this.assign(Object.create(null), options.xmlns);\n}\n\n/**\n * Parses `source` using the options in the way configured by the `DOMParserOptions` of `this`\n * `DOMParser`. If `mimeType` is `text/html` an HTML `Document` is created,\n * otherwise an XML `Document` is created.\n *\n * __It behaves different from the description in the living standard__:\n * - Uses the `options` passed to the `DOMParser` constructor to modify the behavior.\n * - Any unexpected input is reported to `onError` with either a `warning`,\n * `error` or `fatalError` level.\n * - Any `fatalError` throws a `ParseError` which prevents further processing.\n * - Any error thrown by `onError` is converted to a `ParseError` which prevents further\n * processing - If no `Document` was created during parsing it is reported as a `fatalError`.\n * *****Warning: By configuring a faulty DOMHandler implementation,\n * the specified behavior can completely be broken*****.\n *\n * @param {string} source\n * The XML mime type only allows string input!\n * @param {string} [mimeType='application/xml']\n * the mimeType or contentType of the document to be created determines the `type` of document\n * created (XML or HTML)\n * @returns {Document}\n * The `Document` node.\n * @throws {ParseError}\n * for any `fatalError` or anything that is thrown by `onError`\n * @throws {TypeError}\n * for any invalid `mimeType`\n * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString\n * @see https://html.spec.whatwg.org/#dom-domparser-parsefromstring-dev\n */\nDOMParser.prototype.parseFromString = function (source, mimeType) {\n\tif (!isValidMimeType(mimeType)) {\n\t\tthrow new TypeError('DOMParser.parseFromString: the provided mimeType \"' + mimeType + '\" is not valid.');\n\t}\n\tvar defaultNSMap = this.assign(Object.create(null), this.xmlns);\n\tvar entityMap = entities.XML_ENTITIES;\n\tvar defaultNamespace = defaultNSMap[''] || null;\n\tif (hasDefaultHTMLNamespace(mimeType)) {\n\t\tentityMap = entities.HTML_ENTITIES;\n\t\tdefaultNamespace = NAMESPACE.HTML;\n\t} else if (mimeType === MIME_TYPE.XML_SVG_IMAGE) {\n\t\tdefaultNamespace = NAMESPACE.SVG;\n\t}\n\tdefaultNSMap[''] = defaultNamespace;\n\tdefaultNSMap.xml = defaultNSMap.xml || NAMESPACE.XML;\n\n\tvar domBuilder = new this.domHandler({\n\t\tmimeType: mimeType,\n\t\tdefaultNamespace: defaultNamespace,\n\t\tonError: this.onError,\n\t});\n\tvar locator = this.locator ? {} : undefined;\n\tif (this.locator) {\n\t\tdomBuilder.setDocumentLocator(locator);\n\t}\n\n\tvar sax = new XMLReader();\n\tsax.errorHandler = domBuilder;\n\tsax.domBuilder = domBuilder;\n\tvar isXml = !conventions.isHTMLMimeType(mimeType);\n\tif (isXml && typeof source !== 'string') {\n\t\tsax.errorHandler.fatalError('source is not a string');\n\t}\n\tsax.parse(this.normalizeLineEndings(String(source)), defaultNSMap, entityMap);\n\tif (!domBuilder.doc.documentElement) {\n\t\tsax.errorHandler.fatalError('missing root element');\n\t}\n\treturn domBuilder.doc;\n};\n\n/**\n * @typedef DOMHandlerOptions\n * @property {string} [mimeType=MIME_TYPE.XML_APPLICATION]\n * @property {string | null} [defaultNamespace=null]\n */\n/**\n * The class that is used to handle events from the SAX parser to create the related DOM\n * elements.\n *\n * Some methods are only implemented as an empty function,\n * since they are (at least currently) not relevant for xmldom.\n *\n * @class\n * @param {DOMHandlerOptions} [options]\n * @see http://www.saxproject.org/apidoc/org/xml/sax/ext/DefaultHandler2.html\n */\nfunction DOMHandler(options) {\n\tvar opt = options || {};\n\t/**\n\t * The mime type is used to determine if the DOM handler will create an XML or HTML document.\n\t * Only if it is set to `text/html` it will create an HTML document.\n\t * It defaults to MIME_TYPE.XML_APPLICATION.\n\t *\n\t * @type {string}\n\t * @see {@link MIME_TYPE}\n\t * @readonly\n\t */\n\tthis.mimeType = opt.mimeType || MIME_TYPE.XML_APPLICATION;\n\n\t/**\n\t * The namespace to use to create an XML document.\n\t * For the following reasons this is required:\n\t * - The SAX API for `startDocument` doesn't offer any way to pass a namespace,\n\t * since at that point there is no way for the parser to know what the default namespace from\n\t * the document will be.\n\t * - When creating using `DOMImplementation.createDocument` it is required to pass a\n\t * namespace,\n\t * to determine the correct `Document.contentType`, which should match `this.mimeType`.\n\t * - When parsing an XML document with the `application/xhtml+xml` mimeType,\n\t * the HTML namespace needs to be the default namespace.\n\t *\n\t * @type {string | null}\n\t * @private\n\t * @readonly\n\t */\n\tthis.defaultNamespace = opt.defaultNamespace || null;\n\n\t/**\n\t * @type {boolean}\n\t * @private\n\t */\n\tthis.cdata = false;\n\n\t/**\n\t * The last `Element` that was created by `startElement`.\n\t * `endElement` sets it to the `currentElement.parentNode`.\n\t *\n\t * Note: The sax parser currently sets it to white space text nodes between tags.\n\t *\n\t * @type {Element | Node | undefined}\n\t * @private\n\t */\n\tthis.currentElement = undefined;\n\n\t/**\n\t * The Document that is created as part of `startDocument`,\n\t * and returned by `DOMParser.parseFromString`.\n\t *\n\t * @type {Document | undefined}\n\t * @readonly\n\t */\n\tthis.doc = undefined;\n\n\t/**\n\t * The locator is stored as part of setDocumentLocator.\n\t * It is controlled and mutated by the SAX parser to store the current parsing position.\n\t * It is used by DOMHandler to set `columnNumber` and `lineNumber`\n\t * on the DOM nodes.\n\t *\n\t * @type {Readonly<Locator> | undefined}\n\t * @private\n\t * @readonly (the\n\t * sax parser currently sometimes set's it)\n\t */\n\tthis.locator = undefined;\n\t/**\n\t * @type {function (level:ErrorLevel ,message:string, context:DOMHandler):void}\n\t * @readonly\n\t */\n\tthis.onError = opt.onError;\n}\n\nfunction position(locator, node) {\n\tnode.lineNumber = locator.lineNumber;\n\tnode.columnNumber = locator.columnNumber;\n}\n\nDOMHandler.prototype = {\n\t/**\n\t * Either creates an XML or an HTML document and stores it under `this.doc`.\n\t * If it is an XML document, `this.defaultNamespace` is used to create it,\n\t * and it will not contain any `childNodes`.\n\t * If it is an HTML document, it will be created without any `childNodes`.\n\t *\n\t * @see http://www.saxproject.org/apidoc/org/xml/sax/ContentHandler.html\n\t */\n\tstartDocument: function () {\n\t\tvar impl = new DOMImplementation();\n\t\tthis.doc = isHTMLMimeType(this.mimeType) ? impl.createHTMLDocument(false) : impl.createDocument(this.defaultNamespace, '');\n\t},\n\tstartElement: function (namespaceURI, localName, qName, attrs) {\n\t\tvar doc = this.doc;\n\t\tvar el = doc.createElementNS(namespaceURI, qName || localName);\n\t\tvar len = attrs.length;\n\t\tappendElement(this, el);\n\t\tthis.currentElement = el;\n\n\t\tthis.locator && position(this.locator, el);\n\t\tfor (var i = 0; i < len; i++) {\n\t\t\tvar namespaceURI = attrs.getURI(i);\n\t\t\tvar value = attrs.getValue(i);\n\t\t\tvar qName = attrs.getQName(i);\n\t\t\tvar attr = doc.createAttributeNS(namespaceURI, qName);\n\t\t\tthis.locator && position(attrs.getLocator(i), attr);\n\t\t\tattr.value = attr.nodeValue = value;\n\t\t\tel.setAttributeNode(attr);\n\t\t}\n\t},\n\tendElement: function (namespaceURI, localName, qName) {\n\t\tthis.currentElement = this.currentElement.parentNode;\n\t},\n\tstartPrefixMapping: function (prefix, uri) {},\n\tendPrefixMapping: function (prefix) {},\n\tprocessingInstruction: function (target, data) {\n\t\tvar ins = this.doc.createProcessingInstruction(target, data);\n\t\tthis.locator && position(this.locator, ins);\n\t\tappendElement(this, ins);\n\t},\n\tignorableWhitespace: function (ch, start, length) {},\n\tcharacters: function (chars, start, length) {\n\t\tchars = _toString.apply(this, arguments);\n\t\t//console.log(chars)\n\t\tif (chars) {\n\t\t\tif (this.cdata) {\n\t\t\t\tvar charNode = this.doc.createCDATASection(chars);\n\t\t\t} else {\n\t\t\t\tvar charNode = this.doc.createTextNode(chars);\n\t\t\t}\n\t\t\tif (this.currentElement) {\n\t\t\t\tthis.currentElement.appendChild(charNode);\n\t\t\t} else if (/^\\s*$/.test(chars)) {\n\t\t\t\tthis.doc.appendChild(charNode);\n\t\t\t\t//process xml\n\t\t\t}\n\t\t\tthis.locator && position(this.locator, charNode);\n\t\t}\n\t},\n\tskippedEntity: function (name) {},\n\tendDocument: function () {\n\t\tthis.doc.normalize();\n\t},\n\t/**\n\t * Stores the locator to be able to set the `columnNumber` and `lineNumber`\n\t * on the created DOM nodes.\n\t *\n\t * @param {Locator} locator\n\t */\n\tsetDocumentLocator: function (locator) {\n\t\tif (locator) {\n\t\t\tlocator.lineNumber = 0;\n\t\t}\n\t\tthis.locator = locator;\n\t},\n\t//LexicalHandler\n\tcomment: function (chars, start, length) {\n\t\tchars = _toString.apply(this, arguments);\n\t\tvar comm = this.doc.createComment(chars);\n\t\tthis.locator && position(this.locator, comm);\n\t\tappendElement(this, comm);\n\t},\n\n\tstartCDATA: function () {\n\t\t//used in characters() methods\n\t\tthis.cdata = true;\n\t},\n\tendCDATA: function () {\n\t\tthis.cdata = false;\n\t},\n\n\tstartDTD: function (name, publicId, systemId, internalSubset) {\n\t\tvar impl = this.doc.implementation;\n\t\tif (impl && impl.createDocumentType) {\n\t\t\tvar dt = impl.createDocumentType(name, publicId, systemId, internalSubset);\n\t\t\tthis.locator && position(this.locator, dt);\n\t\t\tappendElement(this, dt);\n\t\t\tthis.doc.doctype = dt;\n\t\t}\n\t},\n\treportError: function (level, message) {\n\t\tif (typeof this.onError === 'function') {\n\t\t\ttry {\n\t\t\t\tthis.onError(level, message, this);\n\t\t\t} catch (e) {\n\t\t\t\tthrow new ParseError('Reporting ' + level + ' \"' + message + '\" caused ' + e, this.locator);\n\t\t\t}\n\t\t} else {\n\t\t\tconsole.error('[xmldom ' + level + ']\\t' + message, _locator(this.locator));\n\t\t}\n\t},\n\t/**\n\t * @see http://www.saxproject.org/apidoc/org/xml/sax/ErrorHandler.html\n\t */\n\twarning: function (message) {\n\t\tthis.reportError('warning', message);\n\t},\n\terror: function (message) {\n\t\tthis.reportError('error', message);\n\t},\n\t/**\n\t * This function reports a fatal error and throws a ParseError.\n\t *\n\t * @param {string} message\n\t * - The message to be used for reporting and throwing the error.\n\t * @returns {never}\n\t * This function always throws an error and never returns a value.\n\t * @throws {ParseError}\n\t * Always throws a ParseError with the provided message.\n\t */\n\tfatalError: function (message) {\n\t\tthis.reportError('fatalError', message);\n\t\tthrow new ParseError(message, this.locator);\n\t},\n};\n\nfunction _locator(l) {\n\tif (l) {\n\t\treturn '\\n@#[line:' + l.lineNumber + ',col:' + l.columnNumber + ']';\n\t}\n}\n\nfunction _toString(chars, start, length) {\n\tif (typeof chars == 'string') {\n\t\treturn chars.substr(start, length);\n\t} else {\n\t\t//java sax connect width xmldom on rhino(what about: \"? && !(chars instanceof String)\")\n\t\tif (chars.length >= start + length || start) {\n\t\t\treturn new java.lang.String(chars, start, length) + '';\n\t\t}\n\t\treturn chars;\n\t}\n}\n\n/*\n * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/LexicalHandler.html\n * used method of org.xml.sax.ext.LexicalHandler:\n * #comment(chars, start, length)\n * #startCDATA()\n * #endCDATA()\n * #startDTD(name, publicId, systemId)\n *\n *\n * IGNORED method of org.xml.sax.ext.LexicalHandler:\n * #endDTD()\n * #startEntity(name)\n * #endEntity(name)\n *\n *\n * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/DeclHandler.html\n * IGNORED method of org.xml.sax.ext.DeclHandler\n * \t#attributeDecl(eName, aName, type, mode, value)\n * #elementDecl(name, model)\n * #externalEntityDecl(name, publicId, systemId)\n * #internalEntityDecl(name, value)\n * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/EntityResolver2.html\n * IGNORED method of org.xml.sax.EntityResolver2\n * #resolveEntity(String name,String publicId,String baseURI,String systemId)\n * #resolveEntity(publicId, systemId)\n * #getExternalSubset(name, baseURI)\n * @link http://www.saxproject.org/apidoc/org/xml/sax/DTDHandler.html\n * IGNORED method of org.xml.sax.DTDHandler\n * #notationDecl(name, publicId, systemId) {};\n * #unparsedEntityDecl(name, publicId, systemId, notationName) {};\n */\n'endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl'.replace(\n\t/\\w+/g,\n\tfunction (key) {\n\t\tDOMHandler.prototype[key] = function () {\n\t\t\treturn null;\n\t\t};\n\t}\n);\n\n/* Private static helpers treated below as private instance methods, so don't need to add these to the public API; we might use a Relator to also get rid of non-standard public properties */\nfunction appendElement(handler, node) {\n\tif (!handler.currentElement) {\n\t\thandler.doc.appendChild(node);\n\t} else {\n\t\thandler.currentElement.appendChild(node);\n\t}\n}\n\n/**\n * A method that prevents any further parsing when an `error`\n * with level `error` is reported during parsing.\n *\n * @see {@link DOMParserOptions.onError}\n * @see {@link onWarningStopParsing}\n */\nfunction onErrorStopParsing(level) {\n\tif (level === 'error') throw 'onErrorStopParsing';\n}\n\n/**\n * A method that prevents any further parsing when any `error` is reported during parsing.\n *\n * @see {@link DOMParserOptions.onError}\n * @see {@link onErrorStopParsing}\n */\nfunction onWarningStopParsing() {\n\tthrow 'onWarningStopParsing';\n}\n\nexports.__DOMHandler = DOMHandler;\nexports.DOMParser = DOMParser;\nexports.normalizeLineEndings = normalizeLineEndings;\nexports.onErrorStopParsing = onErrorStopParsing;\nexports.onWarningStopParsing = onWarningStopParsing;\n","'use strict';\nvar conventions = require('./conventions');\nexports.assign = conventions.assign;\nexports.hasDefaultHTMLNamespace = conventions.hasDefaultHTMLNamespace;\nexports.isHTMLMimeType = conventions.isHTMLMimeType;\nexports.isValidMimeType = conventions.isValidMimeType;\nexports.MIME_TYPE = conventions.MIME_TYPE;\nexports.NAMESPACE = conventions.NAMESPACE;\n\nvar errors = require('./errors');\nexports.DOMException = errors.DOMException;\nexports.DOMExceptionName = errors.DOMExceptionName;\nexports.ExceptionCode = errors.ExceptionCode;\nexports.ParseError = errors.ParseError;\n\nvar dom = require('./dom');\nexports.Attr = dom.Attr;\nexports.CDATASection = dom.CDATASection;\nexports.CharacterData = dom.CharacterData;\nexports.Comment = dom.Comment;\nexports.Document = dom.Document;\nexports.DocumentFragment = dom.DocumentFragment;\nexports.DocumentType = dom.DocumentType;\nexports.DOMImplementation = dom.DOMImplementation;\nexports.Element = dom.Element;\nexports.Entity = dom.Entity;\nexports.EntityReference = dom.EntityReference;\nexports.LiveNodeList = dom.LiveNodeList;\nexports.NamedNodeMap = dom.NamedNodeMap;\nexports.Node = dom.Node;\nexports.NodeList = dom.NodeList;\nexports.Notation = dom.Notation;\nexports.ProcessingInstruction = dom.ProcessingInstruction;\nexports.Text = dom.Text;\nexports.XMLSerializer = dom.XMLSerializer;\n\nvar domParser = require('./dom-parser');\nexports.DOMParser = domParser.DOMParser;\nexports.normalizeLineEndings = domParser.normalizeLineEndings;\nexports.onErrorStopParsing = domParser.onErrorStopParsing;\nexports.onWarningStopParsing = domParser.onWarningStopParsing;\n","import osmtogeojson from 'osmtogeojson';\nimport { DOMParser } from '@xmldom/xmldom';\nimport { LineString } from 'geojson';\n\nexport function osmStringToGeojson(osmString: string) {\n const parser = new DOMParser();\n const osmXml = parser.parseFromString(osmString, \"text/xml\");\n return osmtogeojson(osmXml);\n}\n\nexport function lineStringToPolygon(lineString: LineString) {\n const coordinates = lineString.coordinates;\n const firstCoord = coordinates[0];\n const lastCoord = coordinates[coordinates.length - 1];\n \n // Check if first and last coordinates are the same\n const isClosed = firstCoord[0] === lastCoord[0] && firstCoord[1] === lastCoord[1];\n \n // If not closed, add the first coordinate at the end\n const polygonCoordinates = isClosed ? coordinates : [...coordinates, firstCoord];\n \n const polygon = {\n type: 'Polygon',\n coordinates: [polygonCoordinates]\n };\n return polygon;\n}\n","import { Coordinates, Level, Level_t } from '@wemap/geo';\nimport { OsmTagsUtils } from '@wemap/osm';\nimport booleanPointInPolygon from '@turf/boolean-point-in-polygon';\nimport type { Feature, FeatureCollection, GeoJSON, LineString, MultiPolygon, Point, Polygon, Position } from 'geojson';\n\nimport Graph from '../../graph/Graph.js';\nimport { default as Edge, type EdgeProperties } from '../../graph/Edge.js';\nimport { default as Vertex, type VertexProperties } from '../../graph/Vertex.js';\nimport { lineStringToPolygon } from './GeoJsonUtils.js';\n\nfunction getFeatures(geojson: GeoJSON): Feature[] {\n return (geojson.type === 'FeatureCollection') \n ? (geojson as FeatureCollection).features\n : (geojson.type === 'Feature')\n ? [geojson as Feature]\n : [{ type: 'Feature', geometry: geojson, properties: {} }];\n}\n\nexport default class GeoJsonGraphUtils {\n\n static RESTRICTED_PEDESTRIANS_HIGHWAYS = ['motorway', 'motorway_link'];\n\n static DEFAULT_FEATURE_SELECTOR = (feature: Feature) => {\n if (!feature.properties) return false;\n\n if (feature.geometry.type === 'LineString') {\n if (feature.properties.foot === 'yes') return true;\n if (['no', 'private'].includes(feature.properties.access)) return false;\n if ('highway' in feature.properties) {\n return !GeoJsonGraphUtils.RESTRICTED_PEDESTRIANS_HIGHWAYS.includes(feature.properties.highway);\n }\n if (feature.properties.footway === 'sidewalk') return true;\n // if (feature.properties.public_transport === 'platform') return true;\n // if (feature.properties.railway === 'platform') return true;\n }\n \n if (feature.properties.highway === 'elevator' && ['Point', 'Polygon'].includes(feature.type)) {\n return true;\n }\n\n return false;\n };\n\n static parsePointProperties(feature: Feature<Point>): VertexProperties {\n if (!feature.properties) return {\n ...(feature.id && { externalId: feature.id })\n };\n \n return {\n ...(feature.id && { externalId: feature.id }),\n ...(OsmTagsUtils.elementName(feature.properties) && { name: OsmTagsUtils.elementName(feature.properties) }),\n ...(OsmTagsUtils.isGate(feature.properties) && { isGate: true }),\n ...(OsmTagsUtils.isSubwayEntrance(feature.properties) && { isSubwayEntrance: true }),\n ...(OsmTagsUtils.getRef(feature.properties) && { subwayEntrsanceRef: OsmTagsUtils.getRef(feature.properties) }),\n ...(OsmTagsUtils.isElevator(feature.properties) && { isElevator: true }),\n ...(OsmTagsUtils.isTurnstile(feature.properties) && { isTurnstile: true })\n }\n }\n\n static parseLineStringProperties(feature: Feature): EdgeProperties {\n\n if (!feature.properties) return {\n ...(feature.id && { externalId: feature.id })\n };\n \n return {\n ...(feature.properties.id && { externalId: feature.properties.id }),\n ...(feature.id && { externalId: feature.id }),\n ...(OsmTagsUtils.elementName(feature.properties) && { name: OsmTagsUtils.elementName(feature.properties) }),\n ...(OsmTagsUtils.isOneway(feature.properties) && { isOneway: true }),\n ...(OsmTagsUtils.areStairs(feature.properties) && { areStairs: true }),\n ...(OsmTagsUtils.isElevator(feature.properties) && { isElevator: true }),\n ...(OsmTagsUtils.isEscalator(feature.properties) && { areEscalators: true }),\n ...(OsmTagsUtils.isMovingWalkway(feature.properties) && { isMovingWalkway: true }),\n ...(OsmTagsUtils.needTicket(feature.properties) && { needTicket: true }),\n ...(OsmTagsUtils.getIncline(feature.properties) && { incline: OsmTagsUtils.getIncline(feature.properties) }),\n ...(OsmTagsUtils.getWheelchair(feature.properties) && { wheelchair: OsmTagsUtils.getWheelchair(feature.properties) }),\n ...(OsmTagsUtils.getSmoothness(feature.properties) && { smoothness: OsmTagsUtils.getSmoothness(feature.properties) }),\n ...(OsmTagsUtils.getSurface(feature.properties) && { surface: OsmTagsUtils.getSurface(feature.properties) }),\n }\n }\n\n static createGraphFromGeojsonString(geojsonString: string) {\n const geojson = JSON.parse(geojsonString);\n return this.createGraphFromGeojson(geojson);\n }\n\n static createGraphFromGeojson(\n geojson: GeoJSON,\n featureSelectionFilter = GeoJsonGraphUtils.DEFAULT_FEATURE_SELECTOR\n ) {\n\n // Get features array from GeoJSON input\n const features = getFeatures(geojson);\n const graphFeatures = features.filter(featureSelectionFilter);\n\n const edges: Edge[] = [];\n const vertices: Vertex[] = [];\n let nextVertexId = 0;\n\n // 1. Create a function to retrieve a vertex which has already been created and avoid duplicates\n const getOrCreateVertex = (position: Position, vertexLevel: Level_t) => {\n\n const coords = new Coordinates(position[1], position[0], null, vertexLevel);\n\n // Check if a vertex with same coordinates already exists\n let vertex: Vertex | null = vertices\n .find((vertex) => {\n if (!vertex.coords.equalsWithoutLevel(coords)) return false;\n if (Level.intersect(vertex.coords.level, vertexLevel)) return true;\n // Specific case of exits\n return vertex.coords.level === null || vertexLevel === null;\n }) || null;\n\n // If the vertex already exists, return it\n if (vertex) {\n // In the case where vertices are linked to edges with level change\n if (!Level.equals(vertex.coords.level, vertexLevel)) {\n vertex.coords.level = Level.intersection(vertex.coords.level, vertexLevel);\n if (vertex.coords.level === null) {\n vertex.coords.level = vertexLevel;\n }\n }\n return vertex;\n }\n\n // If it does not exist, create it\n vertex = new Vertex(coords);\n vertex.id = nextVertexId++;\n vertices.push(vertex);\n\n return vertex;\n };\n\n // 2. Go through LineString features to create edges and vertices\n graphFeatures.filter(feature => feature.geometry.type === 'LineString').forEach(feature => {\n\n const lineString = feature.geometry as LineString;\n const featureProperties = feature.properties || {};\n const edgeProperties = this.parseLineStringProperties(feature);\n // console.log(edgeProperties);\n const lineStringLevelString = 'level' in featureProperties ? featureProperties.level : null;\n const lineStringLevel = Level.fromString(lineStringLevelString);\n\n const processLineStringForLevel = (_level: Level_t) => {\n for (let i = 1; i < lineString.coordinates.length; i++) {\n\n let firstVertex = getOrCreateVertex(lineString.coordinates[i - 1], _level);\n let secondVertex = getOrCreateVertex(lineString.coordinates[i], _level);\n\n const isOnewayBackward = OsmTagsUtils.isOnewayBackward(featureProperties);\n if (isOnewayBackward) {\n const tmpVertex = secondVertex;\n secondVertex = firstVertex;\n firstVertex = tmpVertex;\n }\n\n const edge = new Edge(firstVertex, secondVertex, edgeProperties);\n edges.push(edge);\n }\n }\n\n processLineStringForLevel(lineStringLevel);\n if ('repeat_on' in featureProperties) {\n featureProperties.repeat_on.split(';').map(Level.fromString).forEach(processLineStringForLevel);\n }\n\n });\n\n const elevatorsVertices: {vertices: Vertex[], props: EdgeProperties}[] = [];\n const routingBoundsEntryPoints: Vertex[] = [];\n features.filter(feature => feature.geometry.type === 'Point').forEach(feature => {\n const properties = feature.properties || {};\n\n const point = feature.geometry as Point;\n const pointLevelString = 'level' in properties ? properties.level : null;\n const pointLevel = Level.fromString(pointLevelString);\n\n const coords = new Coordinates(point.coordinates[1], point.coordinates[0], null, pointLevel);\n const verticesWithSameCoordsAndIntersectLevels = vertices.filter(vertex => {\n if (!Coordinates.equalsWithoutLevel(vertex.coords, coords)) return false;\n if (Level.intersect(vertex.coords.level, pointLevel)) return true;\n // Specific case of exits\n return vertex.coords.level === null || pointLevel === null;\n });\n\n verticesWithSameCoordsAndIntersectLevels.forEach(vertex => {\n vertex.properties = this.parsePointProperties(feature as Feature<Point>);\n if (pointLevel !== null) {\n vertex.coords.level = Level.union(vertex.coords.level, pointLevel);\n }\n });\n\n\n if (OsmTagsUtils.isElevator(properties)) {\n const retrieveElevatorVertices = (position: Position, levelRange: Level_t) => {\n const coords = new Coordinates(position[1], position[0], null, levelRange);\n const elevatorVertices: Vertex[] = [];\n vertices.forEach(vertex => {\n if (Coordinates.equalsWithoutLevel(vertex.coords, coords) \n && Level.intersect(vertex.coords.level, levelRange)) {\n elevatorVertices.push(vertex);\n }\n });\n return elevatorVertices;\n }\n\n const elevatorVertices = retrieveElevatorVertices(point.coordinates, pointLevel);\n if (elevatorVertices.length > 0) {\n elevatorsVertices.push({ vertices: elevatorVertices, props: { name: properties.name, isElevator: true, externalId: properties.id } });\n }\n }\n\n if (OsmTagsUtils.isRoutingBoundsEntryPoint(properties)) {\n // Theoretically, there should be only one entry point per coordinates\n verticesWithSameCoordsAndIntersectLevels.forEach(vertex => {\n routingBoundsEntryPoints.push(vertex);\n });\n }\n });\n\n // 3. Manage elevators without explicit navigation graph inside.\n // It creates a graph from entries to the center of the elevator shape.\n features\n .filter(f => f.geometry.type === 'Polygon' && f.properties && OsmTagsUtils.isElevator(f.properties))\n .filter(f => {\n // Skip if the polygon already has elevator vertices inside\n // Note: this is a workaround to avoid creating elevators twice when contributor did a mistake\n const polygon = f.geometry as Polygon;\n return !elevatorsVertices\n .flatMap(({vertices}) => vertices)\n .some(v => booleanPointInPolygon([v.coords.lng, v.coords.lat], polygon));\n })\n .forEach(feature => {\n const polygon = feature as Feature<Polygon>;\n const entryVertices = polygon.geometry.coordinates[0]\n .map(p => vertices.filter(v => v.coords.equalsWithoutLevel(new Coordinates(p[1], p[0], null, v.coords.level))))\n .flat();\n\n // Horrible method but works for macro-problems\n const points = polygon.geometry.coordinates[0].slice(0, -1);\n const elevatorCenter = points\n .reduce((acc, p) => [acc[0] + p[0], acc[1] + p[1]], [0, 0])\n .map(val => val / points.length);\n const elevatorLevel = entryVertices.reduce((acc, v) => Level.union(acc, v.coords.level), null as Level_t);\n const elevatorCenterCoords = new Coordinates(elevatorCenter[1], elevatorCenter[0], null, elevatorLevel);\n\n const elevatorVertices: Vertex[] = [];\n entryVertices.forEach(entryVertex => {\n const vertexCenter = getOrCreateVertex([elevatorCenterCoords.lng, elevatorCenterCoords.lat], entryVertex.coords.level);\n edges.push(new Edge(vertexCenter, entryVertex, { externalId: feature.properties?.id }));\n elevatorVertices.push(vertexCenter);\n })\n elevatorsVertices.push({ vertices: elevatorVertices, props: { name: feature.properties?.name, isElevator: true, externalId: feature.properties?.id } });\n });\n\n\n // 4. Link elevators vertices\n elevatorsVertices.forEach(({vertices: elevatorVertices, props}) => {\n // Link vertices of each level together\n for (let i = 0; i < elevatorVertices.length; i++) {\n for (let j = i + 1; j < elevatorVertices.length; j++) {\n edges.push(new Edge(elevatorVertices[i], elevatorVertices[j], props));\n }\n }\n\n if (elevatorVertices.length === 1 && elevatorVertices[0].coords.level === null) {\n // Outdoor elevator\n const vertex = elevatorVertices[0];\n const vertexEdges = edges.filter(e => e.vertex1 === vertex || e.vertex2 === vertex);\n \n if (vertexEdges.length > 1) {\n // Keep existing vertex for first edge\n const elevatorVertices: Vertex[] = [vertex];\n for (let i = 1; i < vertexEdges.length; i++) {\n const clonedVertex = new Vertex(vertex.coords, vertex.properties);\n clonedVertex.id = nextVertexId++;\n vertices.push(clonedVertex);\n if (vertexEdges[i].vertex1 === vertex) {\n vertexEdges[i].vertex1 = clonedVertex;\n } else {\n vertexEdges[i].vertex2 = clonedVertex;\n }\n elevatorVertices.push(clonedVertex);\n }\n for (let i = 0; i < elevatorVertices.length; i++) {\n for (let j = i + 1; j < elevatorVertices.length; j++) {\n edges.push(new Edge(elevatorVertices[i], elevatorVertices[j], props));\n }\n }\n }\n }\n });\n\n // 5. Routing bounds\n const routingBounds: MultiPolygon = {\n type: 'MultiPolygon',\n coordinates: []\n };\n features.filter(f => f.properties && OsmTagsUtils.isRoutingBounds(f.properties)).forEach(feature => {\n if (feature.geometry.type === 'LineString') {\n const polygon = lineStringToPolygon(feature.geometry as LineString);\n routingBounds.coordinates.push(polygon.coordinates);\n } else if (feature.geometry.type === 'Polygon') {\n routingBounds.coordinates.push(feature.geometry.coordinates);\n } else if (feature.geometry.type === 'MultiPolygon') {\n routingBounds.coordinates.push(...(feature.geometry as MultiPolygon).coordinates);\n }\n });\n \n return new Graph(\n vertices,\n edges,\n routingBounds.coordinates.length > 0 ? routingBounds : undefined,\n routingBoundsEntryPoints\n );\n }\n\n}","import { Coordinates, Level, Level_t } from '@wemap/geo';\nimport { OsmModel, OsmNode, OsmWay, OsmTagsUtils, OsmParser } from '@wemap/osm';\nimport booleanPointInPolygon from '@turf/boolean-point-in-polygon';\nimport { MultiPolygon } from 'geojson';\n\nimport Graph from '../../graph/Graph.js';\nimport { default as Edge, type EdgeProperties } from '../../graph/Edge.js';\nimport { default as Vertex, type VertexProperties } from '../../graph/Vertex.js';\n\nexport default class OsmGraphUtils {\n\n static RESTRICTED_PEDESTRIANS_HIGHWAYS = ['motorway', 'motorway_link'];\n\n static DEFAULT_WAY_SELECTOR = (way: OsmWay) => {\n if (way.tags.area === 'yes') return false;\n if (way.tags.foot === 'yes') return true;\n if (way.tags.access && ['no', 'private'].includes(way.tags.access)) return false;\n\n const isElevatorArea = way.tags.highway === 'elevator' && way.isGeometryClosed\n return way.tags.highway && !OsmGraphUtils.RESTRICTED_PEDESTRIANS_HIGHWAYS.includes(way.tags.highway) && !isElevatorArea\n || way.tags.footway === 'sidewalk'\n || way.tags.public_transport === 'platform'\n || way.tags.railway === 'platform';\n };\n\n static parseNodeProperties(osmNode: OsmNode): VertexProperties {\n return {\n ...(osmNode.id && { externalId: osmNode.id }),\n ...(OsmTagsUtils.elementName(osmNode.tags) && { name: OsmTagsUtils.elementName(osmNode.tags) }),\n ...(OsmTagsUtils.isGate(osmNode.tags) && { isGate: true }),\n ...(OsmTagsUtils.isSubwayEntrance(osmNode.tags) && { isSubwayEntrance: true }),\n ...(OsmTagsUtils.getRef(osmNode.tags) && { subwayEntrsanceRef: OsmTagsUtils.getRef(osmNode.tags) }),\n ...(OsmTagsUtils.isTurnstile(osmNode.tags) && { isTurnstile: true })\n }\n }\n\n static parseWayProperties(osmWay: OsmWay): EdgeProperties {\n\n return {\n ...(osmWay.id && { externalId: osmWay.id }),\n ...(OsmTagsUtils.elementName(osmWay.tags) && { name: OsmTagsUtils.elementName(osmWay.tags) }),\n ...(OsmTagsUtils.isOneway(osmWay.tags) && { isOneway: OsmTagsUtils.isOneway(osmWay.tags) }),\n ...(OsmTagsUtils.areStairs(osmWay.tags) && { areStairs: OsmTagsUtils.areStairs(osmWay.tags) }),\n ...(OsmTagsUtils.isElevator(osmWay.tags) && { isElevator: OsmTagsUtils.isElevator(osmWay.tags) }),\n ...(OsmTagsUtils.isEscalator(osmWay.tags) && { areEscalators: OsmTagsUtils.isEscalator(osmWay.tags) }),\n ...(OsmTagsUtils.isMovingWalkway(osmWay.tags) && { isMovingWalkway: OsmTagsUtils.isMovingWalkway(osmWay.tags) }),\n ...(OsmTagsUtils.needTicket(osmWay.tags) && { needTicket: OsmTagsUtils.needTicket(osmWay.tags) }),\n ...(OsmTagsUtils.getIncline(osmWay.tags) && { incline: OsmTagsUtils.getIncline(osmWay.tags) }),\n ...(OsmTagsUtils.getWheelchair(osmWay.tags) && { wheelchair: OsmTagsUtils.getWheelchair(osmWay.tags) }),\n ...(OsmTagsUtils.getSmoothness(osmWay.tags) && { smoothness: OsmTagsUtils.getSmoothness(osmWay.tags) }),\n ...(OsmTagsUtils.getSurface(osmWay.tags) && { surface: OsmTagsUtils.getSurface(osmWay.tags) }),\n }\n }\n\n static createGraphFromOsmXmlString(osmXmlString: string) {\n const osmModel = OsmParser.parseOsmXmlString(osmXmlString);\n return this.createGraphFromOsmModel(osmModel);\n }\n\n static createGraphFromOsmModel(\n osmModel: OsmModel,\n waySelectionFilter = OsmGraphUtils.DEFAULT_WAY_SELECTOR,\n callbackVerticesMapping?: (mapping: [nodeId: number, vertex: Vertex][]) => void\n ) {\n\n const edges: Edge[] = [];\n const verticesMapping: [nodeId: number, vertex: Vertex][] = [];\n const elevatorVertices: [id: number, name: string | undefined, vertices: Vertex[]][] = [];\n const routingBoundsEntryPoints: Set<Vertex> = new Set();\n\n // 1. Create a function to retrieve a vertex which has already been created and avoid duplicates\n const getOrCreateVertex = (osmNode: OsmNode, nodeLevel: Level_t) => {\n\n // Check if a vertex with same coordinates already exists\n let vertex: Vertex | null = verticesMapping\n .find(([nodeId, v]) => {\n if (nodeId !== osmNode.id) return false;\n if (Level.intersect(v.coords.level, nodeLevel)) return true;\n // Specific case of exits\n return v.coords.level === null || nodeLevel === null;\n })?.[1] || null;\n\n // If the vertex already exists, return it\n if (vertex) {\n // In the case where vertices are linked to edges with level change\n if (!Level.equals(vertex.coords.level, nodeLevel)) {\n vertex.coords.level = Level.intersection(vertex.coords.level, nodeLevel);\n if (vertex.coords.level === null) {\n vertex.coords.level = nodeLevel;\n }\n }\n return vertex;\n }\n\n // If it does not exist, create it\n const newCoords = new Coordinates(osmNode.coords.lat, osmNode.coords.lng, null, nodeLevel)\n vertex = new Vertex(newCoords, this.parseNodeProperties(osmNode));\n\n verticesMapping.push([osmNode.id, vertex]);\n\n if (OsmTagsUtils.isElevator(osmNode.tags)) {\n let elevatorEntry = elevatorVertices.find(([id]) => osmNode.id === id);\n if (!elevatorEntry) {\n elevatorEntry = [osmNode.id, osmNode.name, []];\n elevatorVertices.push(elevatorEntry);\n }\n elevatorEntry[2].push(vertex);\n }\n\n if (OsmTagsUtils.isRoutingBoundsEntryPoint(osmNode.tags)) {\n routingBoundsEntryPoints.add(vertex);\n }\n\n return vertex;\n };\n\n // 2. Go through OSM ways to create edges and vertices\n osmModel.ways.forEach(way => {\n if (!waySelectionFilter(way)) {\n return;\n }\n\n const edgeProperties = this.parseWayProperties(way);\n\n const processWayForLevel = (_level: Level_t) => {\n for (let i = 1; i < way.nodes.length; i++) {\n\n let firstVertex = getOrCreateVertex(way.nodes[i - 1], _level);\n let secondVertex = getOrCreateVertex(way.nodes[i], _level);\n\n if (OsmTagsUtils.isOnewayBackward(way.tags)) {\n const tmpVertex = secondVertex;\n secondVertex = firstVertex;\n firstVertex = tmpVertex;\n }\n\n const edge = new Edge(firstVertex, secondVertex, edgeProperties);\n edges.push(edge);\n }\n }\n\n processWayForLevel(way.level);\n if (way.tags.repeat_on) {\n way.tags.repeat_on.split(';').map(Level.fromString).forEach(processWayForLevel);\n }\n\n });\n\n // 3. Manage elevators without explicit navigation graph inside.\n // It creates a graph from entries to the center of the elevator shape.\n let fakeOsmNodeId = -1;\n osmModel.ways\n .filter(way => OsmTagsUtils.isElevator(way.tags) && way.isGeometryClosed)\n .filter(way => {\n // Skip if the polygon already has elevator vertices inside\n // Note: this is a workaround to avoid creating elevators twice when contributor did a mistake\n const polygon = way.getGeoJsonPolygon();\n return !elevatorVertices\n .flatMap(([,,vertices]) => vertices)\n .some(vertex => booleanPointInPolygon([vertex.coords.lng, vertex.coords.lat], polygon)\n );\n })\n .forEach(way => {\n const entryVertices = way.nodes.map(node => verticesMapping.filter(([osmId]) => osmId === node.id).map(vm => vm[1])).flat();\n\n // Horrible method but works for macro-problems\n const elevatorCenter = way.nodes\n .reduce((acc, node) => [acc[0] + node.coords.lat, acc[1] + node.coords.lng], [0, 0])\n .map(val => val / way.nodes.length);\n const elevatorLevel = entryVertices.reduce((acc, v) => Level.union(acc, v.coords.level), null as Level_t);\n const elevatorCenterCoords = new Coordinates(elevatorCenter[0], elevatorCenter[1], null, elevatorLevel);\n\n const elevatorCenterFakeOsmNode = new OsmNode(fakeOsmNodeId--, elevatorCenterCoords, { highway: 'elevator' });\n\n entryVertices.forEach(entryVertex => {\n const vertexCenter = getOrCreateVertex(elevatorCenterFakeOsmNode, entryVertex.coords.level);\n edges.push(new Edge(vertexCenter, entryVertex, { externalId: way.id }));\n })\n });\n\n\n // 4. Link elevators vertices\n elevatorVertices.forEach(([id, name, verticesOfEachLevel]) => {\n const elevatorEdgeProps = { name, isElevator: true, externalId: id };\n // Link vertices of each level together\n for (let i = 0; i < verticesOfEachLevel.length; i++) {\n for (let j = i + 1; j < verticesOfEachLevel.length; j++) {\n edges.push(new Edge(verticesOfEachLevel[i], verticesOfEachLevel[j], elevatorEdgeProps));\n }\n }\n\n if (verticesOfEachLevel.length === 1 && verticesOfEachLevel[0].coords.level === null) {\n // Outdoor elevator\n const vertex = verticesOfEachLevel[0];\n const vertexEdges = edges.filter(e => e.vertex1 === vertex || e.vertex2 === vertex);\n \n if (vertexEdges.length > 1) {\n // Keep existing vertex for first edge\n const elevatorVertices: Vertex[] = [vertex];\n for (let i = 1; i < vertexEdges.length; i++) {\n const clonedVertex = new Vertex(vertex.coords, vertex.properties);\n verticesMapping.push([vertex.id, clonedVertex]);\n if (vertexEdges[i].vertex1 === vertex) {\n vertexEdges[i].vertex1 = clonedVertex;\n } else {\n vertexEdges[i].vertex2 = clonedVertex;\n }\n elevatorVertices.push(clonedVertex);\n }\n for (let i = 0; i < elevatorVertices.length; i++) {\n for (let j = i + 1; j < elevatorVertices.length; j++) {\n edges.push(new Edge(elevatorVertices[i], elevatorVertices[j], elevatorEdgeProps));\n }\n }\n }\n }\n });\n\n // 5. Routing bounds\n const routingBounds: MultiPolygon = {\n type: 'MultiPolygon',\n coordinates: []\n };\n\n osmModel.ways\n .filter((way) => OsmTagsUtils.isRoutingBounds(way.tags))\n .map(way => way.getGeoJsonPolygon())\n .forEach(polygon => polygon && routingBounds.coordinates.push(polygon.coordinates));\n\n osmModel.relations\n .filter((rel) => OsmTagsUtils.isRoutingBounds(rel.tags))\n .map(rel => rel.getGeoJsonPolygon())\n .forEach(polygon => polygon && routingBounds.coordinates.push(polygon.coordinates));\n\n callbackVerticesMapping?.(verticesMapping);\n \n return new Graph(verticesMapping.map(v => v[1]), edges, \n routingBounds.coordinates.length > 0 ? routingBounds : undefined, \n Array.from(routingBoundsEntryPoints));\n }\n\n}","import { GeoJSON } from 'geojson';\n\nimport { OsmParser } from '@wemap/osm';\n\nimport CustomGraphMap from './CustomGraphMap.js';\nimport Vertex from '../graph/Vertex.js';\nimport GeoJsonGraphUtils from '../import/geojson/GeoJsonGraphUtils.js';\nimport OsmGraphUtils from '../import/osm/OsmGraphUtils.js';\n\nexport type Report = {\n customGraphMap?: CustomGraphMap,\n errors: Error[],\n}\n\nexport type Error = CouldNotParseFileError\n | MultipleGraphComponentsError\n | RoutingBoundsNotFoundError\n | RoutingBoundsEntryPointsNotFoundError;\n\nexport type CouldNotParseFileError = {\n type: 'could-not-parse-file',\n details: string | undefined\n}\n\nexport type MultipleGraphComponentsError = {\n type: 'multiple-graph-components',\n data: Vertex[][]\n}\n\nexport type RoutingBoundsNotFoundError = {\n type: 'routing-bounds-not-found'\n}\n\nexport type RoutingBoundsEntryPointsNotFoundError = {\n type: 'routing-bounds-entry-points-not-found'\n}\n\nexport default class CustomGraphMapTester {\n\n // OSM\n\n static createReportFromOsmXmlString(osmXmlString: string): Report {\n let osmModel;\n try {\n osmModel = OsmParser.parseOsmXmlString(osmXmlString);\n } catch (e) {\n return {\n errors: [{\n type: 'could-not-parse-file',\n details: e instanceof Error ? e.message : \"Unknown error\"\n }]\n };\n }\n const customGraphMap = new CustomGraphMap(OsmGraphUtils.createGraphFromOsmModel(osmModel));\n return this.createReportFromCustomGraphMap(customGraphMap);\n }\n\n\n // GeoJSON\n\n static createReportFromGeoJsonString(geojsonString: string): Report {\n let geojson;\n try { \n geojson = JSON.parse(geojsonString);\n } catch (e) {\n return {\n errors: [{\n type: 'could-not-parse-file',\n details: e instanceof Error ? e.message : \"Unknown error\"\n }]\n };\n }\n return this.createReportFromGeoJson(geojson);\n }\n \n static createReportFromGeoJson(geojson: GeoJSON): Report {\n const customGraphMap = new CustomGraphMap(GeoJsonGraphUtils.createGraphFromGeojson(geojson));\n return this.createReportFromCustomGraphMap(customGraphMap);\n }\n\n // Common\n\n private static createReportFromCustomGraphMap(customGraphMap: CustomGraphMap): Report {\n\n const graph = customGraphMap.graph;\n\n const errors: Error[] = [];\n if (!graph.routingBounds) {\n errors.push({\n type: 'routing-bounds-not-found'\n });\n }\n\n if (graph.routingBoundsEntryPoints.length === 0) {\n errors.push({\n type: 'routing-bounds-entry-points-not-found'\n });\n }\n\n const components = customGraphMap.router.calculateComponents();\n if (components.length > 1) {\n errors.push({\n type: 'multiple-graph-components',\n data: components\n });\n }\n\n return { customGraphMap, errors };\n }\n\n static reportToJson(report: Report) {\n return {\n graph: report.customGraphMap?.graph?.toJson(),\n errors: report.errors.map(error => {\n if (error.type === 'multiple-graph-components') {\n return { type: error.type, data: error.data.map(c => c.map(v => v.id)) };\n }\n if (error.type === 'routing-bounds-entry-points-not-found') {\n return { type: error.type };\n }\n if (error.type === 'routing-bounds-not-found') {\n return { type: error.type };\n }\n return { type: error.type };\n })\n }\n }\n\n}\n\n","import { Coordinates } from '@wemap/geo';\n\nimport Itinerary from './model/Itinerary.js';\nimport Leg from './model/Leg.js';\nimport { Step } from './model/Step.js';\nimport Graph from './graph/Graph.js';\nimport GraphProjection from './graph/GraphProjection.js';\nimport Vertex from './graph/Vertex.js';\nimport Edge from './graph/Edge.js';\n\nexport type ItineraryInfo<U extends Coordinates = Coordinates> = {\n nextStep: Step | null;\n previousStep: Step | null;\n projection: GraphProjection<U>;\n leg: Leg;\n traveledDistance: number;\n remainingDistance: number;\n traveledPercentage: number;\n remainingPercentage: number;\n};\n\nclass ItineraryInfoManager {\n\n _itinerary: Itinerary | null = null;\n _graph: Graph | null = null;\n\n _steps: Step[] = [];\n _coordsNextStep: (Step | null)[] = [];\n _coordsPreviousStep: (Step | null)[] = [];\n _coordsDistanceTraveled: number[] = [];\n _coordsLeg: Leg[] = [];\n _itineraryDistanceWithoutProjections = 0;\n\n constructor(itinerary: Itinerary | null = null) {\n this.itinerary = itinerary;\n }\n\n get itinerary() {\n return this._itinerary;\n }\n\n set itinerary(itinerary) {\n\n if (itinerary === null) {\n this._itinerary = null;\n return;\n }\n\n this._itinerary = itinerary;\n this._steps = itinerary.steps;\n this._graph = itinerary.toGraph();\n\n this._coordsNextStep = new Array(itinerary.coords.length);\n this._coordsPreviousStep = new Array(itinerary.coords.length);\n this._coordsDistanceTraveled = new Array(itinerary.coords.length);\n this._coordsLeg = new Array(itinerary.coords.length);\n this._itineraryDistanceWithoutProjections = itinerary.distance;\n\n let stepId = 0;\n let previousStep: Step | null = null;\n let nextStep: Step | null = this._steps[0];\n let distanceTraveled = 0;\n\n itinerary.coords.forEach((coords, idx, arr) => {\n if (idx !== 0) {\n distanceTraveled += arr[idx - 1].distanceTo(coords);\n }\n\n this._coordsNextStep[idx] = nextStep;\n this._coordsPreviousStep[idx] = previousStep;\n this._coordsDistanceTraveled[idx] = distanceTraveled;\n this._coordsLeg[idx] = itinerary.legs.find(leg => leg.coords.includes(coords)) as Leg;\n\n if (stepId < this._steps.length && this._steps[stepId].coords.equals(coords)) {\n previousStep = this._steps[stepId];\n nextStep = stepId === this._steps.length - 1 ? null : this._steps[stepId + 1];\n stepId++;\n }\n });\n }\n\n getInfo<U extends Coordinates = Coordinates>(position: U) {\n\n if (!this._itinerary || !this._graph) {\n return null;\n }\n\n const projection = this._graph.getProjection(position);\n if (!projection) {\n return null;\n }\n\n let itineraryInfo: ItineraryInfo<U> | null = null;\n\n if (projection.nearestElement instanceof Vertex) {\n const idx = this._itinerary.coords.findIndex(\n coords => (projection.nearestElement as Vertex).coords === coords\n );\n if (idx === -1) {\n throw new Error('ItineraryInfoManager: could not find projection in itinerary (Node)');\n }\n\n const traveledDistanceOnItinerary = this._coordsDistanceTraveled[idx];\n\n // Traveled distance takes into account:\n // - projection of the origin\n const traveledDistance = traveledDistanceOnItinerary;\n\n // Remaining distance takes into account:\n // - projection of the current position\n // - distance remaining on the itinerary\n const remainingDistanceOnItinerary = this._itineraryDistanceWithoutProjections - traveledDistanceOnItinerary;\n const remainingDistance = projection.distanceFromNearestElement + remainingDistanceOnItinerary;\n\n const distanceForPercentage = traveledDistance + remainingDistance\n const traveledPercentage = traveledDistance / distanceForPercentage;\n const remainingPercentage = 1 - traveledPercentage;\n\n itineraryInfo = {\n nextStep: this._coordsNextStep[idx],\n previousStep: this._coordsPreviousStep[idx],\n projection: projection,\n leg: this._coordsLeg[idx],\n traveledDistance: traveledDistanceOnItinerary,\n remainingDistance,\n traveledPercentage,\n remainingPercentage\n };\n\n } else if (projection.nearestElement instanceof Edge) {\n\n let firstNode = projection.nearestElement.vertex1.coords;\n let idx = this._itinerary.coords.findIndex(coords => firstNode === coords);\n if (idx === -1) {\n throw new Error('ItineraryInfoManager: could not find projection in itinerary (Edge)');\n }\n\n // graphEdge is not necessarly ordered. We have to look for the first point\n if (idx === this._itinerary.coords.length - 1\n || this._itinerary.coords[idx + 1] !== projection.nearestElement.vertex2.coords\n ) {\n firstNode = projection.nearestElement.vertex2.coords;\n idx--;\n }\n\n const traveledDistanceOnItinerary = this._coordsDistanceTraveled[idx] \n + projection.coords.distanceTo(firstNode);\n \n // Traveled distance takes into account:\n // - distance traveled on the itinerary\n const traveledDistance = traveledDistanceOnItinerary;\n\n // Remaining distance takes into account:\n // - projection of the current position\n // - distance remaining on the itinerary\n const remainingDistanceOnItinerary = this._itineraryDistanceWithoutProjections - traveledDistanceOnItinerary;\n const remainingDistance = projection.distanceFromNearestElement + remainingDistanceOnItinerary \n\n const distanceForPercentage = traveledDistance + remainingDistance\n const traveledPercentage = traveledDistance / distanceForPercentage;\n const remainingPercentage = 1 - traveledPercentage;\n\n itineraryInfo = {\n nextStep: this._coordsNextStep[idx + 1],\n previousStep: this._coordsPreviousStep[idx + 1],\n projection: projection,\n leg: this._coordsLeg[idx + 1],\n traveledDistance,\n remainingDistance,\n traveledPercentage,\n remainingPercentage\n };\n\n }\n\n return itineraryInfo;\n }\n\n}\n\nexport default ItineraryInfoManager;\n"],"names":["GeoConstants","GeoUtils","_","window","undefined","regexes","ua","this","__defProp","__defNormalProp","__publicField","last","StatusCode","jsonToCoordinates","inputModeCorrespondance","transitModeCorrespondance","TRANSPORT_IDS","dateStringToTimestamp","via","apiKey","GeoveloRemoteRouter","Polyline","OsrmRemoteRouter","CitywayRemoteRouter","NavitiaRemoteRouter","DeutscheBahnRemoteRouter","IdfmRemoteRouter","OtpRemoteRouter","TictactripRemoteRouter","WemapMultiRemoteRouter","errors","RemoteRouterManager","pointInPolygon","global","iteratee","Buffer","Symbol","Uint8Array","Map","Promise","Set","entries","key","othValue","string","rewind","require$$0","require$$1","require$$2","i","way","rel","centroid","bounds","coords","node","feature","outer","inner","j","o","polygonFeatures","find","hasOwn","isHTMLVoidElement","isHTMLRawTextElement","isHTMLEscapableRawTextElement","isHTMLMimeType","MIME_TYPE","hasDefaultHTMLNamespace","isValidMimeType","NAMESPACE","conventions","DOMExceptionName","DOMException","ParseError","self","Comment","g","DOMImplementation","dom","freeze","XMLReader","a","end","position","appendElement","value","p","errorHandler","sax","require$$3","require$$4","DOMParser","chars","domParser","osmtogeojson","vertex","elevatorVertices","vertices","_a"],"mappings":";;;;;;;;;;;;;AA0BO,SAAS,oBAAoB,eAA8B;AAC9D,QAAM,EAAE,QAAQ,aAAa,WAAW,GAAG,KAAS,IAAA;AAC7C,SAAA;AAAA,IACH,QAAQ,OAAO,OAAO;AAAA,IACtB,aAAa,YAAY,OAAO;AAAA,IAChC,GAAI,aAAa,EAAE,WAAW,UAAU,IAAI,CAAK,MAAA,EAAE,OAAO,CAAC,EAAE;AAAA,IAC7D,GAAG;AAAA,EAAA;AAEX;ACJA,MAAqB,QAArB,MAAqB,MAAK;AAAA,EAUtB,YACW,SACA,SACA,aAA6B,CACpB,GAAA,KAAa,MAAK,mBACpC;AAXc;AAGA;AA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