@wemap/routers 13.2.0 → 13.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var e=Object.defineProperty,t=(t,r,n)=>(((t,r,n)=>{r in t?e(t,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[r]=n})(t,"symbol"!=typeof r?r+"":r,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("@wemap/geo"),n=require("@wemap/maths"),o=require("@wemap/logger"),i=require("@wemap/salesman.js"),s=require("@mapbox/polyline"),a=require("@turf/boolean-point-in-polygon"),l=require("@wemap/osm");const c=class e{constructor(n,o,i={},s=e.currentUniqueId++){t(this,"level"),t(this,"bearing"),t(this,"length"),this.vertex1=n,this.vertex2=o,this.properties=i,this.id=s,this.level=r.Level.union(n.coords.level,o.coords.level),this.length=this.vertex1.distanceTo(this.vertex2),this.bearing=this.vertex1.bearingTo(this.vertex2)}static getEdgeByVertices(e,t,r){return e.find((e=>t===e.vertex1&&r===e.vertex2||r===e.vertex1&&t===e.vertex2))}reverseProperties(){const{properties:e}=this;e.incline&&(e.incline="up"===e.incline?"down":"up"),e.isOneway&&(e.isOneway=!1)}};t(c,"currentUniqueId",0);let u=c;class d{constructor(e,t,r,n){this.origin=e,this.distanceFromNearestElement=t,this.coords=r,this.nearestElement=n}}class p{constructor(e,r={}){t(this,"id",-1),this.coords=e,this.properties=r}distanceTo(e){return this.coords.distanceTo(e.coords)}bearingTo(e){return this.coords.bearingTo(e.coords)}toJson(){return{id:this.id,coords:this.coords.toCompressedJson(),...Object.keys(this.properties).length>0&&{properties:this.properties}}}equals(e){return this.coords.equals(e.coords)}static fromJson(e){const t=new p(r.Coordinates.fromCompressedJson(e.coords),e.properties);return t.id=e.id,t}}class h{constructor(e,r,n=null,o=[]){t(this,"exitVertices"),this.vertices=e,this.edges=r,this.routingBounds=n,this.routingBoundsEntryPoints=o;const i=r.filter((e=>null===e.level)).map((e=>[e.vertex1,e.vertex2])).flat(),s=r.filter((e=>null!==e.level)).map((e=>[e.vertex1,e.vertex2])).flat();this.exitVertices=new Set(i.filter((e=>s.includes(e)))),null==o||o.forEach((e=>this.exitVertices.add(e)))}getEdgeByVertices(e,t){return u.getEdgeByVertices(this.edges,e,t)}getVertexByCoords(e){return h.getVertexByCoords(this.vertices,e)}static getVertexByCoords(e,t){return e.find((e=>e.coords.equals(t)))}getVertexByName(e){return this.vertices.find((t=>t.properties.name===e))}getVerticesByName(e){return this.vertices.filter((t=>t.properties.name===e))}getEdgeByName(e){return this.edges.find((t=>t.properties.name===e))}getEdgesByName(e){return this.edges.filter((t=>t.properties.name===e))}getBoundingBox(e){if(!this.vertices.length)return null;const t=r.BoundingBox.fromCoordinates(this.vertices.map((e=>e.coords)));return e&&t.extendsWithMeasure(e),t}getProjection(e,t={}){const o="maxDistance"in t,i=t.maxDistance,s="maxBearingAngle"in t;if(s&&(!(e instanceof r.UserPosition)||null===e.bearing))return null;const a=t.maxBearingAngle,l="acceptEdgeFn"in t,c=!("useMultiLevelSegments"in t)||t.useMultiLevelSegments;let u=null;const p=t=>{if(!(e instanceof r.UserPosition))return t;const n=e.clone();return n.lat=t.lat,n.lng=t.lng,n.level=t.level,n.alt=t.alt,n.heightFromFloor=t.heightFromFloor,n.heightFromGround=t.heightFromGround,n};return this.edges.forEach((h=>{if(l&&!t.acceptEdgeFn(h))return;if(!c&&r.Level.isRange(h.level))return;if(!r.Level.intersect(h.level,e.level))return;if(s&&n.diffAngleLines(h.bearing,e.bearing)>a)return;const m=e.getSegmentProjection(h.vertex1.coords,h.vertex2.coords);if(!m)return;const f=m.distanceTo(e);o&&f>i||f<((null==u?void 0:u.distanceFromNearestElement)??Number.MAX_VALUE)&&(u=new d(e,f,p(m),h))})),s||this.vertices.forEach((t=>{let n=t.coords;if(this.exitVertices.has(t)&&null===e.level&&(n=t.coords.clone(),n.level=null),!c&&r.Level.isRange(n.level))return;if(!r.Level.intersect(n.level,e.level))return;const s=n.distanceTo(e);s<r.Constants.EPS_MM?u=new d(e,0,p(n),t):o&&s>i||s<((null==u?void 0:u.distanceFromNearestElement)??Number.MAX_VALUE)&&(u=new d(e,s,p(n),t))})),u}toJson(){return{vertices:this.vertices.map((e=>e.toJson())),edges:this.edges.map((e=>({id:e.id,vertex1Idx:this.vertices.indexOf(e.vertex1),vertex2Idx:this.vertices.indexOf(e.vertex2),...Object.keys(e.properties).length>0&&{properties:e.properties}}))),...this.routingBounds&&{routingBounds:this.routingBounds},...this.routingBoundsEntryPoints.length>0&&{routingBoundsEntryPoints:this.routingBoundsEntryPoints.map((e=>e.id))}}}static fromJson(e){var t;const r=e.vertices.map((e=>p.fromJson(e))),n=e.edges.map((e=>new u(r[e.vertex1Idx],r[e.vertex2Idx],e.properties,e.id)));return new h(r,n,e.routingBounds,null==(t=e.routingBoundsEntryPoints)?void 0:t.map((e=>r[e])))}toCompressedJson(){return{vertices:this.vertices.map((e=>e.coords.toCompressedJson())),verticesIds:this.vertices.map((e=>e.id)),edges:this.edges.map((e=>{const t=this.vertices.indexOf(e.vertex1),r=this.vertices.indexOf(e.vertex2),n=e.properties;return Object.keys(n).length>0?[t,r,n]:[t,r]}))}}static fromCompressedJson(e){const t=e.vertices.map((e=>new p(r.Coordinates.fromCompressedJson(e)))),n=e.edges.map((e=>new u(t[e[0]],t[e[1]],e.length>2?e[2]:{})));return new h(t,n)}static fromCoordinatesSegments(e){const t=[],r=[],n=e=>{const r=t.find((t=>t.coords.equals(e)));if(r)return r;const n=new p(e);return t.push(n),n};for(const o of e){let e=null;for(const t of o){const o=n(t);e&&r.push(new u(o,e)),e=o}}return new h(t,r)}getEdgesAtLevel(e,t=!0){return this.edges.filter((({level:n})=>t?r.Level.intersect(e,n):r.Level.contains(e,n)))}toDetailedString(){let e=`--- Network ---\nVertices: ${this.vertices.length}\nEdges: ${this.edges.length}\n---\nVertices\n`;return this.vertices.forEach((t=>{e+=t.id;const r=t.properties;0!==Object.keys(r).length&&(e+=` ${r}`)})),e+="---\nEdges\n",this.edges.forEach((t=>{e+=`${t.id} - [v1: ${t.vertex1.id}, v2: ${t.vertex2.id}]`;const r=t.properties;0!==Object.keys(r).length&&(e+=` ${r}`)})),e+="---",e}}function m(e,t=5){return e/(1e3*t/3600)}function f(e){const t=n.positiveMod(n.rad2deg(e),360);return t>0&&t<60?"sharp-right":t>=60&&t<140?"right":t>=140&&t<160?"slight-right":t>=160&&t<=200?"straight":t>200&&t<=220?"slight-left":t>220&&t<=300?"left":t>300&&t<360?"sharp-left":"u-turn"}function g(e){return["AIRPLANE","BOAT","BUS","FERRY","FUNICULAR","METRO","MULTI","TRAIN","TRAM"].includes(e)}function v(e,t){return e===t||g(e)&&"TRANSIT"===t||"WALK"===e&&"TRANSIT"===t}function y(e){return{...e.firstStep&&{firstStep:!0},...e.lastStep&&{lastStep:!0},number:e.number,type:e.type,coords:e.coords.toCompressedJson(),...null!==e.name&&{name:e.name},angle:Number(e.angle.toFixed(2)),previousBearing:Number(e.previousBearing.toFixed(2)),nextBearing:Number(e.nextBearing.toFixed(2)),distance:Number(e.distance.toFixed(1)),duration:Number(e.duration.toFixed(1)),levelDifference:e.levelDifference,direction:e.direction}}function b(e){return{...e,coords:r.Coordinates.fromCompressedJson(e.coords),firstStep:Boolean(e.firstStep),lastStep:Boolean(e.lastStep),name:e.name||null,levelDifference:e.levelDifference||null}}function w(e){return!!e&&("up"===e.direction||"down"===e.direction)}class E extends h{constructor(e,t,r,n,o){super(r,n),this.start=e,this.end=t,this.vertices=r,this.edges=n,this.edgesWeights=o}reverse(){const e=this.vertices.slice().reverse(),t=this.edges.slice().reverse(),r=this.edgesWeights.slice().reverse();return t.map((e=>new u(e.vertex2,e.vertex1,e.properties))),new E(this.start,this.end,e,t,r)}static fromCoordinates(e,t,r){const n=h.fromCoordinatesSegments([r]),o=n.edges.map((e=>m(e.length)));return new E(e,t,n.vertices,n.edges,o)}get hasRoute(){return Boolean(this.vertices.length)}}const T=n.deg2rad(20);class N{constructor(){t(this,"start",null),t(this,"end",null),t(this,"pathCoords",null),t(this,"stepsInfo",[])}setStart(e){return this.start=e,this}setEnd(e){return this.end=e,this}setPathCoords(e){return this.pathCoords=e,this}setStepsInfo(e){return this.stepsInfo=e,this}addStepInfo(e){return this.stepsInfo.push(e),this}setGraphRoute(e){const t=[],{start:o,end:i}=e;if(!e.hasRoute)return this;let s=null,a=o.bearingTo(e.vertices[0].coords);for(let c=0;c<e.vertices.length-1;c++){const o=e.vertices[c],i=o.coords,l=e.vertices[c+1],u=l.coords,d=e.edges[c],p=o.bearingTo(l),h=n.diffAngle(a,p+Math.PI),m=t.length?t[t.length-1]:null,{isSubwayEntrance:g,isGate:v,subwayEntranceRef:y}=o.properties,{isElevator:b,areEscalators:E,areStairs:N,isMovingWalkway:_,incline:S}=d.properties;let x;!N&&!b||!S||null!==(null==m?void 0:m.levelDifference)&&void 0!==(null==m?void 0:m.levelDifference)||(x=S);const A=c>0?e.edges[c-1]:null,I=(null==A?void 0:A.properties)||{},O=Boolean(I.incline&&I.areStairs&&(!S||!N)),R=o.properties.isSubwayEntrance,C=d.properties.name||y||null,D=e.edgesWeights[c];let L=Math.abs(n.diffAngle(Math.PI,h))>=T;const M=r.Level.isRange(d.level)&&!r.Level.isRange(i.level)||x;L=L&&!(i.level&&r.Level.isRange(i.level));const k=w(m)&&!r.Level.isRange(i.level)||O;if(!s||(L||M||k||R)){let e=null,n="turn";b?n="elevator":E?n="escalator":N?n="stairs":g?n="subway-entrance":v?n="gate":_?n="moving-walkway":M&&(n="incline-plane");let o=f(h);M&&(e=r.Level.diff(i.level,u.level)||0,o=e>0?"up":"down",x&&(o=x)),s={coords:i,...C&&{name:C},type:n,direction:o,levelDifference:e,distance:0,duration:0},t.push(s)}s.distance+=i.distanceTo(u),s.duration+=D,a=p}const l=e.vertices[e.vertices.length-1].coords;return r.Coordinates.equals(l,i)||t.push({coords:l,type:"arrive",direction:null}),this.setStart(o),this.setEnd(i),this.setPathCoords(e.vertices.map((e=>e.coords))),this.setStepsInfo(t),this}build(){const{pathCoords:e,start:t,end:r}=this;if(!e)return o.warn('StepsBuilder: Missing "pathCoords" property to build steps'),[];if(!t)return o.warn('StepsBuilder: Missing "from" property to build steps'),[];if(!r)return o.warn('StepsBuilder: Missing "to" property to build steps'),[];0===this.stepsInfo.length&&this.setGraphRoute(E.fromCoordinates(t,r,e));const{stepsInfo:i}=this;return i.map(((o,s)=>{const a=e.findIndex((e=>e.equals(o.coords)));if(-1===a)throw new Error("Cannot find step coordinates in itinerary coordinates.");const l=0===a?t:e[a-1],c=a===e.length-1?r:e[a+1],u=l.bearingTo(o.coords),d=o.coords.bearingTo(c),p=n.diffAngle(u,d+Math.PI);let h=o.type;const g=o.direction||f(p),v=0===s;let y=0;const b=s===i.length-1,w=b?e[e.length-1]:i[s+1].coords;let E=a;for(;!e[E].equals(w);)y+=e[E].distanceTo(e[E+1]),E++;return h||(h="straight"===g?"continue":g.includes("left")||g.includes("right")||"u-turn"===g?"turn":v?"depart":b?"arrive":null),{coords:o.coords,direction:"transit"===h?null:g,type:h,levelDifference:void 0!==o.levelDifference?o.levelDifference:null,name:o.name||null,number:s+1,previousBearing:u,nextBearing:d,angle:p,firstStep:v,lastStep:b,distance:y,duration:o.duration||m(y)}}))}}class _{constructor({start:e,end:n,coords:o,transitMode:i,duration:s,startTime:a,endTime:l,transportInfo:c,steps:u}){t(this,"start"),t(this,"end"),t(this,"coords"),t(this,"distance"),t(this,"transitMode"),t(this,"duration"),t(this,"startTime"),t(this,"endTime"),t(this,"steps"),t(this,"transportInfo"),this.start={name:e.name||null,coords:e.coords},this.end={name:n.name||null,coords:n.coords},this.coords=o,this.transitMode=i,this.distance=r.Utils.calcDistance(o),this.duration="number"==typeof s?s:m(this.distance),this.startTime="number"==typeof a?a:null,this.endTime="number"==typeof l?l:null,this.transportInfo=c||null,this.steps=Array.isArray(u)?u:(new N).setStart(e.coords).setEnd(n.coords).setPathCoords(o).build()}isPublicTransport(){return g(this.transitMode)}toGraph(){return h.fromCoordinatesSegments([this.coords])}static equals(e,t){var r,n;if(!(e.transitMode===t.transitMode&&Math.abs(e.duration-t.duration)<=.05&&e.startTime===t.startTime&&e.endTime===t.endTime&&e.start.name===t.start.name&&e.start.coords.equals(t.start.coords)&&e.end.name===t.end.name&&e.end.coords.equals(t.end.coords)&&e.coords.length===t.coords.length&&(e.steps===t.steps||(null==(r=e.steps)?void 0:r.length)===(null==(n=t.steps)?void 0:n.length))))return!1;let o;for(o=0;o<e.coords.length;o++)if(!e.coords[o].equals(t.coords[o]))return!1;for(o=0;o<e.steps.length;o++)if(i=e.steps[o],s=t.steps[o],!(i.coords.equals(s.coords)&&Math.abs(i.angle-s.angle)<=.005&&Math.abs(i.distance-s.distance)<=.05&&Math.abs(i.duration-s.duration)<=.05&&i.firstStep===s.firstStep&&i.lastStep===s.lastStep&&i.levelDifference===s.levelDifference&&i.type===s.type&&i.direction===s.direction&&i.name===s.name&&Math.abs(i.nextBearing-s.nextBearing)<=.005&&i.number===s.number&&Math.abs(i.previousBearing-s.previousBearing)<=.005))return!1;var i,s;if(e.transportInfo!==t.transportInfo){if(null===e.transportInfo||null===t.transportInfo)return!1;if(e.transportInfo.name!==t.transportInfo.name||e.transportInfo.routeColor!==t.transportInfo.routeColor||e.transportInfo.routeTextColor!==t.transportInfo.routeTextColor||e.transportInfo.directionName!==t.transportInfo.directionName)return!1}return!0}equals(e){return _.equals(this,e)}toJson(){return{transitMode:this.transitMode,start:{coords:this.start.coords.toCompressedJson(),...this.start.name&&{name:this.start.name}},end:{coords:this.end.coords.toCompressedJson(),...this.end.name&&{name:this.end.name}},distance:Number(this.distance.toFixed(1)),duration:Number(this.duration.toFixed(1)),coords:this.coords.map((e=>e.toCompressedJson())),steps:this.steps.map(y),...null!==this.startTime&&{startTime:this.startTime},...null!==this.endTime&&{endTime:this.endTime},...null!==this.transportInfo&&{transportInfo:this.transportInfo}}}static fromJson(e){var t;return new _(Object.assign({},e,{start:{coords:r.Coordinates.fromCompressedJson(e.start.coords),name:e.start.name||null},end:{coords:r.Coordinates.fromCompressedJson(e.end.coords),name:e.end.name||null},coords:e.coords.map(r.Coordinates.fromCompressedJson),steps:(null==(t=e.steps)?void 0:t.map(b))||null}))}static fromGraphRoute(e,t="WALK"){return new _({start:{coords:e.start},end:{coords:e.end},coords:e.vertices.map((e=>e.coords)),duration:e.edgesWeights.reduce(((e,t)=>e+t),0),transitMode:t,steps:(new N).setGraphRoute(e).build()})}multiplyLevel(e){this.start.coords.level=r.Level.multiplyBy(this.start.coords.level,e),this.end.coords.level=r.Level.multiplyBy(this.end.coords.level,e);for(const t of this.coords)t.level=r.Level.multiplyBy(t.level,e);this.steps.forEach((t=>{t.coords.level=r.Level.multiplyBy(t.coords.level,e)}))}}class S{constructor({origin:e,destination:r,duration:n,legs:o,startTime:i,endTime:s}){t(this,"origin"),t(this,"destination"),t(this,"duration"),t(this,"legs"),t(this,"_transitMode",null),t(this,"startTime"),t(this,"endTime"),t(this,"_coords",null),t(this,"_distance",null),this.origin=e,this.destination=r,this.legs=o,this.duration="number"==typeof n?n:this.legs.reduce(((e,t)=>e+t.duration),0),this.startTime="number"==typeof i?i:null,this.endTime="number"==typeof s?s:null,this.updateStepsFromLegs()}set coords(e){throw new Error("Itinerary.coords cannot be set. They are calculated from Itinerary.legs.")}get coords(){return this._coords||(this._coords=this.legs.map((e=>e.coords)).flat().filter(((e,t,r)=>0===t||!r[t-1].equals(e)))),this._coords}set steps(e){throw new Error("Itinerary.step cannot be set. They are calculated from Itinerary.legs.")}get steps(){return this.legs.map((e=>e.steps)).flat()}set price(e){throw new Error("Itinerary.price cannot be set. They are calculated from Itinerary.legs.")}get price(){return this.legs.reduce(((e,t)=>{var r;return e+((null==(r=t.transportInfo)?void 0:r.price)||0)}),0)}set transitMode(e){throw new Error("Itinerary.transitMode cannot be set. They are calculated from Itinerary.legs.")}get transitMode(){if(!this._transitMode){const e=new Set(this.legs.map((e=>e.transitMode)));if(e.delete("WALK"),e.size>1)return this._transitMode="MULTI",this._transitMode;if(1===e.size)return this._transitMode=e.values().next().value,this._transitMode;this._transitMode="WALK"}return this._transitMode}set distance(e){throw new Error("Itinerary.distance cannot be set. They are calculated from Itinerary.legs.")}get distance(){return null===this._distance&&(this._distance=r.Utils.calcDistance(this.coords)),this._distance}toGraph(){return h.fromCoordinatesSegments([this.coords])}static fromItineraries(...e){return new S({origin:e[0].origin,destination:e[e.length-1].destination,legs:e.map((e=>e.legs)).flat()})}static fromOrderedPointsArray(e,t,n){const o=e=>new r.Coordinates(e[0],e[1],null,e[2]);return this.fromOrderedCoordinates(e.map(o),o(t),o(n))}static fromOrderedCoordinates(e,t,r,n="WALK"){const o=(new N).setPathCoords(e).setStart(t).setEnd(r).build(),i=new _({start:{coords:t},end:{coords:r},coords:e,transitMode:n,steps:o});return new S({origin:t,destination:r,legs:[i]})}static equals(e,t){if(!(e.origin.equals(t.origin)&&e.destination.equals(t.destination)&&Math.abs(e.distance-t.distance)<=.05&&Math.abs(e.duration-t.duration)<=.05&&e.startTime===t.startTime&&e.endTime===t.endTime&&e.legs.length===t.legs.length))return!1;for(let r=0;r<e.legs.length;r++)if(!e.legs[r].equals(t.legs[r]))return!1;return!0}equals(e){return S.equals(this,e)}toJson(){return{origin:this.origin.toJson(),destination:this.destination.toJson(),distance:Number(this.distance.toFixed(1)),duration:Number(this.duration.toFixed(1)),transitMode:this.transitMode,legs:this.legs.map((e=>e.toJson())),...null!==this.startTime&&{startTime:this.startTime},...null!==this.endTime&&{endTime:this.endTime}}}static fromJson(e){return new S({origin:r.Coordinates.fromJson(e.origin),destination:r.Coordinates.fromJson(e.destination),duration:e.duration,legs:e.legs.map(_.fromJson),startTime:e.startTime,endTime:e.endTime})}static fromGraphRoute(e,t="WALK"){const r=_.fromGraphRoute(e,t);return new S({origin:e.start,destination:e.end,legs:[r]})}multiplyLevel(e){this.origin.level=r.Level.multiplyBy(this.origin.level,e),this.destination.level=r.Level.multiplyBy(this.destination.level,e),this.legs.forEach((t=>t.multiplyLevel(e)))}forceUnknownLevelTo0(){this.origin.level=this.origin.level||0,this.destination.level=this.destination.level||0;for(const e of this.legs){e.start.coords.level=e.start.coords.level||0,e.end.coords.level=e.end.coords.level||0;for(const t of e.coords)t.level=t.level||0;if(e.steps)for(const t of e.steps)t.coords.level=t.coords.level||0}if(this._coords)for(const e of this._coords)e.level=e.level||0}toGeoJson(){const e=(e,t,r)=>({type:"Feature",properties:{name:t,level:e.level,...r&&{type:r}},geometry:{type:"Point",coordinates:[e.lng,e.lat]}}),t=[...new Set(this.coords.map((e=>r.Level.toString(e.level))))].map(r.Level.fromString).map((e=>[e,r.Utils.createSegmentsAtLevel(this.coords,e,!0)])).map((([e,t])=>((e,t)=>({type:"Feature",properties:{level:t,name:null==t?void 0:t.toString()},geometry:{type:"MultiLineString",coordinates:e.map((e=>e.map((({lat:e,lng:t})=>[t,e]))))}}))(t,e))),n=this.legs.map(((t,r)=>e(t.start.coords,`Leg ${r} start`,"leg-start"))),o=this.legs.map(((t,r)=>e(t.end.coords,`Leg ${r} end`,"leg-end"))),i=this.steps.map((t=>e(t.coords,`Step ${t.number}`,"step")));return{type:"FeatureCollection",features:[e(this.origin,"origin","origin"),e(this.destination,"destination","destination"),...t,...n,...o,...i]}}updateStepsFromLegs(){const e=this.coords.filter(((e,t,r)=>0===t||!r[t-1].equals(e))),t=this.legs.map((e=>e.steps)).flat();t.map(((r,o)=>{const i=e.findIndex((e=>e.equals(r.coords)));if(-1===i)throw new Error("Cannot find step coordinates in itinerary coordinates.");const s=0===i?this.origin:e[i-1],a=i===e.length-1?this.destination:e[i+1];r.previousBearing=s.bearingTo(r.coords),r.nextBearing=r.coords.bearingTo(a),r.angle=n.diffAngle(r.previousBearing,r.nextBearing+Math.PI);const l=r.distance;r.distance=0;const c=o!==t.length-1?t[o+1].coords:e[e.length-1];let u=i;for(;!e[u].equals(c);)r.distance+=e[u].distanceTo(e[u+1]),u++;if(u===e.length-1&&(r.distance+=e[u].distanceTo(this.destination)),r.number=o+1,r.firstStep=0===o,r.lastStep=o===t.length-1,"arrive"===r.type&&!r.lastStep||"depart"===r.type&&!r.firstStep){const e=r.direction;e&&(e.includes("left")||e.includes("right")||"u-turn"===e)?r.type="turn":r.type="continue"}r.duration+=m(r.distance-l)}))}}var x="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function A(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var I,O,R={exports:{}};I=R,O=R.exports,function(e,t){var r="function",n="undefined",o="object",i="string",s="major",a="model",l="name",c="type",u="vendor",d="version",p="architecture",h="console",m="mobile",f="tablet",g="smarttv",v="wearable",y="embedded",b="Amazon",w="Apple",E="ASUS",T="BlackBerry",N="Browser",_="Chrome",S="Firefox",x="Google",A="Huawei",R="LG",C="Microsoft",D="Motorola",L="Opera",M="Samsung",k="Sharp",U="Sony",P="Xiaomi",q="Zebra",B="Facebook",F="Chromium OS",j="Mac OS",G=function(e){for(var t={},r=0;r<e.length;r++)t[e[r].toUpperCase()]=e[r];return t},W=function(e,t){return typeof e===i&&-1!==H(t).indexOf(H(e))},H=function(e){return e.toLowerCase()},V=function(e,t){if(typeof e===i)return e=e.replace(/^\s\s*/,""),typeof t===n?e:e.substring(0,350)},$=function(e,n){for(var i,s,a,l,c,u,d=0;d<n.length&&!c;){var p=n[d],h=n[d+1];for(i=s=0;i<p.length&&!c&&p[i];)if(c=p[i++].exec(e))for(a=0;a<h.length;a++)u=c[++s],typeof(l=h[a])===o&&l.length>0?2===l.length?typeof l[1]==r?this[l[0]]=l[1].call(this,u):this[l[0]]=l[1]:3===l.length?typeof l[1]!==r||l[1].exec&&l[1].test?this[l[0]]=u?u.replace(l[1],l[2]):t:this[l[0]]=u?l[1].call(this,u,l[2]):t:4===l.length&&(this[l[0]]=u?l[3].call(this,u.replace(l[1],l[2])):t):this[l]=u||t;d+=2}},z=function(e,r){for(var n in r)if(typeof r[n]===o&&r[n].length>0){for(var i=0;i<r[n].length;i++)if(W(r[n][i],e))return"?"===n?t:n}else if(W(r[n],e))return"?"===n?t:n;return e},Y={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},K={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[d,[l,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[d,[l,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[l,d],[/opios[\/ ]+([\w\.]+)/i],[d,[l,L+" Mini"]],[/\bopr\/([\w\.]+)/i],[d,[l,L]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(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,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[l,d],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[d,[l,"UC"+N]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[d,[l,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[d,[l,"WeChat"]],[/konqueror\/([\w\.]+)/i],[d,[l,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[d,[l,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[d,[l,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[l,/(.+)/,"$1 Secure "+N],d],[/\bfocus\/([\w\.]+)/i],[d,[l,S+" Focus"]],[/\bopt\/([\w\.]+)/i],[d,[l,L+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[d,[l,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[d,[l,"Dolphin"]],[/coast\/([\w\.]+)/i],[d,[l,L+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[d,[l,"MIUI "+N]],[/fxios\/([-\w\.]+)/i],[d,[l,S]],[/\bqihu|(qi?ho?o?|360)browser/i],[[l,"360 "+N]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[l,/(.+)/,"$1 "+N],d],[/(comodo_dragon)\/([\w\.]+)/i],[[l,/_/g," "],d],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[l,d],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[l],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[l,B],d],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[l,d],[/\bgsa\/([\w\.]+) .*safari\//i],[d,[l,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[d,[l,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[d,[l,_+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[l,_+" WebView"],d],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[d,[l,"Android "+N]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[l,d],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[d,[l,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[d,l],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[l,[d,z,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[l,d],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[l,"Netscape"],d],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[d,[l,S+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[l,d],[/(cobalt)\/([\w\.]+)/i],[l,[d,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[p,"amd64"]],[/(ia32(?=;))/i],[[p,H]],[/((?:i[346]|x)86)[;\)]/i],[[p,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[p,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[p,"armhf"]],[/windows (ce|mobile); ppc;/i],[[p,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[p,/ower/,"",H]],[/(sun4\w)[;\)]/i],[[p,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[p,H]]],device:[[/\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],[a,[u,M],[c,f]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[a,[u,M],[c,m]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[a,[u,w],[c,m]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[a,[u,w],[c,f]],[/(macintosh);/i],[a,[u,w]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[a,[u,k],[c,m]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[a,[u,A],[c,f]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[a,[u,A],[c,m]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[a,/_/g," "],[u,P],[c,m]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[a,/_/g," "],[u,P],[c,f]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[a,[u,"OPPO"],[c,m]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[a,[u,"Vivo"],[c,m]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[a,[u,"Realme"],[c,m]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[a,[u,D],[c,m]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[a,[u,D],[c,f]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[a,[u,R],[c,f]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[a,[u,R],[c,m]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[a,[u,"Lenovo"],[c,f]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[a,/_/g," "],[u,"Nokia"],[c,m]],[/(pixel c)\b/i],[a,[u,x],[c,f]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[a,[u,x],[c,m]],[/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],[a,[u,U],[c,m]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[a,"Xperia Tablet"],[u,U],[c,f]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[a,[u,"OnePlus"],[c,m]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[a,[u,b],[c,f]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[a,/(.+)/g,"Fire Phone $1"],[u,b],[c,m]],[/(playbook);[-\w\),; ]+(rim)/i],[a,u,[c,f]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[a,[u,T],[c,m]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[a,[u,E],[c,f]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[a,[u,E],[c,m]],[/(nexus 9)/i],[a,[u,"HTC"],[c,f]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[u,[a,/_/g," "],[c,m]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[a,[u,"Acer"],[c,f]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[a,[u,"Meizu"],[c,m]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[u,a,[c,m]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[u,a,[c,f]],[/(surface duo)/i],[a,[u,C],[c,f]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[a,[u,"Fairphone"],[c,m]],[/(u304aa)/i],[a,[u,"AT&T"],[c,m]],[/\bsie-(\w*)/i],[a,[u,"Siemens"],[c,m]],[/\b(rct\w+) b/i],[a,[u,"RCA"],[c,f]],[/\b(venue[\d ]{2,7}) b/i],[a,[u,"Dell"],[c,f]],[/\b(q(?:mv|ta)\w+) b/i],[a,[u,"Verizon"],[c,f]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[a,[u,"Barnes & Noble"],[c,f]],[/\b(tm\d{3}\w+) b/i],[a,[u,"NuVision"],[c,f]],[/\b(k88) b/i],[a,[u,"ZTE"],[c,f]],[/\b(nx\d{3}j) b/i],[a,[u,"ZTE"],[c,m]],[/\b(gen\d{3}) b.+49h/i],[a,[u,"Swiss"],[c,m]],[/\b(zur\d{3}) b/i],[a,[u,"Swiss"],[c,f]],[/\b((zeki)?tb.*\b) b/i],[a,[u,"Zeki"],[c,f]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[u,"Dragon Touch"],a,[c,f]],[/\b(ns-?\w{0,9}) b/i],[a,[u,"Insignia"],[c,f]],[/\b((nxa|next)-?\w{0,9}) b/i],[a,[u,"NextBook"],[c,f]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[u,"Voice"],a,[c,m]],[/\b(lvtel\-)?(v1[12]) b/i],[[u,"LvTel"],a,[c,m]],[/\b(ph-1) /i],[a,[u,"Essential"],[c,m]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[a,[u,"Envizen"],[c,f]],[/\b(trio[-\w\. ]+) b/i],[a,[u,"MachSpeed"],[c,f]],[/\btu_(1491) b/i],[a,[u,"Rotor"],[c,f]],[/(shield[\w ]+) b/i],[a,[u,"Nvidia"],[c,f]],[/(sprint) (\w+)/i],[u,a,[c,m]],[/(kin\.[onetw]{3})/i],[[a,/\./g," "],[u,C],[c,m]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[a,[u,q],[c,f]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[a,[u,q],[c,m]],[/smart-tv.+(samsung)/i],[u,[c,g]],[/hbbtv.+maple;(\d+)/i],[[a,/^/,"SmartTV"],[u,M],[c,g]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[u,R],[c,g]],[/(apple) ?tv/i],[u,[a,w+" TV"],[c,g]],[/crkey/i],[[a,_+"cast"],[u,x],[c,g]],[/droid.+aft(\w)( bui|\))/i],[a,[u,b],[c,g]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[a,[u,k],[c,g]],[/(bravia[\w ]+)( bui|\))/i],[a,[u,U],[c,g]],[/(mitv-\w{5}) bui/i],[a,[u,P],[c,g]],[/Hbbtv.*(technisat) (.*);/i],[u,a,[c,g]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[u,V],[a,V],[c,g]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[c,g]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[u,a,[c,h]],[/droid.+; (shield) bui/i],[a,[u,"Nvidia"],[c,h]],[/(playstation [345portablevi]+)/i],[a,[u,U],[c,h]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[a,[u,C],[c,h]],[/((pebble))app/i],[u,a,[c,v]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[a,[u,w],[c,v]],[/droid.+; (glass) \d/i],[a,[u,x],[c,v]],[/droid.+; (wt63?0{2,3})\)/i],[a,[u,q],[c,v]],[/(quest( 2| pro)?)/i],[a,[u,B],[c,v]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[u,[c,y]],[/(aeobc)\b/i],[a,[u,b],[c,y]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[a,[c,m]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[a,[c,f]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[c,f]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[c,m]],[/(android[-\w\. ]{0,9});.+buil/i],[a,[u,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[d,[l,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[d,[l,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[l,d],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[d,l]],os:[[/microsoft (windows) (vista|xp)/i],[l,d],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[l,[d,z,Y]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[l,"Windows"],[d,z,Y]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/ios;fbsv\/([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[d,/_/g,"."],[l,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[l,j],[d,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[d,l],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[l,d],[/\(bb(10);/i],[d,[l,T]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[d,[l,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[d,[l,S+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[d,[l,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[d,[l,"watchOS"]],[/crkey\/([\d\.]+)/i],[d,[l,_+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[l,F],d],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([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,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[l,d],[/(sunos) ?([\w\.\d]*)/i],[[l,"Solaris"],d],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[l,d]]},J=function(h,g){if(typeof h===o&&(g=h,h=t),!(this instanceof J))return new J(h,g).getResult();var v=typeof e!==n&&e.navigator?e.navigator:t,y=h||(v&&v.userAgent?v.userAgent:""),b=v&&v.userAgentData?v.userAgentData:t,w=g?function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r}(K,g):K,E=v&&v.userAgent==y;return this.getBrowser=function(){var e,n={};return n[l]=t,n[d]=t,$.call(n,y,w.browser),n[s]=typeof(e=n[d])===i?e.replace(/[^\d\.]/g,"").split(".")[0]:t,E&&v&&v.brave&&typeof v.brave.isBrave==r&&(n[l]="Brave"),n},this.getCPU=function(){var e={};return e[p]=t,$.call(e,y,w.cpu),e},this.getDevice=function(){var e={};return e[u]=t,e[a]=t,e[c]=t,$.call(e,y,w.device),E&&!e[c]&&b&&b.mobile&&(e[c]=m),E&&"Macintosh"==e[a]&&v&&typeof v.standalone!==n&&v.maxTouchPoints&&v.maxTouchPoints>2&&(e[a]="iPad",e[c]=f),e},this.getEngine=function(){var e={};return e[l]=t,e[d]=t,$.call(e,y,w.engine),e},this.getOS=function(){var e={};return e[l]=t,e[d]=t,$.call(e,y,w.os),E&&!e[l]&&b&&"Unknown"!=b.platform&&(e[l]=b.platform.replace(/chrome os/i,F).replace(/macos/i,j)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return y},this.setUA=function(e){return y=typeof e===i&&e.length>350?V(e,350):e,this},this.setUA(y),this};J.VERSION="1.0.35",J.BROWSER=G([l,d,s]),J.CPU=G([p]),J.DEVICE=G([a,u,c,h,m,g,f,v,y]),J.ENGINE=J.OS=G([l,d]),I.exports&&(O=I.exports=J),O.UAParser=J;var X=typeof e!==n&&(e.jQuery||e.Zepto);if(X&&!X.ua){var Q=new J;X.ua=Q.getResult(),X.ua.get=function(){return Q.getUA()},X.ua.set=function(e){Q.setUA(e);var t=Q.getResult();for(var r in t)X.ua[r]=t[r]}}}("object"==typeof window?window:x);var C=Object.defineProperty,D=(e,t,r)=>(((e,t,r)=>{t in e?C(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);const L="Unknown",M="Safari",k="Firefox",U="Opera",P="Chrome",q="iOS-webview";class B{static getName(){if(!this._name)if("undefined"!=typeof navigator&&navigator){const{userAgent:e}=navigator;e.match(/Firefox/i)?this._name=k:e.match(/(Opera|OPR)/i)?this._name=U:e.match(/Chrome/i)?this._name=P:e.match(/Safari/i)?this._name=M:e.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Version)/i)?this._name=q:this._name=L}else this._name=L;return this._name}static get isMobile(){if(null===this._isMobile&&(this._isMobile=!1,"undefined"!=typeof navigator&&navigator)){const e=navigator.userAgent||navigator.vendor;e&&(/(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(e)||/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(e.substr(0,4)))&&(this._isMobile=!0)}return this._isMobile}static clearCache(){this._name=null,this._isMobile=null}}D(B,"_name",null),D(B,"_isMobile",null);const F=[4215763,14529296,11869460,48895,16468400,45661,13290186];const j=Object.freeze(Object.defineProperty({__proto__:null,getQualitativeColor:function(e){return F[e%F.length]}},Symbol.toStringTag,{value:"Module"}));const G=Object.freeze(Object.defineProperty({__proto__:null,formatSO:function(e,...t){let r=e.toString();if(t.length){const e=typeof t[0],n="string"===e||"number"===e?t.slice():t[0];for(const t in n)r=r.replace(new RegExp("\\{"+t+"\\}","gi"),n[t])}return r},toUpperCase:function(e){return e.toUpperCase()}},Symbol.toStringTag,{value:"Module"})),W=4,H=3,V={wheelchair:{horrible:.1,bad:.5,intermediate:.7,good:.9,excellent:1},default:{horrible:.4,bad:.7,intermediate:.8,good:.9,excellent:1}},$={wheelchair:{asphalt:1,concrete:1,paved:1,paving_stones:.8,compacted:.7,wood:.6,metal:.5,gravel:.3,grass:.2,ground:.2},default:{asphalt:1,concrete:1,paved:1,paving_stones:.9,compacted:.8,wood:.8,metal:.7,gravel:.6,grass:.5,ground:.4}},z=class e{constructor(){t(this,"avoidStairs",!1),t(this,"avoidEscalators",!1),t(this,"avoidElevators",!1),t(this,"avoidMovingWalkways",!1),t(this,"avoidTicketRestrictedAreas",!1),t(this,"useMultiLevelSegments",!1),t(this,"projectionMaxDistance"),t(this,"isWheelchair",!1)}setAvoidStairs(e){return this.avoidStairs=e,this}setAvoidEscalators(e){return this.avoidEscalators=e,this}setAvoidElevators(e){return this.avoidElevators=e,this}setAvoidMovingWalkways(e){return this.avoidMovingWalkways=e,this}setAvoidTicketRestrictedAreas(e){return this.avoidTicketRestrictedAreas=e,this}setUseMultiLevelSegments(e){return this.useMultiLevelSegments=e,this}setIsWheelchair(e){return this.isWheelchair=e,this}static fromJson(t){const r=new e;return Object.assign(r,t),r.build()}build(){return{input:{avoidStairs:this.avoidStairs,avoidEscalators:this.avoidEscalators,avoidElevators:this.avoidElevators,avoidMovingWalkways:this.avoidMovingWalkways,avoidTicketRestrictedAreas:this.avoidTicketRestrictedAreas,isWheelchair:this.isWheelchair,projectionMaxDistance:this.projectionMaxDistance},weightEdgeFn:e=>{if(e.properties.isElevator)return 90;const t=this.isWheelchair?H:W;let r=m(e.length,t);if(e.properties.areStairs)r*=3;else if(e.properties.areEscalators)r*=1.5;else if(e.properties.isMovingWalkway)r*=.8;else if(e.properties.smoothness){const t=this.isWheelchair?"wheelchair":"default";r*=V[t][e.properties.smoothness]??1}else if(e.properties.surface){const t=this.isWheelchair?"wheelchair":"default";r*=$[t][e.properties.surface]??1}else"limited"===e.properties.wheelchair&&(r*=.5);return r},weightVertexFn:e=>e.properties.isTurnstile?10:0,acceptEdgeFn:e=>{if(e.properties.wheelchair){if(this.isWheelchair&&"no"===e.properties.wheelchair)return!1;if(!this.isWheelchair&&"designated"===e.properties.wheelchair)return!1}if(this.isWheelchair){if(e.properties.areStairs)return!1;if(e.properties.areEscalators)return!1;if(e.properties.isMovingWalkway)return!1}return(!this.avoidStairs||!e.properties.areStairs)&&((!this.avoidEscalators||!e.properties.areEscalators)&&((!this.avoidElevators||!e.properties.isElevator)&&((!this.avoidMovingWalkways||!e.properties.isMovingWalkway)&&(!this.avoidTicketRestrictedAreas||!e.properties.needTicket))))},projectionMaxDistance:this.projectionMaxDistance,useMultiLevelSegments:this.useMultiLevelSegments}}};t(z,"DEFAULT",(new z).build()),t(z,"WITHOUT_STAIRS",(new z).setAvoidStairs(!0).build()),t(z,"WHEELCHAIR",(new z).setIsWheelchair(!0).build());let Y=z;class K{constructor(e,t,r,n,o){this.prev=e,this.dist=t,this.source=r,this.targets=n,this.edges=o}routeVertices(e=this.targets[0],t=[]){const r=this.prev[e.id];return null===r?this.source===e?[...t,e]:[]:[...this.routeVertices(r,t),e]}weightedDistance(e=this.targets[0]){const t=this.dist[e.id];return t===Number.MAX_VALUE?null:t}route(e=this.targets[0]){const t=this.routeVertices(e),r=[],n=[];for(let o=1;o<t.length;o++){const e=t[o-1],i=t[o],s=u.getEdgeByVertices(this.edges,e,i),a=new u(e,i,Object.assign({},s.properties));s.vertex1===a.vertex2&&a.reverseProperties(),r.push(a),n.push(this.dist[i.id]-this.dist[e.id])}return new E(this.source.coords,e.coords,t,r,n)}toGeoJson(e){return{type:"FeatureCollection",features:[...e.vertices.map((e=>{const t=this.prev[e.id],r=this.dist[e.id],n=e===this.source,o=this.targets.includes(e),i=e.coords.level;return{type:"Feature",properties:{id:e.id,...t&&{prev:t.id},dist:r===Number.MAX_VALUE?"infinity":r,...n&&{name:"source"},...o&&{name:"target"},...null!==i&&{level:i},...e.properties},geometry:{type:"Point",coordinates:[e.coords.lng,e.coords.lat]}}})),...e.edges.map((e=>{const t=e.level;return{type:"Feature",properties:{id:e.id,...null!==t&&{level:t},...e.properties},geometry:{type:"LineString",coordinates:[[e.vertex1.coords.lng,e.vertex1.coords.lat],[e.vertex2.coords.lng,e.vertex2.coords.lat]]}}}))]}}}class J{constructor(e){t(this,"disabledEdges",new Set),this.graph=e;let r=0;e.vertices.forEach((e=>e.id=r++))}calculateShortestPathToMultipleDestinationsByVertex(e,t,r=Y.DEFAULT,n=this.graph.vertices,o=this.graph.edges){const i=new Set(n),s=Array(i.size).fill(Number.MAX_VALUE),a=new Array(i.size).fill(null),l=o.filter((e=>{var t;return((null==(t=r.acceptEdgeFn)?void 0:t.call(r,e))??!0)&&!this.disabledEdges.has(e)})),c=r.weightEdgeFn||(e=>e.length),u=r.weightVertexFn||(e=>0),d=e=>{let t=Number.MAX_VALUE,r=null;return e.forEach((e=>{const n=s[e.id];n<=t&&(t=n,r=e)})),r},p=new Set(t);for(s[e.id]=0;i.size>0;){const e=d(i);if(i.delete(e),t.includes(e)&&(p.delete(e),0===p.size))break;l.filter((t=>t.vertex1==e||!t.properties.isOneway&&t.vertex2==e)).forEach((t=>{const r=e===t.vertex1?t.vertex2:t.vertex1,n=c(t)+u(r),o=s[e.id]+n;o<s[r.id]&&(s[r.id]=o,a[r.id]=e)}))}return new K(a,s,e,t,l)}calculateShortestPathByVertex(e,t,r=Y.DEFAULT,n=this.graph.vertices,o=this.graph.edges){return this.calculateShortestPathToMultipleDestinationsByVertex(e,[t],r,n,o)}calculateComponents(){function e(e){const t=e.values().next().value;return e.delete(t),t}const t=new Set(this.graph.vertices);let r,n=[];for(;t.size>0;){const r=e(t),o=this.graph.vertices.filter((e=>e.id!==r.id)),i=this.calculateShortestPathToMultipleDestinationsByVertex(r,o),s=o.filter((e=>null!==i.weightedDistance(e)));n.push([r,...s]),s.forEach((e=>t.delete(e)))}do{r=!1;for(let e=0;e<n.length-1;e++){const t=n[e];for(let o=e+1;o<n.length;o++){const e=n[o];e.some((e=>t.includes(e)))&&(t.push(...e),n=n.filter((t=>t!==e)),r=!0)}}}while(r);return n.map((e=>[...new Set(e)]))}toGeoJson(){const e=this.calculateComponents().map(((e,t)=>({type:"Feature",geometry:{type:"MultiLineString",coordinates:this.graph.edges.filter((t=>e.includes(t.vertex1)&&e.includes(t.vertex2))).map((e=>[[e.vertex1.coords.lng,e.vertex1.coords.lat],[e.vertex2.coords.lng,e.vertex2.coords.lat]]))},properties:{stroke:"#"+j.getQualitativeColor(t).toString(16)}})));return{type:"FeatureCollection",features:e}}}class X extends K{constructor(e,t,r){super(e.prev,e.dist,e.source,e.targets,e.edges),this.sourceProjection=t,this.targetsProjections=r}static createEmpty(e,t){const r=t.length,n=new K(new Array(r).fill(null),new Array(r).fill(Number.MAX_VALUE),new p(e),t.map((e=>new p(e))),[]),o=[e,null],i=t.map((e=>[e,null]));return new X(n,o,i)}routeVertices(e=this.targetsProjections[0][0]){var t;if(e instanceof p)return super.routeVertices(e);if(!this.sourceProjection[1])return[];const r=null==(t=this.targetsProjections.find((([t])=>t===e)))?void 0:t[1];return r?super.routeVertices(r):[]}weightedDistance(e=this.targetsProjections[0][0]){var t;if(e instanceof p)return super.weightedDistance(e);if(!this.sourceProjection[1])return null;const r=null==(t=this.targetsProjections.find((([t])=>t===e)))?void 0:t[1];return r?super.weightedDistance(r):null}route(e=this.targetsProjections[0][0]){var t;if(e instanceof p)return super.route(e);const r=null==(t=this.targetsProjections.find((([t])=>t===e)))?void 0:t[1];if(!r)return new E(this.sourceProjection[0],e,[],[],[]);const n=super.route(r);return n.start=this.sourceProjection[0],n.end=e,n}}class Q extends J{calculateShortestPathToMultipleDestinations(e,t,r=Y.DEFAULT){const n=new Set,o=new Set,i=[],s={maxDistance:r.projectionMaxDistance,acceptEdgeFn:r.acceptEdgeFn,useMultiLevelSegments:r.useMultiLevelSegments},a=e=>{const t=this.graph.getProjection(e,s);if(null===t)return null;if(t.nearestElement instanceof p)return t.nearestElement;if(t.nearestElement instanceof u){const e=t.nearestElement,r=new p(t.coords,{name:`proj on ${e.properties.name||null} (tmp)`,...void 0!==e.properties.externalId&&{externalId:e.properties.externalId}});r.id=this.graph.vertices.length+n.size;const s={...e.properties,...void 0!==e.properties.externalId&&{externalId:e.properties.externalId}},a=new u(e.vertex1,r,s),l=new u(r,e.vertex2,s);n.add(r),o.add(a),o.add(l);const c=i.find((t=>t[0]===e));return c?c[1].push(r):i.push([e,[r]]),r}return null},l=a(e);if(!l)return X.createEmpty(e,t);const c=t.map((e=>[e,a(e)])),d=c.map((([,e])=>e)).filter((e=>null!==e));i.filter((e=>e[1].length>=2)),i.forEach((([e,t])=>{const r={...e.properties,name:`splitted ${e.properties.name||null} (tmp)`};for(let n=0;n<t.length;n++){const i=t[n],s=i.distanceTo(e.vertex1);for(let a=n+1;a<t.length;a++){const n=t[a],l=n.distanceTo(e.vertex1)<s?new u(n,i,r):new u(i,n,r);o.add(l)}}}));const h=this.calculateShortestPathToMultipleDestinationsByVertex(l,d,r,[...this.graph.vertices,...n],[...this.graph.edges,...o]);return new X(h,[e,l],c)}calculateShortestPath(e,t,r=Y.DEFAULT){return this.calculateShortestPathToMultipleDestinations(e,[t],r)}getShortestTrip(e,t,r=.99){const n=e.map((e=>{const t=new i.Point(0,0);return t.coords=e,t})),o=[],s=i.solve(n,r,void 0,((e,r)=>{const n=this.calculateShortestPath(e.coords,r.coords,t).route();return o.push(n),n.hasRoute?n.edgesWeights.reduce(((e,t)=>e+t),0):Number.MAX_VALUE})).map((e=>n[e])),a=[];for(let i=0;i<s.length;i++){const e=s[i],t=s[(i+1)%s.length];let r=o.find((r=>r.start===e.coords&&r.end===t.coords||r.end===e.coords&&r.start===t.coords));(null==r?void 0:r.end)===e.coords&&(r=r.reverse()),r&&a.push(r)}return a.some((e=>!e.hasRoute))?[]:a}}class Z extends Error{constructor(e,t,r=null){super(),this.start=e,this.end=t,this.details=r}get startStr(){return this.start instanceof p?`Vertex ${this.start.coords.toString()}`:this.start.toString()}get endStr(){return this.end instanceof p?`Vertex ${this.end.coords.toString()}`:Array.isArray(this.end)?this.end.map((e=>e instanceof p?e.coords.toString():e.toString())).join(","):this.end.toString()}get message(){let e=`No route found from ${this.startStr} to ${this.endStr}.`;return this.details&&(e+=` Details: ${this.details}`),e}}class ee{}var te=(e=>(e[e.OK=0]="OK",e[e.CANCELLED=1]="CANCELLED",e[e.UNKNOWN=2]="UNKNOWN",e[e.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",e[e.NOT_FOUND=5]="NOT_FOUND",e[e.UNIMPLEMENTED=12]="UNIMPLEMENTED",e[e.INTERNAL=13]="INTERNAL",e[e.UNAVAILABLE=14]="UNAVAILABLE",e[e.UNAUTHENTICATED=16]="UNAUTHENTICATED",e))(te||{});class re extends Error{constructor(e=te.UNKNOWN,r){super(r),t(this,"customMapName"),this.code=e}static notFound(e){return new re(te.NOT_FOUND,`Cannot found an itinerary. Details: ${e}`)}}class ne extends re{constructor(e=te.UNKNOWN,t,r){super(e,r),this.code=e,this.mapName=t,this.mapName=t}static notFound(e,t){return new ne(te.NOT_FOUND,e,`Cannot found an itinerary in map ${e}. Details: ${t||"No details"}`)}}class oe extends re{constructor(e=te.UNKNOWN,t,r){super(e,r),this.code=e,this.routerName=t,this.routerName=t}static notFound(e,t){return new oe(te.NOT_FOUND,e,`Cannot found an itinerary with ${e}. Details: ${t||"No details"}`)}static missingApiKey(e,t){return new oe(te.UNAUTHENTICATED,e,`API key is missing for ${e}. Details: ${t}`)}static unreachableServer(e,t){return new oe(te.NOT_FOUND,e,`Remote router server ${e} is unreachable. URL: ${t}`)}static responseNotParsing(e,t){return new oe(te.NOT_FOUND,e,`Remote router server response ${e} cannot be parsed. URL: ${t}`)}static travelModeUnimplemented(e,t){return new oe(te.UNIMPLEMENTED,e,`Travel mode "${t}" is not implemented for ${e}`)}}function ie(e,t,r,n,o,i,s="Europe/Paris"){const a=new Date(Date.UTC(e,t,r,n,o,i)),l=new Date(a.toLocaleString("en-US",{timeZone:"UTC"})),c=new Date(a.toLocaleString("en-US",{timeZone:s})),u=l.getTime()-c.getTime();return a.setTime(a.getTime()+u),a}function se(e){return new r.Coordinates(e.Lat,e.Long)}function ae(e){const[t,r]=e.split(" "),[n,o,i]=t.split("/"),[s,a,l]=r.split(":");return ie(Number(i),Number(o)-1,Number(n),Number(s),Number(a),Number(l)).getTime()}const le=new Map;le.set("CAR","Car"),le.set("WALK","Walk"),le.set("BIKE","Bike"),le.set("TRANSIT","PT");const ce=new Map;ce.set("WALK","WALK"),ce.set("BICYCLE","BIKE"),ce.set("TRAMWAY","TRAM"),ce.set("METRO","METRO"),ce.set("FUNICULAR","FUNICULAR"),ce.set("BUS","BUS"),ce.set("COACH","BUS"),ce.set("SCHOOL","BUS"),ce.set("BUS_PMR","BUS"),ce.set("MINIBUS","BUS"),ce.set("TROLLEY_BUS","BUS"),ce.set("TAXIBUS","BUS"),ce.set("SHUTTLE","BUS"),ce.set("TRAIN","TRAIN"),ce.set("HST","TRAIN"),ce.set("LOCAL_TRAIN","TRAIN"),ce.set("AIR","AIRPLANE"),ce.set("FERRY","BOAT"),ce.set("TAXI","UNKNOWN"),ce.set("CAR_POOL","UNKNOWN"),ce.set("PRIVATE_VEHICLE","CAR"),ce.set("SCOOTER","MOTO");const ue=new Map;function de(e){const t=e.match(/LINESTRING ?\((.*)\)/i),n=e.match(/POINT ?\((.*)\)/i);if(n){const[e,t]=n[1].split(" ");return[new r.Coordinates(Number(t),Number(e))]}return t[1].split(",").map((e=>{const t=e.trim().split(" ");return new r.Coordinates(Number(t[1]),Number(t[0]))}))}ue.set(0,"BUS"),ue.set(1,"WALK"),ue.set(2,"BIKE"),ue.set(3,"CAR"),ue.set(4,"UNKNOWN"),ue.set(5,"UNKNOWN"),ue.set(6,"UNKNOWN"),ue.set(7,"UNKNOWN"),ue.set(8,"UNKNOWN"),ue.set(9,"UNKNOWN"),ue.set(10,"UNKNOWN"),ue.set(11,"UNKNOWN"),ue.set(12,"UNKNOWN"),ue.set(13,"UNKNOWN"),ue.set(14,"UNKNOWN");const pe=new class extends ee{get rname(){return"cityway"}async getItineraries(e,t){const r=this.getURL(e,t),n=await fetch(r).catch((()=>{throw oe.unreachableServer(this.rname,r)})),o=await n.json().catch((()=>{throw oe.responseNotParsing(this.rname,r)}));return this.parseResponse(o)}getURL(e,t){const{origin:r,destination:n,travelMode:i,waypoints:s}=t,a=le.get(i);if(!a)throw oe.travelModeUnimplemented(this.rname,i);(s||[]).length>0&&o.warn(`${this.rname} router uses only the first 2 waypoints (asked ${null==s?void 0:s.length})`);const l=`DepartureLatitude=${r.latitude}&DepartureLongitude=${r.longitude}`,c=`ArrivalLatitude=${n.latitude}&ArrivalLongitude=${n.longitude}`,u=`TripModes=${a}`,d=new URL(e);t.departureTime&&(d.searchParams.set("Date",t.departureTime),d.searchParams.set("TypeDate","Departure"));let{search:p}=d;return p=(p?`${p}&`:"?")+`${l}&${c}&${u}`,`${d.origin}${d.pathname}${p}`}parseResponse(e){if(200!==e.StatusCode||!e.Data||!e.Data.length)throw oe.notFound(this.rname,e.Message);const t=[],r=e.Data.map((e=>e.response.trips.Trip.map((t=>({...t,...e.hasOwnProperty("PlanTripType")&&{PlanTripType:e.PlanTripType}}))))).flat();e:for(const n of r){if(n.hasOwnProperty("PlanTripType")&&"UNKNOWN"===ue.get(n.PlanTripType))continue;const e=[];for(const t of n.sections.Section){const r=t.Leg?t.Leg:t.PTRide,i=ce.get(r.TransportMode),s=[];let a,l,c;const u=new N;if("UNKNOWN"===i)continue e;if("WALK"===i||"BIKE"===i||"CAR"===i){a={name:r.Departure.Site.Name,coords:se(r.Departure.Site.Position)},l={name:r.Arrival.Site.Name,coords:se(r.Arrival.Site.Position)};for(const e of r.pathLinks.PathLink){let t;t=e.Geometry&&"Null"!==e.Geometry?de(e.Geometry):[a.coords,l.coords],t.forEach(((e,t)=>{0===t&&0!==s.length&&s[s.length-1].equals(e)||s.push(e)})),u.addStepInfo({coords:t[0],distance:e.Distance,name:e.Departure.Site.Name})}t===n.sections.Section[n.sections.Section.length-1]&&u.addStepInfo({coords:s[s.length-1]})}else{if(!g(i)){o.warn(`[CitywayParser] Unknown leg mode: ${r.TransportMode}`);continue}{a={name:r.Departure.StopPlace.Name,coords:se(r.Departure.StopPlace.Position)},l={name:r.Arrival.StopPlace.Name,coords:se(r.Arrival.StopPlace.Position)};let e=r.Line.Number;"TRAM"===i&&e.toLowerCase().includes("tram")&&(e=e.substr(5)),c={name:e,routeColor:r.Line.Color,routeTextColor:r.Line.TextColor,directionName:r.Destination};for(const t of r.steps.Step){de(t.Geometry).forEach(((e,t)=>{0===t&&0!==s.length&&s[s.length-1].equals(e)||s.push(e)}))}u.addStepInfo({coords:s[0],name:r.Line.Name,distance:r.Distance,type:"transit"})}}u.setStart(a.coords),u.setEnd(l.coords),u.setPathCoords(s);const d=new _({transitMode:i,duration:this.parseDuration(r.Duration),startTime:ae(r.Departure.Time),endTime:ae(r.Arrival.Time),coords:s,start:a,end:l,transportInfo:c,steps:u.build()});e.push(d)}const r=new S({duration:this.parseDuration(n.Duration),startTime:ae(n.Departure.Time),origin:se(n.Departure.Site.Position),endTime:ae(n.Arrival.Time),destination:se(n.Arrival.Site.Position),legs:e});t.push(r)}return t}parseDuration(e){const t=e.match(/(-)?P(?:([.,\d]+)Y)?(?:([.,\d]+)M)?(?:([.,\d]+)W)?(?:([.,\d]+)D)?T(?:([.,\d]+)H)?(?:([.,\d]+)M)?(?:([.,\d]+)S)?/),r=void 0===t[2]?0:Number(t[2]),n=void 0===t[3]?0:Number(t[3]),o=void 0===t[4]?0:Number(t[4]),i=void 0===t[5]?0:Number(t[5]),s=void 0===t[6]?0:Number(t[6]),a=void 0===t[7]?0:Number(t[7]);return(void 0===t[8]?0:Number(t[8]))+60*a+3600*s+86400*i+604800*o+2592e3*n+31557600*r}},he=new Map;he.set("Air","AIRPLANE"),he.set("Boat","BOAT"),he.set("Bus","BUS"),he.set("BusRapidTransit","BUS"),he.set("Coach","BUS"),he.set("Ferry","FERRY"),he.set("Funicular","FUNICULAR"),he.set("LocalTrain","TRAIN"),he.set("LongDistanceTrain","TRAIN"),he.set("Metro","METRO"),he.set("Métro","METRO"),he.set("RailShuttle","TRAIN"),he.set("RapidTransit","BUS"),he.set("Shuttle","BUS"),he.set("SuspendedCableCar","FUNICULAR"),he.set("Taxi","TAXI"),he.set("Train","TRAIN"),he.set("RER","TRAIN"),he.set("Tramway","TRAM"),he.set("walking","WALK"),he.set("bike","BIKE");const me=["physical_mode:Air","physical_mode:Boat","physical_mode:Bus","physical_mode:BusRapidTransit","physical_mode:Coach","physical_mode:Ferry","physical_mode:Funicular","physical_mode:LocalTrain","physical_mode:LongDistanceTrain","physical_mode:Metro","physical_mode:RailShuttle","physical_mode:RapidTransit","physical_mode:Shuttle","physical_mode:SuspendedCableCar","physical_mode:Taxi","physical_mode:Train","physical_mode:Tramway"];function fe(e){return new r.Coordinates(Number(e.lat),Number(e.lon))}function ge(e){return e[e.length-1]}function ve(e,t){const r=e.substr(0,4),n=e.substr(4,2),o=e.substr(6,2),i=e.substr(9,2),s=e.substr(11,2),a=e.substr(13,2);return ie(Number(r),Number(n)-1,Number(o),Number(i),Number(s),Number(a),t).getTime()}const ye=new class extends ee{get rname(){return"navitia"}async getItineraries(e,t){const r=this.getURL(e,t),n=r.searchParams.get("api_key");if(!n)throw oe.missingApiKey(this.rname);const o=await fetch(r,{method:"GET",headers:{Authorization:n}}).catch((()=>{throw oe.unreachableServer(this.rname,r.toString())})),i=await o.json().catch((()=>{throw oe.responseNotParsing(this.rname,r.toString())}));if(i&&i.error)throw oe.notFound(this.rname,i.error.message);const s=this.parseResponse(i);if(!s.some((e=>v(e.transitMode,t.travelMode))))throw oe.notFound(this.rname,"Selected mode of transport was not found for this itinerary.");return s}getURL(e,t){var r;const{origin:n,destination:i,waypoints:s,travelMode:a}=t;(s||[]).length>0&&o.warn(`${this.rname} router uses only the first 2 waypoints (asked ${null==s?void 0:s.length})`);const l=new URL(e),c=new URLSearchParams;c.set("from",`${n.longitude};${n.latitude}`),c.set("to",`${i.longitude};${i.latitude}`),c.set("data_freshness","realtime"),(null==(r=t.itineraryModifiers)?void 0:r.isWheelchair)&&c.set("wheelchair","true");let u=new URLSearchParams;switch(a){case"WALK":u=this.getWalkingQuery();break;case"BIKE":u=this.getBikeQuery();break;case"CAR":u=this.getCarQuery()}return[c,u].map((e=>{for(const t of e.entries())l.searchParams.append(t[0],t[1])})),l}getCarQuery(){const e=new URLSearchParams;return me.forEach((t=>{e.append("forbidden_uris[]",t)})),e.append("first_section_mode[]","walking"),e.append("first_section_mode[]","car"),e.append("last_section_mode[]","walking"),e.append("last_section_mode[]","car"),e}getWalkingQuery(){const e=new URLSearchParams;return me.forEach((t=>{e.append("forbidden_uris[]",t)})),e.append("first_section_mode[]","walking"),e.append("last_section_mode[]","walking"),e}getBikeQuery(){const e=new URLSearchParams;return me.forEach((t=>{e.append("forbidden_uris[]",t)})),e.append("first_section_mode[]","bike"),e.append("last_section_mode[]","bike"),e}getSectionCoords(e){let t,r;return t="stop_point"in e.from?e.from.stop_point.coord:"address"in e.from?e.from.address.coord:e.from.poi.coord,r="stop_point"in e.to?e.to.stop_point.coord:"address"in e.to?e.to.address.coord:e.to.poi.coord,{from:fe(t),to:fe(r)}}findStepsCoord(e,t){const n=e,o=[...n];let i=t[0],s=0;const a=[];for(const[l,c]of t.entries()){let e,u;if(0===l)u=0,e=n[0];else if(l===t.length-1)u=n.length-1,e=ge(n);else if(1===o.length)s++,u=s,e=o[0],n[u]=e;else{const t=r.Utils.trimRoute(o,o[0],i.distance);s+=t.length-1,o.splice(0,t.length-1),u=s,e=ge(t),n[u]=e}a.push({...c,coords:e}),i=c}return a}findStepCoords(e,t){var r;if("instruction_start_coordinate"in e)return fe(e.instruction_start_coordinate);const n=null==(r=t.vias)?void 0:r.find((t=>t.id===e.via_uri));return n?fe(n.access_point.coord):void 0}parseResponse(e){var t;if(!e||!e.journeys)throw oe.notFound(this.rname,null==(t=e.error)?void 0:t.message);const n=[],o=e.context.timezone;for(const i of e.journeys){const e=[];for(const n of i.sections){if("waiting"===n.type||"transfer"===n.type)continue;const{from:t,to:i}=this.getSectionCoords(n);let s=[];const a=n.geojson.coordinates.reduce(((e,[t,n])=>(s.includes(`${t}-${n}`)||(s=s.concat(`${t}-${n}`),e.push(new r.Coordinates(n,t))),e)),[]),l=(new N).setStart(t).setEnd(i).setPathCoords(a);let c,u=he.get(n.mode);if(n.path){const e=n.path.every((e=>"instruction_start_coordinate"in e||e.via_uri)),t=[];for(const r of n.path){let o;e?(o=this.findStepCoords(r,n),l.addStepInfo({name:r.name,distance:r.length,coords:o,type:"turn"})):t.push({name:r.name,distance:r.length})}e||l.setStepsInfo(this.findStepsCoord(a,t))}if("public_transport"===n.type){c={name:n.display_informations.code,routeColor:n.display_informations.color,routeTextColor:n.display_informations.text_color,directionName:n.display_informations.direction},u=he.get(n.display_informations.physical_mode);const e={coords:a[0],name:c.directionName,distance:n.geojson.properties[0].length,type:"transit"};l.setStepsInfo([e])}const d=new _({transitMode:u,duration:n.duration,startTime:ve(n.departure_date_time,o),endTime:ve(n.arrival_date_time,o),start:{name:n.from.name,coords:t},end:{name:n.to.name,coords:i},coords:a,transportInfo:c,steps:l.build()});e.push(d)}const t=new S({duration:i.duration,startTime:ve(i.departure_date_time,o),endTime:ve(i.arrival_date_time,o),origin:this.getSectionCoords(i.sections[0]).from,destination:this.getSectionCoords(ge(i.sections)).to,legs:e});n.push(t)}return n}};const be=new class extends ee{get rname(){return"deutsche-bahn"}async getItineraries(e,t){const r=this.getURL(e,t),n=await fetch(r).catch((()=>{throw oe.unreachableServer(this.rname,r)})),o=await n.json().catch((()=>{throw oe.responseNotParsing(this.rname,r)}));return this.parseResponse(o,t.origin,t.destination)}getURL(e,t){let n=e+"/route/v1/walking/";return n+=[t.origin,...t.waypoints||[],t.destination].map((e=>{if(null!==e.level){const t=r.Level.isRange(e.level)?e.level[0]:e.level;return e.longitude+","+e.latitude+","+t}return e.longitude+","+e.latitude})).join(";"),n+="?geometries=geojson&overview=full&steps=true",n}parseResponse(e,t,n){if(!e.segments)throw oe.notFound(this.rname);const o=e.segments.map((e=>{const t=r.Level.union(e.fromLevel,e.toLevel),n=e.polyline.map((({lon:e,lat:n})=>new r.Coordinates(n,e,null,t)));return new _({transitMode:"WALK",coords:n,start:{coords:n[0]},end:{coords:n[n.length-1]}})}));return[new S({origin:t,destination:n,legs:o})]}};function we(e){const t=e[0];return e.slice(1).map((e=>{const r={};return t.forEach(((t,n)=>{r[t]=e[n]})),r}))}const Ee=new Map;Ee.set("BIKE","BIKE"),Ee.set("PEDESTRIAN","WALK");function Te(e){return new r.Coordinates(e.latitude,e.longitude)}function Ne(e){return e[e.length-1]}const _e=new class extends ee{get rname(){return"geovelo"}async getItineraries(e,t){const r=this.getQueryParams(),n=this.getBodyParams(t),o=new URL(e);for(const[a,l]of Object.entries(r))o.searchParams.append(a,l.toString());const i=await fetch(o,{method:"POST",headers:{apiKey:"qWHj6ax6DMttG8DX6tH9CQARaiTgQ1Di","Content-Type":"application/json"},body:JSON.stringify(n)}).catch((()=>{throw oe.unreachableServer(this.rname,o.toString())})),s=await i.json().catch((()=>{throw oe.responseNotParsing(this.rname,o.toString())}));if(!s||0===s.length)throw oe.notFound(this.rname,"No itineraries found.");return this.parseResponse(s)}getQueryParams(){return{instructions:!0,elevations:!1,geometry:!0,single_result:!1,bike_stations:!1,objects_as_ids:!1,merge_instructions:!0,show_pushing_bike_instructions:!1}}getBodyParams(e){const{origin:t,destination:r,waypoints:n}=e;let o=[];return o=n&&n.length>1?n.map((e=>({longitude:e.longitude,latitude:e.latitude}))):[{latitude:t.latitude,longitude:t.longitude},{latitude:r.latitude,longitude:r.longitude}],{transportModes:["BIKE"],waypoints:o}}parseResponse(e){if(!e||!e.length)throw oe.notFound(this.rname);const t=[];for(const n of e){const e=[];for(const t of n.sections){const n=Te(t.waypoints[0]),o=Te(Ne(t.waypoints)),i=s.toGeoJSON(t.geometry,6);let a=[];const l=i.coordinates.reduce(((e,[t,n])=>(a.includes(`${t}-${n}`)||(a=a.concat(`${t}-${n}`),e.push(new r.Coordinates(n,t))),e)),[]),c=(new N).setStart(n).setEnd(o).setPathCoords(l),u=Ee.get(t.transportMode),d=we(t.details.instructions);for(const e of d){const{geometryIndex:t,roadLength:n,roadName:o}=e,s=i.coordinates[t],a={name:o,distance:n,coords:new r.Coordinates(s[1],s[0])};c.addStepInfo(a)}const p=new _({transitMode:u,duration:t.duration,startTime:new Date(t.estimatedDatetimeOfDeparture).getTime(),endTime:new Date(t.estimatedDatetimeOfArrival).getTime(),start:{coords:n},end:{coords:o},coords:l,steps:c.build()});e.push(p)}const o=new S({duration:n.duration,startTime:new Date(n.estimatedDatetimeOfDeparture).getTime(),endTime:new Date(n.estimatedDatetimeOfArrival).getTime(),origin:Te(n.waypoints[0]),destination:Te(Ne(n.waypoints)),legs:e});t.push(o)}return t}},Se=new Map;Se.set("Air","AIRPLANE"),Se.set("Boat","BOAT"),Se.set("Bus","BUS"),Se.set("BusRapidTransit","BUS"),Se.set("Coach","BUS"),Se.set("Ferry","FERRY"),Se.set("Funicular","FUNICULAR"),Se.set("LocalTrain","TRAIN"),Se.set("LongDistanceTrain","TRAIN"),Se.set("Metro","METRO"),Se.set("Métro","METRO"),Se.set("RailShuttle","TRAIN"),Se.set("RapidTransit","BUS"),Se.set("Shuttle","BUS"),Se.set("SuspendedCableCar","FUNICULAR"),Se.set("Taxi","TAXI"),Se.set("Train","TRAIN"),Se.set("RER","TRAIN"),Se.set("Tramway","TRAM"),Se.set("walking","WALK"),Se.set("bike","BIKE");const xe=["physical_mode:Air","physical_mode:Boat","physical_mode:Bus","physical_mode:BusRapidTransit","physical_mode:Coach","physical_mode:Ferry","physical_mode:Funicular","physical_mode:LocalTrain","physical_mode:LongDistanceTrain","physical_mode:Metro","physical_mode:RailShuttle","physical_mode:RapidTransit","physical_mode:Shuttle","physical_mode:SuspendedCableCar","physical_mode:Taxi","physical_mode:Train","physical_mode:Tramway"];function Ae(e){return new r.Coordinates(Number(e.lat),Number(e.lon))}function Ie(e){return e[e.length-1]}function Oe(e,t){const r=e.substr(0,4),n=e.substr(4,2),o=e.substr(6,2),i=e.substr(9,2),s=e.substr(11,2),a=e.substr(13,2);return ie(Number(r),Number(n)-1,Number(o),Number(i),Number(s),Number(a),t).getTime()}const Re=new class extends ee{get rname(){return"idfm"}async getItineraries(e,t){const{travelMode:r}=t;if("BIKE"===r)return _e.getItineraries("https://idfm.getwemap.com/marketplace/computedroutes",t);const n=this.getURL(e,t),o=await fetch(n,{method:"GET",headers:{apiKey:"qWHj6ax6DMttG8DX6tH9CQARaiTgQ1Di"}}).catch((()=>{throw oe.unreachableServer(this.rname,n)})),i=await o.json().catch((()=>{throw oe.responseNotParsing(this.rname,n)}));if(i&&i.error)throw oe.notFound(this.rname,i.error.message);const s=this.parseResponse(i);if(!s.some((e=>v(e.transitMode,t.travelMode))))throw oe.notFound(this.rname,"Selected mode of transport was not found for this itinerary.");return s}getURL(e,t){var r;const{origin:n,destination:i,waypoints:s,travelMode:a}=t;(s||[]).length>0&&o.warn(`${this.rname} router uses only the first 2 waypoints (asked ${null==s?void 0:s.length})`);const l=new URL(e),c=new URLSearchParams;c.set("from",`${n.longitude};${n.latitude}`),c.set("to",`${i.longitude};${i.latitude}`),c.set("data_freshness","realtime"),(null==(r=t.itineraryModifiers)?void 0:r.isWheelchair)&&c.set("wheelchair","true"),t.departureTime&&(c.set("datetime",t.departureTime),c.set("datetime_represents","departure"));let u=new URLSearchParams;switch(a){case"WALK":u=this.getWalkingQuery();break;case"BIKE":u=this.getBikeQuery();break;case"CAR":u=this.getCarQuery()}return[c,u].map((e=>{for(const t of e.entries())l.searchParams.append(t[0],t[1])})),l.toString()}getCarQuery(){const e=new URLSearchParams;return xe.forEach((t=>{e.append("forbidden_uris[]",t)})),e.append("first_section_mode[]","walking"),e.append("first_section_mode[]","car"),e.append("last_section_mode[]","walking"),e.append("last_section_mode[]","car"),e}getWalkingQuery(){const e=new URLSearchParams;return xe.forEach((t=>{e.append("forbidden_uris[]",t)})),e.append("first_section_mode[]","walking"),e.append("last_section_mode[]","walking"),e}getBikeQuery(){const e=new URLSearchParams;return xe.forEach((t=>{e.append("forbidden_uris[]",t)})),e.append("first_section_mode[]","bike"),e.append("last_section_mode[]","bike"),e}getSectionCoords(e){let t,r;return t="stop_point"in e.from?e.from.stop_point.coord:"address"in e.from?e.from.address.coord:e.from.poi.coord,r="stop_point"in e.to?e.to.stop_point.coord:"address"in e.to?e.to.address.coord:e.to.poi.coord,{from:Ae(t),to:Ae(r)}}findStepsCoord(e,t){const n=e,o=[...n];let i=t[0],s=0;const a=[];for(const[l,c]of t.entries()){let e,u;if(0===l)u=0,e=n[0];else if(l===t.length-1)u=n.length-1,e=Ie(n);else if(1===o.length)s++,u=s,e=o[0],n[u]=e;else{const t=r.Utils.trimRoute(o,o[0],i.distance);s+=t.length-1,o.splice(0,t.length-1),u=s,e=Ie(t),n[u]=e}a.push({...c,coords:e}),i=c}return a}findStepCoords(e,t){var r;if("instruction_start_coordinate"in e)return Ae(e.instruction_start_coordinate);const n=null==(r=t.vias)?void 0:r.find((t=>t.id===e.via_uri));return n?Ae(n.access_point.coord):void 0}parseResponse(e){var t;if(!e||!e.journeys)throw oe.notFound(this.rname,null==(t=e.error)?void 0:t.message);const n=[],o=e.context.timezone;for(const i of e.journeys){const e=[];for(const n of i.sections){if("waiting"===n.type||"transfer"===n.type)continue;const{from:t,to:i}=this.getSectionCoords(n);let s=[];const a=n.geojson.coordinates.reduce(((e,[t,n])=>(s.includes(`${t}-${n}`)||(s=s.concat(`${t}-${n}`),e.push(new r.Coordinates(n,t))),e)),[]),l=(new N).setStart(t).setEnd(i).setPathCoords(a);let c,u=Se.get(n.mode);if(n.path){const e=n.path.every((e=>"instruction_start_coordinate"in e||e.via_uri)),t=[];for(const r of n.path){let o;if(e){o=this.findStepCoords(r,n);const e={name:r.name,distance:r.length,coords:o};l.addStepInfo(e)}else t.push({name:r.name,distance:r.length})}e||l.setStepsInfo(this.findStepsCoord(a,t))}if("public_transport"===n.type){c={name:n.display_informations.code,routeColor:n.display_informations.color,routeTextColor:n.display_informations.text_color,directionName:n.display_informations.direction},u=Se.get(n.display_informations.physical_mode);const e={coords:a[0],name:c.directionName,distance:n.geojson.properties[0].length,type:"transit"};l.setStepsInfo([e])}const d=new _({transitMode:u,duration:n.duration,startTime:Oe(n.departure_date_time,o),endTime:Oe(n.arrival_date_time,o),start:{name:n.from.name,coords:t},end:{name:n.to.name,coords:i},coords:a,transportInfo:c,steps:l.build()});e.push(d)}const t=new S({duration:i.duration,startTime:Oe(i.departure_date_time,o),endTime:Oe(i.arrival_date_time,o),origin:this.getSectionCoords(i.sections[0]).from,destination:this.getSectionCoords(Ie(i.sections)).to,legs:e});n.push(t)}return n}},Ce=new Map;Ce.set("CAR","CAR"),Ce.set("WALK","WALK"),Ce.set("BIKE","BIKE");const De=new class extends ee{constructor(){super(...arguments),t(this,"inputModeCorrespondance",(e=>{var t;const{travelMode:r,travelModePreference:n}=e;if("WALK"===r&&(null==(t=e.itineraryModifiers)?void 0:t.isWheelchair))return"pmr";if("WALK"===r)return"walking";if("BIKE"===r)return"FASTEST"===n?"bike-fastest":"bike-safest";if("CAR"===r)return"driving";throw oe.travelModeUnimplemented(this.rname,r)}))}get rname(){return"osrm"}async getItineraries(e,t){const r=this.getURL(e,t),n=await fetch(r).catch((()=>{throw oe.unreachableServer(this.rname,r)})),o=await n.json().catch((()=>{throw oe.responseNotParsing(this.rname,r)}));return this.parseResponse(o,t.origin,t.destination,t.travelMode)}getURL(e,t){const{origin:r,destination:n}=t;let o=e+"/route/v1/"+this.inputModeCorrespondance(t)+"/";return o+=[r,...t.waypoints||[],n].map((e=>[e.longitude+","+e.latitude])).join(";"),o+="?geometries=geojson&overview=full&steps=true",t.provideItineraryAlternatives&&(o+="&alternatives=true"),o}osrmTypeToStepType(e){switch(e){case"depart":return"depart";case"turn":default:return"turn";case"roundabout":return"roundabout";case"exit roundabout":return"exit-roundabout";case"arrive":return"arrive"}}osrmModifierToStepDirection(e){switch(e){case"sharp right":return"sharp-right";case"sharp left":return"sharp-left";case"slight right":return"slight-right";case"slight left":return"slight-left";case"u turn":return"u-turn";default:return e}}coordinatesToJson({lat:e,lng:t,level:n}){return null===n?[t,e]:r.Level.isRange(n)?[t,e,n[0]]:[t,e,n]}jsonToCoordinates(e){const t=new r.Coordinates(e[1],e[0]);return e.length>2&&(t.level=e[2]),t}getModifierFromAngle(e){const t=n.positiveMod(n.rad2deg(e),360);return t>0&&t<60?"sharp right":t>=60&&t<140?"right":t>=140&&t<160?"slight right":t>=160&&t<=200?"straight":t>200&&t<=220?"slight left":t>220&&t<=300?"left":t>300&&t<360?"sharp left":"u turn"}noRouteFoundJson(e){return{code:"NoRoute",message:e}}itineraryToOsrmJson(e){const t=e.legs.length-1,r=e.steps,o=e.legs.map((({distance:e,duration:o,coords:i},s)=>{const a=r.filter((e=>i.find((t=>t.equals(e.coords))))),l=a.length-1;return{distance:e,duration:o||0,steps:a.map(((e,r,o)=>{let a=0===r&&0===s?"depart":"turn";a=r===l&&s===t?"arrive":a;const c=i.findIndex((t=>t.equals(e.coords))),u=r===l?c:i.findIndex((e=>e.equals(o[r+1].coords)));return{geometry:{type:"LineString",coordinates:i.slice(c,u+1).map(this.coordinatesToJson)},distance:e.distance,duration:e.duration||0,...e.name&&{name:e.name},maneuver:{bearing_before:n.rad2deg(e.previousBearing),bearing_after:n.rad2deg(e.nextBearing),location:this.coordinatesToJson(e.coords),modifier:this.getModifierFromAngle(e.angle),type:a}}}))}}));return{code:"Ok",routes:[{geometry:{type:"LineString",coordinates:e.coords.map(this.coordinatesToJson)},legs:o,distance:e.distance,duration:e.duration,weight_name:"routability",weight:0}],waypoints:[]}}parseResponse(e,t,r,n){const o=Ce.get(n),{routes:i}=e;if(!i)throw oe.notFound(this.rname,e.message);return i.map((e=>{const n=e.legs.map((e=>{var t;const r=e.steps.map((e=>e.geometry.coordinates.map(this.jsonToCoordinates))).flat().filter(((e,t,r)=>0===t||!r[t-1].equals(e))),n=r[0],i=r[r.length-1],s=(new N).setPathCoords(r).setStart(n).setEnd(i);return null==(t=e.steps)||t.forEach((({maneuver:e,name:t,distance:n,duration:o})=>{const i=this.jsonToCoordinates(e.location),a=r.map((e=>e.distanceTo(i))),l=a.indexOf(Math.min(...a));if(l<0)throw new Error("Osrm Parser: Cannot find step coords in leg coordinates");const c=void 0!==e.exit?e.exit.toString():t;s.addStepInfo({coords:r[l],name:c,distance:n,duration:o,type:this.osrmTypeToStepType(e.type),direction:this.osrmModifierToStepDirection(e.modifier)})})),new _({transitMode:o,duration:e.duration,coords:r,start:{coords:n},end:{coords:i},steps:s.build()})}));return new S({duration:e.duration,origin:t,destination:r,legs:n})}))}};function Le(e){return"BUS"===e.mode||"TRAM"===e.mode}function Me(e){return new r.Coordinates(e.lat,e.lon)}const ke=new Map;ke.set("CAR","CAR"),ke.set("WALK","WALK"),ke.set("BIKE","BICYCLE"),ke.set("TRANSIT","WALK,TRANSIT");const Ue=new class extends ee{get rname(){return"otp"}async getItineraries(e,t){const r=this.getURL(e,t),n=await fetch(r).catch((()=>{throw oe.unreachableServer(this.rname,r)})),o=await n.json().catch((()=>{throw oe.responseNotParsing(this.rname,r)}));return this.parseResponse(o)}getURL(e,t){const{origin:r,destination:n,waypoints:i,travelMode:s}=t,a=ke.get(s);if(!a)throw oe.travelModeUnimplemented(this.rname,s);(i||[]).length>0&&o.warn(`${this.rname} router uses only the first 2 waypoints (asked ${null==i?void 0:i.length})`);const l=`fromPlace=${r.latitude},${r.longitude}`,c=`toPlace=${n.latitude},${n.longitude}`,u=`mode=${a}`,d=new URL(e);let{search:p}=d;return p=(p?`${p}&`:"?")+`${l}&${c}&${u}`,`${d.origin}${d.pathname}${p}`}parseResponse(e){const{plan:t}=e;if(!t)throw oe.notFound(this.rname);const n=[],o=Me(t.from),i=Me(t.to);for(const a of t.itineraries){const e=[];for(const n of a.legs){const t=Me(n.from),o=Me(n.to),i=s.decode(n.legGeometry.points).map((([e,t])=>new r.Coordinates(e,t)));let a;const l=(new N).setStart(t).setEnd(o).setPathCoords(i);Le(n)?(a={name:n.routeShortName,routeColor:n.routeColor,routeTextColor:n.routeTextColor,directionName:n.headsign},l.addStepInfo({coords:i[0],name:n.headsign,type:"transit"})):n.steps.forEach((e=>{const t=i.map((t=>t.distanceTo(Me(e)))),r=t.indexOf(Math.min(...t));if(r<0)throw new Error("OTP Parser: Cannot find closest step");l.addStepInfo({coords:i[r],name:e.streetName,type:"turn"})}));const c=new _({transitMode:n.mode,duration:n.duration,startTime:n.startTime,endTime:n.endTime,start:{name:n.from.name,coords:Me(n.from)},end:{name:n.to.name,coords:Me(n.to)},coords:i,transportInfo:a,steps:l.build()});e.push(c)}const t=new S({duration:a.duration,startTime:a.startTime,endTime:a.endTime,origin:o,destination:i,legs:e});n.push(t)}return n}};const Pe=new class extends ee{get rname(){return"wemap-multi"}async getItineraries(e,t){const{origin:n,destination:o,waypoints:i}=t,s={...t,origin:n instanceof r.Coordinates?n.toJson():n,destination:o instanceof r.Coordinates?o.toJson():o,...i&&{waypoints:i.map((e=>e instanceof r.Coordinates?e.toJson():e))}},a=await fetch(e,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(s)}).catch((()=>{throw oe.unreachableServer(this.rname,e)})),l=await a.json().catch((()=>{throw oe.responseNotParsing(this.rname,e)}));if(l.error)throw oe.notFound(this.rname,l.error);return(l.itineraries||[]).map(S.fromJson)}},qe="https://routing-osrm.getwemap.com";const Be=new class extends ee{get rname(){return"tictactrip"}async getSegmentItinerary(e,t){const r=m(e.distanceTo(t));if(r<300)return null;let n=null;return n=r<1800?(await De.getItineraries(qe,{origin:e,destination:t,travelMode:"WALK",provideItineraryAlternatives:!1,optimizeWaypoints:!1}))[0]:(await De.getItineraries(qe,{origin:e,destination:t,travelMode:"CAR",provideItineraryAlternatives:!1,optimizeWaypoints:!1}))[0],n}getItineraryFromStation(e,t){return De.getItineraries(qe,{origin:e,destination:t,travelMode:"WALK"})}async getItineraries(e,t){const r=this.getBodyParams(t),n=new URL(e),o=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}).catch((()=>{throw oe.unreachableServer(this.rname,n.toString())})),i=await o.json().catch((()=>{throw oe.responseNotParsing(this.rname,n.toString())}));return await this.parseResponse(i,t)}getBodyParams(e){const{origin:t,destination:r}=e;return{origin:{latitude:t.lat,longitude:t.lng},destination:{latitude:r.lat,longitude:r.lng},outbound_date:e.departureTime||(new Date).toISOString(),passengers:[{age:30}]}}async parseResponse(e,t){return e&&e.trips?await Promise.all(Object.values(e.trips).filter((e=>"TRAIN"===e.transportType)).map((async e=>{var n,o;const i=e.segments.map((e=>{const t=G.toUpperCase(e.transportType),n=new r.Coordinates(e.origin.latitude,e.origin.longitude),o=new r.Coordinates(e.destination.latitude,e.destination.longitude),i=[n,o],s=(new N).setStart(n).setEnd(o).setPathCoords(i);return s.setStepsInfo([{coords:n,type:"depart",direction:null},{coords:o,type:"arrive",direction:null}]),new _({start:{name:e.origin.name,coords:n},end:{name:e.destination.name,coords:o},coords:[n,o],transitMode:t,duration:60*e.durationMinutes,startTime:new Date(e.departureLocalISO).getTime(),endTime:new Date(e.arrivalLocalISO).getTime(),transportInfo:{name:e.provider.name,price:e.priceCents/100,directionName:e.destination.name},steps:s.build()})}));let s=null,a=null;const l=[],c=null==(n=e.segments[0])?void 0:n.origin;if(c){const e=new r.Coordinates(c.latitude,c.longitude),n=t.origin;s=await this.getSegmentItinerary(n,e).catch((()=>null)),s&&(s.legs[0].start.name=c.name,l.push(...s.legs))}l.push(...i);const u=null==(o=e.segments[e.segments.length-1])?void 0:o.destination;if(u){const e=new r.Coordinates(u.latitude,u.longitude),n=t.destination;a=await this.getSegmentItinerary(e,n).catch((()=>null)),a&&(a.legs[a.legs.length-1].end.name=u.name,l.push(...a.legs))}return new S({origin:new r.Coordinates(e.origin.latitude,e.origin.longitude),destination:new r.Coordinates(e.destination.latitude,e.destination.longitude),duration:60*e.durationMinutes,startTime:new Date(e.departureLocalISO).getTime(),endTime:new Date(e.arrivalLocalISO).getTime(),legs:l})}))):[]}},Fe=[pe,ye,be,Re,De,Ue,Be,Pe];const je=new class{getRouterByName(e){return Fe.find((t=>t.rname===e))}async getItineraries(e,t,r){const n=this.getRouterByName(e);if(!n)throw oe.notFound(e,`Unknown "${e}" remote router`);return n.getItineraries(t,r)}async getItinerariesWithFallback(e,t){let r;const n=[];for(const{name:a,endpointUrl:l}of t)try{if(r=await this.getItineraries(a,l,e),r.length)return r}catch(s){if(!(s instanceof oe))throw s;n.push({name:a,endpointUrl:l,error:s})}const o=t.map((({name:e})=>e)).join(", "),i=n.map((e=>`(${e.name}) Could not find an itinerary on endpoint: ${e.endpointUrl}. Details: ${e.error.message}`)).join("\n");throw oe.notFound(o,i)}};class Ge{constructor(e,r=null){t(this,"router"),this.graph=e,this.name=r,this.name=r,this.graph=e,this.router=new Q(e)}get routingBounds(){return this.graph.routingBounds}get entryPoints(){return this.graph.routingBoundsEntryPoints}isPointInside(e){return!!this.routingBounds&&a([e.lng,e.lat],this.routingBounds)}getOrderedEntryPointsSortedByDistance(e,t){const n=[...this.entryPoints];return n.sort(((n,o)=>Number(n.coords.distanceTo(e))+n.coords.distanceTo(t)-(o.coords.distanceTo(e)+o.coords.distanceTo(t))+50*(Math.abs(r.Level.diff(e.level,n.coords.level)||0)+Math.abs(r.Level.diff(t.level,n.coords.level)||0)-(Math.abs(r.Level.diff(e.level,o.coords.level)||0)+Math.abs(r.Level.diff(t.level,o.coords.level)||0)))))}getBestRouteFromEntryPointsToDestination(e,t,r){const n=this.getOrderedEntryPointsSortedByDistance(e,t);for(const o of n){const e=this.router.calculateShortestPath(o.coords,t,r).route();if(e.hasRoute)return e}return null}getBestRouteFromOriginToEntryPoints(e,t,r){const n=this.getOrderedEntryPointsSortedByDistance(e,t);for(const o of n){const t=this.router.calculateShortestPath(e,o.coords,r).route();if(t.hasRoute)return t}return null}getRouteInsideMap(e,t,r){const n=this.router.calculateShortestPath(e,t,r).route();return n.hasRoute?n:null}getTripInsideMap(e,t){return this.router.getShortestTrip(e,t)}getRoutesMultipleDestinationsInsideMap(e,t,r){return this.router.calculateShortestPathToMultipleDestinations(e,t,r)}}var We={exports:{}};
1
+ "use strict";var e=Object.defineProperty,t=(t,r,n)=>(((t,r,n)=>{r in t?e(t,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[r]=n})(t,"symbol"!=typeof r?r+"":r,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("@wemap/geo"),n=require("@wemap/maths"),o=require("@wemap/logger"),i=require("@wemap/salesman.js"),s=require("@mapbox/polyline"),a=require("@turf/boolean-point-in-polygon"),l=require("@wemap/osm");const c=class e{constructor(n,o,i={},s=e.currentUniqueId++){t(this,"level"),t(this,"bearing"),t(this,"length"),this.vertex1=n,this.vertex2=o,this.properties=i,this.id=s,this.level=r.Level.union(n.coords.level,o.coords.level),this.length=this.vertex1.distanceTo(this.vertex2),this.bearing=this.vertex1.bearingTo(this.vertex2)}static getEdgeByVertices(e,t,r){return e.find((e=>t===e.vertex1&&r===e.vertex2||r===e.vertex1&&t===e.vertex2))}reverseProperties(){const{properties:e}=this;e.incline&&(e.incline="up"===e.incline?"down":"up"),e.isOneway&&(e.isOneway=!1)}};t(c,"currentUniqueId",0);let u=c;class d{constructor(e,t,r,n){this.origin=e,this.distanceFromNearestElement=t,this.coords=r,this.nearestElement=n}}class p{constructor(e,r={}){t(this,"id",-1),this.coords=e,this.properties=r}distanceTo(e){return this.coords.distanceTo(e.coords)}bearingTo(e){return this.coords.bearingTo(e.coords)}toJson(){return{id:this.id,coords:this.coords.toCompressedJson(),...Object.keys(this.properties).length>0&&{properties:this.properties}}}equals(e){return this.coords.equals(e.coords)}static fromJson(e){const t=new p(r.Coordinates.fromCompressedJson(e.coords),e.properties);return t.id=e.id,t}}class h{constructor(e,r,n=null,o=[]){t(this,"exitVertices"),this.vertices=e,this.edges=r,this.routingBounds=n,this.routingBoundsEntryPoints=o;const i=r.filter((e=>null===e.level)).map((e=>[e.vertex1,e.vertex2])).flat(),s=r.filter((e=>null!==e.level)).map((e=>[e.vertex1,e.vertex2])).flat();this.exitVertices=new Set(i.filter((e=>s.includes(e)))),null==o||o.forEach((e=>this.exitVertices.add(e)))}getEdgeByVertices(e,t){return u.getEdgeByVertices(this.edges,e,t)}getVertexByCoords(e){return h.getVertexByCoords(this.vertices,e)}static getVertexByCoords(e,t){return e.find((e=>e.coords.equals(t)))}getVertexByName(e){return this.vertices.find((t=>t.properties.name===e))}getVerticesByName(e){return this.vertices.filter((t=>t.properties.name===e))}getEdgeByName(e){return this.edges.find((t=>t.properties.name===e))}getEdgesByName(e){return this.edges.filter((t=>t.properties.name===e))}getBoundingBox(e){if(!this.vertices.length)return null;const t=r.BoundingBox.fromCoordinates(this.vertices.map((e=>e.coords)));return e&&t.extendsWithMeasure(e),t}getProjection(e,t={}){const o="maxDistance"in t,i=t.maxDistance,s="maxBearingAngle"in t;if(s&&(!(e instanceof r.UserPosition)||null===e.bearing))return null;const a=t.maxBearingAngle,l="acceptEdgeFn"in t,c=!("useMultiLevelSegments"in t)||t.useMultiLevelSegments;let u=null;const p=t=>{if(!(e instanceof r.UserPosition))return t;const n=e.clone();return n.lat=t.lat,n.lng=t.lng,n.level=t.level,n.alt=t.alt,n.heightFromFloor=t.heightFromFloor,n.heightFromGround=t.heightFromGround,n};return this.edges.forEach((h=>{if(l&&!t.acceptEdgeFn(h))return;if(!c&&r.Level.isRange(h.level))return;if(!r.Level.intersect(h.level,e.level))return;if(s&&n.diffAngleLines(h.bearing,e.bearing)>a)return;const m=e.getSegmentProjection(h.vertex1.coords,h.vertex2.coords);if(!m)return;const f=m.distanceTo(e);o&&f>i||f<((null==u?void 0:u.distanceFromNearestElement)??Number.MAX_VALUE)&&(u=new d(e,f,p(m),h))})),s||this.vertices.forEach((t=>{let n=t.coords;if(this.exitVertices.has(t)&&null===e.level&&(n=t.coords.clone(),n.level=null),!c&&r.Level.isRange(n.level))return;if(!r.Level.intersect(n.level,e.level))return;const s=n.distanceTo(e);s<r.Constants.EPS_MM?u=new d(e,0,p(n),t):o&&s>i||s<((null==u?void 0:u.distanceFromNearestElement)??Number.MAX_VALUE)&&(u=new d(e,s,p(n),t))})),u}toJson(){return{vertices:this.vertices.map((e=>e.toJson())),edges:this.edges.map((e=>({id:e.id,vertex1Idx:this.vertices.indexOf(e.vertex1),vertex2Idx:this.vertices.indexOf(e.vertex2),...Object.keys(e.properties).length>0&&{properties:e.properties}}))),...this.routingBounds&&{routingBounds:this.routingBounds},...this.routingBoundsEntryPoints.length>0&&{routingBoundsEntryPoints:this.routingBoundsEntryPoints.map((e=>e.id))}}}static fromJson(e){var t;const r=e.vertices.map((e=>p.fromJson(e))),n=e.edges.map((e=>new u(r[e.vertex1Idx],r[e.vertex2Idx],e.properties,e.id)));return new h(r,n,e.routingBounds,null==(t=e.routingBoundsEntryPoints)?void 0:t.map((e=>r[e])))}toCompressedJson(){return{vertices:this.vertices.map((e=>e.coords.toCompressedJson())),verticesIds:this.vertices.map((e=>e.id)),edges:this.edges.map((e=>{const t=this.vertices.indexOf(e.vertex1),r=this.vertices.indexOf(e.vertex2),n=e.properties;return Object.keys(n).length>0?[t,r,n]:[t,r]}))}}static fromCompressedJson(e){const t=e.vertices.map((e=>new p(r.Coordinates.fromCompressedJson(e)))),n=e.edges.map((e=>new u(t[e[0]],t[e[1]],e.length>2?e[2]:{})));return new h(t,n)}static fromCoordinatesSegments(e){const t=[],r=[],n=e=>{const r=t.find((t=>t.coords.equals(e)));if(r)return r;const n=new p(e);return t.push(n),n};for(const o of e){let e=null;for(const t of o){const o=n(t);e&&r.push(new u(o,e)),e=o}}return new h(t,r)}getEdgesAtLevel(e,t=!0){return this.edges.filter((({level:n})=>t?r.Level.intersect(e,n):r.Level.contains(e,n)))}toDetailedString(){let e=`--- Network ---\nVertices: ${this.vertices.length}\nEdges: ${this.edges.length}\n---\nVertices\n`;return this.vertices.forEach((t=>{e+=t.id;const r=t.properties;0!==Object.keys(r).length&&(e+=` ${r}`)})),e+="---\nEdges\n",this.edges.forEach((t=>{e+=`${t.id} - [v1: ${t.vertex1.id}, v2: ${t.vertex2.id}]`;const r=t.properties;0!==Object.keys(r).length&&(e+=` ${r}`)})),e+="---",e}}function m(e,t=5){return e/(1e3*t/3600)}function f(e){const t=n.positiveMod(n.rad2deg(e),360);return t>0&&t<60?"sharp-right":t>=60&&t<140?"right":t>=140&&t<160?"slight-right":t>=160&&t<=200?"straight":t>200&&t<=220?"slight-left":t>220&&t<=300?"left":t>300&&t<360?"sharp-left":"u-turn"}function g(e){return["AIRPLANE","BOAT","BUS","FERRY","FUNICULAR","METRO","MULTI","TRAIN","TRAM"].includes(e)}function v(e,t){return e===t||g(e)&&"TRANSIT"===t||"WALK"===e&&"TRANSIT"===t}function y(e){return{...e.firstStep&&{firstStep:!0},...e.lastStep&&{lastStep:!0},number:e.number,type:e.type,coords:e.coords.toCompressedJson(),...null!==e.name&&{name:e.name},angle:Number(e.angle.toFixed(2)),previousBearing:Number(e.previousBearing.toFixed(2)),nextBearing:Number(e.nextBearing.toFixed(2)),distance:Number(e.distance.toFixed(1)),duration:Number(e.duration.toFixed(1)),levelDifference:e.levelDifference,direction:e.direction}}function b(e){return{...e,coords:r.Coordinates.fromCompressedJson(e.coords),firstStep:Boolean(e.firstStep),lastStep:Boolean(e.lastStep),name:e.name||null,levelDifference:e.levelDifference||null}}function w(e){return!!e&&("up"===e.direction||"down"===e.direction)}class E extends h{constructor(e,t,r,n,o){super(r,n),this.start=e,this.end=t,this.vertices=r,this.edges=n,this.edgesWeights=o}reverse(){const e=this.vertices.slice().reverse(),t=this.edges.slice().reverse(),r=this.edgesWeights.slice().reverse();return t.map((e=>new u(e.vertex2,e.vertex1,e.properties))),new E(this.start,this.end,e,t,r)}static fromCoordinates(e,t,r){const n=h.fromCoordinatesSegments([r]),o=n.edges.map((e=>m(e.length)));return new E(e,t,n.vertices,n.edges,o)}get hasRoute(){return Boolean(this.vertices.length)}}const T=n.deg2rad(20);class N{constructor(){t(this,"start",null),t(this,"end",null),t(this,"pathCoords",null),t(this,"stepsInfo",[])}setStart(e){return this.start=e,this}setEnd(e){return this.end=e,this}setPathCoords(e){return this.pathCoords=e,this}setStepsInfo(e){return this.stepsInfo=e,this}addStepInfo(e){return this.stepsInfo.push(e),this}setGraphRoute(e){const t=[],{start:o,end:i}=e;if(!e.hasRoute)return this;let s=null,a=o.bearingTo(e.vertices[0].coords);for(let c=0;c<e.vertices.length-1;c++){const o=e.vertices[c],i=o.coords,l=e.vertices[c+1],u=l.coords,d=e.edges[c],p=o.bearingTo(l),h=n.diffAngle(a,p+Math.PI),m=t.length?t[t.length-1]:null,{isSubwayEntrance:g,isGate:v,subwayEntranceRef:y}=o.properties,{isElevator:b,areEscalators:E,areStairs:N,isMovingWalkway:_,incline:S}=d.properties;let x;!N&&!b||!S||null!==(null==m?void 0:m.levelDifference)&&void 0!==(null==m?void 0:m.levelDifference)||(x=S);const A=c>0?e.edges[c-1]:null,I=(null==A?void 0:A.properties)||{},O=Boolean(I.incline&&I.areStairs&&(!S||!N)),R=o.properties.isSubwayEntrance,C=d.properties.name||y||null,D=e.edgesWeights[c];let M=Math.abs(n.diffAngle(Math.PI,h))>=T;const L=r.Level.isRange(d.level)&&!r.Level.isRange(i.level)||x;M=M&&!(i.level&&r.Level.isRange(i.level));const k=w(m)&&!r.Level.isRange(i.level)||O;if(!s||(M||L||k||R)){let e=null,n="turn";b?n="elevator":E?n="escalator":N?n="stairs":g?n="subway-entrance":v?n="gate":_?n="moving-walkway":L&&(n="incline-plane");let o=f(h);L&&(e=r.Level.diff(i.level,u.level)||0,o=e>0?"up":"down",x&&(o=x)),s={coords:i,...C&&{name:C},type:n,direction:o,levelDifference:e,distance:0,duration:0},t.push(s)}s.distance+=i.distanceTo(u),s.duration+=D,a=p}const l=e.vertices[e.vertices.length-1].coords;return r.Coordinates.equals(l,i)||t.push({coords:l,type:"arrive",direction:null}),this.setStart(o),this.setEnd(i),this.setPathCoords(e.vertices.map((e=>e.coords))),this.setStepsInfo(t),this}build(){const{pathCoords:e,start:t,end:r}=this;if(!e)return o.warn('StepsBuilder: Missing "pathCoords" property to build steps'),[];if(!t)return o.warn('StepsBuilder: Missing "from" property to build steps'),[];if(!r)return o.warn('StepsBuilder: Missing "to" property to build steps'),[];0===this.stepsInfo.length&&this.setGraphRoute(E.fromCoordinates(t,r,e));const{stepsInfo:i}=this;return i.map(((o,s)=>{const a=e.findIndex((e=>e.equals(o.coords)));if(-1===a)throw new Error("Cannot find step coordinates in itinerary coordinates.");const l=0===a?t:e[a-1],c=a===e.length-1?r:e[a+1],u=l.bearingTo(o.coords),d=o.coords.bearingTo(c),p=n.diffAngle(u,d+Math.PI);let h=o.type;const g=o.direction||f(p),v=0===s;let y=0;const b=s===i.length-1,w=b?e[e.length-1]:i[s+1].coords;let E=a;for(;!e[E].equals(w);)y+=e[E].distanceTo(e[E+1]),E++;return h||(h="straight"===g?"continue":g.includes("left")||g.includes("right")||"u-turn"===g?"turn":v?"depart":b?"arrive":null),{coords:o.coords,direction:"transit"===h?null:g,type:h,levelDifference:void 0!==o.levelDifference?o.levelDifference:null,name:o.name||null,number:s+1,previousBearing:u,nextBearing:d,angle:p,firstStep:v,lastStep:b,distance:y,duration:o.duration||m(y)}}))}}class _{constructor({start:e,end:n,coords:o,transitMode:i,duration:s,startTime:a,endTime:l,transportInfo:c,steps:u}){t(this,"start"),t(this,"end"),t(this,"coords"),t(this,"distance"),t(this,"transitMode"),t(this,"duration"),t(this,"startTime"),t(this,"endTime"),t(this,"steps"),t(this,"transportInfo"),this.start={name:e.name||null,coords:e.coords},this.end={name:n.name||null,coords:n.coords},this.coords=o,this.transitMode=i,this.distance=r.Utils.calcDistance(o),this.duration="number"==typeof s?s:m(this.distance),this.startTime="number"==typeof a?a:null,this.endTime="number"==typeof l?l:null,this.transportInfo=c||null,this.steps=Array.isArray(u)?u:(new N).setStart(e.coords).setEnd(n.coords).setPathCoords(o).build()}isPublicTransport(){return g(this.transitMode)}toGraph(){return h.fromCoordinatesSegments([this.coords])}static equals(e,t){var r,n;if(!(e.transitMode===t.transitMode&&Math.abs(e.duration-t.duration)<=.05&&e.startTime===t.startTime&&e.endTime===t.endTime&&e.start.name===t.start.name&&e.start.coords.equals(t.start.coords)&&e.end.name===t.end.name&&e.end.coords.equals(t.end.coords)&&e.coords.length===t.coords.length&&(e.steps===t.steps||(null==(r=e.steps)?void 0:r.length)===(null==(n=t.steps)?void 0:n.length))))return!1;let o;for(o=0;o<e.coords.length;o++)if(!e.coords[o].equals(t.coords[o]))return!1;for(o=0;o<e.steps.length;o++)if(i=e.steps[o],s=t.steps[o],!(i.coords.equals(s.coords)&&Math.abs(i.angle-s.angle)<=.005&&Math.abs(i.distance-s.distance)<=.05&&Math.abs(i.duration-s.duration)<=.05&&i.firstStep===s.firstStep&&i.lastStep===s.lastStep&&i.levelDifference===s.levelDifference&&i.type===s.type&&i.direction===s.direction&&i.name===s.name&&Math.abs(i.nextBearing-s.nextBearing)<=.005&&i.number===s.number&&Math.abs(i.previousBearing-s.previousBearing)<=.005))return!1;var i,s;if(e.transportInfo!==t.transportInfo){if(null===e.transportInfo||null===t.transportInfo)return!1;if(e.transportInfo.name!==t.transportInfo.name||e.transportInfo.routeColor!==t.transportInfo.routeColor||e.transportInfo.routeTextColor!==t.transportInfo.routeTextColor||e.transportInfo.directionName!==t.transportInfo.directionName)return!1}return!0}equals(e){return _.equals(this,e)}toJson(){return{transitMode:this.transitMode,start:{coords:this.start.coords.toCompressedJson(),...this.start.name&&{name:this.start.name}},end:{coords:this.end.coords.toCompressedJson(),...this.end.name&&{name:this.end.name}},distance:Number(this.distance.toFixed(1)),duration:Number(this.duration.toFixed(1)),coords:this.coords.map((e=>e.toCompressedJson())),steps:this.steps.map(y),...null!==this.startTime&&{startTime:this.startTime},...null!==this.endTime&&{endTime:this.endTime},...null!==this.transportInfo&&{transportInfo:this.transportInfo}}}static fromJson(e){var t;return new _(Object.assign({},e,{start:{coords:r.Coordinates.fromCompressedJson(e.start.coords),name:e.start.name||null},end:{coords:r.Coordinates.fromCompressedJson(e.end.coords),name:e.end.name||null},coords:e.coords.map(r.Coordinates.fromCompressedJson),steps:(null==(t=e.steps)?void 0:t.map(b))||null}))}static fromGraphRoute(e,t="WALK"){return new _({start:{coords:e.start},end:{coords:e.end},coords:e.vertices.map((e=>e.coords)),duration:e.edgesWeights.reduce(((e,t)=>e+t),0),transitMode:t,steps:(new N).setGraphRoute(e).build()})}multiplyLevel(e){this.start.coords.level=r.Level.multiplyBy(this.start.coords.level,e),this.end.coords.level=r.Level.multiplyBy(this.end.coords.level,e);for(const t of this.coords)t.level=r.Level.multiplyBy(t.level,e);this.steps.forEach((t=>{t.coords.level=r.Level.multiplyBy(t.coords.level,e)}))}}class S{constructor({origin:e,destination:r,duration:n,legs:o,startTime:i,endTime:s}){t(this,"origin"),t(this,"destination"),t(this,"duration"),t(this,"legs"),t(this,"_transitMode",null),t(this,"startTime"),t(this,"endTime"),t(this,"_coords",null),t(this,"_distance",null),this.origin=e,this.destination=r,this.legs=o,this.duration="number"==typeof n?n:this.legs.reduce(((e,t)=>e+t.duration),0),this.startTime="number"==typeof i?i:null,this.endTime="number"==typeof s?s:null,this.updateStepsFromLegs()}set coords(e){throw new Error("Itinerary.coords cannot be set. They are calculated from Itinerary.legs.")}get coords(){return this._coords||(this._coords=this.legs.map((e=>e.coords)).flat().filter(((e,t,r)=>0===t||!r[t-1].equals(e)))),this._coords}set steps(e){throw new Error("Itinerary.step cannot be set. They are calculated from Itinerary.legs.")}get steps(){return this.legs.map((e=>e.steps)).flat()}set price(e){throw new Error("Itinerary.price cannot be set. They are calculated from Itinerary.legs.")}get price(){return this.legs.reduce(((e,t)=>{var r;return e+((null==(r=t.transportInfo)?void 0:r.price)||0)}),0)}set transitMode(e){throw new Error("Itinerary.transitMode cannot be set. They are calculated from Itinerary.legs.")}get transitMode(){if(!this._transitMode){const e=new Set(this.legs.map((e=>e.transitMode)));if(e.delete("WALK"),e.size>1)return this._transitMode="MULTI",this._transitMode;if(1===e.size)return this._transitMode=e.values().next().value,this._transitMode;this._transitMode="WALK"}return this._transitMode}set distance(e){throw new Error("Itinerary.distance cannot be set. They are calculated from Itinerary.legs.")}get distance(){return null===this._distance&&(this._distance=r.Utils.calcDistance(this.coords)),this._distance}toGraph(){return h.fromCoordinatesSegments([this.coords])}static fromItineraries(...e){return new S({origin:e[0].origin,destination:e[e.length-1].destination,legs:e.map((e=>e.legs)).flat()})}static fromOrderedPointsArray(e,t,n){const o=e=>new r.Coordinates(e[0],e[1],null,e[2]);return this.fromOrderedCoordinates(e.map(o),o(t),o(n))}static fromOrderedCoordinates(e,t,r,n="WALK"){const o=(new N).setPathCoords(e).setStart(t).setEnd(r).build(),i=new _({start:{coords:t},end:{coords:r},coords:e,transitMode:n,steps:o});return new S({origin:t,destination:r,legs:[i]})}static equals(e,t){if(!(e.origin.equals(t.origin)&&e.destination.equals(t.destination)&&Math.abs(e.distance-t.distance)<=.05&&Math.abs(e.duration-t.duration)<=.05&&e.startTime===t.startTime&&e.endTime===t.endTime&&e.legs.length===t.legs.length))return!1;for(let r=0;r<e.legs.length;r++)if(!e.legs[r].equals(t.legs[r]))return!1;return!0}equals(e){return S.equals(this,e)}toJson(){return{origin:this.origin.toJson(),destination:this.destination.toJson(),distance:Number(this.distance.toFixed(1)),duration:Number(this.duration.toFixed(1)),transitMode:this.transitMode,legs:this.legs.map((e=>e.toJson())),...null!==this.startTime&&{startTime:this.startTime},...null!==this.endTime&&{endTime:this.endTime}}}static fromJson(e){return new S({origin:r.Coordinates.fromJson(e.origin),destination:r.Coordinates.fromJson(e.destination),duration:e.duration,legs:e.legs.map(_.fromJson),startTime:e.startTime,endTime:e.endTime})}static fromGraphRoute(e,t="WALK"){const r=_.fromGraphRoute(e,t);return new S({origin:e.start,destination:e.end,legs:[r]})}multiplyLevel(e){this.origin.level=r.Level.multiplyBy(this.origin.level,e),this.destination.level=r.Level.multiplyBy(this.destination.level,e),this.legs.forEach((t=>t.multiplyLevel(e)))}forceUnknownLevelTo0(){this.origin.level=this.origin.level||0,this.destination.level=this.destination.level||0;for(const e of this.legs){e.start.coords.level=e.start.coords.level||0,e.end.coords.level=e.end.coords.level||0;for(const t of e.coords)t.level=t.level||0;if(e.steps)for(const t of e.steps)t.coords.level=t.coords.level||0}if(this._coords)for(const e of this._coords)e.level=e.level||0}toGeoJson(){const e=(e,t,r)=>({type:"Feature",properties:{name:t,level:e.level,...r&&{type:r}},geometry:{type:"Point",coordinates:[e.lng,e.lat]}}),t=[...new Set(this.coords.map((e=>r.Level.toString(e.level))))].map(r.Level.fromString).map((e=>[e,r.Utils.createSegmentsAtLevel(this.coords,e,!0)])).map((([e,t])=>((e,t)=>({type:"Feature",properties:{level:t,name:null==t?void 0:t.toString()},geometry:{type:"MultiLineString",coordinates:e.map((e=>e.map((({lat:e,lng:t})=>[t,e]))))}}))(t,e))),n=this.legs.map(((t,r)=>e(t.start.coords,`Leg ${r} start`,"leg-start"))),o=this.legs.map(((t,r)=>e(t.end.coords,`Leg ${r} end`,"leg-end"))),i=this.steps.map((t=>e(t.coords,`Step ${t.number}`,"step")));return{type:"FeatureCollection",features:[e(this.origin,"origin","origin"),e(this.destination,"destination","destination"),...t,...n,...o,...i]}}updateStepsFromLegs(){const e=this.coords.filter(((e,t,r)=>0===t||!r[t-1].equals(e))),t=this.legs.map((e=>e.steps)).flat();t.map(((r,o)=>{const i=e.findIndex((e=>e.equals(r.coords)));if(-1===i)throw new Error("Cannot find step coordinates in itinerary coordinates.");const s=0===i?this.origin:e[i-1],a=i===e.length-1?this.destination:e[i+1];r.previousBearing=s.bearingTo(r.coords),r.nextBearing=r.coords.bearingTo(a),r.angle=n.diffAngle(r.previousBearing,r.nextBearing+Math.PI);const l=r.distance;r.distance=0;const c=o!==t.length-1?t[o+1].coords:e[e.length-1];let u=i;for(;!e[u].equals(c);)r.distance+=e[u].distanceTo(e[u+1]),u++;if(u===e.length-1&&(r.distance+=e[u].distanceTo(this.destination)),r.number=o+1,r.firstStep=0===o,r.lastStep=o===t.length-1,"arrive"===r.type&&!r.lastStep||"depart"===r.type&&!r.firstStep){const e=r.direction;e&&(e.includes("left")||e.includes("right")||"u-turn"===e)?r.type="turn":r.type="continue"}r.duration+=m(r.distance-l)}))}}var x="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function A(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var I,O,R={exports:{}};I=R,O=R.exports,function(e,t){var r="function",n="undefined",o="object",i="string",s="major",a="model",l="name",c="type",u="vendor",d="version",p="architecture",h="console",m="mobile",f="tablet",g="smarttv",v="wearable",y="embedded",b="Amazon",w="Apple",E="ASUS",T="BlackBerry",N="Browser",_="Chrome",S="Firefox",x="Google",A="Huawei",R="LG",C="Microsoft",D="Motorola",M="Opera",L="Samsung",k="Sharp",U="Sony",P="Xiaomi",q="Zebra",B="Facebook",F="Chromium OS",j="Mac OS",G=function(e){for(var t={},r=0;r<e.length;r++)t[e[r].toUpperCase()]=e[r];return t},W=function(e,t){return typeof e===i&&-1!==H(t).indexOf(H(e))},H=function(e){return e.toLowerCase()},V=function(e,t){if(typeof e===i)return e=e.replace(/^\s\s*/,""),typeof t===n?e:e.substring(0,350)},$=function(e,n){for(var i,s,a,l,c,u,d=0;d<n.length&&!c;){var p=n[d],h=n[d+1];for(i=s=0;i<p.length&&!c&&p[i];)if(c=p[i++].exec(e))for(a=0;a<h.length;a++)u=c[++s],typeof(l=h[a])===o&&l.length>0?2===l.length?typeof l[1]==r?this[l[0]]=l[1].call(this,u):this[l[0]]=l[1]:3===l.length?typeof l[1]!==r||l[1].exec&&l[1].test?this[l[0]]=u?u.replace(l[1],l[2]):t:this[l[0]]=u?l[1].call(this,u,l[2]):t:4===l.length&&(this[l[0]]=u?l[3].call(this,u.replace(l[1],l[2])):t):this[l]=u||t;d+=2}},z=function(e,r){for(var n in r)if(typeof r[n]===o&&r[n].length>0){for(var i=0;i<r[n].length;i++)if(W(r[n][i],e))return"?"===n?t:n}else if(W(r[n],e))return"?"===n?t:n;return e},Y={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},K={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[d,[l,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[d,[l,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[l,d],[/opios[\/ ]+([\w\.]+)/i],[d,[l,M+" Mini"]],[/\bopr\/([\w\.]+)/i],[d,[l,M]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(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,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[l,d],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[d,[l,"UC"+N]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[d,[l,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[d,[l,"WeChat"]],[/konqueror\/([\w\.]+)/i],[d,[l,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[d,[l,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[d,[l,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[l,/(.+)/,"$1 Secure "+N],d],[/\bfocus\/([\w\.]+)/i],[d,[l,S+" Focus"]],[/\bopt\/([\w\.]+)/i],[d,[l,M+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[d,[l,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[d,[l,"Dolphin"]],[/coast\/([\w\.]+)/i],[d,[l,M+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[d,[l,"MIUI "+N]],[/fxios\/([-\w\.]+)/i],[d,[l,S]],[/\bqihu|(qi?ho?o?|360)browser/i],[[l,"360 "+N]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[l,/(.+)/,"$1 "+N],d],[/(comodo_dragon)\/([\w\.]+)/i],[[l,/_/g," "],d],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[l,d],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[l],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[l,B],d],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[l,d],[/\bgsa\/([\w\.]+) .*safari\//i],[d,[l,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[d,[l,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[d,[l,_+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[l,_+" WebView"],d],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[d,[l,"Android "+N]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[l,d],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[d,[l,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[d,l],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[l,[d,z,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[l,d],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[l,"Netscape"],d],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[d,[l,S+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[l,d],[/(cobalt)\/([\w\.]+)/i],[l,[d,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[p,"amd64"]],[/(ia32(?=;))/i],[[p,H]],[/((?:i[346]|x)86)[;\)]/i],[[p,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[p,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[p,"armhf"]],[/windows (ce|mobile); ppc;/i],[[p,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[p,/ower/,"",H]],[/(sun4\w)[;\)]/i],[[p,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[p,H]]],device:[[/\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],[a,[u,L],[c,f]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[a,[u,L],[c,m]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[a,[u,w],[c,m]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[a,[u,w],[c,f]],[/(macintosh);/i],[a,[u,w]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[a,[u,k],[c,m]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[a,[u,A],[c,f]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[a,[u,A],[c,m]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[a,/_/g," "],[u,P],[c,m]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[a,/_/g," "],[u,P],[c,f]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[a,[u,"OPPO"],[c,m]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[a,[u,"Vivo"],[c,m]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[a,[u,"Realme"],[c,m]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[a,[u,D],[c,m]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[a,[u,D],[c,f]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[a,[u,R],[c,f]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[a,[u,R],[c,m]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[a,[u,"Lenovo"],[c,f]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[a,/_/g," "],[u,"Nokia"],[c,m]],[/(pixel c)\b/i],[a,[u,x],[c,f]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[a,[u,x],[c,m]],[/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],[a,[u,U],[c,m]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[a,"Xperia Tablet"],[u,U],[c,f]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[a,[u,"OnePlus"],[c,m]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[a,[u,b],[c,f]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[a,/(.+)/g,"Fire Phone $1"],[u,b],[c,m]],[/(playbook);[-\w\),; ]+(rim)/i],[a,u,[c,f]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[a,[u,T],[c,m]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[a,[u,E],[c,f]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[a,[u,E],[c,m]],[/(nexus 9)/i],[a,[u,"HTC"],[c,f]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[u,[a,/_/g," "],[c,m]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[a,[u,"Acer"],[c,f]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[a,[u,"Meizu"],[c,m]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[u,a,[c,m]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[u,a,[c,f]],[/(surface duo)/i],[a,[u,C],[c,f]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[a,[u,"Fairphone"],[c,m]],[/(u304aa)/i],[a,[u,"AT&T"],[c,m]],[/\bsie-(\w*)/i],[a,[u,"Siemens"],[c,m]],[/\b(rct\w+) b/i],[a,[u,"RCA"],[c,f]],[/\b(venue[\d ]{2,7}) b/i],[a,[u,"Dell"],[c,f]],[/\b(q(?:mv|ta)\w+) b/i],[a,[u,"Verizon"],[c,f]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[a,[u,"Barnes & Noble"],[c,f]],[/\b(tm\d{3}\w+) b/i],[a,[u,"NuVision"],[c,f]],[/\b(k88) b/i],[a,[u,"ZTE"],[c,f]],[/\b(nx\d{3}j) b/i],[a,[u,"ZTE"],[c,m]],[/\b(gen\d{3}) b.+49h/i],[a,[u,"Swiss"],[c,m]],[/\b(zur\d{3}) b/i],[a,[u,"Swiss"],[c,f]],[/\b((zeki)?tb.*\b) b/i],[a,[u,"Zeki"],[c,f]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[u,"Dragon Touch"],a,[c,f]],[/\b(ns-?\w{0,9}) b/i],[a,[u,"Insignia"],[c,f]],[/\b((nxa|next)-?\w{0,9}) b/i],[a,[u,"NextBook"],[c,f]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[u,"Voice"],a,[c,m]],[/\b(lvtel\-)?(v1[12]) b/i],[[u,"LvTel"],a,[c,m]],[/\b(ph-1) /i],[a,[u,"Essential"],[c,m]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[a,[u,"Envizen"],[c,f]],[/\b(trio[-\w\. ]+) b/i],[a,[u,"MachSpeed"],[c,f]],[/\btu_(1491) b/i],[a,[u,"Rotor"],[c,f]],[/(shield[\w ]+) b/i],[a,[u,"Nvidia"],[c,f]],[/(sprint) (\w+)/i],[u,a,[c,m]],[/(kin\.[onetw]{3})/i],[[a,/\./g," "],[u,C],[c,m]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[a,[u,q],[c,f]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[a,[u,q],[c,m]],[/smart-tv.+(samsung)/i],[u,[c,g]],[/hbbtv.+maple;(\d+)/i],[[a,/^/,"SmartTV"],[u,L],[c,g]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[u,R],[c,g]],[/(apple) ?tv/i],[u,[a,w+" TV"],[c,g]],[/crkey/i],[[a,_+"cast"],[u,x],[c,g]],[/droid.+aft(\w)( bui|\))/i],[a,[u,b],[c,g]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[a,[u,k],[c,g]],[/(bravia[\w ]+)( bui|\))/i],[a,[u,U],[c,g]],[/(mitv-\w{5}) bui/i],[a,[u,P],[c,g]],[/Hbbtv.*(technisat) (.*);/i],[u,a,[c,g]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[u,V],[a,V],[c,g]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[c,g]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[u,a,[c,h]],[/droid.+; (shield) bui/i],[a,[u,"Nvidia"],[c,h]],[/(playstation [345portablevi]+)/i],[a,[u,U],[c,h]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[a,[u,C],[c,h]],[/((pebble))app/i],[u,a,[c,v]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[a,[u,w],[c,v]],[/droid.+; (glass) \d/i],[a,[u,x],[c,v]],[/droid.+; (wt63?0{2,3})\)/i],[a,[u,q],[c,v]],[/(quest( 2| pro)?)/i],[a,[u,B],[c,v]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[u,[c,y]],[/(aeobc)\b/i],[a,[u,b],[c,y]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[a,[c,m]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[a,[c,f]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[c,f]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[c,m]],[/(android[-\w\. ]{0,9});.+buil/i],[a,[u,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[d,[l,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[d,[l,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[l,d],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[d,l]],os:[[/microsoft (windows) (vista|xp)/i],[l,d],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[l,[d,z,Y]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[l,"Windows"],[d,z,Y]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/ios;fbsv\/([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[d,/_/g,"."],[l,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[l,j],[d,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[d,l],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[l,d],[/\(bb(10);/i],[d,[l,T]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[d,[l,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[d,[l,S+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[d,[l,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[d,[l,"watchOS"]],[/crkey\/([\d\.]+)/i],[d,[l,_+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[l,F],d],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([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,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[l,d],[/(sunos) ?([\w\.\d]*)/i],[[l,"Solaris"],d],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[l,d]]},J=function(h,g){if(typeof h===o&&(g=h,h=t),!(this instanceof J))return new J(h,g).getResult();var v=typeof e!==n&&e.navigator?e.navigator:t,y=h||(v&&v.userAgent?v.userAgent:""),b=v&&v.userAgentData?v.userAgentData:t,w=g?function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r}(K,g):K,E=v&&v.userAgent==y;return this.getBrowser=function(){var e,n={};return n[l]=t,n[d]=t,$.call(n,y,w.browser),n[s]=typeof(e=n[d])===i?e.replace(/[^\d\.]/g,"").split(".")[0]:t,E&&v&&v.brave&&typeof v.brave.isBrave==r&&(n[l]="Brave"),n},this.getCPU=function(){var e={};return e[p]=t,$.call(e,y,w.cpu),e},this.getDevice=function(){var e={};return e[u]=t,e[a]=t,e[c]=t,$.call(e,y,w.device),E&&!e[c]&&b&&b.mobile&&(e[c]=m),E&&"Macintosh"==e[a]&&v&&typeof v.standalone!==n&&v.maxTouchPoints&&v.maxTouchPoints>2&&(e[a]="iPad",e[c]=f),e},this.getEngine=function(){var e={};return e[l]=t,e[d]=t,$.call(e,y,w.engine),e},this.getOS=function(){var e={};return e[l]=t,e[d]=t,$.call(e,y,w.os),E&&!e[l]&&b&&"Unknown"!=b.platform&&(e[l]=b.platform.replace(/chrome os/i,F).replace(/macos/i,j)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return y},this.setUA=function(e){return y=typeof e===i&&e.length>350?V(e,350):e,this},this.setUA(y),this};J.VERSION="1.0.35",J.BROWSER=G([l,d,s]),J.CPU=G([p]),J.DEVICE=G([a,u,c,h,m,g,f,v,y]),J.ENGINE=J.OS=G([l,d]),I.exports&&(O=I.exports=J),O.UAParser=J;var X=typeof e!==n&&(e.jQuery||e.Zepto);if(X&&!X.ua){var Q=new J;X.ua=Q.getResult(),X.ua.get=function(){return Q.getUA()},X.ua.set=function(e){Q.setUA(e);var t=Q.getResult();for(var r in t)X.ua[r]=t[r]}}}("object"==typeof window?window:x);var C=Object.defineProperty,D=(e,t,r)=>(((e,t,r)=>{t in e?C(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);const M="Unknown",L="Safari",k="Firefox",U="Opera",P="Chrome",q="iOS-webview";class B{static getName(){if(!this._name)if("undefined"!=typeof navigator&&navigator){const{userAgent:e}=navigator;e.match(/Firefox/i)?this._name=k:e.match(/(Opera|OPR)/i)?this._name=U:e.match(/Chrome/i)?this._name=P:e.match(/Safari/i)?this._name=L:e.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Version)/i)?this._name=q:this._name=M}else this._name=M;return this._name}static get isMobile(){if(null===this._isMobile&&(this._isMobile=!1,"undefined"!=typeof navigator&&navigator)){const e=navigator.userAgent||navigator.vendor;e&&(/(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(e)||/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(e.substr(0,4)))&&(this._isMobile=!0)}return this._isMobile}static clearCache(){this._name=null,this._isMobile=null}}D(B,"_name",null),D(B,"_isMobile",null);const F=[4215763,14529296,11869460,48895,16468400,45661,13290186];const j=Object.freeze(Object.defineProperty({__proto__:null,getQualitativeColor:function(e){return F[e%F.length]}},Symbol.toStringTag,{value:"Module"}));const G=Object.freeze(Object.defineProperty({__proto__:null,formatSO:function(e,...t){let r=e.toString();if(t.length){const e=typeof t[0],n="string"===e||"number"===e?t.slice():t[0];for(const t in n)r=r.replace(new RegExp("\\{"+t+"\\}","gi"),n[t])}return r},toUpperCase:function(e){return e.toUpperCase()}},Symbol.toStringTag,{value:"Module"})),W=4,H=3,V={wheelchair:{horrible:.1,bad:.5,intermediate:.7,good:.9,excellent:1},default:{horrible:.4,bad:.7,intermediate:.8,good:.9,excellent:1}},$={wheelchair:{asphalt:1,concrete:1,paved:1,paving_stones:.8,compacted:.7,wood:.6,metal:.5,gravel:.3,grass:.2,ground:.2},default:{asphalt:1,concrete:1,paved:1,paving_stones:.9,compacted:.8,wood:.8,metal:.7,gravel:.6,grass:.5,ground:.4}},z=class e{constructor(){t(this,"avoidStairs",!1),t(this,"avoidEscalators",!1),t(this,"avoidElevators",!1),t(this,"avoidMovingWalkways",!1),t(this,"avoidTicketRestrictedAreas",!1),t(this,"useMultiLevelSegments",!1),t(this,"projectionMaxDistance"),t(this,"isWheelchair",!1)}setAvoidStairs(e){return this.avoidStairs=e,this}setAvoidEscalators(e){return this.avoidEscalators=e,this}setAvoidElevators(e){return this.avoidElevators=e,this}setAvoidMovingWalkways(e){return this.avoidMovingWalkways=e,this}setAvoidTicketRestrictedAreas(e){return this.avoidTicketRestrictedAreas=e,this}setUseMultiLevelSegments(e){return this.useMultiLevelSegments=e,this}setIsWheelchair(e){return this.isWheelchair=e,this}static fromJson(t){const r=new e;return Object.assign(r,t),r.build()}build(){return{input:{avoidStairs:this.avoidStairs,avoidEscalators:this.avoidEscalators,avoidElevators:this.avoidElevators,avoidMovingWalkways:this.avoidMovingWalkways,avoidTicketRestrictedAreas:this.avoidTicketRestrictedAreas,isWheelchair:this.isWheelchair,projectionMaxDistance:this.projectionMaxDistance},weightEdgeFn:e=>{if(e.properties.isElevator)return 90;const t=this.isWheelchair?H:W;let r=m(e.length,t);if(e.properties.areStairs)r*=3;else if(e.properties.areEscalators)r*=1.5;else if(e.properties.isMovingWalkway)r*=.8;else if(e.properties.smoothness){const t=this.isWheelchair?"wheelchair":"default";r*=V[t][e.properties.smoothness]??1}else if(e.properties.surface){const t=this.isWheelchair?"wheelchair":"default";r*=$[t][e.properties.surface]??1}else"limited"===e.properties.wheelchair&&(r*=.5);return r},weightVertexFn:e=>e.properties.isTurnstile?10:0,acceptEdgeFn:e=>{if(e.properties.wheelchair){if(this.isWheelchair&&"no"===e.properties.wheelchair)return!1;if(!this.isWheelchair&&"designated"===e.properties.wheelchair)return!1}if(this.isWheelchair){if(e.properties.areStairs)return!1;if(e.properties.areEscalators)return!1;if(e.properties.isMovingWalkway)return!1}return(!this.avoidStairs||!e.properties.areStairs)&&((!this.avoidEscalators||!e.properties.areEscalators)&&((!this.avoidElevators||!e.properties.isElevator)&&((!this.avoidMovingWalkways||!e.properties.isMovingWalkway)&&(!this.avoidTicketRestrictedAreas||!e.properties.needTicket))))},projectionMaxDistance:this.projectionMaxDistance,useMultiLevelSegments:this.useMultiLevelSegments}}};t(z,"DEFAULT",(new z).build()),t(z,"WITHOUT_STAIRS",(new z).setAvoidStairs(!0).build()),t(z,"WHEELCHAIR",(new z).setIsWheelchair(!0).build());let Y=z;class K{constructor(e,t,r,n,o){this.prev=e,this.dist=t,this.source=r,this.targets=n,this.edges=o}routeVertices(e=this.targets[0],t=[]){const r=this.prev[e.id];return null===r?this.source===e?[...t,e]:[]:[...this.routeVertices(r,t),e]}weightedDistance(e=this.targets[0]){const t=this.dist[e.id];return t===Number.MAX_VALUE?null:t}route(e=this.targets[0]){const t=this.routeVertices(e),r=[],n=[];for(let o=1;o<t.length;o++){const e=t[o-1],i=t[o],s=u.getEdgeByVertices(this.edges,e,i),a=new u(e,i,Object.assign({},s.properties));s.vertex1===a.vertex2&&a.reverseProperties(),r.push(a),n.push(this.dist[i.id]-this.dist[e.id])}return new E(this.source.coords,e.coords,t,r,n)}toGeoJson(e){return{type:"FeatureCollection",features:[...e.vertices.map((e=>{const t=this.prev[e.id],r=this.dist[e.id],n=e===this.source,o=this.targets.includes(e),i=e.coords.level;return{type:"Feature",properties:{id:e.id,...t&&{prev:t.id},dist:r===Number.MAX_VALUE?"infinity":r,...n&&{name:"source"},...o&&{name:"target"},...null!==i&&{level:i},...e.properties},geometry:{type:"Point",coordinates:[e.coords.lng,e.coords.lat]}}})),...e.edges.map((e=>{const t=e.level;return{type:"Feature",properties:{id:e.id,...null!==t&&{level:t},...e.properties},geometry:{type:"LineString",coordinates:[[e.vertex1.coords.lng,e.vertex1.coords.lat],[e.vertex2.coords.lng,e.vertex2.coords.lat]]}}}))]}}}class J{constructor(e){t(this,"disabledEdges",new Set),this.graph=e;let r=0;e.vertices.forEach((e=>e.id=r++))}calculateShortestPathToMultipleDestinationsByVertex(e,t,r=Y.DEFAULT,n=this.graph.vertices,o=this.graph.edges){const i=new Set(n),s=Array(i.size).fill(Number.MAX_VALUE),a=new Array(i.size).fill(null),l=o.filter((e=>{var t;return((null==(t=r.acceptEdgeFn)?void 0:t.call(r,e))??!0)&&!this.disabledEdges.has(e)})),c=r.weightEdgeFn||(e=>e.length),u=r.weightVertexFn||(e=>0),d=e=>{let t=Number.MAX_VALUE,r=null;return e.forEach((e=>{const n=s[e.id];n<=t&&(t=n,r=e)})),r},p=new Set(t);for(s[e.id]=0;i.size>0;){const e=d(i);if(i.delete(e),t.includes(e)&&(p.delete(e),0===p.size))break;l.filter((t=>t.vertex1==e||!t.properties.isOneway&&t.vertex2==e)).forEach((t=>{const r=e===t.vertex1?t.vertex2:t.vertex1,n=c(t)+u(r),o=s[e.id]+n;o<s[r.id]&&(s[r.id]=o,a[r.id]=e)}))}return new K(a,s,e,t,l)}calculateShortestPathByVertex(e,t,r=Y.DEFAULT,n=this.graph.vertices,o=this.graph.edges){return this.calculateShortestPathToMultipleDestinationsByVertex(e,[t],r,n,o)}calculateComponents(){function e(e){const t=e.values().next().value;return e.delete(t),t}const t=new Set(this.graph.vertices);let r,n=[];for(;t.size>0;){const r=e(t),o=this.graph.vertices.filter((e=>e.id!==r.id)),i=this.calculateShortestPathToMultipleDestinationsByVertex(r,o),s=o.filter((e=>null!==i.weightedDistance(e)));n.push([r,...s]),s.forEach((e=>t.delete(e)))}do{r=!1;for(let e=0;e<n.length-1;e++){const t=n[e];for(let o=e+1;o<n.length;o++){const e=n[o];e.some((e=>t.includes(e)))&&(t.push(...e),n=n.filter((t=>t!==e)),r=!0)}}}while(r);return n.map((e=>[...new Set(e)]))}toGeoJson(){const e=this.calculateComponents().map(((e,t)=>({type:"Feature",geometry:{type:"MultiLineString",coordinates:this.graph.edges.filter((t=>e.includes(t.vertex1)&&e.includes(t.vertex2))).map((e=>[[e.vertex1.coords.lng,e.vertex1.coords.lat],[e.vertex2.coords.lng,e.vertex2.coords.lat]]))},properties:{stroke:"#"+j.getQualitativeColor(t).toString(16)}})));return{type:"FeatureCollection",features:e}}}class X extends K{constructor(e,t,r){super(e.prev,e.dist,e.source,e.targets,e.edges),this.sourceProjection=t,this.targetsProjections=r}static createEmpty(e,t){const r=t.length,n=new K(new Array(r).fill(null),new Array(r).fill(Number.MAX_VALUE),new p(e),t.map((e=>new p(e))),[]),o=[e,null],i=t.map((e=>[e,null]));return new X(n,o,i)}routeVertices(e=this.targetsProjections[0][0]){var t;if(e instanceof p)return super.routeVertices(e);if(!this.sourceProjection[1])return[];const r=null==(t=this.targetsProjections.find((([t])=>t===e)))?void 0:t[1];return r?super.routeVertices(r):[]}weightedDistance(e=this.targetsProjections[0][0]){var t;if(e instanceof p)return super.weightedDistance(e);if(!this.sourceProjection[1])return null;const r=null==(t=this.targetsProjections.find((([t])=>t===e)))?void 0:t[1];return r?super.weightedDistance(r):null}route(e=this.targetsProjections[0][0]){var t;if(e instanceof p)return super.route(e);const r=null==(t=this.targetsProjections.find((([t])=>t===e)))?void 0:t[1];if(!r)return new E(this.sourceProjection[0],e,[],[],[]);const n=super.route(r);return n.start=this.sourceProjection[0],n.end=e,n}}class Q extends J{calculateShortestPathToMultipleDestinations(e,t,r=Y.DEFAULT){const n=new Set,o=new Set,i=[],s={maxDistance:r.projectionMaxDistance,acceptEdgeFn:r.acceptEdgeFn,useMultiLevelSegments:r.useMultiLevelSegments},a=e=>{const t=this.graph.getProjection(e,s);if(null===t)return null;if(t.nearestElement instanceof p)return t.nearestElement;if(t.nearestElement instanceof u){const e=t.nearestElement,r=new p(t.coords,{name:`proj on ${e.properties.name||null} (tmp)`,...void 0!==e.properties.externalId&&{externalId:e.properties.externalId}});r.id=this.graph.vertices.length+n.size;const s={...e.properties,...void 0!==e.properties.externalId&&{externalId:e.properties.externalId}},a=new u(e.vertex1,r,s),l=new u(r,e.vertex2,s);n.add(r),o.add(a),o.add(l);const c=i.find((t=>t[0]===e));return c?c[1].push(r):i.push([e,[r]]),r}return null},l=a(e);if(!l)return X.createEmpty(e,t);const c=t.map((e=>[e,a(e)])),d=c.map((([,e])=>e)).filter((e=>null!==e));i.filter((e=>e[1].length>=2)),i.forEach((([e,t])=>{const r={...e.properties,name:`splitted ${e.properties.name||null} (tmp)`};for(let n=0;n<t.length;n++){const i=t[n],s=i.distanceTo(e.vertex1);for(let a=n+1;a<t.length;a++){const n=t[a],l=n.distanceTo(e.vertex1)<s?new u(n,i,r):new u(i,n,r);o.add(l)}}}));const h=this.calculateShortestPathToMultipleDestinationsByVertex(l,d,r,[...this.graph.vertices,...n],[...this.graph.edges,...o]);return new X(h,[e,l],c)}calculateShortestPath(e,t,r=Y.DEFAULT){return this.calculateShortestPathToMultipleDestinations(e,[t],r)}getShortestTrip(e,t,r=.99){const n=e.map((e=>{const t=new i.Point(0,0);return t.coords=e,t})),o=[],s=i.solve(n,r,void 0,((e,r)=>{const n=this.calculateShortestPath(e.coords,r.coords,t).route();return o.push(n),n.hasRoute?n.edgesWeights.reduce(((e,t)=>e+t),0):Number.MAX_VALUE})).map((e=>n[e])),a=[];for(let i=0;i<s.length;i++){const e=s[i],t=s[(i+1)%s.length];let r=o.find((r=>r.start===e.coords&&r.end===t.coords||r.end===e.coords&&r.start===t.coords));(null==r?void 0:r.end)===e.coords&&(r=r.reverse()),r&&a.push(r)}return a.some((e=>!e.hasRoute))?[]:a}}class Z extends Error{constructor(e,t,r=null){super(),this.start=e,this.end=t,this.details=r}get startStr(){return this.start instanceof p?`Vertex ${this.start.coords.toString()}`:this.start.toString()}get endStr(){return this.end instanceof p?`Vertex ${this.end.coords.toString()}`:Array.isArray(this.end)?this.end.map((e=>e instanceof p?e.coords.toString():e.toString())).join(","):this.end.toString()}get message(){let e=`No route found from ${this.startStr} to ${this.endStr}.`;return this.details&&(e+=` Details: ${this.details}`),e}}class ee{}var te=(e=>(e[e.OK=0]="OK",e[e.CANCELLED=1]="CANCELLED",e[e.UNKNOWN=2]="UNKNOWN",e[e.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",e[e.NOT_FOUND=5]="NOT_FOUND",e[e.UNIMPLEMENTED=12]="UNIMPLEMENTED",e[e.INTERNAL=13]="INTERNAL",e[e.UNAVAILABLE=14]="UNAVAILABLE",e[e.UNAUTHENTICATED=16]="UNAUTHENTICATED",e))(te||{});class re extends Error{constructor(e=te.UNKNOWN,r){super(r),t(this,"customMapName"),this.code=e}static notFound(e){return new re(te.NOT_FOUND,`Cannot found an itinerary. Details: ${e}`)}}class ne extends re{constructor(e=te.UNKNOWN,t,r){super(e,r),this.code=e,this.mapName=t,this.mapName=t}static notFound(e,t){return new ne(te.NOT_FOUND,e,`Cannot found an itinerary in map ${e}. Details: ${t||"No details"}`)}}class oe extends re{constructor(e=te.UNKNOWN,t,r){super(e,r),this.code=e,this.routerName=t,this.routerName=t}static notFound(e,t){return new oe(te.NOT_FOUND,e,`Cannot found an itinerary with ${e}. Details: ${t||"No details"}`)}static missingApiKey(e,t){return new oe(te.UNAUTHENTICATED,e,`API key is missing for ${e}. Details: ${t}`)}static unreachableServer(e,t){return new oe(te.NOT_FOUND,e,`Remote router server ${e} is unreachable. URL: ${t}`)}static responseNotParsing(e,t){return new oe(te.NOT_FOUND,e,`Remote router server response ${e} cannot be parsed. URL: ${t}`)}static travelModeUnimplemented(e,t){return new oe(te.UNIMPLEMENTED,e,`Travel mode "${t}" is not implemented for ${e}`)}}function ie(e,t,r,n,o,i,s="Europe/Paris"){const a=new Date(Date.UTC(e,t,r,n,o,i)),l=new Date(a.toLocaleString("en-US",{timeZone:"UTC"})),c=new Date(a.toLocaleString("en-US",{timeZone:s})),u=l.getTime()-c.getTime();return a.setTime(a.getTime()+u),a}function se(e){return new r.Coordinates(e.Lat,e.Long)}function ae(e){const[t,r]=e.split(" "),[n,o,i]=t.split("/"),[s,a,l]=r.split(":");return ie(Number(i),Number(o)-1,Number(n),Number(s),Number(a),Number(l)).getTime()}const le=new Map;le.set("CAR","Car"),le.set("WALK","Walk"),le.set("BIKE","Bike"),le.set("TRANSIT","PT");const ce=new Map;ce.set("WALK","WALK"),ce.set("BICYCLE","BIKE"),ce.set("TRAMWAY","TRAM"),ce.set("METRO","METRO"),ce.set("FUNICULAR","FUNICULAR"),ce.set("BUS","BUS"),ce.set("COACH","BUS"),ce.set("SCHOOL","BUS"),ce.set("BUS_PMR","BUS"),ce.set("MINIBUS","BUS"),ce.set("TROLLEY_BUS","BUS"),ce.set("TAXIBUS","BUS"),ce.set("SHUTTLE","BUS"),ce.set("TRAIN","TRAIN"),ce.set("HST","TRAIN"),ce.set("LOCAL_TRAIN","TRAIN"),ce.set("AIR","AIRPLANE"),ce.set("FERRY","BOAT"),ce.set("TAXI","UNKNOWN"),ce.set("CAR_POOL","UNKNOWN"),ce.set("PRIVATE_VEHICLE","CAR"),ce.set("SCOOTER","MOTO");const ue=new Map;function de(e){const t=e.match(/LINESTRING ?\((.*)\)/i),n=e.match(/POINT ?\((.*)\)/i);if(n){const[e,t]=n[1].split(" ");return[new r.Coordinates(Number(t),Number(e))]}return t[1].split(",").map((e=>{const t=e.trim().split(" ");return new r.Coordinates(Number(t[1]),Number(t[0]))}))}ue.set(0,"BUS"),ue.set(1,"WALK"),ue.set(2,"BIKE"),ue.set(3,"CAR"),ue.set(4,"UNKNOWN"),ue.set(5,"UNKNOWN"),ue.set(6,"UNKNOWN"),ue.set(7,"UNKNOWN"),ue.set(8,"UNKNOWN"),ue.set(9,"UNKNOWN"),ue.set(10,"UNKNOWN"),ue.set(11,"UNKNOWN"),ue.set(12,"UNKNOWN"),ue.set(13,"UNKNOWN"),ue.set(14,"UNKNOWN");const pe=new class extends ee{get rname(){return"cityway"}async getItineraries(e,t){const r=this.getURL(e,t),n=await fetch(r).catch((()=>{throw oe.unreachableServer(this.rname,r)})),o=await n.json().catch((()=>{throw oe.responseNotParsing(this.rname,r)}));return this.parseResponse(o)}getURL(e,t){const{origin:r,destination:n,travelMode:i,waypoints:s}=t,a=le.get(i);if(!a)throw oe.travelModeUnimplemented(this.rname,i);(s||[]).length>0&&o.warn(`${this.rname} router uses only the first 2 waypoints (asked ${null==s?void 0:s.length})`);const l=`DepartureLatitude=${r.latitude}&DepartureLongitude=${r.longitude}`,c=`ArrivalLatitude=${n.latitude}&ArrivalLongitude=${n.longitude}`,u=`TripModes=${a}`,d=new URL(e);t.departureTime&&(d.searchParams.set("Date",t.departureTime),d.searchParams.set("TypeDate","Departure"));let{search:p}=d;return p=(p?`${p}&`:"?")+`${l}&${c}&${u}`,`${d.origin}${d.pathname}${p}`}parseResponse(e){if(200!==e.StatusCode||!e.Data||!e.Data.length)throw oe.notFound(this.rname,e.Message);const t=[],r=e.Data.map((e=>e.response.trips.Trip.map((t=>({...t,...e.hasOwnProperty("PlanTripType")&&{PlanTripType:e.PlanTripType}}))))).flat();e:for(const n of r){if(n.hasOwnProperty("PlanTripType")&&"UNKNOWN"===ue.get(n.PlanTripType))continue;const e=[];for(const t of n.sections.Section){const r=t.Leg?t.Leg:t.PTRide,i=ce.get(r.TransportMode),s=[];let a,l,c;const u=new N;if("UNKNOWN"===i)continue e;if("WALK"===i||"BIKE"===i||"CAR"===i){a={name:r.Departure.Site.Name,coords:se(r.Departure.Site.Position)},l={name:r.Arrival.Site.Name,coords:se(r.Arrival.Site.Position)};for(const e of r.pathLinks.PathLink){let t;t=e.Geometry&&"Null"!==e.Geometry?de(e.Geometry):[a.coords,l.coords],t.forEach(((e,t)=>{0===t&&0!==s.length&&s[s.length-1].equals(e)||s.push(e)})),u.addStepInfo({coords:t[0],distance:e.Distance,name:e.Departure.Site.Name})}t===n.sections.Section[n.sections.Section.length-1]&&u.addStepInfo({coords:s[s.length-1]})}else{if(!g(i)){o.warn(`[CitywayParser] Unknown leg mode: ${r.TransportMode}`);continue}{a={name:r.Departure.StopPlace.Name,coords:se(r.Departure.StopPlace.Position)},l={name:r.Arrival.StopPlace.Name,coords:se(r.Arrival.StopPlace.Position)};let e=r.Line.Number;"TRAM"===i&&e.toLowerCase().includes("tram")&&(e=e.substr(5)),c={name:e,routeColor:r.Line.Color,routeTextColor:r.Line.TextColor,directionName:r.Destination};for(const t of r.steps.Step){de(t.Geometry).forEach(((e,t)=>{0===t&&0!==s.length&&s[s.length-1].equals(e)||s.push(e)}))}u.addStepInfo({coords:s[0],name:r.Line.Name,distance:r.Distance,type:"transit"})}}u.setStart(a.coords),u.setEnd(l.coords),u.setPathCoords(s);const d=new _({transitMode:i,duration:this.parseDuration(r.Duration),startTime:ae(r.Departure.Time),endTime:ae(r.Arrival.Time),coords:s,start:a,end:l,transportInfo:c,steps:u.build()});e.push(d)}const r=new S({duration:this.parseDuration(n.Duration),startTime:ae(n.Departure.Time),origin:se(n.Departure.Site.Position),endTime:ae(n.Arrival.Time),destination:se(n.Arrival.Site.Position),legs:e});t.push(r)}return t}parseDuration(e){const t=e.match(/(-)?P(?:([.,\d]+)Y)?(?:([.,\d]+)M)?(?:([.,\d]+)W)?(?:([.,\d]+)D)?T(?:([.,\d]+)H)?(?:([.,\d]+)M)?(?:([.,\d]+)S)?/),r=void 0===t[2]?0:Number(t[2]),n=void 0===t[3]?0:Number(t[3]),o=void 0===t[4]?0:Number(t[4]),i=void 0===t[5]?0:Number(t[5]),s=void 0===t[6]?0:Number(t[6]),a=void 0===t[7]?0:Number(t[7]);return(void 0===t[8]?0:Number(t[8]))+60*a+3600*s+86400*i+604800*o+2592e3*n+31557600*r}},he=new Map;he.set("Air","AIRPLANE"),he.set("Boat","BOAT"),he.set("Bus","BUS"),he.set("BusRapidTransit","BUS"),he.set("Coach","BUS"),he.set("Ferry","FERRY"),he.set("Funicular","FUNICULAR"),he.set("LocalTrain","TRAIN"),he.set("LongDistanceTrain","TRAIN"),he.set("Metro","METRO"),he.set("Métro","METRO"),he.set("RailShuttle","TRAIN"),he.set("RapidTransit","BUS"),he.set("Shuttle","BUS"),he.set("SuspendedCableCar","FUNICULAR"),he.set("Taxi","TAXI"),he.set("Train","TRAIN"),he.set("RER","TRAIN"),he.set("Tramway","TRAM"),he.set("walking","WALK"),he.set("bike","BIKE");const me=["physical_mode:Air","physical_mode:Boat","physical_mode:Bus","physical_mode:BusRapidTransit","physical_mode:Coach","physical_mode:Ferry","physical_mode:Funicular","physical_mode:LocalTrain","physical_mode:LongDistanceTrain","physical_mode:Metro","physical_mode:RailShuttle","physical_mode:RapidTransit","physical_mode:Shuttle","physical_mode:SuspendedCableCar","physical_mode:Taxi","physical_mode:Train","physical_mode:Tramway"];function fe(e){return new r.Coordinates(Number(e.lat),Number(e.lon))}function ge(e){return e[e.length-1]}function ve(e,t){const r=e.substr(0,4),n=e.substr(4,2),o=e.substr(6,2),i=e.substr(9,2),s=e.substr(11,2),a=e.substr(13,2);return ie(Number(r),Number(n)-1,Number(o),Number(i),Number(s),Number(a),t).getTime()}const ye=new class extends ee{get rname(){return"navitia"}async getItineraries(e,t){const r=this.getURL(e,t),n=r.searchParams.get("api_key");if(!n)throw oe.missingApiKey(this.rname);const o=await fetch(r,{method:"GET",headers:{Authorization:n}}).catch((()=>{throw oe.unreachableServer(this.rname,r.toString())})),i=await o.json().catch((()=>{throw oe.responseNotParsing(this.rname,r.toString())}));if(i&&i.error)throw oe.notFound(this.rname,i.error.message);const s=this.parseResponse(i);if(!s.some((e=>v(e.transitMode,t.travelMode))))throw oe.notFound(this.rname,"Selected mode of transport was not found for this itinerary.");return s}getURL(e,t){var r;const{origin:n,destination:i,waypoints:s,travelMode:a}=t;(s||[]).length>0&&o.warn(`${this.rname} router uses only the first 2 waypoints (asked ${null==s?void 0:s.length})`);const l=new URL(e),c=new URLSearchParams;c.set("from",`${n.longitude};${n.latitude}`),c.set("to",`${i.longitude};${i.latitude}`),c.set("data_freshness","realtime"),(null==(r=t.itineraryModifiers)?void 0:r.isWheelchair)&&c.set("wheelchair","true");let u=new URLSearchParams;switch(a){case"WALK":u=this.getWalkingQuery();break;case"BIKE":u=this.getBikeQuery();break;case"CAR":u=this.getCarQuery()}return[c,u].map((e=>{for(const t of e.entries())l.searchParams.append(t[0],t[1])})),l}getCarQuery(){const e=new URLSearchParams;return me.forEach((t=>{e.append("forbidden_uris[]",t)})),e.append("first_section_mode[]","walking"),e.append("first_section_mode[]","car"),e.append("last_section_mode[]","walking"),e.append("last_section_mode[]","car"),e}getWalkingQuery(){const e=new URLSearchParams;return me.forEach((t=>{e.append("forbidden_uris[]",t)})),e.append("first_section_mode[]","walking"),e.append("last_section_mode[]","walking"),e}getBikeQuery(){const e=new URLSearchParams;return me.forEach((t=>{e.append("forbidden_uris[]",t)})),e.append("first_section_mode[]","bike"),e.append("last_section_mode[]","bike"),e}getSectionCoords(e){let t,r;return t="stop_point"in e.from?e.from.stop_point.coord:"address"in e.from?e.from.address.coord:e.from.poi.coord,r="stop_point"in e.to?e.to.stop_point.coord:"address"in e.to?e.to.address.coord:e.to.poi.coord,{from:fe(t),to:fe(r)}}findStepsCoord(e,t){const n=e,o=[...n];let i=t[0],s=0;const a=[];for(const[l,c]of t.entries()){let e,u;if(0===l)u=0,e=n[0];else if(l===t.length-1)u=n.length-1,e=ge(n);else if(1===o.length)s++,u=s,e=o[0],n[u]=e;else{const t=r.Utils.trimRoute(o,o[0],i.distance);s+=t.length-1,o.splice(0,t.length-1),u=s,e=ge(t),n[u]=e}a.push({...c,coords:e}),i=c}return a}findStepCoords(e,t){var r;if("instruction_start_coordinate"in e)return fe(e.instruction_start_coordinate);const n=null==(r=t.vias)?void 0:r.find((t=>t.id===e.via_uri));return n?fe(n.access_point.coord):void 0}parseResponse(e){var t;if(!e||!e.journeys)throw oe.notFound(this.rname,null==(t=e.error)?void 0:t.message);const n=[],o=e.context.timezone;for(const i of e.journeys){const e=[];for(const n of i.sections){if("waiting"===n.type||"transfer"===n.type)continue;const{from:t,to:i}=this.getSectionCoords(n);let s=[];const a=n.geojson.coordinates.reduce(((e,[t,n])=>(s.includes(`${t}-${n}`)||(s=s.concat(`${t}-${n}`),e.push(new r.Coordinates(n,t))),e)),[]),l=(new N).setStart(t).setEnd(i).setPathCoords(a);let c,u=he.get(n.mode);if(n.path){const e=n.path.every((e=>"instruction_start_coordinate"in e||e.via_uri)),t=[];for(const r of n.path){let o;e?(o=this.findStepCoords(r,n),l.addStepInfo({name:r.name,distance:r.length,coords:o,type:"turn"})):t.push({name:r.name,distance:r.length})}e||l.setStepsInfo(this.findStepsCoord(a,t))}if("public_transport"===n.type){c={name:n.display_informations.code,routeColor:n.display_informations.color,routeTextColor:n.display_informations.text_color,directionName:n.display_informations.direction},u=he.get(n.display_informations.physical_mode);const e={coords:a[0],name:c.directionName,distance:n.geojson.properties[0].length,type:"transit"};l.setStepsInfo([e])}const d=new _({transitMode:u,duration:n.duration,startTime:ve(n.departure_date_time,o),endTime:ve(n.arrival_date_time,o),start:{name:n.from.name,coords:t},end:{name:n.to.name,coords:i},coords:a,transportInfo:c,steps:l.build()});e.push(d)}const t=new S({duration:i.duration,startTime:ve(i.departure_date_time,o),endTime:ve(i.arrival_date_time,o),origin:this.getSectionCoords(i.sections[0]).from,destination:this.getSectionCoords(ge(i.sections)).to,legs:e});n.push(t)}return n}};const be=new class extends ee{get rname(){return"deutsche-bahn"}async getItineraries(e,t){const r=this.getURL(e,t),n=await fetch(r).catch((()=>{throw oe.unreachableServer(this.rname,r)})),o=await n.json().catch((()=>{throw oe.responseNotParsing(this.rname,r)}));return this.parseResponse(o,t.origin,t.destination)}getURL(e,t){let n=e+"/route/v1/walking/";return n+=[t.origin,...t.waypoints||[],t.destination].map((e=>{if(null!==e.level){const t=r.Level.isRange(e.level)?e.level[0]:e.level;return e.longitude+","+e.latitude+","+t}return e.longitude+","+e.latitude})).join(";"),n+="?geometries=geojson&overview=full&steps=true",n}parseResponse(e,t,n){if(!e.segments)throw oe.notFound(this.rname);const o=e.segments.map((e=>{const t=r.Level.union(e.fromLevel,e.toLevel),n=e.polyline.map((({lon:e,lat:n})=>new r.Coordinates(n,e,null,t)));return new _({transitMode:"WALK",coords:n,start:{coords:n[0]},end:{coords:n[n.length-1]}})}));return[new S({origin:t,destination:n,legs:o})]}};function we(e){const t=e[0];return e.slice(1).map((e=>{const r={};return t.forEach(((t,n)=>{r[t]=e[n]})),r}))}const Ee=new Map;Ee.set("BIKE","BIKE"),Ee.set("PEDESTRIAN","WALK");function Te(e){return new r.Coordinates(e.latitude,e.longitude)}function Ne(e){return e[e.length-1]}const _e=new class extends ee{get rname(){return"geovelo"}async getItineraries(e,t){const r=this.getQueryParams(),n=this.getBodyParams(t),o=new URL(e);for(const[a,l]of Object.entries(r))o.searchParams.append(a,l.toString());const i=await fetch(o,{method:"POST",headers:{apiKey:"qWHj6ax6DMttG8DX6tH9CQARaiTgQ1Di","Content-Type":"application/json"},body:JSON.stringify(n)}).catch((()=>{throw oe.unreachableServer(this.rname,o.toString())})),s=await i.json().catch((()=>{throw oe.responseNotParsing(this.rname,o.toString())}));if(!s||0===s.length)throw oe.notFound(this.rname,"No itineraries found.");return this.parseResponse(s)}getQueryParams(){return{instructions:!0,elevations:!1,geometry:!0,single_result:!1,bike_stations:!1,objects_as_ids:!1,merge_instructions:!0,show_pushing_bike_instructions:!1}}getBodyParams(e){const{origin:t,destination:r,waypoints:n}=e;let o=[];return o=n&&n.length>1?n.map((e=>({longitude:e.longitude,latitude:e.latitude}))):[{latitude:t.latitude,longitude:t.longitude},{latitude:r.latitude,longitude:r.longitude}],{transportModes:["BIKE"],waypoints:o}}parseResponse(e){if(!e||!e.length)throw oe.notFound(this.rname);const t=[];for(const n of e){const e=[];for(const t of n.sections){const n=Te(t.waypoints[0]),o=Te(Ne(t.waypoints)),i=s.toGeoJSON(t.geometry,6);let a=[];const l=i.coordinates.reduce(((e,[t,n])=>(a.includes(`${t}-${n}`)||(a=a.concat(`${t}-${n}`),e.push(new r.Coordinates(n,t))),e)),[]),c=(new N).setStart(n).setEnd(o).setPathCoords(l),u=Ee.get(t.transportMode),d=we(t.details.instructions);for(const e of d){const{geometryIndex:t,roadLength:n,roadName:o}=e,s=i.coordinates[t],a={name:o,distance:n,coords:new r.Coordinates(s[1],s[0])};c.addStepInfo(a)}const p=new _({transitMode:u,duration:t.duration,startTime:new Date(t.estimatedDatetimeOfDeparture).getTime(),endTime:new Date(t.estimatedDatetimeOfArrival).getTime(),start:{coords:n},end:{coords:o},coords:l,steps:c.build()});e.push(p)}const o=new S({duration:n.duration,startTime:new Date(n.estimatedDatetimeOfDeparture).getTime(),endTime:new Date(n.estimatedDatetimeOfArrival).getTime(),origin:Te(n.waypoints[0]),destination:Te(Ne(n.waypoints)),legs:e});t.push(o)}return t}},Se=new Map;Se.set("Air","AIRPLANE"),Se.set("Boat","BOAT"),Se.set("Bus","BUS"),Se.set("BusRapidTransit","BUS"),Se.set("Coach","BUS"),Se.set("Ferry","FERRY"),Se.set("Funicular","FUNICULAR"),Se.set("LocalTrain","TRAIN"),Se.set("LongDistanceTrain","TRAIN"),Se.set("Metro","METRO"),Se.set("Métro","METRO"),Se.set("RailShuttle","TRAIN"),Se.set("RapidTransit","BUS"),Se.set("Shuttle","BUS"),Se.set("SuspendedCableCar","FUNICULAR"),Se.set("Taxi","TAXI"),Se.set("Train","TRAIN"),Se.set("RER","TRAIN"),Se.set("Tramway","TRAM"),Se.set("walking","WALK"),Se.set("bike","BIKE");const xe=["physical_mode:Air","physical_mode:Boat","physical_mode:Bus","physical_mode:BusRapidTransit","physical_mode:Coach","physical_mode:Ferry","physical_mode:Funicular","physical_mode:LocalTrain","physical_mode:LongDistanceTrain","physical_mode:Metro","physical_mode:RailShuttle","physical_mode:RapidTransit","physical_mode:Shuttle","physical_mode:SuspendedCableCar","physical_mode:Taxi","physical_mode:Train","physical_mode:Tramway"];function Ae(e){return new r.Coordinates(Number(e.lat),Number(e.lon))}function Ie(e){return e[e.length-1]}function Oe(e,t){const r=e.substr(0,4),n=e.substr(4,2),o=e.substr(6,2),i=e.substr(9,2),s=e.substr(11,2),a=e.substr(13,2);return ie(Number(r),Number(n)-1,Number(o),Number(i),Number(s),Number(a),t).getTime()}const Re=new class extends ee{get rname(){return"idfm"}async getItineraries(e,t){const{travelMode:r}=t;if("BIKE"===r)return _e.getItineraries("https://idfm.getwemap.com/marketplace/computedroutes",t);const n=this.getURL(e,t),o=await fetch(n,{method:"GET",headers:{apiKey:"qWHj6ax6DMttG8DX6tH9CQARaiTgQ1Di"}}).catch((()=>{throw oe.unreachableServer(this.rname,n)})),i=await o.json().catch((()=>{throw oe.responseNotParsing(this.rname,n)}));if(i&&i.error)throw oe.notFound(this.rname,i.error.message);const s=this.parseResponse(i);if(!s.some((e=>v(e.transitMode,t.travelMode))))throw oe.notFound(this.rname,"Selected mode of transport was not found for this itinerary.");return s}getURL(e,t){var r;const{origin:n,destination:i,waypoints:s,travelMode:a}=t;(s||[]).length>0&&o.warn(`${this.rname} router uses only the first 2 waypoints (asked ${null==s?void 0:s.length})`);const l=new URL(e),c=new URLSearchParams;c.set("from",`${n.longitude};${n.latitude}`),c.set("to",`${i.longitude};${i.latitude}`),c.set("data_freshness","realtime"),(null==(r=t.itineraryModifiers)?void 0:r.isWheelchair)&&c.set("wheelchair","true"),t.departureTime&&(c.set("datetime",t.departureTime),c.set("datetime_represents","departure"));let u=new URLSearchParams;switch(a){case"WALK":u=this.getWalkingQuery();break;case"BIKE":u=this.getBikeQuery();break;case"CAR":u=this.getCarQuery()}return[c,u].map((e=>{for(const t of e.entries())l.searchParams.append(t[0],t[1])})),l.toString()}getCarQuery(){const e=new URLSearchParams;return xe.forEach((t=>{e.append("forbidden_uris[]",t)})),e.append("first_section_mode[]","walking"),e.append("first_section_mode[]","car"),e.append("last_section_mode[]","walking"),e.append("last_section_mode[]","car"),e}getWalkingQuery(){const e=new URLSearchParams;return xe.forEach((t=>{e.append("forbidden_uris[]",t)})),e.append("first_section_mode[]","walking"),e.append("last_section_mode[]","walking"),e}getBikeQuery(){const e=new URLSearchParams;return xe.forEach((t=>{e.append("forbidden_uris[]",t)})),e.append("first_section_mode[]","bike"),e.append("last_section_mode[]","bike"),e}getSectionCoords(e){let t,r;return t="stop_point"in e.from?e.from.stop_point.coord:"address"in e.from?e.from.address.coord:e.from.poi.coord,r="stop_point"in e.to?e.to.stop_point.coord:"address"in e.to?e.to.address.coord:e.to.poi.coord,{from:Ae(t),to:Ae(r)}}findStepsCoord(e,t){const n=e,o=[...n];let i=t[0],s=0;const a=[];for(const[l,c]of t.entries()){let e,u;if(0===l)u=0,e=n[0];else if(l===t.length-1)u=n.length-1,e=Ie(n);else if(1===o.length)s++,u=s,e=o[0],n[u]=e;else{const t=r.Utils.trimRoute(o,o[0],i.distance);s+=t.length-1,o.splice(0,t.length-1),u=s,e=Ie(t),n[u]=e}a.push({...c,coords:e}),i=c}return a}findStepCoords(e,t){var r;if("instruction_start_coordinate"in e)return Ae(e.instruction_start_coordinate);const n=null==(r=t.vias)?void 0:r.find((t=>t.id===e.via_uri));return n?Ae(n.access_point.coord):void 0}parseResponse(e){var t;if(!e||!e.journeys)throw oe.notFound(this.rname,null==(t=e.error)?void 0:t.message);const n=[],o=e.context.timezone;for(const i of e.journeys){const e=[];for(const n of i.sections){if("waiting"===n.type||"transfer"===n.type)continue;const{from:t,to:i}=this.getSectionCoords(n);let s=[];const a=n.geojson.coordinates.reduce(((e,[t,n])=>(s.includes(`${t}-${n}`)||(s=s.concat(`${t}-${n}`),e.push(new r.Coordinates(n,t))),e)),[]),l=(new N).setStart(t).setEnd(i).setPathCoords(a);let c,u=Se.get(n.mode);if(n.path){const e=n.path.every((e=>"instruction_start_coordinate"in e||e.via_uri)),t=[];for(const r of n.path){let o;if(e){o=this.findStepCoords(r,n);const e={name:r.name,distance:r.length,coords:o};l.addStepInfo(e)}else t.push({name:r.name,distance:r.length})}e||l.setStepsInfo(this.findStepsCoord(a,t))}if("public_transport"===n.type){c={name:n.display_informations.code,routeColor:n.display_informations.color,routeTextColor:n.display_informations.text_color,directionName:n.display_informations.direction},u=Se.get(n.display_informations.physical_mode);const e={coords:a[0],name:c.directionName,distance:n.geojson.properties[0].length,type:"transit"};l.setStepsInfo([e])}const d=new _({transitMode:u,duration:n.duration,startTime:Oe(n.departure_date_time,o),endTime:Oe(n.arrival_date_time,o),start:{name:n.from.name,coords:t},end:{name:n.to.name,coords:i},coords:a,transportInfo:c,steps:l.build()});e.push(d)}const t=new S({duration:i.duration,startTime:Oe(i.departure_date_time,o),endTime:Oe(i.arrival_date_time,o),origin:this.getSectionCoords(i.sections[0]).from,destination:this.getSectionCoords(Ie(i.sections)).to,legs:e});n.push(t)}return n}},Ce=new Map;Ce.set("CAR","CAR"),Ce.set("WALK","WALK"),Ce.set("BIKE","BIKE");const De=new class extends ee{constructor(){super(...arguments),t(this,"inputModeCorrespondance",(e=>{var t;const{travelMode:r,travelModePreference:n}=e;if("WALK"===r&&(null==(t=e.itineraryModifiers)?void 0:t.isWheelchair))return"pmr";if("WALK"===r)return"walking";if("BIKE"===r)return"FASTEST"===n?"bike-fastest":"bike-safest";if("CAR"===r)return"driving";throw oe.travelModeUnimplemented(this.rname,r)}))}get rname(){return"osrm"}async getItineraries(e,t){const r=this.getURL(e,t),n=await fetch(r).catch((()=>{throw oe.unreachableServer(this.rname,r)})),o=await n.json().catch((()=>{throw oe.responseNotParsing(this.rname,r)}));return this.parseResponse(o,t.origin,t.destination,t.travelMode)}getURL(e,t){const{origin:r,destination:n}=t;let o=e+"/route/v1/"+this.inputModeCorrespondance(t)+"/";return o+=[r,...t.waypoints||[],n].map((e=>[e.longitude+","+e.latitude])).join(";"),o+="?geometries=geojson&overview=full&steps=true",t.provideItineraryAlternatives&&(o+="&alternatives=true"),o}osrmTypeToStepType(e){switch(e){case"depart":return"depart";case"turn":default:return"turn";case"roundabout":return"roundabout";case"exit roundabout":return"exit-roundabout";case"arrive":return"arrive"}}osrmModifierToStepDirection(e){switch(e){case"sharp right":return"sharp-right";case"sharp left":return"sharp-left";case"slight right":return"slight-right";case"slight left":return"slight-left";case"u turn":return"u-turn";default:return e}}coordinatesToJson({lat:e,lng:t,level:n}){return null===n?[t,e]:r.Level.isRange(n)?[t,e,n[0]]:[t,e,n]}jsonToCoordinates(e){const t=new r.Coordinates(e[1],e[0]);return e.length>2&&(t.level=e[2]),t}getModifierFromAngle(e){const t=n.positiveMod(n.rad2deg(e),360);return t>0&&t<60?"sharp right":t>=60&&t<140?"right":t>=140&&t<160?"slight right":t>=160&&t<=200?"straight":t>200&&t<=220?"slight left":t>220&&t<=300?"left":t>300&&t<360?"sharp left":"u turn"}noRouteFoundJson(e){return{code:"NoRoute",message:e}}itineraryToOsrmJson(e){const t=e.legs.length-1,r=e.steps,o=e.legs.map((({distance:e,duration:o,coords:i},s)=>{const a=r.filter((e=>i.find((t=>t.equals(e.coords))))),l=a.length-1;return{distance:e,duration:o||0,steps:a.map(((e,r,o)=>{let a=0===r&&0===s?"depart":"turn";a=r===l&&s===t?"arrive":a;const c=i.findIndex((t=>t.equals(e.coords))),u=r===l?c:i.findIndex((e=>e.equals(o[r+1].coords)));return{geometry:{type:"LineString",coordinates:i.slice(c,u+1).map(this.coordinatesToJson)},distance:e.distance,duration:e.duration||0,...e.name&&{name:e.name},maneuver:{bearing_before:n.rad2deg(e.previousBearing),bearing_after:n.rad2deg(e.nextBearing),location:this.coordinatesToJson(e.coords),modifier:this.getModifierFromAngle(e.angle),type:a}}}))}}));return{code:"Ok",routes:[{geometry:{type:"LineString",coordinates:e.coords.map(this.coordinatesToJson)},legs:o,distance:e.distance,duration:e.duration,weight_name:"routability",weight:0}],waypoints:[]}}parseResponse(e,t,r,n){const o=Ce.get(n),{routes:i}=e;if(!i)throw oe.notFound(this.rname,e.message);return i.map((e=>{const n=e.legs.map((e=>{var t;const r=e.steps.map((e=>e.geometry.coordinates.map(this.jsonToCoordinates))).flat().filter(((e,t,r)=>0===t||!r[t-1].equals(e))),n=r[0],i=r[r.length-1],s=(new N).setPathCoords(r).setStart(n).setEnd(i);return null==(t=e.steps)||t.forEach((({maneuver:e,name:t,distance:n,duration:o})=>{const i=this.jsonToCoordinates(e.location),a=r.map((e=>e.distanceTo(i))),l=a.indexOf(Math.min(...a));if(l<0)throw new Error("Osrm Parser: Cannot find step coords in leg coordinates");const c=void 0!==e.exit?e.exit.toString():t;s.addStepInfo({coords:r[l],name:c,distance:n,duration:o,type:this.osrmTypeToStepType(e.type),direction:this.osrmModifierToStepDirection(e.modifier)})})),new _({transitMode:o,duration:e.duration,coords:r,start:{coords:n},end:{coords:i},steps:s.build()})}));return new S({duration:e.duration,origin:t,destination:r,legs:n})}))}};function Me(e){return"BUS"===e.mode||"TRAM"===e.mode}function Le(e){return new r.Coordinates(e.lat,e.lon)}const ke=new Map;ke.set("CAR","CAR"),ke.set("WALK","WALK"),ke.set("BIKE","BICYCLE"),ke.set("TRANSIT","WALK,TRANSIT");const Ue=new class extends ee{get rname(){return"otp"}async getItineraries(e,t){const r=this.getURL(e,t),n=await fetch(r).catch((()=>{throw oe.unreachableServer(this.rname,r)})),o=await n.json().catch((()=>{throw oe.responseNotParsing(this.rname,r)}));return this.parseResponse(o)}getURL(e,t){const{origin:r,destination:n,waypoints:i,travelMode:s}=t,a=ke.get(s);if(!a)throw oe.travelModeUnimplemented(this.rname,s);(i||[]).length>0&&o.warn(`${this.rname} router uses only the first 2 waypoints (asked ${null==i?void 0:i.length})`);const l=`fromPlace=${r.latitude},${r.longitude}`,c=`toPlace=${n.latitude},${n.longitude}`,u=`mode=${a}`,d=new URL(e);let{search:p}=d;return p=(p?`${p}&`:"?")+`${l}&${c}&${u}`,`${d.origin}${d.pathname}${p}`}parseResponse(e){const{plan:t}=e;if(!t)throw oe.notFound(this.rname);const n=[],o=Le(t.from),i=Le(t.to);for(const a of t.itineraries){const e=[];for(const n of a.legs){const t=Le(n.from),o=Le(n.to),i=s.decode(n.legGeometry.points).map((([e,t])=>new r.Coordinates(e,t)));let a;const l=(new N).setStart(t).setEnd(o).setPathCoords(i);Me(n)?(a={name:n.routeShortName,routeColor:n.routeColor,routeTextColor:n.routeTextColor,directionName:n.headsign},l.addStepInfo({coords:i[0],name:n.headsign,type:"transit"})):n.steps.forEach((e=>{const t=i.map((t=>t.distanceTo(Le(e)))),r=t.indexOf(Math.min(...t));if(r<0)throw new Error("OTP Parser: Cannot find closest step");l.addStepInfo({coords:i[r],name:e.streetName,type:"turn"})}));const c=new _({transitMode:n.mode,duration:n.duration,startTime:n.startTime,endTime:n.endTime,start:{name:n.from.name,coords:Le(n.from)},end:{name:n.to.name,coords:Le(n.to)},coords:i,transportInfo:a,steps:l.build()});e.push(c)}const t=new S({duration:a.duration,startTime:a.startTime,endTime:a.endTime,origin:o,destination:i,legs:e});n.push(t)}return n}};const Pe=new class extends ee{get rname(){return"wemap-multi"}async getItineraries(e,t){const{origin:n,destination:o,waypoints:i}=t,s={...t,origin:n instanceof r.Coordinates?n.toJson():n,destination:o instanceof r.Coordinates?o.toJson():o,...i&&{waypoints:i.map((e=>e instanceof r.Coordinates?e.toJson():e))}},a=await fetch(e,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(s)}).catch((()=>{throw oe.unreachableServer(this.rname,e)})),l=await a.json().catch((()=>{throw oe.responseNotParsing(this.rname,e)}));if(l.error)throw oe.notFound(this.rname,l.error);return(l.itineraries||[]).map(S.fromJson)}},qe="https://routing-osrm.getwemap.com";const Be=new class extends ee{get rname(){return"tictactrip"}async getSegmentItinerary(e,t){const r=m(e.distanceTo(t));if(r<300)return null;let n=null;return n=r<1800?(await De.getItineraries(qe,{origin:e,destination:t,travelMode:"WALK",provideItineraryAlternatives:!1,optimizeWaypoints:!1}))[0]:(await De.getItineraries(qe,{origin:e,destination:t,travelMode:"CAR",provideItineraryAlternatives:!1,optimizeWaypoints:!1}))[0],n}getItineraryFromStation(e,t){return De.getItineraries(qe,{origin:e,destination:t,travelMode:"WALK"})}async getItineraries(e,t){const r=this.getBodyParams(t),n=new URL(e),o=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}).catch((()=>{throw oe.unreachableServer(this.rname,n.toString())})),i=await o.json().catch((()=>{throw oe.responseNotParsing(this.rname,n.toString())}));return await this.parseResponse(i,t)}getBodyParams(e){const{origin:t,destination:r}=e;return{origin:{latitude:t.lat,longitude:t.lng},destination:{latitude:r.lat,longitude:r.lng},outbound_date:e.departureTime||(new Date).toISOString(),passengers:[{age:30}]}}async parseResponse(e,t){return e&&e.trips?await Promise.all(Object.values(e.trips).filter((e=>"TRAIN"===e.transportType)).map((async e=>{var n,o;const i=e.segments.map((e=>{const t=G.toUpperCase(e.transportType),n=new r.Coordinates(e.origin.latitude,e.origin.longitude),o=new r.Coordinates(e.destination.latitude,e.destination.longitude),i=[n,o],s=(new N).setStart(n).setEnd(o).setPathCoords(i);return s.setStepsInfo([{coords:n,type:"depart",direction:null},{coords:o,type:"arrive",direction:null}]),new _({start:{name:e.origin.name,coords:n},end:{name:e.destination.name,coords:o},coords:[n,o],transitMode:t,duration:60*e.durationMinutes,startTime:new Date(e.departureLocalISO).getTime(),endTime:new Date(e.arrivalLocalISO).getTime(),transportInfo:{name:e.provider.name,price:e.priceCents/100,directionName:e.destination.name},steps:s.build()})}));let s=null,a=null;const l=[],c=null==(n=e.segments[0])?void 0:n.origin;if(c){const e=new r.Coordinates(c.latitude,c.longitude),n=t.origin;s=await this.getSegmentItinerary(n,e).catch((()=>null)),s&&(s.legs[0].start.name=c.name,l.push(...s.legs))}l.push(...i);const u=null==(o=e.segments[e.segments.length-1])?void 0:o.destination;if(u){const e=new r.Coordinates(u.latitude,u.longitude),n=t.destination;a=await this.getSegmentItinerary(e,n).catch((()=>null)),a&&(a.legs[a.legs.length-1].end.name=u.name,l.push(...a.legs))}return new S({origin:new r.Coordinates(e.origin.latitude,e.origin.longitude),destination:new r.Coordinates(e.destination.latitude,e.destination.longitude),duration:60*e.durationMinutes,startTime:new Date(e.departureLocalISO).getTime(),endTime:new Date(e.arrivalLocalISO).getTime(),legs:l})}))):[]}},Fe=[pe,ye,be,Re,De,Ue,Be,Pe];const je=new class{getRouterByName(e){return Fe.find((t=>t.rname===e))}async getItineraries(e,t,r){const n=this.getRouterByName(e);if(!n)throw oe.notFound(e,`Unknown "${e}" remote router`);return n.getItineraries(t,r)}async getItinerariesWithFallback(e,t){let r;const n=[];for(const{name:a,endpointUrl:l}of t)try{if(r=await this.getItineraries(a,l,e),r.length)return r}catch(s){if(!(s instanceof oe))throw s;n.push({name:a,endpointUrl:l,error:s})}const o=t.map((({name:e})=>e)).join(", "),i=n.map((e=>`(${e.name}) Could not find an itinerary on endpoint: ${e.endpointUrl}. Details: ${e.error.message}`)).join("\n");throw oe.notFound(o,i)}};class Ge{constructor(e,r=null){t(this,"router"),this.graph=e,this.name=r,this.name=r,this.graph=e,this.router=new Q(e)}get routingBounds(){return this.graph.routingBounds}get entryPoints(){return this.graph.routingBoundsEntryPoints}isPointInside(e){return!!this.routingBounds&&a([e.lng,e.lat],this.routingBounds)}getOrderedEntryPointsSortedByDistance(e,t){const n=[...this.entryPoints];return n.sort(((n,o)=>Number(n.coords.distanceTo(e))+n.coords.distanceTo(t)-(o.coords.distanceTo(e)+o.coords.distanceTo(t))+50*(Math.abs(r.Level.diff(e.level,n.coords.level)||0)+Math.abs(r.Level.diff(t.level,n.coords.level)||0)-(Math.abs(r.Level.diff(e.level,o.coords.level)||0)+Math.abs(r.Level.diff(t.level,o.coords.level)||0)))))}getBestRouteFromEntryPointsToDestination(e,t,r){const n=this.getOrderedEntryPointsSortedByDistance(e,t);for(const o of n){const e=this.router.calculateShortestPath(o.coords,t,r).route();if(e.hasRoute)return e}return null}getBestRouteFromOriginToEntryPoints(e,t,r){const n=this.getOrderedEntryPointsSortedByDistance(e,t);for(const o of n){const t=this.router.calculateShortestPath(e,o.coords,r).route();if(t.hasRoute)return t}return null}getRouteInsideMap(e,t,r){const n=this.router.calculateShortestPath(e,t,r).route();return n.hasRoute?n:null}getTripInsideMap(e,t){return this.router.getShortestTrip(e,t)}getRoutesMultipleDestinationsInsideMap(e,t,r){return this.router.calculateShortestPathToMultipleDestinations(e,t,r)}}var We={exports:{}};
2
2
  /**
3
3
  * @license
4
4
  * lodash (Custom Build) <https://lodash.com/>
@@ -7,5 +7,5 @@
7
7
  * Released under MIT license <https://lodash.com/license>
8
8
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
9
9
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
10
- */!function(e,t){(function(){var r,n="__lodash_hash_undefined__",o=9007199254740991,i="[object Arguments]",s="[object Array]",a="[object Boolean]",l="[object Date]",c="[object Error]",u="[object Function]",d="[object GeneratorFunction]",p="[object Map]",h="[object Number]",m="[object Object]",f="[object Promise]",g="[object RegExp]",v="[object Set]",y="[object String]",b="[object Symbol]",w="[object WeakMap]",E="[object ArrayBuffer]",T="[object DataView]",N="[object Float32Array]",_="[object Float64Array]",S="[object Int8Array]",A="[object Int16Array]",I="[object Int32Array]",O="[object Uint8Array]",R="[object Uint8ClampedArray]",C="[object Uint16Array]",D="[object Uint32Array]",L=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,M=/^\w*$/,k=/^\./,U=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,P=/\\(\\)?/g,q=/\w*$/,B=/^\[object .+?Constructor\]$/,F=/^(?:0|[1-9]\d*)$/,j={};j[N]=j[_]=j[S]=j[A]=j[I]=j[O]=j[R]=j[C]=j[D]=!0,j[i]=j[s]=j[E]=j[a]=j[T]=j[l]=j[c]=j[u]=j[p]=j[h]=j[m]=j[g]=j[v]=j[y]=j[w]=!1;var G={};G[i]=G[s]=G[E]=G[T]=G[a]=G[l]=G[N]=G[_]=G[S]=G[A]=G[I]=G[p]=G[h]=G[m]=G[g]=G[v]=G[y]=G[b]=G[O]=G[R]=G[C]=G[D]=!0,G[c]=G[u]=G[w]=!1;var W="object"==typeof x&&x&&x.Object===Object&&x,H="object"==typeof self&&self&&self.Object===Object&&self,V=W||H||Function("return this")(),$=t&&!t.nodeType&&t,z=$&&e&&!e.nodeType&&e,Y=z&&z.exports===$,K=Y&&W.process,J=function(){try{return K&&K.binding("util")}catch(e){}}(),X=J&&J.isTypedArray;function Q(e,t){return e.set(t[0],t[1]),e}function Z(e,t){return e.add(t),e}function ee(e,t){for(var r=-1,n=e?e.length:0;++r<n&&!1!==t(e[r],r,e););return e}function te(e,t,r,n){var o=-1,i=e?e.length:0;for(n&&i&&(r=e[++o]);++o<i;)r=t(r,e[o],o,e);return r}function re(e,t){for(var r=-1,n=e?e.length:0;++r<n;)if(t(e[r],r,e))return!0;return!1}function ne(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(r){}return t}function oe(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function ie(e,t){return function(r){return e(t(r))}}function se(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}var ae,le=Array.prototype,ce=Function.prototype,ue=Object.prototype,de=V["__core-js_shared__"],pe=(ae=/[^.]+$/.exec(de&&de.keys&&de.keys.IE_PROTO||""))?"Symbol(src)_1."+ae:"",he=ce.toString,me=ue.hasOwnProperty,fe=he.call(Object),ge=ue.toString,ve=RegExp("^"+he.call(me).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ye=Y?V.Buffer:r,be=V.Symbol,we=V.Uint8Array,Ee=ie(Object.getPrototypeOf,Object),Te=Object.create,Ne=ue.propertyIsEnumerable,_e=le.splice,Se=Object.getOwnPropertySymbols,xe=ye?ye.isBuffer:r,Ae=ie(Object.keys,Object),Ie=Math.max,Oe=yt(V,"DataView"),Re=yt(V,"Map"),Ce=yt(V,"Promise"),De=yt(V,"Set"),Le=yt(V,"WeakMap"),Me=yt(Object,"create"),ke=!Ne.call({valueOf:1},"valueOf"),Ue=It(Oe),Pe=It(Re),qe=It(Ce),Be=It(De),Fe=It(Le),je=be?be.prototype:r,Ge=je?je.valueOf:r,We=je?je.toString:r;function He(){}function Ve(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function $e(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ze(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Ye(e){var t=-1,r=e?e.length:0;for(this.__data__=new ze;++t<r;)this.add(e[t])}function Ke(e){this.__data__=new $e(e)}function Je(e,t){var r=Lt(e)||Dt(e)?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],n=r.length,o=!!n;for(var i in e)!t&&!me.call(e,i)||o&&("length"==i||Et(i,n))||r.push(i);return r}function Xe(e,t,n){(n!==r&&!Ct(e[t],n)||"number"==typeof t&&n===r&&!(t in e))&&(e[t]=n)}function Qe(e,t,n){var o=e[t];me.call(e,t)&&Ct(o,n)&&(n!==r||t in e)||(e[t]=n)}function Ze(e,t){for(var r=e.length;r--;)if(Ct(e[r][0],t))return r;return-1}function et(e,t,n,o,s,c,f){var w;if(o&&(w=c?o(e,s,c,f):o(e)),w!==r)return w;if(!Bt(e))return e;var x=Lt(e);if(x){if(w=function(e){var t=e.length,r=e.constructor(t);t&&"string"==typeof e[0]&&me.call(e,"index")&&(r.index=e.index,r.input=e.input);return r}(e),!t)return mt(e,w)}else{var L=wt(e),M=L==u||L==d;if(Ut(e))return function(e,t){if(t)return e.slice();var r=new e.constructor(e.length);return e.copy(r),r}(e,t);if(L==m||L==i||M&&!c){if(ne(e))return c?e:{};if(w=function(e){return"function"!=typeof e.constructor||Nt(e)?{}:(t=Ee(e),Bt(t)?Te(t):{});var t}(M?{}:e),!t)return function(e,t){return ft(e,bt(e),t)}(e,function(e,t){return e&&ft(t,Kt(t),e)}(w,e))}else{if(!G[L])return c?e:{};w=function(e,t,r,n){var o=e.constructor;switch(t){case E:return ht(e);case a:case l:return new o(+e);case T:return function(e,t){var r=t?ht(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,n);case N:case _:case S:case A:case I:case O:case R:case C:case D:return function(e,t){var r=t?ht(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}(e,n);case p:return function(e,t,r){var n=t?r(oe(e),!0):oe(e);return te(n,Q,new e.constructor)}(e,n,r);case h:case y:return new o(e);case g:return function(e){var t=new e.constructor(e.source,q.exec(e));return t.lastIndex=e.lastIndex,t}(e);case v:return function(e,t,r){var n=t?r(se(e),!0):se(e);return te(n,Z,new e.constructor)}(e,n,r);case b:return i=e,Ge?Object(Ge.call(i)):{}}var i}(e,L,et,t)}}f||(f=new Ke);var k=f.get(e);if(k)return k;if(f.set(e,w),!x)var U=n?function(e){return function(e,t,r){var n=t(e);return Lt(e)?n:function(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e}(n,r(e))}(e,Kt,bt)}(e):Kt(e);return ee(U||e,(function(r,i){U&&(r=e[i=r]),Qe(w,i,et(r,t,n,o,i,e,f))})),w}Ve.prototype.clear=function(){this.__data__=Me?Me(null):{}},Ve.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},Ve.prototype.get=function(e){var t=this.__data__;if(Me){var o=t[e];return o===n?r:o}return me.call(t,e)?t[e]:r},Ve.prototype.has=function(e){var t=this.__data__;return Me?t[e]!==r:me.call(t,e)},Ve.prototype.set=function(e,t){return this.__data__[e]=Me&&t===r?n:t,this},$e.prototype.clear=function(){this.__data__=[]},$e.prototype.delete=function(e){var t=this.__data__,r=Ze(t,e);return!(r<0)&&(r==t.length-1?t.pop():_e.call(t,r,1),!0)},$e.prototype.get=function(e){var t=this.__data__,n=Ze(t,e);return n<0?r:t[n][1]},$e.prototype.has=function(e){return Ze(this.__data__,e)>-1},$e.prototype.set=function(e,t){var r=this.__data__,n=Ze(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},ze.prototype.clear=function(){this.__data__={hash:new Ve,map:new(Re||$e),string:new Ve}},ze.prototype.delete=function(e){return vt(this,e).delete(e)},ze.prototype.get=function(e){return vt(this,e).get(e)},ze.prototype.has=function(e){return vt(this,e).has(e)},ze.prototype.set=function(e,t){return vt(this,e).set(e,t),this},Ye.prototype.add=Ye.prototype.push=function(e){return this.__data__.set(e,n),this},Ye.prototype.has=function(e){return this.__data__.has(e)},Ke.prototype.clear=function(){this.__data__=new $e},Ke.prototype.delete=function(e){return this.__data__.delete(e)},Ke.prototype.get=function(e){return this.__data__.get(e)},Ke.prototype.has=function(e){return this.__data__.has(e)},Ke.prototype.set=function(e,t){var r=this.__data__;if(r instanceof $e){var n=r.__data__;if(!Re||n.length<199)return n.push([e,t]),this;r=this.__data__=new ze(n)}return r.set(e,t),this};var tt,rt,nt=(tt=function(e,t){return e&&ot(e,t,Kt)},function(e,t){if(null==e)return e;if(!Mt(e))return tt(e,t);for(var r=e.length,n=rt?r:-1,o=Object(e);(rt?n--:++n<r)&&!1!==t(o[n],n,o););return e}),ot=function(e){return function(t,r,n){for(var o=-1,i=Object(t),s=n(t),a=s.length;a--;){var l=s[e?a:++o];if(!1===r(i[l],l,i))break}return t}}();function it(e,t){for(var n=0,o=(t=Tt(t,e)?[t]:pt(t)).length;null!=e&&n<o;)e=e[At(t[n++])];return n&&n==o?e:r}function st(e,t){return null!=e&&t in Object(e)}function at(e,t,n,o,u){return e===t||(null==e||null==t||!Bt(e)&&!Ft(t)?e!=e&&t!=t:function(e,t,n,o,u,d){var f=Lt(e),w=Lt(t),N=s,_=s;f||(N=(N=wt(e))==i?m:N);w||(_=(_=wt(t))==i?m:_);var S=N==m&&!ne(e),x=_==m&&!ne(t),A=N==_;if(A&&!S)return d||(d=new Ke),f||Ht(e)?gt(e,t,n,o,u,d):function(e,t,r,n,o,i,s){switch(r){case T:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case E:return!(e.byteLength!=t.byteLength||!n(new we(e),new we(t)));case a:case l:case h:return Ct(+e,+t);case c:return e.name==t.name&&e.message==t.message;case g:case y:return e==t+"";case p:var u=oe;case v:var d=2&i;if(u||(u=se),e.size!=t.size&&!d)return!1;var m=s.get(e);if(m)return m==t;i|=1,s.set(e,t);var f=gt(u(e),u(t),n,o,i,s);return s.delete(e),f;case b:if(Ge)return Ge.call(e)==Ge.call(t)}return!1}(e,t,N,n,o,u,d);if(!(2&u)){var I=S&&me.call(e,"__wrapped__"),O=x&&me.call(t,"__wrapped__");if(I||O){var R=I?e.value():e,C=O?t.value():t;return d||(d=new Ke),n(R,C,o,u,d)}}if(!A)return!1;return d||(d=new Ke),function(e,t,n,o,i,s){var a=2&i,l=Kt(e),c=l.length,u=Kt(t),d=u.length;if(c!=d&&!a)return!1;var p=c;for(;p--;){var h=l[p];if(!(a?h in t:me.call(t,h)))return!1}var m=s.get(e);if(m&&s.get(t))return m==t;var f=!0;s.set(e,t),s.set(t,e);var g=a;for(;++p<c;){var v=e[h=l[p]],y=t[h];if(o)var b=a?o(y,v,h,t,e,s):o(v,y,h,e,t,s);if(!(b===r?v===y||n(v,y,o,i,s):b)){f=!1;break}g||(g="constructor"==h)}if(f&&!g){var w=e.constructor,E=t.constructor;w==E||!("constructor"in e)||!("constructor"in t)||"function"==typeof w&&w instanceof w&&"function"==typeof E&&E instanceof E||(f=!1)}return s.delete(e),s.delete(t),f}(e,t,n,o,u,d)}(e,t,at,n,o,u))}function lt(e){return!(!Bt(e)||(t=e,pe&&pe in t))&&(Pt(e)||ne(e)?ve:B).test(It(e));var t}function ct(e){return"function"==typeof e?e:null==e?Qt:"object"==typeof e?Lt(e)?function(e,t){if(Tt(e)&&_t(t))return St(At(e),t);return function(n){var o=zt(n,e);return o===r&&o===t?Yt(n,e):at(t,o,r,3)}}(e[0],e[1]):function(e){var t=function(e){var t=Kt(e),r=t.length;for(;r--;){var n=t[r],o=e[n];t[r]=[n,o,_t(o)]}return t}(e);if(1==t.length&&t[0][2])return St(t[0][0],t[0][1]);return function(n){return n===e||function(e,t,n,o){var i=n.length,s=i,a=!o;if(null==e)return!s;for(e=Object(e);i--;){var l=n[i];if(a&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++i<s;){var c=(l=n[i])[0],u=e[c],d=l[1];if(a&&l[2]){if(u===r&&!(c in e))return!1}else{var p=new Ke;if(o)var h=o(u,d,c,e,t,p);if(!(h===r?at(d,u,o,3,p):h))return!1}}return!0}(n,e,t)}}(e):er(e)}function ut(e){if(!Bt(e))return function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}(e);var t=Nt(e),r=[];for(var n in e)("constructor"!=n||!t&&me.call(e,n))&&r.push(n);return r}function dt(e,t,n,o,i){if(e!==t){if(!Lt(t)&&!Ht(t))var s=ut(t);ee(s||t,(function(a,l){if(s&&(a=t[l=a]),Bt(a))i||(i=new Ke),function(e,t,n,o,i,s,a){var l=e[n],c=t[n],u=a.get(c);if(u)return void Xe(e,n,u);var d=s?s(l,c,n+"",e,t,a):r,p=d===r;p&&(d=c,Lt(c)||Ht(c)?Lt(l)?d=l:kt(l)?d=mt(l):(p=!1,d=et(c,!0)):jt(c)||Dt(c)?Dt(l)?d=Vt(l):!Bt(l)||o&&Pt(l)?(p=!1,d=et(c,!0)):d=l:p=!1);p&&(a.set(c,d),i(d,c,o,s,a),a.delete(c));Xe(e,n,d)}(e,t,l,n,dt,o,i);else{var c=o?o(e[l],a,l+"",e,t,i):r;c===r&&(c=a),Xe(e,l,c)}}))}}function pt(e){return Lt(e)?e:xt(e)}function ht(e){var t=new e.constructor(e.byteLength);return new we(t).set(new we(e)),t}function mt(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}function ft(e,t,n,o){n||(n={});for(var i=-1,s=t.length;++i<s;){var a=t[i],l=o?o(n[a],e[a],a,n,e):r;Qe(n,a,l===r?e[a]:l)}return n}function gt(e,t,n,o,i,s){var a=2&i,l=e.length,c=t.length;if(l!=c&&!(a&&c>l))return!1;var u=s.get(e);if(u&&s.get(t))return u==t;var d=-1,p=!0,h=1&i?new Ye:r;for(s.set(e,t),s.set(t,e);++d<l;){var m=e[d],f=t[d];if(o)var g=a?o(f,m,d,t,e,s):o(m,f,d,e,t,s);if(g!==r){if(g)continue;p=!1;break}if(h){if(!re(t,(function(e,t){if(!h.has(t)&&(m===e||n(m,e,o,i,s)))return h.add(t)}))){p=!1;break}}else if(m!==f&&!n(m,f,o,i,s)){p=!1;break}}return s.delete(e),s.delete(t),p}function vt(e,t){var r,n,o=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof t?"string":"hash"]:o.map}function yt(e,t){var n=function(e,t){return null==e?r:e[t]}(e,t);return lt(n)?n:r}var bt=Se?ie(Se,Object):tr,wt=function(e){return ge.call(e)};function Et(e,t){return!!(t=null==t?o:t)&&("number"==typeof e||F.test(e))&&e>-1&&e%1==0&&e<t}function Tt(e,t){if(Lt(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!Gt(e))||(M.test(e)||!L.test(e)||null!=t&&e in Object(t))}function Nt(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ue)}function _t(e){return e==e&&!Bt(e)}function St(e,t){return function(n){return null!=n&&(n[e]===t&&(t!==r||e in Object(n)))}}(Oe&&wt(new Oe(new ArrayBuffer(1)))!=T||Re&&wt(new Re)!=p||Ce&&wt(Ce.resolve())!=f||De&&wt(new De)!=v||Le&&wt(new Le)!=w)&&(wt=function(e){var t=ge.call(e),n=t==m?e.constructor:r,o=n?It(n):r;if(o)switch(o){case Ue:return T;case Pe:return p;case qe:return f;case Be:return v;case Fe:return w}return t});var xt=Rt((function(e){e=$t(e);var t=[];return k.test(e)&&t.push(""),e.replace(U,(function(e,r,n,o){t.push(n?o.replace(P,"$1"):r||e)})),t}));function At(e){if("string"==typeof e||Gt(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function It(e){if(null!=e){try{return he.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function Ot(e,t){return(Lt(e)?ee:nt)(e,function(){var e=He.iteratee||Zt;return e=e===Zt?ct:e,arguments.length?e(arguments[0],arguments[1]):e}(t,3))}function Rt(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var s=e.apply(this,n);return r.cache=i.set(o,s),s};return r.cache=new(Rt.Cache||ze),r}function Ct(e,t){return e===t||e!=e&&t!=t}function Dt(e){return kt(e)&&me.call(e,"callee")&&(!Ne.call(e,"callee")||ge.call(e)==i)}Rt.Cache=ze;var Lt=Array.isArray;function Mt(e){return null!=e&&qt(e.length)&&!Pt(e)}function kt(e){return Ft(e)&&Mt(e)}var Ut=xe||rr;function Pt(e){var t=Bt(e)?ge.call(e):"";return t==u||t==d}function qt(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}function Bt(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Ft(e){return!!e&&"object"==typeof e}function jt(e){if(!Ft(e)||ge.call(e)!=m||ne(e))return!1;var t=Ee(e);if(null===t)return!0;var r=me.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&he.call(r)==fe}function Gt(e){return"symbol"==typeof e||Ft(e)&&ge.call(e)==b}var Wt,Ht=X?(Wt=X,function(e){return Wt(e)}):function(e){return Ft(e)&&qt(e.length)&&!!j[ge.call(e)]};function Vt(e){return ft(e,Jt(e))}function $t(e){return null==e?"":function(e){if("string"==typeof e)return e;if(Gt(e))return We?We.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)}function zt(e,t,n){var o=null==e?r:it(e,t);return o===r?n:o}function Yt(e,t){return null!=e&&function(e,t,r){for(var n,o=-1,i=(t=Tt(t,e)?[t]:pt(t)).length;++o<i;){var s=At(t[o]);if(!(n=null!=e&&r(e,s)))break;e=e[s]}return n||!!(i=e?e.length:0)&&qt(i)&&Et(s,i)&&(Lt(e)||Dt(e))}(e,t,st)}function Kt(e){return Mt(e)?Je(e):function(e){if(!Nt(e))return Ae(e);var t=[];for(var r in Object(e))me.call(e,r)&&"constructor"!=r&&t.push(r);return t}(e)}function Jt(e){return Mt(e)?Je(e,!0):ut(e)}var Xt=function(e){return t=function(t,n){var o=-1,i=n.length,s=i>1?n[i-1]:r,a=i>2?n[2]:r;for(s=e.length>3&&"function"==typeof s?(i--,s):r,a&&function(e,t,r){if(!Bt(r))return!1;var n=typeof t;return!!("number"==n?Mt(r)&&Et(t,r.length):"string"==n&&t in r)&&Ct(r[t],e)}(n[0],n[1],a)&&(s=i<3?r:s,i=1),t=Object(t);++o<i;){var l=n[o];l&&e(t,l,o,s)}return t},n=Ie(n===r?t.length-1:n,0),function(){for(var e=arguments,r=-1,o=Ie(e.length-n,0),i=Array(o);++r<o;)i[r]=e[n+r];r=-1;for(var s=Array(n+1);++r<n;)s[r]=e[r];return s[n]=i,function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}(t,this,s)};var t,n}((function(e,t,r){dt(e,t,r)}));function Qt(e){return e}function Zt(e){return ct("function"==typeof e?e:et(e,!0))}function er(e){return Tt(e)?function(e){return function(t){return null==t?r:t[e]}}(At(e)):function(e){return function(t){return it(t,e)}}(e)}function tr(){return[]}function rr(){return!1}He.compact=function(e){for(var t=-1,r=e?e.length:0,n=0,o=[];++t<r;){var i=e[t];i&&(o[n++]=i)}return o},He.iteratee=Zt,He.keys=Kt,He.keysIn=Jt,He.memoize=Rt,He.merge=Xt,He.property=er,He.toPlainObject=Vt,He.clone=function(e){return et(e,!1,!0)},He.eq=Ct,He.forEach=Ot,He.get=zt,He.hasIn=Yt,He.identity=Qt,He.isArguments=Dt,He.isArray=Lt,He.isArrayLike=Mt,He.isArrayLikeObject=kt,He.isBuffer=Ut,He.isEmpty=function(e){if(Mt(e)&&(Lt(e)||"string"==typeof e||"function"==typeof e.splice||Ut(e)||Dt(e)))return!e.length;var t=wt(e);if(t==p||t==v)return!e.size;if(ke||Nt(e))return!Ae(e).length;for(var r in e)if(me.call(e,r))return!1;return!0},He.isFunction=Pt,He.isLength=qt,He.isObject=Bt,He.isObjectLike=Ft,He.isPlainObject=jt,He.isSymbol=Gt,He.isTypedArray=Ht,He.stubArray=tr,He.stubFalse=rr,He.toString=$t,He.each=Ot,He.VERSION="4.15.0",z&&((z.exports=He)._=He,$._=He)}).call(x)}(We,We.exports);var He=function e(t,r){var n,o=t&&t.type;if("FeatureCollection"===o)for(n=0;n<t.features.length;n++)e(t.features[n],r);else if("GeometryCollection"===o)for(n=0;n<t.geometries.length;n++)e(t.geometries[n],r);else if("Feature"===o)e(t.geometry,r);else if("Polygon"===o)Ve(t.coordinates,r);else if("MultiPolygon"===o)for(n=0;n<t.coordinates.length;n++)Ve(t.coordinates[n],r);return t};function Ve(e,t){if(0!==e.length){$e(e[0],t);for(var r=1;r<e.length;r++)$e(e[r],!t)}}function $e(e,t){for(var r=0,n=0,o=0,i=e.length,s=i-1;o<i;s=o++){var a=(e[o][0]-e[s][0])*(e[s][1]+e[o][1]),l=r+a;n+=Math.abs(r)>=Math.abs(a)?r-l+a:a-l+r,r=l}r+n>=0!=!!t&&e.reverse()}var ze=We.exports,Ye=He,Ke={};function Je(e,t){return(e.version||t.version)&&e.version!==t.version?(+e.version||0)>(+t.version||0)?e:t:ze.merge(e,t)}[{key:"building",polygon:"all"},{key:"highway",polygon:"whitelist",values:["services","rest_area","escape","elevator"]},{key:"natural",polygon:"blacklist",values:["coastline","cliff","ridge","arete","tree_row"]},{key:"landuse",polygon:"all"},{key:"waterway",polygon:"whitelist",values:["riverbank","dock","boatyard","dam"]},{key:"amenity",polygon:"all"},{key:"leisure",polygon:"all"},{key:"barrier",polygon:"whitelist",values:["city_wall","ditch","hedge","retaining_wall","wall","spikes"]},{key:"railway",polygon:"whitelist",values:["station","turntable","roundhouse","platform"]},{key:"area",polygon:"all"},{key:"boundary",polygon:"all"},{key:"man_made",polygon:"blacklist",values:["cutline","embankment","pipeline"]},{key:"power",polygon:"whitelist",values:["plant","substation","generator","transformer"]},{key:"place",polygon:"all"},{key:"shop",polygon:"all"},{key:"aeroway",polygon:"blacklist",values:["taxiway"]},{key:"tourism",polygon:"all"},{key:"historic",polygon:"all"},{key:"public_transport",polygon:"all"},{key:"office",polygon:"all"},{key:"building:part",polygon:"all"},{key:"military",polygon:"all"},{key:"ruins",polygon:"all"},{key:"area:highway",polygon:"all"},{key:"craft",polygon:"all"},{key:"golf",polygon:"all"},{key:"indoor",polygon:"all"}].forEach((function(e){if("all"===e.polygon)Ke[e.key]=!0;else{var t="whitelist"===e.polygon?"included_values":"excluded_values",r={};e.values.forEach((function(e){r[e]=!0})),Ke[e.key]={},Ke[e.key][t]=r}}));var Xe;function Qe(e){for(var t,r,n,o,i,s,a=function(e){return e[0]},l=function(e){return e[e.length-1]},c=function(e,t){return void 0!==e&&void 0!==t&&e.id===t.id},u=[];e.length;)for(t=e.pop().nodes.slice(),u.push(t);e.length&&!c(a(t),l(t));){for(r=a(t),n=l(t),o=0;o<e.length;o++){if(c(n,a(s=e[o].nodes))){i=t.push,s=s.slice(1);break}if(c(n,l(s))){i=t.push,s=s.slice(0,-1).reverse();break}if(c(r,l(s))){i=t.unshift,s=s.slice(0,-1);break}if(c(r,a(s))){i=t.unshift,s=s.slice(1).reverse();break}s=i=null}if(!s)break;e.splice(o,1),i.apply(t,s)}return u}Xe=function(e,t,r){var n;return t=ze.merge({verbose:!1,flatProperties:!0,uninterestingTags:{source:!0,source_ref:!0,"source:ref":!0,history:!0,attribution:!0,created_by:!0,"tiger:county":!0,"tiger:tlid":!0,"tiger:upload_uuid":!0},polygonFeatures:Ke,deduplicator:Je},t),n="undefined"!=typeof XMLDocument&&e instanceof XMLDocument||"undefined"==typeof XMLDocument&&e.childNodes?function(e){var t,r,n=new Array,i=new Array,s=new Array;function a(e,t,r){e.hasAttribute(r)&&(t[r]=e.getAttribute(r))}function l(e,t){var r=ze.clone(e);a(t,r,"lat"),a(t,r,"lon"),r.__is_center_placeholder=!0,n.push(r)}function c(e,t){var r=ze.clone(e);function o(e,t,o){var i={type:"node",id:"_"+r.type+"/"+r.id+"bounds"+o,lat:e,lon:t};r.nodes.push(i.id),n.push(i)}r.nodes=[],o(t.getAttribute("minlat"),t.getAttribute("minlon"),1),o(t.getAttribute("maxlat"),t.getAttribute("minlon"),2),o(t.getAttribute("maxlat"),t.getAttribute("maxlon"),3),o(t.getAttribute("minlat"),t.getAttribute("maxlon"),4),r.nodes.push(r.nodes[0]),r.__is_bounds_placeholder=!0,i.push(r)}return ze.each(e.getElementsByTagName("node"),(function(e,t){var r={};ze.each(e.getElementsByTagName("tag"),(function(e){r[e.getAttribute("k")]=e.getAttribute("v")}));var o={type:"node"};a(e,o,"id"),a(e,o,"lat"),a(e,o,"lon"),a(e,o,"version"),a(e,o,"timestamp"),a(e,o,"changeset"),a(e,o,"uid"),a(e,o,"user"),ze.isEmpty(r)||(o.tags=r),n.push(o)})),ze.each(e.getElementsByTagName("way"),(function(e,o){var s={},u=[];ze.each(e.getElementsByTagName("tag"),(function(e){s[e.getAttribute("k")]=e.getAttribute("v")}));var d=!1;ze.each(e.getElementsByTagName("nd"),(function(e,t){var r;(r=e.getAttribute("ref"))&&(u[t]=r),!d&&e.getAttribute("lat")&&(d=!0)}));var p={type:"way"};a(e,p,"id"),a(e,p,"version"),a(e,p,"timestamp"),a(e,p,"changeset"),a(e,p,"uid"),a(e,p,"user"),u.length>0&&(p.nodes=u),ze.isEmpty(s)||(p.tags=s),(t=e.getElementsByTagName("center")[0])&&l(p,t),d?function(e,t){function r(e,t,r){var o={type:"node",id:r,lat:e,lon:t};return n.push(o),o.id}ze.isArray(e.nodes)||(e.nodes=[],ze.each(t,(function(t,r){e.nodes.push("_anonymous@"+t.getAttribute("lat")+"/"+t.getAttribute("lon"))})));ze.each(t,(function(t,n){t.getAttribute("lat")&&r(t.getAttribute("lat"),t.getAttribute("lon"),e.nodes[n])}))}(p,e.getElementsByTagName("nd")):(r=e.getElementsByTagName("bounds")[0])&&c(p,r),i.push(p)})),ze.each(e.getElementsByTagName("relation"),(function(e,o){var u={},d=[];ze.each(e.getElementsByTagName("tag"),(function(e){u[e.getAttribute("k")]=e.getAttribute("v")}));var p=!1;ze.each(e.getElementsByTagName("member"),(function(e,t){d[t]={},a(e,d[t],"ref"),a(e,d[t],"role"),a(e,d[t],"type"),(!p&&"node"==d[t].type&&e.getAttribute("lat")||"way"==d[t].type&&e.getElementsByTagName("nd").length>0)&&(p=!0)}));var h={type:"relation"};a(e,h,"id"),a(e,h,"version"),a(e,h,"timestamp"),a(e,h,"changeset"),a(e,h,"uid"),a(e,h,"user"),d.length>0&&(h.members=d),ze.isEmpty(u)||(h.tags=u),(t=e.getElementsByTagName("center")[0])&&l(h,t),p?function(e,t){function r(e,t,r){var o={type:"node",id:r,lat:e,lon:t};n.push(o)}function o(e,t){if(!i.some((function(e){return"way"==e.type&&e.id==t}))){var r={type:"way",id:t,nodes:[]};ze.each(e,(function(e){e.getAttribute("lat")?o(e.getAttribute("lat"),e.getAttribute("lon")):r.nodes.push(void 0)})),i.push(r)}function o(e,t){var o={type:"node",id:"_anonymous@"+e+"/"+t,lat:e,lon:t};r.nodes.push(o.id),n.push(o)}}ze.each(t,(function(t,n){"node"==e.members[n].type?t.getAttribute("lat")&&r(t.getAttribute("lat"),t.getAttribute("lon"),e.members[n].ref):"way"==e.members[n].type&&t.getElementsByTagName("nd").length>0&&(e.members[n].ref="_fullGeom"+e.members[n].ref,o(t.getElementsByTagName("nd"),e.members[n].ref))}))}(h,e.getElementsByTagName("member")):(r=e.getElementsByTagName("bounds")[0])&&c(h,r),s.push(h)})),o(n,i,s)}(e):function(e){var t=new Array,r=new Array,n=new Array;function i(e){var r=ze.clone(e);r.lat=e.center.lat,r.lon=e.center.lon,r.__is_center_placeholder=!0,t.push(r)}function s(e){var n=ze.clone(e);function o(e,r,o){var i={type:"node",id:"_"+n.type+"/"+n.id+"bounds"+o,lat:e,lon:r};n.nodes.push(i.id),t.push(i)}n.nodes=[],o(n.bounds.minlat,n.bounds.minlon,1),o(n.bounds.maxlat,n.bounds.minlon,2),o(n.bounds.maxlat,n.bounds.maxlon,3),o(n.bounds.minlat,n.bounds.maxlon,4),n.nodes.push(n.nodes[0]),n.__is_bounds_placeholder=!0,r.push(n)}function a(e){ze.isArray(e.nodes)||(e.nodes=e.geometry.map((function(e){return null!==e?"_anonymous@"+e.lat+"/"+e.lon:"_anonymous@unknown_location"}))),e.geometry.forEach((function(r,n){var o,i,s,a;r&&(o=r.lat,i=r.lon,s=e.nodes[n],a={type:"node",id:s,lat:o,lon:i},t.push(a))}))}function l(e){function n(e,n){if(!r.some((function(e){return"way"==e.type&&e.id==n}))){var o={type:"way",id:n,nodes:[]};e.forEach((function(e){var r,n,i;e?(r=e.lat,n=e.lon,i={type:"node",id:"_anonymous@"+r+"/"+n,lat:r,lon:n},o.nodes.push(i.id),t.push(i)):o.nodes.push(void 0)})),r.push(o)}}e.members.forEach((function(e,r){var o,i,s,a;"node"==e.type?e.lat&&(o=e.lat,i=e.lon,s=e.ref,a={type:"node",id:s,lat:o,lon:i},t.push(a)):"way"==e.type&&e.geometry&&(e.ref="_fullGeom"+e.ref,n(e.geometry,e.ref))}))}for(var c=0;c<e.elements.length;c++)switch(e.elements[c].type){case"node":var u=e.elements[c];t.push(u);break;case"way":var d=ze.clone(e.elements[c]);d.nodes=ze.clone(d.nodes),r.push(d),d.center&&i(d),d.geometry?a(d):d.bounds&&s(d);break;case"relation":var p=ze.clone(e.elements[c]);p.members=ze.clone(p.members),n.push(p);var h=p.members&&p.members.some((function(e){return"node"==e.type&&e.lat||"way"==e.type&&e.geometry&&e.geometry.length>0}));p.center&&i(p),h?l(p):p.bounds&&s(p)}return o(t,r,n)}(e),n;function o(e,n,o){function s(e,r){if("object"!=typeof r&&(r={}),"function"==typeof t.uninterestingTags)return!t.uninterestingTags(e,r);for(var n in e)if(!0!==t.uninterestingTags[n]&&!0!==r[n]&&r[n]!==e[n])return!0;return!1}function a(e){var t={timestamp:e.timestamp,version:e.version,changeset:e.changeset,user:e.user,uid:e.uid};for(var r in t)void 0===t[r]&&delete t[r];return t}for(var l=new Object,c=new Object,u=0;u<e.length;u++){void 0!==l[(v=e[u]).id]&&(v=t.deduplicator(v,l[v.id])),l[v.id]=v,void 0!==v.tags&&s(v.tags)&&(c[v.id]=!0)}for(u=0;u<o.length;u++)if(ze.isArray(o[u].members))for(var d=0;d<o[u].members.length;d++)"node"==o[u].members[d].type&&(c[o[u].members[d].ref]=!0);var p=new Object,h=new Object;for(u=0;u<n.length;u++){var m=n[u];if(p[m.id]&&(m=t.deduplicator(m,p[m.id])),p[m.id]=m,ze.isArray(m.nodes))for(d=0;d<m.nodes.length;d++)"object"!=typeof m.nodes[d]&&(h[m.nodes[d]]=!0,m.nodes[d]=l[m.nodes[d]])}var f=new Array;for(var g in l){var v=l[g];h[g]&&!c[g]||f.push(v)}var y=new Array;for(u=0;u<o.length;u++){y[(E=o[u]).id]&&(E=t.deduplicator(E,y[E.id])),y[E.id]=E}var b,w={node:{},way:{},relation:{}};for(var g in y){var E=y[g];if(ze.isArray(E.members))for(d=0;d<E.members.length;d++){var T=E.members[d].type,N=E.members[d].ref;"number"!=typeof N&&(N=N.replace("_fullGeom","")),w[T]?(void 0===w[T][N]&&(w[T][N]=[]),w[T][N].push({role:E.members[d].role,rel:E.id,reltags:E.tags})):t.verbose&&console.warn("Relation",E.type+"/"+E.id,"member",T+"/"+N,"ignored because it has an invalid type")}else t.verbose&&console.warn("Relation",E.type+"/"+E.id,"ignored because it has no members")}var _=[];for(u=0;u<f.length;u++)if(void 0!==f[u].lon&&void 0!==f[u].lat){var S={type:"Feature",id:f[u].type+"/"+f[u].id,properties:{type:f[u].type,id:f[u].id,tags:f[u].tags||{},relations:w.node[f[u].id]||[],meta:a(f[u])},geometry:{type:"Point",coordinates:[+f[u].lon,+f[u].lat]}};f[u].__is_center_placeholder&&(S.properties.geometry="center"),r?r(S):_.push(S)}else t.verbose&&console.warn("POI",f[u].type+"/"+f[u].id,"ignored because it lacks coordinates");var x=[],A=[];for(u=0;u<o.length;u++)if(y[o[u].id]===o[u]){if(void 0!==o[u].tags&&("route"==o[u].tags.type||"waterway"==o[u].tags.type)){let e=function(e){var r,n,o=!1;r=(r=e.members.filter((function(e){return"way"===e.type}))).map((function(r){var n=p[r.ref];return void 0===n||void 0===n.nodes?(t.verbose&&console.warn("Route "+e.type+"/"+e.id,"tainted by a missing or incomplete way",r.type+"/"+r.ref),void(o=!0)):{id:r.ref,role:r.role,way:n,nodes:n.nodes.filter((function(n){return void 0!==n||(o=!0,t.verbose&&console.warn("Route",e.type+"/"+e.id,"tainted by a way",r.type+"/"+r.ref,"with a missing node"),!1)}))}})),n=Qe(r=ze.compact(r));var i;if(0==(i=ze.compact(n.map((function(e){return ze.compact(e.map((function(e){return[+e.lon,+e.lat]})))})))).length)return t.verbose&&console.warn("Route",e.type+"/"+e.id,"contains no coordinates"),!1;var s={type:"Feature",id:e.type+"/"+e.id,properties:{type:e.type,id:e.id,tags:e.tags||{},relations:w[e.type][e.id]||[],meta:a(e)},geometry:{type:1===i.length?"LineString":"MultiLineString",coordinates:1===i.length?i[0]:i}};return o&&(t.verbose&&console.warn("Route",e.type+"/"+e.id,"is tainted"),s.properties.tainted=!0),s};if(!ze.isArray(o[u].members)){t.verbose&&console.warn("Route",o[u].type+"/"+o[u].id,"ignored because it has no members");continue}if(o[u].members.forEach((function(e){p[e.ref]&&!s(p[e.ref].tags)&&(p[e.ref].is_skippablerelationmember=!0)})),!1===(S=e(o[u]))){t.verbose&&console.warn("Route relation",o[u].type+"/"+o[u].id,"ignored because it has invalid geometry");continue}r?r(Ye(S)):A.push(S)}if(void 0!==o[u].tags&&("multipolygon"==o[u].tags.type||"boundary"==o[u].tags.type)){let e=function(e,r){var n,o,i,s,l=!1,c=O?"way":"relation",u="number"==typeof e.id?e.id:+e.id.replace("_fullGeom","");function d(e){var t,r=function(e,t){for(var r=0;r<t.length;r++)if(i(t[r],e))return!0;return!1},n=function(e){return e.map((function(e){return[+e.lat,+e.lon]}))},i=function(e,t){for(var r=e[0],n=e[1],o=!1,i=0,s=t.length-1;i<t.length;s=i++){var a=t[i][0],l=t[i][1],c=t[s][0],u=t[s][1];l>n!=u>n&&r<(c-a)*(n-l)/(u-l)+a&&(o=!o)}return o};for(e=n(e),t=0;t<o.length;t++)if(r(n(o[t]),e))return t}n=(n=r.members.filter((function(e){return"way"===e.type}))).map((function(e){var r=p[e.ref];return void 0===r||void 0===r.nodes?(t.verbose&&console.warn("Multipolygon",c+"/"+u,"tainted by a missing or incomplete way",e.type+"/"+e.ref),void(l=!0)):{id:e.ref,role:e.role||"outer",way:r,nodes:r.nodes.filter((function(r){return void 0!==r||(l=!0,t.verbose&&console.warn("Multipolygon",c+"/"+u,"tainted by a way",e.type+"/"+e.ref,"with a missing node"),!1)}))}})),n=ze.compact(n),o=Qe(n.filter((function(e){return"outer"===e.role}))),i=Qe(n.filter((function(e){return"inner"===e.role}))),s=o.map((function(e){return[e]}));for(var h=0;h<i.length;h++){var m=d(i[h]);void 0!==m?s[m].push(i[h]):t.verbose&&console.warn("Multipolygon",c+"/"+u,"contains an inner ring with no containing outer")}var f=[];if(0==(f=ze.compact(s.map((function(e){var r=ze.compact(e.map((function(e){if(!(e.length<4))return ze.compact(e.map((function(e){return[+e.lon,+e.lat]})));t.verbose&&console.warn("Multipolygon",c+"/"+u,"contains a ring with less than four nodes")})));if(0!=r.length)return r;t.verbose&&console.warn("Multipolygon",c+"/"+u,"contains an empty ring cluster")})))).length)return t.verbose&&console.warn("Multipolygon",c+"/"+u,"contains no coordinates"),!1;var g="MultiPolygon";1===f.length&&(g="Polygon",f=f[0]);var v={type:"Feature",id:e.type+"/"+u,properties:{type:e.type,id:u,tags:e.tags||{},relations:w[e.type][e.id]||[],meta:a(e)},geometry:{type:g,coordinates:f}};return l&&(t.verbose&&console.warn("Multipolygon",c+"/"+u,"is tainted"),v.properties.tainted=!0),v};if(!ze.isArray(o[u].members)){t.verbose&&console.warn("Multipolygon",o[u].type+"/"+o[u].id,"ignored because it has no members");continue}var I=0;for(d=0;d<o[u].members.length;d++)"outer"==o[u].members[d].role?I++:t.verbose&&"inner"!=o[u].members[d].role&&console.warn("Multipolygon",o[u].type+"/"+o[u].id,"member",o[u].members[d].type+"/"+o[u].members[d].ref,'ignored because it has an invalid role: "'+o[u].members[d].role+'"');if(o[u].members.forEach((function(e){p[e.ref]&&("outer"!==e.role||s(p[e.ref].tags,o[u].tags)||(p[e.ref].is_skippablerelationmember=!0),"inner"!==e.role||s(p[e.ref].tags)||(p[e.ref].is_skippablerelationmember=!0))})),0==I){t.verbose&&console.warn("Multipolygon relation",o[u].type+"/"+o[u].id,"ignored because it has no outer ways");continue}var O=!1;1!=I||s(o[u].tags,{type:!0})||(O=!0);S=null;if(O){var R=o[u].members.filter((function(e){return"outer"===e.role}))[0];if(void 0===(R=p[R.ref])){t.verbose&&console.warn("Multipolygon relation",o[u].type+"/"+o[u].id,"ignored because outer way",R.type+"/"+R.ref,"is missing");continue}R.is_skippablerelationmember=!0,S=e(R,o[u])}else S=e(o[u],o[u]);if(!1===S){t.verbose&&console.warn("Multipolygon relation",o[u].type+"/"+o[u].id,"ignored because it has invalid geometry");continue}r?r(Ye(S)):A.push(S)}}for(u=0;u<n.length;u++)if(p[n[u].id]===n[u])if(ze.isArray(n[u].nodes)){if(!n[u].is_skippablerelationmember){"number"!=typeof n[u].id&&(n[u].id=+n[u].id.replace("_fullGeom","")),n[u].tainted=!1,n[u].hidden=!1;var C=new Array;for(d=0;d<n[u].nodes.length;d++)"object"==typeof n[u].nodes[d]?C.push([+n[u].nodes[d].lon,+n[u].nodes[d].lat]):(t.verbose&&console.warn("Way",n[u].type+"/"+n[u].id,"is tainted by an invalid node"),n[u].tainted=!0);if(C.length<=1)t.verbose&&console.warn("Way",n[u].type+"/"+n[u].id,"ignored because it contains too few nodes");else{var D="LineString";void 0!==n[u].nodes[0]&&void 0!==n[u].nodes[n[u].nodes.length-1]&&n[u].nodes[0].id===n[u].nodes[n[u].nodes.length-1].id&&(void 0!==n[u].tags&&i(n[u].tags)||n[u].__is_bounds_placeholder)&&(D="Polygon",C=[C]);S={type:"Feature",id:n[u].type+"/"+n[u].id,properties:{type:n[u].type,id:n[u].id,tags:n[u].tags||{},relations:w.way[n[u].id]||[],meta:a(n[u])},geometry:{type:D,coordinates:C}};n[u].tainted&&(t.verbose&&console.warn("Way",n[u].type+"/"+n[u].id,"is tainted"),S.properties.tainted=!0),n[u].__is_bounds_placeholder&&(S.properties.geometry="bounds"),r?r(Ye(S)):"LineString"==D?x.push(S):A.push(S)}}}else t.verbose&&console.warn("Way",n[u].type+"/"+n[u].id,"ignored because it has no nodes");return!!r||((b={type:"FeatureCollection",features:[]}).features=b.features.concat(A),b.features=b.features.concat(x),b.features=b.features.concat(_),t.flatProperties&&b.features.forEach((function(e){e.properties=ze.merge(e.properties.meta,e.properties.tags,{id:e.properties.type+"/"+e.properties.id})})),b=Ye(b))}function i(e){var r=t.polygonFeatures;if("function"==typeof r)return r(e);if("no"===e.area)return!1;for(var n in e){var o=e[n],i=r[n];if(void 0!==i&&"no"!==o){if(!0===i)return!0;if(i.included_values&&!0===i.included_values[o])return!0;if(i.excluded_values&&!0!==i.excluded_values[o])return!0}}return!1}},Xe.toGeojson=Xe;const Ze=A(Xe);var et={};function tt(e,t){return void 0===t&&(t=Object),t&&"function"==typeof t.getOwnPropertyDescriptors&&(e=t.create(null,t.getOwnPropertyDescriptors(e))),t&&"function"==typeof t.freeze?t.freeze(e):e}function rt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var nt=tt({allowfullscreen:!0,async:!0,autofocus:!0,autoplay:!0,checked:!0,controls:!0,default:!0,defer:!0,disabled:!0,formnovalidate:!0,hidden:!0,ismap:!0,itemscope:!0,loop:!0,multiple:!0,muted:!0,nomodule:!0,novalidate:!0,open:!0,playsinline:!0,readonly:!0,required:!0,reversed:!0,selected:!0});var ot=tt({area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});var it=tt({script:!1,style:!1,textarea:!0,title:!0});function st(e){return e===at.HTML}var at=tt({HTML:"text/html",XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),lt=Object.keys(at).map((function(e){return at[e]}));var ct=tt({HTML:"http://www.w3.org/1999/xhtml",SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});et.assign=function(e,t){if(null===e||"object"!=typeof e)throw new TypeError("target is not an object");for(var r in t)rt(t,r)&&(e[r]=t[r]);return e},et.find=function(e,t,r){if(void 0===r&&(r=Array.prototype),e&&"function"==typeof r.find)return r.find.call(e,t);for(var n=0;n<e.length;n++)if(rt(e,n)){var o=e[n];if(t.call(void 0,o,n,e))return o}},et.freeze=tt,et.HTML_BOOLEAN_ATTRIBUTES=nt,et.HTML_RAW_TEXT_ELEMENTS=it,et.HTML_VOID_ELEMENTS=ot,et.hasDefaultHTMLNamespace=function(e){return st(e)||e===at.XML_XHTML_APPLICATION},et.hasOwn=rt,et.isHTMLBooleanAttribute=function(e){return rt(nt,e.toLowerCase())},et.isHTMLRawTextElement=function(e){var t=e.toLowerCase();return rt(it,t)&&!it[t]},et.isHTMLEscapableRawTextElement=function(e){var t=e.toLowerCase();return rt(it,t)&&it[t]},et.isHTMLMimeType=st,et.isHTMLVoidElement=function(e){return rt(ot,e.toLowerCase())},et.isValidMimeType=function(e){return lt.indexOf(e)>-1},et.MIME_TYPE=at,et.NAMESPACE=ct;var ut={};function dt(e,t){e.prototype=Object.create(Error.prototype,{constructor:{value:e},name:{value:e.name,enumerable:!0,writable:t}})}var pt=et.freeze({Error:"Error",IndexSizeError:"IndexSizeError",DomstringSizeError:"DomstringSizeError",HierarchyRequestError:"HierarchyRequestError",WrongDocumentError:"WrongDocumentError",InvalidCharacterError:"InvalidCharacterError",NoDataAllowedError:"NoDataAllowedError",NoModificationAllowedError:"NoModificationAllowedError",NotFoundError:"NotFoundError",NotSupportedError:"NotSupportedError",InUseAttributeError:"InUseAttributeError",InvalidStateError:"InvalidStateError",SyntaxError:"SyntaxError",InvalidModificationError:"InvalidModificationError",NamespaceError:"NamespaceError",InvalidAccessError:"InvalidAccessError",ValidationError:"ValidationError",TypeMismatchError:"TypeMismatchError",SecurityError:"SecurityError",NetworkError:"NetworkError",AbortError:"AbortError",URLMismatchError:"URLMismatchError",QuotaExceededError:"QuotaExceededError",TimeoutError:"TimeoutError",InvalidNodeTypeError:"InvalidNodeTypeError",DataCloneError:"DataCloneError",EncodingError:"EncodingError",NotReadableError:"NotReadableError",UnknownError:"UnknownError",ConstraintError:"ConstraintError",DataError:"DataError",TransactionInactiveError:"TransactionInactiveError",ReadOnlyError:"ReadOnlyError",VersionError:"VersionError",OperationError:"OperationError",NotAllowedError:"NotAllowedError",OptOutError:"OptOutError"}),ht=Object.keys(pt);function mt(e){return"number"==typeof e&&e>=1&&e<=25}function ft(e,t){var r;mt(e)?(this.name=ht[e],this.message=t||""):(this.message=e,this.name="string"==typeof(r=t)&&r.substring(r.length-pt.Error.length)===pt.Error?t:pt.Error),Error.captureStackTrace&&Error.captureStackTrace(this,ft)}dt(ft,!0),Object.defineProperties(ft.prototype,{code:{enumerable:!0,get:function(){var e=ht.indexOf(this.name);return mt(e)?e:0}}});for(var gt={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25},vt=Object.entries(gt),yt=0;yt<vt.length;yt++){ft[vt[yt][0]]=vt[yt][1]}function bt(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,bt)}dt(bt),ut.DOMException=ft,ut.DOMExceptionName=pt,ut.ExceptionCode=gt,ut.ParseError=bt;var wt={},Et={};function Tt(e){try{"function"!=typeof e&&(e=RegExp);var t=new e("𝌆","u").exec("𝌆");return!!t&&2===t[0].length}catch(r){}return!1}var Nt=Tt();function _t(e){if("["!==e.source[0])throw new Error(e+" can not be used with chars");return e.source.slice(1,e.source.lastIndexOf("]"))}function St(e,t){if("["!==e.source[0])throw new Error("/"+e.source+"/ can not be used with chars_without");if(!t||"string"!=typeof t)throw new Error(JSON.stringify(t)+" is not a valid search");if(-1===e.source.indexOf(t))throw new Error('"'+t+'" is not is /'+e.source+"/");if("-"===t&&1!==e.source.indexOf(t))throw new Error('"'+t+'" is not at the first postion of /'+e.source+"/");return new RegExp(e.source.replace(t,""),Nt?"u":"")}function xt(e){var t=this;return new RegExp(Array.prototype.slice.call(arguments).map((function(e){var r="string"==typeof e;if(r&&void 0===t&&"|"===e)throw new Error("use regg instead of reg to wrap expressions with `|`!");return r?e:e.source})).join(""),Nt?"mu":"m")}function At(e){if(0===arguments.length)throw new Error("no parameters provided");return xt.apply(At,["(?:"].concat(Array.prototype.slice.call(arguments),[")"]))}var It=/[-\x09\x0A\x0D\x20-\x2C\x2E-\uD7FF\uE000-\uFFFD]/;Nt&&(It=xt("[",_t(It),"\\u{10000}-\\u{10FFFF}","]"));var Ot=/[\x20\x09\x0D\x0A]/,Rt=_t(Ot),Ct=xt(Ot,"+"),Dt=xt(Ot,"*"),Lt=/[:_a-zA-Z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;Nt&&(Lt=xt("[",_t(Lt),"\\u{10000}-\\u{10FFFF}","]"));var Mt=xt("[",_t(Lt),_t(/[-.0-9\xB7]/),_t(/[\u0300-\u036F\u203F-\u2040]/),"]"),kt=xt(Lt,Mt,"*"),Ut=xt(Mt,"+"),Pt=xt("&",kt,";"),qt=At(/&#[0-9]+;|&#x[0-9a-fA-F]+;/),Bt=At(Pt,"|",qt),Ft=xt("%",kt,";"),jt=At(xt('"',At(/[^%&"]/,"|",Ft,"|",Bt),"*",'"'),"|",xt("'",At(/[^%&']/,"|",Ft,"|",Bt),"*","'")),Gt=At('"',At(/[^<&"]/,"|",Bt),"*",'"',"|","'",At(/[^<&']/,"|",Bt),"*","'"),Wt=xt(St(Lt,":"),St(Mt,":"),"*"),Ht=xt(Wt,At(":",Wt),"?"),Vt=xt("^",Ht,"$"),$t=xt("(",Ht,")"),zt=At(/"[^"]*"|'[^']*'/),Yt=xt(/^<\?/,"(",kt,")",At(Ct,"(",It,"*?)"),"?",/\?>/),Kt=/[\x20\x0D\x0Aa-zA-Z0-9-'()+,./:=?;!*#@$_%]/,Jt=At('"',Kt,'*"',"|","'",St(Kt,"'"),"*'"),Xt="\x3c!--",Qt=xt(Xt,At(St(It,"-"),"|",xt("-",St(It,"-"))),"*","--\x3e"),Zt="#PCDATA",er=At(xt(/\(/,Dt,Zt,At(Dt,/\|/,Dt,Ht),"*",Dt,/\)\*/),"|",xt(/\(/,Dt,Zt,Dt,/\)/)),tr=At("EMPTY","|","ANY","|",er,"|",xt(/\([^>]+\)/,/[?*+]?/)),rr=xt("<!ELEMENT",Ct,At(Ht,"|",Ft),Ct,At(tr,"|",Ft),Dt,">"),nr=xt("NOTATION",Ct,/\(/,Dt,kt,At(Dt,/\|/,Dt,kt),"*",Dt,/\)/),or=xt(/\(/,Dt,Ut,At(Dt,/\|/,Dt,Ut),"*",Dt,/\)/),ir=At(nr,"|",or),sr=At(/CDATA|ID|IDREF|IDREFS|ENTITY|ENTITIES|NMTOKEN|NMTOKENS/,"|",ir),ar=At(/#REQUIRED|#IMPLIED/,"|",At(At("#FIXED",Ct),"?",Gt)),lr=xt("<!ATTLIST",Ct,kt,At(Ct,kt,Ct,sr,Ct,ar),"*",Dt,">"),cr="about:legacy-compat",ur=At('"'+cr+'"',"|","'"+cr+"'"),dr="SYSTEM",pr="PUBLIC",hr=At(At(dr,Ct,zt),"|",At(pr,Ct,Jt,Ct,zt)),mr=xt("^",At(At(dr,Ct,"(?<SystemLiteralOnly>",zt,")"),"|",At(pr,Ct,"(?<PubidLiteral>",Jt,")",Ct,"(?<SystemLiteral>",zt,")"))),fr=At(Ct,"NDATA",Ct,kt),gr="<!ENTITY",vr=xt(gr,Ct,kt,Ct,At(jt,"|",At(hr,fr,"?")),Dt,">"),yr=At(jt,"|",hr),br=At(vr,"|",xt(gr,Ct,"%",Ct,kt,Ct,yr,Dt,">")),wr=xt(pr,Ct,Jt),Er=xt("<!NOTATION",Ct,kt,Ct,At(hr,"|",wr),Dt,">"),Tr=xt(Dt,"=",Dt),Nr=/1[.]\d+/,_r=xt(Ct,"version",Tr,At("'",Nr,"'","|",'"',Nr,'"')),Sr=/[A-Za-z][-A-Za-z0-9._]*/,xr=xt(/^<\?xml/,_r,At(Ct,"encoding",Tr,At('"',Sr,'"',"|","'",Sr,"'")),"?",At(Ct,"standalone",Tr,At("'",At("yes","|","no"),"'","|",'"',At("yes","|","no"),'"')),"?",Dt,/\?>/),Ar=xt(It,"*?",/\]\]>/),Ir=xt(/<!\[CDATA\[/,Ar);Et.chars=_t,Et.chars_without=St,Et.detectUnicodeSupport=Tt,Et.reg=xt,Et.regg=At,Et.ABOUT_LEGACY_COMPAT=cr,Et.ABOUT_LEGACY_COMPAT_SystemLiteral=ur,Et.AttlistDecl=lr,Et.CDATA_START="<![CDATA[",Et.CDATA_END="]]>",Et.CDSect=Ir,Et.Char=It,Et.Comment=Qt,Et.COMMENT_START=Xt,Et.COMMENT_END="--\x3e",Et.DOCTYPE_DECL_START="<!DOCTYPE",Et.elementdecl=rr,Et.EntityDecl=br,Et.EntityValue=jt,Et.ExternalID=hr,Et.ExternalID_match=mr,Et.Name=kt,Et.NotationDecl=Er,Et.Reference=Bt,Et.PEReference=Ft,Et.PI=Yt,Et.PUBLIC=pr,Et.PubidLiteral=Jt,Et.QName=Ht,Et.QName_exact=Vt,Et.QName_group=$t,Et.S=Ct,Et.SChar_s=Rt,Et.S_OPT=Dt,Et.SYSTEM=dr,Et.SystemLiteral=zt,Et.UNICODE_REPLACEMENT_CHARACTER="�",Et.UNICODE_SUPPORT=Nt,Et.XMLDecl=xr;var Or=et,Rr=Or.find,Cr=Or.hasDefaultHTMLNamespace,Dr=Or.hasOwn,Lr=Or.isHTMLMimeType,Mr=Or.isHTMLRawTextElement,kr=Or.isHTMLVoidElement,Ur=Or.MIME_TYPE,Pr=Or.NAMESPACE,qr=Symbol(),Br=ut,Fr=Br.DOMException,jr=Br.DOMExceptionName,Gr=Et;function Wr(e){if(e!==qr)throw new TypeError("Illegal constructor")}function Hr(e){return""!==e}function Vr(e,t){return Dr(e,t)||(e[t]=!0),e}function $r(e){if(!e)return[];var t=function(e){return e?e.split(/[\t\n\f\r ]+/).filter(Hr):[]}(e);return Object.keys(t.reduce(Vr,{}))}function zr(e){if(!Gr.QName_exact.test(e))throw new Fr(Fr.INVALID_CHARACTER_ERR,'invalid character in qualified name "'+e+'"')}function Yr(e,t){zr(t),e=e||null;var r=null,n=t;if(t.indexOf(":")>=0){var o=t.split(":");r=o[0],n=o[1]}if(null!==r&&null===e)throw new Fr(Fr.NAMESPACE_ERR,"prefix is non-null and namespace is null");if("xml"===r&&e!==Or.NAMESPACE.XML)throw new Fr(Fr.NAMESPACE_ERR,'prefix is "xml" and namespace is not the XML namespace');if(("xmlns"===r||"xmlns"===t)&&e!==Or.NAMESPACE.XMLNS)throw new Fr(Fr.NAMESPACE_ERR,'either qualifiedName or prefix is "xmlns" and namespace is not the XMLNS namespace');if(e===Or.NAMESPACE.XMLNS&&"xmlns"!==r&&"xmlns"!==t)throw new Fr(Fr.NAMESPACE_ERR,'namespace is the XMLNS namespace and neither qualifiedName nor prefix is "xmlns"');return[e,r,n]}function Kr(e,t){for(var r in e)Dr(e,r)&&(t[r]=e[r])}function Jr(e,t){var r=e.prototype;if(!(r instanceof t)){let n=function(){};n.prototype=t.prototype,n=new n,Kr(r,n),e.prototype=r=n}r.constructor!=e&&("function"!=typeof e&&console.error("unknown Class:"+e),r.constructor=e)}var Xr={},Qr=Xr.ELEMENT_NODE=1,Zr=Xr.ATTRIBUTE_NODE=2,en=Xr.TEXT_NODE=3,tn=Xr.CDATA_SECTION_NODE=4,rn=Xr.ENTITY_REFERENCE_NODE=5,nn=Xr.ENTITY_NODE=6,on=Xr.PROCESSING_INSTRUCTION_NODE=7,sn=Xr.COMMENT_NODE=8,an=Xr.DOCUMENT_NODE=9,ln=Xr.DOCUMENT_TYPE_NODE=10,cn=Xr.DOCUMENT_FRAGMENT_NODE=11,un=Xr.NOTATION_NODE=12,dn=Or.freeze({DOCUMENT_POSITION_DISCONNECTED:1,DOCUMENT_POSITION_PRECEDING:2,DOCUMENT_POSITION_FOLLOWING:4,DOCUMENT_POSITION_CONTAINS:8,DOCUMENT_POSITION_CONTAINED_BY:16,DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:32});function pn(e,t){if(t.length<e.length)return pn(t,e);var r=null;for(var n in e){if(e[n]!==t[n])return r;r=e[n]}return r}function hn(e){return e.guid||(e.guid=Math.random()),e.guid}function mn(){}function fn(e,t){this._node=e,this._refresh=t,gn(this)}function gn(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!==t){var r=e._refresh(e._node);if(no(e,"length",r.length),!e.$$length||r.length<e.$$length)for(var n=r.length;n in e;n++)Dr(e,n)&&delete e[n];Kr(r,e),e._inc=t}}function vn(){}function yn(e,t){for(var r=0;r<e.length;){if(e[r]===t)return r;r++}}function bn(e,t,r,n){if(n?t[yn(t,n)]=r:(t[t.length]=r,t.length++),e){r.ownerElement=e;var o=e.ownerDocument;o&&(n&&xn(o,e,n),function(e,t,r){e&&e._inc++;var n=r.namespaceURI;n===Pr.XMLNS&&(t._nsMap[r.prefix?r.localName:""]=r.value)}(o,e,r))}}function wn(e,t,r){var n=yn(t,r);if(n>=0){for(var o=t.length-1;n<=o;)t[n]=t[++n];if(t.length=o,e){var i=e.ownerDocument;i&&xn(i,e,r),r.ownerElement=null}}}function En(){}function Tn(e){Wr(e)}function Nn(e){return("<"==e?"&lt;":">"==e&&"&gt;")||"&"==e&&"&amp;"||'"'==e&&"&quot;"||"&#"+e.charCodeAt()+";"}function _n(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(_n(e,t))return!0}while(e=e.nextSibling)}function Sn(e,t){Wr(e);var r=t||{};this.ownerDocument=this,this.contentType=r.contentType||Ur.XML_APPLICATION,this.type=Lr(this.contentType)?"html":"xml"}function xn(e,t,r,n){e&&e._inc++,r.namespaceURI===Pr.XMLNS&&delete t._nsMap[r.prefix?r.localName:""]}function An(e,t,r){if(e&&e._inc){e._inc++;var n=t.childNodes;if(r&&!r.nextSibling)n[n.length++]=r;else{for(var o=t.firstChild,i=0;o;)n[i++]=o,o=o.nextSibling;n.length=i,delete n[n.length]}}}function In(e,t){if(e!==t.parentNode)throw new Fr(Fr.NOT_FOUND_ERR,"child's parent is not parent");var r=t.previousSibling,n=t.nextSibling;return r?r.nextSibling=n:e.firstChild=n,n?n.previousSibling=r:e.lastChild=r,An(e.ownerDocument,e),t.parentNode=null,t.previousSibling=null,t.nextSibling=null,t}function On(e){return e&&e.nodeType===Tn.DOCUMENT_TYPE_NODE}function Rn(e){return e&&e.nodeType===Tn.ELEMENT_NODE}function Cn(e){return e&&e.nodeType===Tn.TEXT_NODE}function Dn(e,t){var r=e.childNodes||[];if(Rr(r,Rn)||On(t))return!1;var n=Rr(r,On);return!(t&&n&&r.indexOf(n)>r.indexOf(t))}function Ln(e,t){var r=e.childNodes||[];if(Rr(r,(function(e){return Rn(e)&&e!==t})))return!1;var n=Rr(r,On);return!(t&&n&&r.indexOf(n)>r.indexOf(t))}function Mn(e,t,r){if(!function(e){return e&&(e.nodeType===Tn.DOCUMENT_NODE||e.nodeType===Tn.DOCUMENT_FRAGMENT_NODE||e.nodeType===Tn.ELEMENT_NODE)}(e))throw new Fr(Fr.HIERARCHY_REQUEST_ERR,"Unexpected parent node type "+e.nodeType);if(r&&r.parentNode!==e)throw new Fr(Fr.NOT_FOUND_ERR,"child not in parent");if(!function(e){return e&&(e.nodeType===Tn.CDATA_SECTION_NODE||e.nodeType===Tn.COMMENT_NODE||e.nodeType===Tn.DOCUMENT_FRAGMENT_NODE||e.nodeType===Tn.DOCUMENT_TYPE_NODE||e.nodeType===Tn.ELEMENT_NODE||e.nodeType===Tn.PROCESSING_INSTRUCTION_NODE||e.nodeType===Tn.TEXT_NODE)}(t)||On(t)&&e.nodeType!==Tn.DOCUMENT_NODE)throw new Fr(Fr.HIERARCHY_REQUEST_ERR,"Unexpected node type "+t.nodeType+" for parent node type "+e.nodeType)}function kn(e,t,r){var n=e.childNodes||[],o=t.childNodes||[];if(t.nodeType===Tn.DOCUMENT_FRAGMENT_NODE){var i=o.filter(Rn);if(i.length>1||Rr(o,Cn))throw new Fr(Fr.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(1===i.length&&!Dn(e,r))throw new Fr(Fr.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if(Rn(t)&&!Dn(e,r))throw new Fr(Fr.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(On(t)){if(Rr(n,On))throw new Fr(Fr.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var s=Rr(n,Rn);if(r&&n.indexOf(s)<n.indexOf(r))throw new Fr(Fr.HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element");if(!r&&s)throw new Fr(Fr.HIERARCHY_REQUEST_ERR,"Doctype can not be appended since element is present")}}function Un(e,t,r){var n=e.childNodes||[],o=t.childNodes||[];if(t.nodeType===Tn.DOCUMENT_FRAGMENT_NODE){var i=o.filter(Rn);if(i.length>1||Rr(o,Cn))throw new Fr(Fr.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(1===i.length&&!Ln(e,r))throw new Fr(Fr.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if(Rn(t)&&!Ln(e,r))throw new Fr(Fr.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(On(t)){if(Rr(n,(function(e){return On(e)&&e!==r})))throw new Fr(Fr.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var s=Rr(n,Rn);if(r&&n.indexOf(s)<n.indexOf(r))throw new Fr(Fr.HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element")}}function Pn(e,t,r,n){Mn(e,t,r),e.nodeType===Tn.DOCUMENT_NODE&&(n||kn)(e,t,r);var o=t.parentNode;if(o&&o.removeChild(t),t.nodeType===cn){var i=t.firstChild;if(null==i)return t;var s=t.lastChild}else i=s=t;var a=r?r.previousSibling:e.lastChild;i.previousSibling=a,s.nextSibling=r,a?a.nextSibling=i:e.firstChild=i,null==r?e.lastChild=s:r.previousSibling=s;do{i.parentNode=e}while(i!==s&&(i=i.nextSibling));return An(e.ownerDocument||e,e,t),t.nodeType==cn&&(t.firstChild=t.lastChild=null),t}function qn(e){Wr(e),this._nsMap=Object.create(null)}function Bn(e){Wr(e),this.namespaceURI=null,this.prefix=null,this.ownerElement=null}function Fn(e){Wr(e)}function jn(e){Wr(e)}function Gn(e){Wr(e)}function Wn(e){Wr(e)}function Hn(e){Wr(e)}function Vn(e){Wr(e)}function $n(e){Wr(e)}function zn(e){Wr(e)}function Yn(e){Wr(e)}function Kn(e){Wr(e)}function Jn(){}function Xn(e){var t=[],r=this.nodeType===an&&this.documentElement||this,n=r.prefix,o=r.namespaceURI;if(o&&null==n&&null==(n=r.lookupPrefix(o)))var i=[{namespace:o,prefix:null}];return eo(this,t,e,i),t.join("")}function Qn(e,t,r){var n=e.prefix||"",o=e.namespaceURI;if(!o)return!1;if("xml"===n&&o===Pr.XML||o===Pr.XMLNS)return!1;for(var i=r.length;i--;){var s=r[i];if(s.prefix===n)return s.namespace!==o}return!0}function Zn(e,t,r){e.push(" ",t,'="',r.replace(/[<>&"\t\n\r]/g,Nn),'"')}function eo(e,t,r,n){n||(n=[]);var o="html"===(e.nodeType===an?e:e.ownerDocument).type;if(r){if(!(e=r(e)))return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case Qr:var i=e.attributes,s=i.length,a=e.firstChild,l=e.tagName,c=l;if(!o&&!e.prefix&&e.namespaceURI){for(var u,d=0;d<i.length;d++)if("xmlns"===i.item(d).name){u=i.item(d).value;break}if(!u)for(var p=n.length-1;p>=0;p--){if(""===(h=n[p]).prefix&&h.namespace===e.namespaceURI){u=h.namespace;break}}if(u!==e.namespaceURI)for(p=n.length-1;p>=0;p--){var h;if((h=n[p]).namespace===e.namespaceURI){h.prefix&&(c=h.prefix+":"+l);break}}}t.push("<",c);for(var m=0;m<s;m++){"xmlns"==(f=i.item(m)).prefix?n.push({prefix:f.localName,namespace:f.value}):"xmlns"==f.nodeName&&n.push({prefix:"",namespace:f.value})}for(m=0;m<s;m++){var f,g,v;if(Qn(f=i.item(m),0,n))Zn(t,(g=f.prefix||"")?"xmlns:"+g:"xmlns",v=f.namespaceURI),n.push({prefix:g,namespace:v});eo(f,t,r,n)}if(l===c&&Qn(e,0,n))Zn(t,(g=e.prefix||"")?"xmlns:"+g:"xmlns",v=e.namespaceURI),n.push({prefix:g,namespace:v});var y=!a;if(y&&(o||e.namespaceURI===Pr.HTML)&&(y=kr(l)),y)t.push("/>");else{if(t.push(">"),o&&Mr(l))for(;a;)a.data?t.push(a.data):eo(a,t,r,n.slice()),a=a.nextSibling;else for(;a;)eo(a,t,r,n.slice()),a=a.nextSibling;t.push("</",c,">")}return;case an:case cn:for(a=e.firstChild;a;)eo(a,t,r,n.slice()),a=a.nextSibling;return;case Zr:return Zn(t,e.name,e.value);case en:return t.push(e.data.replace(/[<&>]/g,Nn));case tn:return t.push(Gr.CDATA_START,e.data,Gr.CDATA_END);case sn:return t.push(Gr.COMMENT_START,e.data,Gr.COMMENT_END);case ln:var b=e.publicId,w=e.systemId;return t.push(Gr.DOCTYPE_DECL_START," ",e.name),b?(t.push(" ",Gr.PUBLIC," ",b),w&&"."!==w&&t.push(" ",w)):w&&"."!==w&&t.push(" ",Gr.SYSTEM," ",w),e.internalSubset&&t.push(" [",e.internalSubset,"]"),void t.push(">");case on:return t.push("<?",e.target," ",e.data,"?>");case rn:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function to(e,t,r){var n;switch(t.nodeType){case Qr:(n=t.cloneNode(!1)).ownerDocument=e;case cn:break;case Zr:r=!0}if(n||(n=t.cloneNode(!1)),n.ownerDocument=e,n.parentNode=null,r)for(var o=t.firstChild;o;)n.appendChild(to(e,o,r)),o=o.nextSibling;return n}function ro(e,t,r){var n=new t.constructor(qr);for(var o in t)if(Dr(t,o)){var i=t[o];"object"!=typeof i&&i!=n[o]&&(n[o]=i)}switch(t.childNodes&&(n.childNodes=new mn),n.ownerDocument=e,n.nodeType){case Qr:var s=t.attributes,a=n.attributes=new vn,l=s.length;a._ownerElement=n;for(var c=0;c<l;c++)n.setAttributeNode(ro(e,s.item(c),!0));break;case Zr:r=!0}if(r)for(var u=t.firstChild;u;)n.appendChild(ro(e,u,r)),u=u.nextSibling;return n}function no(e,t,r){e[t]=r}mn.prototype={length:0,item:function(e){return e>=0&&e<this.length?this[e]:null},toString:function(e){for(var t=[],r=0;r<this.length;r++)eo(this[r],t,e);return t.join("")},filter:function(e){return Array.prototype.filter.call(this,e)},indexOf:function(e){return Array.prototype.indexOf.call(this,e)}},mn.prototype[Symbol.iterator]=function(){var e=this,t=0;return{next:function(){return t<e.length?{value:e[t++],done:!1}:{done:!0}},return:function(){return{done:!0}}}},fn.prototype.item=function(e){return gn(this),this[e]||null},Jr(fn,mn),vn.prototype={length:0,item:mn.prototype.item,getNamedItem:function(e){this._ownerElement&&this._ownerElement._isInHTMLDocumentAndNamespace()&&(e=e.toLowerCase());for(var t=0;t<this.length;){var r=this[t];if(r.nodeName===e)return r;t++}return null},setNamedItem:function(e){var t=e.ownerElement;if(t&&t!==this._ownerElement)throw new Fr(Fr.INUSE_ATTRIBUTE_ERR);var r=this.getNamedItemNS(e.namespaceURI,e.localName);return r===e?e:(bn(this._ownerElement,this,e,r),r)},setNamedItemNS:function(e){return this.setNamedItem(e)},removeNamedItem:function(e){var t=this.getNamedItem(e);if(!t)throw new Fr(Fr.NOT_FOUND_ERR,e);return wn(this._ownerElement,this,t),t},removeNamedItemNS:function(e,t){var r=this.getNamedItemNS(e,t);if(!r)throw new Fr(Fr.NOT_FOUND_ERR,e?e+" : "+t:t);return wn(this._ownerElement,this,r),r},getNamedItemNS:function(e,t){e||(e=null);for(var r=0;r<this.length;){var n=this[r];if(n.localName===t&&n.namespaceURI===e)return n;r++}return null}},vn.prototype[Symbol.iterator]=function(){var e=this,t=0;return{next:function(){return t<e.length?{value:e[t++],done:!1}:{done:!0}},return:function(){return{done:!0}}}},En.prototype={hasFeature:function(e,t){return!0},createDocument:function(e,t,r){var n=Ur.XML_APPLICATION;e===Pr.HTML?n=Ur.XML_XHTML_APPLICATION:e===Pr.SVG&&(n=Ur.XML_SVG_IMAGE);var o=new Sn(qr,{contentType:n});if(o.implementation=this,o.childNodes=new mn,o.doctype=r||null,r&&o.appendChild(r),t){var i=o.createElementNS(e,t);o.appendChild(i)}return o},createDocumentType:function(e,t,r,n){zr(e);var o=new Hn(qr);return o.name=e,o.nodeName=e,o.publicId=t||"",o.systemId=r||"",o.internalSubset=n||"",o.childNodes=new mn,o},createHTMLDocument:function(e){var t=new Sn(qr,{contentType:Ur.HTML});if(t.implementation=this,t.childNodes=new mn,!1!==e){t.doctype=this.createDocumentType("html"),t.doctype.ownerDocument=t,t.appendChild(t.doctype);var r=t.createElement("html");t.appendChild(r);var n=t.createElement("head");if(r.appendChild(n),"string"==typeof e){var o=t.createElement("title");o.appendChild(t.createTextNode(e)),n.appendChild(o)}r.appendChild(t.createElement("body"))}return t}},Tn.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,parentNode:null,get parentElement(){return this.parentNode&&this.parentNode.nodeType===this.ELEMENT_NODE?this.parentNode:null},childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,baseURI:"about:blank",get isConnected(){var e=this.getRootNode();return e&&e.nodeType===e.DOCUMENT_NODE},contains:function(e){if(!e)return!1;var t=e;do{if(this===t)return!0;t=e.parentNode}while(t);return!1},getRootNode:function(e){var t=this;do{if(!t.parentNode)return t;t=t.parentNode}while(t)},isEqualNode:function(e){if(!e)return!1;if(this.nodeType!==e.nodeType)return!1;switch(this.nodeType){case this.DOCUMENT_TYPE_NODE:if(this.name!==e.name)return!1;if(this.publicId!==e.publicId)return!1;if(this.systemId!==e.systemId)return!1;break;case this.ELEMENT_NODE:if(this.namespaceURI!==e.namespaceURI)return!1;if(this.prefix!==e.prefix)return!1;if(this.localName!==e.localName)return!1;if(this.attributes.length!==e.attributes.length)return!1;for(var t=0;t<this.attributes.length;t++){var r=this.attributes.item(t);if(!r.isEqualNode(e.getAttributeNodeNS(r.namespaceURI,r.localName)))return!1}break;case this.ATTRIBUTE_NODE:if(this.namespaceURI!==e.namespaceURI)return!1;if(this.localName!==e.localName)return!1;if(this.value!==e.value)return!1;break;case this.PROCESSING_INSTRUCTION_NODE:if(this.target!==e.target||this.data!==e.data)return!1;break;case this.TEXT_NODE:case this.COMMENT_NODE:if(this.data!==e.data)return!1}if(this.childNodes.length!==e.childNodes.length)return!1;for(t=0;t<this.childNodes.length;t++)if(!this.childNodes[t].isEqualNode(e.childNodes[t]))return!1;return!0},isSameNode:function(e){return this===e},insertBefore:function(e,t){return Pn(this,e,t)},replaceChild:function(e,t){Pn(this,e,t,Un),t&&this.removeChild(t)},removeChild:function(e){return In(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(e){return ro(this.ownerDocument||this,this,e)},normalize:function(){for(var e=this.firstChild;e;){var t=e.nextSibling;t&&t.nodeType==en&&e.nodeType==en?(this.removeChild(t),e.appendData(t.data)):(e.normalize(),e=t)}},isSupported:function(e,t){return this.ownerDocument.implementation.hasFeature(e,t)},lookupPrefix:function(e){for(var t=this;t;){var r=t._nsMap;if(r)for(var n in r)if(Dr(r,n)&&r[n]===e)return n;t=t.nodeType==Zr?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var r=t._nsMap;if(r&&Dr(r,e))return r[e];t=t.nodeType==Zr?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)},compareDocumentPosition:function(e){if(this===e)return 0;var t=e,r=this,n=null,o=null;if(t instanceof Bn&&(t=(n=t).ownerElement),r instanceof Bn&&(r=(o=r).ownerElement,n&&t&&r===t))for(var i,s=0;i=r.attributes[s];s++){if(i===n)return dn.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+dn.DOCUMENT_POSITION_PRECEDING;if(i===o)return dn.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+dn.DOCUMENT_POSITION_FOLLOWING}if(!t||!r||r.ownerDocument!==t.ownerDocument)return dn.DOCUMENT_POSITION_DISCONNECTED+dn.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+(hn(r.ownerDocument)>hn(t.ownerDocument)?dn.DOCUMENT_POSITION_FOLLOWING:dn.DOCUMENT_POSITION_PRECEDING);if(o&&t===r)return dn.DOCUMENT_POSITION_CONTAINS+dn.DOCUMENT_POSITION_PRECEDING;if(n&&t===r)return dn.DOCUMENT_POSITION_CONTAINED_BY+dn.DOCUMENT_POSITION_FOLLOWING;for(var a=[],l=t.parentNode;l;){if(!o&&l===r)return dn.DOCUMENT_POSITION_CONTAINED_BY+dn.DOCUMENT_POSITION_FOLLOWING;a.push(l),l=l.parentNode}a.reverse();for(var c=[],u=r.parentNode;u;){if(!n&&u===t)return dn.DOCUMENT_POSITION_CONTAINS+dn.DOCUMENT_POSITION_PRECEDING;c.push(u),u=u.parentNode}c.reverse();var d=pn(a,c);for(var p in d.childNodes){var h=d.childNodes[p];if(h===r)return dn.DOCUMENT_POSITION_FOLLOWING;if(h===t)return dn.DOCUMENT_POSITION_PRECEDING;if(c.indexOf(h)>=0)return dn.DOCUMENT_POSITION_FOLLOWING;if(a.indexOf(h)>=0)return dn.DOCUMENT_POSITION_PRECEDING}return 0}},Kr(Xr,Tn),Kr(Xr,Tn.prototype),Kr(dn,Tn),Kr(dn,Tn.prototype),Sn.prototype={implementation:null,nodeName:"#document",nodeType:an,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType===cn){for(var r=e.firstChild;r;){var n=r.nextSibling;this.insertBefore(r,t),r=n}return e}return Pn(this,e,t),e.ownerDocument=this,null===this.documentElement&&e.nodeType===Qr&&(this.documentElement=e),e},removeChild:function(e){var t=In(this,e);return t===this.documentElement&&(this.documentElement=null),t},replaceChild:function(e,t){Pn(this,e,t,Un),e.ownerDocument=this,t&&this.removeChild(t),Rn(e)&&(this.documentElement=e)},importNode:function(e,t){return to(this,e,t)},getElementById:function(e){var t=null;return _n(this.documentElement,(function(r){if(r.nodeType==Qr&&r.getAttribute("id")==e)return t=r,!0})),t},createElement:function(e){var t=new qn(qr);return t.ownerDocument=this,"html"===this.type&&(e=e.toLowerCase()),Cr(this.contentType)&&(t.namespaceURI=Pr.HTML),t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new mn,(t.attributes=new vn)._ownerElement=t,t},createDocumentFragment:function(){var e=new Yn(qr);return e.ownerDocument=this,e.childNodes=new mn,e},createTextNode:function(e){var t=new jn(qr);return t.ownerDocument=this,t.childNodes=new mn,t.appendData(e),t},createComment:function(e){var t=new Gn(qr);return t.ownerDocument=this,t.childNodes=new mn,t.appendData(e),t},createCDATASection:function(e){var t=new Wn(qr);return t.ownerDocument=this,t.childNodes=new mn,t.appendData(e),t},createProcessingInstruction:function(e,t){var r=new Kn(qr);return r.ownerDocument=this,r.childNodes=new mn,r.nodeName=r.target=e,r.nodeValue=r.data=t,r},createAttribute:function(e){if(!Gr.QName_exact.test(e))throw new Fr(Fr.INVALID_CHARACTER_ERR,'invalid character in name "'+e+'"');return"html"===this.type&&(e=e.toLowerCase()),this._createAttribute(e)},_createAttribute:function(e){var t=new Bn(qr);return t.ownerDocument=this,t.childNodes=new mn,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){if(!Gr.Name.test(e))throw new Fr(Fr.INVALID_CHARACTER_ERR,'not a valid xml name "'+e+'"');if("html"===this.type)throw new Fr("document is an html document",jr.NotSupportedError);var t=new zn(qr);return t.ownerDocument=this,t.childNodes=new mn,t.nodeName=e,t},createElementNS:function(e,t){var r=Yr(e,t),n=new qn(qr),o=n.attributes=new vn;return n.childNodes=new mn,n.ownerDocument=this,n.nodeName=t,n.tagName=t,n.namespaceURI=r[0],n.prefix=r[1],n.localName=r[2],o._ownerElement=n,n},createAttributeNS:function(e,t){var r=Yr(e,t),n=new Bn(qr);return n.ownerDocument=this,n.childNodes=new mn,n.nodeName=t,n.name=t,n.specified=!0,n.namespaceURI=r[0],n.prefix=r[1],n.localName=r[2],n}},Jr(Sn,Tn),qn.prototype={nodeType:Qr,attributes:null,getQualifiedName:function(){return this.prefix?this.prefix+":"+this.localName:this.localName},_isInHTMLDocumentAndNamespace:function(){return"html"===this.ownerDocument.type&&this.namespaceURI===Pr.HTML},hasAttributes:function(){return!(!this.attributes||!this.attributes.length)},hasAttribute:function(e){return!!this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t?t.value:null},getAttributeNode:function(e){return this._isInHTMLDocumentAndNamespace()&&(e=e.toLowerCase()),this.attributes.getNamedItem(e)},setAttribute:function(e,t){this._isInHTMLDocumentAndNamespace()&&(e=e.toLowerCase());var r=this.getAttributeNode(e);r?r.value=r.nodeValue=""+t:((r=this.ownerDocument._createAttribute(e)).value=r.nodeValue=""+t,this.setAttributeNode(r))},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var r=this.getAttributeNodeNS(e,t);r&&this.removeAttributeNode(r)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var r=this.getAttributeNodeNS(e,t);return r?r.value:null},setAttributeNS:function(e,t,r){var n=Yr(e,t)[2],o=this.getAttributeNodeNS(e,n);o?o.value=o.nodeValue=""+r:((o=this.ownerDocument.createAttributeNS(e,t)).value=o.nodeValue=""+r,this.setAttributeNode(o))},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByClassName:function(e){var t=$r(e);return new fn(this,(function(r){var n=[];return t.length>0&&_n(r,(function(o){if(o!==r&&o.nodeType===Qr){var i=o.getAttribute("class");if(i){var s=e===i;if(!s){var a=$r(i);s=t.every((l=a,function(e){return l&&-1!==l.indexOf(e)}))}s&&n.push(o)}}var l})),n}))},getElementsByTagName:function(e){var t="html"===(this.nodeType===an?this:this.ownerDocument).type,r=e.toLowerCase();return new fn(this,(function(n){var o=[];return _n(n,(function(i){i!==n&&i.nodeType===Qr&&(("*"===e||i.getQualifiedName()===(t&&i.namespaceURI===Pr.HTML?r:e))&&o.push(i))})),o}))},getElementsByTagNameNS:function(e,t){return new fn(this,(function(r){var n=[];return _n(r,(function(o){o===r||o.nodeType!==Qr||"*"!==e&&o.namespaceURI!==e||"*"!==t&&o.localName!=t||n.push(o)})),n}))}},Sn.prototype.getElementsByClassName=qn.prototype.getElementsByClassName,Sn.prototype.getElementsByTagName=qn.prototype.getElementsByTagName,Sn.prototype.getElementsByTagNameNS=qn.prototype.getElementsByTagNameNS,Jr(qn,Tn),Bn.prototype.nodeType=Zr,Jr(Bn,Tn),Fn.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,r){r=this.data.substring(0,e)+r+this.data.substring(e+t),this.nodeValue=this.data=r,this.length=r.length}},Jr(Fn,Tn),jn.prototype={nodeName:"#text",nodeType:en,splitText:function(e){var t=this.data,r=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var n=this.ownerDocument.createTextNode(r);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}},Jr(jn,Fn),Gn.prototype={nodeName:"#comment",nodeType:sn},Jr(Gn,Fn),Wn.prototype={nodeName:"#cdata-section",nodeType:tn},Jr(Wn,jn),Hn.prototype.nodeType=ln,Jr(Hn,Tn),Vn.prototype.nodeType=un,Jr(Vn,Tn),$n.prototype.nodeType=nn,Jr($n,Tn),zn.prototype.nodeType=rn,Jr(zn,Tn),Yn.prototype.nodeName="#document-fragment",Yn.prototype.nodeType=cn,Jr(Yn,Tn),Kn.prototype.nodeType=on,Jr(Kn,Fn),Jn.prototype.serializeToString=function(e,t){return Xn.call(e,t)},Tn.prototype.toString=Xn;try{if(Object.defineProperty){let e=function(t){switch(t.nodeType){case Qr:case cn:var r=[];for(t=t.firstChild;t;)7!==t.nodeType&&8!==t.nodeType&&r.push(e(t)),t=t.nextSibling;return r.join("");default:return t.nodeValue}};Object.defineProperty(fn.prototype,"length",{get:function(){return gn(this),this.$$length}}),Object.defineProperty(Tn.prototype,"textContent",{get:function(){return e(this)},set:function(e){switch(this.nodeType){case Qr:case cn:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),no=function(e,t,r){e["$$"+t]=r}}}catch(ti){}wt._updateLiveList=gn,wt.Attr=Bn,wt.CDATASection=Wn,wt.CharacterData=Fn,wt.Comment=Gn,wt.Document=Sn,wt.DocumentFragment=Yn,wt.DocumentType=Hn,wt.DOMImplementation=En,wt.Element=qn,wt.Entity=$n,wt.EntityReference=zn,wt.LiveNodeList=fn,wt.NamedNodeMap=vn,wt.Node=Tn,wt.NodeList=mn,wt.Notation=Vn,wt.Text=jn,wt.ProcessingInstruction=Kn,wt.XMLSerializer=Jn;var oo={},io={};!function(e){var t=et.freeze;e.XML_ENTITIES=t({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),e.HTML_ENTITIES=t({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}),e.entityMap=e.HTML_ENTITIES}(io);var so={},ao=et,lo=Et,co=ut,uo=ao.isHTMLEscapableRawTextElement,po=ao.isHTMLMimeType,ho=ao.isHTMLRawTextElement,mo=ao.hasOwn,fo=ao.NAMESPACE,go=co.ParseError,vo=co.DOMException;function yo(){}yo.prototype={parse:function(e,t,r){var n=this.domBuilder;n.startDocument(),_o(t,t=Object.create(null)),function(e,t,r,n,o){var i=po(n.mimeType);e.indexOf(lo.UNICODE_REPLACEMENT_CHARACTER)>=0&&o.warning("Unicode replacement character detected, source encoding issues?");function s(e){if(e>65535){var t=55296+((e-=65536)>>10),r=56320+(1023&e);return String.fromCharCode(t,r)}return String.fromCharCode(e)}function a(e){var t=";"===e[e.length-1]?e:e+";";if(!i&&t!==e)return o.error("EntityRef: expecting ;"),e;var n=lo.Reference.exec(t);if(!n||n[0].length!==t.length)return o.error("entity not matching Reference production: "+e),e;var a=t.slice(1,-1);return mo(r,a)?r[a]:"#"===a.charAt(0)?s(parseInt(a.substring(1).replace("x","0x"))):(o.error("entity not found:"+e),e)}function l(t){if(t>g){var r=e.substring(g,t).replace(bo,a);p&&h(g),n.characters(r,0,t-g),g=t}}var c=0,u=0,d=/\r\n?|\n|$/g,p=n.locator;function h(t,r){for(;t>=u&&(r=d.exec(e));)c=u,u=r.index+r[0].length,p.lineNumber++;p.columnNumber=t-c+1}var m=[{currentNSMap:t}],f=[],g=0;for(;;){try{var v=e.indexOf("<",g);if(v<0){if(!i&&f.length>0)return o.fatalError("unclosed xml tag(s): "+f.join(", "));if(!e.substring(g).match(/^\s*$/)){var y=n.doc,b=y.createTextNode(e.substring(g));if(y.documentElement)return o.error("Extra content at the end of the document");y.appendChild(b),n.currentElement=b}return}if(v>g){var w=e.substring(g,v);i||0!==f.length||(w=w.replace(new RegExp(lo.S_OPT.source,"g"),""))&&o.error("Unexpected content outside root element: '"+w+"'"),l(v)}switch(e.charAt(v+1)){case"/":var E=e.indexOf(">",v+2),T=e.substring(v+2,E>0?E:void 0);if(!T)return o.fatalError("end tag name missing");var N=E>0&&lo.reg("^",lo.QName_group,lo.S_OPT,"$").exec(T);if(!N)return o.fatalError('end tag name contains invalid characters: "'+T+'"');if(!n.currentElement&&!n.doc.documentElement)return;var _=f[f.length-1]||n.currentElement.tagName||n.doc.documentElement.tagName||"";if(_!==N[1]){var S=N[1].toLowerCase();if(!i||_.toLowerCase()!==S)return o.fatalError('Opening and ending tag mismatch: "'+_+'" != "'+T+'"')}var x=m.pop();f.pop();var A=x.localNSMap;if(n.endElement(x.uri,x.localName,_),A)for(var I in A)mo(A,I)&&n.endPrefixMapping(I);E++;break;case"?":p&&h(v),E=Ao(e,v,n,o);break;case"!":p&&h(v),E=xo(e,v,n,o,i);break;default:p&&h(v);var O=new Io,R=m[m.length-1].currentNSMap,C=(E=Eo(e,v,O,R,a,o,i),O.length);if(O.closed||(i&&ao.isHTMLVoidElement(O.tagName)?O.closed=!0:f.push(O.tagName)),p&&C){for(var D=wo(p,{}),L=0;L<C;L++){var M=O[L];h(M.offset),M.locator=wo(p,{})}n.locator=D,To(O,n,R)&&m.push(O),n.locator=p}else To(O,n,R)&&m.push(O);i&&!O.closed?E=No(e,E,O.tagName,a,n):E++}}catch(ti){if(ti instanceof go)throw ti;if(ti instanceof vo)throw new go(ti.name+": "+ti.message,n.locator,ti);o.error("element parse error: "+ti),E=-1}E>g?g=E:l(Math.max(v,g)+1)}}(e,t,r,n,this.errorHandler),n.endDocument()}};var bo=/&#?\w+;?/g;function wo(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function Eo(e,t,r,n,o,i,s){function a(e,t,n){return mo(r.attributeNames,e)?i.fatalError("Attribute "+e+" redefined"):!s&&t.indexOf("<")>=0?i.fatalError("Unescaped '<' not allowed in attributes values"):void r.addValue(e,t.replace(/[\t\n\r]/g," ").replace(bo,o),n)}for(var l,c=++t,u=0;;){var d=e.charAt(c);switch(d){case"=":if(1===u)l=e.slice(t,c),u=3;else{if(2!==u)throw new Error("attribute equal must after attrName");u=3}break;case"'":case'"':if(3===u||1===u){if(1===u&&(i.warning('attribute value must after "="'),l=e.slice(t,c)),t=c+1,!((c=e.indexOf(d,t))>0))throw new Error("attribute value no end '"+d+"' match");a(l,p=e.slice(t,c),t-1),u=5}else{if(4!=u)throw new Error('attribute value must after "="');a(l,p=e.slice(t,c),t),i.warning('attribute "'+l+'" missed start quot('+d+")!!"),t=c+1,u=5}break;case"/":switch(u){case 0:r.setTagName(e.slice(t,c));case 5:case 6:case 7:u=7,r.closed=!0;case 4:case 1:break;case 2:r.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return i.error("unexpected end of input"),0==u&&r.setTagName(e.slice(t,c)),c;case">":switch(u){case 0:r.setTagName(e.slice(t,c));case 5:case 6:case 7:break;case 4:case 1:"/"===(p=e.slice(t,c)).slice(-1)&&(r.closed=!0,p=p.slice(0,-1));case 2:2===u&&(p=l),4==u?(i.warning('attribute "'+p+'" missed quot(")!'),a(l,p,t)):(s||i.warning('attribute "'+p+'" missed value!! "'+p+'" instead!!'),a(p,p,t));break;case 3:if(!s)return i.fatalError("AttValue: ' or \" expected")}return c;case"€":d=" ";default:if(d<=" ")switch(u){case 0:r.setTagName(e.slice(t,c)),u=6;break;case 1:l=e.slice(t,c),u=2;break;case 4:var p=e.slice(t,c);i.warning('attribute "'+p+'" missed quot(")!!'),a(l,p,t);case 5:u=6}else switch(u){case 2:s||i.warning('attribute "'+l+'" missed value!! "'+l+'" instead2!!'),a(l,l,t),t=c,u=1;break;case 5:i.warning('attribute space is required"'+l+'"!!');case 6:u=1,t=c;break;case 3:u=4,t=c;break;case 7:throw new Error("elements closed character '/' and '>' must be connected to")}}c++}}function To(e,t,r){for(var n=e.tagName,o=null,i=e.length;i--;){var s=e[i],a=s.qName,l=s.value;if((p=a.indexOf(":"))>0)var c=s.prefix=a.slice(0,p),u=a.slice(p+1),d="xmlns"===c&&u;else u=a,c=null,d="xmlns"===a&&"";s.localName=u,!1!==d&&(null==o&&(o=Object.create(null),_o(r,r=Object.create(null))),r[d]=o[d]=l,s.uri=fo.XMLNS,t.startPrefixMapping(d,l))}for(i=e.length;i--;)(s=e[i]).prefix&&("xml"===s.prefix&&(s.uri=fo.XML),"xmlns"!==s.prefix&&(s.uri=r[s.prefix]));var p;(p=n.indexOf(":"))>0?(c=e.prefix=n.slice(0,p),u=e.localName=n.slice(p+1)):(c=null,u=e.localName=n);var h=e.uri=r[c||""];if(t.startElement(h,u,n,e),!e.closed)return e.currentNSMap=r,e.localNSMap=o,!0;if(t.endElement(h,u,n),o)for(c in o)mo(o,c)&&t.endPrefixMapping(c)}function No(e,t,r,n,o){var i=uo(r);if(i||ho(r)){var s=e.indexOf("</"+r+">",t),a=e.substring(t+1,s);return i&&(a=a.replace(bo,n)),o.characters(a,0,a.length),s}return t+1}function _o(e,t){for(var r in e)mo(e,r)&&(t[r]=e[r])}function So(e,t){var r=t;function n(t){return t=t||0,e.charAt(r+t)}function o(e){r+=e=e||1}function i(){return e.substring(r)}return{char:n,getIndex:function(){return r},getMatch:function(e){var t=lo.reg("^",e).exec(i());return t?(o(t[0].length),t[0]):null},getSource:function(){return e},skip:o,skipBlanks:function(){for(var t=0;r<e.length;){var i=n();if(" "!==i&&"\n"!==i&&"\t"!==i&&"\r"!==i)return t;t++,o()}return-1},substringFromIndex:i,substringStartsWith:function(t){return e.substring(r,r+t.length)===t},substringStartsWithCaseInsensitive:function(t){return e.substring(r,r+t.length).toUpperCase()===t.toUpperCase()}}}function xo(e,t,r,n,o){var i=So(e,t);switch(o?i.char(2).toUpperCase():i.char(2)){case"-":var s=i.getMatch(lo.Comment);return s?(r.comment(s,lo.COMMENT_START.length,s.length-lo.COMMENT_START.length-lo.COMMENT_END.length),i.getIndex()):n.fatalError("comment is not well-formed at position "+i.getIndex());case"[":var a=i.getMatch(lo.CDSect);return a?o||r.currentElement?(r.startCDATA(),r.characters(a,lo.CDATA_START.length,a.length-lo.CDATA_START.length-lo.CDATA_END.length),r.endCDATA(),i.getIndex()):n.fatalError("CDATA outside of element"):n.fatalError("Invalid CDATA starting at position "+t);case"D":if(r.doc&&r.doc.documentElement)return n.fatalError("Doctype not allowed inside or after documentElement at position "+i.getIndex());if(o?!i.substringStartsWithCaseInsensitive(lo.DOCTYPE_DECL_START):!i.substringStartsWith(lo.DOCTYPE_DECL_START))return n.fatalError("Expected "+lo.DOCTYPE_DECL_START+" at position "+i.getIndex());if(i.skip(lo.DOCTYPE_DECL_START.length),i.skipBlanks()<1)return n.fatalError("Expected whitespace after "+lo.DOCTYPE_DECL_START+" at position "+i.getIndex());var l={name:void 0,publicId:void 0,systemId:void 0,internalSubset:void 0};if(l.name=i.getMatch(lo.Name),!l.name)return n.fatalError("doctype name missing or contains unexpected characters at position "+i.getIndex());if(o&&"html"!==l.name.toLowerCase()&&n.warning("Unexpected DOCTYPE in HTML document at position "+i.getIndex()),i.skipBlanks(),i.substringStartsWith(lo.PUBLIC)||i.substringStartsWith(lo.SYSTEM)){var c=lo.ExternalID_match.exec(i.substringFromIndex());if(!c)return n.fatalError("doctype external id is not well-formed at position "+i.getIndex());void 0!==c.groups.SystemLiteralOnly?l.systemId=c.groups.SystemLiteralOnly:(l.systemId=c.groups.SystemLiteral,l.publicId=c.groups.PubidLiteral),i.skip(c[0].length)}else if(o&&i.substringStartsWithCaseInsensitive(lo.SYSTEM)){if(i.skip(lo.SYSTEM.length),i.skipBlanks()<1)return n.fatalError("Expected whitespace after "+lo.SYSTEM+" at position "+i.getIndex());if(l.systemId=i.getMatch(lo.ABOUT_LEGACY_COMPAT_SystemLiteral),!l.systemId)return n.fatalError("Expected "+lo.ABOUT_LEGACY_COMPAT+" in single or double quotes after "+lo.SYSTEM+" at position "+i.getIndex())}return o&&l.systemId&&!lo.ABOUT_LEGACY_COMPAT_SystemLiteral.test(l.systemId)&&n.warning("Unexpected doctype.systemId in HTML document at position "+i.getIndex()),o||(i.skipBlanks(),l.internalSubset=function(e,t){var r,n,o,i=e.getSource();if("["===e.char()){e.skip(1);for(var s=e.getIndex();e.getIndex()<i.length;){if(e.skipBlanks(),"]"===e.char()){var a=i.substring(s,e.getIndex());return e.skip(1),a}var l=null;if("<"===e.char()&&"!"===e.char(1))switch(e.char(2)){case"E":"L"===e.char(3)?l=e.getMatch(lo.elementdecl):"N"===e.char(3)&&(l=e.getMatch(lo.EntityDecl));break;case"A":l=e.getMatch(lo.AttlistDecl);break;case"N":l=e.getMatch(lo.NotationDecl);break;case"-":l=e.getMatch(lo.Comment)}else if("<"===e.char()&&"?"===e.char(1))r=e,n=t,o=void 0,l=(o=lo.PI.exec(r.substringFromIndex()))?"xml"===o[1].toLowerCase()?n.fatalError("xml declaration is only allowed at the start of the document, but found at position "+r.getIndex()):(r.skip(o[0].length),o[0]):n.fatalError("processing instruction is not well-formed at position "+r.getIndex());else{if("%"!==e.char())return t.fatalError("Error detected in Markup declaration");l=e.getMatch(lo.PEReference)}if(!l)return t.fatalError("Error in internal subset at position "+e.getIndex())}return t.fatalError("doctype internal subset is not well-formed, missing ]")}}(i,n)),i.skipBlanks(),">"!==i.char()?n.fatalError("doctype not terminated with > at position "+i.getIndex()):(i.skip(1),r.startDTD(l.name,l.publicId,l.systemId,l.internalSubset),r.endDTD(),i.getIndex());default:return n.fatalError('Not well-formed XML starting with "<!" at position '+t)}}function Ao(e,t,r,n){var o=e.substring(t).match(lo.PI);if(!o)return n.fatalError("Invalid processing instruction starting at position "+t);if("xml"===o[1].toLowerCase()){if(t>0)return n.fatalError("processing instruction at position "+t+" is an xml declaration which is only at the start of the document");if(!lo.XMLDecl.test(e.substring(t)))return n.fatalError("xml declaration is not well-formed")}return r.processingInstruction(o[1],o[2]),t+o[0].length}function Io(){this.attributeNames=Object.create(null)}Io.prototype={setTagName:function(e){if(!lo.QName_exact.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,t,r){if(!lo.QName_exact.test(e))throw new Error("invalid attribute:"+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:r}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},so.XMLReader=yo,so.parseUtils=So,so.parseDoctypeCommentOrCData=xo;var Oo=et,Ro=ut,Co=io,Do=so,Lo=wt.DOMImplementation,Mo=Oo.hasDefaultHTMLNamespace,ko=Oo.isHTMLMimeType,Uo=Oo.isValidMimeType,Po=Oo.MIME_TYPE,qo=Oo.NAMESPACE,Bo=Ro.ParseError,Fo=Do.XMLReader;function jo(e){return e.replace(/\r[\n\u0085]/g,"\n").replace(/[\r\u0085\u2028\u2029]/g,"\n")}function Go(e){if(void 0===(e=e||{}).locator&&(e.locator=!0),this.assign=e.assign||Oo.assign,this.domHandler=e.domHandler||Wo,this.onError=e.onError||e.errorHandler,e.errorHandler&&"function"!=typeof e.errorHandler)throw new TypeError("errorHandler object is no longer supported, switch to onError!");e.errorHandler&&e.errorHandler("warning","The `errorHandler` option has been deprecated, use `onError` instead!",this),this.normalizeLineEndings=e.normalizeLineEndings||jo,this.locator=!!e.locator,this.xmlns=this.assign(Object.create(null),e.xmlns)}function Wo(e){var t=e||{};this.mimeType=t.mimeType||Po.XML_APPLICATION,this.defaultNamespace=t.defaultNamespace||null,this.cdata=!1,this.currentElement=void 0,this.doc=void 0,this.locator=void 0,this.onError=t.onError}function Ho(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}function Vo(e,t,r){return"string"==typeof e?e.substr(t,r):e.length>=t+r||t?new java.lang.String(e,t,r)+"":e}function $o(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}Go.prototype.parseFromString=function(e,t){if(!Uo(t))throw new TypeError('DOMParser.parseFromString: the provided mimeType "'+t+'" is not valid.');var r=this.assign(Object.create(null),this.xmlns),n=Co.XML_ENTITIES,o=r[""]||null;Mo(t)?(n=Co.HTML_ENTITIES,o=qo.HTML):t===Po.XML_SVG_IMAGE&&(o=qo.SVG),r[""]=o,r.xml=r.xml||qo.XML;var i=new this.domHandler({mimeType:t,defaultNamespace:o,onError:this.onError}),s=this.locator?{}:void 0;this.locator&&i.setDocumentLocator(s);var a=new Fo;return a.errorHandler=i,a.domBuilder=i,!Oo.isHTMLMimeType(t)&&"string"!=typeof e&&a.errorHandler.fatalError("source is not a string"),a.parse(this.normalizeLineEndings(String(e)),r,n),i.doc.documentElement||a.errorHandler.fatalError("missing root element"),i.doc},Wo.prototype={startDocument:function(){var e=new Lo;this.doc=ko(this.mimeType)?e.createHTMLDocument(!1):e.createDocument(this.defaultNamespace,"")},startElement:function(e,t,r,n){var o=this.doc,i=o.createElementNS(e,r||t),s=n.length;$o(this,i),this.currentElement=i,this.locator&&Ho(this.locator,i);for(var a=0;a<s;a++){e=n.getURI(a);var l=n.getValue(a),c=(r=n.getQName(a),o.createAttributeNS(e,r));this.locator&&Ho(n.getLocator(a),c),c.value=c.nodeValue=l,i.setAttributeNode(c)}},endElement:function(e,t,r){this.currentElement=this.currentElement.parentNode},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,t){var r=this.doc.createProcessingInstruction(e,t);this.locator&&Ho(this.locator,r),$o(this,r)},ignorableWhitespace:function(e,t,r){},characters:function(e,t,r){if(e=Vo.apply(this,arguments)){if(this.cdata)var n=this.doc.createCDATASection(e);else n=this.doc.createTextNode(e);this.currentElement?this.currentElement.appendChild(n):/^\s*$/.test(e)&&this.doc.appendChild(n),this.locator&&Ho(this.locator,n)}},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){e&&(e.lineNumber=0),this.locator=e},comment:function(e,t,r){e=Vo.apply(this,arguments);var n=this.doc.createComment(e);this.locator&&Ho(this.locator,n),$o(this,n)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e,t,r,n){var o=this.doc.implementation;if(o&&o.createDocumentType){var i=o.createDocumentType(e,t,r,n);this.locator&&Ho(this.locator,i),$o(this,i),this.doc.doctype=i}},reportError:function(e,t){if("function"==typeof this.onError)try{this.onError(e,t,this)}catch(ti){throw new Bo("Reporting "+e+' "'+t+'" caused '+ti,this.locator)}else console.error("[xmldom "+e+"]\t"+t,function(e){if(e)return"\n@#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}(this.locator))},warning:function(e){this.reportError("warning",e)},error:function(e){this.reportError("error",e)},fatalError:function(e){throw this.reportError("fatalError",e),new Bo(e,this.locator)}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,(function(e){Wo.prototype[e]=function(){return null}})),oo.__DOMHandler=Wo,oo.DOMParser=Go,oo.normalizeLineEndings=jo,oo.onErrorStopParsing=function(e){if("error"===e)throw"onErrorStopParsing"},oo.onWarningStopParsing=function(){throw"onWarningStopParsing"};var zo=et;zo.assign,zo.hasDefaultHTMLNamespace,zo.isHTMLMimeType,zo.isValidMimeType,zo.MIME_TYPE,zo.NAMESPACE;var Yo=oo.DOMParser;function Ko(e){const t=e.coordinates,r=t[0],n=t[t.length-1];return{type:"Polygon",coordinates:[r[0]===n[0]&&r[1]===n[1]?t:[...t,r]]}}const Jo=Object.freeze(Object.defineProperty({__proto__:null,lineStringToPolygon:Ko,osmStringToGeojson:function(e){const t=(new Yo).parseFromString(e,"text/xml");return Ze(t)}},Symbol.toStringTag,{value:"Module"}));const Xo=class e{static parsePointProperties(e){return e.properties?{...e.id&&{externalId:e.id},...l.OsmTagsUtils.elementName(e.properties)&&{name:l.OsmTagsUtils.elementName(e.properties)},...l.OsmTagsUtils.isGate(e.properties)&&{isGate:!0},...l.OsmTagsUtils.isSubwayEntrance(e.properties)&&{isSubwayEntrance:!0},...l.OsmTagsUtils.getRef(e.properties)&&{subwayEntrsanceRef:l.OsmTagsUtils.getRef(e.properties)},...l.OsmTagsUtils.isElevator(e.properties)&&{isElevator:!0},...l.OsmTagsUtils.isTurnstile(e.properties)&&{isTurnstile:!0}}:{...e.id&&{externalId:e.id}}}static parseLineStringProperties(e){return e.properties?{...e.properties.id&&{externalId:e.properties.id},...e.id&&{externalId:e.id},...l.OsmTagsUtils.elementName(e.properties)&&{name:l.OsmTagsUtils.elementName(e.properties)},...l.OsmTagsUtils.isOneway(e.properties)&&{isOneway:!0},...l.OsmTagsUtils.areStairs(e.properties)&&{areStairs:!0},...l.OsmTagsUtils.isElevator(e.properties)&&{isElevator:!0},...l.OsmTagsUtils.isEscalator(e.properties)&&{areEscalators:!0},...l.OsmTagsUtils.isMovingWalkway(e.properties)&&{isMovingWalkway:!0},...l.OsmTagsUtils.needTicket(e.properties)&&{needTicket:!0},...l.OsmTagsUtils.getIncline(e.properties)&&{incline:l.OsmTagsUtils.getIncline(e.properties)},...l.OsmTagsUtils.getWheelchair(e.properties)&&{wheelchair:l.OsmTagsUtils.getWheelchair(e.properties)},...l.OsmTagsUtils.getSmoothness(e.properties)&&{smoothness:l.OsmTagsUtils.getSmoothness(e.properties)},...l.OsmTagsUtils.getSurface(e.properties)&&{surface:l.OsmTagsUtils.getSurface(e.properties)}}:{...e.id&&{externalId:e.id}}}static createGraphFromGeojsonString(e){const t=JSON.parse(e);return this.createGraphFromGeojson(t)}static createGraphFromGeojson(t,n=e.DEFAULT_FEATURE_SELECTOR){const o=function(e){return"FeatureCollection"===e.type?e.features:"Feature"===e.type?[e]:[{type:"Feature",geometry:e,properties:{}}]}(t),i=o.filter(n),s=[],a=[];let c=0;const d=(e,t)=>{const n=new r.Coordinates(e[1],e[0],null,t);let o=a.find((e=>!!e.coords.equalsWithoutLevel(n)&&(!!r.Level.intersect(e.coords.level,t)||(null===e.coords.level||null===t))))||null;return o?(r.Level.equals(o.coords.level,t)||(o.coords.level=r.Level.intersection(o.coords.level,t),null===o.coords.level&&(o.coords.level=t)),o):(o=new p(n),o.id=c++,a.push(o),o)};i.filter((e=>"LineString"===e.geometry.type)).forEach((e=>{const t=e.geometry,n=e.properties||{},o=this.parseLineStringProperties(e),i="level"in n?n.level:null,a=e=>{for(let r=1;r<t.coordinates.length;r++){let i=d(t.coordinates[r-1],e),a=d(t.coordinates[r],e);if(l.OsmTagsUtils.isOnewayBackward(n)){const e=a;a=i,i=e}const c=new u(i,a,o);s.push(c)}};a(r.Level.fromString(i)),"repeat_on"in n&&n.repeat_on.split(";").map(r.Level.fromString).forEach(a)}));const m=[],f=[];o.filter((e=>"Point"===e.geometry.type)).forEach((e=>{const t=e.properties||{},n=e.geometry,o="level"in t?t.level:null,i=r.Level.fromString(o),s=new r.Coordinates(n.coordinates[1],n.coordinates[0],null,i),c=a.filter((e=>!!r.Coordinates.equalsWithoutLevel(e.coords,s)&&(!!r.Level.intersect(e.coords.level,i)||(null===e.coords.level||null===i))));if(c.forEach((t=>{t.properties=this.parsePointProperties(e),null!==i&&(t.coords.level=r.Level.union(t.coords.level,i))})),l.OsmTagsUtils.isElevator(t)){const e=((e,t)=>{const n=new r.Coordinates(e[1],e[0],null,t),o=[];return a.forEach((e=>{r.Coordinates.equalsWithoutLevel(e.coords,n)&&r.Level.intersect(e.coords.level,t)&&o.push(e)})),o})(n.coordinates,i);e.length>0&&m.push({vertices:e,props:{name:t.name,isElevator:!0,externalId:t.id}})}l.OsmTagsUtils.isRoutingBoundsEntryPoint(t)&&c.forEach((e=>{f.push(e)}))})),o.filter((e=>"Polygon"===e.geometry.type&&e.properties&&l.OsmTagsUtils.isElevator(e.properties))).forEach((e=>{var t,n;const o=e,i=o.geometry.coordinates[0].map((e=>a.filter((t=>t.coords.equalsWithoutLevel(new r.Coordinates(e[1],e[0],null,t.coords.level)))))).flat(),l=o.geometry.coordinates[0].slice(0,-1),c=l.reduce(((e,t)=>[e[0]+t[0],e[1]+t[1]]),[0,0]).map((e=>e/l.length)),p=i.reduce(((e,t)=>r.Level.union(e,t.coords.level)),null),h=new r.Coordinates(c[1],c[0],null,p),f=[];i.forEach((t=>{var r;const n=d([h.lng,h.lat],t.coords.level);s.push(new u(n,t,{externalId:null==(r=e.properties)?void 0:r.id})),f.push(n)})),m.push({vertices:f,props:{name:null==(t=e.properties)?void 0:t.name,isElevator:!0,externalId:null==(n=e.properties)?void 0:n.id}})})),m.forEach((({vertices:e,props:t})=>{for(let r=0;r<e.length;r++)for(let n=r+1;n<e.length;n++)s.push(new u(e[r],e[n],t));if(1===e.length&&null===e[0].coords.level){const r=e[0],n=s.filter((e=>e.vertex1===r||e.vertex2===r));if(n.length>1){const e=[r];for(let t=1;t<n.length;t++){const o=new p(r.coords,r.properties);o.id=c++,a.push(o),n[t].vertex1===r?n[t].vertex1=o:n[t].vertex2=o,e.push(o)}for(let r=0;r<e.length;r++)for(let n=r+1;n<e.length;n++)s.push(new u(e[r],e[n],t))}}}));const g={type:"MultiPolygon",coordinates:[]};return o.filter((e=>e.properties&&l.OsmTagsUtils.isRoutingBounds(e.properties))).forEach((e=>{if("LineString"===e.geometry.type){const t=Ko(e.geometry);g.coordinates.push(t.coordinates)}else"Polygon"===e.geometry.type?g.coordinates.push(e.geometry.coordinates):"MultiPolygon"===e.geometry.type&&g.coordinates.push(...e.geometry.coordinates)})),new h(a,s,g.coordinates.length>0?g:void 0,f)}};t(Xo,"RESTRICTED_PEDESTRIANS_HIGHWAYS",["motorway","motorway_link"]),t(Xo,"DEFAULT_FEATURE_SELECTOR",(e=>{if(!e.properties)return!1;if("LineString"===e.geometry.type){if("yes"===e.properties.foot)return!0;if(["no","private"].includes(e.properties.access))return!1;if("highway"in e.properties)return!Xo.RESTRICTED_PEDESTRIANS_HIGHWAYS.includes(e.properties.highway);if("sidewalk"===e.properties.footway)return!0}return!("elevator"!==e.properties.highway||!["Point","Polygon"].includes(e.type))}));let Qo=Xo;const Zo=class e{static parseNodeProperties(e){return{...e.id&&{externalId:e.id},...l.OsmTagsUtils.elementName(e.tags)&&{name:l.OsmTagsUtils.elementName(e.tags)},...l.OsmTagsUtils.isGate(e.tags)&&{isGate:!0},...l.OsmTagsUtils.isSubwayEntrance(e.tags)&&{isSubwayEntrance:!0},...l.OsmTagsUtils.getRef(e.tags)&&{subwayEntrsanceRef:l.OsmTagsUtils.getRef(e.tags)},...l.OsmTagsUtils.isTurnstile(e.tags)&&{isTurnstile:!0}}}static parseWayProperties(e){return{...e.id&&{externalId:e.id},...l.OsmTagsUtils.elementName(e.tags)&&{name:l.OsmTagsUtils.elementName(e.tags)},...l.OsmTagsUtils.isOneway(e.tags)&&{isOneway:l.OsmTagsUtils.isOneway(e.tags)},...l.OsmTagsUtils.areStairs(e.tags)&&{areStairs:l.OsmTagsUtils.areStairs(e.tags)},...l.OsmTagsUtils.isElevator(e.tags)&&{isElevator:l.OsmTagsUtils.isElevator(e.tags)},...l.OsmTagsUtils.isEscalator(e.tags)&&{areEscalators:l.OsmTagsUtils.isEscalator(e.tags)},...l.OsmTagsUtils.isMovingWalkway(e.tags)&&{isMovingWalkway:l.OsmTagsUtils.isMovingWalkway(e.tags)},...l.OsmTagsUtils.needTicket(e.tags)&&{needTicket:l.OsmTagsUtils.needTicket(e.tags)},...l.OsmTagsUtils.getIncline(e.tags)&&{incline:l.OsmTagsUtils.getIncline(e.tags)},...l.OsmTagsUtils.getWheelchair(e.tags)&&{wheelchair:l.OsmTagsUtils.getWheelchair(e.tags)},...l.OsmTagsUtils.getSmoothness(e.tags)&&{smoothness:l.OsmTagsUtils.getSmoothness(e.tags)},...l.OsmTagsUtils.getSurface(e.tags)&&{surface:l.OsmTagsUtils.getSurface(e.tags)}}}static createGraphFromOsmXmlString(e){const t=l.OsmParser.parseOsmXmlString(e);return this.createGraphFromOsmModel(t)}static createGraphFromOsmModel(t,n=e.DEFAULT_WAY_SELECTOR,o){const i=[],s=[],a=[],c=new Set,d=(e,t)=>{var n;let o=(null==(n=s.find((([n,o])=>n===e.id&&(!!r.Level.intersect(o.coords.level,t)||(null===o.coords.level||null===t)))))?void 0:n[1])||null;if(o)return r.Level.equals(o.coords.level,t)||(o.coords.level=r.Level.intersection(o.coords.level,t),null===o.coords.level&&(o.coords.level=t)),o;const i=new r.Coordinates(e.coords.lat,e.coords.lng,null,t);if(o=new p(i,this.parseNodeProperties(e)),s.push([e.id,o]),l.OsmTagsUtils.isElevator(e.tags)){let t=a.find((([t])=>e.id===t));t||(t=[e.id,e.name,[]],a.push(t)),t[2].push(o)}return l.OsmTagsUtils.isRoutingBoundsEntryPoint(e.tags)&&c.add(o),o};t.ways.forEach((e=>{if(!n(e))return;const t=this.parseWayProperties(e),o=r=>{for(let n=1;n<e.nodes.length;n++){let o=d(e.nodes[n-1],r),s=d(e.nodes[n],r);if(l.OsmTagsUtils.isOnewayBackward(e.tags)){const e=s;s=o,o=e}const a=new u(o,s,t);i.push(a)}};o(e.level),e.tags.repeat_on&&e.tags.repeat_on.split(";").map(r.Level.fromString).forEach(o)}));let m=-1;t.ways.filter((e=>l.OsmTagsUtils.isElevator(e.tags)&&e.isGeometryClosed)).forEach((e=>{const t=e.nodes.map((e=>s.filter((([t])=>t===e.id)).map((e=>e[1])))).flat(),n=e.nodes.reduce(((e,t)=>[e[0]+t.coords.lat,e[1]+t.coords.lng]),[0,0]).map((t=>t/e.nodes.length)),o=t.reduce(((e,t)=>r.Level.union(e,t.coords.level)),null),a=new r.Coordinates(n[0],n[1],null,o),c=new l.OsmNode(m--,a,{highway:"elevator"});t.forEach((t=>{const r=d(c,t.coords.level);i.push(new u(r,t,{externalId:e.id}))}))})),a.forEach((([e,t,r])=>{const n={name:t,isElevator:!0,externalId:e};for(let o=0;o<r.length;o++)for(let e=o+1;e<r.length;e++)i.push(new u(r[o],r[e],n));if(1===r.length&&null===r[0].coords.level){const e=r[0],t=i.filter((t=>t.vertex1===e||t.vertex2===e));if(t.length>1){const r=[e];for(let n=1;n<t.length;n++){const o=new p(e.coords,e.properties);s.push([e.id,o]),t[n].vertex1===e?t[n].vertex1=o:t[n].vertex2=o,r.push(o)}for(let e=0;e<r.length;e++)for(let t=e+1;t<r.length;t++)i.push(new u(r[e],r[t],n))}}}));const f={type:"MultiPolygon",coordinates:[]};return t.ways.filter((e=>l.OsmTagsUtils.isRoutingBounds(e.tags))).map((e=>e.getGeoJsonPolygon())).forEach((e=>e&&f.coordinates.push(e.coordinates))),t.relations.filter((e=>l.OsmTagsUtils.isRoutingBounds(e.tags))).map((e=>e.getGeoJsonPolygon())).forEach((e=>e&&f.coordinates.push(e.coordinates))),null==o||o(s),new h(s.map((e=>e[1])),i,f.coordinates.length>0?f:void 0,Array.from(c))}};t(Zo,"RESTRICTED_PEDESTRIANS_HIGHWAYS",["motorway","motorway_link"]),t(Zo,"DEFAULT_WAY_SELECTOR",(e=>{if("yes"===e.tags.area)return!1;if("yes"===e.tags.foot)return!0;if(e.tags.access&&["no","private"].includes(e.tags.access))return!1;const t="elevator"===e.tags.highway&&e.isGeometryClosed;return e.tags.highway&&!Zo.RESTRICTED_PEDESTRIANS_HIGHWAYS.includes(e.tags.highway)&&!t||"sidewalk"===e.tags.footway||"platform"===e.tags.public_transport||"platform"===e.tags.railway}));let ei=Zo;exports.CitywayRemoteRouter=pe,exports.CustomGraphMap=Ge,exports.CustomGraphMapTester=class{static createReportFromOsmXmlString(e){let t;try{t=l.OsmParser.parseOsmXmlString(e)}catch(ti){return{errors:[{type:"could-not-parse-file",details:ti instanceof Error?ti.message:"Unknown error"}]}}const r=new Ge(ei.createGraphFromOsmModel(t));return this.createReportFromCustomGraphMap(r)}static createReportFromGeoJsonString(e){let t;try{t=JSON.parse(e)}catch(ti){return{errors:[{type:"could-not-parse-file",details:ti instanceof Error?ti.message:"Unknown error"}]}}return this.createReportFromGeoJson(t)}static createReportFromGeoJson(e){const t=new Ge(Qo.createGraphFromGeojson(e));return this.createReportFromCustomGraphMap(t)}static createReportFromCustomGraphMap(e){const t=e.graph,r=[];t.routingBounds||r.push({type:"routing-bounds-not-found"}),0===t.routingBoundsEntryPoints.length&&r.push({type:"routing-bounds-entry-points-not-found"});const n=e.router.calculateComponents();return n.length>1&&r.push({type:"multiple-graph-components",data:n}),{customGraphMap:e,errors:r}}static reportToJson(e){var t,r;return{graph:null==(r=null==(t=e.customGraphMap)?void 0:t.graph)?void 0:r.toJson(),errors:e.errors.map((e=>"multiple-graph-components"===e.type?{type:e.type,data:e.data.map((e=>e.map((e=>e.id))))}:("routing-bounds-entry-points-not-found"===e.type||e.type,{type:e.type})))}}},exports.DeutscheBahnRemoteRouter=be,exports.Edge=u,exports.GeoJsonGraphUtils=Qo,exports.GeoJsonUtils=Jo,exports.GeoveloRemoteRouter=_e,exports.Graph=h,exports.GraphProjection=d,exports.GraphRoute=E,exports.GraphRouter=Q,exports.GraphRouterOptionsBuilder=Y,exports.IdfmRemoteRouter=Re,exports.Itinerary=S,exports.ItineraryInfoManager=class{constructor(e=null){t(this,"_itinerary",null),t(this,"_graph",null),t(this,"_steps",[]),t(this,"_coordsNextStep",[]),t(this,"_coordsPreviousStep",[]),t(this,"_coordsDistanceTraveled",[]),t(this,"_coordsLeg",[]),t(this,"_itineraryDistanceWithoutProjections",0),this.itinerary=e}get itinerary(){return this._itinerary}set itinerary(e){if(null===e)return void(this._itinerary=null);this._itinerary=e,this._steps=e.steps,this._graph=e.toGraph(),this._coordsNextStep=new Array(e.coords.length),this._coordsPreviousStep=new Array(e.coords.length),this._coordsDistanceTraveled=new Array(e.coords.length),this._coordsLeg=new Array(e.coords.length),this._itineraryDistanceWithoutProjections=e.distance;let t=0,r=null,n=this._steps[0],o=0;e.coords.forEach(((i,s,a)=>{0!==s&&(o+=a[s-1].distanceTo(i)),this._coordsNextStep[s]=n,this._coordsPreviousStep[s]=r,this._coordsDistanceTraveled[s]=o,this._coordsLeg[s]=e.legs.find((e=>e.coords.includes(i))),t<this._steps.length&&this._steps[t].coords.equals(i)&&(r=this._steps[t],n=t===this._steps.length-1?null:this._steps[t+1],t++)}))}getInfo(e){if(!this._itinerary||!this._graph)return null;const t=this._graph.getProjection(e);if(!t)return null;let r=null;if(t.nearestElement instanceof p){const e=this._itinerary.coords.findIndex((e=>t.nearestElement.coords===e));if(-1===e)throw new Error("ItineraryInfoManager: could not find projection in itinerary (Node)");const n=this._coordsDistanceTraveled[e],o=n,i=this._itineraryDistanceWithoutProjections-n,s=t.distanceFromNearestElement+i,a=o/(o+s),l=1-a;r={nextStep:this._coordsNextStep[e],previousStep:this._coordsPreviousStep[e],projection:t,leg:this._coordsLeg[e],traveledDistance:n,remainingDistance:s,traveledPercentage:a,remainingPercentage:l}}else if(t.nearestElement instanceof u){let e=t.nearestElement.vertex1.coords,n=this._itinerary.coords.findIndex((t=>e===t));if(-1===n)throw new Error("ItineraryInfoManager: could not find projection in itinerary (Edge)");n!==this._itinerary.coords.length-1&&this._itinerary.coords[n+1]===t.nearestElement.vertex2.coords||(e=t.nearestElement.vertex2.coords,n--);const o=this._coordsDistanceTraveled[n]+t.coords.distanceTo(e),i=o,s=this._itineraryDistanceWithoutProjections-o,a=t.distanceFromNearestElement+s,l=i/(i+a),c=1-l;r={nextStep:this._coordsNextStep[n+1],previousStep:this._coordsPreviousStep[n+1],projection:t,leg:this._coordsLeg[n+1],traveledDistance:i,remainingDistance:a,traveledPercentage:l,remainingPercentage:c}}return r}},exports.Leg=_,exports.NavitiaRemoteRouter=ye,exports.NoRouteFoundError=Z,exports.OsmGraphUtils=ei,exports.OsrmRemoteRouter=De,exports.OtpRemoteRouter=Ue,exports.RemoteRouterManager=je,exports.RemoteRoutingError=oe,exports.RoutingError=re,exports.StatusCode=te,exports.TictactripRemoteRouter=Be,exports.Vertex=p,exports.WemapMultiRemoteRouter=Pe,exports.WemapMultiRouter=class{constructor(){t(this,"maps",[])}get rname(){return"wemap-multi"}addIOMap(e){this.maps.push(e)}removeIOMap(e){this.maps=this.maps.filter((t=>t!==e))}removeAllMaps(){this.maps=[]}getMapByName(e){return this.maps.find((t=>t.name===e))}async getItineraries(e,t=[],r=this.maps){const{origin:n,destination:o}=e;t=t.filter((({name:e})=>e!==Pe.rname))||[];const i=r;if(!i.length)return await je.getItinerariesWithFallback(e,t);let s,a;const l=i.find((e=>e.isPointInside(n))),c=Y.fromJson(e.itineraryModifiers||{});if(l&&l.isPointInside(o)){if(s=l.getRouteInsideMap(n,o,c),!s)throw ne.notFound(l.name||"");return[S.fromGraphRoute(s)]}const u=i.find((e=>e.isPointInside(o)));let d;if(!l&&!u)return await je.getItinerariesWithFallback(e,t);if(l&&!u){if(!l.entryPoints.length)throw ne.notFound(l.name||"",`A map including the "origin" but the "destination" has been \n found (${l.name}), however, no "entrypoints" have been found to go out`);const r=e=>`Tried to calculate an itinerary from "origin" to "entrypoints" using wemap router on local map "${l.name}" and an itinerary from "entrypoints" to "destination" using remote routers (${t.map((e=>e.name)).join(", ")}), but failed. Details: ${e}.`;if(s=l.getBestRouteFromOriginToEntryPoints(n,o,c),!s){const e=`No route found from ${n.toString()} to entry points in map: ${l.name}`;throw ne.notFound(l.name||"",r(e))}const i={...e,origin:s.end,destination:o,waypoints:[]};try{d=await je.getItinerariesWithFallback(i,t)}catch(ti){throw ti instanceof oe&&(ti.message=r(ti.message)),ti}return a=S.fromGraphRoute(s),d.map((e=>S.fromItineraries(a,e)))}if(!l&&u){if(!u.entryPoints.length)throw ne.notFound(u.name||"",`A map including the "destination" but the "origin" has been \n found (${u.name}), however, no "entrypoints" have been found to go in`);const r=e=>`Tried to calculate an itinerary from "origin" to "entrypoints" using remote routers (${t.map((e=>e.name)).join(", ")}) and an itinerary from "entrypoints" to "destination" using wemap router on local map "${u.name}", but failed. Details: ${e}.`;if(s=u.getBestRouteFromEntryPointsToDestination(n,o,c),!s){const e=`No route found from entry points to ${o.toString()} in map: ${u.name}`;throw ne.notFound(u.name||"",r(e))}const i={...e,origin:n,destination:s.start,waypoints:[]};try{d=await je.getItinerariesWithFallback(i,t)}catch(ti){throw ti instanceof oe&&(ti.message=r(ti.message)),ti}return a=S.fromGraphRoute(s),d.map((e=>S.fromItineraries(e,a)))}if(l&&u){if(!l.entryPoints.length)throw ne.notFound(l.name||"",`One map including the "origin" (${l.name}) and another \n including the "destination" (${u.name}) has been found, however, no "entrypoints" have \n been found to go out of the origin map`);if(!u.entryPoints.length)throw ne.notFound(u.name||"",`One map including the "origin" (${l.name}) and another \n including the "destination" (${u.name}) has been found, however, no "entrypoints" have \n been found to go in the second map`);const r=e=>`Tried to calculate an itinerary from "origin" to "entrypoints1" using wemap router on local map "${l.name}", an itinerary from "entrypoints1" to "entrypoints2" using remote routers (${t.map((e=>e.name)).join(", ")}) and an itinerary from "entrypoints2" to "destination" using wemap router on local map "${u.name}", but failed. Details: ${e}.`,i=l.getBestRouteFromOriginToEntryPoints(n,o,c);if(!i){const e=`No route found from ${n.toString()} to entry points in map: ${l.name}`;throw ne.notFound(l.name||"",r(e))}const s=u.getBestRouteFromEntryPointsToDestination(n,o,c);if(!s){const e=`No route found from entry points to ${o.toString()} in map: ${u.name}`;throw ne.notFound(u.name||"",r(e))}const a={...e,origin:i.end,destination:s.start,waypoints:[]};try{d=await je.getItinerariesWithFallback(a,t)}catch(ti){throw ti instanceof oe&&(ti.message=r(ti.message)),ti}return d.map((e=>S.fromItineraries(S.fromGraphRoute(i),e,S.fromGraphRoute(s))))}throw new Error("Should never happen")}},exports.WemapMultiRoutingError=ne,exports.areTransitAndTravelModeConsistent=v,exports.getDirectionFromAngle=f,exports.getDurationFromLength=m,exports.isStepLevelChange=w,exports.isTransitModePublicTransport=g,exports.routerRequestToJson=function(e){const{origin:t,destination:r,waypoints:n,...o}=e;return{origin:t.toJson(),destination:r.toJson(),...n&&{waypoints:n.map((e=>e.toJson()))},...o}};
10
+ */!function(e,t){(function(){var r,n="__lodash_hash_undefined__",o=9007199254740991,i="[object Arguments]",s="[object Array]",a="[object Boolean]",l="[object Date]",c="[object Error]",u="[object Function]",d="[object GeneratorFunction]",p="[object Map]",h="[object Number]",m="[object Object]",f="[object Promise]",g="[object RegExp]",v="[object Set]",y="[object String]",b="[object Symbol]",w="[object WeakMap]",E="[object ArrayBuffer]",T="[object DataView]",N="[object Float32Array]",_="[object Float64Array]",S="[object Int8Array]",A="[object Int16Array]",I="[object Int32Array]",O="[object Uint8Array]",R="[object Uint8ClampedArray]",C="[object Uint16Array]",D="[object Uint32Array]",M=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,L=/^\w*$/,k=/^\./,U=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,P=/\\(\\)?/g,q=/\w*$/,B=/^\[object .+?Constructor\]$/,F=/^(?:0|[1-9]\d*)$/,j={};j[N]=j[_]=j[S]=j[A]=j[I]=j[O]=j[R]=j[C]=j[D]=!0,j[i]=j[s]=j[E]=j[a]=j[T]=j[l]=j[c]=j[u]=j[p]=j[h]=j[m]=j[g]=j[v]=j[y]=j[w]=!1;var G={};G[i]=G[s]=G[E]=G[T]=G[a]=G[l]=G[N]=G[_]=G[S]=G[A]=G[I]=G[p]=G[h]=G[m]=G[g]=G[v]=G[y]=G[b]=G[O]=G[R]=G[C]=G[D]=!0,G[c]=G[u]=G[w]=!1;var W="object"==typeof x&&x&&x.Object===Object&&x,H="object"==typeof self&&self&&self.Object===Object&&self,V=W||H||Function("return this")(),$=t&&!t.nodeType&&t,z=$&&e&&!e.nodeType&&e,Y=z&&z.exports===$,K=Y&&W.process,J=function(){try{return K&&K.binding("util")}catch(e){}}(),X=J&&J.isTypedArray;function Q(e,t){return e.set(t[0],t[1]),e}function Z(e,t){return e.add(t),e}function ee(e,t){for(var r=-1,n=e?e.length:0;++r<n&&!1!==t(e[r],r,e););return e}function te(e,t,r,n){var o=-1,i=e?e.length:0;for(n&&i&&(r=e[++o]);++o<i;)r=t(r,e[o],o,e);return r}function re(e,t){for(var r=-1,n=e?e.length:0;++r<n;)if(t(e[r],r,e))return!0;return!1}function ne(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(r){}return t}function oe(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function ie(e,t){return function(r){return e(t(r))}}function se(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}var ae,le=Array.prototype,ce=Function.prototype,ue=Object.prototype,de=V["__core-js_shared__"],pe=(ae=/[^.]+$/.exec(de&&de.keys&&de.keys.IE_PROTO||""))?"Symbol(src)_1."+ae:"",he=ce.toString,me=ue.hasOwnProperty,fe=he.call(Object),ge=ue.toString,ve=RegExp("^"+he.call(me).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ye=Y?V.Buffer:r,be=V.Symbol,we=V.Uint8Array,Ee=ie(Object.getPrototypeOf,Object),Te=Object.create,Ne=ue.propertyIsEnumerable,_e=le.splice,Se=Object.getOwnPropertySymbols,xe=ye?ye.isBuffer:r,Ae=ie(Object.keys,Object),Ie=Math.max,Oe=yt(V,"DataView"),Re=yt(V,"Map"),Ce=yt(V,"Promise"),De=yt(V,"Set"),Me=yt(V,"WeakMap"),Le=yt(Object,"create"),ke=!Ne.call({valueOf:1},"valueOf"),Ue=It(Oe),Pe=It(Re),qe=It(Ce),Be=It(De),Fe=It(Me),je=be?be.prototype:r,Ge=je?je.valueOf:r,We=je?je.toString:r;function He(){}function Ve(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function $e(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ze(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Ye(e){var t=-1,r=e?e.length:0;for(this.__data__=new ze;++t<r;)this.add(e[t])}function Ke(e){this.__data__=new $e(e)}function Je(e,t){var r=Mt(e)||Dt(e)?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],n=r.length,o=!!n;for(var i in e)!t&&!me.call(e,i)||o&&("length"==i||Et(i,n))||r.push(i);return r}function Xe(e,t,n){(n!==r&&!Ct(e[t],n)||"number"==typeof t&&n===r&&!(t in e))&&(e[t]=n)}function Qe(e,t,n){var o=e[t];me.call(e,t)&&Ct(o,n)&&(n!==r||t in e)||(e[t]=n)}function Ze(e,t){for(var r=e.length;r--;)if(Ct(e[r][0],t))return r;return-1}function et(e,t,n,o,s,c,f){var w;if(o&&(w=c?o(e,s,c,f):o(e)),w!==r)return w;if(!Bt(e))return e;var x=Mt(e);if(x){if(w=function(e){var t=e.length,r=e.constructor(t);t&&"string"==typeof e[0]&&me.call(e,"index")&&(r.index=e.index,r.input=e.input);return r}(e),!t)return mt(e,w)}else{var M=wt(e),L=M==u||M==d;if(Ut(e))return function(e,t){if(t)return e.slice();var r=new e.constructor(e.length);return e.copy(r),r}(e,t);if(M==m||M==i||L&&!c){if(ne(e))return c?e:{};if(w=function(e){return"function"!=typeof e.constructor||Nt(e)?{}:(t=Ee(e),Bt(t)?Te(t):{});var t}(L?{}:e),!t)return function(e,t){return ft(e,bt(e),t)}(e,function(e,t){return e&&ft(t,Kt(t),e)}(w,e))}else{if(!G[M])return c?e:{};w=function(e,t,r,n){var o=e.constructor;switch(t){case E:return ht(e);case a:case l:return new o(+e);case T:return function(e,t){var r=t?ht(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,n);case N:case _:case S:case A:case I:case O:case R:case C:case D:return function(e,t){var r=t?ht(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}(e,n);case p:return function(e,t,r){var n=t?r(oe(e),!0):oe(e);return te(n,Q,new e.constructor)}(e,n,r);case h:case y:return new o(e);case g:return function(e){var t=new e.constructor(e.source,q.exec(e));return t.lastIndex=e.lastIndex,t}(e);case v:return function(e,t,r){var n=t?r(se(e),!0):se(e);return te(n,Z,new e.constructor)}(e,n,r);case b:return i=e,Ge?Object(Ge.call(i)):{}}var i}(e,M,et,t)}}f||(f=new Ke);var k=f.get(e);if(k)return k;if(f.set(e,w),!x)var U=n?function(e){return function(e,t,r){var n=t(e);return Mt(e)?n:function(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e}(n,r(e))}(e,Kt,bt)}(e):Kt(e);return ee(U||e,(function(r,i){U&&(r=e[i=r]),Qe(w,i,et(r,t,n,o,i,e,f))})),w}Ve.prototype.clear=function(){this.__data__=Le?Le(null):{}},Ve.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},Ve.prototype.get=function(e){var t=this.__data__;if(Le){var o=t[e];return o===n?r:o}return me.call(t,e)?t[e]:r},Ve.prototype.has=function(e){var t=this.__data__;return Le?t[e]!==r:me.call(t,e)},Ve.prototype.set=function(e,t){return this.__data__[e]=Le&&t===r?n:t,this},$e.prototype.clear=function(){this.__data__=[]},$e.prototype.delete=function(e){var t=this.__data__,r=Ze(t,e);return!(r<0)&&(r==t.length-1?t.pop():_e.call(t,r,1),!0)},$e.prototype.get=function(e){var t=this.__data__,n=Ze(t,e);return n<0?r:t[n][1]},$e.prototype.has=function(e){return Ze(this.__data__,e)>-1},$e.prototype.set=function(e,t){var r=this.__data__,n=Ze(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},ze.prototype.clear=function(){this.__data__={hash:new Ve,map:new(Re||$e),string:new Ve}},ze.prototype.delete=function(e){return vt(this,e).delete(e)},ze.prototype.get=function(e){return vt(this,e).get(e)},ze.prototype.has=function(e){return vt(this,e).has(e)},ze.prototype.set=function(e,t){return vt(this,e).set(e,t),this},Ye.prototype.add=Ye.prototype.push=function(e){return this.__data__.set(e,n),this},Ye.prototype.has=function(e){return this.__data__.has(e)},Ke.prototype.clear=function(){this.__data__=new $e},Ke.prototype.delete=function(e){return this.__data__.delete(e)},Ke.prototype.get=function(e){return this.__data__.get(e)},Ke.prototype.has=function(e){return this.__data__.has(e)},Ke.prototype.set=function(e,t){var r=this.__data__;if(r instanceof $e){var n=r.__data__;if(!Re||n.length<199)return n.push([e,t]),this;r=this.__data__=new ze(n)}return r.set(e,t),this};var tt,rt,nt=(tt=function(e,t){return e&&ot(e,t,Kt)},function(e,t){if(null==e)return e;if(!Lt(e))return tt(e,t);for(var r=e.length,n=rt?r:-1,o=Object(e);(rt?n--:++n<r)&&!1!==t(o[n],n,o););return e}),ot=function(e){return function(t,r,n){for(var o=-1,i=Object(t),s=n(t),a=s.length;a--;){var l=s[e?a:++o];if(!1===r(i[l],l,i))break}return t}}();function it(e,t){for(var n=0,o=(t=Tt(t,e)?[t]:pt(t)).length;null!=e&&n<o;)e=e[At(t[n++])];return n&&n==o?e:r}function st(e,t){return null!=e&&t in Object(e)}function at(e,t,n,o,u){return e===t||(null==e||null==t||!Bt(e)&&!Ft(t)?e!=e&&t!=t:function(e,t,n,o,u,d){var f=Mt(e),w=Mt(t),N=s,_=s;f||(N=(N=wt(e))==i?m:N);w||(_=(_=wt(t))==i?m:_);var S=N==m&&!ne(e),x=_==m&&!ne(t),A=N==_;if(A&&!S)return d||(d=new Ke),f||Ht(e)?gt(e,t,n,o,u,d):function(e,t,r,n,o,i,s){switch(r){case T:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case E:return!(e.byteLength!=t.byteLength||!n(new we(e),new we(t)));case a:case l:case h:return Ct(+e,+t);case c:return e.name==t.name&&e.message==t.message;case g:case y:return e==t+"";case p:var u=oe;case v:var d=2&i;if(u||(u=se),e.size!=t.size&&!d)return!1;var m=s.get(e);if(m)return m==t;i|=1,s.set(e,t);var f=gt(u(e),u(t),n,o,i,s);return s.delete(e),f;case b:if(Ge)return Ge.call(e)==Ge.call(t)}return!1}(e,t,N,n,o,u,d);if(!(2&u)){var I=S&&me.call(e,"__wrapped__"),O=x&&me.call(t,"__wrapped__");if(I||O){var R=I?e.value():e,C=O?t.value():t;return d||(d=new Ke),n(R,C,o,u,d)}}if(!A)return!1;return d||(d=new Ke),function(e,t,n,o,i,s){var a=2&i,l=Kt(e),c=l.length,u=Kt(t),d=u.length;if(c!=d&&!a)return!1;var p=c;for(;p--;){var h=l[p];if(!(a?h in t:me.call(t,h)))return!1}var m=s.get(e);if(m&&s.get(t))return m==t;var f=!0;s.set(e,t),s.set(t,e);var g=a;for(;++p<c;){var v=e[h=l[p]],y=t[h];if(o)var b=a?o(y,v,h,t,e,s):o(v,y,h,e,t,s);if(!(b===r?v===y||n(v,y,o,i,s):b)){f=!1;break}g||(g="constructor"==h)}if(f&&!g){var w=e.constructor,E=t.constructor;w==E||!("constructor"in e)||!("constructor"in t)||"function"==typeof w&&w instanceof w&&"function"==typeof E&&E instanceof E||(f=!1)}return s.delete(e),s.delete(t),f}(e,t,n,o,u,d)}(e,t,at,n,o,u))}function lt(e){return!(!Bt(e)||(t=e,pe&&pe in t))&&(Pt(e)||ne(e)?ve:B).test(It(e));var t}function ct(e){return"function"==typeof e?e:null==e?Qt:"object"==typeof e?Mt(e)?function(e,t){if(Tt(e)&&_t(t))return St(At(e),t);return function(n){var o=zt(n,e);return o===r&&o===t?Yt(n,e):at(t,o,r,3)}}(e[0],e[1]):function(e){var t=function(e){var t=Kt(e),r=t.length;for(;r--;){var n=t[r],o=e[n];t[r]=[n,o,_t(o)]}return t}(e);if(1==t.length&&t[0][2])return St(t[0][0],t[0][1]);return function(n){return n===e||function(e,t,n,o){var i=n.length,s=i,a=!o;if(null==e)return!s;for(e=Object(e);i--;){var l=n[i];if(a&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++i<s;){var c=(l=n[i])[0],u=e[c],d=l[1];if(a&&l[2]){if(u===r&&!(c in e))return!1}else{var p=new Ke;if(o)var h=o(u,d,c,e,t,p);if(!(h===r?at(d,u,o,3,p):h))return!1}}return!0}(n,e,t)}}(e):er(e)}function ut(e){if(!Bt(e))return function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}(e);var t=Nt(e),r=[];for(var n in e)("constructor"!=n||!t&&me.call(e,n))&&r.push(n);return r}function dt(e,t,n,o,i){if(e!==t){if(!Mt(t)&&!Ht(t))var s=ut(t);ee(s||t,(function(a,l){if(s&&(a=t[l=a]),Bt(a))i||(i=new Ke),function(e,t,n,o,i,s,a){var l=e[n],c=t[n],u=a.get(c);if(u)return void Xe(e,n,u);var d=s?s(l,c,n+"",e,t,a):r,p=d===r;p&&(d=c,Mt(c)||Ht(c)?Mt(l)?d=l:kt(l)?d=mt(l):(p=!1,d=et(c,!0)):jt(c)||Dt(c)?Dt(l)?d=Vt(l):!Bt(l)||o&&Pt(l)?(p=!1,d=et(c,!0)):d=l:p=!1);p&&(a.set(c,d),i(d,c,o,s,a),a.delete(c));Xe(e,n,d)}(e,t,l,n,dt,o,i);else{var c=o?o(e[l],a,l+"",e,t,i):r;c===r&&(c=a),Xe(e,l,c)}}))}}function pt(e){return Mt(e)?e:xt(e)}function ht(e){var t=new e.constructor(e.byteLength);return new we(t).set(new we(e)),t}function mt(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}function ft(e,t,n,o){n||(n={});for(var i=-1,s=t.length;++i<s;){var a=t[i],l=o?o(n[a],e[a],a,n,e):r;Qe(n,a,l===r?e[a]:l)}return n}function gt(e,t,n,o,i,s){var a=2&i,l=e.length,c=t.length;if(l!=c&&!(a&&c>l))return!1;var u=s.get(e);if(u&&s.get(t))return u==t;var d=-1,p=!0,h=1&i?new Ye:r;for(s.set(e,t),s.set(t,e);++d<l;){var m=e[d],f=t[d];if(o)var g=a?o(f,m,d,t,e,s):o(m,f,d,e,t,s);if(g!==r){if(g)continue;p=!1;break}if(h){if(!re(t,(function(e,t){if(!h.has(t)&&(m===e||n(m,e,o,i,s)))return h.add(t)}))){p=!1;break}}else if(m!==f&&!n(m,f,o,i,s)){p=!1;break}}return s.delete(e),s.delete(t),p}function vt(e,t){var r,n,o=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof t?"string":"hash"]:o.map}function yt(e,t){var n=function(e,t){return null==e?r:e[t]}(e,t);return lt(n)?n:r}var bt=Se?ie(Se,Object):tr,wt=function(e){return ge.call(e)};function Et(e,t){return!!(t=null==t?o:t)&&("number"==typeof e||F.test(e))&&e>-1&&e%1==0&&e<t}function Tt(e,t){if(Mt(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!Gt(e))||(L.test(e)||!M.test(e)||null!=t&&e in Object(t))}function Nt(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ue)}function _t(e){return e==e&&!Bt(e)}function St(e,t){return function(n){return null!=n&&(n[e]===t&&(t!==r||e in Object(n)))}}(Oe&&wt(new Oe(new ArrayBuffer(1)))!=T||Re&&wt(new Re)!=p||Ce&&wt(Ce.resolve())!=f||De&&wt(new De)!=v||Me&&wt(new Me)!=w)&&(wt=function(e){var t=ge.call(e),n=t==m?e.constructor:r,o=n?It(n):r;if(o)switch(o){case Ue:return T;case Pe:return p;case qe:return f;case Be:return v;case Fe:return w}return t});var xt=Rt((function(e){e=$t(e);var t=[];return k.test(e)&&t.push(""),e.replace(U,(function(e,r,n,o){t.push(n?o.replace(P,"$1"):r||e)})),t}));function At(e){if("string"==typeof e||Gt(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function It(e){if(null!=e){try{return he.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function Ot(e,t){return(Mt(e)?ee:nt)(e,function(){var e=He.iteratee||Zt;return e=e===Zt?ct:e,arguments.length?e(arguments[0],arguments[1]):e}(t,3))}function Rt(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var s=e.apply(this,n);return r.cache=i.set(o,s),s};return r.cache=new(Rt.Cache||ze),r}function Ct(e,t){return e===t||e!=e&&t!=t}function Dt(e){return kt(e)&&me.call(e,"callee")&&(!Ne.call(e,"callee")||ge.call(e)==i)}Rt.Cache=ze;var Mt=Array.isArray;function Lt(e){return null!=e&&qt(e.length)&&!Pt(e)}function kt(e){return Ft(e)&&Lt(e)}var Ut=xe||rr;function Pt(e){var t=Bt(e)?ge.call(e):"";return t==u||t==d}function qt(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}function Bt(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Ft(e){return!!e&&"object"==typeof e}function jt(e){if(!Ft(e)||ge.call(e)!=m||ne(e))return!1;var t=Ee(e);if(null===t)return!0;var r=me.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&he.call(r)==fe}function Gt(e){return"symbol"==typeof e||Ft(e)&&ge.call(e)==b}var Wt,Ht=X?(Wt=X,function(e){return Wt(e)}):function(e){return Ft(e)&&qt(e.length)&&!!j[ge.call(e)]};function Vt(e){return ft(e,Jt(e))}function $t(e){return null==e?"":function(e){if("string"==typeof e)return e;if(Gt(e))return We?We.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)}function zt(e,t,n){var o=null==e?r:it(e,t);return o===r?n:o}function Yt(e,t){return null!=e&&function(e,t,r){for(var n,o=-1,i=(t=Tt(t,e)?[t]:pt(t)).length;++o<i;){var s=At(t[o]);if(!(n=null!=e&&r(e,s)))break;e=e[s]}return n||!!(i=e?e.length:0)&&qt(i)&&Et(s,i)&&(Mt(e)||Dt(e))}(e,t,st)}function Kt(e){return Lt(e)?Je(e):function(e){if(!Nt(e))return Ae(e);var t=[];for(var r in Object(e))me.call(e,r)&&"constructor"!=r&&t.push(r);return t}(e)}function Jt(e){return Lt(e)?Je(e,!0):ut(e)}var Xt=function(e){return t=function(t,n){var o=-1,i=n.length,s=i>1?n[i-1]:r,a=i>2?n[2]:r;for(s=e.length>3&&"function"==typeof s?(i--,s):r,a&&function(e,t,r){if(!Bt(r))return!1;var n=typeof t;return!!("number"==n?Lt(r)&&Et(t,r.length):"string"==n&&t in r)&&Ct(r[t],e)}(n[0],n[1],a)&&(s=i<3?r:s,i=1),t=Object(t);++o<i;){var l=n[o];l&&e(t,l,o,s)}return t},n=Ie(n===r?t.length-1:n,0),function(){for(var e=arguments,r=-1,o=Ie(e.length-n,0),i=Array(o);++r<o;)i[r]=e[n+r];r=-1;for(var s=Array(n+1);++r<n;)s[r]=e[r];return s[n]=i,function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}(t,this,s)};var t,n}((function(e,t,r){dt(e,t,r)}));function Qt(e){return e}function Zt(e){return ct("function"==typeof e?e:et(e,!0))}function er(e){return Tt(e)?function(e){return function(t){return null==t?r:t[e]}}(At(e)):function(e){return function(t){return it(t,e)}}(e)}function tr(){return[]}function rr(){return!1}He.compact=function(e){for(var t=-1,r=e?e.length:0,n=0,o=[];++t<r;){var i=e[t];i&&(o[n++]=i)}return o},He.iteratee=Zt,He.keys=Kt,He.keysIn=Jt,He.memoize=Rt,He.merge=Xt,He.property=er,He.toPlainObject=Vt,He.clone=function(e){return et(e,!1,!0)},He.eq=Ct,He.forEach=Ot,He.get=zt,He.hasIn=Yt,He.identity=Qt,He.isArguments=Dt,He.isArray=Mt,He.isArrayLike=Lt,He.isArrayLikeObject=kt,He.isBuffer=Ut,He.isEmpty=function(e){if(Lt(e)&&(Mt(e)||"string"==typeof e||"function"==typeof e.splice||Ut(e)||Dt(e)))return!e.length;var t=wt(e);if(t==p||t==v)return!e.size;if(ke||Nt(e))return!Ae(e).length;for(var r in e)if(me.call(e,r))return!1;return!0},He.isFunction=Pt,He.isLength=qt,He.isObject=Bt,He.isObjectLike=Ft,He.isPlainObject=jt,He.isSymbol=Gt,He.isTypedArray=Ht,He.stubArray=tr,He.stubFalse=rr,He.toString=$t,He.each=Ot,He.VERSION="4.15.0",z&&((z.exports=He)._=He,$._=He)}).call(x)}(We,We.exports);var He=function e(t,r){var n,o=t&&t.type;if("FeatureCollection"===o)for(n=0;n<t.features.length;n++)e(t.features[n],r);else if("GeometryCollection"===o)for(n=0;n<t.geometries.length;n++)e(t.geometries[n],r);else if("Feature"===o)e(t.geometry,r);else if("Polygon"===o)Ve(t.coordinates,r);else if("MultiPolygon"===o)for(n=0;n<t.coordinates.length;n++)Ve(t.coordinates[n],r);return t};function Ve(e,t){if(0!==e.length){$e(e[0],t);for(var r=1;r<e.length;r++)$e(e[r],!t)}}function $e(e,t){for(var r=0,n=0,o=0,i=e.length,s=i-1;o<i;s=o++){var a=(e[o][0]-e[s][0])*(e[s][1]+e[o][1]),l=r+a;n+=Math.abs(r)>=Math.abs(a)?r-l+a:a-l+r,r=l}r+n>=0!=!!t&&e.reverse()}var ze=We.exports,Ye=He,Ke={};function Je(e,t){return(e.version||t.version)&&e.version!==t.version?(+e.version||0)>(+t.version||0)?e:t:ze.merge(e,t)}[{key:"building",polygon:"all"},{key:"highway",polygon:"whitelist",values:["services","rest_area","escape","elevator"]},{key:"natural",polygon:"blacklist",values:["coastline","cliff","ridge","arete","tree_row"]},{key:"landuse",polygon:"all"},{key:"waterway",polygon:"whitelist",values:["riverbank","dock","boatyard","dam"]},{key:"amenity",polygon:"all"},{key:"leisure",polygon:"all"},{key:"barrier",polygon:"whitelist",values:["city_wall","ditch","hedge","retaining_wall","wall","spikes"]},{key:"railway",polygon:"whitelist",values:["station","turntable","roundhouse","platform"]},{key:"area",polygon:"all"},{key:"boundary",polygon:"all"},{key:"man_made",polygon:"blacklist",values:["cutline","embankment","pipeline"]},{key:"power",polygon:"whitelist",values:["plant","substation","generator","transformer"]},{key:"place",polygon:"all"},{key:"shop",polygon:"all"},{key:"aeroway",polygon:"blacklist",values:["taxiway"]},{key:"tourism",polygon:"all"},{key:"historic",polygon:"all"},{key:"public_transport",polygon:"all"},{key:"office",polygon:"all"},{key:"building:part",polygon:"all"},{key:"military",polygon:"all"},{key:"ruins",polygon:"all"},{key:"area:highway",polygon:"all"},{key:"craft",polygon:"all"},{key:"golf",polygon:"all"},{key:"indoor",polygon:"all"}].forEach((function(e){if("all"===e.polygon)Ke[e.key]=!0;else{var t="whitelist"===e.polygon?"included_values":"excluded_values",r={};e.values.forEach((function(e){r[e]=!0})),Ke[e.key]={},Ke[e.key][t]=r}}));var Xe;function Qe(e){for(var t,r,n,o,i,s,a=function(e){return e[0]},l=function(e){return e[e.length-1]},c=function(e,t){return void 0!==e&&void 0!==t&&e.id===t.id},u=[];e.length;)for(t=e.pop().nodes.slice(),u.push(t);e.length&&!c(a(t),l(t));){for(r=a(t),n=l(t),o=0;o<e.length;o++){if(c(n,a(s=e[o].nodes))){i=t.push,s=s.slice(1);break}if(c(n,l(s))){i=t.push,s=s.slice(0,-1).reverse();break}if(c(r,l(s))){i=t.unshift,s=s.slice(0,-1);break}if(c(r,a(s))){i=t.unshift,s=s.slice(1).reverse();break}s=i=null}if(!s)break;e.splice(o,1),i.apply(t,s)}return u}Xe=function(e,t,r){var n;return t=ze.merge({verbose:!1,flatProperties:!0,uninterestingTags:{source:!0,source_ref:!0,"source:ref":!0,history:!0,attribution:!0,created_by:!0,"tiger:county":!0,"tiger:tlid":!0,"tiger:upload_uuid":!0},polygonFeatures:Ke,deduplicator:Je},t),n="undefined"!=typeof XMLDocument&&e instanceof XMLDocument||"undefined"==typeof XMLDocument&&e.childNodes?function(e){var t,r,n=new Array,i=new Array,s=new Array;function a(e,t,r){e.hasAttribute(r)&&(t[r]=e.getAttribute(r))}function l(e,t){var r=ze.clone(e);a(t,r,"lat"),a(t,r,"lon"),r.__is_center_placeholder=!0,n.push(r)}function c(e,t){var r=ze.clone(e);function o(e,t,o){var i={type:"node",id:"_"+r.type+"/"+r.id+"bounds"+o,lat:e,lon:t};r.nodes.push(i.id),n.push(i)}r.nodes=[],o(t.getAttribute("minlat"),t.getAttribute("minlon"),1),o(t.getAttribute("maxlat"),t.getAttribute("minlon"),2),o(t.getAttribute("maxlat"),t.getAttribute("maxlon"),3),o(t.getAttribute("minlat"),t.getAttribute("maxlon"),4),r.nodes.push(r.nodes[0]),r.__is_bounds_placeholder=!0,i.push(r)}return ze.each(e.getElementsByTagName("node"),(function(e,t){var r={};ze.each(e.getElementsByTagName("tag"),(function(e){r[e.getAttribute("k")]=e.getAttribute("v")}));var o={type:"node"};a(e,o,"id"),a(e,o,"lat"),a(e,o,"lon"),a(e,o,"version"),a(e,o,"timestamp"),a(e,o,"changeset"),a(e,o,"uid"),a(e,o,"user"),ze.isEmpty(r)||(o.tags=r),n.push(o)})),ze.each(e.getElementsByTagName("way"),(function(e,o){var s={},u=[];ze.each(e.getElementsByTagName("tag"),(function(e){s[e.getAttribute("k")]=e.getAttribute("v")}));var d=!1;ze.each(e.getElementsByTagName("nd"),(function(e,t){var r;(r=e.getAttribute("ref"))&&(u[t]=r),!d&&e.getAttribute("lat")&&(d=!0)}));var p={type:"way"};a(e,p,"id"),a(e,p,"version"),a(e,p,"timestamp"),a(e,p,"changeset"),a(e,p,"uid"),a(e,p,"user"),u.length>0&&(p.nodes=u),ze.isEmpty(s)||(p.tags=s),(t=e.getElementsByTagName("center")[0])&&l(p,t),d?function(e,t){function r(e,t,r){var o={type:"node",id:r,lat:e,lon:t};return n.push(o),o.id}ze.isArray(e.nodes)||(e.nodes=[],ze.each(t,(function(t,r){e.nodes.push("_anonymous@"+t.getAttribute("lat")+"/"+t.getAttribute("lon"))})));ze.each(t,(function(t,n){t.getAttribute("lat")&&r(t.getAttribute("lat"),t.getAttribute("lon"),e.nodes[n])}))}(p,e.getElementsByTagName("nd")):(r=e.getElementsByTagName("bounds")[0])&&c(p,r),i.push(p)})),ze.each(e.getElementsByTagName("relation"),(function(e,o){var u={},d=[];ze.each(e.getElementsByTagName("tag"),(function(e){u[e.getAttribute("k")]=e.getAttribute("v")}));var p=!1;ze.each(e.getElementsByTagName("member"),(function(e,t){d[t]={},a(e,d[t],"ref"),a(e,d[t],"role"),a(e,d[t],"type"),(!p&&"node"==d[t].type&&e.getAttribute("lat")||"way"==d[t].type&&e.getElementsByTagName("nd").length>0)&&(p=!0)}));var h={type:"relation"};a(e,h,"id"),a(e,h,"version"),a(e,h,"timestamp"),a(e,h,"changeset"),a(e,h,"uid"),a(e,h,"user"),d.length>0&&(h.members=d),ze.isEmpty(u)||(h.tags=u),(t=e.getElementsByTagName("center")[0])&&l(h,t),p?function(e,t){function r(e,t,r){var o={type:"node",id:r,lat:e,lon:t};n.push(o)}function o(e,t){if(!i.some((function(e){return"way"==e.type&&e.id==t}))){var r={type:"way",id:t,nodes:[]};ze.each(e,(function(e){e.getAttribute("lat")?o(e.getAttribute("lat"),e.getAttribute("lon")):r.nodes.push(void 0)})),i.push(r)}function o(e,t){var o={type:"node",id:"_anonymous@"+e+"/"+t,lat:e,lon:t};r.nodes.push(o.id),n.push(o)}}ze.each(t,(function(t,n){"node"==e.members[n].type?t.getAttribute("lat")&&r(t.getAttribute("lat"),t.getAttribute("lon"),e.members[n].ref):"way"==e.members[n].type&&t.getElementsByTagName("nd").length>0&&(e.members[n].ref="_fullGeom"+e.members[n].ref,o(t.getElementsByTagName("nd"),e.members[n].ref))}))}(h,e.getElementsByTagName("member")):(r=e.getElementsByTagName("bounds")[0])&&c(h,r),s.push(h)})),o(n,i,s)}(e):function(e){var t=new Array,r=new Array,n=new Array;function i(e){var r=ze.clone(e);r.lat=e.center.lat,r.lon=e.center.lon,r.__is_center_placeholder=!0,t.push(r)}function s(e){var n=ze.clone(e);function o(e,r,o){var i={type:"node",id:"_"+n.type+"/"+n.id+"bounds"+o,lat:e,lon:r};n.nodes.push(i.id),t.push(i)}n.nodes=[],o(n.bounds.minlat,n.bounds.minlon,1),o(n.bounds.maxlat,n.bounds.minlon,2),o(n.bounds.maxlat,n.bounds.maxlon,3),o(n.bounds.minlat,n.bounds.maxlon,4),n.nodes.push(n.nodes[0]),n.__is_bounds_placeholder=!0,r.push(n)}function a(e){ze.isArray(e.nodes)||(e.nodes=e.geometry.map((function(e){return null!==e?"_anonymous@"+e.lat+"/"+e.lon:"_anonymous@unknown_location"}))),e.geometry.forEach((function(r,n){var o,i,s,a;r&&(o=r.lat,i=r.lon,s=e.nodes[n],a={type:"node",id:s,lat:o,lon:i},t.push(a))}))}function l(e){function n(e,n){if(!r.some((function(e){return"way"==e.type&&e.id==n}))){var o={type:"way",id:n,nodes:[]};e.forEach((function(e){var r,n,i;e?(r=e.lat,n=e.lon,i={type:"node",id:"_anonymous@"+r+"/"+n,lat:r,lon:n},o.nodes.push(i.id),t.push(i)):o.nodes.push(void 0)})),r.push(o)}}e.members.forEach((function(e,r){var o,i,s,a;"node"==e.type?e.lat&&(o=e.lat,i=e.lon,s=e.ref,a={type:"node",id:s,lat:o,lon:i},t.push(a)):"way"==e.type&&e.geometry&&(e.ref="_fullGeom"+e.ref,n(e.geometry,e.ref))}))}for(var c=0;c<e.elements.length;c++)switch(e.elements[c].type){case"node":var u=e.elements[c];t.push(u);break;case"way":var d=ze.clone(e.elements[c]);d.nodes=ze.clone(d.nodes),r.push(d),d.center&&i(d),d.geometry?a(d):d.bounds&&s(d);break;case"relation":var p=ze.clone(e.elements[c]);p.members=ze.clone(p.members),n.push(p);var h=p.members&&p.members.some((function(e){return"node"==e.type&&e.lat||"way"==e.type&&e.geometry&&e.geometry.length>0}));p.center&&i(p),h?l(p):p.bounds&&s(p)}return o(t,r,n)}(e),n;function o(e,n,o){function s(e,r){if("object"!=typeof r&&(r={}),"function"==typeof t.uninterestingTags)return!t.uninterestingTags(e,r);for(var n in e)if(!0!==t.uninterestingTags[n]&&!0!==r[n]&&r[n]!==e[n])return!0;return!1}function a(e){var t={timestamp:e.timestamp,version:e.version,changeset:e.changeset,user:e.user,uid:e.uid};for(var r in t)void 0===t[r]&&delete t[r];return t}for(var l=new Object,c=new Object,u=0;u<e.length;u++){void 0!==l[(v=e[u]).id]&&(v=t.deduplicator(v,l[v.id])),l[v.id]=v,void 0!==v.tags&&s(v.tags)&&(c[v.id]=!0)}for(u=0;u<o.length;u++)if(ze.isArray(o[u].members))for(var d=0;d<o[u].members.length;d++)"node"==o[u].members[d].type&&(c[o[u].members[d].ref]=!0);var p=new Object,h=new Object;for(u=0;u<n.length;u++){var m=n[u];if(p[m.id]&&(m=t.deduplicator(m,p[m.id])),p[m.id]=m,ze.isArray(m.nodes))for(d=0;d<m.nodes.length;d++)"object"!=typeof m.nodes[d]&&(h[m.nodes[d]]=!0,m.nodes[d]=l[m.nodes[d]])}var f=new Array;for(var g in l){var v=l[g];h[g]&&!c[g]||f.push(v)}var y=new Array;for(u=0;u<o.length;u++){y[(E=o[u]).id]&&(E=t.deduplicator(E,y[E.id])),y[E.id]=E}var b,w={node:{},way:{},relation:{}};for(var g in y){var E=y[g];if(ze.isArray(E.members))for(d=0;d<E.members.length;d++){var T=E.members[d].type,N=E.members[d].ref;"number"!=typeof N&&(N=N.replace("_fullGeom","")),w[T]?(void 0===w[T][N]&&(w[T][N]=[]),w[T][N].push({role:E.members[d].role,rel:E.id,reltags:E.tags})):t.verbose&&console.warn("Relation",E.type+"/"+E.id,"member",T+"/"+N,"ignored because it has an invalid type")}else t.verbose&&console.warn("Relation",E.type+"/"+E.id,"ignored because it has no members")}var _=[];for(u=0;u<f.length;u++)if(void 0!==f[u].lon&&void 0!==f[u].lat){var S={type:"Feature",id:f[u].type+"/"+f[u].id,properties:{type:f[u].type,id:f[u].id,tags:f[u].tags||{},relations:w.node[f[u].id]||[],meta:a(f[u])},geometry:{type:"Point",coordinates:[+f[u].lon,+f[u].lat]}};f[u].__is_center_placeholder&&(S.properties.geometry="center"),r?r(S):_.push(S)}else t.verbose&&console.warn("POI",f[u].type+"/"+f[u].id,"ignored because it lacks coordinates");var x=[],A=[];for(u=0;u<o.length;u++)if(y[o[u].id]===o[u]){if(void 0!==o[u].tags&&("route"==o[u].tags.type||"waterway"==o[u].tags.type)){let e=function(e){var r,n,o=!1;r=(r=e.members.filter((function(e){return"way"===e.type}))).map((function(r){var n=p[r.ref];return void 0===n||void 0===n.nodes?(t.verbose&&console.warn("Route "+e.type+"/"+e.id,"tainted by a missing or incomplete way",r.type+"/"+r.ref),void(o=!0)):{id:r.ref,role:r.role,way:n,nodes:n.nodes.filter((function(n){return void 0!==n||(o=!0,t.verbose&&console.warn("Route",e.type+"/"+e.id,"tainted by a way",r.type+"/"+r.ref,"with a missing node"),!1)}))}})),n=Qe(r=ze.compact(r));var i;if(0==(i=ze.compact(n.map((function(e){return ze.compact(e.map((function(e){return[+e.lon,+e.lat]})))})))).length)return t.verbose&&console.warn("Route",e.type+"/"+e.id,"contains no coordinates"),!1;var s={type:"Feature",id:e.type+"/"+e.id,properties:{type:e.type,id:e.id,tags:e.tags||{},relations:w[e.type][e.id]||[],meta:a(e)},geometry:{type:1===i.length?"LineString":"MultiLineString",coordinates:1===i.length?i[0]:i}};return o&&(t.verbose&&console.warn("Route",e.type+"/"+e.id,"is tainted"),s.properties.tainted=!0),s};if(!ze.isArray(o[u].members)){t.verbose&&console.warn("Route",o[u].type+"/"+o[u].id,"ignored because it has no members");continue}if(o[u].members.forEach((function(e){p[e.ref]&&!s(p[e.ref].tags)&&(p[e.ref].is_skippablerelationmember=!0)})),!1===(S=e(o[u]))){t.verbose&&console.warn("Route relation",o[u].type+"/"+o[u].id,"ignored because it has invalid geometry");continue}r?r(Ye(S)):A.push(S)}if(void 0!==o[u].tags&&("multipolygon"==o[u].tags.type||"boundary"==o[u].tags.type)){let e=function(e,r){var n,o,i,s,l=!1,c=O?"way":"relation",u="number"==typeof e.id?e.id:+e.id.replace("_fullGeom","");function d(e){var t,r=function(e,t){for(var r=0;r<t.length;r++)if(i(t[r],e))return!0;return!1},n=function(e){return e.map((function(e){return[+e.lat,+e.lon]}))},i=function(e,t){for(var r=e[0],n=e[1],o=!1,i=0,s=t.length-1;i<t.length;s=i++){var a=t[i][0],l=t[i][1],c=t[s][0],u=t[s][1];l>n!=u>n&&r<(c-a)*(n-l)/(u-l)+a&&(o=!o)}return o};for(e=n(e),t=0;t<o.length;t++)if(r(n(o[t]),e))return t}n=(n=r.members.filter((function(e){return"way"===e.type}))).map((function(e){var r=p[e.ref];return void 0===r||void 0===r.nodes?(t.verbose&&console.warn("Multipolygon",c+"/"+u,"tainted by a missing or incomplete way",e.type+"/"+e.ref),void(l=!0)):{id:e.ref,role:e.role||"outer",way:r,nodes:r.nodes.filter((function(r){return void 0!==r||(l=!0,t.verbose&&console.warn("Multipolygon",c+"/"+u,"tainted by a way",e.type+"/"+e.ref,"with a missing node"),!1)}))}})),n=ze.compact(n),o=Qe(n.filter((function(e){return"outer"===e.role}))),i=Qe(n.filter((function(e){return"inner"===e.role}))),s=o.map((function(e){return[e]}));for(var h=0;h<i.length;h++){var m=d(i[h]);void 0!==m?s[m].push(i[h]):t.verbose&&console.warn("Multipolygon",c+"/"+u,"contains an inner ring with no containing outer")}var f=[];if(0==(f=ze.compact(s.map((function(e){var r=ze.compact(e.map((function(e){if(!(e.length<4))return ze.compact(e.map((function(e){return[+e.lon,+e.lat]})));t.verbose&&console.warn("Multipolygon",c+"/"+u,"contains a ring with less than four nodes")})));if(0!=r.length)return r;t.verbose&&console.warn("Multipolygon",c+"/"+u,"contains an empty ring cluster")})))).length)return t.verbose&&console.warn("Multipolygon",c+"/"+u,"contains no coordinates"),!1;var g="MultiPolygon";1===f.length&&(g="Polygon",f=f[0]);var v={type:"Feature",id:e.type+"/"+u,properties:{type:e.type,id:u,tags:e.tags||{},relations:w[e.type][e.id]||[],meta:a(e)},geometry:{type:g,coordinates:f}};return l&&(t.verbose&&console.warn("Multipolygon",c+"/"+u,"is tainted"),v.properties.tainted=!0),v};if(!ze.isArray(o[u].members)){t.verbose&&console.warn("Multipolygon",o[u].type+"/"+o[u].id,"ignored because it has no members");continue}var I=0;for(d=0;d<o[u].members.length;d++)"outer"==o[u].members[d].role?I++:t.verbose&&"inner"!=o[u].members[d].role&&console.warn("Multipolygon",o[u].type+"/"+o[u].id,"member",o[u].members[d].type+"/"+o[u].members[d].ref,'ignored because it has an invalid role: "'+o[u].members[d].role+'"');if(o[u].members.forEach((function(e){p[e.ref]&&("outer"!==e.role||s(p[e.ref].tags,o[u].tags)||(p[e.ref].is_skippablerelationmember=!0),"inner"!==e.role||s(p[e.ref].tags)||(p[e.ref].is_skippablerelationmember=!0))})),0==I){t.verbose&&console.warn("Multipolygon relation",o[u].type+"/"+o[u].id,"ignored because it has no outer ways");continue}var O=!1;1!=I||s(o[u].tags,{type:!0})||(O=!0);S=null;if(O){var R=o[u].members.filter((function(e){return"outer"===e.role}))[0];if(void 0===(R=p[R.ref])){t.verbose&&console.warn("Multipolygon relation",o[u].type+"/"+o[u].id,"ignored because outer way",R.type+"/"+R.ref,"is missing");continue}R.is_skippablerelationmember=!0,S=e(R,o[u])}else S=e(o[u],o[u]);if(!1===S){t.verbose&&console.warn("Multipolygon relation",o[u].type+"/"+o[u].id,"ignored because it has invalid geometry");continue}r?r(Ye(S)):A.push(S)}}for(u=0;u<n.length;u++)if(p[n[u].id]===n[u])if(ze.isArray(n[u].nodes)){if(!n[u].is_skippablerelationmember){"number"!=typeof n[u].id&&(n[u].id=+n[u].id.replace("_fullGeom","")),n[u].tainted=!1,n[u].hidden=!1;var C=new Array;for(d=0;d<n[u].nodes.length;d++)"object"==typeof n[u].nodes[d]?C.push([+n[u].nodes[d].lon,+n[u].nodes[d].lat]):(t.verbose&&console.warn("Way",n[u].type+"/"+n[u].id,"is tainted by an invalid node"),n[u].tainted=!0);if(C.length<=1)t.verbose&&console.warn("Way",n[u].type+"/"+n[u].id,"ignored because it contains too few nodes");else{var D="LineString";void 0!==n[u].nodes[0]&&void 0!==n[u].nodes[n[u].nodes.length-1]&&n[u].nodes[0].id===n[u].nodes[n[u].nodes.length-1].id&&(void 0!==n[u].tags&&i(n[u].tags)||n[u].__is_bounds_placeholder)&&(D="Polygon",C=[C]);S={type:"Feature",id:n[u].type+"/"+n[u].id,properties:{type:n[u].type,id:n[u].id,tags:n[u].tags||{},relations:w.way[n[u].id]||[],meta:a(n[u])},geometry:{type:D,coordinates:C}};n[u].tainted&&(t.verbose&&console.warn("Way",n[u].type+"/"+n[u].id,"is tainted"),S.properties.tainted=!0),n[u].__is_bounds_placeholder&&(S.properties.geometry="bounds"),r?r(Ye(S)):"LineString"==D?x.push(S):A.push(S)}}}else t.verbose&&console.warn("Way",n[u].type+"/"+n[u].id,"ignored because it has no nodes");return!!r||((b={type:"FeatureCollection",features:[]}).features=b.features.concat(A),b.features=b.features.concat(x),b.features=b.features.concat(_),t.flatProperties&&b.features.forEach((function(e){e.properties=ze.merge(e.properties.meta,e.properties.tags,{id:e.properties.type+"/"+e.properties.id})})),b=Ye(b))}function i(e){var r=t.polygonFeatures;if("function"==typeof r)return r(e);if("no"===e.area)return!1;for(var n in e){var o=e[n],i=r[n];if(void 0!==i&&"no"!==o){if(!0===i)return!0;if(i.included_values&&!0===i.included_values[o])return!0;if(i.excluded_values&&!0!==i.excluded_values[o])return!0}}return!1}},Xe.toGeojson=Xe;const Ze=A(Xe);var et={};function tt(e,t){return void 0===t&&(t=Object),t&&"function"==typeof t.getOwnPropertyDescriptors&&(e=t.create(null,t.getOwnPropertyDescriptors(e))),t&&"function"==typeof t.freeze?t.freeze(e):e}function rt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var nt=tt({allowfullscreen:!0,async:!0,autofocus:!0,autoplay:!0,checked:!0,controls:!0,default:!0,defer:!0,disabled:!0,formnovalidate:!0,hidden:!0,ismap:!0,itemscope:!0,loop:!0,multiple:!0,muted:!0,nomodule:!0,novalidate:!0,open:!0,playsinline:!0,readonly:!0,required:!0,reversed:!0,selected:!0});var ot=tt({area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});var it=tt({script:!1,style:!1,textarea:!0,title:!0});function st(e){return e===at.HTML}var at=tt({HTML:"text/html",XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),lt=Object.keys(at).map((function(e){return at[e]}));var ct=tt({HTML:"http://www.w3.org/1999/xhtml",SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});et.assign=function(e,t){if(null===e||"object"!=typeof e)throw new TypeError("target is not an object");for(var r in t)rt(t,r)&&(e[r]=t[r]);return e},et.find=function(e,t,r){if(void 0===r&&(r=Array.prototype),e&&"function"==typeof r.find)return r.find.call(e,t);for(var n=0;n<e.length;n++)if(rt(e,n)){var o=e[n];if(t.call(void 0,o,n,e))return o}},et.freeze=tt,et.HTML_BOOLEAN_ATTRIBUTES=nt,et.HTML_RAW_TEXT_ELEMENTS=it,et.HTML_VOID_ELEMENTS=ot,et.hasDefaultHTMLNamespace=function(e){return st(e)||e===at.XML_XHTML_APPLICATION},et.hasOwn=rt,et.isHTMLBooleanAttribute=function(e){return rt(nt,e.toLowerCase())},et.isHTMLRawTextElement=function(e){var t=e.toLowerCase();return rt(it,t)&&!it[t]},et.isHTMLEscapableRawTextElement=function(e){var t=e.toLowerCase();return rt(it,t)&&it[t]},et.isHTMLMimeType=st,et.isHTMLVoidElement=function(e){return rt(ot,e.toLowerCase())},et.isValidMimeType=function(e){return lt.indexOf(e)>-1},et.MIME_TYPE=at,et.NAMESPACE=ct;var ut={};function dt(e,t){e.prototype=Object.create(Error.prototype,{constructor:{value:e},name:{value:e.name,enumerable:!0,writable:t}})}var pt=et.freeze({Error:"Error",IndexSizeError:"IndexSizeError",DomstringSizeError:"DomstringSizeError",HierarchyRequestError:"HierarchyRequestError",WrongDocumentError:"WrongDocumentError",InvalidCharacterError:"InvalidCharacterError",NoDataAllowedError:"NoDataAllowedError",NoModificationAllowedError:"NoModificationAllowedError",NotFoundError:"NotFoundError",NotSupportedError:"NotSupportedError",InUseAttributeError:"InUseAttributeError",InvalidStateError:"InvalidStateError",SyntaxError:"SyntaxError",InvalidModificationError:"InvalidModificationError",NamespaceError:"NamespaceError",InvalidAccessError:"InvalidAccessError",ValidationError:"ValidationError",TypeMismatchError:"TypeMismatchError",SecurityError:"SecurityError",NetworkError:"NetworkError",AbortError:"AbortError",URLMismatchError:"URLMismatchError",QuotaExceededError:"QuotaExceededError",TimeoutError:"TimeoutError",InvalidNodeTypeError:"InvalidNodeTypeError",DataCloneError:"DataCloneError",EncodingError:"EncodingError",NotReadableError:"NotReadableError",UnknownError:"UnknownError",ConstraintError:"ConstraintError",DataError:"DataError",TransactionInactiveError:"TransactionInactiveError",ReadOnlyError:"ReadOnlyError",VersionError:"VersionError",OperationError:"OperationError",NotAllowedError:"NotAllowedError",OptOutError:"OptOutError"}),ht=Object.keys(pt);function mt(e){return"number"==typeof e&&e>=1&&e<=25}function ft(e,t){var r;mt(e)?(this.name=ht[e],this.message=t||""):(this.message=e,this.name="string"==typeof(r=t)&&r.substring(r.length-pt.Error.length)===pt.Error?t:pt.Error),Error.captureStackTrace&&Error.captureStackTrace(this,ft)}dt(ft,!0),Object.defineProperties(ft.prototype,{code:{enumerable:!0,get:function(){var e=ht.indexOf(this.name);return mt(e)?e:0}}});for(var gt={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25},vt=Object.entries(gt),yt=0;yt<vt.length;yt++){ft[vt[yt][0]]=vt[yt][1]}function bt(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,bt)}dt(bt),ut.DOMException=ft,ut.DOMExceptionName=pt,ut.ExceptionCode=gt,ut.ParseError=bt;var wt={},Et={};function Tt(e){try{"function"!=typeof e&&(e=RegExp);var t=new e("𝌆","u").exec("𝌆");return!!t&&2===t[0].length}catch(r){}return!1}var Nt=Tt();function _t(e){if("["!==e.source[0])throw new Error(e+" can not be used with chars");return e.source.slice(1,e.source.lastIndexOf("]"))}function St(e,t){if("["!==e.source[0])throw new Error("/"+e.source+"/ can not be used with chars_without");if(!t||"string"!=typeof t)throw new Error(JSON.stringify(t)+" is not a valid search");if(-1===e.source.indexOf(t))throw new Error('"'+t+'" is not is /'+e.source+"/");if("-"===t&&1!==e.source.indexOf(t))throw new Error('"'+t+'" is not at the first postion of /'+e.source+"/");return new RegExp(e.source.replace(t,""),Nt?"u":"")}function xt(e){var t=this;return new RegExp(Array.prototype.slice.call(arguments).map((function(e){var r="string"==typeof e;if(r&&void 0===t&&"|"===e)throw new Error("use regg instead of reg to wrap expressions with `|`!");return r?e:e.source})).join(""),Nt?"mu":"m")}function At(e){if(0===arguments.length)throw new Error("no parameters provided");return xt.apply(At,["(?:"].concat(Array.prototype.slice.call(arguments),[")"]))}var It=/[-\x09\x0A\x0D\x20-\x2C\x2E-\uD7FF\uE000-\uFFFD]/;Nt&&(It=xt("[",_t(It),"\\u{10000}-\\u{10FFFF}","]"));var Ot=/[\x20\x09\x0D\x0A]/,Rt=_t(Ot),Ct=xt(Ot,"+"),Dt=xt(Ot,"*"),Mt=/[:_a-zA-Z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;Nt&&(Mt=xt("[",_t(Mt),"\\u{10000}-\\u{10FFFF}","]"));var Lt=xt("[",_t(Mt),_t(/[-.0-9\xB7]/),_t(/[\u0300-\u036F\u203F-\u2040]/),"]"),kt=xt(Mt,Lt,"*"),Ut=xt(Lt,"+"),Pt=xt("&",kt,";"),qt=At(/&#[0-9]+;|&#x[0-9a-fA-F]+;/),Bt=At(Pt,"|",qt),Ft=xt("%",kt,";"),jt=At(xt('"',At(/[^%&"]/,"|",Ft,"|",Bt),"*",'"'),"|",xt("'",At(/[^%&']/,"|",Ft,"|",Bt),"*","'")),Gt=At('"',At(/[^<&"]/,"|",Bt),"*",'"',"|","'",At(/[^<&']/,"|",Bt),"*","'"),Wt=xt(St(Mt,":"),St(Lt,":"),"*"),Ht=xt(Wt,At(":",Wt),"?"),Vt=xt("^",Ht,"$"),$t=xt("(",Ht,")"),zt=At(/"[^"]*"|'[^']*'/),Yt=xt(/^<\?/,"(",kt,")",At(Ct,"(",It,"*?)"),"?",/\?>/),Kt=/[\x20\x0D\x0Aa-zA-Z0-9-'()+,./:=?;!*#@$_%]/,Jt=At('"',Kt,'*"',"|","'",St(Kt,"'"),"*'"),Xt="\x3c!--",Qt=xt(Xt,At(St(It,"-"),"|",xt("-",St(It,"-"))),"*","--\x3e"),Zt="#PCDATA",er=At(xt(/\(/,Dt,Zt,At(Dt,/\|/,Dt,Ht),"*",Dt,/\)\*/),"|",xt(/\(/,Dt,Zt,Dt,/\)/)),tr=At("EMPTY","|","ANY","|",er,"|",xt(/\([^>]+\)/,/[?*+]?/)),rr=xt("<!ELEMENT",Ct,At(Ht,"|",Ft),Ct,At(tr,"|",Ft),Dt,">"),nr=xt("NOTATION",Ct,/\(/,Dt,kt,At(Dt,/\|/,Dt,kt),"*",Dt,/\)/),or=xt(/\(/,Dt,Ut,At(Dt,/\|/,Dt,Ut),"*",Dt,/\)/),ir=At(nr,"|",or),sr=At(/CDATA|ID|IDREF|IDREFS|ENTITY|ENTITIES|NMTOKEN|NMTOKENS/,"|",ir),ar=At(/#REQUIRED|#IMPLIED/,"|",At(At("#FIXED",Ct),"?",Gt)),lr=xt("<!ATTLIST",Ct,kt,At(Ct,kt,Ct,sr,Ct,ar),"*",Dt,">"),cr="about:legacy-compat",ur=At('"'+cr+'"',"|","'"+cr+"'"),dr="SYSTEM",pr="PUBLIC",hr=At(At(dr,Ct,zt),"|",At(pr,Ct,Jt,Ct,zt)),mr=xt("^",At(At(dr,Ct,"(?<SystemLiteralOnly>",zt,")"),"|",At(pr,Ct,"(?<PubidLiteral>",Jt,")",Ct,"(?<SystemLiteral>",zt,")"))),fr=At(Ct,"NDATA",Ct,kt),gr="<!ENTITY",vr=xt(gr,Ct,kt,Ct,At(jt,"|",At(hr,fr,"?")),Dt,">"),yr=At(jt,"|",hr),br=At(vr,"|",xt(gr,Ct,"%",Ct,kt,Ct,yr,Dt,">")),wr=xt(pr,Ct,Jt),Er=xt("<!NOTATION",Ct,kt,Ct,At(hr,"|",wr),Dt,">"),Tr=xt(Dt,"=",Dt),Nr=/1[.]\d+/,_r=xt(Ct,"version",Tr,At("'",Nr,"'","|",'"',Nr,'"')),Sr=/[A-Za-z][-A-Za-z0-9._]*/,xr=xt(/^<\?xml/,_r,At(Ct,"encoding",Tr,At('"',Sr,'"',"|","'",Sr,"'")),"?",At(Ct,"standalone",Tr,At("'",At("yes","|","no"),"'","|",'"',At("yes","|","no"),'"')),"?",Dt,/\?>/),Ar=xt(It,"*?",/\]\]>/),Ir=xt(/<!\[CDATA\[/,Ar);Et.chars=_t,Et.chars_without=St,Et.detectUnicodeSupport=Tt,Et.reg=xt,Et.regg=At,Et.ABOUT_LEGACY_COMPAT=cr,Et.ABOUT_LEGACY_COMPAT_SystemLiteral=ur,Et.AttlistDecl=lr,Et.CDATA_START="<![CDATA[",Et.CDATA_END="]]>",Et.CDSect=Ir,Et.Char=It,Et.Comment=Qt,Et.COMMENT_START=Xt,Et.COMMENT_END="--\x3e",Et.DOCTYPE_DECL_START="<!DOCTYPE",Et.elementdecl=rr,Et.EntityDecl=br,Et.EntityValue=jt,Et.ExternalID=hr,Et.ExternalID_match=mr,Et.Name=kt,Et.NotationDecl=Er,Et.Reference=Bt,Et.PEReference=Ft,Et.PI=Yt,Et.PUBLIC=pr,Et.PubidLiteral=Jt,Et.QName=Ht,Et.QName_exact=Vt,Et.QName_group=$t,Et.S=Ct,Et.SChar_s=Rt,Et.S_OPT=Dt,Et.SYSTEM=dr,Et.SystemLiteral=zt,Et.UNICODE_REPLACEMENT_CHARACTER="�",Et.UNICODE_SUPPORT=Nt,Et.XMLDecl=xr;var Or=et,Rr=Or.find,Cr=Or.hasDefaultHTMLNamespace,Dr=Or.hasOwn,Mr=Or.isHTMLMimeType,Lr=Or.isHTMLRawTextElement,kr=Or.isHTMLVoidElement,Ur=Or.MIME_TYPE,Pr=Or.NAMESPACE,qr=Symbol(),Br=ut,Fr=Br.DOMException,jr=Br.DOMExceptionName,Gr=Et;function Wr(e){if(e!==qr)throw new TypeError("Illegal constructor")}function Hr(e){return""!==e}function Vr(e,t){return Dr(e,t)||(e[t]=!0),e}function $r(e){if(!e)return[];var t=function(e){return e?e.split(/[\t\n\f\r ]+/).filter(Hr):[]}(e);return Object.keys(t.reduce(Vr,{}))}function zr(e){if(!Gr.QName_exact.test(e))throw new Fr(Fr.INVALID_CHARACTER_ERR,'invalid character in qualified name "'+e+'"')}function Yr(e,t){zr(t),e=e||null;var r=null,n=t;if(t.indexOf(":")>=0){var o=t.split(":");r=o[0],n=o[1]}if(null!==r&&null===e)throw new Fr(Fr.NAMESPACE_ERR,"prefix is non-null and namespace is null");if("xml"===r&&e!==Or.NAMESPACE.XML)throw new Fr(Fr.NAMESPACE_ERR,'prefix is "xml" and namespace is not the XML namespace');if(("xmlns"===r||"xmlns"===t)&&e!==Or.NAMESPACE.XMLNS)throw new Fr(Fr.NAMESPACE_ERR,'either qualifiedName or prefix is "xmlns" and namespace is not the XMLNS namespace');if(e===Or.NAMESPACE.XMLNS&&"xmlns"!==r&&"xmlns"!==t)throw new Fr(Fr.NAMESPACE_ERR,'namespace is the XMLNS namespace and neither qualifiedName nor prefix is "xmlns"');return[e,r,n]}function Kr(e,t){for(var r in e)Dr(e,r)&&(t[r]=e[r])}function Jr(e,t){var r=e.prototype;if(!(r instanceof t)){let n=function(){};n.prototype=t.prototype,n=new n,Kr(r,n),e.prototype=r=n}r.constructor!=e&&("function"!=typeof e&&console.error("unknown Class:"+e),r.constructor=e)}var Xr={},Qr=Xr.ELEMENT_NODE=1,Zr=Xr.ATTRIBUTE_NODE=2,en=Xr.TEXT_NODE=3,tn=Xr.CDATA_SECTION_NODE=4,rn=Xr.ENTITY_REFERENCE_NODE=5,nn=Xr.ENTITY_NODE=6,on=Xr.PROCESSING_INSTRUCTION_NODE=7,sn=Xr.COMMENT_NODE=8,an=Xr.DOCUMENT_NODE=9,ln=Xr.DOCUMENT_TYPE_NODE=10,cn=Xr.DOCUMENT_FRAGMENT_NODE=11,un=Xr.NOTATION_NODE=12,dn=Or.freeze({DOCUMENT_POSITION_DISCONNECTED:1,DOCUMENT_POSITION_PRECEDING:2,DOCUMENT_POSITION_FOLLOWING:4,DOCUMENT_POSITION_CONTAINS:8,DOCUMENT_POSITION_CONTAINED_BY:16,DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:32});function pn(e,t){if(t.length<e.length)return pn(t,e);var r=null;for(var n in e){if(e[n]!==t[n])return r;r=e[n]}return r}function hn(e){return e.guid||(e.guid=Math.random()),e.guid}function mn(){}function fn(e,t){this._node=e,this._refresh=t,gn(this)}function gn(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!==t){var r=e._refresh(e._node);if(no(e,"length",r.length),!e.$$length||r.length<e.$$length)for(var n=r.length;n in e;n++)Dr(e,n)&&delete e[n];Kr(r,e),e._inc=t}}function vn(){}function yn(e,t){for(var r=0;r<e.length;){if(e[r]===t)return r;r++}}function bn(e,t,r,n){if(n?t[yn(t,n)]=r:(t[t.length]=r,t.length++),e){r.ownerElement=e;var o=e.ownerDocument;o&&(n&&xn(o,e,n),function(e,t,r){e&&e._inc++;var n=r.namespaceURI;n===Pr.XMLNS&&(t._nsMap[r.prefix?r.localName:""]=r.value)}(o,e,r))}}function wn(e,t,r){var n=yn(t,r);if(n>=0){for(var o=t.length-1;n<=o;)t[n]=t[++n];if(t.length=o,e){var i=e.ownerDocument;i&&xn(i,e,r),r.ownerElement=null}}}function En(){}function Tn(e){Wr(e)}function Nn(e){return("<"==e?"&lt;":">"==e&&"&gt;")||"&"==e&&"&amp;"||'"'==e&&"&quot;"||"&#"+e.charCodeAt()+";"}function _n(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(_n(e,t))return!0}while(e=e.nextSibling)}function Sn(e,t){Wr(e);var r=t||{};this.ownerDocument=this,this.contentType=r.contentType||Ur.XML_APPLICATION,this.type=Mr(this.contentType)?"html":"xml"}function xn(e,t,r,n){e&&e._inc++,r.namespaceURI===Pr.XMLNS&&delete t._nsMap[r.prefix?r.localName:""]}function An(e,t,r){if(e&&e._inc){e._inc++;var n=t.childNodes;if(r&&!r.nextSibling)n[n.length++]=r;else{for(var o=t.firstChild,i=0;o;)n[i++]=o,o=o.nextSibling;n.length=i,delete n[n.length]}}}function In(e,t){if(e!==t.parentNode)throw new Fr(Fr.NOT_FOUND_ERR,"child's parent is not parent");var r=t.previousSibling,n=t.nextSibling;return r?r.nextSibling=n:e.firstChild=n,n?n.previousSibling=r:e.lastChild=r,An(e.ownerDocument,e),t.parentNode=null,t.previousSibling=null,t.nextSibling=null,t}function On(e){return e&&e.nodeType===Tn.DOCUMENT_TYPE_NODE}function Rn(e){return e&&e.nodeType===Tn.ELEMENT_NODE}function Cn(e){return e&&e.nodeType===Tn.TEXT_NODE}function Dn(e,t){var r=e.childNodes||[];if(Rr(r,Rn)||On(t))return!1;var n=Rr(r,On);return!(t&&n&&r.indexOf(n)>r.indexOf(t))}function Mn(e,t){var r=e.childNodes||[];if(Rr(r,(function(e){return Rn(e)&&e!==t})))return!1;var n=Rr(r,On);return!(t&&n&&r.indexOf(n)>r.indexOf(t))}function Ln(e,t,r){if(!function(e){return e&&(e.nodeType===Tn.DOCUMENT_NODE||e.nodeType===Tn.DOCUMENT_FRAGMENT_NODE||e.nodeType===Tn.ELEMENT_NODE)}(e))throw new Fr(Fr.HIERARCHY_REQUEST_ERR,"Unexpected parent node type "+e.nodeType);if(r&&r.parentNode!==e)throw new Fr(Fr.NOT_FOUND_ERR,"child not in parent");if(!function(e){return e&&(e.nodeType===Tn.CDATA_SECTION_NODE||e.nodeType===Tn.COMMENT_NODE||e.nodeType===Tn.DOCUMENT_FRAGMENT_NODE||e.nodeType===Tn.DOCUMENT_TYPE_NODE||e.nodeType===Tn.ELEMENT_NODE||e.nodeType===Tn.PROCESSING_INSTRUCTION_NODE||e.nodeType===Tn.TEXT_NODE)}(t)||On(t)&&e.nodeType!==Tn.DOCUMENT_NODE)throw new Fr(Fr.HIERARCHY_REQUEST_ERR,"Unexpected node type "+t.nodeType+" for parent node type "+e.nodeType)}function kn(e,t,r){var n=e.childNodes||[],o=t.childNodes||[];if(t.nodeType===Tn.DOCUMENT_FRAGMENT_NODE){var i=o.filter(Rn);if(i.length>1||Rr(o,Cn))throw new Fr(Fr.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(1===i.length&&!Dn(e,r))throw new Fr(Fr.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if(Rn(t)&&!Dn(e,r))throw new Fr(Fr.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(On(t)){if(Rr(n,On))throw new Fr(Fr.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var s=Rr(n,Rn);if(r&&n.indexOf(s)<n.indexOf(r))throw new Fr(Fr.HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element");if(!r&&s)throw new Fr(Fr.HIERARCHY_REQUEST_ERR,"Doctype can not be appended since element is present")}}function Un(e,t,r){var n=e.childNodes||[],o=t.childNodes||[];if(t.nodeType===Tn.DOCUMENT_FRAGMENT_NODE){var i=o.filter(Rn);if(i.length>1||Rr(o,Cn))throw new Fr(Fr.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(1===i.length&&!Mn(e,r))throw new Fr(Fr.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if(Rn(t)&&!Mn(e,r))throw new Fr(Fr.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(On(t)){if(Rr(n,(function(e){return On(e)&&e!==r})))throw new Fr(Fr.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var s=Rr(n,Rn);if(r&&n.indexOf(s)<n.indexOf(r))throw new Fr(Fr.HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element")}}function Pn(e,t,r,n){Ln(e,t,r),e.nodeType===Tn.DOCUMENT_NODE&&(n||kn)(e,t,r);var o=t.parentNode;if(o&&o.removeChild(t),t.nodeType===cn){var i=t.firstChild;if(null==i)return t;var s=t.lastChild}else i=s=t;var a=r?r.previousSibling:e.lastChild;i.previousSibling=a,s.nextSibling=r,a?a.nextSibling=i:e.firstChild=i,null==r?e.lastChild=s:r.previousSibling=s;do{i.parentNode=e}while(i!==s&&(i=i.nextSibling));return An(e.ownerDocument||e,e,t),t.nodeType==cn&&(t.firstChild=t.lastChild=null),t}function qn(e){Wr(e),this._nsMap=Object.create(null)}function Bn(e){Wr(e),this.namespaceURI=null,this.prefix=null,this.ownerElement=null}function Fn(e){Wr(e)}function jn(e){Wr(e)}function Gn(e){Wr(e)}function Wn(e){Wr(e)}function Hn(e){Wr(e)}function Vn(e){Wr(e)}function $n(e){Wr(e)}function zn(e){Wr(e)}function Yn(e){Wr(e)}function Kn(e){Wr(e)}function Jn(){}function Xn(e){var t=[],r=this.nodeType===an&&this.documentElement||this,n=r.prefix,o=r.namespaceURI;if(o&&null==n&&null==(n=r.lookupPrefix(o)))var i=[{namespace:o,prefix:null}];return eo(this,t,e,i),t.join("")}function Qn(e,t,r){var n=e.prefix||"",o=e.namespaceURI;if(!o)return!1;if("xml"===n&&o===Pr.XML||o===Pr.XMLNS)return!1;for(var i=r.length;i--;){var s=r[i];if(s.prefix===n)return s.namespace!==o}return!0}function Zn(e,t,r){e.push(" ",t,'="',r.replace(/[<>&"\t\n\r]/g,Nn),'"')}function eo(e,t,r,n){n||(n=[]);var o="html"===(e.nodeType===an?e:e.ownerDocument).type;if(r){if(!(e=r(e)))return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case Qr:var i=e.attributes,s=i.length,a=e.firstChild,l=e.tagName,c=l;if(!o&&!e.prefix&&e.namespaceURI){for(var u,d=0;d<i.length;d++)if("xmlns"===i.item(d).name){u=i.item(d).value;break}if(!u)for(var p=n.length-1;p>=0;p--){if(""===(h=n[p]).prefix&&h.namespace===e.namespaceURI){u=h.namespace;break}}if(u!==e.namespaceURI)for(p=n.length-1;p>=0;p--){var h;if((h=n[p]).namespace===e.namespaceURI){h.prefix&&(c=h.prefix+":"+l);break}}}t.push("<",c);for(var m=0;m<s;m++){"xmlns"==(f=i.item(m)).prefix?n.push({prefix:f.localName,namespace:f.value}):"xmlns"==f.nodeName&&n.push({prefix:"",namespace:f.value})}for(m=0;m<s;m++){var f,g,v;if(Qn(f=i.item(m),0,n))Zn(t,(g=f.prefix||"")?"xmlns:"+g:"xmlns",v=f.namespaceURI),n.push({prefix:g,namespace:v});eo(f,t,r,n)}if(l===c&&Qn(e,0,n))Zn(t,(g=e.prefix||"")?"xmlns:"+g:"xmlns",v=e.namespaceURI),n.push({prefix:g,namespace:v});var y=!a;if(y&&(o||e.namespaceURI===Pr.HTML)&&(y=kr(l)),y)t.push("/>");else{if(t.push(">"),o&&Lr(l))for(;a;)a.data?t.push(a.data):eo(a,t,r,n.slice()),a=a.nextSibling;else for(;a;)eo(a,t,r,n.slice()),a=a.nextSibling;t.push("</",c,">")}return;case an:case cn:for(a=e.firstChild;a;)eo(a,t,r,n.slice()),a=a.nextSibling;return;case Zr:return Zn(t,e.name,e.value);case en:return t.push(e.data.replace(/[<&>]/g,Nn));case tn:return t.push(Gr.CDATA_START,e.data,Gr.CDATA_END);case sn:return t.push(Gr.COMMENT_START,e.data,Gr.COMMENT_END);case ln:var b=e.publicId,w=e.systemId;return t.push(Gr.DOCTYPE_DECL_START," ",e.name),b?(t.push(" ",Gr.PUBLIC," ",b),w&&"."!==w&&t.push(" ",w)):w&&"."!==w&&t.push(" ",Gr.SYSTEM," ",w),e.internalSubset&&t.push(" [",e.internalSubset,"]"),void t.push(">");case on:return t.push("<?",e.target," ",e.data,"?>");case rn:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function to(e,t,r){var n;switch(t.nodeType){case Qr:(n=t.cloneNode(!1)).ownerDocument=e;case cn:break;case Zr:r=!0}if(n||(n=t.cloneNode(!1)),n.ownerDocument=e,n.parentNode=null,r)for(var o=t.firstChild;o;)n.appendChild(to(e,o,r)),o=o.nextSibling;return n}function ro(e,t,r){var n=new t.constructor(qr);for(var o in t)if(Dr(t,o)){var i=t[o];"object"!=typeof i&&i!=n[o]&&(n[o]=i)}switch(t.childNodes&&(n.childNodes=new mn),n.ownerDocument=e,n.nodeType){case Qr:var s=t.attributes,a=n.attributes=new vn,l=s.length;a._ownerElement=n;for(var c=0;c<l;c++)n.setAttributeNode(ro(e,s.item(c),!0));break;case Zr:r=!0}if(r)for(var u=t.firstChild;u;)n.appendChild(ro(e,u,r)),u=u.nextSibling;return n}function no(e,t,r){e[t]=r}mn.prototype={length:0,item:function(e){return e>=0&&e<this.length?this[e]:null},toString:function(e){for(var t=[],r=0;r<this.length;r++)eo(this[r],t,e);return t.join("")},filter:function(e){return Array.prototype.filter.call(this,e)},indexOf:function(e){return Array.prototype.indexOf.call(this,e)}},mn.prototype[Symbol.iterator]=function(){var e=this,t=0;return{next:function(){return t<e.length?{value:e[t++],done:!1}:{done:!0}},return:function(){return{done:!0}}}},fn.prototype.item=function(e){return gn(this),this[e]||null},Jr(fn,mn),vn.prototype={length:0,item:mn.prototype.item,getNamedItem:function(e){this._ownerElement&&this._ownerElement._isInHTMLDocumentAndNamespace()&&(e=e.toLowerCase());for(var t=0;t<this.length;){var r=this[t];if(r.nodeName===e)return r;t++}return null},setNamedItem:function(e){var t=e.ownerElement;if(t&&t!==this._ownerElement)throw new Fr(Fr.INUSE_ATTRIBUTE_ERR);var r=this.getNamedItemNS(e.namespaceURI,e.localName);return r===e?e:(bn(this._ownerElement,this,e,r),r)},setNamedItemNS:function(e){return this.setNamedItem(e)},removeNamedItem:function(e){var t=this.getNamedItem(e);if(!t)throw new Fr(Fr.NOT_FOUND_ERR,e);return wn(this._ownerElement,this,t),t},removeNamedItemNS:function(e,t){var r=this.getNamedItemNS(e,t);if(!r)throw new Fr(Fr.NOT_FOUND_ERR,e?e+" : "+t:t);return wn(this._ownerElement,this,r),r},getNamedItemNS:function(e,t){e||(e=null);for(var r=0;r<this.length;){var n=this[r];if(n.localName===t&&n.namespaceURI===e)return n;r++}return null}},vn.prototype[Symbol.iterator]=function(){var e=this,t=0;return{next:function(){return t<e.length?{value:e[t++],done:!1}:{done:!0}},return:function(){return{done:!0}}}},En.prototype={hasFeature:function(e,t){return!0},createDocument:function(e,t,r){var n=Ur.XML_APPLICATION;e===Pr.HTML?n=Ur.XML_XHTML_APPLICATION:e===Pr.SVG&&(n=Ur.XML_SVG_IMAGE);var o=new Sn(qr,{contentType:n});if(o.implementation=this,o.childNodes=new mn,o.doctype=r||null,r&&o.appendChild(r),t){var i=o.createElementNS(e,t);o.appendChild(i)}return o},createDocumentType:function(e,t,r,n){zr(e);var o=new Hn(qr);return o.name=e,o.nodeName=e,o.publicId=t||"",o.systemId=r||"",o.internalSubset=n||"",o.childNodes=new mn,o},createHTMLDocument:function(e){var t=new Sn(qr,{contentType:Ur.HTML});if(t.implementation=this,t.childNodes=new mn,!1!==e){t.doctype=this.createDocumentType("html"),t.doctype.ownerDocument=t,t.appendChild(t.doctype);var r=t.createElement("html");t.appendChild(r);var n=t.createElement("head");if(r.appendChild(n),"string"==typeof e){var o=t.createElement("title");o.appendChild(t.createTextNode(e)),n.appendChild(o)}r.appendChild(t.createElement("body"))}return t}},Tn.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,parentNode:null,get parentElement(){return this.parentNode&&this.parentNode.nodeType===this.ELEMENT_NODE?this.parentNode:null},childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,baseURI:"about:blank",get isConnected(){var e=this.getRootNode();return e&&e.nodeType===e.DOCUMENT_NODE},contains:function(e){if(!e)return!1;var t=e;do{if(this===t)return!0;t=e.parentNode}while(t);return!1},getRootNode:function(e){var t=this;do{if(!t.parentNode)return t;t=t.parentNode}while(t)},isEqualNode:function(e){if(!e)return!1;if(this.nodeType!==e.nodeType)return!1;switch(this.nodeType){case this.DOCUMENT_TYPE_NODE:if(this.name!==e.name)return!1;if(this.publicId!==e.publicId)return!1;if(this.systemId!==e.systemId)return!1;break;case this.ELEMENT_NODE:if(this.namespaceURI!==e.namespaceURI)return!1;if(this.prefix!==e.prefix)return!1;if(this.localName!==e.localName)return!1;if(this.attributes.length!==e.attributes.length)return!1;for(var t=0;t<this.attributes.length;t++){var r=this.attributes.item(t);if(!r.isEqualNode(e.getAttributeNodeNS(r.namespaceURI,r.localName)))return!1}break;case this.ATTRIBUTE_NODE:if(this.namespaceURI!==e.namespaceURI)return!1;if(this.localName!==e.localName)return!1;if(this.value!==e.value)return!1;break;case this.PROCESSING_INSTRUCTION_NODE:if(this.target!==e.target||this.data!==e.data)return!1;break;case this.TEXT_NODE:case this.COMMENT_NODE:if(this.data!==e.data)return!1}if(this.childNodes.length!==e.childNodes.length)return!1;for(t=0;t<this.childNodes.length;t++)if(!this.childNodes[t].isEqualNode(e.childNodes[t]))return!1;return!0},isSameNode:function(e){return this===e},insertBefore:function(e,t){return Pn(this,e,t)},replaceChild:function(e,t){Pn(this,e,t,Un),t&&this.removeChild(t)},removeChild:function(e){return In(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(e){return ro(this.ownerDocument||this,this,e)},normalize:function(){for(var e=this.firstChild;e;){var t=e.nextSibling;t&&t.nodeType==en&&e.nodeType==en?(this.removeChild(t),e.appendData(t.data)):(e.normalize(),e=t)}},isSupported:function(e,t){return this.ownerDocument.implementation.hasFeature(e,t)},lookupPrefix:function(e){for(var t=this;t;){var r=t._nsMap;if(r)for(var n in r)if(Dr(r,n)&&r[n]===e)return n;t=t.nodeType==Zr?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var r=t._nsMap;if(r&&Dr(r,e))return r[e];t=t.nodeType==Zr?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)},compareDocumentPosition:function(e){if(this===e)return 0;var t=e,r=this,n=null,o=null;if(t instanceof Bn&&(t=(n=t).ownerElement),r instanceof Bn&&(r=(o=r).ownerElement,n&&t&&r===t))for(var i,s=0;i=r.attributes[s];s++){if(i===n)return dn.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+dn.DOCUMENT_POSITION_PRECEDING;if(i===o)return dn.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+dn.DOCUMENT_POSITION_FOLLOWING}if(!t||!r||r.ownerDocument!==t.ownerDocument)return dn.DOCUMENT_POSITION_DISCONNECTED+dn.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+(hn(r.ownerDocument)>hn(t.ownerDocument)?dn.DOCUMENT_POSITION_FOLLOWING:dn.DOCUMENT_POSITION_PRECEDING);if(o&&t===r)return dn.DOCUMENT_POSITION_CONTAINS+dn.DOCUMENT_POSITION_PRECEDING;if(n&&t===r)return dn.DOCUMENT_POSITION_CONTAINED_BY+dn.DOCUMENT_POSITION_FOLLOWING;for(var a=[],l=t.parentNode;l;){if(!o&&l===r)return dn.DOCUMENT_POSITION_CONTAINED_BY+dn.DOCUMENT_POSITION_FOLLOWING;a.push(l),l=l.parentNode}a.reverse();for(var c=[],u=r.parentNode;u;){if(!n&&u===t)return dn.DOCUMENT_POSITION_CONTAINS+dn.DOCUMENT_POSITION_PRECEDING;c.push(u),u=u.parentNode}c.reverse();var d=pn(a,c);for(var p in d.childNodes){var h=d.childNodes[p];if(h===r)return dn.DOCUMENT_POSITION_FOLLOWING;if(h===t)return dn.DOCUMENT_POSITION_PRECEDING;if(c.indexOf(h)>=0)return dn.DOCUMENT_POSITION_FOLLOWING;if(a.indexOf(h)>=0)return dn.DOCUMENT_POSITION_PRECEDING}return 0}},Kr(Xr,Tn),Kr(Xr,Tn.prototype),Kr(dn,Tn),Kr(dn,Tn.prototype),Sn.prototype={implementation:null,nodeName:"#document",nodeType:an,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType===cn){for(var r=e.firstChild;r;){var n=r.nextSibling;this.insertBefore(r,t),r=n}return e}return Pn(this,e,t),e.ownerDocument=this,null===this.documentElement&&e.nodeType===Qr&&(this.documentElement=e),e},removeChild:function(e){var t=In(this,e);return t===this.documentElement&&(this.documentElement=null),t},replaceChild:function(e,t){Pn(this,e,t,Un),e.ownerDocument=this,t&&this.removeChild(t),Rn(e)&&(this.documentElement=e)},importNode:function(e,t){return to(this,e,t)},getElementById:function(e){var t=null;return _n(this.documentElement,(function(r){if(r.nodeType==Qr&&r.getAttribute("id")==e)return t=r,!0})),t},createElement:function(e){var t=new qn(qr);return t.ownerDocument=this,"html"===this.type&&(e=e.toLowerCase()),Cr(this.contentType)&&(t.namespaceURI=Pr.HTML),t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new mn,(t.attributes=new vn)._ownerElement=t,t},createDocumentFragment:function(){var e=new Yn(qr);return e.ownerDocument=this,e.childNodes=new mn,e},createTextNode:function(e){var t=new jn(qr);return t.ownerDocument=this,t.childNodes=new mn,t.appendData(e),t},createComment:function(e){var t=new Gn(qr);return t.ownerDocument=this,t.childNodes=new mn,t.appendData(e),t},createCDATASection:function(e){var t=new Wn(qr);return t.ownerDocument=this,t.childNodes=new mn,t.appendData(e),t},createProcessingInstruction:function(e,t){var r=new Kn(qr);return r.ownerDocument=this,r.childNodes=new mn,r.nodeName=r.target=e,r.nodeValue=r.data=t,r},createAttribute:function(e){if(!Gr.QName_exact.test(e))throw new Fr(Fr.INVALID_CHARACTER_ERR,'invalid character in name "'+e+'"');return"html"===this.type&&(e=e.toLowerCase()),this._createAttribute(e)},_createAttribute:function(e){var t=new Bn(qr);return t.ownerDocument=this,t.childNodes=new mn,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){if(!Gr.Name.test(e))throw new Fr(Fr.INVALID_CHARACTER_ERR,'not a valid xml name "'+e+'"');if("html"===this.type)throw new Fr("document is an html document",jr.NotSupportedError);var t=new zn(qr);return t.ownerDocument=this,t.childNodes=new mn,t.nodeName=e,t},createElementNS:function(e,t){var r=Yr(e,t),n=new qn(qr),o=n.attributes=new vn;return n.childNodes=new mn,n.ownerDocument=this,n.nodeName=t,n.tagName=t,n.namespaceURI=r[0],n.prefix=r[1],n.localName=r[2],o._ownerElement=n,n},createAttributeNS:function(e,t){var r=Yr(e,t),n=new Bn(qr);return n.ownerDocument=this,n.childNodes=new mn,n.nodeName=t,n.name=t,n.specified=!0,n.namespaceURI=r[0],n.prefix=r[1],n.localName=r[2],n}},Jr(Sn,Tn),qn.prototype={nodeType:Qr,attributes:null,getQualifiedName:function(){return this.prefix?this.prefix+":"+this.localName:this.localName},_isInHTMLDocumentAndNamespace:function(){return"html"===this.ownerDocument.type&&this.namespaceURI===Pr.HTML},hasAttributes:function(){return!(!this.attributes||!this.attributes.length)},hasAttribute:function(e){return!!this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t?t.value:null},getAttributeNode:function(e){return this._isInHTMLDocumentAndNamespace()&&(e=e.toLowerCase()),this.attributes.getNamedItem(e)},setAttribute:function(e,t){this._isInHTMLDocumentAndNamespace()&&(e=e.toLowerCase());var r=this.getAttributeNode(e);r?r.value=r.nodeValue=""+t:((r=this.ownerDocument._createAttribute(e)).value=r.nodeValue=""+t,this.setAttributeNode(r))},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var r=this.getAttributeNodeNS(e,t);r&&this.removeAttributeNode(r)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var r=this.getAttributeNodeNS(e,t);return r?r.value:null},setAttributeNS:function(e,t,r){var n=Yr(e,t)[2],o=this.getAttributeNodeNS(e,n);o?o.value=o.nodeValue=""+r:((o=this.ownerDocument.createAttributeNS(e,t)).value=o.nodeValue=""+r,this.setAttributeNode(o))},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByClassName:function(e){var t=$r(e);return new fn(this,(function(r){var n=[];return t.length>0&&_n(r,(function(o){if(o!==r&&o.nodeType===Qr){var i=o.getAttribute("class");if(i){var s=e===i;if(!s){var a=$r(i);s=t.every((l=a,function(e){return l&&-1!==l.indexOf(e)}))}s&&n.push(o)}}var l})),n}))},getElementsByTagName:function(e){var t="html"===(this.nodeType===an?this:this.ownerDocument).type,r=e.toLowerCase();return new fn(this,(function(n){var o=[];return _n(n,(function(i){i!==n&&i.nodeType===Qr&&(("*"===e||i.getQualifiedName()===(t&&i.namespaceURI===Pr.HTML?r:e))&&o.push(i))})),o}))},getElementsByTagNameNS:function(e,t){return new fn(this,(function(r){var n=[];return _n(r,(function(o){o===r||o.nodeType!==Qr||"*"!==e&&o.namespaceURI!==e||"*"!==t&&o.localName!=t||n.push(o)})),n}))}},Sn.prototype.getElementsByClassName=qn.prototype.getElementsByClassName,Sn.prototype.getElementsByTagName=qn.prototype.getElementsByTagName,Sn.prototype.getElementsByTagNameNS=qn.prototype.getElementsByTagNameNS,Jr(qn,Tn),Bn.prototype.nodeType=Zr,Jr(Bn,Tn),Fn.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,r){r=this.data.substring(0,e)+r+this.data.substring(e+t),this.nodeValue=this.data=r,this.length=r.length}},Jr(Fn,Tn),jn.prototype={nodeName:"#text",nodeType:en,splitText:function(e){var t=this.data,r=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var n=this.ownerDocument.createTextNode(r);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}},Jr(jn,Fn),Gn.prototype={nodeName:"#comment",nodeType:sn},Jr(Gn,Fn),Wn.prototype={nodeName:"#cdata-section",nodeType:tn},Jr(Wn,jn),Hn.prototype.nodeType=ln,Jr(Hn,Tn),Vn.prototype.nodeType=un,Jr(Vn,Tn),$n.prototype.nodeType=nn,Jr($n,Tn),zn.prototype.nodeType=rn,Jr(zn,Tn),Yn.prototype.nodeName="#document-fragment",Yn.prototype.nodeType=cn,Jr(Yn,Tn),Kn.prototype.nodeType=on,Jr(Kn,Fn),Jn.prototype.serializeToString=function(e,t){return Xn.call(e,t)},Tn.prototype.toString=Xn;try{if(Object.defineProperty){let e=function(t){switch(t.nodeType){case Qr:case cn:var r=[];for(t=t.firstChild;t;)7!==t.nodeType&&8!==t.nodeType&&r.push(e(t)),t=t.nextSibling;return r.join("");default:return t.nodeValue}};Object.defineProperty(fn.prototype,"length",{get:function(){return gn(this),this.$$length}}),Object.defineProperty(Tn.prototype,"textContent",{get:function(){return e(this)},set:function(e){switch(this.nodeType){case Qr:case cn:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),no=function(e,t,r){e["$$"+t]=r}}}catch(ti){}wt._updateLiveList=gn,wt.Attr=Bn,wt.CDATASection=Wn,wt.CharacterData=Fn,wt.Comment=Gn,wt.Document=Sn,wt.DocumentFragment=Yn,wt.DocumentType=Hn,wt.DOMImplementation=En,wt.Element=qn,wt.Entity=$n,wt.EntityReference=zn,wt.LiveNodeList=fn,wt.NamedNodeMap=vn,wt.Node=Tn,wt.NodeList=mn,wt.Notation=Vn,wt.Text=jn,wt.ProcessingInstruction=Kn,wt.XMLSerializer=Jn;var oo={},io={};!function(e){var t=et.freeze;e.XML_ENTITIES=t({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),e.HTML_ENTITIES=t({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}),e.entityMap=e.HTML_ENTITIES}(io);var so={},ao=et,lo=Et,co=ut,uo=ao.isHTMLEscapableRawTextElement,po=ao.isHTMLMimeType,ho=ao.isHTMLRawTextElement,mo=ao.hasOwn,fo=ao.NAMESPACE,go=co.ParseError,vo=co.DOMException;function yo(){}yo.prototype={parse:function(e,t,r){var n=this.domBuilder;n.startDocument(),_o(t,t=Object.create(null)),function(e,t,r,n,o){var i=po(n.mimeType);e.indexOf(lo.UNICODE_REPLACEMENT_CHARACTER)>=0&&o.warning("Unicode replacement character detected, source encoding issues?");function s(e){if(e>65535){var t=55296+((e-=65536)>>10),r=56320+(1023&e);return String.fromCharCode(t,r)}return String.fromCharCode(e)}function a(e){var t=";"===e[e.length-1]?e:e+";";if(!i&&t!==e)return o.error("EntityRef: expecting ;"),e;var n=lo.Reference.exec(t);if(!n||n[0].length!==t.length)return o.error("entity not matching Reference production: "+e),e;var a=t.slice(1,-1);return mo(r,a)?r[a]:"#"===a.charAt(0)?s(parseInt(a.substring(1).replace("x","0x"))):(o.error("entity not found:"+e),e)}function l(t){if(t>g){var r=e.substring(g,t).replace(bo,a);p&&h(g),n.characters(r,0,t-g),g=t}}var c=0,u=0,d=/\r\n?|\n|$/g,p=n.locator;function h(t,r){for(;t>=u&&(r=d.exec(e));)c=u,u=r.index+r[0].length,p.lineNumber++;p.columnNumber=t-c+1}var m=[{currentNSMap:t}],f=[],g=0;for(;;){try{var v=e.indexOf("<",g);if(v<0){if(!i&&f.length>0)return o.fatalError("unclosed xml tag(s): "+f.join(", "));if(!e.substring(g).match(/^\s*$/)){var y=n.doc,b=y.createTextNode(e.substring(g));if(y.documentElement)return o.error("Extra content at the end of the document");y.appendChild(b),n.currentElement=b}return}if(v>g){var w=e.substring(g,v);i||0!==f.length||(w=w.replace(new RegExp(lo.S_OPT.source,"g"),""))&&o.error("Unexpected content outside root element: '"+w+"'"),l(v)}switch(e.charAt(v+1)){case"/":var E=e.indexOf(">",v+2),T=e.substring(v+2,E>0?E:void 0);if(!T)return o.fatalError("end tag name missing");var N=E>0&&lo.reg("^",lo.QName_group,lo.S_OPT,"$").exec(T);if(!N)return o.fatalError('end tag name contains invalid characters: "'+T+'"');if(!n.currentElement&&!n.doc.documentElement)return;var _=f[f.length-1]||n.currentElement.tagName||n.doc.documentElement.tagName||"";if(_!==N[1]){var S=N[1].toLowerCase();if(!i||_.toLowerCase()!==S)return o.fatalError('Opening and ending tag mismatch: "'+_+'" != "'+T+'"')}var x=m.pop();f.pop();var A=x.localNSMap;if(n.endElement(x.uri,x.localName,_),A)for(var I in A)mo(A,I)&&n.endPrefixMapping(I);E++;break;case"?":p&&h(v),E=Ao(e,v,n,o);break;case"!":p&&h(v),E=xo(e,v,n,o,i);break;default:p&&h(v);var O=new Io,R=m[m.length-1].currentNSMap,C=(E=Eo(e,v,O,R,a,o,i),O.length);if(O.closed||(i&&ao.isHTMLVoidElement(O.tagName)?O.closed=!0:f.push(O.tagName)),p&&C){for(var D=wo(p,{}),M=0;M<C;M++){var L=O[M];h(L.offset),L.locator=wo(p,{})}n.locator=D,To(O,n,R)&&m.push(O),n.locator=p}else To(O,n,R)&&m.push(O);i&&!O.closed?E=No(e,E,O.tagName,a,n):E++}}catch(ti){if(ti instanceof go)throw ti;if(ti instanceof vo)throw new go(ti.name+": "+ti.message,n.locator,ti);o.error("element parse error: "+ti),E=-1}E>g?g=E:l(Math.max(v,g)+1)}}(e,t,r,n,this.errorHandler),n.endDocument()}};var bo=/&#?\w+;?/g;function wo(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function Eo(e,t,r,n,o,i,s){function a(e,t,n){return mo(r.attributeNames,e)?i.fatalError("Attribute "+e+" redefined"):!s&&t.indexOf("<")>=0?i.fatalError("Unescaped '<' not allowed in attributes values"):void r.addValue(e,t.replace(/[\t\n\r]/g," ").replace(bo,o),n)}for(var l,c=++t,u=0;;){var d=e.charAt(c);switch(d){case"=":if(1===u)l=e.slice(t,c),u=3;else{if(2!==u)throw new Error("attribute equal must after attrName");u=3}break;case"'":case'"':if(3===u||1===u){if(1===u&&(i.warning('attribute value must after "="'),l=e.slice(t,c)),t=c+1,!((c=e.indexOf(d,t))>0))throw new Error("attribute value no end '"+d+"' match");a(l,p=e.slice(t,c),t-1),u=5}else{if(4!=u)throw new Error('attribute value must after "="');a(l,p=e.slice(t,c),t),i.warning('attribute "'+l+'" missed start quot('+d+")!!"),t=c+1,u=5}break;case"/":switch(u){case 0:r.setTagName(e.slice(t,c));case 5:case 6:case 7:u=7,r.closed=!0;case 4:case 1:break;case 2:r.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return i.error("unexpected end of input"),0==u&&r.setTagName(e.slice(t,c)),c;case">":switch(u){case 0:r.setTagName(e.slice(t,c));case 5:case 6:case 7:break;case 4:case 1:"/"===(p=e.slice(t,c)).slice(-1)&&(r.closed=!0,p=p.slice(0,-1));case 2:2===u&&(p=l),4==u?(i.warning('attribute "'+p+'" missed quot(")!'),a(l,p,t)):(s||i.warning('attribute "'+p+'" missed value!! "'+p+'" instead!!'),a(p,p,t));break;case 3:if(!s)return i.fatalError("AttValue: ' or \" expected")}return c;case"€":d=" ";default:if(d<=" ")switch(u){case 0:r.setTagName(e.slice(t,c)),u=6;break;case 1:l=e.slice(t,c),u=2;break;case 4:var p=e.slice(t,c);i.warning('attribute "'+p+'" missed quot(")!!'),a(l,p,t);case 5:u=6}else switch(u){case 2:s||i.warning('attribute "'+l+'" missed value!! "'+l+'" instead2!!'),a(l,l,t),t=c,u=1;break;case 5:i.warning('attribute space is required"'+l+'"!!');case 6:u=1,t=c;break;case 3:u=4,t=c;break;case 7:throw new Error("elements closed character '/' and '>' must be connected to")}}c++}}function To(e,t,r){for(var n=e.tagName,o=null,i=e.length;i--;){var s=e[i],a=s.qName,l=s.value;if((p=a.indexOf(":"))>0)var c=s.prefix=a.slice(0,p),u=a.slice(p+1),d="xmlns"===c&&u;else u=a,c=null,d="xmlns"===a&&"";s.localName=u,!1!==d&&(null==o&&(o=Object.create(null),_o(r,r=Object.create(null))),r[d]=o[d]=l,s.uri=fo.XMLNS,t.startPrefixMapping(d,l))}for(i=e.length;i--;)(s=e[i]).prefix&&("xml"===s.prefix&&(s.uri=fo.XML),"xmlns"!==s.prefix&&(s.uri=r[s.prefix]));var p;(p=n.indexOf(":"))>0?(c=e.prefix=n.slice(0,p),u=e.localName=n.slice(p+1)):(c=null,u=e.localName=n);var h=e.uri=r[c||""];if(t.startElement(h,u,n,e),!e.closed)return e.currentNSMap=r,e.localNSMap=o,!0;if(t.endElement(h,u,n),o)for(c in o)mo(o,c)&&t.endPrefixMapping(c)}function No(e,t,r,n,o){var i=uo(r);if(i||ho(r)){var s=e.indexOf("</"+r+">",t),a=e.substring(t+1,s);return i&&(a=a.replace(bo,n)),o.characters(a,0,a.length),s}return t+1}function _o(e,t){for(var r in e)mo(e,r)&&(t[r]=e[r])}function So(e,t){var r=t;function n(t){return t=t||0,e.charAt(r+t)}function o(e){r+=e=e||1}function i(){return e.substring(r)}return{char:n,getIndex:function(){return r},getMatch:function(e){var t=lo.reg("^",e).exec(i());return t?(o(t[0].length),t[0]):null},getSource:function(){return e},skip:o,skipBlanks:function(){for(var t=0;r<e.length;){var i=n();if(" "!==i&&"\n"!==i&&"\t"!==i&&"\r"!==i)return t;t++,o()}return-1},substringFromIndex:i,substringStartsWith:function(t){return e.substring(r,r+t.length)===t},substringStartsWithCaseInsensitive:function(t){return e.substring(r,r+t.length).toUpperCase()===t.toUpperCase()}}}function xo(e,t,r,n,o){var i=So(e,t);switch(o?i.char(2).toUpperCase():i.char(2)){case"-":var s=i.getMatch(lo.Comment);return s?(r.comment(s,lo.COMMENT_START.length,s.length-lo.COMMENT_START.length-lo.COMMENT_END.length),i.getIndex()):n.fatalError("comment is not well-formed at position "+i.getIndex());case"[":var a=i.getMatch(lo.CDSect);return a?o||r.currentElement?(r.startCDATA(),r.characters(a,lo.CDATA_START.length,a.length-lo.CDATA_START.length-lo.CDATA_END.length),r.endCDATA(),i.getIndex()):n.fatalError("CDATA outside of element"):n.fatalError("Invalid CDATA starting at position "+t);case"D":if(r.doc&&r.doc.documentElement)return n.fatalError("Doctype not allowed inside or after documentElement at position "+i.getIndex());if(o?!i.substringStartsWithCaseInsensitive(lo.DOCTYPE_DECL_START):!i.substringStartsWith(lo.DOCTYPE_DECL_START))return n.fatalError("Expected "+lo.DOCTYPE_DECL_START+" at position "+i.getIndex());if(i.skip(lo.DOCTYPE_DECL_START.length),i.skipBlanks()<1)return n.fatalError("Expected whitespace after "+lo.DOCTYPE_DECL_START+" at position "+i.getIndex());var l={name:void 0,publicId:void 0,systemId:void 0,internalSubset:void 0};if(l.name=i.getMatch(lo.Name),!l.name)return n.fatalError("doctype name missing or contains unexpected characters at position "+i.getIndex());if(o&&"html"!==l.name.toLowerCase()&&n.warning("Unexpected DOCTYPE in HTML document at position "+i.getIndex()),i.skipBlanks(),i.substringStartsWith(lo.PUBLIC)||i.substringStartsWith(lo.SYSTEM)){var c=lo.ExternalID_match.exec(i.substringFromIndex());if(!c)return n.fatalError("doctype external id is not well-formed at position "+i.getIndex());void 0!==c.groups.SystemLiteralOnly?l.systemId=c.groups.SystemLiteralOnly:(l.systemId=c.groups.SystemLiteral,l.publicId=c.groups.PubidLiteral),i.skip(c[0].length)}else if(o&&i.substringStartsWithCaseInsensitive(lo.SYSTEM)){if(i.skip(lo.SYSTEM.length),i.skipBlanks()<1)return n.fatalError("Expected whitespace after "+lo.SYSTEM+" at position "+i.getIndex());if(l.systemId=i.getMatch(lo.ABOUT_LEGACY_COMPAT_SystemLiteral),!l.systemId)return n.fatalError("Expected "+lo.ABOUT_LEGACY_COMPAT+" in single or double quotes after "+lo.SYSTEM+" at position "+i.getIndex())}return o&&l.systemId&&!lo.ABOUT_LEGACY_COMPAT_SystemLiteral.test(l.systemId)&&n.warning("Unexpected doctype.systemId in HTML document at position "+i.getIndex()),o||(i.skipBlanks(),l.internalSubset=function(e,t){var r,n,o,i=e.getSource();if("["===e.char()){e.skip(1);for(var s=e.getIndex();e.getIndex()<i.length;){if(e.skipBlanks(),"]"===e.char()){var a=i.substring(s,e.getIndex());return e.skip(1),a}var l=null;if("<"===e.char()&&"!"===e.char(1))switch(e.char(2)){case"E":"L"===e.char(3)?l=e.getMatch(lo.elementdecl):"N"===e.char(3)&&(l=e.getMatch(lo.EntityDecl));break;case"A":l=e.getMatch(lo.AttlistDecl);break;case"N":l=e.getMatch(lo.NotationDecl);break;case"-":l=e.getMatch(lo.Comment)}else if("<"===e.char()&&"?"===e.char(1))r=e,n=t,o=void 0,l=(o=lo.PI.exec(r.substringFromIndex()))?"xml"===o[1].toLowerCase()?n.fatalError("xml declaration is only allowed at the start of the document, but found at position "+r.getIndex()):(r.skip(o[0].length),o[0]):n.fatalError("processing instruction is not well-formed at position "+r.getIndex());else{if("%"!==e.char())return t.fatalError("Error detected in Markup declaration");l=e.getMatch(lo.PEReference)}if(!l)return t.fatalError("Error in internal subset at position "+e.getIndex())}return t.fatalError("doctype internal subset is not well-formed, missing ]")}}(i,n)),i.skipBlanks(),">"!==i.char()?n.fatalError("doctype not terminated with > at position "+i.getIndex()):(i.skip(1),r.startDTD(l.name,l.publicId,l.systemId,l.internalSubset),r.endDTD(),i.getIndex());default:return n.fatalError('Not well-formed XML starting with "<!" at position '+t)}}function Ao(e,t,r,n){var o=e.substring(t).match(lo.PI);if(!o)return n.fatalError("Invalid processing instruction starting at position "+t);if("xml"===o[1].toLowerCase()){if(t>0)return n.fatalError("processing instruction at position "+t+" is an xml declaration which is only at the start of the document");if(!lo.XMLDecl.test(e.substring(t)))return n.fatalError("xml declaration is not well-formed")}return r.processingInstruction(o[1],o[2]),t+o[0].length}function Io(){this.attributeNames=Object.create(null)}Io.prototype={setTagName:function(e){if(!lo.QName_exact.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,t,r){if(!lo.QName_exact.test(e))throw new Error("invalid attribute:"+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:r}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},so.XMLReader=yo,so.parseUtils=So,so.parseDoctypeCommentOrCData=xo;var Oo=et,Ro=ut,Co=io,Do=so,Mo=wt.DOMImplementation,Lo=Oo.hasDefaultHTMLNamespace,ko=Oo.isHTMLMimeType,Uo=Oo.isValidMimeType,Po=Oo.MIME_TYPE,qo=Oo.NAMESPACE,Bo=Ro.ParseError,Fo=Do.XMLReader;function jo(e){return e.replace(/\r[\n\u0085]/g,"\n").replace(/[\r\u0085\u2028\u2029]/g,"\n")}function Go(e){if(void 0===(e=e||{}).locator&&(e.locator=!0),this.assign=e.assign||Oo.assign,this.domHandler=e.domHandler||Wo,this.onError=e.onError||e.errorHandler,e.errorHandler&&"function"!=typeof e.errorHandler)throw new TypeError("errorHandler object is no longer supported, switch to onError!");e.errorHandler&&e.errorHandler("warning","The `errorHandler` option has been deprecated, use `onError` instead!",this),this.normalizeLineEndings=e.normalizeLineEndings||jo,this.locator=!!e.locator,this.xmlns=this.assign(Object.create(null),e.xmlns)}function Wo(e){var t=e||{};this.mimeType=t.mimeType||Po.XML_APPLICATION,this.defaultNamespace=t.defaultNamespace||null,this.cdata=!1,this.currentElement=void 0,this.doc=void 0,this.locator=void 0,this.onError=t.onError}function Ho(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}function Vo(e,t,r){return"string"==typeof e?e.substr(t,r):e.length>=t+r||t?new java.lang.String(e,t,r)+"":e}function $o(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}Go.prototype.parseFromString=function(e,t){if(!Uo(t))throw new TypeError('DOMParser.parseFromString: the provided mimeType "'+t+'" is not valid.');var r=this.assign(Object.create(null),this.xmlns),n=Co.XML_ENTITIES,o=r[""]||null;Lo(t)?(n=Co.HTML_ENTITIES,o=qo.HTML):t===Po.XML_SVG_IMAGE&&(o=qo.SVG),r[""]=o,r.xml=r.xml||qo.XML;var i=new this.domHandler({mimeType:t,defaultNamespace:o,onError:this.onError}),s=this.locator?{}:void 0;this.locator&&i.setDocumentLocator(s);var a=new Fo;return a.errorHandler=i,a.domBuilder=i,!Oo.isHTMLMimeType(t)&&"string"!=typeof e&&a.errorHandler.fatalError("source is not a string"),a.parse(this.normalizeLineEndings(String(e)),r,n),i.doc.documentElement||a.errorHandler.fatalError("missing root element"),i.doc},Wo.prototype={startDocument:function(){var e=new Mo;this.doc=ko(this.mimeType)?e.createHTMLDocument(!1):e.createDocument(this.defaultNamespace,"")},startElement:function(e,t,r,n){var o=this.doc,i=o.createElementNS(e,r||t),s=n.length;$o(this,i),this.currentElement=i,this.locator&&Ho(this.locator,i);for(var a=0;a<s;a++){e=n.getURI(a);var l=n.getValue(a),c=(r=n.getQName(a),o.createAttributeNS(e,r));this.locator&&Ho(n.getLocator(a),c),c.value=c.nodeValue=l,i.setAttributeNode(c)}},endElement:function(e,t,r){this.currentElement=this.currentElement.parentNode},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,t){var r=this.doc.createProcessingInstruction(e,t);this.locator&&Ho(this.locator,r),$o(this,r)},ignorableWhitespace:function(e,t,r){},characters:function(e,t,r){if(e=Vo.apply(this,arguments)){if(this.cdata)var n=this.doc.createCDATASection(e);else n=this.doc.createTextNode(e);this.currentElement?this.currentElement.appendChild(n):/^\s*$/.test(e)&&this.doc.appendChild(n),this.locator&&Ho(this.locator,n)}},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){e&&(e.lineNumber=0),this.locator=e},comment:function(e,t,r){e=Vo.apply(this,arguments);var n=this.doc.createComment(e);this.locator&&Ho(this.locator,n),$o(this,n)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e,t,r,n){var o=this.doc.implementation;if(o&&o.createDocumentType){var i=o.createDocumentType(e,t,r,n);this.locator&&Ho(this.locator,i),$o(this,i),this.doc.doctype=i}},reportError:function(e,t){if("function"==typeof this.onError)try{this.onError(e,t,this)}catch(ti){throw new Bo("Reporting "+e+' "'+t+'" caused '+ti,this.locator)}else console.error("[xmldom "+e+"]\t"+t,function(e){if(e)return"\n@#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}(this.locator))},warning:function(e){this.reportError("warning",e)},error:function(e){this.reportError("error",e)},fatalError:function(e){throw this.reportError("fatalError",e),new Bo(e,this.locator)}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,(function(e){Wo.prototype[e]=function(){return null}})),oo.__DOMHandler=Wo,oo.DOMParser=Go,oo.normalizeLineEndings=jo,oo.onErrorStopParsing=function(e){if("error"===e)throw"onErrorStopParsing"},oo.onWarningStopParsing=function(){throw"onWarningStopParsing"};var zo=et;zo.assign,zo.hasDefaultHTMLNamespace,zo.isHTMLMimeType,zo.isValidMimeType,zo.MIME_TYPE,zo.NAMESPACE;var Yo=oo.DOMParser;function Ko(e){const t=e.coordinates,r=t[0],n=t[t.length-1];return{type:"Polygon",coordinates:[r[0]===n[0]&&r[1]===n[1]?t:[...t,r]]}}const Jo=Object.freeze(Object.defineProperty({__proto__:null,lineStringToPolygon:Ko,osmStringToGeojson:function(e){const t=(new Yo).parseFromString(e,"text/xml");return Ze(t)}},Symbol.toStringTag,{value:"Module"}));const Xo=class e{static parsePointProperties(e){return e.properties?{...e.id&&{externalId:e.id},...l.OsmTagsUtils.elementName(e.properties)&&{name:l.OsmTagsUtils.elementName(e.properties)},...l.OsmTagsUtils.isGate(e.properties)&&{isGate:!0},...l.OsmTagsUtils.isSubwayEntrance(e.properties)&&{isSubwayEntrance:!0},...l.OsmTagsUtils.getRef(e.properties)&&{subwayEntrsanceRef:l.OsmTagsUtils.getRef(e.properties)},...l.OsmTagsUtils.isElevator(e.properties)&&{isElevator:!0},...l.OsmTagsUtils.isTurnstile(e.properties)&&{isTurnstile:!0}}:{...e.id&&{externalId:e.id}}}static parseLineStringProperties(e){return e.properties?{...e.properties.id&&{externalId:e.properties.id},...e.id&&{externalId:e.id},...l.OsmTagsUtils.elementName(e.properties)&&{name:l.OsmTagsUtils.elementName(e.properties)},...l.OsmTagsUtils.isOneway(e.properties)&&{isOneway:!0},...l.OsmTagsUtils.areStairs(e.properties)&&{areStairs:!0},...l.OsmTagsUtils.isElevator(e.properties)&&{isElevator:!0},...l.OsmTagsUtils.isEscalator(e.properties)&&{areEscalators:!0},...l.OsmTagsUtils.isMovingWalkway(e.properties)&&{isMovingWalkway:!0},...l.OsmTagsUtils.needTicket(e.properties)&&{needTicket:!0},...l.OsmTagsUtils.getIncline(e.properties)&&{incline:l.OsmTagsUtils.getIncline(e.properties)},...l.OsmTagsUtils.getWheelchair(e.properties)&&{wheelchair:l.OsmTagsUtils.getWheelchair(e.properties)},...l.OsmTagsUtils.getSmoothness(e.properties)&&{smoothness:l.OsmTagsUtils.getSmoothness(e.properties)},...l.OsmTagsUtils.getSurface(e.properties)&&{surface:l.OsmTagsUtils.getSurface(e.properties)}}:{...e.id&&{externalId:e.id}}}static createGraphFromGeojsonString(e){const t=JSON.parse(e);return this.createGraphFromGeojson(t)}static createGraphFromGeojson(t,n=e.DEFAULT_FEATURE_SELECTOR){const o=function(e){return"FeatureCollection"===e.type?e.features:"Feature"===e.type?[e]:[{type:"Feature",geometry:e,properties:{}}]}(t),i=o.filter(n),s=[],c=[];let d=0;const m=(e,t)=>{const n=new r.Coordinates(e[1],e[0],null,t);let o=c.find((e=>!!e.coords.equalsWithoutLevel(n)&&(!!r.Level.intersect(e.coords.level,t)||(null===e.coords.level||null===t))))||null;return o?(r.Level.equals(o.coords.level,t)||(o.coords.level=r.Level.intersection(o.coords.level,t),null===o.coords.level&&(o.coords.level=t)),o):(o=new p(n),o.id=d++,c.push(o),o)};i.filter((e=>"LineString"===e.geometry.type)).forEach((e=>{const t=e.geometry,n=e.properties||{},o=this.parseLineStringProperties(e),i="level"in n?n.level:null,a=e=>{for(let r=1;r<t.coordinates.length;r++){let i=m(t.coordinates[r-1],e),a=m(t.coordinates[r],e);if(l.OsmTagsUtils.isOnewayBackward(n)){const e=a;a=i,i=e}const c=new u(i,a,o);s.push(c)}};a(r.Level.fromString(i)),"repeat_on"in n&&n.repeat_on.split(";").map(r.Level.fromString).forEach(a)}));const f=[],g=[];o.filter((e=>"Point"===e.geometry.type)).forEach((e=>{const t=e.properties||{},n=e.geometry,o="level"in t?t.level:null,i=r.Level.fromString(o),s=new r.Coordinates(n.coordinates[1],n.coordinates[0],null,i),a=c.filter((e=>!!r.Coordinates.equalsWithoutLevel(e.coords,s)&&(!!r.Level.intersect(e.coords.level,i)||(null===e.coords.level||null===i))));if(a.forEach((t=>{t.properties=this.parsePointProperties(e),null!==i&&(t.coords.level=r.Level.union(t.coords.level,i))})),l.OsmTagsUtils.isElevator(t)){const e=((e,t)=>{const n=new r.Coordinates(e[1],e[0],null,t),o=[];return c.forEach((e=>{r.Coordinates.equalsWithoutLevel(e.coords,n)&&r.Level.intersect(e.coords.level,t)&&o.push(e)})),o})(n.coordinates,i);e.length>0&&f.push({vertices:e,props:{name:t.name,isElevator:!0,externalId:t.id}})}l.OsmTagsUtils.isRoutingBoundsEntryPoint(t)&&a.forEach((e=>{g.push(e)}))})),o.filter((e=>"Polygon"===e.geometry.type&&e.properties&&l.OsmTagsUtils.isElevator(e.properties))).filter((e=>{const t=e.geometry;return!f.flatMap((({vertices:e})=>e)).some((e=>a([e.coords.lng,e.coords.lat],t)))})).forEach((e=>{var t,n;const o=e,i=o.geometry.coordinates[0].map((e=>c.filter((t=>t.coords.equalsWithoutLevel(new r.Coordinates(e[1],e[0],null,t.coords.level)))))).flat(),a=o.geometry.coordinates[0].slice(0,-1),l=a.reduce(((e,t)=>[e[0]+t[0],e[1]+t[1]]),[0,0]).map((e=>e/a.length)),d=i.reduce(((e,t)=>r.Level.union(e,t.coords.level)),null),p=new r.Coordinates(l[1],l[0],null,d),h=[];i.forEach((t=>{var r;const n=m([p.lng,p.lat],t.coords.level);s.push(new u(n,t,{externalId:null==(r=e.properties)?void 0:r.id})),h.push(n)})),f.push({vertices:h,props:{name:null==(t=e.properties)?void 0:t.name,isElevator:!0,externalId:null==(n=e.properties)?void 0:n.id}})})),f.forEach((({vertices:e,props:t})=>{for(let r=0;r<e.length;r++)for(let n=r+1;n<e.length;n++)s.push(new u(e[r],e[n],t));if(1===e.length&&null===e[0].coords.level){const r=e[0],n=s.filter((e=>e.vertex1===r||e.vertex2===r));if(n.length>1){const e=[r];for(let t=1;t<n.length;t++){const o=new p(r.coords,r.properties);o.id=d++,c.push(o),n[t].vertex1===r?n[t].vertex1=o:n[t].vertex2=o,e.push(o)}for(let r=0;r<e.length;r++)for(let n=r+1;n<e.length;n++)s.push(new u(e[r],e[n],t))}}}));const v={type:"MultiPolygon",coordinates:[]};return o.filter((e=>e.properties&&l.OsmTagsUtils.isRoutingBounds(e.properties))).forEach((e=>{if("LineString"===e.geometry.type){const t=Ko(e.geometry);v.coordinates.push(t.coordinates)}else"Polygon"===e.geometry.type?v.coordinates.push(e.geometry.coordinates):"MultiPolygon"===e.geometry.type&&v.coordinates.push(...e.geometry.coordinates)})),new h(c,s,v.coordinates.length>0?v:void 0,g)}};t(Xo,"RESTRICTED_PEDESTRIANS_HIGHWAYS",["motorway","motorway_link"]),t(Xo,"DEFAULT_FEATURE_SELECTOR",(e=>{if(!e.properties)return!1;if("LineString"===e.geometry.type){if("yes"===e.properties.foot)return!0;if(["no","private"].includes(e.properties.access))return!1;if("highway"in e.properties)return!Xo.RESTRICTED_PEDESTRIANS_HIGHWAYS.includes(e.properties.highway);if("sidewalk"===e.properties.footway)return!0}return!("elevator"!==e.properties.highway||!["Point","Polygon"].includes(e.type))}));let Qo=Xo;const Zo=class e{static parseNodeProperties(e){return{...e.id&&{externalId:e.id},...l.OsmTagsUtils.elementName(e.tags)&&{name:l.OsmTagsUtils.elementName(e.tags)},...l.OsmTagsUtils.isGate(e.tags)&&{isGate:!0},...l.OsmTagsUtils.isSubwayEntrance(e.tags)&&{isSubwayEntrance:!0},...l.OsmTagsUtils.getRef(e.tags)&&{subwayEntrsanceRef:l.OsmTagsUtils.getRef(e.tags)},...l.OsmTagsUtils.isTurnstile(e.tags)&&{isTurnstile:!0}}}static parseWayProperties(e){return{...e.id&&{externalId:e.id},...l.OsmTagsUtils.elementName(e.tags)&&{name:l.OsmTagsUtils.elementName(e.tags)},...l.OsmTagsUtils.isOneway(e.tags)&&{isOneway:l.OsmTagsUtils.isOneway(e.tags)},...l.OsmTagsUtils.areStairs(e.tags)&&{areStairs:l.OsmTagsUtils.areStairs(e.tags)},...l.OsmTagsUtils.isElevator(e.tags)&&{isElevator:l.OsmTagsUtils.isElevator(e.tags)},...l.OsmTagsUtils.isEscalator(e.tags)&&{areEscalators:l.OsmTagsUtils.isEscalator(e.tags)},...l.OsmTagsUtils.isMovingWalkway(e.tags)&&{isMovingWalkway:l.OsmTagsUtils.isMovingWalkway(e.tags)},...l.OsmTagsUtils.needTicket(e.tags)&&{needTicket:l.OsmTagsUtils.needTicket(e.tags)},...l.OsmTagsUtils.getIncline(e.tags)&&{incline:l.OsmTagsUtils.getIncline(e.tags)},...l.OsmTagsUtils.getWheelchair(e.tags)&&{wheelchair:l.OsmTagsUtils.getWheelchair(e.tags)},...l.OsmTagsUtils.getSmoothness(e.tags)&&{smoothness:l.OsmTagsUtils.getSmoothness(e.tags)},...l.OsmTagsUtils.getSurface(e.tags)&&{surface:l.OsmTagsUtils.getSurface(e.tags)}}}static createGraphFromOsmXmlString(e){const t=l.OsmParser.parseOsmXmlString(e);return this.createGraphFromOsmModel(t)}static createGraphFromOsmModel(t,n=e.DEFAULT_WAY_SELECTOR,o){const i=[],s=[],c=[],d=new Set,m=(e,t)=>{var n;let o=(null==(n=s.find((([n,o])=>n===e.id&&(!!r.Level.intersect(o.coords.level,t)||(null===o.coords.level||null===t)))))?void 0:n[1])||null;if(o)return r.Level.equals(o.coords.level,t)||(o.coords.level=r.Level.intersection(o.coords.level,t),null===o.coords.level&&(o.coords.level=t)),o;const i=new r.Coordinates(e.coords.lat,e.coords.lng,null,t);if(o=new p(i,this.parseNodeProperties(e)),s.push([e.id,o]),l.OsmTagsUtils.isElevator(e.tags)){let t=c.find((([t])=>e.id===t));t||(t=[e.id,e.name,[]],c.push(t)),t[2].push(o)}return l.OsmTagsUtils.isRoutingBoundsEntryPoint(e.tags)&&d.add(o),o};t.ways.forEach((e=>{if(!n(e))return;const t=this.parseWayProperties(e),o=r=>{for(let n=1;n<e.nodes.length;n++){let o=m(e.nodes[n-1],r),s=m(e.nodes[n],r);if(l.OsmTagsUtils.isOnewayBackward(e.tags)){const e=s;s=o,o=e}const a=new u(o,s,t);i.push(a)}};o(e.level),e.tags.repeat_on&&e.tags.repeat_on.split(";").map(r.Level.fromString).forEach(o)}));let f=-1;t.ways.filter((e=>l.OsmTagsUtils.isElevator(e.tags)&&e.isGeometryClosed)).filter((e=>{const t=e.getGeoJsonPolygon();return!c.flatMap((([,,e])=>e)).some((e=>a([e.coords.lng,e.coords.lat],t)))})).forEach((e=>{const t=e.nodes.map((e=>s.filter((([t])=>t===e.id)).map((e=>e[1])))).flat(),n=e.nodes.reduce(((e,t)=>[e[0]+t.coords.lat,e[1]+t.coords.lng]),[0,0]).map((t=>t/e.nodes.length)),o=t.reduce(((e,t)=>r.Level.union(e,t.coords.level)),null),a=new r.Coordinates(n[0],n[1],null,o),c=new l.OsmNode(f--,a,{highway:"elevator"});t.forEach((t=>{const r=m(c,t.coords.level);i.push(new u(r,t,{externalId:e.id}))}))})),c.forEach((([e,t,r])=>{const n={name:t,isElevator:!0,externalId:e};for(let o=0;o<r.length;o++)for(let e=o+1;e<r.length;e++)i.push(new u(r[o],r[e],n));if(1===r.length&&null===r[0].coords.level){const e=r[0],t=i.filter((t=>t.vertex1===e||t.vertex2===e));if(t.length>1){const r=[e];for(let n=1;n<t.length;n++){const o=new p(e.coords,e.properties);s.push([e.id,o]),t[n].vertex1===e?t[n].vertex1=o:t[n].vertex2=o,r.push(o)}for(let e=0;e<r.length;e++)for(let t=e+1;t<r.length;t++)i.push(new u(r[e],r[t],n))}}}));const g={type:"MultiPolygon",coordinates:[]};return t.ways.filter((e=>l.OsmTagsUtils.isRoutingBounds(e.tags))).map((e=>e.getGeoJsonPolygon())).forEach((e=>e&&g.coordinates.push(e.coordinates))),t.relations.filter((e=>l.OsmTagsUtils.isRoutingBounds(e.tags))).map((e=>e.getGeoJsonPolygon())).forEach((e=>e&&g.coordinates.push(e.coordinates))),null==o||o(s),new h(s.map((e=>e[1])),i,g.coordinates.length>0?g:void 0,Array.from(d))}};t(Zo,"RESTRICTED_PEDESTRIANS_HIGHWAYS",["motorway","motorway_link"]),t(Zo,"DEFAULT_WAY_SELECTOR",(e=>{if("yes"===e.tags.area)return!1;if("yes"===e.tags.foot)return!0;if(e.tags.access&&["no","private"].includes(e.tags.access))return!1;const t="elevator"===e.tags.highway&&e.isGeometryClosed;return e.tags.highway&&!Zo.RESTRICTED_PEDESTRIANS_HIGHWAYS.includes(e.tags.highway)&&!t||"sidewalk"===e.tags.footway||"platform"===e.tags.public_transport||"platform"===e.tags.railway}));let ei=Zo;exports.CitywayRemoteRouter=pe,exports.CustomGraphMap=Ge,exports.CustomGraphMapTester=class{static createReportFromOsmXmlString(e){let t;try{t=l.OsmParser.parseOsmXmlString(e)}catch(ti){return{errors:[{type:"could-not-parse-file",details:ti instanceof Error?ti.message:"Unknown error"}]}}const r=new Ge(ei.createGraphFromOsmModel(t));return this.createReportFromCustomGraphMap(r)}static createReportFromGeoJsonString(e){let t;try{t=JSON.parse(e)}catch(ti){return{errors:[{type:"could-not-parse-file",details:ti instanceof Error?ti.message:"Unknown error"}]}}return this.createReportFromGeoJson(t)}static createReportFromGeoJson(e){const t=new Ge(Qo.createGraphFromGeojson(e));return this.createReportFromCustomGraphMap(t)}static createReportFromCustomGraphMap(e){const t=e.graph,r=[];t.routingBounds||r.push({type:"routing-bounds-not-found"}),0===t.routingBoundsEntryPoints.length&&r.push({type:"routing-bounds-entry-points-not-found"});const n=e.router.calculateComponents();return n.length>1&&r.push({type:"multiple-graph-components",data:n}),{customGraphMap:e,errors:r}}static reportToJson(e){var t,r;return{graph:null==(r=null==(t=e.customGraphMap)?void 0:t.graph)?void 0:r.toJson(),errors:e.errors.map((e=>"multiple-graph-components"===e.type?{type:e.type,data:e.data.map((e=>e.map((e=>e.id))))}:("routing-bounds-entry-points-not-found"===e.type||e.type,{type:e.type})))}}},exports.DeutscheBahnRemoteRouter=be,exports.Edge=u,exports.GeoJsonGraphUtils=Qo,exports.GeoJsonUtils=Jo,exports.GeoveloRemoteRouter=_e,exports.Graph=h,exports.GraphProjection=d,exports.GraphRoute=E,exports.GraphRouter=Q,exports.GraphRouterOptionsBuilder=Y,exports.IdfmRemoteRouter=Re,exports.Itinerary=S,exports.ItineraryInfoManager=class{constructor(e=null){t(this,"_itinerary",null),t(this,"_graph",null),t(this,"_steps",[]),t(this,"_coordsNextStep",[]),t(this,"_coordsPreviousStep",[]),t(this,"_coordsDistanceTraveled",[]),t(this,"_coordsLeg",[]),t(this,"_itineraryDistanceWithoutProjections",0),this.itinerary=e}get itinerary(){return this._itinerary}set itinerary(e){if(null===e)return void(this._itinerary=null);this._itinerary=e,this._steps=e.steps,this._graph=e.toGraph(),this._coordsNextStep=new Array(e.coords.length),this._coordsPreviousStep=new Array(e.coords.length),this._coordsDistanceTraveled=new Array(e.coords.length),this._coordsLeg=new Array(e.coords.length),this._itineraryDistanceWithoutProjections=e.distance;let t=0,r=null,n=this._steps[0],o=0;e.coords.forEach(((i,s,a)=>{0!==s&&(o+=a[s-1].distanceTo(i)),this._coordsNextStep[s]=n,this._coordsPreviousStep[s]=r,this._coordsDistanceTraveled[s]=o,this._coordsLeg[s]=e.legs.find((e=>e.coords.includes(i))),t<this._steps.length&&this._steps[t].coords.equals(i)&&(r=this._steps[t],n=t===this._steps.length-1?null:this._steps[t+1],t++)}))}getInfo(e){if(!this._itinerary||!this._graph)return null;const t=this._graph.getProjection(e);if(!t)return null;let r=null;if(t.nearestElement instanceof p){const e=this._itinerary.coords.findIndex((e=>t.nearestElement.coords===e));if(-1===e)throw new Error("ItineraryInfoManager: could not find projection in itinerary (Node)");const n=this._coordsDistanceTraveled[e],o=n,i=this._itineraryDistanceWithoutProjections-n,s=t.distanceFromNearestElement+i,a=o/(o+s),l=1-a;r={nextStep:this._coordsNextStep[e],previousStep:this._coordsPreviousStep[e],projection:t,leg:this._coordsLeg[e],traveledDistance:n,remainingDistance:s,traveledPercentage:a,remainingPercentage:l}}else if(t.nearestElement instanceof u){let e=t.nearestElement.vertex1.coords,n=this._itinerary.coords.findIndex((t=>e===t));if(-1===n)throw new Error("ItineraryInfoManager: could not find projection in itinerary (Edge)");n!==this._itinerary.coords.length-1&&this._itinerary.coords[n+1]===t.nearestElement.vertex2.coords||(e=t.nearestElement.vertex2.coords,n--);const o=this._coordsDistanceTraveled[n]+t.coords.distanceTo(e),i=o,s=this._itineraryDistanceWithoutProjections-o,a=t.distanceFromNearestElement+s,l=i/(i+a),c=1-l;r={nextStep:this._coordsNextStep[n+1],previousStep:this._coordsPreviousStep[n+1],projection:t,leg:this._coordsLeg[n+1],traveledDistance:i,remainingDistance:a,traveledPercentage:l,remainingPercentage:c}}return r}},exports.Leg=_,exports.NavitiaRemoteRouter=ye,exports.NoRouteFoundError=Z,exports.OsmGraphUtils=ei,exports.OsrmRemoteRouter=De,exports.OtpRemoteRouter=Ue,exports.RemoteRouterManager=je,exports.RemoteRoutingError=oe,exports.RoutingError=re,exports.StatusCode=te,exports.TictactripRemoteRouter=Be,exports.Vertex=p,exports.WemapMultiRemoteRouter=Pe,exports.WemapMultiRouter=class{constructor(){t(this,"maps",[])}get rname(){return"wemap-multi"}addIOMap(e){this.maps.push(e)}removeIOMap(e){this.maps=this.maps.filter((t=>t!==e))}removeAllMaps(){this.maps=[]}getMapByName(e){return this.maps.find((t=>t.name===e))}async getItineraries(e,t=[],r=this.maps){const{origin:n,destination:o}=e;t=t.filter((({name:e})=>e!==Pe.rname))||[];const i=r;if(!i.length)return await je.getItinerariesWithFallback(e,t);let s,a;const l=i.find((e=>e.isPointInside(n))),c=Y.fromJson(e.itineraryModifiers||{});if(l&&l.isPointInside(o)){if(s=l.getRouteInsideMap(n,o,c),!s)throw ne.notFound(l.name||"");return[S.fromGraphRoute(s)]}const u=i.find((e=>e.isPointInside(o)));let d;if(!l&&!u)return await je.getItinerariesWithFallback(e,t);if(l&&!u){if(!l.entryPoints.length)throw ne.notFound(l.name||"",`A map including the "origin" but the "destination" has been \n found (${l.name}), however, no "entrypoints" have been found to go out`);const r=e=>`Tried to calculate an itinerary from "origin" to "entrypoints" using wemap router on local map "${l.name}" and an itinerary from "entrypoints" to "destination" using remote routers (${t.map((e=>e.name)).join(", ")}), but failed. Details: ${e}.`;if(s=l.getBestRouteFromOriginToEntryPoints(n,o,c),!s){const e=`No route found from ${n.toString()} to entry points in map: ${l.name}`;throw ne.notFound(l.name||"",r(e))}const i={...e,origin:s.end,destination:o,waypoints:[]};try{d=await je.getItinerariesWithFallback(i,t)}catch(ti){throw ti instanceof oe&&(ti.message=r(ti.message)),ti}return a=S.fromGraphRoute(s),d.map((e=>S.fromItineraries(a,e)))}if(!l&&u){if(!u.entryPoints.length)throw ne.notFound(u.name||"",`A map including the "destination" but the "origin" has been \n found (${u.name}), however, no "entrypoints" have been found to go in`);const r=e=>`Tried to calculate an itinerary from "origin" to "entrypoints" using remote routers (${t.map((e=>e.name)).join(", ")}) and an itinerary from "entrypoints" to "destination" using wemap router on local map "${u.name}", but failed. Details: ${e}.`;if(s=u.getBestRouteFromEntryPointsToDestination(n,o,c),!s){const e=`No route found from entry points to ${o.toString()} in map: ${u.name}`;throw ne.notFound(u.name||"",r(e))}const i={...e,origin:n,destination:s.start,waypoints:[]};try{d=await je.getItinerariesWithFallback(i,t)}catch(ti){throw ti instanceof oe&&(ti.message=r(ti.message)),ti}return a=S.fromGraphRoute(s),d.map((e=>S.fromItineraries(e,a)))}if(l&&u){if(!l.entryPoints.length)throw ne.notFound(l.name||"",`One map including the "origin" (${l.name}) and another \n including the "destination" (${u.name}) has been found, however, no "entrypoints" have \n been found to go out of the origin map`);if(!u.entryPoints.length)throw ne.notFound(u.name||"",`One map including the "origin" (${l.name}) and another \n including the "destination" (${u.name}) has been found, however, no "entrypoints" have \n been found to go in the second map`);const r=e=>`Tried to calculate an itinerary from "origin" to "entrypoints1" using wemap router on local map "${l.name}", an itinerary from "entrypoints1" to "entrypoints2" using remote routers (${t.map((e=>e.name)).join(", ")}) and an itinerary from "entrypoints2" to "destination" using wemap router on local map "${u.name}", but failed. Details: ${e}.`,i=l.getBestRouteFromOriginToEntryPoints(n,o,c);if(!i){const e=`No route found from ${n.toString()} to entry points in map: ${l.name}`;throw ne.notFound(l.name||"",r(e))}const s=u.getBestRouteFromEntryPointsToDestination(n,o,c);if(!s){const e=`No route found from entry points to ${o.toString()} in map: ${u.name}`;throw ne.notFound(u.name||"",r(e))}const a={...e,origin:i.end,destination:s.start,waypoints:[]};try{d=await je.getItinerariesWithFallback(a,t)}catch(ti){throw ti instanceof oe&&(ti.message=r(ti.message)),ti}return d.map((e=>S.fromItineraries(S.fromGraphRoute(i),e,S.fromGraphRoute(s))))}throw new Error("Should never happen")}},exports.WemapMultiRoutingError=ne,exports.areTransitAndTravelModeConsistent=v,exports.getDirectionFromAngle=f,exports.getDurationFromLength=m,exports.isStepLevelChange=w,exports.isTransitModePublicTransport=g,exports.routerRequestToJson=function(e){const{origin:t,destination:r,waypoints:n,...o}=e;return{origin:t.toJson(),destination:r.toJson(),...n&&{waypoints:n.map((e=>e.toJson()))},...o}};
11
11
  //# sourceMappingURL=index.js.map