@aibee/crc-bmap 0.6.14 → 0.6.15
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/lib/bmap.cjs.min.js +1 -1
- package/lib/bmap.cjs.min.js.map +2 -2
- package/lib/bmap.esm.js +8 -2
- package/lib/bmap.esm.js.map +2 -2
- package/lib/bmap.esm.min.js +2 -2
- package/lib/bmap.esm.min.js.map +2 -2
- package/lib/bmap.min.js +2 -2
- package/lib/bmap.min.js.map +2 -2
- package/lib/src/plugins/navigation/position-navigation.d.ts +3 -0
- package/package.json +1 -1
package/lib/bmap.cjs.min.js
CHANGED
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
}
|
|
103
103
|
`,r=-1/0,i=this.geometry.getAttribute("position");if(i)for(let a=0;a<i.count;a++){let l=i.getZ(a);l>r&&(r=l)}let o=new L.ShaderMaterial({uniforms:{maxZ:{value:r},uColor:{value:new L.Color(this.options[0].fillColor).convertLinearToSRGB()},uColor2:{value:new L.Color(pt(this.options[0].fillColor)).convertLinearToSRGB()},uOpacity:{value:this.options[0].fillOpacity}},vertexShader:t,fragmentShader:n,transparent:!0});this.material=o}initLineMaterial(){let t=I.createLineMaterial({color:this.options[0].strokeColor,opacity:this.options[0].strokeOpacity});return this.lineMaterial=t,t}initMesh(){this.mesh&&this.remove(this.mesh),this.mesh=new L.Mesh(this.geometry,this.material),this.add(this.mesh)}getBorderPoints(){let t=[],n=this.options[0].height+this.options[0].deltaHeight;return this.options.map(r=>{let{coords:i}=r.geometry;for(let o=0;o<i.length;o++){let a=i[o];for(let l=0;l<a.length;l++){let u=a[l],c=l+1===a.length?a[0]:a[l+1];t.push(new L.Vector3(u[0],u[1],n)),t.push(new L.Vector3(c[0],c[1],n))}}}),t}initLineGeometry(){this.lineGeometry&&this.lineGeometry.dispose();let t=this.getBorderPoints(),n=new L.BufferGeometry().setFromPoints(t);this.lineGeometry=n}createBorder(){this.line&&this.remove(this.line);let t=new L.LineSegments(this.lineGeometry,this.lineMaterial);return t.position.z=.01,this.line=t,this.add(t),t}dispose(){this.geometry.dispose(),this.material.dispose(),this.line?.geometry.dispose(),this.clear()}};var U=require("three");var Rr=require("lodash"),Vi={text:"",icon:"",icon_size:[18,18],level:1,collision_enable:!0,opacity:1,id:"",position:{x:0,y:0,z:0},text_font_size:14,icon_rotate:0,depth_test:!1},q=class extends U.Object3D{constructor(t,n){super();this.context=t;this.options=At((0,Rr.cloneDeep)({...Vi,...n}),this),this.position.set(this.options.position.x,this.options.position.y,this.options.position.z),this.registryEvent(),this.init()}options;textAspect=1;spriteText;spriteIcon;box=new U.Box2;boxHelper;_initIconPromise=null;get durIconAndText(){return this.options.icon&&this.options.text?2:0}get offset(){return this.options.icon&&this.options.text?0:.5}get iconWidth(){return this.options.icon?this.options.icon_size[0]:0}get iconHeight(){return this.options.icon?this.options.icon_size[1]:0}get textWidth(){return this.options.text?this.options.text_font_size*this.textAspect:0}get textHeight(){return this.options.text?this.options.text_font_size:0}get deltaZ(){return!this.options.icon&&this.options.text?.1+this.offset*(this.iconHeight+this.durIconAndText+this.textHeight)/this.context.camera.zoom:.1}get canSelect(){return this.visible&&(this.spriteIcon?this.spriteIcon.visible:!0)&&(this.spriteText?this.spriteText.visible:!0)}registryEvent(){this.context.addEventListener("control-zoom-change",this._initScale),this.addEventListener("change-icon",async({value:t})=>{this._initIconPromise&&await this._initIconPromise,this.spriteIcon&&(this.remove(this.spriteIcon),this.spriteIcon=void 0),await this.initIcon(),this.initSize(),this._initScale({zoom:this.context.camera.zoom})}),this.addEventListener("change-text",({value:t})=>{this.spriteText&&(this.remove(this.spriteText),this.spriteText=void 0),this.initText(),this.initSize(),this._initScale({zoom:this.context.camera.zoom})}),this.addEventListener("change-icon_rotate",({value:t})=>{this.spriteIcon&&(this.spriteIcon.material.rotation=t/180*Math.PI)}),this.addEventListener("change-icon_size",({value:t})=>{this.spriteIcon&&this._initScale({zoom:this.context.camera.zoom})}),this.addEventListener("change-depth_test",({value:t})=>{this.spriteIcon&&(this.spriteIcon.material.depthTest=t),this.spriteText&&(this.spriteText.material.depthTest=t)})}unRegistryEvent(){this.context.removeEventListener("control-zoom-change",this._initScale)}getPosition(){return this.position}async initIcon(){if(this.options.icon)return this._initIconPromise=new Promise(async t=>{let n=await xt.getTextureByUrl(this.options.icon),r=new U.Sprite(new U.SpriteMaterial({map:n,transparent:!0,alphaTest:.2,depthTest:this.options.depth_test,rotation:this.options.icon_rotate/180*Math.PI}));r.visible=!1,r.renderOrder=1e5+this.options.level,n.needsUpdate=!0,this.add(r),this.spriteIcon=r,t(r)}).then(()=>{this._initIconPromise=null})}initText(){if(this.options.text){let t=vt.getTextureByText(this.options.text);this.textAspect=t.image.width/t.image.height;let n=new U.Sprite(new U.SpriteMaterial({map:t,transparent:!0,alphaTest:.2,depthTest:this.options.depth_test}));n.visible=!1,n.renderOrder=100001+this.options.level,t.needsUpdate=!0,this.spriteText=n,this.add(n)}}initSize(){let t=0,n=0,{icon:r,text:i}=this.options;r?i?(t=0,n=t*(this.iconHeight/this.textHeight)-this.iconHeight/this.textHeight-this.durIconAndText/this.textHeight):(t=.5,n=0):i?(n=.5,t=0):(t=0,n=0),this.spriteIcon?.center.set(.5,t),this.spriteText?.center.set(.5,n)}async init(){await this.initIcon(),this.initText(),this.initSize(),this._initScale({zoom:this.context.camera.zoom})}_initScale=({zoom:t})=>{if(this.spriteText){let n=this.textHeight/t;this.spriteText.scale.set(this.textAspect*n,n,.1)}this.spriteIcon&&this.spriteIcon?.scale.set(this.options.icon_size[0]/t,this.options.icon_size[1]/t,.1),this.resetZ()};resetZ(){let t=this.deltaZ;this.spriteIcon&&(this.spriteIcon.position.z=t),this.spriteText&&(this.spriteText.position.z=t)}getBox(t){let{clientSize:{width:n,height:r}}=this.context,i=n*(t.x+1)/2,o=r*(-t.y+1)/2;o+=this.offset*(this.iconHeight+this.durIconAndText+this.textHeight);let a=this.iconWidth/2,l=new U.Box2(new U.Vector2(i-a,o-this.iconHeight),new U.Vector2(i+a,o)),u=this.textWidth/2,c=new U.Box2(new U.Vector2(i-u,o-this.textHeight-this.durIconAndText-this.iconHeight),new U.Vector2(i+u,o-this.iconHeight-this.durIconAndText));return this.box=c.union(l),this.box}renderBoxHelper(t,n){if(!this.boxHelper){let r=document.createElement("div");r.style.position="absolute",r.style.zIndex="999",r.style.border="1px solid red",r.style.pointerEvents="none",this.boxHelper=r,this.context.container.appendChild(r)}t&&n?(this.boxHelper.style.left=t+"px",this.boxHelper.style.top=n+"px",this.boxHelper.style.width="2px",this.boxHelper.style.height="2px"):(this.boxHelper.style.left=this.box.min.x+"px",this.boxHelper.style.top=this.box.min.y+"px",this.boxHelper.style.width=this.box.max.x-this.box.min.x+"px",this.boxHelper.style.height=this.box.max.y-this.box.min.y+"px")}parentSetVisible(t){this.spriteText&&(this.spriteText.visible=t),this.spriteIcon&&(this.spriteIcon.visible=t),this.boxHelper&&(this.boxHelper.style.display=t?"block":"none")}dispose(){this.unRegistryEvent(),this.spriteText=void 0}};var Q=require("three"),Lr=require("three/examples/jsm/utils/BufferGeometryUtils");var Nr={airHeight:0,deltaHeight:0,height:0,geometry:{cds:[],type:"polygon",coords:[],curveCpt:[],curveIndex:[]},texts:[],fillColor:"#ffffff",fillOpacity:0,strokeColor:"#ffffff",strokeOpacity:0,secondHeight:0,secondRotate:0,center_x:0,center_y:0},de=class extends Q.Object3D{constructor(t,n){super();this.context=t;this.options=n.map(r=>({...Nr,...r})),this.init()}options;mesh;async init(){let t=this.options.map(a=>vt.getTextureByText(a.texts[0],{fillStyle:Me(a.fillColor,a.fillOpacity),strokeStyle:Me(a.strokeColor,a.strokeOpacity),lineWidth:6,font:"54px sans-serif"})),n=t.map((a,l)=>{let u=this.options[l],{width:c,height:h}=a.image,p=c/h,d=u.secondHeight*p,m=new Q.PlaneGeometry(d,u.secondHeight),f=new Q.Matrix4().makeTranslation(u.center_x,u.center_y,u.airHeight+u.deltaHeight+u.height).multiply(new Q.Matrix4().makeRotationZ(u.secondRotate));return m.applyMatrix4(f),m}),r=(0,Lr.mergeGeometries)(n,!0);n.forEach(a=>a.dispose());let i=t.map(a=>{let l=new Q.MeshBasicMaterial({map:a,alphaTest:1,side:Q.DoubleSide});return a.needsUpdate=!0,l}),o=new Q.Mesh(r,i);this.mesh=o,this.position.z+=.004,this.add(o)}dispose(){this.mesh?.geometry.dispose(),(this.mesh?.material).forEach(t=>t.dispose()),this.clear()}};var Dr=require("three"),Le=class extends J{startPoint;endPoint;rect;frustum=new Dr.Frustum;constructor(e){super(e);let{config:{selectBox:{fill:t,stroke:n}}}=e;this.rect=mt(n,t),this.svg.appendChild(this.rect),this.registryEvent()}setEnable(e){super.setEnable(e),B(this.rect,0,0,0,0),e?this.registryEvent():(this.startPoint=void 0,this.unRegistryEvent())}onPointerDown=e=>{if(!this.enable)return;let t=this.getIntersectByPointerEvent(e);t&&(this.startPoint=t),this.endPoint=void 0};onPointerMove=e=>{if(!this.enable||!this.startPoint)return;let t=this.getIntersectByPointerEvent(e);t&&(this.endPoint=t)};onPointerUp=e=>{if(!this.enable)return;let t=this.getIntersectByPointerEvent(e);t&&(this.endPoint=t),this.doSelect(),this.startPoint=void 0};onUpdate=()=>{if(this.startPoint){let e=this.getSvgCoordinate(this.startPoint),t={...e};this.endPoint&&(t=this.getSvgCoordinate(this.endPoint));let n={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y)},r=Math.abs(t.x-e.x),i=Math.abs(t.y-e.y);B(this.rect,n.x,n.y,r,i)}else B(this.rect,0,0,0,0)};registryEvent(){this.context.container.addEventListener("pointerdown",this.onPointerDown),this.context.container.addEventListener("pointermove",this.onPointerMove),this.context.container.addEventListener("pointerup",this.onPointerUp),this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.container.removeEventListener("pointerdown",this.onPointerDown),this.context.container.removeEventListener("pointermove",this.onPointerMove),this.context.container.removeEventListener("pointerup",this.onPointerUp),this.context.removeEventListener("update",this.onUpdate)}doSelect(){if(this.startPoint&&this.endPoint){if(this.startPoint.distanceTo(this.endPoint)<.1)return;let{context:{camera:t,container:{clientWidth:n,clientHeight:r}}}=this,i=y(this.startPoint,t,n,r),o=y(this.endPoint,t,n,r),a={x:Math.min(i.x,o.x),y:Math.min(i.y,o.y)},l={x:Math.max(i.x,o.x),y:Math.max(i.y,o.y)},u=this.searchMapInFrustum(a,l);this.dispatchEvent({type:"selected",list:u})}}searchMapInFrustum(e,t){let{context:n}=this;return n.currentFloor?.graphicLayer.children.filter(r=>r instanceof R&&this.searchChildInFrustum(r,e,t))||[]}searchChildInFrustum(e,t,n){let{context:{camera:r,container:{clientWidth:i,clientHeight:o}}}=this;if(!e)return!1;if(!e.mesh){let p=e.getPosition();if(p){let d=y(p,r,i,o);return gt(d,t,n)}return!1}e.mesh.geometry.boundingBox||e.mesh.geometry.computeBoundingBox();let a=e.mesh.geometry.boundingBox;if(!a)return!1;let{min:l,max:u}=a,c=y(l,r,i,o),h=y(u,r,i,o);return!(!gt(c,t,n)||!gt(h,t,n))}dispose(){this.unRegistryEvent()}};var ge=class extends Or.EventDispatcher{constructor(t){super();this.context=t;this.boxSelection=new Le(t),this.boxSelection.setEnable(!1),this.registryEvent()}_list=new Set;boxSelection;prevPanStatus;prevRotateStatus;downPoint=null;isMultipleSelect=!1;get list(){return this._list}enableBoxSelection(){this.isMultipleSelect||!this.context.config.enableBoxSelect||(this.isMultipleSelect=!0,this.boxSelection.setEnable(!0),this.prevPanStatus=this.context.control.enablePan,this.prevRotateStatus=this.context.control.enableRotate,this.context.control.enablePan=!1,this.context.control.enableRotate=!1)}disableBoxSelection(){this.isMultipleSelect&&(this.isMultipleSelect=!1,this.boxSelection.setEnable(!1),this.context.control.enablePan=!!this.prevPanStatus,this.context.control.enableRotate=!!this.prevRotateStatus)}onPointerDown=t=>{this.downPoint={x:t.offsetX,y:t.offsetY}};onPointerUp=t=>{if(!this.downPoint)return;let{offsetX:n,offsetY:r}=t,{x:i,y:o}=this.downPoint;if(Math.sqrt((i-n)**2+(o-r)**2)>3)return;let{graphics:a}=this.context.getGraphicsByDeviceXy(n,r),l=new Set(a.map(c=>c.options.id));this.context.getPoisByDeviceXy(n,r).forEach(c=>{if(!l.has(c.options.id)){let h=this.context.currentFloor?.graphicLayer.graphicMap.get(c.options.id)||null;h&&h.options.geometry.type==="point"&&(a.push(h),l.add(c.options.id))}}),(It?t.metaKey:t.ctrlKey)||this._list.clear(),a.forEach(c=>this._list.add(c)),this.selectEnd(),this.downPoint=null};onPointerOut=t=>{this.disableBoxSelection()};onKeyDown=t=>{Rt(t.key)&&this.enableBoxSelection()};onKeyUp=t=>{Rt(t.key)&&this.disableBoxSelection()};onBoxSelected=({list:t})=>{this._list.clear(),t.forEach(n=>{this._list.add(n)}),this.selectEnd()};selectEnd(){this.dispatchEvent({type:"select",graphics:[...this._list],isMultipleSelect:this.isMultipleSelect})}registryEvent(){this.context.container.addEventListener("pointerdown",this.onPointerDown),this.context.container.addEventListener("pointerup",this.onPointerUp),this.context.container.addEventListener("pointerout",this.onPointerOut),this.context.container.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("keydown",this.onKeyDown),window.addEventListener("keyup",this.onKeyUp),this.boxSelection.addEventListener("selected",this.onBoxSelected)}unRegistryEvent(){this.context.container.removeEventListener("pointerdown",this.onPointerDown),this.context.container.removeEventListener("pointerup",this.onPointerUp),this.context.container.removeEventListener("pointerout",this.onPointerOut),this.context.container.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("keyup",this.onKeyUp),this.boxSelection.removeEventListener("selected",this.onBoxSelected)}clear(){this._list.clear()}remove(t){this._list.delete(t)}dispose(){this.unRegistryEvent()}};var Ne=require("three");var me=class extends Ne.EventDispatcher{constructor(t){super();this.context=t;this.registryEvent()}curGraphics=new Set;timer=new D;graphicTimerMap=new Map;onPointerMove=({graphics:t,pois:n,e:r})=>{let i=n.map(u=>this.context.currentFloor?.graphicLayer.graphicMap.get(u.options.id)).filter(u=>u&&u.options.geometry.type==="point");if(!t.length&&!i.length&&this.curGraphics.size){this.curGraphics.clear(),this.handleHoverGraphicsChange();return}let{time:o}=this.context.config.hover,a=new Set;if(i.length){let u,c=1e4;i.forEach(h=>{let p=n.find(d=>d.options.id===h.options.id);if(p instanceof bt){let{x:d,y:m}=p.clientPos,f=Math.sqrt((d-r.offsetX)**2+(m-r.offsetY)**2);f<c&&(c=f,u=h)}else if(p instanceof q){let{x:d,y:m}=p.box.getCenter(new Ne.Vector2),f=Math.sqrt((d-r.offsetX)**2+(m-r.offsetY)**2);f<c&&(c=f,u=h)}}),a.add(u)}a.size||t.forEach(u=>a.add(u)),a.forEach(u=>{if(this.graphicTimerMap.get(u)||this.curGraphics.has(u))return;let c=this.timer.setTimeout(()=>{this.curGraphics.add(u),this.graphicTimerMap.delete(u),this.timer.clearTimeout(c),this.handleHoverGraphicsChange()},o);this.graphicTimerMap.set(u,c)}),this.graphicTimerMap.forEach((u,c)=>{a.has(c)||(this.timer.clearTimeout(u),this.graphicTimerMap.delete(c))});let l=this.curGraphics.size;this.curGraphics.forEach(u=>{a.has(u)||this.curGraphics.delete(u)}),l!==this.curGraphics.size&&this.handleHoverGraphicsChange()};onPointerLevel=()=>{this.curGraphics.clear(),this.handleHoverGraphicsChange()};onBodyPointerMove=t=>{if(this.curGraphics.size){let n=this.context.container.getBoundingClientRect();(t.clientX<n.left||t.clientX>n.right||t.clientY<n.top||t.clientY>n.bottom)&&this.onPointerLevel()}};handleHoverGraphicsChange(t=this.curGraphics){this.dispatchEvent({type:"hover-change",graphics:Array.from(t)})}registryEvent(){this.context.addEventListener("pointer-over",this.onPointerMove),this.context.addEventListener("pointer-move",this.onPointerMove),this.context.addEventListener("pointer-level",this.onPointerLevel),document.body.addEventListener("pointermove",this.onBodyPointerMove)}unRegistryEvent(){this.context.removeEventListener("pointer-over",this.onPointerMove),this.context.removeEventListener("pointer-move",this.onPointerMove),this.context.removeEventListener("pointer-level",this.onPointerLevel),document.body.removeEventListener("pointermove",this.onBodyPointerMove)}dispose(){this.unRegistryEvent(),this.timer.dispose()}};var Bt=require("three");var De=class{constructor(e){this.context=e;this.registryEvent(),this.changePrevCamera()}prevCamera={position:new Bt.Vector3,zoom:1,target:new Bt.Vector3};enable=!0;box=new Bt.Box3;updateBox(){this.box.setFromObject(this.context.scene)}setEnable(e){this.enable=e,e?this.registryEvent():this.unRegistryEvent()}changePrevCamera(){this.prevCamera={position:this.context.camera.position.clone(),zoom:this.context.camera.zoom,target:this.context.control.target.clone()}}backToPrevCamera(){this.setEnable(!1),this.context.camera.position.copy(this.prevCamera.position),this.context.camera.zoom=this.prevCamera.zoom,this.context.control.target.copy(this.prevCamera.target),this.context.control.update(),this.setEnable(!0)}registryEvent(){this.context.addEventListener("control-change",this.onCameraChange)}unRegistryEvent(){this.context.removeEventListener("control-change",this.onCameraChange)}getCurFloorScreenPosition(){if(!this.context.scene.children.filter(g=>g instanceof ct).length)return null;let t=this.box,{camera:n,clientSize:{width:r,height:i}}=this.context,{min:o,max:a}=t,l=y(o,n,r,i),u=y(a,n,r,i),c=y(new Bt.Vector3(o.x,a.y,a.z),n,r,i),h=y(new Bt.Vector3(a.x,o.y,o.z),n,r,i),p=Math.min(l.x,u.x,c.x,h.x),d=Math.max(l.x,u.x,c.x,h.x),m=Math.min(l.y,u.y,c.y,h.y),f=Math.max(l.y,u.y,c.y,h.y);return{left:p,right:d,top:m,bottom:f}}checkDistanceToScreenEdge({left:e,right:t,top:n,bottom:r}){let{width:i,height:o}=this.context.clientSize,[a,l,u,c]=this.context.config.cameraBound.padding,h=t>=c,p=i-e>=l,d=o-n>=u,m=r>=a;return h&&p&&d&&m}onCameraChange=()=>{let e=this.getCurFloorScreenPosition();if(e){let{left:t,right:n,top:r,bottom:i}=e;this.checkDistanceToScreenEdge({left:t,right:n,top:r,bottom:i})?this.changePrevCamera():this.backToPrevCamera()}};dispose(){this.unRegistryEvent()}};var Mn=require("three"),Fr=require("three/examples/jsm/controls/MapControls"),Gt=require("@tweenjs/tween.js");var Oe=class extends Fr.MapControls{constructor(t,n,r){super(n,r);this.context=t;this.camera=n;this.domElement=r;this.enableDamping=!1,this.zoomSpeed=.5,this.prevCameraZoom=n.zoom,this.registryEvent()}prevCameraZoom=1;tweenGroup=new Gt.Group;offsetY=0;registryEvent(){this.addEventListener("change",()=>{let t=this.camera.zoom;t!==this.prevCameraZoom&&(this.prevCameraZoom=t,this.dispatchEvent({type:"change-zoom",zoom:t}))}),this.context.addEventListener("update",this.tweenUpdate)}tweenUpdate=()=>{this.tweenGroup.update()};setPolarAngle(t,n=!1){let{maxPolarAngle:r,minPolarAngle:i}=this,o=r===i;(n||t<=r&&t>=i)&&(this.maxPolarAngle=t,this.minPolarAngle=t,this.update()),o||(this.maxPolarAngle=r,this.minPolarAngle=i)}async setPolarAngleByDuration(t,n=!1,r=500){return r<=0?this.setPolarAngle(t,n):Z(new Promise(i=>{let o={polar:this.getPolarAngle()},a={polar:t},l=new Gt.Tween(o,this.tweenGroup).to(a,r).onUpdate(()=>{this.setPolarAngle(o.polar,n)}).onComplete(()=>{this.enabled=!0,this.tweenGroup.remove(l),i(!0)}).onStart(()=>{this.enabled=!1}).start()}),r+500)}setAzimuthalAngle(t,n){let{maxAzimuthAngle:r,minAzimuthAngle:i,maxPolarAngle:o,minPolarAngle:a}=this,l=r===i;if(n||t<=r&&t>=i){this.maxAzimuthAngle=t,this.minAzimuthAngle=t;let u=this.getPolarAngle();this.maxPolarAngle=u,this.minPolarAngle=u,this.update(),this.maxPolarAngle=o,this.minPolarAngle=a}l||(this.maxAzimuthAngle=r,this.minAzimuthAngle=i)}setAzimuthalAngleDuration(t,n=!1,r=500){return r<=0?this.setAzimuthalAngle(t,n):Z(new Promise(i=>{let o={azimuthal:this.getAzimuthalAngle()},a={azimuthal:t},l=new Gt.Tween(o,this.tweenGroup).to(a,r).onUpdate(()=>{this.setAzimuthalAngle(o.azimuthal,n)}).onComplete(()=>{this.enabled=!0,this.tweenGroup.remove(l),i(!0)}).onStart(()=>{this.enabled=!1}).start()}),r+500)}getCameraLookAt(){return new Mn.Vector3().subVectors(this.target,this.camera.position)}async setCameraPositionByTarget(t,n){let r=this.target.clone(),i=this.getCameraLookAt();if(!n){this.camera.position.copy(t.clone().sub(i)),this.target.copy(t.clone()),this.update();return}return Z(new Promise(o=>{let a=new Gt.Tween(r,this.tweenGroup).to(t,n).onUpdate(()=>{this.camera.position.copy(r.clone().sub(i)),this.target.copy(r.clone()),this.update()}).onComplete(()=>{this.tweenGroup.remove(a),this.camera.position.copy(t.clone().sub(i)),this.target.copy(t.clone()),this.update(),this.enabled=!0,o(!0)}).onStart(()=>{this.enabled=!1}).start()}),n+500)}setZoom(t,n,r=!1){let{minZoom:i,maxZoom:o}=this;(r||t>=i&&t<=o)&&(this.camera.position.copy(n.clone().sub(this.getCameraLookAt())),this.target.copy(n),this.camera.zoom=t,this.update())}async setZoomByDuration(t,n,r=!1,i=500){let o=this.getCameraLookAt(),a={zoom:this.camera.zoom,target:this.target.clone()};return i?Z(new Promise(l=>{let u=new Gt.Tween(a,this.tweenGroup).to({zoom:t,target:n},i).onUpdate(()=>{this.setZoom(a.zoom,a.target,r)}).onComplete(()=>{this.tweenGroup.remove(u),this.enabled=!0,l(!0)}).onStart(()=>{this.enabled=!1}).start()}),i+500):this.setZoom(t,n,r)}setTargetByOffset(t,n=this.target.clone()){if(!t)return;this.camera.updateMatrix();let r=new Mn.Vector3;r.setFromMatrixColumn(this.camera.matrix,1),r.normalize(),r.multiplyScalar(t/this.camera.zoom),n.add(r),this.setCameraPositionByTarget(n,0)}clearTween(){this.tweenGroup.getAll().forEach(t=>t.stop()),this.tweenGroup.removeAll()}dispose(){this.clearTween()}};var jt=require("three");var Fe=class extends jt.WebGLRenderer{event=new jt.EventDispatcher;scene;camera;enable=!0;timer=new D;constructor(e){super({antialias:!0,alpha:!0,...e}),this.autoClear=!0,this.setPixelRatio(window.devicePixelRatio),this.shadowMap.enabled=!0,this.shadowMap.autoUpdate=!0,this.shadowMap.type=jt.PCFSoftShadowMap}setCameraAndScene(e,t){this.scene=e,this.camera=t}autoRender(){this.scene&&this.camera&&this.enable&&(this.event.dispatchEvent({type:"update"}),this.render(this.scene,this.camera)),this.timer.requestAnimationFrame(()=>{this.autoRender()})}pauseRender(){this.enable=!1}continueRender(){this.enable=!0}addEventListener(e,t){this.event.addEventListener(e,t)}removeEventListener(e,t){this.event.removeEventListener(e,t)}dispose(){this.timer.dispose(),this.enable=!1,super.dispose()}};var Ur=require("three"),Ue=class extends Ur.Scene{constructor(){super()}};var Br=require("three"),Be=class extends Br.OrthographicCamera{constructor(e,t){super(-e/2,e/2,t/2,-t/2,-1e3,5e3),this.up.set(0,0,1),this.position.set(0,0,100),this.lookAt(0,0,0)}};var _e=class extends S.EventDispatcher{constructor(t,n){super();this.container=t;this.config=n;this.container.style.position="relative",this.container.style.overflow="hidden",this.init(),this.selection=new ge(this),this.hoverHelper=new me(this),this.resizeClientSize(),this.registryEvent()}scene=new Ue;renderer=new Fe;camera;control;lights=Ze();currentFloor;selection;hoverHelper;basicRatio;cameraBound;clientSize={width:0,height:0,x:0,y:0};renderRf=0;resizeClientSize(){let{x:t,y:n,width:r,height:i}=this.container.getBoundingClientRect();this.clientSize={width:r||this.container.clientWidth,height:i||this.container.clientHeight,x:t,y:n}}init(){let{clientWidth:t,clientHeight:n}=this.container;this.camera=new Be(t,n),this.renderer.setSize(t,n),this.renderer.setCameraAndScene(this.scene,this.camera),this.renderer.autoRender(),this.control=new Oe(this,this.camera,this.renderer.domElement),this.control.maxPolarAngle=this.config.control.maxPolar,this.container.appendChild(this.renderer.domElement),this.scene.add(this.lights),this.basicRatio=this.getRatio(),this.control.addEventListener("change",()=>{this.dispatchEvent({type:"change-ratio",px:(this.basicRatio||0)*this.camera.zoom}),this.dispatchEvent({type:"control-change"})}),this.control.addEventListener("change-zoom",({zoom:r})=>{this.dispatchEvent({type:"control-zoom-change",zoom:r})}),this.renderer.addEventListener("update",()=>{this.dispatchEvent({type:"update"})}),this.cameraBound=new De(this)}getRatio(t=new S.Vector3(0,0,0),n=new S.Vector3(100,0,0)){let{clientWidth:r,clientHeight:i}=this.container,o=y(t,this.camera,r,i),a=y(n,this.camera,r,i);return Math.ceil(Math.sqrt((a.x-o.x)**2+(a.y-o.y)**2))}changeAmbientLightColor(t){this.lights.children.forEach(n=>{n instanceof S.AmbientLight&&(n.color=new S.Color(t))})}switchFloor(t){this.currentFloor&&(this.scene.remove(this.currentFloor),this.currentFloor.dispose()),this.currentFloor=t,this.scene.add(t);let n=t.getCenter();n&&(this.lights.position.x=n.x,this.lights.position.y=n.y),this.cameraBound.updateBox()}onWindowResize=()=>{let{container:t,camera:n,renderer:r}=this,{clientWidth:i,clientHeight:o}=t;i=Math.max(1,i),o=Math.max(1,o),n.left=-i/2,n.right=i/2,n.top=o/2,n.bottom=-o/2,n.updateProjectionMatrix(),r.setSize(i,o),this.resizeClientSize(),this.dispatchEvent({type:"resize",width:i,height:o})};onClick=t=>{let{graphics:n,position:r}=this.getGraphicsByDeviceXy(t.offsetX,t.offsetY);n.length&&this.dispatchEvent({type:"graphic-click",graphics:n,position:r});let i=this.getPoisByDeviceXy(t.offsetX,t.offsetY);i.length&&this.dispatchEvent({type:"poi-click",pois:i})};getGraphicsByDeviceXy(t,n){let r=new S.Vector2;r.x=t/this.clientSize.width*2-1,r.y=n/this.clientSize.height*-2+1;let i=new S.Raycaster;return i.setFromCamera(r,this.camera),i.ray.origin.sub(i.ray.direction.clone().multiplyScalar(100)),this.currentFloor?.graphicLayer.getGraphicByRaycaster(i)||{graphics:[],position:null}}getPoisByDeviceXy(t,n){let r=this.currentFloor?.poiLayer.getPoiByDeviceXy(t,n),i=this.currentFloor?.poiLayer2.getPoiByDeviceXy(t,n);return(r||[]).concat(i||[])}onPointerover=t=>{let{graphics:n,position:r}=this.getGraphicsByDeviceXy(t.offsetX,t.offsetY),i=this.getPoisByDeviceXy(t.offsetX,t.offsetY);this.dispatchEvent({type:"pointer-over",e:t,graphics:n,pois:i,position:r})};onPointermove=t=>{let{graphics:n,position:r}=this.getGraphicsByDeviceXy(t.offsetX,t.offsetY),i=this.getPoisByDeviceXy(t.offsetX,t.offsetY);this.dispatchEvent({type:"pointer-move",e:t,graphics:n,pois:i,position:r})};onPointerleave=t=>{this.dispatchEvent({type:"pointer-level"})};onSelectionSelect=({graphics:t,isMultipleSelect:n})=>{this.dispatchEvent({type:"select-graphic",graphics:t,isMultipleSelect:n})};onHoverChange=({graphics:t})=>{this.dispatchEvent({type:"hover",graphics:t})};registryEvent(){window.addEventListener("resize",this.onWindowResize),this.container.addEventListener("click",this.onClick),this.container.addEventListener("pointerover",this.onPointerover),this.container.addEventListener("pointermove",this.onPointermove),this.container.addEventListener("pointerleave",this.onPointerleave),this.container.addEventListener("pointercancel",this.onPointerleave),this.container.addEventListener("pointerout",this.onPointerleave),this.selection.addEventListener("select",this.onSelectionSelect),this.hoverHelper.addEventListener("hover-change",this.onHoverChange)}unRegistryEvent(){window.removeEventListener("resize",this.onWindowResize),this.container.removeEventListener("click",this.onClick),this.container.removeEventListener("pointerover",this.onPointerover),this.container.removeEventListener("pointermove",this.onPointermove),this.container.removeEventListener("pointerleave",this.onPointerleave),this.container.removeEventListener("pointercancel",this.onPointerleave),this.container.removeEventListener("pointerout",this.onPointerleave),this.selection.removeEventListener("select",this.onSelectionSelect),this.hoverHelper.removeEventListener("hover-change",this.onHoverChange)}setPolarAngle(t,n=500){return this.control.setPolarAngleByDuration(t,!0,n)}setAzimuthalAngle(t,n=500){return this.control.setAzimuthalAngleDuration(t,!0,n)}getCameraLookAt(){return this.control.getCameraLookAt()}setZoom(t,n,r=500){return this.control.setZoomByDuration(t,n,!0,r)}getFitCameraToObjectZoom(t,n=[20,20,20,20],r=500,i=!0){let[o,a,l,u]=n,{clientSize:{width:c,height:h}}=this,p=this.control.getPolarAngle();i&&this.setPolarAngle(0,0);let d=new S.Box3().setFromObject(t);this.setPolarAngle(p,0);let{max:m,min:f}=d,g=new S.Vector3(f.x,m.y,m.z),E=new S.Vector3(m.x,m.y,m.z),x=new S.Vector3(m.x,f.y,f.z),z=new S.Vector3(f.x,f.y,f.z),b=y(g,this.camera,c,h),T=y(E,this.camera,c,h),k=y(z,this.camera,c,h),$=y(x,this.camera,c,h),Kt=new S.Box2().setFromPoints([new S.Vector2(b.x,b.y),new S.Vector2(T.x,T.y),new S.Vector2(k.x,k.y),new S.Vector2($.x,$.y)]).getSize(new S.Vector2),Ke=(c-a-u)/Kt.x,fi=(h-o-l)/Kt.y,di=Math.min(Ke,fi),gi=new S.Vector3((m.x+f.x)/2,(m.y+f.y)/2,(m.z+f.z)/2);return{zoom:di*this.camera.zoom,center:gi}}fitCameraToObject(t,n=[20,20,20,20],r=500,i=!0){let{zoom:o,center:a}=this.getFitCameraToObjectZoom(t,n,r,i);return this.setZoom(o,a,r)}getFitCameraToGroundZoom(t=[20,20,20,20],n=500,r=!0){if(this.currentFloor&&this.currentFloor.hasElement)return this.getFitCameraToObjectZoom(this.currentFloor.groundUpper,t,n,r).zoom}fitCameraToGround(t=[20,20,20,20],n=500,r=!0){return this.currentFloor&&this.currentFloor.hasElement?this.fitCameraToObject(this.currentFloor.groundUpper,t,n,r):Promise.resolve(!1)}async setCameraPosition(t,n){return this.control.setCameraPositionByTarget(t,n)}pauseRender(){this.renderer.pauseRender()}continueRender(){this.renderer.continueRender()}dispose(){this.control.dispose(),this.cameraBound.dispose(),this.selection.dispose(),this.hoverHelper.dispose(),this.unRegistryEvent(),this.renderer.domElement.remove(),this.renderer.dispose(),this.lights.children.forEach(t=>t.dispose()),V(this.scene)}};var Gr=require("lodash"),zr={apiDomain:"",apiInfo:{},apiPath:{floorGraphic:"/api/inception-map/floor/get",floorRange:"/api/inception-map/range/get",equipmentList:"/api/inception-map/equipment/get",roadNetwork:"/api/inception-map/road_network/get"},enableBoxSelect:!0,resizeObserver:!1,initTransToMark:!1,heatMap:{radius:50,gradient:{0:"#8F9FCD",.5:"#6284FF",1:"#F95D5D"}},useFloorCache:!0,control:{maxPolar:1.2,defaultPolar:1.1,defaultAzimuthal:0},defaultPadding:[20,20,20,20],svg:{circle:{radius:"2",fill:"#1CADFF"},line:{stroke:"#1CADFF"}},selectBox:{stroke:"#1CADFF",fill:"rgba(28, 173, 255, 0.3)"},hover:{time:100},ground:{color:"#F6F6F6",opacity:1,height:.001,stroke:!1,strokeColor:"#E6E6E6",strokeOpacity:1},markGraphic:{color:"#EEF0F3",opacity:1,height:.001,stroke:!1,strokeColor:"#000",strokeOpacity:1},graphic:{fillOpacity:1},cameraBound:{padding:[150,150,150,150]},poi:{boxScale:1}};function wn(s){return(0,Gr.merge)({},zr,s)}var kr=require("lodash");var Vr=(t=>(t[t.D2=0]="D2",t[t.D3=1.1]="D3",t))(Vr||{}),Tn=class extends Ge.EventDispatcher{constructor(t,n={}){super();this.container=t;this.config=wn(n),this.context=new _e(t,this.config),this.registryEvent()}config;context;polarKeys=[];azimuthalKeys=[];svgLine;svgPolygon;basicZoom=1;prevCameraZoom=1;type="2d";currentBuildGround=null;observe=null;buildingCenter=[0,0];timer=new D;plugins=[];changeBuildingCenter(t,{brand:n,project:r}){let i=t?Jt(t.info.geometry.cds[0]):[0,0];this.buildingCenter=i,this.dispatchEvent({type:"center-change",center:i,project:r,brand:n})}use(t){t.bmap=this,this.plugins.push(t)}unUse(t){this.plugins=this.plugins.filter(n=>n!==t)}triggerHooks(t,n){this.dispatchEvent({type:t,data:n})}switchFloorByFloor(t,n=t.graphicLayer.children){this.triggerHooks("switch_floor_before",{curFloor:t,graphics:n}),this.context.switchFloor(t),this.initialFloorCamera(),this.triggerHooks("switch_floor_after",{curFloor:t,graphics:n})}initialFloorCamera(){this.context.cameraBound.setEnable(!1),this.context.control.minZoom=0,this.context.control.maxZoom=1/0,this.context.camera.zoom=1,this.context.setAzimuthalAngle(this.config.control.defaultAzimuthal,0),this.context.setPolarAngle(this.config.control.defaultPolar,0),this.context.fitCameraToGround(void 0,0);let t=this.context.camera.zoom;this.context.control.minZoom=t,this.context.control.maxZoom=t*30,this.type==="3d"&&this.context.fitCameraToGround(this.config.defaultPadding,0,!1),this.basicZoom=this.context.camera.zoom,this.context.control.addEventListener("change",this.onControlChange),this.onControlChange(),this.context.cameraBound.setEnable(!0),this.context.cameraBound.changePrevCamera()}onControlChange=()=>{let{camera:{zoom:t}}=this.context;t!==this.prevCameraZoom&&(this.dispatchEvent({type:"zoom-change",basicZoom:this.basicZoom,cameraZoom:this.context.camera.zoom}),this.prevCameraZoom=t)};addModel(t,n){if(t.options.geometry.type==="polygon"){let r=this.context.currentFloor?.addModel({...n,position:t.getPosition().setZ(.1),id:t.options.id});if(r){let{facilityAngle:i=0,facilityXScale:o=1,facilityYScale:a=1}=t.options.userData;r.rotateZ((180-i)/180*Math.PI),r.scale.set(o,a,1)}}}addHeatmap(t){return this.context.currentFloor?.addHeatmap(t)}getLegacyToGraphicMap(){return this.context.currentFloor?.userData.legacyToGraphicMap||new Map}getFloorAllGraphics(){return this.context.currentFloor?.graphicLayer.children.filter(t=>t instanceof R)||[]}createGraphicPoi(t,n){if(this.context.currentFloor){n.id===void 0&&(n.id=t.options.id);let r=t.options.center,i=t.getCenter(),o=r?.[0]||i.x,a=r?.[1]||i.y;return console.log(o,a,r,i),this.context.currentFloor.addPoi({...n,position:{x:o,y:a,z:i.z+t.options.height/2}})}return null}removeHeatMap(){this.context.currentFloor?.removeHeatMap()}translateElementToCenter(t,n=500){let r=t.getPosition();return this.context.setCameraPosition(r,n)}async translateElementToCenterX(t,n=500){return Z(new Promise(r=>{let i=this.context.control.target.clone(),o=t.getPosition();this.timer.requestAnimationFrame(()=>{let{clientSize:{width:a,height:l},camera:u}=this.context,h=y(o,u,a,l).x-a/2,p=new Ge.Vector3;p.setFromMatrixColumn(this.context.camera.matrix,0),p.normalize(),p.multiplyScalar(h/this.context.camera.zoom),i.add(p),this.context.setCameraPosition(i,n).then(r)})}),n+500)}getElementDeviceCoordinate(t){let n=t.position.clone(),{clientWidth:r,clientHeight:i}=this.container;return y(n,this.context.camera,r,i)}changeMapType(t,n=500){return this.type=t,t==="2d"?this.context.setPolarAngle(0,n):this.context.setPolarAngle(1.1,n)}async resetView(t=300){let n=t/3;await this.context.setAzimuthalAngle(this.config.control.defaultAzimuthal,n),await this.context.setPolarAngle(this.config.control.defaultPolar,n),await this.context.fitCameraToGround(this.config.defaultPadding,n,!1)}reduceMap(t=.5,n=500){let r=this.context.camera.zoom;return this.context.setZoom(r-t,this.context.control.target,n)}enlargeMap(t=.5,n=500){let r=this.context.camera.zoom;return this.context.setZoom(r+t,this.context.control.target,n)}onKeydown=t=>{this.polarKeys.includes(t.code)&&(this.context.control.maxPolarAngle=this.config.control.maxPolar,this.context.control.minPolarAngle=0),this.azimuthalKeys.includes(t.code)&&(this.context.control.maxAzimuthAngle=1/0,this.context.control.minAzimuthAngle=1/0)};onKeyUp=t=>{if(this.polarKeys.includes(t.code)){let n=this.context.control.getPolarAngle();this.context.control.maxPolarAngle=n,this.context.control.minPolarAngle=n}if(this.azimuthalKeys.includes(t.code)){let n=this.context.control.getAzimuthalAngle();this.context.control.maxAzimuthAngle=n,this.context.control.minAzimuthAngle=n}};registryEvent(){if(window.addEventListener("keydown",this.onKeydown),window.addEventListener("keyup",this.onKeyUp),this.config.resizeObserver){let t=new ResizeObserver((0,kr.debounce)(this.resize,5));t.observe(this.container),this.observe=t}}unRegistryEvent(){window.removeEventListener("keydown",this.onKeydown),window.removeEventListener("keyup",this.onKeyUp),this.observe?.disconnect(),this.observe=null}configurePolarShortcutKeys(t){this.polarKeys=t}configureAzimuthalShortcutKeys(t){this.azimuthalKeys=t}rotateMap(t=.1){let n=this.context.control.getAzimuthalAngle();this.context.setAzimuthalAngle(n+t,500)}async measureDistance(){return this.cancelDistance(),new Promise((t,n)=>{this.changeMapType("2d",0),this.context.control.enableRotate=!1,this.svgLine=new le(this.context);let r=this.svgLine.dispose.bind(this.svgLine);this.svgLine.dispose=function(){r(),n("cancel")},this.svgLine.addEventListener("distance",({distance:i})=>{t(i)})})}cancelDistance(){this.svgLine&&(this.svgLine.dispose(),this.svgLine=void 0,this.context.control.enableRotate=!0)}measureArea(){return this.cancelArea(),new Promise((t,n)=>{this.changeMapType("2d",0),this.context.control.enableRotate=!1,this.svgPolygon=new ue(this.context);let r=this.svgPolygon.dispose.bind(this.svgPolygon);this.svgPolygon.dispose=function(){r(),n("cancel")},this.svgPolygon.addEventListener("area",({area:i})=>{t(i)})})}cancelArea(){this.svgPolygon&&(this.svgPolygon.dispose(),this.svgPolygon=void 0,this.context.control.enableRotate=!0)}getGraphicByNodeId(t){return this.context.currentFloor?.graphicLayer.getGraphicByNodeId(t)||null}deleteGraphic(t){this.context.currentFloor?.graphicLayer.removeGraphic(t)}createGraphicByOptions(t){if(!t.transformToBuildingGround&&this.currentBuildGround){let n=Jt(this.currentBuildGround.info.geometry.cds[0]);if(t.geometry.type==="polygon")t.geometry.coords=JSON.parse(JSON.stringify(t.geometry.cds)),t.geometry.coords.map(r=>{Array.isArray(r)&&r.forEach(i=>{i[0]-=n[0],i[1]-=n[1]})});else{let[r,i]=t.geometry.cds;t.geometry.coords=[r-n[0],i-n[1]]}}return this.context.currentFloor?.graphicLayer.createGraphic(t)}removePoiById(t){this.context.currentFloor?.poiLayer.removePoiById(t),this.context.currentFloor?.poiLayer2.removePoiById(t)}getPoiById(t){return this.context.currentFloor?.poiLayer.getPoiById(t)||this.context.currentFloor?.poiLayer2.getPoiById(t)}getPois(){return[...(this.context.currentFloor?.poiLayer.pois||[]).filter(t=>!t.options.built_in),...this.context.currentFloor?.poiLayer2.pois||[]]}clearPoi(){this.context.currentFloor&&this.context.currentFloor.poiLayer.clear()}removeSelectGraphic(t){this.context.selection.remove(t)}resize=()=>{this.context.cameraBound.setEnable(!1),this.context.onWindowResize();let t=this.context.control.getAzimuthalAngle(),n=this.context.camera.zoom;this.context.control.minZoom=0,this.context.control.maxZoom=1/0,this.context.camera.zoom=1,this.context.setAzimuthalAngle(0,0);let r=this.context.getFitCameraToGroundZoom(void 0,0)||1;this.context.camera.zoom=n,this.context.control.minZoom=r,this.context.control.maxZoom=r*25,this.basicZoom=n,this.context.control.addEventListener("change",this.onControlChange),this.context.setAzimuthalAngle(t,0),this.context.cameraBound.setEnable(!0)};dispose(){this.timer.dispose(),this.plugins.forEach(t=>t.dispose()),this.context.dispose(),this.unRegistryEvent(),vt.dispose(),xt.dispose(),Nt.dispose(),Et.dispose(),I.dispose()}};var Hr=require("three"),dt=class extends Hr.EventDispatcher{bmap;constructor(e){super(),this.bmap=e,this.bmap.use(this)}dispose(){}};var Cn=class extends dt{equipmentList=[];equipmentMap=new Map;constructor(e){super(e),this.fetchEquipment(),this.bmap.addEventListener("switch_floor_after",this.onSwitchFloor)}async fetchEquipment(){let{apiDomain:e,apiPath:{equipmentList:t},apiInfo:n}=this.bmap.config,r=`${e}${t}`;await fetch(r,n).then(i=>i.json()).then(i=>i.data).then(i=>{this.equipmentList=i,this.equipmentMap=new Map(i.map(o=>[o.equipment_id,o]))}),this.dispatchEvent({type:"change-equipment-list",data:this.equipmentList}),this.bmap.context.currentFloor&&this.changeGraphicToEquipment(this.bmap.context.currentFloor.graphicLayer.children)}onSwitchFloor=({data:{graphics:e}})=>{this.equipmentList.length&&this.changeGraphicToEquipment(e)};getGraphicEquipment(e){return e.userData.data.info.userData.equipment}changeGraphicToEquipment(e){e.filter(t=>{let n=this.getGraphicEquipment(t);return n&&this.equipmentMap.has(n)}).forEach(t=>{let n=this.equipmentMap.get(this.getGraphicEquipment(t)),r=this.bmap.createGraphicPoi(t,{icon:n?.equipment_icon,built_in:!0,icon_size:[14,14]});r&&(r.userData.data=n,r.userData.type="equipment")})}dispose(){this.bmap.removeEventListener("switch_floor_after",this.onSwitchFloor),Array.from(this.bmap.context.currentFloor?.poiLayer.pois||[]).forEach(e=>{e.userData.type==="equipment"&&this.bmap.context.currentFloor?.poiLayer.removePoi(e)})}};var N=require("three");var _=require("three"),tt=class extends _.BufferGeometry{constructor(){super(),this.isMeshLine=!0,this.type="MeshLine",this.positions=[],this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[],this.counters=[],this._points=[],this._geom=null,this.widthCallback=null,this.matrixWorld=new _.Matrix4,Object.defineProperties(this,{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(e){this.setGeometry(e,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(e){this.setPoints(e,this.widthCallback)}}})}};tt.prototype.setMatrixWorld=function(s){this.matrixWorld=s};tt.prototype.setGeometry=function(s,e){this._geometry=s,this.setPoints(s.getAttribute("position").array,e)};tt.prototype.setPoints=function(s,e){if(!(s instanceof Float32Array)&&!(s instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=s,this.widthCallback=e,this.positions=[],this.counters=[],s.length&&s[0]instanceof _.Vector3)for(var t=0;t<s.length;t++){var n=s[t],r=t/s.length;this.positions.push(n.x,n.y,n.z),this.positions.push(n.x,n.y,n.z),this.counters.push(r),this.counters.push(r)}else for(var t=0;t<s.length;t+=3){var r=t/s.length;this.positions.push(s[t],s[t+1],s[t+2]),this.positions.push(s[t],s[t+1],s[t+2]),this.counters.push(r),this.counters.push(r)}this.process()};function Hi(s,e){var t=new _.Matrix4,n=new _.Ray,r=new _.Sphere,i=new _.Vector3,o=this.geometry;if(o.boundingSphere||o.computeBoundingSphere(),r.copy(o.boundingSphere),r.applyMatrix4(this.matrixWorld),s.ray.intersectSphere(r,i)!==!1){t.copy(this.matrixWorld).invert(),n.copy(s.ray).applyMatrix4(t);var a=new _.Vector3,l=new _.Vector3,u=new _.Vector3,c=this instanceof _.LineSegments?2:1,h=o.index,p=o.attributes;if(h!==null)for(var d=h.array,m=p.position.array,f=p.width.array,g=0,E=d.length-1;g<E;g+=c){var x=d[g],z=d[g+1];a.fromArray(m,x*3),l.fromArray(m,z*3);var b=f[Math.floor(g/3)]!==void 0?f[Math.floor(g/3)]:1,T=s.params.Line.threshold+this.material.lineWidth*b/2,k=T*T,$=n.distanceSqToSegment(a,l,i,u);if(!($>k)){i.applyMatrix4(this.matrixWorld);var Tt=s.ray.origin.distanceTo(i);Tt<s.near||Tt>s.far||(e.push({distance:Tt,point:u.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}),g=E)}}}}tt.prototype.raycast=Hi;tt.prototype.compareV3=function(s,e){var t=s*6,n=e*6;return this.positions[t]===this.positions[n]&&this.positions[t+1]===this.positions[n+1]&&this.positions[t+2]===this.positions[n+2]};tt.prototype.copyV3=function(s){var e=s*6;return[this.positions[e],this.positions[e+1],this.positions[e+2]]};tt.prototype.getDistance=function(s){let e=0;for(let t=0;t<s;t++){let n=6*t,r=new _.Vector3(this.positions[n],this.positions[n+1],this.positions[n+2]),i=new _.Vector3(this.positions[n+6],this.positions[n+7],this.positions[n+8]),o=r.distanceTo(i);e+=o}return e};tt.prototype.process=function(){var s=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var e;let t=this.getDistance(s-1);var n;this.compareV3(0,s-1)?n=this.copyV3(s-2):n=this.copyV3(0),this.previous.push(n[0],n[1],n[2]),this.previous.push(n[0],n[1],n[2]);for(var r=0;r<s;r++){if(this.side.push(1),this.side.push(-1),this.widthCallback?e=this.widthCallback(r/(s-1)):e=1,this.width.push(e),this.width.push(e),r===0)this.uvs.push(0,0),this.uvs.push(0,1);else if(r===s-1)this.uvs.push(1,0),this.uvs.push(1,1);else{let o=this.getDistance(r)/t;this.uvs.push(o,0),this.uvs.push(o,1)}if(r<s-1){n=this.copyV3(r),this.previous.push(n[0],n[1],n[2]),this.previous.push(n[0],n[1],n[2]);var i=r*2;this.indices_array.push(i,i+1,i+2),this.indices_array.push(i+2,i+1,i+3)}r>0&&(n=this.copyV3(r),this.next.push(n[0],n[1],n[2]),this.next.push(n[0],n[1],n[2]))}this.compareV3(s-1,0)?n=this.copyV3(1):n=this.copyV3(s-1),this.next.push(n[0],n[1],n[2]),this.next.push(n[0],n[1],n[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new _.BufferAttribute(new Float32Array(this.positions),3),previous:new _.BufferAttribute(new Float32Array(this.previous),3),next:new _.BufferAttribute(new Float32Array(this.next),3),side:new _.BufferAttribute(new Float32Array(this.side),1),width:new _.BufferAttribute(new Float32Array(this.width),1),uv:new _.BufferAttribute(new Float32Array(this.uvs),2),index:new _.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new _.BufferAttribute(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()};function Pn(s,e,t,n,r){var i;if(s=s.subarray||s.slice?s:s.buffer,t=t.subarray||t.slice?t:t.buffer,s=e?s.subarray?s.subarray(e,r&&e+r):s.slice(e,r&&e+r):s,t.set)t.set(s,n);else for(i=0;i<s.length;i++)t[i+n]=s[i];return t}tt.prototype.advance=function(s){var e=this._attributes.position.array,t=this._attributes.previous.array,n=this._attributes.next.array,r=e.length;Pn(e,0,t,0,r),Pn(e,6,e,0,r-6),e[r-6]=s.x,e[r-5]=s.y,e[r-4]=s.z,e[r-3]=s.x,e[r-2]=s.y,e[r-1]=s.z,Pn(e,6,n,0,r-6),n[r-6]=s.x,n[r-5]=s.y,n[r-4]=s.z,n[r-3]=s.x,n[r-2]=s.y,n[r-1]=s.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0};_.ShaderChunk.meshline_vert=["",_.ShaderChunk.logdepthbuf_pars_vertex,_.ShaderChunk.fog_pars_vertex,"","attribute vec3 previous;","attribute vec3 next;","attribute float side;","attribute float width;","attribute float counters;","","uniform vec2 resolution;","uniform float lineWidth;","uniform vec3 color;","uniform float opacity;","uniform float sizeAttenuation;","","varying vec2 vUV;","varying vec4 vColor;","varying float vCounters;","","vec2 fix( vec4 i, float aspect ) {",""," vec2 res = i.xy / i.w;"," res.x *= aspect;"," vCounters = counters;"," return res;","","}","","void main() {",""," float aspect = resolution.x / resolution.y;",""," vColor = vec4( color, opacity );"," vUV = uv;",""," mat4 m = projectionMatrix * modelViewMatrix;"," vec4 finalPosition = m * vec4( position, 1.0 );"," vec4 prevPos = m * vec4( previous, 1.0 );"," vec4 nextPos = m * vec4( next, 1.0 );",""," vec2 currentP = fix( finalPosition, aspect );"," vec2 prevP = fix( prevPos, aspect );"," vec2 nextP = fix( nextPos, aspect );",""," float w = lineWidth * width;",""," vec2 dir;"," if( nextP == currentP ) dir = normalize( currentP - prevP );"," else if( prevP == currentP ) dir = normalize( nextP - currentP );"," else {"," vec2 dir1 = normalize( currentP - prevP );"," vec2 dir2 = normalize( nextP - currentP );"," dir = normalize( dir1 + dir2 );",""," vec2 perp = vec2( -dir1.y, dir1.x );"," vec2 miter = vec2( -dir.y, dir.x );"," //w = clamp( w / dot( miter, perp ), 0., 4. * lineWidth * width );",""," }",""," //vec2 normal = ( cross( vec3( dir, 0. ), vec3( 0., 0., 1. ) ) ).xy;"," vec4 normal = vec4( -dir.y, dir.x, 0., 1. );"," normal.xy *= .5 * w;"," normal *= projectionMatrix;"," if( sizeAttenuation == 0. ) {"," normal.xy *= finalPosition.w;"," normal.xy /= ( vec4( resolution, 0., 1. ) * projectionMatrix ).xy;"," }",""," finalPosition.xy += normal.xy * side;",""," gl_Position = finalPosition;","",_.ShaderChunk.logdepthbuf_vertex,_.ShaderChunk.fog_vertex&&" vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",_.ShaderChunk.fog_vertex,"}"].join(`
|
|
104
104
|
`);_.ShaderChunk.meshline_frag=["",_.ShaderChunk.fog_pars_fragment,_.ShaderChunk.logdepthbuf_pars_fragment,"","uniform sampler2D map;","uniform sampler2D alphaMap;","uniform float useMap;","uniform float useAlphaMap;","uniform float useDash;","uniform float dashArray;","uniform float dashOffset;","uniform float dashRatio;","uniform float visibility;","uniform float alphaTest;","uniform vec2 repeat;","uniform float thresholdRatio;","","varying vec2 vUV;","varying vec4 vColor;","varying float vCounters;","","void main() {","",_.ShaderChunk.logdepthbuf_fragment,""," vec4 c = vColor;"," if( useMap == 1. ) c *= texture2D( map, vUV * repeat );"," if( useAlphaMap == 1. ) c.a *= texture2D( alphaMap, vUV * repeat ).a;"," if( c.a < alphaTest ) discard;"," if( useDash == 1. ){"," c.a *= ceil(mod(vCounters + dashOffset, dashArray) - (dashArray * dashRatio));"," }"," gl_FragColor = c;"," gl_FragColor.a *= step(vCounters, visibility);","",_.ShaderChunk.fog_fragment,"if (vUV.x <= thresholdRatio) {","gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);","}","}"].join(`
|
|
105
|
-
`);var ye=class extends _.ShaderMaterial{constructor(e){super({uniforms:Object.assign({},_.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new _.Color(16777215)},opacity:{value:1},resolution:{value:new _.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new _.Vector2(1,1)},thresholdRatio:{value:0},transparent:{value:!0},depthTest:{vale:!1},depthWrite:{value:!1}}),vertexShader:_.ShaderChunk.meshline_vert,fragmentShader:_.ShaderChunk.meshline_frag}),this.isMeshLineMaterial=!0,this.type="MeshLineMaterial",Object.defineProperties(this,{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(t){this.uniforms.lineWidth.value=t}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(t){this.uniforms.map.value=t}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(t){this.uniforms.useMap.value=t}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(t){this.uniforms.alphaMap.value=t}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(t){this.uniforms.useAlphaMap.value=t}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(t){this.uniforms.color.value=t}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(t){this.uniforms.sizeAttenuation.value=t}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(t){this.uniforms.dashArray.value=t,this.useDash=t!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(t){this.uniforms.dashOffset.value=t}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(t){this.uniforms.dashRatio.value=t}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(t){this.uniforms.useDash.value=t}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(t){this.uniforms.visibility.value=t}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(t){this.uniforms.alphaTest.value=t}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(t){this.uniforms.repeat.value.copy(t)}},thresholdRatio:{enumerable:!0,get:function(){return this.uniforms.thresholdRatio.value},set:function(t){this.uniforms.thresholdRatio.value=t}}}),this.setValues(e)}};ye.prototype.copy=function(s){return _.ShaderMaterial.prototype.copy.call(this,s),this.lineWidth=s.lineWidth,this.map=s.map,this.useMap=s.useMap,this.alphaMap=s.alphaMap,this.useAlphaMap=s.useAlphaMap,this.color.copy(s.color),this.opacity=s.opacity,this.resolution.copy(s.resolution),this.sizeAttenuation=s.sizeAttenuation,this.dashArray.copy(s.dashArray),this.dashOffset.copy(s.dashOffset),this.dashRatio.copy(s.dashRatio),this.useDash=s.useDash,this.visibility=s.visibility,this.alphaTest=s.alphaTest,this.repeat.copy(s.repeat),this};var Wr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAQCAMAAACROYkbAAABrVBMVEVsjPdsjPdqi/doifdpivdrjPdsjPdsjPd/m/igtfqTq/lykfdri/dsjPdtjfe/zPv8/f/w8/6zw/p0kvdri/dsjPdtjffU3vz////////3+f62xfpzkfdri/dsjPdsjPeZr/nr8P7////////4+f62xfp0kvdri/dsjPdsjPdujveXrvne5v3////////3+f63x/t2lPdri/dsjPdsjPdsjPdri/eMpfjb4/3+/v/////4+v+7yft1k/dri/dsjPdsjPdri/eJovjl6/3////////3+f6Jo/lqivdsjPdri/dvjveluPry9f7////////i6f2BnPhqi/dsjPdrjPdvjveluPrv8v7////////l6/6Uq/lsjPdsjPdsjPdvjveluPrv8v7////////m6/6Uq/lsjPdsjPdsjPdsjPeZr/nv8v7////////s8f6XrvlsjPdsjPdtjffS2/z////////w9P6bsfltjfdsjPdtjffBz/v7/P/y9f6svvpxkPdrjPdsjPdsjPd+mviftPqVrPlykfdri/dsjPdsjPdri/doifdpifdrjPdsjPclkRlrAAAAx0lEQVQ4y2NgwAsYmZhZWNkYyAfsHJxc3Dy85BvAxy8gKCQsIkq2AWLiEpJS0jKycuQaIK+gqKSsoqqmrkGmAZpa2jq6evoGhkbG5BlgYmpmbmFpZW1ja0emE+wdHJ2cXVzd3D3INMDTy9vH188/IDCIPP3BIaFh4RGRUdExseQZEBefkJiUnJKalp5BngGZWdk5uXn5BemFZAZBUXFJaVl5RSWZ9jMwVFXX1NbVNzSSq5+hqbmlta29g2z9DJ1d3T29ffhUAABKPSh5Xst3GwAAAABJRU5ErkJggg==";var Xr={texture_url:Wr,lineWidth:8,color:16777215},ze=class extends N.Object3D{constructor(t,n){super();this.navigation=t;this.config=Object.assign({},Xr,n),this.registryEvent(),this.prevCameraZoom=this.navigation.bmap.context.camera.zoom,this.setDepthTest(this.getDepthTestByControl())}mesh=null;geometry=null;material=null;texture=null;config=Xr;points=[];basicRepeat=1;prevCameraZoom=0;depthTest=!0;registryEvent(){this.navigation.bmap.context.addEventListener("control-change",this.onControlChange),this.navigation.bmap.context.addEventListener("update",this.onUpdate),this.navigation.bmap.context.addEventListener("resize",this.onResize)}unRegistryEvent(){this.navigation.bmap.context.removeEventListener("control-change",this.onControlChange),this.navigation.bmap.context.removeEventListener("update",this.onUpdate),this.navigation.bmap.context.removeEventListener("resize",this.onResize)}onControlChange=()=>{let t=this.navigation.bmap.context.camera.zoom;t!==this.prevCameraZoom&&(this.prevCameraZoom=t,this.changeRepeat()),this.setDepthTest(this.getDepthTestByControl())};getDepthTestByControl(){let t=this.navigation.bmap.context.control.getPolarAngle();return!(t>=0&&t<=.15)}setDepthTest(t){this.depthTest=t,this.material&&(this.material.depthTest=t)}onUpdate=()=>{this.texture};onResize=()=>{if(this.material){let{width:t,height:n}=this.navigation.bmap.context.clientSize;this.material.resolution.set(t,n)}};getRepeat(){let{points:t,navigation:{bmap:{context:{camera:n,clientSize:{width:r,height:i}}}}}=this,o=t.map(([l,u])=>y(new N.Vector3(l,u,0),n,r,i)).map(({x:l,y:u})=>[l,u]);return at(o)/32}changeRepeat(){if(!this.material)return;let t=this.getRepeat();this.material.repeat=new N.Vector2(t,1)}loadTexture(t){return new Promise((n,r)=>{new N.TextureLoader().load(t,n,void 0,r)})}transformPoints(t){let n=[];for(let r=0;r<t.length;r++)n.push(...t[r],0);return n}updatePoints(t){this.points=t,this.changeRepeat();let n=this.transformPoints(t);this.geometry&&this.geometry.setPoints(n)}movePath(t){this.material&&(this.material.thresholdRatio=t)}async create(t){let n=this.geometry=new tt;if(this.updatePoints(t),!this.texture){let o=this.texture=await this.loadTexture(this.config.texture_url);o.wrapS=o.wrapT=N.RepeatWrapping}let r=this.material=new ye({useMap:!0,color:new N.Color(this.config.color),transparent:!0,resolution:new N.Vector2(this.navigation.bmap.context.clientSize.width,this.navigation.bmap.context.clientSize.height),depthTest:!1,sizeAttenuation:!1,lineWidth:this.config.lineWidth*2,map:this.texture,blending:N.NormalBlending,repeat:new N.Vector2(this.getRepeat(),1)}),i=this.mesh=new N.Mesh(n,r);return i.renderOrder=9,this.add(i),i}dispose(){this.unRegistryEvent(),this.clear(),this.geometry?.dispose(),this.material?.dispose(),this.texture?.dispose()}};var Yt=require("@tweenjs/tween.js"),wt=require("three");var qr=require("three");var jr=require("@tweenjs/tween.js"),Yr=require("lodash"),Xi={offsetDistance:15,offsetToResetTime:3e3,directionEmitThreshold:5,simulationSpeed:1},ke=class extends qr.EventDispatcher{constructor(t,n){super();this.navigation=t;this.options=Object.assign({},Xi,n),this.registryEvent()}offset=!1;reset=!1;position=[0,0];routeIndex=0;pointIndex=0;paths=[];options;timer=new D;resetTimer=null;tweenUtil=new Dt;simulationTween;get curRoutePath(){return this.paths[this.routeIndex]||null}get curRoutePathPoints(){return this.curRoutePath?.points||[]}registryEvent(){this.navigation.bmap.context.addEventListener("update",this.onUpdate),this.navigation.addEventListener("add-path",this.onAddPaths)}unRegistryEvent(){this.navigation.bmap.context.removeEventListener("update",this.onUpdate),this.navigation.removeEventListener("add-path",this.onAddPaths)}onAddPaths=({paths:t})=>{this.paths=t,this.resetStatus(t)};onUpdate=()=>{this.tweenUtil.update()};resetStatus(t){this.offset=!1,this.reset=!1,this.routeIndex=0,this.pointIndex=0,t.length&&(this.position=t[0].points[0])}emitNavigationStatus(){let t=this.getNavigationInfo();t&&this.dispatchEvent({type:"navigation-info",info:t})}adsorb(t,n){let{curRoutePathPoints:r,position:i,curRoutePath:o,paths:a,routeIndex:l}=this;if(!r.length)return null;let u=r;if(i){let f=Pt(r,i);u=u.slice(f+1),u.unshift(i)}let c=[{floor:o?.floor,points:u},...a.slice(l+1)],{distance:h,closestPoint:p,index:d,i:m}=c.reduce((f,g,E)=>{if(g.floor!==t)return f;let{distance:x,closestPoint:z,index:b}=g.points.reduce((T,k,$,Tt)=>{if(!Tt[$+1])return{...T,distance:T.distance===1/0?A(k,n):T.distance};let{distance:Kt,closestPoint:Ke}=hn(n,k,Tt[$+1]);return Kt<T.distance?{distance:Kt,closestPoint:Ke,index:$}:T},{distance:1/0,closestPoint:g.points[0],index:0});return x<f.distance?{distance:x,closestPoint:z,index:E,i:b}:f},{distance:1/0,closestPoint:u[0],index:0,i:0});return{distance:h,closestPoint:p,routeIndex:d+l,pointIndex:d===0?m+this.pointIndex:m}}toPosition(t,n){let r=this.adsorb(t,n);if(console.log("adsorbData",r),!r)return;let{distance:i,closestPoint:o,routeIndex:a,pointIndex:l}=r;i>this.options.offsetDistance?(this.offset=!0,this.resetTimer||(this.resetTimer=this.timer.setTimeout(()=>{this.reset=!0,this.resetTimer=null},this.options.offsetToResetTime))):(this.offset=!1,this.reset=!1,this.resetTimer&&(this.timer.clearTimeout(this.resetTimer),this.resetTimer=null)),this.routeIndex=a,this.pointIndex=l,this.position=o,this.emitNavigationStatus()}startSimulation(){this.resetStatus(this.paths),this.emitNavigationStatus(),this.startCurRouteSimulation()}async startCurRouteSimulation(){let{curRoutePath:t}=this;if(!t)return;this.simulationTween&&this.tweenUtil.remove(this.simulationTween);let n=[];return new Promise(r=>{let i=[this.position,...this.curRoutePathPoints.slice(this.pointIndex+1)],o=this.getCurRouteRemainDistance(),a=o/this.options.simulationSpeed,l=(0,Yr.throttle)(c=>{let h=ee(i,c.distance);h&&(n.push({floor:t.floor,pos:h}),this.toPosition(t.floor,h))},200),u=this.simulationTween=new jr.Tween({distance:0},this.tweenUtil.group).to({distance:o},a*1e3).onUpdate(l).onComplete(()=>{this.tweenUtil.remove(u),l.flush(),l.cancel(),this.routeIndex+1<this.paths.length?(this.routeIndex++,this.position=this.paths[this.routeIndex].points[0],this.pointIndex=0,setTimeout(()=>{r(this.startCurRouteSimulation())},3e3)):(r(!0),console.log(n,this.routeIndex,this.paths))}).start()})}changeSimulationSpeed(t){this.options.simulationSpeed=t,this.startCurRouteSimulation()}getCurRouteRemainDistance(){let{curRoutePathPoints:t,pointIndex:n,position:r}=this;if(!t.length)return 0;let i=[r,...t.slice(n+1)];return at(i)}getRemainDistance(){let t=this.getCurRouteRemainDistance();return{total:this.paths.slice(this.routeIndex+1).reduce((i,o)=>i+o.distance,0)+t,curRoute:t}}getNextDirDistance(){if(!this.position)return null;let{pointIndex:t,curRoutePathPoints:n,position:r}=this,i=n[t],o=n[t+1],a=n[t+2];if(!i||!o)return{dir:"end",distance:0};let l=A(r,o);return t===0&&A(i,r)<5?{dir:"start",distance:l}:a?{dir:we(i,o,a),distance:l}:{dir:"end",distance:l}}getNavigationInfo(){let{total:t,curRoute:n}=this.getRemainDistance();console.log(t,n,this.paths);let r=this.getNextDirDistance();if(!r)return null;let{dir:i,distance:o}=r;return i==="end"&&o>15&&(i="front"),i!=="start"&&o>=this.options.directionEmitThreshold&&(i="front"),n<=10&&(i="end"),{distance:t,curRouteDistance:n,nextDirDistance:o,dir:i,pos:this.position,routeIndex:this.routeIndex,offset:this.offset,reset:this.reset}}dispose(){this.timer.dispose(),this.unRegistryEvent(),this.tweenUtil.clear()}};var $r=require("three"),ve=class extends $r.EventDispatcher{_task=[];started=!1;activeTask=null;_id=0;constructor(e=!0){super(),e&&this.start()}_isEffectiveTask(e){return e&&typeof e.run=="function"}_getIndexByTid(e){return this._task.findIndex(t=>t.tid===e)}_createTask(e){return this._isEffectiveTask(e)?{...e,tid:++this._id,meta:e.meta||{}}:!1}get task(){return[...this._task]}getTasks(){return[...this._task]}add(e){if(this._isEffectiveTask(e)){let t=this._createTask(e);return this._task.push(t),this.started&&!this.activeTask&&this.start(),t.tid}return!1}replace(e,t){if(!this._isEffectiveTask(t))return console.warn("[TaskQueue] replace\u65B9\u6CD5\u4F20\u5165\u7684task\u53C2\u6570\u683C\u5F0F\u4E0D\u6B63\u786E"),!1;let n=this._getIndexByTid(e);if(n===-1)return console.warn(`[TaskQueue] \u6CA1\u6709\u627E\u5230id=${e}\u7684\u4EFB\u52A1`),!1;let r=this._createTask(t);return this._task.splice(n,1,r),r.tid}remove(e){let t=this._getIndexByTid(e);return t===-1?(console.warn(`[TaskQueue] remove\u65B9\u6CD5\u4F20\u5165\u7684id\uFF1A${e}\u627E\u4E0D\u5230\u5BF9\u5E94\u7684task`),!1):(this._task.splice(t,1),!0)}clear(){this._task.length=0}start(){this.started=!0,!this.activeTask&&this._task.length&&this.exec()}stop(){this.started=!1}async exec(){if(!this.started||!this._task.length)return!1;let e=this._task.shift();this.activeTask=e,this.dispatchEvent({type:"active-task-start",task:e});try{await e.run()}catch(t){console.warn("[task run err]",t,e)}return this.activeTask=null,this.dispatchEvent({type:"active-task-end",task:e}),this.exec()}};var qi={path:{},cheapMaximumDistance:20,needStartPoi:!1,startPoi:{},positionNavigation:{},offsetY:150,directionEmitThreshold:5,disablePathAnimation:!1,speed:1},An=class extends dt{path=null;fetchRoadStatus=!1;paths=[];curPathIndex=0;curFloorPath=null;translatePath=null;currentPathPosition=null;options;pathTween=null;startPoi=null;movedDistance=0;pathStart=[0,0];tweenUtil=new Dt;taskQueue=new ve;animationPathOptions={cPathIndex:0};cPath=[];positionNavigation;constructor(e,t={},n){super(e),!n&&typeof t=="object"&&(n=t),this.options=Object.assign({},qi,n);let{apiDomain:r,apiPath:{roadNetwork:i},apiInfo:o}=this.bmap.config;this.positionNavigation=new ke(this,{simulationSpeed:this.options.speed,...this.options.positionNavigation}),this.registryEvent()}get curFloorPathLength(){return this.curFloorPath?.distance??0}get curFloorPathPoints(){return this.curFloorPath?.points??[]}registryEvent(){this.bmap.context.addEventListener("update",this.onUpdate),this.bmap.addEventListener("switch_floor_after",this.onSwitchFloor),this.positionNavigation.addEventListener("navigation-info",this.onNavigationInfo)}onNavigationInfo=({info:e})=>{if(this.dispatchEvent({type:"navigation-info",info:e}),!e.offset){if(e.routeIndex!==this.curPathIndex)return;this.toPositionByTask(e.pos)}};toPositionByTask(e){let n=this.taskQueue.getTasks().find(i=>i.meta.type==="toPosition")?.tid,r={run:()=>this.toPositionBySpeed(e,this.options.speed),meta:{type:"toPosition"}};n?this.taskQueue.replace(n,r):this.taskQueue.add(r)}pauseAnimation(){this.tweenUtil.pause(),this.positionNavigation.tweenUtil.pause()}continueAnimation(){this.tweenUtil.continue(),this.positionNavigation.tweenUtil.continue()}clearTween(){this.tweenUtil.clear(),this.taskQueue.clear(),this.bmap.context.control.enabled=!0}unRegistryEvent(){this.bmap.context.removeEventListener("update",this.onUpdate),this.bmap.removeEventListener("switch_floor_after",this.onSwitchFloor),this.positionNavigation.removeEventListener("navigation-info",this.onNavigationInfo)}onUpdate=()=>{this.tweenUtil.update()};clearPath(){this.path&&(this.bmap.context.scene.remove(this.path),this.path.dispose(),this.path=null,this.clearTween()),this.startPoi&&(this.bmap.context.currentFloor?.poiLayer2.removePoi(this.startPoi),this.startPoi=null),this.translatePath=null}setCurFloorPath(e){e===null?(this.curFloorPath=null,this.currentPathPosition=null):(this.curFloorPath=e,this.currentPathPosition=e.points[0]),this.movedDistance=0,this.clearTween()}setCurPathIndex(e){this.curPathIndex=e,this.paths[e]?.floor===this.bmap.context.currentFloor?.name?(this.setCurFloorPath(this.paths[e]),this.renderPath(this.translatePoints(this.curFloorPathPoints))):this.clearPath()}onSwitchFloor=({data:{curFloor:e}})=>{if(this.clearTween(),this.paths[this.curPathIndex]){let t=this.paths[this.curPathIndex];this.setCurFloorPath(t??null),t?this.renderPath(this.translatePoints(t.points)):this.clearPath()}else this.clearPath()};addPath(e,t=0){this.paths=e,this.curPathIndex=t,this.clearTween();let n=this.bmap.context.currentFloor?.name,r=e[t];if(n&&r?.floor===n)if(this.setCurFloorPath(r),this.bmap.currentBuildGround)this.renderPath(this.translatePoints(r.points));else{let i=()=>{this.bmap.removeEventListener("center-change",i),this.renderPath(this.translatePoints(r.points))};this.bmap.addEventListener("center-change",i)}else this.clearPath();this.dispatchEvent({type:"add-path",paths:e})}translatePoints(e){let[t,n]=this.bmap.buildingCenter;return e.map(r=>[r[0]-t,r[1]-n])}renderPath(e){this.translatePath=e;let t=this.catmullRomCurve3(e);this.cPath=t,this.animationPathOptions={cPathIndex:0},this.pathStart=t[0],this.path?this.path.updatePoints(t):(this.path=new ze(this,this.options.path),this.path.create(t),this.path.position.z=this.bmap.context.currentFloor.groundMaxHeight+.5,this.bmap.context.scene.add(this.path)),this.path.movePath(0),this.startPoi&&(this.bmap.context.currentFloor?.poiLayer2.removePoi(this.startPoi),this.startPoi=null),this.options.needStartPoi&&(this.startPoi=new q(this.bmap.context,{...this.options.startPoi,id:"navigation_start_poi",position:{x:t[0][0],y:t[0][1],z:.51},collision_enable:!1})||null,this.bmap.context.currentFloor?.poiLayer2.pushPoi(this.startPoi)),this.dispatchEvent({type:"render-path",path:this.path})}catmullRomCurve3(e){return cn(e,!1,!0,.1,170,2.5)}getPathDirection(){if(!this.curFloorPath||!this.currentPathPosition||this.curFloorPathPoints.length<2)return null;let e=Pt(this.curFloorPathPoints,this.currentPathPosition),t=this.curFloorPathPoints[e],n=this.curFloorPathPoints[e+1],r=new wt.Vector3(n[0]-t[0],n[1]-t[1],0).normalize(),i=new wt.Vector3(0,1,0).normalize(),o=r.angleTo(i),a=new wt.Vector3().crossVectors(i,r);return(Object.is(a.y,0)?-1:1)*o}async changeCameraToPathUp(e=100){let t=this.getPathDirection();if(t===null)return;let n=this.bmap.context.control.getAzimuthalAngle();Math.abs(n-t)>Math.PI&&(n>0?t=Math.PI*2+t:t=t-Math.PI*2);let r=Math.abs(t-this.bmap.context.control.getAzimuthalAngle());if(r<.01)return;let{control:i}=this.bmap.context,o=e/Math.PI*6*r;return Z(new Promise(a=>{let l={azimuthal:i.getAzimuthalAngle()},u={azimuthal:t},c=new Yt.Tween(l,this.tweenUtil.group).to(u,o).easing(Yt.Easing.Quadratic.InOut).onUpdate(async()=>{this.startPoi&&i.target.copy(this.startPoi.position),i.setAzimuthalAngle(l.azimuthal,!0),i.setTargetByOffset(this.options.offsetY)}).onComplete(()=>{i.enabled=!0,this.tweenUtil.remove(c),a(!0)}).onStart(()=>{i.enabled=!1}).start()}),o+500).finally(()=>{this.bmap.context.control.enabled=!0})}async initNavigationCamera(e=1e3){let n=this.taskQueue.getTasks().find(i=>i.meta.type==="initNavigationCamera")?.tid,r={run:()=>Z((async()=>{await this.initCameraZoom(e/2),await this.changeCameraToPathUp(e/4),await this.translateCameraToStartPoi(e/4)})(),e+500).finally(()=>{this.bmap.context.control.enabled=!0}),meta:{type:"initNavigationCamera"}};n?this.taskQueue.replace(n,r):this.taskQueue.add(r)}async translateCameraToStartPoi(e=100){if(!this.startPoi)return;let{clientSize:{width:t,height:n},camera:r,control:i}=this.bmap.context,o=Math.round(t/2),a=Math.round(n/2),l=i.target.clone(),u=y(this.startPoi.position,r,t,n),c=u.x-o,h=a-u.y+this.options.offsetY;if(console.log("start",l.clone()),!(Math.abs(c)<=1&&Math.abs(h)<=1)){if(Math.abs(c)>=1){let p=new wt.Vector3;p.setFromMatrixColumn(r.matrix,0),p.normalize(),p.multiplyScalar(c/r.zoom),l.add(new wt.Vector3(p.x,p.y,0))}if(Math.abs(h)>=1){let p=new wt.Vector3;p.setFromMatrixColumn(r.matrix,1),p.normalize(),p.multiplyScalar(h/r.zoom),l.add(new wt.Vector3(p.x,p.y,0))}return console.log("start1",l.clone()),Z(new Promise(p=>{let d=i.target.clone();console.log(d,l,e);let m=new Yt.Tween(d,this.tweenUtil.group).to(l,e).onUpdate(()=>{this.bmap.context.control.setCameraPositionByTarget(d,0)}).onComplete(()=>{this.bmap.context.control.setCameraPositionByTarget(l,0),this.tweenUtil.remove(m),this.bmap.context.control.enabled=!0,p(!0)}).onStart(()=>{this.bmap.context.control.enabled=!1}).start()}),e+500).then(()=>{this.bmap.context.control.enabled=!0})}}async initCameraZoom(e=100){if(!this.startPoi)return;let{clientSize:{width:t,height:n},currentFloor:r}=this.bmap.context,{max:i,min:o}=r.box,l=Math.min(t/(i.x-o.x),n/(i.y-o.y))*(i.x-o.x)/40;return this.bmap.context.setZoom(l,this.startPoi.position,e).finally(()=>{this.bmap.context.control.enabled=!0})}toPosition(e,t){this.positionNavigation.toPosition(e,t)}startSimulation(){this.positionNavigation.startSimulation()}setSimulationSpeed(e){this.positionNavigation.changeSimulationSpeed(e)}async toPositionBySpeed(e,t){let{currentPathPosition:n,curFloorPath:r,curFloorPathPoints:i}=this;if(!r||!n)return null;let o=this.movedDistance,a=fn(i,e);if(o===-1||a===-1||a<=o)return null;let l=a-o;if(!l)return;let u=Math.min(l/t,1);return this.pathTween&&this.clearTween(),Z(new Promise(c=>{let h=this.pathTween=new Yt.Tween({distance:0},this.tweenUtil.group).to({distance:l},u*1e3).onUpdate(async p=>{this.moveDistance(p.distance+o,h)}).onComplete(()=>{this.tweenUtil.remove(h),c(!0)}).start()}),u*1e3+500).finally(()=>{this.bmap.context.control.enabled=!0})}async moveDistance(e,t){this.movedDistance=e,this.path?.movePath(this.movedDistance/this.curFloorPathLength);let n=ee(this.curFloorPathPoints,this.movedDistance);if(n===null)return;this.currentPathPosition=n;let r=this.translatePoints([n])[0];this.startPoi&&(this.startPoi.position.setX(r[0]).setY(r[1]),this.options.disablePathAnimation||this.bmap.context.control.setTargetByOffset(this.options.offsetY,this.startPoi.position.clone())),this.options.disablePathAnimation||(t?.pause(),await this.changeCameraToPathUp(500/this.options.speed),t?.resume())}setStartPoiRotate(e){if(this.startPoi){let n=(this.bmap.context.control.getAzimuthalAngle()*180/Math.PI+360)%360;this.startPoi.options.icon_rotate=(360-e-n)%360}}dispose(){this.tweenUtil.dispose(),this.unRegistryEvent(),this.path?.dispose(),this.startPoi?.dispose(),this.positionNavigation.dispose()}};var Kr=require("three"),In=class extends dt{poiLayer;floors=[];group=new Kr.Group;constructor(e){super(e),this.poiLayer=new Ut(e.context)}show(e){let t=e[0].userData.height;e.forEach(i=>{i.poiLayer2.pois.forEach(o=>{o.position.setZ(o.position.z+t),o.options.depth_test=!0,this.poiLayer.pushPoi(o)}),i.poiLayer2.pois.length=0,i.poiLayer2.dispose(),i.position.z=t,t+=i.userData.height});let{scene:n,currentFloor:r}=this.bmap.context;r&&(n.remove(r),r.dispose()),this.group.add(this.poiLayer,...e),n.add(this.group),this.floors=e,this.fitCamera(),this.bmap.context.cameraBound.updateBox()}hide(){let{scene:e}=this.bmap.context;e.remove(this.group),this.poiLayer.clear(),this.floors.forEach(t=>{t.dispose()}),this.floors=[],this.group.clear()}fitCamera(){let{context:e,config:t,type:n}=this.bmap;e.cameraBound.setEnable(!1),e.control.minZoom=0,e.control.maxZoom=1/0,e.camera.zoom=1,e.setAzimuthalAngle(t.control.defaultAzimuthal,0),e.setPolarAngle(t.control.defaultPolar,0),e.fitCameraToObject(this.group,void 0,0);let r=e.camera.zoom;e.control.minZoom=r,e.control.maxZoom=r*25,n==="3d"&&e.fitCameraToObject(this.group,t.defaultPadding,0,!1),this.bmap.basicZoom=e.camera.zoom,e.control.addEventListener("change",this.bmap.onControlChange.bind(this.bmap)),this.bmap.onControlChange(),e.cameraBound.setEnable(!0)}dispose(){this.poiLayer.dispose(),this.floors.forEach(e=>e.dispose()),this.floors=[]}};var Zr=require("three");function xe(s){let e=new Blob([s],{type:"text/javascript"}),t=URL.createObjectURL(e),n=new Worker(t);return URL.revokeObjectURL(t),n}function Rn(){return xe(`var XP=Object.create;var Jd=Object.defineProperty,YP=Object.defineProperties,$P=Object.getOwnPropertyDescriptor,ZP=Object.getOwnPropertyDescriptors,JP=Object.getOwnPropertyNames,qv=Object.getOwnPropertySymbols,KP=Object.getPrototypeOf,Xv=Object.prototype.hasOwnProperty,QP=Object.prototype.propertyIsEnumerable;var Zd=(r,t,e)=>t in r?Jd(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,qc=(r,t)=>{for(var e in t||(t={}))Xv.call(t,e)&&Zd(r,e,t[e]);if(qv)for(var e of qv(t))QP.call(t,e)&&Zd(r,e,t[e]);return r},Yv=(r,t)=>YP(r,ZP(t));var ce=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports);var jP=(r,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of JP(t))!Xv.call(r,a)&&a!==e&&Jd(r,a,{get:()=>t[a],enumerable:!(o=$P(t,a))||o.enumerable});return r};var Nr=(r,t,e)=>(e=r!=null?XP(KP(r)):{},jP(t||!r||!r.__esModule?Jd(e,"default",{value:r,enumerable:!0}):e,r));var Ii=(r,t,e)=>Zd(r,typeof t!="symbol"?t+"":t,e);var Zv=ce((Pz,$v)=>{var Kd=class{constructor(){this.keys=new Set,this.queue=[]}sort(){this.queue.sort((t,e)=>t.priority-e.priority)}set(t,e){let o=Number(e);if(isNaN(o))throw new TypeError('"priority" must be a number');return this.keys.has(t)?this.queue.map(a=>(a.key===t&&Object.assign(a,{priority:o}),a)):(this.keys.add(t),this.queue.push({key:t,priority:o})),this.sort(),this.queue.length}next(){let t=this.queue.shift();return this.keys.delete(t.key),t}isEmpty(){return this.queue.length===0}has(t){return this.keys.has(t)}get(t){return this.queue.find(e=>e.key===t)}};$v.exports=Kd});var Qv=ce((Iz,Kv)=>{function Jv(r,t){let e=new Map;for(let[o,a]of r)o!==t&&a instanceof Map?e.set(o,Jv(a,t)):o!==t&&e.set(o,a);return e}Kv.exports=Jv});var e_=ce((Rz,t_)=>{function tI(r){let t=Number(r);return!(isNaN(t)||t<=0)}function jv(r){let t=new Map;return Object.keys(r).forEach(o=>{let a=r[o];if(a!==null&&typeof a=="object"&&!Array.isArray(a))return t.set(o,jv(a));if(!tI(a))throw new Error(\`Could not add node at key "\${o}", make sure it's a valid node\`,a);return t.set(o,Number(a))}),t}t_.exports=jv});var i_=ce((Lz,r_)=>{function n_(r){if(!(r instanceof Map))throw new Error(\`Invalid graph: Expected Map instead found \${typeof r}\`);r.forEach((t,e)=>{if(typeof t=="object"&&t instanceof Map){n_(t);return}if(typeof t!="number"||t<=0)throw new Error(\`Values must be numbers greater than 0. Found value \${t} at \${e}\`)})}r_.exports=n_});var u_=ce((Nz,a_)=>{var eI=Zv(),nI=Qv(),o_=e_(),s_=i_(),Qd=class{constructor(t){t instanceof Map?(s_(t),this.graph=t):t?this.graph=o_(t):this.graph=new Map}addNode(t,e){let o;return e instanceof Map?(s_(e),o=e):o=o_(e),this.graph.set(t,o),this}addVertex(t,e){return this.addNode(t,e)}removeNode(t){return this.graph=nI(this.graph,t),this}path(t,e,o={}){if(!this.graph.size)return o.cost?{path:null,cost:0}:null;let a=new Set,c=new eI,p=new Map,d=[],g=0,y=[];if(o.avoid&&(y=[].concat(o.avoid)),y.includes(t))throw new Error(\`Starting node (\${t}) cannot be avoided\`);if(y.includes(e))throw new Error(\`Ending node (\${e}) cannot be avoided\`);for(c.set(t,0);!c.isEmpty();){let _=c.next();if(_.key===e){g=_.priority;let x=_.key;for(;p.has(x);)d.push(x),x=p.get(x);break}a.add(_.key),(this.graph.get(_.key)||new Map).forEach((x,b)=>{if(a.has(b)||y.includes(b))return null;if(!c.has(b))return p.set(b,_.key),c.set(b,_.priority+x);let P=c.get(b).priority,I=_.priority+x;return I<P?(p.set(b,_.key),c.set(b,I)):null})}return d.length?(o.trim?d.shift():d=d.concat([t]),o.reverse||(d=d.reverse()),o.cost?{path:d,cost:g}:d):o.cost?{path:null,cost:0}:null}shortestPath(...t){return this.path(...t)}};a_.exports=Qd});var Qh=ce((Hz,Q1)=>{"use strict";var K1=Object.getOwnPropertySymbols,rD=Object.prototype.hasOwnProperty,iD=Object.prototype.propertyIsEnumerable;function oD(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function sD(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de",Object.getOwnPropertyNames(r)[0]==="5")return!1;for(var t={},e=0;e<10;e++)t["_"+String.fromCharCode(e)]=e;var o=Object.getOwnPropertyNames(t).map(function(c){return t[c]});if(o.join("")!=="0123456789")return!1;var a={};return"abcdefghijklmnopqrst".split("").forEach(function(c){a[c]=c}),Object.keys(Object.assign({},a)).join("")==="abcdefghijklmnopqrst"}catch(c){return!1}}Q1.exports=sD()?Object.assign:function(r,t){for(var e,o=oD(r),a,c=1;c<arguments.length;c++){e=Object(arguments[c]);for(var p in e)rD.call(e,p)&&(o[p]=e[p]);if(K1){a=K1(e);for(var d=0;d<a.length;d++)iD.call(e,a[d])&&(o[a[d]]=e[a[d]])}}return o}});var Sm=ce((wm,Mm)=>{(function(r,t){typeof wm=="object"&&typeof Mm!="undefined"?Mm.exports=t():typeof define=="function"&&define.amd?define(t):(r=r||self).RBush=t()})(wm,function(){"use strict";function r(M,E,N,A,U){(function z($,q,D,G,Q){for(;G>D;){if(G-D>600){var _t=G-D+1,Z=q-D+1,Dt=Math.log(_t),et=.5*Math.exp(2*Dt/3),vt=.5*Math.sqrt(Dt*et*(_t-et)/_t)*(Z-_t/2<0?-1:1),It=Math.max(D,Math.floor(q-Z*et/_t+vt)),Pt=Math.min(G,Math.floor(q+(_t-Z)*et/_t+vt));z($,q,It,Pt,Q)}var Et=$[q],yt=D,Y=G;for(t($,D,q),Q($[G],Et)>0&&t($,D,G);yt<Y;){for(t($,yt,Y),yt++,Y--;Q($[yt],Et)<0;)yt++;for(;Q($[Y],Et)>0;)Y--}Q($[D],Et)===0?t($,D,Y):t($,++Y,G),Y<=q&&(D=Y+1),q<=Y&&(G=Y-1)}})(M,E,N||0,A||M.length-1,U||e)}function t(M,E,N){var A=M[E];M[E]=M[N],M[N]=A}function e(M,E){return M<E?-1:M>E?1:0}var o=function(M){M===void 0&&(M=9),this._maxEntries=Math.max(4,M),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function a(M,E,N){if(!N)return E.indexOf(M);for(var A=0;A<E.length;A++)if(N(M,E[A]))return A;return-1}function c(M,E){p(M,0,M.children.length,E,M)}function p(M,E,N,A,U){U||(U=P(null)),U.minX=1/0,U.minY=1/0,U.maxX=-1/0,U.maxY=-1/0;for(var z=E;z<N;z++){var $=M.children[z];d(U,M.leaf?A($):$)}return U}function d(M,E){return M.minX=Math.min(M.minX,E.minX),M.minY=Math.min(M.minY,E.minY),M.maxX=Math.max(M.maxX,E.maxX),M.maxY=Math.max(M.maxY,E.maxY),M}function g(M,E){return M.minX-E.minX}function y(M,E){return M.minY-E.minY}function _(M){return(M.maxX-M.minX)*(M.maxY-M.minY)}function w(M){return M.maxX-M.minX+(M.maxY-M.minY)}function x(M,E){return M.minX<=E.minX&&M.minY<=E.minY&&E.maxX<=M.maxX&&E.maxY<=M.maxY}function b(M,E){return E.minX<=M.maxX&&E.minY<=M.maxY&&E.maxX>=M.minX&&E.maxY>=M.minY}function P(M){return{children:M,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function I(M,E,N,A,U){for(var z=[E,N];z.length;)if(!((N=z.pop())-(E=z.pop())<=A)){var $=E+Math.ceil((N-E)/A/2)*A;r(M,$,E,N,U),z.push(E,$,$,N)}}return o.prototype.all=function(){return this._all(this.data,[])},o.prototype.search=function(M){var E=this.data,N=[];if(!b(M,E))return N;for(var A=this.toBBox,U=[];E;){for(var z=0;z<E.children.length;z++){var $=E.children[z],q=E.leaf?A($):$;b(M,q)&&(E.leaf?N.push($):x(M,q)?this._all($,N):U.push($))}E=U.pop()}return N},o.prototype.collides=function(M){var E=this.data;if(!b(M,E))return!1;for(var N=[];E;){for(var A=0;A<E.children.length;A++){var U=E.children[A],z=E.leaf?this.toBBox(U):U;if(b(M,z)){if(E.leaf||x(M,z))return!0;N.push(U)}}E=N.pop()}return!1},o.prototype.load=function(M){if(!M||!M.length)return this;if(M.length<this._minEntries){for(var E=0;E<M.length;E++)this.insert(M[E]);return this}var N=this._build(M.slice(),0,M.length-1,0);if(this.data.children.length)if(this.data.height===N.height)this._splitRoot(this.data,N);else{if(this.data.height<N.height){var A=this.data;this.data=N,N=A}this._insert(N,this.data.height-N.height-1,!0)}else this.data=N;return this},o.prototype.insert=function(M){return M&&this._insert(M,this.data.height-1),this},o.prototype.clear=function(){return this.data=P([]),this},o.prototype.remove=function(M,E){if(!M)return this;for(var N,A,U,z=this.data,$=this.toBBox(M),q=[],D=[];z||q.length;){if(z||(z=q.pop(),A=q[q.length-1],N=D.pop(),U=!0),z.leaf){var G=a(M,z.children,E);if(G!==-1)return z.children.splice(G,1),q.push(z),this._condense(q),this}U||z.leaf||!x(z,$)?A?(N++,z=A.children[N],U=!1):z=null:(q.push(z),D.push(N),N=0,A=z,z=z.children[0])}return this},o.prototype.toBBox=function(M){return M},o.prototype.compareMinX=function(M,E){return M.minX-E.minX},o.prototype.compareMinY=function(M,E){return M.minY-E.minY},o.prototype.toJSON=function(){return this.data},o.prototype.fromJSON=function(M){return this.data=M,this},o.prototype._all=function(M,E){for(var N=[];M;)M.leaf?E.push.apply(E,M.children):N.push.apply(N,M.children),M=N.pop();return E},o.prototype._build=function(M,E,N,A){var U,z=N-E+1,$=this._maxEntries;if(z<=$)return c(U=P(M.slice(E,N+1)),this.toBBox),U;A||(A=Math.ceil(Math.log(z)/Math.log($)),$=Math.ceil(z/Math.pow($,A-1))),(U=P([])).leaf=!1,U.height=A;var q=Math.ceil(z/$),D=q*Math.ceil(Math.sqrt($));I(M,E,N,D,this.compareMinX);for(var G=E;G<=N;G+=D){var Q=Math.min(G+D-1,N);I(M,G,Q,q,this.compareMinY);for(var _t=G;_t<=Q;_t+=q){var Z=Math.min(_t+q-1,Q);U.children.push(this._build(M,_t,Z,A-1))}}return c(U,this.toBBox),U},o.prototype._chooseSubtree=function(M,E,N,A){for(;A.push(E),!E.leaf&&A.length-1!==N;){for(var U=1/0,z=1/0,$=void 0,q=0;q<E.children.length;q++){var D=E.children[q],G=_(D),Q=(_t=M,Z=D,(Math.max(Z.maxX,_t.maxX)-Math.min(Z.minX,_t.minX))*(Math.max(Z.maxY,_t.maxY)-Math.min(Z.minY,_t.minY))-G);Q<z?(z=Q,U=G<U?G:U,$=D):Q===z&&G<U&&(U=G,$=D)}E=$||E.children[0]}var _t,Z;return E},o.prototype._insert=function(M,E,N){var A=N?M:this.toBBox(M),U=[],z=this._chooseSubtree(A,this.data,E,U);for(z.children.push(M),d(z,A);E>=0&&U[E].children.length>this._maxEntries;)this._split(U,E),E--;this._adjustParentBBoxes(A,U,E)},o.prototype._split=function(M,E){var N=M[E],A=N.children.length,U=this._minEntries;this._chooseSplitAxis(N,U,A);var z=this._chooseSplitIndex(N,U,A),$=P(N.children.splice(z,N.children.length-z));$.height=N.height,$.leaf=N.leaf,c(N,this.toBBox),c($,this.toBBox),E?M[E-1].children.push($):this._splitRoot(N,$)},o.prototype._splitRoot=function(M,E){this.data=P([M,E]),this.data.height=M.height+1,this.data.leaf=!1,c(this.data,this.toBBox)},o.prototype._chooseSplitIndex=function(M,E,N){for(var A,U,z,$,q,D,G,Q=1/0,_t=1/0,Z=E;Z<=N-E;Z++){var Dt=p(M,0,Z,this.toBBox),et=p(M,Z,N,this.toBBox),vt=(U=Dt,z=et,$=void 0,q=void 0,D=void 0,G=void 0,$=Math.max(U.minX,z.minX),q=Math.max(U.minY,z.minY),D=Math.min(U.maxX,z.maxX),G=Math.min(U.maxY,z.maxY),Math.max(0,D-$)*Math.max(0,G-q)),It=_(Dt)+_(et);vt<Q?(Q=vt,A=Z,_t=It<_t?It:_t):vt===Q&&It<_t&&(_t=It,A=Z)}return A||N-E},o.prototype._chooseSplitAxis=function(M,E,N){var A=M.leaf?this.compareMinX:g,U=M.leaf?this.compareMinY:y;this._allDistMargin(M,E,N,A)<this._allDistMargin(M,E,N,U)&&M.children.sort(A)},o.prototype._allDistMargin=function(M,E,N,A){M.children.sort(A);for(var U=this.toBBox,z=p(M,0,E,U),$=p(M,N-E,N,U),q=w(z)+w($),D=E;D<N-E;D++){var G=M.children[D];d(z,M.leaf?U(G):G),q+=w(z)}for(var Q=N-E-1;Q>=E;Q--){var _t=M.children[Q];d($,M.leaf?U(_t):_t),q+=w($)}return q},o.prototype._adjustParentBBoxes=function(M,E,N){for(var A=N;A>=0;A--)d(E[A],M)},o.prototype._condense=function(M){for(var E=M.length-1,N=void 0;E>=0;E--)M[E].children.length===0?E>0?(N=M[E-1].children).splice(N.indexOf(M[E]),1):this.clear():c(M[E],this.toBBox)},o})});var j1=ce((bm,Tm)=>{(function(r,t){typeof bm=="object"&&typeof Tm!="undefined"?Tm.exports=t():typeof define=="function"&&define.amd?define(t):(r=r||self,r.TinyQueue=t())})(bm,function(){"use strict";var r=function(o,a){if(o===void 0&&(o=[]),a===void 0&&(a=t),this.data=o,this.length=this.data.length,this.compare=a,this.length>0)for(var c=(this.length>>1)-1;c>=0;c--)this._down(c)};r.prototype.push=function(o){this.data.push(o),this.length++,this._up(this.length-1)},r.prototype.pop=function(){if(this.length!==0){var o=this.data[0],a=this.data.pop();return this.length--,this.length>0&&(this.data[0]=a,this._down(0)),o}},r.prototype.peek=function(){return this.data[0]},r.prototype._up=function(o){for(var a=this,c=a.data,p=a.compare,d=c[o];o>0;){var g=o-1>>1,y=c[g];if(p(d,y)>=0)break;c[o]=y,o=g}c[o]=d},r.prototype._down=function(o){for(var a=this,c=a.data,p=a.compare,d=this.length>>1,g=c[o];o<d;){var y=(o<<1)+1,_=c[y],w=y+1;if(w<this.length&&p(c[w],_)<0&&(y=w,_=c[w]),p(_,g)>=0)break;c[o]=_,o=y}c[o]=g};function t(e,o){return e<o?-1:e>o?1:0}return r})});var ex=ce(($z,tx)=>{tx.exports=function(t,e,o,a){var c=t[0],p=t[1],d=!1;o===void 0&&(o=0),a===void 0&&(a=e.length);for(var g=(a-o)/2,y=0,_=g-1;y<g;_=y++){var w=e[o+y*2+0],x=e[o+y*2+1],b=e[o+_*2+0],P=e[o+_*2+1],I=x>p!=P>p&&c<(b-w)*(p-x)/(P-x)+w;I&&(d=!d)}return d}});var rx=ce((Zz,nx)=>{nx.exports=function(t,e,o,a){var c=t[0],p=t[1],d=!1;o===void 0&&(o=0),a===void 0&&(a=e.length);for(var g=a-o,y=0,_=g-1;y<g;_=y++){var w=e[y+o][0],x=e[y+o][1],b=e[_+o][0],P=e[_+o][1],I=x>p!=P>p&&c<(b-w)*(p-x)/(P-x)+w;I&&(d=!d)}return d}});var sx=ce((Jz,ep)=>{var ix=ex(),ox=rx();ep.exports=function(t,e,o,a){return e.length>0&&Array.isArray(e[0])?ox(t,e,o,a):ix(t,e,o,a)};ep.exports.nested=ox;ep.exports.flat=ix});var ux=ce((np,ax)=>{(function(r,t){typeof np=="object"&&typeof ax!="undefined"?t(np):typeof define=="function"&&define.amd?define(["exports"],t):t((r=r||self).predicates={})})(np,function(r){"use strict";let e=33306690738754706e-32;function o(b,P,I,M,E){let N,A,U,z,$=P[0],q=M[0],D=0,G=0;q>$==q>-$?(N=$,$=P[++D]):(N=q,q=M[++G]);let Q=0;if(D<b&&G<I)for(q>$==q>-$?(U=N-((A=$+N)-$),$=P[++D]):(U=N-((A=q+N)-q),q=M[++G]),N=A,U!==0&&(E[Q++]=U);D<b&&G<I;)q>$==q>-$?(U=N-((A=N+$)-(z=A-N))+($-z),$=P[++D]):(U=N-((A=N+q)-(z=A-N))+(q-z),q=M[++G]),N=A,U!==0&&(E[Q++]=U);for(;D<b;)U=N-((A=N+$)-(z=A-N))+($-z),$=P[++D],N=A,U!==0&&(E[Q++]=U);for(;G<I;)U=N-((A=N+q)-(z=A-N))+(q-z),q=M[++G],N=A,U!==0&&(E[Q++]=U);return N===0&&Q!==0||(E[Q++]=N),Q}function a(b){return new Float64Array(b)}let c=33306690738754716e-32,p=22204460492503146e-32,d=11093356479670487e-47,g=a(4),y=a(8),_=a(12),w=a(16),x=a(4);r.orient2d=function(b,P,I,M,E,N){let A=(P-N)*(I-E),U=(b-E)*(M-N),z=A-U;if(A===0||U===0||A>0!=U>0)return z;let $=Math.abs(A+U);return Math.abs(z)>=c*$?z:-function(q,D,G,Q,_t,Z,Dt){let et,vt,It,Pt,Et,yt,Y,ht,Mt,zt,At,$t,ue,le,Qt,me,Xt,Ee,ft=q-_t,He=G-_t,te=D-Z,fe=Q-Z;Et=(Qt=(ht=ft-(Y=(yt=134217729*ft)-(yt-ft)))*(zt=fe-(Mt=(yt=134217729*fe)-(yt-fe)))-((le=ft*fe)-Y*Mt-ht*Mt-Y*zt))-(At=Qt-(Xt=(ht=te-(Y=(yt=134217729*te)-(yt-te)))*(zt=He-(Mt=(yt=134217729*He)-(yt-He)))-((me=te*He)-Y*Mt-ht*Mt-Y*zt))),g[0]=Qt-(At+Et)+(Et-Xt),Et=(ue=le-(($t=le+At)-(Et=$t-le))+(At-Et))-(At=ue-me),g[1]=ue-(At+Et)+(Et-me),Et=(Ee=$t+At)-$t,g[2]=$t-(Ee-Et)+(At-Et),g[3]=Ee;let de=function(Vn,$n){let j=$n[0];for(let H=1;H<Vn;H++)j+=$n[H];return j}(4,g),Ue=p*Dt;if(de>=Ue||-de>=Ue||(et=q-(ft+(Et=q-ft))+(Et-_t),It=G-(He+(Et=G-He))+(Et-_t),vt=D-(te+(Et=D-te))+(Et-Z),Pt=Q-(fe+(Et=Q-fe))+(Et-Z),et===0&&vt===0&&It===0&&Pt===0)||(Ue=d*Dt+e*Math.abs(de),(de+=ft*Pt+fe*et-(te*It+He*vt))>=Ue||-de>=Ue))return de;Et=(Qt=(ht=et-(Y=(yt=134217729*et)-(yt-et)))*(zt=fe-(Mt=(yt=134217729*fe)-(yt-fe)))-((le=et*fe)-Y*Mt-ht*Mt-Y*zt))-(At=Qt-(Xt=(ht=vt-(Y=(yt=134217729*vt)-(yt-vt)))*(zt=He-(Mt=(yt=134217729*He)-(yt-He)))-((me=vt*He)-Y*Mt-ht*Mt-Y*zt))),x[0]=Qt-(At+Et)+(Et-Xt),Et=(ue=le-(($t=le+At)-(Et=$t-le))+(At-Et))-(At=ue-me),x[1]=ue-(At+Et)+(Et-me),Et=(Ee=$t+At)-$t,x[2]=$t-(Ee-Et)+(At-Et),x[3]=Ee;let be=o(4,g,4,x,y);Et=(Qt=(ht=ft-(Y=(yt=134217729*ft)-(yt-ft)))*(zt=Pt-(Mt=(yt=134217729*Pt)-(yt-Pt)))-((le=ft*Pt)-Y*Mt-ht*Mt-Y*zt))-(At=Qt-(Xt=(ht=te-(Y=(yt=134217729*te)-(yt-te)))*(zt=It-(Mt=(yt=134217729*It)-(yt-It)))-((me=te*It)-Y*Mt-ht*Mt-Y*zt))),x[0]=Qt-(At+Et)+(Et-Xt),Et=(ue=le-(($t=le+At)-(Et=$t-le))+(At-Et))-(At=ue-me),x[1]=ue-(At+Et)+(Et-me),Et=(Ee=$t+At)-$t,x[2]=$t-(Ee-Et)+(At-Et),x[3]=Ee;let kt=o(be,y,4,x,_);Et=(Qt=(ht=et-(Y=(yt=134217729*et)-(yt-et)))*(zt=Pt-(Mt=(yt=134217729*Pt)-(yt-Pt)))-((le=et*Pt)-Y*Mt-ht*Mt-Y*zt))-(At=Qt-(Xt=(ht=vt-(Y=(yt=134217729*vt)-(yt-vt)))*(zt=It-(Mt=(yt=134217729*It)-(yt-It)))-((me=vt*It)-Y*Mt-ht*Mt-Y*zt))),x[0]=Qt-(At+Et)+(Et-Xt),Et=(ue=le-(($t=le+At)-(Et=$t-le))+(At-Et))-(At=ue-me),x[1]=ue-(At+Et)+(Et-me),Et=(Ee=$t+At)-$t,x[2]=$t-(Ee-Et)+(At-Et),x[3]=Ee;let ye=o(kt,_,4,x,w);return w[ye-1]}(b,P,I,M,E,N,$)},r.orient2dfast=function(b,P,I,M,E,N){return(P-N)*(I-E)-(b-E)*(M-N)},Object.defineProperty(r,"__esModule",{value:!0})})});var dx=ce((Kz,Im)=>{"use strict";var lx=Sm(),ip=j1(),uD=sx(),lD=ux().orient2d;ip.default&&(ip=ip.default);Im.exports=px;Im.exports.default=px;function px(r,t,e){t=Math.max(0,t===void 0?2:t),e=e||0;var o=dD(r),a=new lx(16);a.toBBox=function(N){return{minX:N[0],minY:N[1],maxX:N[0],maxY:N[1]}},a.compareMinX=function(N,A){return N[0]-A[0]},a.compareMinY=function(N,A){return N[1]-A[1]},a.load(r);for(var c=[],p=0,d;p<o.length;p++){var g=o[p];a.remove(g),d=hx(g,d),c.push(d)}var y=new lx(16);for(p=0;p<c.length;p++)y.insert(Am(c[p]));for(var _=t*t,w=e*e;c.length;){var x=c.shift(),b=x.p,P=x.next.p,I=Cm(b,P);if(!(I<w)){var M=I/_;g=cD(a,x.prev.p,b,P,x.next.next.p,M,y),g&&Math.min(Cm(g,b),Cm(g,P))<=M&&(c.push(x),c.push(hx(g,x)),a.remove(g),y.remove(x),y.insert(Am(x)),y.insert(Am(x.next)))}}x=d;var E=[];do E.push(x.p),x=x.next;while(x!==d);return E.push(x.p),E}function cD(r,t,e,o,a,c,p){for(var d=new ip([],fD),g=r.data;g;){for(var y=0;y<g.children.length;y++){var _=g.children[y],w=g.leaf?Pm(_,e,o):hD(e,o,_);w>c||d.push({node:_,dist:w})}for(;d.length&&!d.peek().node.children;){var x=d.pop(),b=x.node,P=Pm(b,t,e),I=Pm(b,o,a);if(x.dist<P&&x.dist<I&&fx(e,b,p)&&fx(o,b,p))return b}g=d.pop(),g&&(g=g.node)}return null}function fD(r,t){return r.dist-t.dist}function hD(r,t,e){if(cx(r,e)||cx(t,e))return 0;var o=rp(r[0],r[1],t[0],t[1],e.minX,e.minY,e.maxX,e.minY);if(o===0)return 0;var a=rp(r[0],r[1],t[0],t[1],e.minX,e.minY,e.minX,e.maxY);if(a===0)return 0;var c=rp(r[0],r[1],t[0],t[1],e.maxX,e.minY,e.maxX,e.maxY);if(c===0)return 0;var p=rp(r[0],r[1],t[0],t[1],e.minX,e.maxY,e.maxX,e.maxY);return p===0?0:Math.min(o,a,c,p)}function cx(r,t){return r[0]>=t.minX&&r[0]<=t.maxX&&r[1]>=t.minY&&r[1]<=t.maxY}function fx(r,t,e){for(var o=Math.min(r[0],t[0]),a=Math.min(r[1],t[1]),c=Math.max(r[0],t[0]),p=Math.max(r[1],t[1]),d=e.search({minX:o,minY:a,maxX:c,maxY:p}),g=0;g<d.length;g++)if(pD(d[g].p,d[g].next.p,r,t))return!1;return!0}function ic(r,t,e){return lD(r[0],r[1],t[0],t[1],e[0],e[1])}function pD(r,t,e,o){return r!==o&&t!==e&&ic(r,t,e)>0!=ic(r,t,o)>0&&ic(e,o,r)>0!=ic(e,o,t)>0}function Am(r){var t=r.p,e=r.next.p;return r.minX=Math.min(t[0],e[0]),r.minY=Math.min(t[1],e[1]),r.maxX=Math.max(t[0],e[0]),r.maxY=Math.max(t[1],e[1]),r}function dD(r){for(var t=r[0],e=r[0],o=r[0],a=r[0],c=0;c<r.length;c++){var p=r[c];p[0]<t[0]&&(t=p),p[0]>o[0]&&(o=p),p[1]<e[1]&&(e=p),p[1]>a[1]&&(a=p)}var d=[t,e,o,a],g=d.slice();for(c=0;c<r.length;c++)uD(r[c],d)||g.push(r[c]);return mD(g)}function hx(r,t){var e={p:r,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return t?(e.next=t.next,e.prev=t,t.next.prev=e,t.next=e):(e.prev=e,e.next=e),e}function Cm(r,t){var e=r[0]-t[0],o=r[1]-t[1];return e*e+o*o}function Pm(r,t,e){var o=t[0],a=t[1],c=e[0]-o,p=e[1]-a;if(c!==0||p!==0){var d=((r[0]-o)*c+(r[1]-a)*p)/(c*c+p*p);d>1?(o=e[0],a=e[1]):d>0&&(o+=c*d,a+=p*d)}return c=r[0]-o,p=r[1]-a,c*c+p*p}function rp(r,t,e,o,a,c,p,d){var g=e-r,y=o-t,_=p-a,w=d-c,x=r-a,b=t-c,P=g*g+y*y,I=g*_+y*w,M=_*_+w*w,E=g*x+y*b,N=_*x+w*b,A=P*M-I*I,U,z,$,q,D=A,G=A;A===0?(z=0,D=1,q=N,G=M):(z=I*N-M*E,q=P*N-I*E,z<0?(z=0,q=N,G=M):z>D&&(z=D,q=N+I,G=M)),q<0?(q=0,-E<0?z=0:-E>P?z=D:(z=-E,D=P)):q>G&&(q=G,-E+I<0?z=0:-E+I>P?z=D:(z=-E+I,D=P)),U=z===0?0:z/D,$=q===0?0:q/G;var Q=(1-U)*r+U*e,_t=(1-U)*t+U*o,Z=(1-$)*a+$*p,Dt=(1-$)*c+$*d,et=Z-Q,vt=Dt-_t;return et*et+vt*vt}function gD(r,t){return r[0]===t[0]?r[1]-t[1]:r[0]-t[0]}function mD(r){r.sort(gD);for(var t=[],e=0;e<r.length;e++){for(;t.length>=2&&ic(t[t.length-2],t[t.length-1],r[e])<=0;)t.pop();t.push(r[e])}for(var o=[],a=r.length-1;a>=0;a--){for(;o.length>=2&&ic(o[o.length-2],o[o.length-1],r[a])<=0;)o.pop();o.push(r[a])}return o.pop(),t.pop(),t.concat(o)}});var xx=ce((Lm,Nm)=>{(function(r,t){typeof Lm=="object"&&typeof Nm!="undefined"?Nm.exports=t():typeof define=="function"&&define.amd?define(t):r.quickselect=t()})(Lm,function(){"use strict";function r(a,c,p,d,g){t(a,c,p||0,d||a.length-1,g||o)}function t(a,c,p,d,g){for(;d>p;){if(d-p>600){var y=d-p+1,_=c-p+1,w=Math.log(y),x=.5*Math.exp(2*w/3),b=.5*Math.sqrt(w*x*(y-x)/y)*(_-y/2<0?-1:1),P=Math.max(p,Math.floor(c-_*x/y+b)),I=Math.min(d,Math.floor(c+(y-_)*x/y+b));t(a,c,P,I,g)}var M=a[c],E=p,N=d;for(e(a,p,c),g(a[d],M)>0&&e(a,p,d);E<N;){for(e(a,E,N),E++,N--;g(a[E],M)<0;)E++;for(;g(a[N],M)>0;)N--}g(a[p],M)===0?e(a,p,N):(N++,e(a,N,d)),N<=c&&(p=N+1),c<=N&&(d=N-1)}}function e(a,c,p){var d=a[c];a[c]=a[p],a[p]=d}function o(a,c){return a<c?-1:a>c?1:0}return r})});var Um=ce((Mk,Fm)=>{"use strict";Fm.exports=lf;Fm.exports.default=lf;var PD=xx();function lf(r,t){if(!(this instanceof lf))return new lf(r,t);this._maxEntries=Math.max(4,r||9),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),t&&this._initFormat(t),this.clear()}lf.prototype={all:function(){return this._all(this.data,[])},search:function(r){var t=this.data,e=[],o=this.toBBox;if(!sp(r,t))return e;for(var a=[],c,p,d,g;t;){for(c=0,p=t.children.length;c<p;c++)d=t.children[c],g=t.leaf?o(d):d,sp(r,g)&&(t.leaf?e.push(d):Dm(r,g)?this._all(d,e):a.push(d));t=a.pop()}return e},collides:function(r){var t=this.data,e=this.toBBox;if(!sp(r,t))return!1;for(var o=[],a,c,p,d;t;){for(a=0,c=t.children.length;a<c;a++)if(p=t.children[a],d=t.leaf?e(p):p,sp(r,d)){if(t.leaf||Dm(r,d))return!0;o.push(p)}t=o.pop()}return!1},load:function(r){if(!(r&&r.length))return this;if(r.length<this._minEntries){for(var t=0,e=r.length;t<e;t++)this.insert(r[t]);return this}var o=this._build(r.slice(),0,r.length-1,0);if(!this.data.children.length)this.data=o;else if(this.data.height===o.height)this._splitRoot(this.data,o);else{if(this.data.height<o.height){var a=this.data;this.data=o,o=a}this._insert(o,this.data.height-o.height-1,!0)}return this},insert:function(r){return r&&this._insert(r,this.data.height-1),this},clear:function(){return this.data=ac([]),this},remove:function(r,t){if(!r)return this;for(var e=this.data,o=this.toBBox(r),a=[],c=[],p,d,g,y;e||a.length;){if(e||(e=a.pop(),d=a[a.length-1],p=c.pop(),y=!0),e.leaf&&(g=ID(r,e.children,t),g!==-1))return e.children.splice(g,1),a.push(e),this._condense(a),this;!y&&!e.leaf&&Dm(e,o)?(a.push(e),c.push(p),p=0,d=e,e=e.children[0]):d?(p++,e=d.children[p],y=!1):e=null}return this},toBBox:function(r){return r},compareMinX:Ex,compareMinY:wx,toJSON:function(){return this.data},fromJSON:function(r){return this.data=r,this},_all:function(r,t){for(var e=[];r;)r.leaf?t.push.apply(t,r.children):e.push.apply(e,r.children),r=e.pop();return t},_build:function(r,t,e,o){var a=e-t+1,c=this._maxEntries,p;if(a<=c)return p=ac(r.slice(t,e+1)),sc(p,this.toBBox),p;o||(o=Math.ceil(Math.log(a)/Math.log(c)),c=Math.ceil(a/Math.pow(c,o-1))),p=ac([]),p.leaf=!1,p.height=o;var d=Math.ceil(a/c),g=d*Math.ceil(Math.sqrt(c)),y,_,w,x;for(Mx(r,t,e,g,this.compareMinX),y=t;y<=e;y+=g)for(w=Math.min(y+g-1,e),Mx(r,y,w,d,this.compareMinY),_=y;_<=w;_+=d)x=Math.min(_+d-1,w),p.children.push(this._build(r,_,x,o-1));return sc(p,this.toBBox),p},_chooseSubtree:function(r,t,e,o){for(var a,c,p,d,g,y,_,w;o.push(t),!(t.leaf||o.length-1===e);){for(_=w=1/0,a=0,c=t.children.length;a<c;a++)p=t.children[a],g=Om(p),y=RD(r,p)-g,y<w?(w=y,_=g<_?g:_,d=p):y===w&&g<_&&(_=g,d=p);t=d||t.children[0]}return t},_insert:function(r,t,e){var o=this.toBBox,a=e?r:o(r),c=[],p=this._chooseSubtree(a,this.data,t,c);for(p.children.push(r),uf(p,a);t>=0&&c[t].children.length>this._maxEntries;)this._split(c,t),t--;this._adjustParentBBoxes(a,c,t)},_split:function(r,t){var e=r[t],o=e.children.length,a=this._minEntries;this._chooseSplitAxis(e,a,o);var c=this._chooseSplitIndex(e,a,o),p=ac(e.children.splice(c,e.children.length-c));p.height=e.height,p.leaf=e.leaf,sc(e,this.toBBox),sc(p,this.toBBox),t?r[t-1].children.push(p):this._splitRoot(e,p)},_splitRoot:function(r,t){this.data=ac([r,t]),this.data.height=r.height+1,this.data.leaf=!1,sc(this.data,this.toBBox)},_chooseSplitIndex:function(r,t,e){var o,a,c,p,d,g,y,_;for(g=y=1/0,o=t;o<=e-t;o++)a=af(r,0,o,this.toBBox),c=af(r,o,e,this.toBBox),p=LD(a,c),d=Om(a)+Om(c),p<g?(g=p,_=o,y=d<y?d:y):p===g&&d<y&&(y=d,_=o);return _},_chooseSplitAxis:function(r,t,e){var o=r.leaf?this.compareMinX:Ex,a=r.leaf?this.compareMinY:wx,c=this._allDistMargin(r,t,e,o),p=this._allDistMargin(r,t,e,a);c<p&&r.children.sort(o)},_allDistMargin:function(r,t,e,o){r.children.sort(o);var a=this.toBBox,c=af(r,0,t,a),p=af(r,e-t,e,a),d=op(c)+op(p),g,y;for(g=t;g<e-t;g++)y=r.children[g],uf(c,r.leaf?a(y):y),d+=op(c);for(g=e-t-1;g>=t;g--)y=r.children[g],uf(p,r.leaf?a(y):y),d+=op(p);return d},_adjustParentBBoxes:function(r,t,e){for(var o=e;o>=0;o--)uf(t[o],r)},_condense:function(r){for(var t=r.length-1,e;t>=0;t--)r[t].children.length===0?t>0?(e=r[t-1].children,e.splice(e.indexOf(r[t]),1)):this.clear():sc(r[t],this.toBBox)},_initFormat:function(r){var t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(r[0])),this.compareMinY=new Function("a","b",t.join(r[1])),this.toBBox=new Function("a","return {minX: a"+r[0]+", minY: a"+r[1]+", maxX: a"+r[2]+", maxY: a"+r[3]+"};")}};function ID(r,t,e){if(!e)return t.indexOf(r);for(var o=0;o<t.length;o++)if(e(r,t[o]))return o;return-1}function sc(r,t){af(r,0,r.children.length,t,r)}function af(r,t,e,o,a){a||(a=ac(null)),a.minX=1/0,a.minY=1/0,a.maxX=-1/0,a.maxY=-1/0;for(var c=t,p;c<e;c++)p=r.children[c],uf(a,r.leaf?o(p):p);return a}function uf(r,t){return r.minX=Math.min(r.minX,t.minX),r.minY=Math.min(r.minY,t.minY),r.maxX=Math.max(r.maxX,t.maxX),r.maxY=Math.max(r.maxY,t.maxY),r}function Ex(r,t){return r.minX-t.minX}function wx(r,t){return r.minY-t.minY}function Om(r){return(r.maxX-r.minX)*(r.maxY-r.minY)}function op(r){return r.maxX-r.minX+(r.maxY-r.minY)}function RD(r,t){return(Math.max(t.maxX,r.maxX)-Math.min(t.minX,r.minX))*(Math.max(t.maxY,r.maxY)-Math.min(t.minY,r.minY))}function LD(r,t){var e=Math.max(r.minX,t.minX),o=Math.max(r.minY,t.minY),a=Math.min(r.maxX,t.maxX),c=Math.min(r.maxY,t.maxY);return Math.max(0,a-e)*Math.max(0,c-o)}function Dm(r,t){return r.minX<=t.minX&&r.minY<=t.minY&&t.maxX<=r.maxX&&t.maxY<=r.maxY}function sp(r,t){return t.minX<=r.maxX&&t.minY<=r.maxY&&t.maxX>=r.minX&&t.maxY>=r.minY}function ac(r){return{children:r,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Mx(r,t,e,o,a){for(var c=[t,e],p;c.length;)e=c.pop(),t=c.pop(),!(e-t<=o)&&(p=t+Math.ceil((e-t)/o/2)*o,PD(r,p,t,e,a),c.push(t,p,p,e))}});var Px=ce((F5,Vm)=>{"use strict";Vm.exports=cp;Vm.exports.default=cp;function cp(r,t,e){e=e||2;var o=t&&t.length,a=o?t[0]*e:r.length,c=Tx(r,0,a,e,!0),p=[];if(!c||c.next===c.prev)return p;var d,g,y,_,w,x,b;if(o&&(c=HD(r,t,c,e)),r.length>80*e){d=y=r[0],g=_=r[1];for(var P=e;P<a;P+=e)w=r[P],x=r[P+1],w<d&&(d=w),x<g&&(g=x),w>y&&(y=w),x>_&&(_=x);b=Math.max(y-d,_-g),b=b!==0?32767/b:0}return hf(c,p,e,d,g,b,0),p}function Tx(r,t,e,o,a){var c,p;if(a===Hm(r,t,e,o)>0)for(c=t;c<e;c+=o)p=bx(c,r[c],r[c+1],p);else for(c=e-o;c>=t;c-=o)p=bx(c,r[c],r[c+1],p);return p&&fp(p,p.next)&&(df(p),p=p.next),p}function al(r,t){if(!r)return r;t||(t=r);var e=r,o;do if(o=!1,!e.steiner&&(fp(e,e.next)||Vr(e.prev,e,e.next)===0)){if(df(e),e=t=e.prev,e===e.next)break;o=!0}else e=e.next;while(o||e!==t);return t}function hf(r,t,e,o,a,c,p){if(r){!p&&c&&YD(r,o,a,c);for(var d=r,g,y;r.prev!==r.next;){if(g=r.prev,y=r.next,c?zD(r,o,a,c):BD(r)){t.push(g.i/e|0),t.push(r.i/e|0),t.push(y.i/e|0),df(r),r=y.next,d=y.next;continue}if(r=y,r===d){p?p===1?(r=GD(al(r),t,e),hf(r,t,e,o,a,c,2)):p===2&&kD(r,t,e,o,a,c):hf(al(r),t,e,o,a,c,1);break}}}}function BD(r){var t=r.prev,e=r,o=r.next;if(Vr(t,e,o)>=0)return!1;for(var a=t.x,c=e.x,p=o.x,d=t.y,g=e.y,y=o.y,_=a<c?a<p?a:p:c<p?c:p,w=d<g?d<y?d:y:g<y?g:y,x=a>c?a>p?a:p:c>p?c:p,b=d>g?d>y?d:y:g>y?g:y,P=o.next;P!==t;){if(P.x>=_&&P.x<=x&&P.y>=w&&P.y<=b&&cc(a,d,c,g,p,y,P.x,P.y)&&Vr(P.prev,P,P.next)>=0)return!1;P=P.next}return!0}function zD(r,t,e,o){var a=r.prev,c=r,p=r.next;if(Vr(a,c,p)>=0)return!1;for(var d=a.x,g=c.x,y=p.x,_=a.y,w=c.y,x=p.y,b=d<g?d<y?d:y:g<y?g:y,P=_<w?_<x?_:x:w<x?w:x,I=d>g?d>y?d:y:g>y?g:y,M=_>w?_>x?_:x:w>x?w:x,E=Gm(b,P,t,e,o),N=Gm(I,M,t,e,o),A=r.prevZ,U=r.nextZ;A&&A.z>=E&&U&&U.z<=N;){if(A.x>=b&&A.x<=I&&A.y>=P&&A.y<=M&&A!==a&&A!==p&&cc(d,_,g,w,y,x,A.x,A.y)&&Vr(A.prev,A,A.next)>=0||(A=A.prevZ,U.x>=b&&U.x<=I&&U.y>=P&&U.y<=M&&U!==a&&U!==p&&cc(d,_,g,w,y,x,U.x,U.y)&&Vr(U.prev,U,U.next)>=0))return!1;U=U.nextZ}for(;A&&A.z>=E;){if(A.x>=b&&A.x<=I&&A.y>=P&&A.y<=M&&A!==a&&A!==p&&cc(d,_,g,w,y,x,A.x,A.y)&&Vr(A.prev,A,A.next)>=0)return!1;A=A.prevZ}for(;U&&U.z<=N;){if(U.x>=b&&U.x<=I&&U.y>=P&&U.y<=M&&U!==a&&U!==p&&cc(d,_,g,w,y,x,U.x,U.y)&&Vr(U.prev,U,U.next)>=0)return!1;U=U.nextZ}return!0}function GD(r,t,e){var o=r;do{var a=o.prev,c=o.next.next;!fp(a,c)&&Ax(a,o,o.next,c)&&pf(a,c)&&pf(c,a)&&(t.push(a.i/e|0),t.push(o.i/e|0),t.push(c.i/e|0),df(o),df(o.next),o=r=c),o=o.next}while(o!==r);return al(o)}function kD(r,t,e,o,a,c){var p=r;do{for(var d=p.next.next;d!==p.prev;){if(p.i!==d.i&&JD(p,d)){var g=Cx(p,d);p=al(p,p.next),g=al(g,g.next),hf(p,t,e,o,a,c,0),hf(g,t,e,o,a,c,0);return}d=d.next}p=p.next}while(p!==r)}function HD(r,t,e,o){var a=[],c,p,d,g,y;for(c=0,p=t.length;c<p;c++)d=t[c]*o,g=c<p-1?t[c+1]*o:r.length,y=Tx(r,d,g,o,!1),y===y.next&&(y.steiner=!0),a.push(ZD(y));for(a.sort(VD),c=0;c<a.length;c++)e=WD(a[c],e);return e}function VD(r,t){return r.x-t.x}function WD(r,t){var e=qD(r,t);if(!e)return t;var o=Cx(e,r);return al(o,o.next),al(e,e.next)}function qD(r,t){var e=t,o=r.x,a=r.y,c=-1/0,p;do{if(a<=e.y&&a>=e.next.y&&e.next.y!==e.y){var d=e.x+(a-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(d<=o&&d>c&&(c=d,p=e.x<e.next.x?e:e.next,d===o))return p}e=e.next}while(e!==t);if(!p)return null;var g=p,y=p.x,_=p.y,w=1/0,x;e=p;do o>=e.x&&e.x>=y&&o!==e.x&&cc(a<_?o:c,a,y,_,a<_?c:o,a,e.x,e.y)&&(x=Math.abs(a-e.y)/(o-e.x),pf(e,r)&&(x<w||x===w&&(e.x>p.x||e.x===p.x&&XD(p,e)))&&(p=e,w=x)),e=e.next;while(e!==g);return p}function XD(r,t){return Vr(r.prev,r,t.prev)<0&&Vr(t.next,r,r.next)<0}function YD(r,t,e,o){var a=r;do a.z===0&&(a.z=Gm(a.x,a.y,t,e,o)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==r);a.prevZ.nextZ=null,a.prevZ=null,$D(a)}function $D(r){var t,e,o,a,c,p,d,g,y=1;do{for(e=r,r=null,c=null,p=0;e;){for(p++,o=e,d=0,t=0;t<y&&(d++,o=o.nextZ,!!o);t++);for(g=y;d>0||g>0&&o;)d!==0&&(g===0||!o||e.z<=o.z)?(a=e,e=e.nextZ,d--):(a=o,o=o.nextZ,g--),c?c.nextZ=a:r=a,a.prevZ=c,c=a;e=o}c.nextZ=null,y*=2}while(p>1);return r}function Gm(r,t,e,o,a){return r=(r-e)*a|0,t=(t-o)*a|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,r|t<<1}function ZD(r){var t=r,e=r;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==r);return e}function cc(r,t,e,o,a,c,p,d){return(a-p)*(t-d)>=(r-p)*(c-d)&&(r-p)*(o-d)>=(e-p)*(t-d)&&(e-p)*(c-d)>=(a-p)*(o-d)}function JD(r,t){return r.next.i!==t.i&&r.prev.i!==t.i&&!KD(r,t)&&(pf(r,t)&&pf(t,r)&&QD(r,t)&&(Vr(r.prev,r,t.prev)||Vr(r,t.prev,t))||fp(r,t)&&Vr(r.prev,r,r.next)>0&&Vr(t.prev,t,t.next)>0)}function Vr(r,t,e){return(t.y-r.y)*(e.x-t.x)-(t.x-r.x)*(e.y-t.y)}function fp(r,t){return r.x===t.x&&r.y===t.y}function Ax(r,t,e,o){var a=lp(Vr(r,t,e)),c=lp(Vr(r,t,o)),p=lp(Vr(e,o,r)),d=lp(Vr(e,o,t));return!!(a!==c&&p!==d||a===0&&up(r,e,t)||c===0&&up(r,o,t)||p===0&&up(e,r,o)||d===0&&up(e,t,o))}function up(r,t,e){return t.x<=Math.max(r.x,e.x)&&t.x>=Math.min(r.x,e.x)&&t.y<=Math.max(r.y,e.y)&&t.y>=Math.min(r.y,e.y)}function lp(r){return r>0?1:r<0?-1:0}function KD(r,t){var e=r;do{if(e.i!==r.i&&e.next.i!==r.i&&e.i!==t.i&&e.next.i!==t.i&&Ax(e,e.next,r,t))return!0;e=e.next}while(e!==r);return!1}function pf(r,t){return Vr(r.prev,r,r.next)<0?Vr(r,t,r.next)>=0&&Vr(r,r.prev,t)>=0:Vr(r,t,r.prev)<0||Vr(r,r.next,t)<0}function QD(r,t){var e=r,o=!1,a=(r.x+t.x)/2,c=(r.y+t.y)/2;do e.y>c!=e.next.y>c&&e.next.y!==e.y&&a<(e.next.x-e.x)*(c-e.y)/(e.next.y-e.y)+e.x&&(o=!o),e=e.next;while(e!==r);return o}function Cx(r,t){var e=new km(r.i,r.x,r.y),o=new km(t.i,t.x,t.y),a=r.next,c=t.prev;return r.next=t,t.prev=r,e.next=a,a.prev=e,o.next=e,e.prev=o,c.next=o,o.prev=c,o}function bx(r,t,e,o){var a=new km(r,t,e);return o?(a.next=o.next,a.prev=o,o.next.prev=a,o.next=a):(a.prev=a,a.next=a),a}function df(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function km(r,t,e){this.i=r,this.x=t,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}cp.deviation=function(r,t,e,o){var a=t&&t.length,c=a?t[0]*e:r.length,p=Math.abs(Hm(r,0,c,e));if(a)for(var d=0,g=t.length;d<g;d++){var y=t[d]*e,_=d<g-1?t[d+1]*e:r.length;p-=Math.abs(Hm(r,y,_,e))}var w=0;for(d=0;d<o.length;d+=3){var x=o[d]*e,b=o[d+1]*e,P=o[d+2]*e;w+=Math.abs((r[x]-r[P])*(r[b+1]-r[x+1])-(r[x]-r[b])*(r[P+1]-r[x+1]))}return p===0&&w===0?0:Math.abs((w-p)/p)};function Hm(r,t,e,o){for(var a=0,c=t,p=e-o;c<e;c+=o)a+=(r[p]-r[c])*(r[c+1]+r[p+1]),p=c;return a}cp.flatten=function(r){for(var t=r[0][0].length,e={vertices:[],holes:[],dimensions:t},o=0,a=0;a<r.length;a++){for(var c=0;c<r[a].length;c++)for(var p=0;p<t;p++)e.vertices.push(r[a][c][p]);a>0&&(o+=r[a-1].length,e.holes.push(o))}return e}});var $m=ce(Ie=>{"use strict";Object.defineProperty(Ie,"__esModule",{value:!0});Ie.earthRadius=63710088e-1;Ie.factors={centimeters:Ie.earthRadius*100,centimetres:Ie.earthRadius*100,degrees:Ie.earthRadius/111325,feet:Ie.earthRadius*3.28084,inches:Ie.earthRadius*39.37,kilometers:Ie.earthRadius/1e3,kilometres:Ie.earthRadius/1e3,meters:Ie.earthRadius,metres:Ie.earthRadius,miles:Ie.earthRadius/1609.344,millimeters:Ie.earthRadius*1e3,millimetres:Ie.earthRadius*1e3,nauticalmiles:Ie.earthRadius/1852,radians:1,yards:Ie.earthRadius*1.0936};Ie.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/Ie.earthRadius,yards:1.0936133};Ie.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function Au(r,t,e){e===void 0&&(e={});var o={type:"Feature"};return(e.id===0||e.id)&&(o.id=e.id),e.bbox&&(o.bbox=e.bbox),o.properties=t||{},o.geometry=r,o}Ie.feature=Au;function t3(r,t,e){switch(e===void 0&&(e={}),r){case"Point":return Wm(t).geometry;case"LineString":return Xm(t).geometry;case"Polygon":return qm(t).geometry;case"MultiPoint":return Rx(t).geometry;case"MultiLineString":return Ix(t).geometry;case"MultiPolygon":return Lx(t).geometry;default:throw new Error(r+" is invalid")}}Ie.geometry=t3;function Wm(r,t,e){if(e===void 0&&(e={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!hp(r[0])||!hp(r[1]))throw new Error("coordinates must contain numbers");var o={type:"Point",coordinates:r};return Au(o,t,e)}Ie.point=Wm;function e3(r,t,e){return e===void 0&&(e={}),pp(r.map(function(o){return Wm(o,t)}),e)}Ie.points=e3;function qm(r,t,e){e===void 0&&(e={});for(var o=0,a=r;o<a.length;o++){var c=a[o];if(c.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var p=0;p<c[c.length-1].length;p++)if(c[c.length-1][p]!==c[0][p])throw new Error("First and last Position are not equivalent.")}var d={type:"Polygon",coordinates:r};return Au(d,t,e)}Ie.polygon=qm;function n3(r,t,e){return e===void 0&&(e={}),pp(r.map(function(o){return qm(o,t)}),e)}Ie.polygons=n3;function Xm(r,t,e){if(e===void 0&&(e={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var o={type:"LineString",coordinates:r};return Au(o,t,e)}Ie.lineString=Xm;function r3(r,t,e){return e===void 0&&(e={}),pp(r.map(function(o){return Xm(o,t)}),e)}Ie.lineStrings=r3;function pp(r,t){t===void 0&&(t={});var e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=r,e}Ie.featureCollection=pp;function Ix(r,t,e){e===void 0&&(e={});var o={type:"MultiLineString",coordinates:r};return Au(o,t,e)}Ie.multiLineString=Ix;function Rx(r,t,e){e===void 0&&(e={});var o={type:"MultiPoint",coordinates:r};return Au(o,t,e)}Ie.multiPoint=Rx;function Lx(r,t,e){e===void 0&&(e={});var o={type:"MultiPolygon",coordinates:r};return Au(o,t,e)}Ie.multiPolygon=Lx;function i3(r,t,e){e===void 0&&(e={});var o={type:"GeometryCollection",geometries:r};return Au(o,t,e)}Ie.geometryCollection=i3;function o3(r,t){if(t===void 0&&(t=0),t&&!(t>=0))throw new Error("precision must be a positive number");var e=Math.pow(10,t||0);return Math.round(r*e)/e}Ie.round=o3;function Nx(r,t){t===void 0&&(t="kilometers");var e=Ie.factors[t];if(!e)throw new Error(t+" units is invalid");return r*e}Ie.radiansToLength=Nx;function Ym(r,t){t===void 0&&(t="kilometers");var e=Ie.factors[t];if(!e)throw new Error(t+" units is invalid");return r/e}Ie.lengthToRadians=Ym;function s3(r,t){return Ox(Ym(r,t))}Ie.lengthToDegrees=s3;function a3(r){var t=r%360;return t<0&&(t+=360),t}Ie.bearingToAzimuth=a3;function Ox(r){var t=r%(2*Math.PI);return t*180/Math.PI}Ie.radiansToDegrees=Ox;function u3(r){var t=r%360;return t*Math.PI/180}Ie.degreesToRadians=u3;function l3(r,t,e){if(t===void 0&&(t="kilometers"),e===void 0&&(e="kilometers"),!(r>=0))throw new Error("length must be a positive number");return Nx(Ym(r,t),e)}Ie.convertLength=l3;function c3(r,t,e){if(t===void 0&&(t="meters"),e===void 0&&(e="kilometers"),!(r>=0))throw new Error("area must be a positive number");var o=Ie.areaFactors[t];if(!o)throw new Error("invalid original units");var a=Ie.areaFactors[e];if(!a)throw new Error("invalid final units");return r/o*a}Ie.convertArea=c3;function hp(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}Ie.isNumber=hp;function f3(r){return!!r&&r.constructor===Object}Ie.isObject=f3;function h3(r){if(!r)throw new Error("bbox is required");if(!Array.isArray(r))throw new Error("bbox must be an Array");if(r.length!==4&&r.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");r.forEach(function(t){if(!hp(t))throw new Error("bbox must only contain numbers")})}Ie.validateBBox=h3;function p3(r){if(!r)throw new Error("id is required");if(["string","number"].indexOf(typeof r)===-1)throw new Error("id must be a number or a string")}Ie.validateId=p3});var Jm=ce(_i=>{"use strict";Object.defineProperty(_i,"__esModule",{value:!0});var oo=$m();function gf(r,t,e){if(r!==null)for(var o,a,c,p,d,g,y,_=0,w=0,x,b=r.type,P=b==="FeatureCollection",I=b==="Feature",M=P?r.features.length:1,E=0;E<M;E++){y=P?r.features[E].geometry:I?r.geometry:r,x=y?y.type==="GeometryCollection":!1,d=x?y.geometries.length:1;for(var N=0;N<d;N++){var A=0,U=0;if(p=x?y.geometries[N]:y,p!==null){g=p.coordinates;var z=p.type;switch(_=e&&(z==="Polygon"||z==="MultiPolygon")?1:0,z){case null:break;case"Point":if(t(g,w,E,A,U)===!1)return!1;w++,A++;break;case"LineString":case"MultiPoint":for(o=0;o<g.length;o++){if(t(g[o],w,E,A,U)===!1)return!1;w++,z==="MultiPoint"&&A++}z==="LineString"&&A++;break;case"Polygon":case"MultiLineString":for(o=0;o<g.length;o++){for(a=0;a<g[o].length-_;a++){if(t(g[o][a],w,E,A,U)===!1)return!1;w++}z==="MultiLineString"&&A++,z==="Polygon"&&U++}z==="Polygon"&&A++;break;case"MultiPolygon":for(o=0;o<g.length;o++){for(U=0,a=0;a<g[o].length;a++){for(c=0;c<g[o][a].length-_;c++){if(t(g[o][a][c],w,E,A,U)===!1)return!1;w++}U++}A++}break;case"GeometryCollection":for(o=0;o<p.geometries.length;o++)if(gf(p.geometries[o],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function d3(r,t,e,o){var a=e;return gf(r,function(c,p,d,g,y){p===0&&e===void 0?a=c:a=t(a,c,p,d,g,y)},o),a}function Dx(r,t){var e;switch(r.type){case"FeatureCollection":for(e=0;e<r.features.length&&t(r.features[e].properties,e)!==!1;e++);break;case"Feature":t(r.properties,0);break}}function g3(r,t,e){var o=e;return Dx(r,function(a,c){c===0&&e===void 0?o=a:o=t(o,a,c)}),o}function Fx(r,t){if(r.type==="Feature")t(r,0);else if(r.type==="FeatureCollection")for(var e=0;e<r.features.length&&t(r.features[e],e)!==!1;e++);}function m3(r,t,e){var o=e;return Fx(r,function(a,c){c===0&&e===void 0?o=a:o=t(o,a,c)}),o}function y3(r){var t=[];return gf(r,function(e){t.push(e)}),t}function Zm(r,t){var e,o,a,c,p,d,g,y,_,w,x=0,b=r.type==="FeatureCollection",P=r.type==="Feature",I=b?r.features.length:1;for(e=0;e<I;e++){for(d=b?r.features[e].geometry:P?r.geometry:r,y=b?r.features[e].properties:P?r.properties:{},_=b?r.features[e].bbox:P?r.bbox:void 0,w=b?r.features[e].id:P?r.id:void 0,g=d?d.type==="GeometryCollection":!1,p=g?d.geometries.length:1,a=0;a<p;a++){if(c=g?d.geometries[a]:d,c===null){if(t(null,x,y,_,w)===!1)return!1;continue}switch(c.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(c,x,y,_,w)===!1)return!1;break}case"GeometryCollection":{for(o=0;o<c.geometries.length;o++)if(t(c.geometries[o],x,y,_,w)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}x++}}function v3(r,t,e){var o=e;return Zm(r,function(a,c,p,d,g){c===0&&e===void 0?o=a:o=t(o,a,c,p,d,g)}),o}function dp(r,t){Zm(r,function(e,o,a,c,p){var d=e===null?null:e.type;switch(d){case null:case"Point":case"LineString":case"Polygon":return t(oo.feature(e,a,{bbox:c,id:p}),o,0)===!1?!1:void 0}var g;switch(d){case"MultiPoint":g="Point";break;case"MultiLineString":g="LineString";break;case"MultiPolygon":g="Polygon";break}for(var y=0;y<e.coordinates.length;y++){var _=e.coordinates[y],w={type:g,coordinates:_};if(t(oo.feature(w,a),o,y)===!1)return!1}})}function _3(r,t,e){var o=e;return dp(r,function(a,c,p){c===0&&p===0&&e===void 0?o=a:o=t(o,a,c,p)}),o}function Ux(r,t){dp(r,function(e,o,a){var c=0;if(e.geometry){var p=e.geometry.type;if(!(p==="Point"||p==="MultiPoint")){var d,g=0,y=0,_=0;if(gf(e,function(w,x,b,P,I){if(d===void 0||o>g||P>y||I>_){d=w,g=o,y=P,_=I,c=0;return}var M=oo.lineString([d,w],e.properties);if(t(M,o,a,I,c)===!1)return!1;c++,d=w})===!1)return!1}}})}function x3(r,t,e){var o=e,a=!1;return Ux(r,function(c,p,d,g,y){a===!1&&e===void 0?o=c:o=t(o,c,p,d,g,y),a=!0}),o}function Bx(r,t){if(!r)throw new Error("geojson is required");dp(r,function(e,o,a){if(e.geometry!==null){var c=e.geometry.type,p=e.geometry.coordinates;switch(c){case"LineString":if(t(e,o,a,0,0)===!1)return!1;break;case"Polygon":for(var d=0;d<p.length;d++)if(t(oo.lineString(p[d],e.properties),o,a,d)===!1)return!1;break}}})}function E3(r,t,e){var o=e;return Bx(r,function(a,c,p,d){c===0&&e===void 0?o=a:o=t(o,a,c,p,d)}),o}function w3(r,t){if(t=t||{},!oo.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,o=t.multiFeatureIndex||0,a=t.geometryIndex||0,c=t.segmentIndex||0,p=t.properties,d;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),p=p||r.features[e].properties,d=r.features[e].geometry;break;case"Feature":p=p||r.properties,d=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":d=r;break;default:throw new Error("geojson is invalid")}if(d===null)return null;var g=d.coordinates;switch(d.type){case"Point":case"MultiPoint":return null;case"LineString":return c<0&&(c=g.length+c-1),oo.lineString([g[c],g[c+1]],p,t);case"Polygon":return a<0&&(a=g.length+a),c<0&&(c=g[a].length+c-1),oo.lineString([g[a][c],g[a][c+1]],p,t);case"MultiLineString":return o<0&&(o=g.length+o),c<0&&(c=g[o].length+c-1),oo.lineString([g[o][c],g[o][c+1]],p,t);case"MultiPolygon":return o<0&&(o=g.length+o),a<0&&(a=g[o].length+a),c<0&&(c=g[o][a].length-c-1),oo.lineString([g[o][a][c],g[o][a][c+1]],p,t)}throw new Error("geojson is invalid")}function M3(r,t){if(t=t||{},!oo.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,o=t.multiFeatureIndex||0,a=t.geometryIndex||0,c=t.coordIndex||0,p=t.properties,d;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),p=p||r.features[e].properties,d=r.features[e].geometry;break;case"Feature":p=p||r.properties,d=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":d=r;break;default:throw new Error("geojson is invalid")}if(d===null)return null;var g=d.coordinates;switch(d.type){case"Point":return oo.point(g,p,t);case"MultiPoint":return o<0&&(o=g.length+o),oo.point(g[o],p,t);case"LineString":return c<0&&(c=g.length+c),oo.point(g[c],p,t);case"Polygon":return a<0&&(a=g.length+a),c<0&&(c=g[a].length+c),oo.point(g[a][c],p,t);case"MultiLineString":return o<0&&(o=g.length+o),c<0&&(c=g[o].length+c),oo.point(g[o][c],p,t);case"MultiPolygon":return o<0&&(o=g.length+o),a<0&&(a=g[o].length+a),c<0&&(c=g[o][a].length-c),oo.point(g[o][a][c],p,t)}throw new Error("geojson is invalid")}_i.coordAll=y3;_i.coordEach=gf;_i.coordReduce=d3;_i.featureEach=Fx;_i.featureReduce=m3;_i.findPoint=M3;_i.findSegment=w3;_i.flattenEach=dp;_i.flattenReduce=_3;_i.geomEach=Zm;_i.geomReduce=v3;_i.lineEach=Bx;_i.lineReduce=E3;_i.propEach=Dx;_i.propReduce=g3;_i.segmentEach=Ux;_i.segmentReduce=x3});var zx=ce(Qm=>{"use strict";Object.defineProperty(Qm,"__esModule",{value:!0});var S3=Jm();function Km(r){var t=[1/0,1/0,-1/0,-1/0];return S3.coordEach(r,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}Km.default=Km;Qm.default=Km});var gp=ce((Q5,jm)=>{var da=Sm(),kx=$m(),Hx=Jm(),fc=zx().default,b3=Hx.featureEach,J5=Hx.coordEach,K5=kx.polygon,Gx=kx.featureCollection;function Vx(r){var t=new da(r);return t.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:fc(e),da.prototype.insert.call(this,e)},t.load=function(e){var o=[];return Array.isArray(e)?e.forEach(function(a){if(a.type!=="Feature")throw new Error("invalid features");a.bbox=a.bbox?a.bbox:fc(a),o.push(a)}):b3(e,function(a){if(a.type!=="Feature")throw new Error("invalid features");a.bbox=a.bbox?a.bbox:fc(a),o.push(a)}),da.prototype.load.call(this,o)},t.remove=function(e,o){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:fc(e),da.prototype.remove.call(this,e,o)},t.clear=function(){return da.prototype.clear.call(this)},t.search=function(e){var o=da.prototype.search.call(this,this.toBBox(e));return Gx(o)},t.collides=function(e){return da.prototype.collides.call(this,this.toBBox(e))},t.all=function(){var e=da.prototype.all.call(this);return Gx(e)},t.toJSON=function(){return da.prototype.toJSON.call(this)},t.fromJSON=function(e){return da.prototype.fromJSON.call(this,e)},t.toBBox=function(e){var o;if(e.bbox)o=e.bbox;else if(Array.isArray(e)&&e.length===4)o=e;else if(Array.isArray(e)&&e.length===6)o=[e[0],e[1],e[3],e[4]];else if(e.type==="Feature")o=fc(e);else if(e.type==="FeatureCollection")o=fc(e);else throw new Error("invalid geojson");return{minX:o[0],minY:o[1],maxX:o[2],maxY:o[3]}},t}jm.exports=Vx;jm.exports.default=Vx});var o0=ce((a6,jx)=>{"use strict";var Qx=Object.prototype.toString;jx.exports=function(t){var e=Qx.call(t),o=e==="[object Arguments]";return o||(o=e!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&Qx.call(t.callee)==="[object Function]"),o}});var uE=ce((u6,aE)=>{"use strict";var sE;Object.keys||(vf=Object.prototype.hasOwnProperty,s0=Object.prototype.toString,tE=o0(),a0=Object.prototype.propertyIsEnumerable,eE=!a0.call({toString:null},"toString"),nE=a0.call(function(){},"prototype"),_f=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],xp=function(r){var t=r.constructor;return t&&t.prototype===r},rE={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},iE=function(){if(typeof window=="undefined")return!1;for(var r in window)try{if(!rE["$"+r]&&vf.call(window,r)&&window[r]!==null&&typeof window[r]=="object")try{xp(window[r])}catch(t){return!0}}catch(t){return!0}return!1}(),oE=function(r){if(typeof window=="undefined"||!iE)return xp(r);try{return xp(r)}catch(t){return!1}},sE=function(t){var e=t!==null&&typeof t=="object",o=s0.call(t)==="[object Function]",a=tE(t),c=e&&s0.call(t)==="[object String]",p=[];if(!e&&!o&&!a)throw new TypeError("Object.keys called on a non-object");var d=nE&&o;if(c&&t.length>0&&!vf.call(t,0))for(var g=0;g<t.length;++g)p.push(String(g));if(a&&t.length>0)for(var y=0;y<t.length;++y)p.push(String(y));else for(var _ in t)!(d&&_==="prototype")&&vf.call(t,_)&&p.push(String(_));if(eE)for(var w=oE(t),x=0;x<_f.length;++x)!(w&&_f[x]==="constructor")&&vf.call(t,_f[x])&&p.push(_f[x]);return p});var vf,s0,tE,a0,eE,nE,_f,xp,rE,iE,oE;aE.exports=sE});var u0=ce((l6,fE)=>{"use strict";var D3=Array.prototype.slice,F3=o0(),lE=Object.keys,Ep=lE?function(t){return lE(t)}:uE(),cE=Object.keys;Ep.shim=function(){if(Object.keys){var t=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);t||(Object.keys=function(o){return F3(o)?cE(D3.call(o)):cE(o)})}else Object.keys=Ep;return Object.keys||Ep};fE.exports=Ep});var l0=ce((c6,hE)=>{"use strict";hE.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},e=Symbol("test"),o=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(o)!=="[object Symbol]")return!1;var a=42;t[e]=a;for(e in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var p=Object.getOwnPropertyDescriptor(t,e);if(p.value!==a||p.enumerable!==!0)return!1}return!0}});var wp=ce((f6,pE)=>{"use strict";var U3=l0();pE.exports=function(){return U3()&&!!Symbol.toStringTag}});var gE=ce((h6,dE)=>{"use strict";dE.exports=Error});var yE=ce((p6,mE)=>{"use strict";mE.exports=EvalError});var _E=ce((d6,vE)=>{"use strict";vE.exports=RangeError});var EE=ce((g6,xE)=>{"use strict";xE.exports=ReferenceError});var c0=ce((m6,wE)=>{"use strict";wE.exports=SyntaxError});var ul=ce((y6,ME)=>{"use strict";ME.exports=TypeError});var bE=ce((v6,SE)=>{"use strict";SE.exports=URIError});var CE=ce((_6,AE)=>{"use strict";var TE=typeof Symbol!="undefined"&&Symbol,B3=l0();AE.exports=function(){return typeof TE!="function"||typeof Symbol!="function"||typeof TE("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:B3()}});var IE=ce((x6,PE)=>{"use strict";var f0={__proto__:null,foo:{}},z3=Object;PE.exports=function(){return{__proto__:f0}.foo===f0.foo&&!(f0 instanceof z3)}});var NE=ce((E6,LE)=>{"use strict";var G3="Function.prototype.bind called on incompatible ",k3=Object.prototype.toString,H3=Math.max,V3="[object Function]",RE=function(t,e){for(var o=[],a=0;a<t.length;a+=1)o[a]=t[a];for(var c=0;c<e.length;c+=1)o[c+t.length]=e[c];return o},W3=function(t,e){for(var o=[],a=e||0,c=0;a<t.length;a+=1,c+=1)o[c]=t[a];return o},q3=function(r,t){for(var e="",o=0;o<r.length;o+=1)e+=r[o],o+1<r.length&&(e+=t);return e};LE.exports=function(t){var e=this;if(typeof e!="function"||k3.apply(e)!==V3)throw new TypeError(G3+e);for(var o=W3(arguments,1),a,c=function(){if(this instanceof a){var _=e.apply(this,RE(o,arguments));return Object(_)===_?_:this}return e.apply(t,RE(o,arguments))},p=H3(0,e.length-o.length),d=[],g=0;g<p;g++)d[g]="$"+g;if(a=Function("binder","return function ("+q3(d,",")+"){ return binder.apply(this,arguments); }")(c),e.prototype){var y=function(){};y.prototype=e.prototype,a.prototype=new y,y.prototype=null}return a}});var Mp=ce((w6,OE)=>{"use strict";var X3=NE();OE.exports=Function.prototype.bind||X3});var FE=ce((M6,DE)=>{"use strict";var Y3=Function.prototype.call,$3=Object.prototype.hasOwnProperty,Z3=Mp();DE.exports=Z3.call(Y3,$3)});var mc=ce((S6,kE)=>{"use strict";var zn,J3=gE(),K3=yE(),Q3=_E(),j3=EE(),gc=c0(),dc=ul(),tF=bE(),GE=Function,h0=function(r){try{return GE('"use strict"; return ('+r+").constructor;")()}catch(t){}},ll=Object.getOwnPropertyDescriptor;if(ll)try{ll({},"")}catch(r){ll=null}var p0=function(){throw new dc},eF=ll?function(){try{return arguments.callee,p0}catch(r){try{return ll(arguments,"callee").get}catch(t){return p0}}}():p0,hc=CE()(),nF=IE()(),Di=Object.getPrototypeOf||(nF?function(r){return r.__proto__}:null),pc={},rF=typeof Uint8Array=="undefined"||!Di?zn:Di(Uint8Array),cl={__proto__:null,"%AggregateError%":typeof AggregateError=="undefined"?zn:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?zn:ArrayBuffer,"%ArrayIteratorPrototype%":hc&&Di?Di([][Symbol.iterator]()):zn,"%AsyncFromSyncIteratorPrototype%":zn,"%AsyncFunction%":pc,"%AsyncGenerator%":pc,"%AsyncGeneratorFunction%":pc,"%AsyncIteratorPrototype%":pc,"%Atomics%":typeof Atomics=="undefined"?zn:Atomics,"%BigInt%":typeof BigInt=="undefined"?zn:BigInt,"%BigInt64Array%":typeof BigInt64Array=="undefined"?zn:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array=="undefined"?zn:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?zn:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":J3,"%eval%":eval,"%EvalError%":K3,"%Float32Array%":typeof Float32Array=="undefined"?zn:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?zn:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?zn:FinalizationRegistry,"%Function%":GE,"%GeneratorFunction%":pc,"%Int8Array%":typeof Int8Array=="undefined"?zn:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?zn:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?zn:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":hc&&Di?Di(Di([][Symbol.iterator]())):zn,"%JSON%":typeof JSON=="object"?JSON:zn,"%Map%":typeof Map=="undefined"?zn:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!hc||!Di?zn:Di(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?zn:Promise,"%Proxy%":typeof Proxy=="undefined"?zn:Proxy,"%RangeError%":Q3,"%ReferenceError%":j3,"%Reflect%":typeof Reflect=="undefined"?zn:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?zn:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!hc||!Di?zn:Di(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?zn:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":hc&&Di?Di(""[Symbol.iterator]()):zn,"%Symbol%":hc?Symbol:zn,"%SyntaxError%":gc,"%ThrowTypeError%":eF,"%TypedArray%":rF,"%TypeError%":dc,"%Uint8Array%":typeof Uint8Array=="undefined"?zn:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?zn:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?zn:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?zn:Uint32Array,"%URIError%":tF,"%WeakMap%":typeof WeakMap=="undefined"?zn:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?zn:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?zn:WeakSet};if(Di)try{null.error}catch(r){UE=Di(Di(r)),cl["%Error.prototype%"]=UE}var UE,iF=function r(t){var e;if(t==="%AsyncFunction%")e=h0("async function () {}");else if(t==="%GeneratorFunction%")e=h0("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=h0("async function* () {}");else if(t==="%AsyncGenerator%"){var o=r("%AsyncGeneratorFunction%");o&&(e=o.prototype)}else if(t==="%AsyncIteratorPrototype%"){var a=r("%AsyncGenerator%");a&&Di&&(e=Di(a.prototype))}return cl[t]=e,e},BE={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},xf=Mp(),Sp=FE(),oF=xf.call(Function.call,Array.prototype.concat),sF=xf.call(Function.apply,Array.prototype.splice),zE=xf.call(Function.call,String.prototype.replace),bp=xf.call(Function.call,String.prototype.slice),aF=xf.call(Function.call,RegExp.prototype.exec),uF=/[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g,lF=/\\\\(\\\\)?/g,cF=function(t){var e=bp(t,0,1),o=bp(t,-1);if(e==="%"&&o!=="%")throw new gc("invalid intrinsic syntax, expected closing \`%\`");if(o==="%"&&e!=="%")throw new gc("invalid intrinsic syntax, expected opening \`%\`");var a=[];return zE(t,uF,function(c,p,d,g){a[a.length]=d?zE(g,lF,"$1"):p||c}),a},fF=function(t,e){var o=t,a;if(Sp(BE,o)&&(a=BE[o],o="%"+a[0]+"%"),Sp(cl,o)){var c=cl[o];if(c===pc&&(c=iF(o)),typeof c=="undefined"&&!e)throw new dc("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:a,name:o,value:c}}throw new gc("intrinsic "+t+" does not exist!")};kE.exports=function(t,e){if(typeof t!="string"||t.length===0)throw new dc("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new dc('"allowMissing" argument must be a boolean');if(aF(/^%?[^%]*%?$/,t)===null)throw new gc("\`%\` may not be present anywhere but at the beginning and end of the intrinsic name");var o=cF(t),a=o.length>0?o[0]:"",c=fF("%"+a+"%",e),p=c.name,d=c.value,g=!1,y=c.alias;y&&(a=y[0],sF(o,oF([0,1],y)));for(var _=1,w=!0;_<o.length;_+=1){var x=o[_],b=bp(x,0,1),P=bp(x,-1);if((b==='"'||b==="'"||b==="\`"||P==='"'||P==="'"||P==="\`")&&b!==P)throw new gc("property names with quotes must have matching quotes");if((x==="constructor"||!w)&&(g=!0),a+="."+x,p="%"+a+"%",Sp(cl,p))d=cl[p];else if(d!=null){if(!(x in d)){if(!e)throw new dc("base intrinsic for "+t+" exists, but the property is not available.");return}if(ll&&_+1>=o.length){var I=ll(d,x);w=!!I,w&&"get"in I&&!("originalValue"in I.get)?d=I.get:d=d[x]}else w=Sp(d,x),d=d[x];w&&!g&&(cl[p]=d)}}return d}});var Ap=ce((b6,HE)=>{"use strict";var hF=mc(),Tp=hF("%Object.defineProperty%",!0)||!1;if(Tp)try{Tp({},"a",{value:1})}catch(r){Tp=!1}HE.exports=Tp});var d0=ce((T6,VE)=>{"use strict";var pF=mc(),Cp=pF("%Object.getOwnPropertyDescriptor%",!0);if(Cp)try{Cp([],"length")}catch(r){Cp=null}VE.exports=Cp});var Pp=ce((A6,XE)=>{"use strict";var WE=Ap(),dF=c0(),yc=ul(),qE=d0();XE.exports=function(t,e,o){if(!t||typeof t!="object"&&typeof t!="function")throw new yc("\`obj\` must be an object or a function\`");if(typeof e!="string"&&typeof e!="symbol")throw new yc("\`property\` must be a string or a symbol\`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new yc("\`nonEnumerable\`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new yc("\`nonWritable\`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new yc("\`nonConfigurable\`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new yc("\`loose\`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,p=arguments.length>5?arguments[5]:null,d=arguments.length>6?arguments[6]:!1,g=!!qE&&qE(t,e);if(WE)WE(t,e,{configurable:p===null&&g?g.configurable:!p,enumerable:a===null&&g?g.enumerable:!a,value:o,writable:c===null&&g?g.writable:!c});else if(d||!a&&!c&&!p)t[e]=o;else throw new dF("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var Ip=ce((C6,$E)=>{"use strict";var g0=Ap(),YE=function(){return!!g0};YE.hasArrayLengthDefineBug=function(){if(!g0)return null;try{return g0([],"length",{value:1}).length!==1}catch(t){return!0}};$E.exports=YE});var jE=ce((P6,QE)=>{"use strict";var gF=mc(),ZE=Pp(),mF=Ip()(),JE=d0(),KE=ul(),yF=gF("%Math.floor%");QE.exports=function(t,e){if(typeof t!="function")throw new KE("\`fn\` is not a function");if(typeof e!="number"||e<0||e>4294967295||yF(e)!==e)throw new KE("\`length\` must be a positive 32-bit integer");var o=arguments.length>2&&!!arguments[2],a=!0,c=!0;if("length"in t&&JE){var p=JE(t,"length");p&&!p.configurable&&(a=!1),p&&!p.writable&&(c=!1)}return(a||c||!o)&&(mF?ZE(t,"length",e,!0,!0):ZE(t,"length",e)),t}});var Np=ce((I6,Rp)=>{"use strict";var m0=Mp(),Lp=mc(),vF=jE(),_F=ul(),nw=Lp("%Function.prototype.apply%"),rw=Lp("%Function.prototype.call%"),iw=Lp("%Reflect.apply%",!0)||m0.call(rw,nw),tw=Ap(),xF=Lp("%Math.max%");Rp.exports=function(t){if(typeof t!="function")throw new _F("a function is required");var e=iw(m0,rw,arguments);return vF(e,1+xF(0,t.length-(arguments.length-1)),!0)};var ew=function(){return iw(m0,nw,arguments)};tw?tw(Rp.exports,"apply",{value:ew}):Rp.exports.apply=ew});var y0=ce((R6,aw)=>{"use strict";var ow=mc(),sw=Np(),EF=sw(ow("String.prototype.indexOf"));aw.exports=function(t,e){var o=ow(t,!!e);return typeof o=="function"&&EF(t,".prototype.")>-1?sw(o):o}});var cw=ce((L6,lw)=>{"use strict";var wF=wp()(),MF=y0(),v0=MF("Object.prototype.toString"),Op=function(t){return wF&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:v0(t)==="[object Arguments]"},uw=function(t){return Op(t)?!0:t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&v0(t)!=="[object Array]"&&v0(t.callee)==="[object Function]"},SF=function(){return Op(arguments)}();Op.isLegacyArguments=uw;lw.exports=SF?Op:uw});var vc=ce((N6,dw)=>{"use strict";var bF=u0(),TF=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",AF=Object.prototype.toString,CF=Array.prototype.concat,fw=Pp(),PF=function(r){return typeof r=="function"&&AF.call(r)==="[object Function]"},hw=Ip()(),IF=function(r,t,e,o){if(t in r){if(o===!0){if(r[t]===e)return}else if(!PF(o)||!o())return}hw?fw(r,t,e,!0):fw(r,t,e)},pw=function(r,t){var e=arguments.length>2?arguments[2]:{},o=bF(t);TF&&(o=CF.call(o,Object.getOwnPropertySymbols(t)));for(var a=0;a<o.length;a+=1)IF(r,o[a],t[o[a]],e[o[a]])};pw.supportsDescriptors=!!hw;dw.exports=pw});var _0=ce((O6,mw)=>{"use strict";var gw=function(r){return r!==r};mw.exports=function(t,e){return t===0&&e===0?1/t===1/e:!!(t===e||gw(t)&&gw(e))}});var x0=ce((D6,yw)=>{"use strict";var RF=_0();yw.exports=function(){return typeof Object.is=="function"?Object.is:RF}});var _w=ce((F6,vw)=>{"use strict";var LF=x0(),NF=vc();vw.exports=function(){var t=LF();return NF(Object,{is:t},{is:function(){return Object.is!==t}}),t}});var Mw=ce((U6,ww)=>{"use strict";var OF=vc(),DF=Np(),FF=_0(),xw=x0(),UF=_w(),Ew=DF(xw(),Object);OF(Ew,{getPolyfill:xw,implementation:FF,shim:UF});ww.exports=Ew});var Cw=ce((B6,Aw)=>{"use strict";var E0=y0(),Sw=wp()(),bw,Tw,w0,M0;Sw&&(bw=E0("Object.prototype.hasOwnProperty"),Tw=E0("RegExp.prototype.exec"),w0={},Dp=function(){throw w0},M0={toString:Dp,valueOf:Dp},typeof Symbol.toPrimitive=="symbol"&&(M0[Symbol.toPrimitive]=Dp));var Dp,BF=E0("Object.prototype.toString"),zF=Object.getOwnPropertyDescriptor,GF="[object RegExp]";Aw.exports=Sw?function(t){if(!t||typeof t!="object")return!1;var e=zF(t,"lastIndex"),o=e&&bw(e,"value");if(!o)return!1;try{Tw(t,M0)}catch(a){return a===w0}}:function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:BF(t)===GF}});var Iw=ce((z6,Pw)=>{"use strict";var wf=function(){return typeof function(){}.name=="string"},Ef=Object.getOwnPropertyDescriptor;if(Ef)try{Ef([],"length")}catch(r){Ef=null}wf.functionsHaveConfigurableNames=function(){if(!wf()||!Ef)return!1;var t=Ef(function(){},"name");return!!t&&!!t.configurable};var kF=Function.prototype.bind;wf.boundFunctionsHaveNames=function(){return wf()&&typeof kF=="function"&&function(){}.bind().name!==""};Pw.exports=wf});var Nw=ce((G6,Lw)=>{"use strict";var Rw=Pp(),HF=Ip()(),VF=Iw().functionsHaveConfigurableNames(),WF=ul();Lw.exports=function(t,e){if(typeof t!="function")throw new WF("\`fn\` is not a function");var o=arguments.length>2&&!!arguments[2];return(!o||VF)&&(HF?Rw(t,"name",e,!0,!0):Rw(t,"name",e)),t}});var S0=ce((k6,Ow)=>{"use strict";var qF=Nw(),XF=ul(),YF=Object;Ow.exports=qF(function(){if(this==null||this!==YF(this))throw new XF("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t},"get flags",!0)});var b0=ce((H6,Dw)=>{"use strict";var $F=S0(),ZF=vc().supportsDescriptors,JF=Object.getOwnPropertyDescriptor;Dw.exports=function(){if(ZF&&/a/mig.flags==="gim"){var t=JF(RegExp.prototype,"flags");if(t&&typeof t.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var e="",o={};if(Object.defineProperty(o,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(o,"sticky",{get:function(){e+="y"}}),t.get.call(o),e==="dy")return t.get}}return $F}});var Bw=ce((V6,Uw)=>{"use strict";var KF=vc().supportsDescriptors,QF=b0(),jF=Object.getOwnPropertyDescriptor,tU=Object.defineProperty,eU=TypeError,Fw=Object.getPrototypeOf,nU=/a/;Uw.exports=function(){if(!KF||!Fw)throw new eU("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=QF(),e=Fw(nU),o=jF(e,"flags");return(!o||o.get!==t)&&tU(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}});var Hw=ce((W6,kw)=>{"use strict";var rU=vc(),iU=Np(),oU=S0(),zw=b0(),sU=Bw(),Gw=iU(zw());rU(Gw,{getPolyfill:zw,implementation:oU,shim:sU});kw.exports=Gw});var Ww=ce((q6,Vw)=>{"use strict";var aU=Date.prototype.getDay,uU=function(t){try{return aU.call(t),!0}catch(e){return!1}},lU=Object.prototype.toString,cU="[object Date]",fU=wp()();Vw.exports=function(t){return typeof t!="object"||t===null?!1:fU?uU(t):lU.call(t)===cU}});var T0=ce((X6,eM)=>{var qw=u0(),Xw=cw(),Yw=Mw(),$w=Cw(),Zw=Hw(),Jw=Ww(),Kw=Date.prototype.getTime;function tM(r,t,e){var o=e||{};return(o.strict?Yw(r,t):r===t)?!0:!r||!t||typeof r!="object"&&typeof t!="object"?o.strict?Yw(r,t):r==t:hU(r,t,o)}function Qw(r){return r==null}function jw(r){return!(!r||typeof r!="object"||typeof r.length!="number"||typeof r.copy!="function"||typeof r.slice!="function"||r.length>0&&typeof r[0]!="number")}function hU(r,t,e){var o,a;if(typeof r!=typeof t||Qw(r)||Qw(t)||r.prototype!==t.prototype||Xw(r)!==Xw(t))return!1;var c=$w(r),p=$w(t);if(c!==p)return!1;if(c||p)return r.source===t.source&&Zw(r)===Zw(t);if(Jw(r)&&Jw(t))return Kw.call(r)===Kw.call(t);var d=jw(r),g=jw(t);if(d!==g)return!1;if(d||g){if(r.length!==t.length)return!1;for(o=0;o<r.length;o++)if(r[o]!==t[o])return!1;return!0}if(typeof r!=typeof t)return!1;try{var y=qw(r),_=qw(t)}catch(w){return!1}if(y.length!==_.length)return!1;for(y.sort(),_.sort(),o=y.length-1;o>=0;o--)if(y[o]!=_[o])return!1;for(o=y.length-1;o>=0;o--)if(a=y[o],!tM(r[a],t[a],e))return!1;return!0}eM.exports=tM});var B0=ce((QW,uM)=>{var nB=T0(),ga=function(r){this.precision=r&&r.precision?r.precision:17,this.direction=r&&r.direction?r.direction:!1,this.pseudoNode=r&&r.pseudoNode?r.pseudoNode:!1,this.objectComparator=r&&r.objectComparator?r.objectComparator:rB};ga.prototype.compare=function(r,t){if(r.type!==t.type||!aM(r,t))return!1;switch(r.type){case"Point":return this.compareCoord(r.coordinates,t.coordinates);case"LineString":return this.compareLine(r.coordinates,t.coordinates,0,!1);case"Polygon":return this.comparePolygon(r,t);case"Feature":return this.compareFeature(r,t);default:if(r.type.indexOf("Multi")===0){var e=this,o=sM(r),a=sM(t);return o.every(function(c){return this.some(function(p){return e.compare(c,p)})},a)}}return!1};function sM(r){return r.coordinates.map(function(t){return{type:r.type.replace("Multi",""),coordinates:t}})}function aM(r,t){return r.hasOwnProperty("coordinates")?r.coordinates.length===t.coordinates.length:r.length===t.length}ga.prototype.compareCoord=function(r,t){if(r.length!==t.length)return!1;for(var e=0;e<r.length;e++)if(r[e].toFixed(this.precision)!==t[e].toFixed(this.precision))return!1;return!0};ga.prototype.compareLine=function(r,t,e,o){if(!aM(r,t))return!1;var a=this.pseudoNode?r:this.removePseudo(r),c=this.pseudoNode?t:this.removePseudo(t);if(!(o&&!this.compareCoord(a[0],c[0])&&(c=this.fixStartIndex(c,a),!c))){var p=this.compareCoord(a[e],c[e]);return this.direction||p?this.comparePath(a,c):this.compareCoord(a[e],c[c.length-(1+e)])?this.comparePath(a.slice().reverse(),c):!1}};ga.prototype.fixStartIndex=function(r,t){for(var e,o=-1,a=0;a<r.length;a++)if(this.compareCoord(r[a],t[0])){o=a;break}return o>=0&&(e=[].concat(r.slice(o,r.length),r.slice(1,o+1))),e};ga.prototype.comparePath=function(r,t){var e=this;return r.every(function(o,a){return e.compareCoord(o,this[a])},t)};ga.prototype.comparePolygon=function(r,t){if(this.compareLine(r.coordinates[0],t.coordinates[0],1,!0)){var e=r.coordinates.slice(1,r.coordinates.length),o=t.coordinates.slice(1,t.coordinates.length),a=this;return e.every(function(c){return this.some(function(p){return a.compareLine(c,p,1,!0)})},o)}else return!1};ga.prototype.compareFeature=function(r,t){return r.id!==t.id||!this.objectComparator(r.properties,t.properties)||!this.compareBBox(r,t)?!1:this.compare(r.geometry,t.geometry)};ga.prototype.compareBBox=function(r,t){return!!(!r.bbox&&!t.bbox||r.bbox&&t.bbox&&this.compareCoord(r.bbox,t.bbox))};ga.prototype.removePseudo=function(r){return r};function rB(r,t){return nB(r,t,{strict:!0})}uM.exports=ga});var lM=ce((cq,Bp)=>{function Pu(r,t,e,o){this.dataset=[],this.epsilon=1,this.minPts=2,this.distance=this._euclideanDistance,this.clusters=[],this.noise=[],this._visited=[],this._assigned=[],this._datasetLength=0,this._init(r,t,e,o)}Pu.prototype.run=function(r,t,e,o){this._init(r,t,e,o);for(var a=0;a<this._datasetLength;a++)if(this._visited[a]!==1){this._visited[a]=1;var c=this._regionQuery(a);if(c.length<this.minPts)this.noise.push(a);else{var p=this.clusters.length;this.clusters.push([]),this._addToCluster(a,p),this._expandCluster(p,c)}}return this.clusters};Pu.prototype._init=function(r,t,e,o){if(r){if(!(r instanceof Array))throw Error("Dataset must be of type array, "+typeof r+" given");this.dataset=r,this.clusters=[],this.noise=[],this._datasetLength=r.length,this._visited=new Array(this._datasetLength),this._assigned=new Array(this._datasetLength)}t&&(this.epsilon=t),e&&(this.minPts=e),o&&(this.distance=o)};Pu.prototype._expandCluster=function(r,t){for(var e=0;e<t.length;e++){var o=t[e];if(this._visited[o]!==1){this._visited[o]=1;var a=this._regionQuery(o);a.length>=this.minPts&&(t=this._mergeArrays(t,a))}this._assigned[o]!==1&&this._addToCluster(o,r)}};Pu.prototype._addToCluster=function(r,t){this.clusters[t].push(r),this._assigned[r]=1};Pu.prototype._regionQuery=function(r){for(var t=[],e=0;e<this._datasetLength;e++){var o=this.distance(this.dataset[r],this.dataset[e]);o<this.epsilon&&t.push(e)}return t};Pu.prototype._mergeArrays=function(r,t){for(var e=t.length,o=0;o<e;o++){var a=t[o];r.indexOf(a)<0&&r.push(a)}return r};Pu.prototype._euclideanDistance=function(r,t){for(var e=0,o=Math.min(r.length,t.length);o--;)e+=(r[o]-t[o])*(r[o]-t[o]);return Math.sqrt(e)};typeof Bp!="undefined"&&Bp.exports&&(Bp.exports=Pu)});var cM=ce((fq,zp)=>{function Iu(r,t,e){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(r,t,e)}Iu.prototype.init=function(r,t,e){this.assignments=[],this.centroids=[],typeof r!="undefined"&&(this.dataset=r),typeof t!="undefined"&&(this.k=t),typeof e!="undefined"&&(this.distance=e)};Iu.prototype.run=function(r,t){this.init(r,t);for(var e=this.dataset.length,o=0;o<this.k;o++)this.centroids[o]=this.randomCentroid();for(var a=!0;a;){a=this.assign();for(var c=0;c<this.k;c++){for(var p=new Array(_),d=0,g=0;g<_;g++)p[g]=0;for(var y=0;y<e;y++){var _=this.dataset[y].length;if(c===this.assignments[y]){for(var g=0;g<_;g++)p[g]+=this.dataset[y][g];d++}}if(d>0){for(var g=0;g<_;g++)p[g]/=d;this.centroids[c]=p}else this.centroids[c]=this.randomCentroid(),a=!0}}return this.getClusters()};Iu.prototype.randomCentroid=function(){var r=this.dataset.length-1,t,e;do e=Math.round(Math.random()*r),t=this.dataset[e];while(this.centroids.indexOf(t)>=0);return t};Iu.prototype.assign=function(){for(var r=!1,t=this.dataset.length,e,o=0;o<t;o++)e=this.argmin(this.dataset[o],this.centroids,this.distance),e!=this.assignments[o]&&(this.assignments[o]=e,r=!0);return r};Iu.prototype.getClusters=function(){for(var r=new Array(this.k),t,e=0;e<this.assignments.length;e++)t=this.assignments[e],typeof r[t]=="undefined"&&(r[t]=[]),r[t].push(e);return r};Iu.prototype.argmin=function(r,t,e){for(var o=Number.MAX_VALUE,a=0,c=t.length,p,d=0;d<c;d++)p=e(r,t[d]),p<o&&(o=p,a=d);return a};Iu.prototype.distance=function(r,t){for(var e=0,o=Math.min(r.length,t.length);o--;){var a=r[o]-t[o];e+=a*a}return Math.sqrt(e)};typeof zp!="undefined"&&zp.exports&&(zp.exports=Iu)});var z0=ce((hq,Gp)=>{function ma(r,t,e){this._queue=[],this._priorities=[],this._sorting="desc",this._init(r,t,e)}ma.prototype.insert=function(r,t){for(var e=this._queue.length,o=e;o--;){var a=this._priorities[o];this._sorting==="desc"?t>a&&(e=o):t<a&&(e=o)}this._insertAt(r,t,e)};ma.prototype.remove=function(r){for(var t=this._queue.length;t--;){var e=this._queue[t];if(r===e){this._queue.splice(t,1),this._priorities.splice(t,1);break}}};ma.prototype.forEach=function(r){this._queue.forEach(r)};ma.prototype.getElements=function(){return this._queue};ma.prototype.getElementPriority=function(r){return this._priorities[r]};ma.prototype.getPriorities=function(){return this._priorities};ma.prototype.getElementsWithPriorities=function(){for(var r=[],t=0,e=this._queue.length;t<e;t++)r.push([this._queue[t],this._priorities[t]]);return r};ma.prototype._init=function(r,t,e){if(r&&t){if(this._queue=[],this._priorities=[],r.length!==t.length)throw new Error("Arrays must have the same length");for(var o=0;o<r.length;o++)this.insert(r[o],t[o])}e&&(this._sorting=e)};ma.prototype._insertAt=function(r,t,e){this._queue.length===e?(this._queue.push(r),this._priorities.push(t)):(this._queue.splice(e,0,r),this._priorities.splice(e,0,t))};typeof Gp!="undefined"&&Gp.exports&&(Gp.exports=ma)});var hM=ce((pq,xc)=>{typeof xc!="undefined"&&xc.exports&&(fM=z0());var fM;function Ja(r,t,e,o){this.epsilon=1,this.minPts=1,this.distance=this._euclideanDistance,this._reachability=[],this._processed=[],this._coreDistance=0,this._orderedList=[],this._init(r,t,e,o)}Ja.prototype.run=function(r,t,e,o){this._init(r,t,e,o);for(var a=0,c=this.dataset.length;a<c;a++)if(this._processed[a]!==1){this._processed[a]=1,this.clusters.push([a]);var p=this.clusters.length-1;this._orderedList.push(a);var d=new fM(null,null,"asc"),g=this._regionQuery(a);this._distanceToCore(a)!==void 0&&(this._updateQueue(a,g,d),this._expandCluster(p,d))}return this.clusters};Ja.prototype.getReachabilityPlot=function(){for(var r=[],t=0,e=this._orderedList.length;t<e;t++){var o=this._orderedList[t],a=this._reachability[o];r.push([o,a])}return r};Ja.prototype._init=function(r,t,e,o){if(r){if(!(r instanceof Array))throw Error("Dataset must be of type array, "+typeof r+" given");this.dataset=r,this.clusters=[],this._reachability=new Array(this.dataset.length),this._processed=new Array(this.dataset.length),this._coreDistance=0,this._orderedList=[]}t&&(this.epsilon=t),e&&(this.minPts=e),o&&(this.distance=o)};Ja.prototype._updateQueue=function(r,t,e){var o=this;this._coreDistance=this._distanceToCore(r),t.forEach(function(a){if(o._processed[a]===void 0){var c=o.distance(o.dataset[r],o.dataset[a]),p=Math.max(o._coreDistance,c);o._reachability[a]===void 0?(o._reachability[a]=p,e.insert(a,p)):p<o._reachability[a]&&(o._reachability[a]=p,e.remove(a),e.insert(a,p))}})};Ja.prototype._expandCluster=function(r,t){for(var e=t.getElements(),o=0,a=e.length;o<a;o++){var c=e[o];if(this._processed[c]===void 0){var p=this._regionQuery(c);this._processed[c]=1,this.clusters[r].push(c),this._orderedList.push(c),this._distanceToCore(c)!==void 0&&(this._updateQueue(c,p,t),this._expandCluster(r,t))}}};Ja.prototype._distanceToCore=function(r){for(var t=this.epsilon,e=0;e<t;e++){var o=this._regionQuery(r,e);if(o.length>=this.minPts)return e}};Ja.prototype._regionQuery=function(r,t){t=t||this.epsilon;for(var e=[],o=0,a=this.dataset.length;o<a;o++)this.distance(this.dataset[r],this.dataset[o])<t&&e.push(o);return e};Ja.prototype._euclideanDistance=function(r,t){for(var e=0,o=Math.min(r.length,t.length);o--;)e+=(r[o]-t[o])*(r[o]-t[o]);return Math.sqrt(e)};typeof xc!="undefined"&&xc.exports&&(xc.exports=Ja)});var pM=ce((dq,kp)=>{typeof kp!="undefined"&&kp.exports&&(kp.exports={DBSCAN:lM(),KMEANS:cM(),OPTICS:hM(),PriorityQueue:z0()})});var G0=ce((xq,gM)=>{"use strict";gM.exports={eudist:function(t,e,o){for(var a=t.length,c=0,p=0;p<a;p++){var d=(t[p]||0)-(e[p]||0);c+=d*d}return o?Math.sqrt(c):c},mandist:function(t,e,o){for(var a=t.length,c=0,p=0;p<a;p++)c+=Math.abs((t[p]||0)-(e[p]||0));return o?Math.sqrt(c):c},dist:function(t,e,o){var a=Math.abs(t-e);return o?a:a*a}}});var vM=ce((Eq,yM)=>{"use strict";var mM=G0(),lB=mM.eudist,cB=mM.dist;yM.exports={kmrand:function(t,e){for(var o={},a=[],c=e<<2,p=t.length,d=t[0].length>0;a.length<e&&c-- >0;){var g=t[Math.floor(Math.random()*p)],y=d?g.join("_"):""+g;o[y]||(o[y]=!0,a.push(g))}if(a.length<e)throw new Error("Error initializating clusters");return a},kmpp:function(t,e){var o=t[0].length?lB:cB,a=[],c=t.length,p=t[0].length>0,d={},g=t[Math.floor(Math.random()*c)],y=p?g.join("_"):""+g;for(a.push(g),d[y]=!0;a.length<e;){for(var _=[],w=a.length,x=0,b=[],P=0;P<c;P++){for(var I=1/0,M=0;M<w;M++){var E=o(t[P],a[M]);E<=I&&(I=E)}_[P]=I}for(var N=0;N<c;N++)x+=_[N];for(var A=0;A<c;A++)b[A]={i:A,v:t[A],pr:_[A]/x,cs:0};b.sort(function(q,D){return q.pr-D.pr}),b[0].cs=b[0].pr;for(var U=1;U<c;U++)b[U].cs=b[U-1].cs+b[U].pr;for(var z=Math.random(),$=0;$<c-1&&b[$++].cs<z;);a.push(b[$-1].v)}return a}}});var MM=ce((Sq,wM)=>{"use strict";var k0=G0(),EM=vM(),fB=k0.eudist,wq=k0.mandist,Mq=k0.dist,hB=EM.kmrand,pB=EM.kmpp,_M=1e4;function xM(r,t,e){e=e||[];for(var o=0;o<r;o++)e[o]=t;return e}function dB(r,t,e,o){var a=[],c=[],p=[],d=[],g=!1,y=o||_M,_=r.length,w=r[0].length,x=w>0,b=[];if(e)e=="kmrand"?a=hB(r,t):e=="kmpp"?a=pB(r,t):a=e;else for(var P={};a.length<t;){var I=Math.floor(Math.random()*_);P[I]||(P[I]=!0,a.push(r[I]))}do{xM(t,0,b);for(var M=0;M<_;M++){for(var E=1/0,N=0,A=0;A<t;A++){var d=x?fB(r[M],a[A]):Math.abs(r[M]-a[A]);d<=E&&(E=d,N=A)}p[M]=N,b[N]++}for(var U=[],c=[],z=0,$=0;$<t;$++)U[$]=x?xM(w,0,U[$]):0,c[$]=a[$];if(x){for(var q=0;q<t;q++)a[q]=[];for(var D=0;D<_;D++)for(var G=p[D],Q=U[G],_t=r[D],Z=0;Z<w;Z++)Q[Z]+=_t[Z];g=!0;for(var Dt=0;Dt<t;Dt++){for(var et=a[Dt],vt=U[Dt],It=c[Dt],Pt=b[Dt],Et=0;Et<w;Et++)et[Et]=vt[Et]/Pt||0;if(g){for(var yt=0;yt<w;yt++)if(It[yt]!=et[yt]){g=!1;break}}}}else{for(var Y=0;Y<_;Y++){var ht=p[Y];U[ht]+=r[Y]}for(var Mt=0;Mt<t;Mt++)a[Mt]=U[Mt]/b[Mt]||0;g=!0;for(var zt=0;zt<t;zt++)if(c[zt]!=a[zt]){g=!1;break}}g=g||--y<=0}while(!g);return{it:_M-y,k:t,idxs:p,centroids:a}}wM.exports=dB});var bc=ce((Y0,$0)=>{(function(r,t){typeof Y0=="object"&&typeof $0!="undefined"?$0.exports=t():typeof define=="function"&&define.amd?define(t):(r=typeof globalThis!="undefined"?globalThis:r||self,r.polygonClipping=t())})(Y0,function(){"use strict";function r(tt,C){var L={label:0,sent:function(){if(X[0]&1)throw X[1];return X[1]},trys:[],ops:[]},F,J,X,pt;return pt={next:st(0),throw:st(1),return:st(2)},typeof Symbol=="function"&&(pt[Symbol.iterator]=function(){return this}),pt;function st(ut){return function(nt){return k([ut,nt])}}function k(ut){if(F)throw new TypeError("Generator is already executing.");for(;L;)try{if(F=1,J&&(X=ut[0]&2?J.return:ut[0]?J.throw||((X=J.return)&&X.call(J),0):J.next)&&!(X=X.call(J,ut[1])).done)return X;switch(J=0,X&&(ut=[ut[0]&2,X.value]),ut[0]){case 0:case 1:X=ut;break;case 4:return L.label++,{value:ut[1],done:!1};case 5:L.label++,J=ut[1],ut=[0];continue;case 7:ut=L.ops.pop(),L.trys.pop();continue;default:if(X=L.trys,!(X=X.length>0&&X[X.length-1])&&(ut[0]===6||ut[0]===2)){L=0;continue}if(ut[0]===3&&(!X||ut[1]>X[0]&&ut[1]<X[3])){L.label=ut[1];break}if(ut[0]===6&&L.label<X[1]){L.label=X[1],X=ut;break}if(X&&L.label<X[2]){L.label=X[2],L.ops.push(ut);break}X[2]&&L.ops.pop(),L.trys.pop();continue}ut=C.call(tt,L)}catch(nt){ut=[6,nt],J=0}finally{F=X=0}if(ut[0]&5)throw ut[1];return{value:ut[0]?ut[1]:void 0,done:!0}}}var t=function(){function tt(C,L){this.next=null,this.key=C,this.data=L,this.left=null,this.right=null}return tt}();function e(tt,C){return tt>C?1:tt<C?-1:0}function o(tt,C,L){for(var F=new t(null,null),J=F,X=F;;){var pt=L(tt,C.key);if(pt<0){if(C.left===null)break;if(L(tt,C.left.key)<0){var st=C.left;if(C.left=st.right,st.right=C,C=st,C.left===null)break}X.left=C,X=C,C=C.left}else if(pt>0){if(C.right===null)break;if(L(tt,C.right.key)>0){var st=C.right;if(C.right=st.left,st.left=C,C=st,C.right===null)break}J.right=C,J=C,C=C.right}else break}return J.right=C.left,X.left=C.right,C.left=F.right,C.right=F.left,C}function a(tt,C,L,F){var J=new t(tt,C);if(L===null)return J.left=J.right=null,J;L=o(tt,L,F);var X=F(tt,L.key);return X<0?(J.left=L.left,J.right=L,L.left=null):X>=0&&(J.right=L.right,J.left=L,L.right=null),J}function c(tt,C,L){var F=null,J=null;if(C){C=o(tt,C,L);var X=L(C.key,tt);X===0?(F=C.left,J=C.right):X<0?(J=C.right,C.right=null,F=C):(F=C.left,C.left=null,J=C)}return{left:F,right:J}}function p(tt,C,L){return C===null?tt:(tt===null||(C=o(tt.key,C,L),C.left=tt),C)}function d(tt,C,L,F,J){if(tt){F(""+C+(L?"\\u2514\\u2500\\u2500 ":"\\u251C\\u2500\\u2500 ")+J(tt)+\`
|
|
105
|
+
`);var ye=class extends _.ShaderMaterial{constructor(e){super({uniforms:Object.assign({},_.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new _.Color(16777215)},opacity:{value:1},resolution:{value:new _.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new _.Vector2(1,1)},thresholdRatio:{value:0},transparent:{value:!0},depthTest:{vale:!1},depthWrite:{value:!1}}),vertexShader:_.ShaderChunk.meshline_vert,fragmentShader:_.ShaderChunk.meshline_frag}),this.isMeshLineMaterial=!0,this.type="MeshLineMaterial",Object.defineProperties(this,{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(t){this.uniforms.lineWidth.value=t}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(t){this.uniforms.map.value=t}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(t){this.uniforms.useMap.value=t}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(t){this.uniforms.alphaMap.value=t}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(t){this.uniforms.useAlphaMap.value=t}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(t){this.uniforms.color.value=t}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(t){this.uniforms.sizeAttenuation.value=t}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(t){this.uniforms.dashArray.value=t,this.useDash=t!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(t){this.uniforms.dashOffset.value=t}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(t){this.uniforms.dashRatio.value=t}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(t){this.uniforms.useDash.value=t}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(t){this.uniforms.visibility.value=t}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(t){this.uniforms.alphaTest.value=t}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(t){this.uniforms.repeat.value.copy(t)}},thresholdRatio:{enumerable:!0,get:function(){return this.uniforms.thresholdRatio.value},set:function(t){this.uniforms.thresholdRatio.value=t}}}),this.setValues(e)}};ye.prototype.copy=function(s){return _.ShaderMaterial.prototype.copy.call(this,s),this.lineWidth=s.lineWidth,this.map=s.map,this.useMap=s.useMap,this.alphaMap=s.alphaMap,this.useAlphaMap=s.useAlphaMap,this.color.copy(s.color),this.opacity=s.opacity,this.resolution.copy(s.resolution),this.sizeAttenuation=s.sizeAttenuation,this.dashArray.copy(s.dashArray),this.dashOffset.copy(s.dashOffset),this.dashRatio.copy(s.dashRatio),this.useDash=s.useDash,this.visibility=s.visibility,this.alphaTest=s.alphaTest,this.repeat.copy(s.repeat),this};var Wr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAQCAMAAACROYkbAAABrVBMVEVsjPdsjPdqi/doifdpivdrjPdsjPdsjPd/m/igtfqTq/lykfdri/dsjPdtjfe/zPv8/f/w8/6zw/p0kvdri/dsjPdtjffU3vz////////3+f62xfpzkfdri/dsjPdsjPeZr/nr8P7////////4+f62xfp0kvdri/dsjPdsjPdujveXrvne5v3////////3+f63x/t2lPdri/dsjPdsjPdsjPdri/eMpfjb4/3+/v/////4+v+7yft1k/dri/dsjPdsjPdri/eJovjl6/3////////3+f6Jo/lqivdsjPdri/dvjveluPry9f7////////i6f2BnPhqi/dsjPdrjPdvjveluPrv8v7////////l6/6Uq/lsjPdsjPdsjPdvjveluPrv8v7////////m6/6Uq/lsjPdsjPdsjPdsjPeZr/nv8v7////////s8f6XrvlsjPdsjPdtjffS2/z////////w9P6bsfltjfdsjPdtjffBz/v7/P/y9f6svvpxkPdrjPdsjPdsjPd+mviftPqVrPlykfdri/dsjPdsjPdri/doifdpifdrjPdsjPclkRlrAAAAx0lEQVQ4y2NgwAsYmZhZWNkYyAfsHJxc3Dy85BvAxy8gKCQsIkq2AWLiEpJS0jKycuQaIK+gqKSsoqqmrkGmAZpa2jq6evoGhkbG5BlgYmpmbmFpZW1ja0emE+wdHJ2cXVzd3D3INMDTy9vH188/IDCIPP3BIaFh4RGRUdExseQZEBefkJiUnJKalp5BngGZWdk5uXn5BemFZAZBUXFJaVl5RSWZ9jMwVFXX1NbVNzSSq5+hqbmlta29g2z9DJ1d3T29ffhUAABKPSh5Xst3GwAAAABJRU5ErkJggg==";var Xr={texture_url:Wr,lineWidth:8,color:16777215},ze=class extends N.Object3D{constructor(t,n){super();this.navigation=t;this.config=Object.assign({},Xr,n),this.registryEvent(),this.prevCameraZoom=this.navigation.bmap.context.camera.zoom,this.setDepthTest(this.getDepthTestByControl())}mesh=null;geometry=null;material=null;texture=null;config=Xr;points=[];basicRepeat=1;prevCameraZoom=0;depthTest=!0;registryEvent(){this.navigation.bmap.context.addEventListener("control-change",this.onControlChange),this.navigation.bmap.context.addEventListener("update",this.onUpdate),this.navigation.bmap.context.addEventListener("resize",this.onResize)}unRegistryEvent(){this.navigation.bmap.context.removeEventListener("control-change",this.onControlChange),this.navigation.bmap.context.removeEventListener("update",this.onUpdate),this.navigation.bmap.context.removeEventListener("resize",this.onResize)}onControlChange=()=>{let t=this.navigation.bmap.context.camera.zoom;t!==this.prevCameraZoom&&(this.prevCameraZoom=t,this.changeRepeat()),this.setDepthTest(this.getDepthTestByControl())};getDepthTestByControl(){let t=this.navigation.bmap.context.control.getPolarAngle();return!(t>=0&&t<=.15)}setDepthTest(t){this.depthTest=t,this.material&&(this.material.depthTest=t)}onUpdate=()=>{this.texture};onResize=()=>{if(this.material){let{width:t,height:n}=this.navigation.bmap.context.clientSize;this.material.resolution.set(t,n)}};getRepeat(){let{points:t,navigation:{bmap:{context:{camera:n,clientSize:{width:r,height:i}}}}}=this,o=t.map(([l,u])=>y(new N.Vector3(l,u,0),n,r,i)).map(({x:l,y:u})=>[l,u]);return at(o)/32}changeRepeat(){if(!this.material)return;let t=this.getRepeat();this.material.repeat=new N.Vector2(t,1)}loadTexture(t){return new Promise((n,r)=>{new N.TextureLoader().load(t,n,void 0,r)})}transformPoints(t){let n=[];for(let r=0;r<t.length;r++)n.push(...t[r],0);return n}updatePoints(t){this.points=t,this.changeRepeat();let n=this.transformPoints(t);this.geometry&&this.geometry.setPoints(n)}movePath(t){this.material&&(this.material.thresholdRatio=t)}async create(t){let n=this.geometry=new tt;if(this.updatePoints(t),!this.texture){let o=this.texture=await this.loadTexture(this.config.texture_url);o.wrapS=o.wrapT=N.RepeatWrapping}let r=this.material=new ye({useMap:!0,color:new N.Color(this.config.color),transparent:!0,resolution:new N.Vector2(this.navigation.bmap.context.clientSize.width,this.navigation.bmap.context.clientSize.height),depthTest:!1,sizeAttenuation:!1,lineWidth:this.config.lineWidth*2,map:this.texture,blending:N.NormalBlending,repeat:new N.Vector2(this.getRepeat(),1)}),i=this.mesh=new N.Mesh(n,r);return i.renderOrder=9,this.add(i),i}dispose(){this.unRegistryEvent(),this.clear(),this.geometry?.dispose(),this.material?.dispose(),this.texture?.dispose()}};var Yt=require("@tweenjs/tween.js"),wt=require("three");var qr=require("three");var jr=require("@tweenjs/tween.js"),Yr=require("lodash"),Xi={offsetDistance:15,offsetToResetTime:3e3,directionEmitThreshold:5,simulationSpeed:1},ke=class extends qr.EventDispatcher{constructor(t,n){super();this.navigation=t;this.options=Object.assign({},Xi,n),this.registryEvent()}offset=!1;reset=!1;position=[0,0];routeIndex=0;pointIndex=0;paths=[];options;timer=new D;resetTimer=null;tweenUtil=new Dt;simulationTween;throttleUpdatePosition;get curRoutePath(){return this.paths[this.routeIndex]||null}get curRoutePathPoints(){return this.curRoutePath?.points||[]}registryEvent(){this.navigation.bmap.context.addEventListener("update",this.onUpdate),this.navigation.addEventListener("add-path",this.onAddPaths)}unRegistryEvent(){this.navigation.bmap.context.removeEventListener("update",this.onUpdate),this.navigation.removeEventListener("add-path",this.onAddPaths)}onAddPaths=({paths:t})=>{this.paths=t,this.resetStatus(t)};onUpdate=()=>{this.tweenUtil.update()};resetStatus(t){this.offset=!1,this.reset=!1,this.routeIndex=0,this.pointIndex=0,t.length&&(this.position=t[0].points[0])}emitNavigationStatus(){let t=this.getNavigationInfo();t&&this.dispatchEvent({type:"navigation-info",info:t})}adsorb(t,n){let{curRoutePathPoints:r,position:i,curRoutePath:o,paths:a,routeIndex:l}=this;if(!r.length)return null;let u=r;if(i){let f=Pt(r,i);u=u.slice(f+1),u.unshift(i)}let c=[{floor:o?.floor,points:u},...a.slice(l+1)],{distance:h,closestPoint:p,index:d,i:m}=c.reduce((f,g,E)=>{if(g.floor!==t)return f;let{distance:x,closestPoint:z,index:b}=g.points.reduce((T,k,$,Tt)=>{if(!Tt[$+1])return{...T,distance:T.distance===1/0?A(k,n):T.distance};let{distance:Kt,closestPoint:Ke}=hn(n,k,Tt[$+1]);return Kt<T.distance?{distance:Kt,closestPoint:Ke,index:$}:T},{distance:1/0,closestPoint:g.points[0],index:0});return x<f.distance?{distance:x,closestPoint:z,index:E,i:b}:f},{distance:1/0,closestPoint:u[0],index:0,i:0});return{distance:h,closestPoint:p,routeIndex:d+l,pointIndex:d===0?m+this.pointIndex:m}}toPosition(t,n){let r=this.adsorb(t,n);if(console.log("adsorbData",r),!r)return;let{distance:i,closestPoint:o,routeIndex:a,pointIndex:l}=r;i>this.options.offsetDistance?(this.offset=!0,this.resetTimer||(this.resetTimer=this.timer.setTimeout(()=>{this.reset=!0,this.resetTimer=null},this.options.offsetToResetTime))):(this.offset=!1,this.reset=!1,this.resetTimer&&(this.timer.clearTimeout(this.resetTimer),this.resetTimer=null)),this.routeIndex=a,this.pointIndex=l,this.position=o,this.emitNavigationStatus()}startSimulation(){this.resetStatus(this.paths),this.emitNavigationStatus(),this.startCurRouteSimulation()}pause(){this.tweenUtil.pause(),this.throttleUpdatePosition?.cancel()}async startCurRouteSimulation(){let{curRoutePath:t}=this;if(!t)return;this.simulationTween&&this.tweenUtil.remove(this.simulationTween);let n=[];return new Promise(r=>{let i=[this.position,...this.curRoutePathPoints.slice(this.pointIndex+1)],o=this.getCurRouteRemainDistance(),a=o/this.options.simulationSpeed,l=this.throttleUpdatePosition=(0,Yr.throttle)(c=>{let h=ee(i,c.distance);h&&(n.push({floor:t.floor,pos:h}),this.toPosition(t.floor,h))},200),u=this.simulationTween=new jr.Tween({distance:0},this.tweenUtil.group).to({distance:o},a*1e3).onUpdate(l).onComplete(()=>{this.tweenUtil.remove(u),l.flush(),l.cancel(),this.routeIndex+1<this.paths.length?(this.routeIndex++,this.position=this.paths[this.routeIndex].points[0],this.pointIndex=0,setTimeout(()=>{r(this.startCurRouteSimulation())},3e3)):(r(!0),console.log(n,this.routeIndex,this.paths))}).start()})}changeSimulationSpeed(t){this.options.simulationSpeed=t,this.startCurRouteSimulation()}getCurRouteRemainDistance(){let{curRoutePathPoints:t,pointIndex:n,position:r}=this;if(!t.length)return 0;let i=[r,...t.slice(n+1)];return at(i)}getRemainDistance(){let t=this.getCurRouteRemainDistance();return{total:this.paths.slice(this.routeIndex+1).reduce((i,o)=>i+o.distance,0)+t,curRoute:t}}getNextDirDistance(){if(!this.position)return null;let{pointIndex:t,curRoutePathPoints:n,position:r}=this,i=n[t],o=n[t+1],a=n[t+2];if(!i||!o)return{dir:"end",distance:0};let l=A(r,o);return t===0&&A(i,r)<5?{dir:"start",distance:l}:a?{dir:we(i,o,a),distance:l}:{dir:"end",distance:l}}getNavigationInfo(){let{total:t,curRoute:n}=this.getRemainDistance();console.log(t,n,this.paths);let r=this.getNextDirDistance();if(!r)return null;let{dir:i,distance:o}=r;return i==="end"&&o>15&&(i="front"),i!=="start"&&o>=this.options.directionEmitThreshold&&(i="front"),n<=10&&(i="end"),{distance:t,curRouteDistance:n,nextDirDistance:o,dir:i,pos:this.position,routeIndex:this.routeIndex,offset:this.offset,reset:this.reset}}dispose(){this.timer.dispose(),this.unRegistryEvent(),this.tweenUtil.clear()}};var $r=require("three"),ve=class extends $r.EventDispatcher{_task=[];started=!1;activeTask=null;_id=0;constructor(e=!0){super(),e&&this.start()}_isEffectiveTask(e){return e&&typeof e.run=="function"}_getIndexByTid(e){return this._task.findIndex(t=>t.tid===e)}_createTask(e){return this._isEffectiveTask(e)?{...e,tid:++this._id,meta:e.meta||{}}:!1}get task(){return[...this._task]}getTasks(){return[...this._task]}add(e){if(this._isEffectiveTask(e)){let t=this._createTask(e);return this._task.push(t),this.started&&!this.activeTask&&this.start(),t.tid}return!1}replace(e,t){if(!this._isEffectiveTask(t))return console.warn("[TaskQueue] replace\u65B9\u6CD5\u4F20\u5165\u7684task\u53C2\u6570\u683C\u5F0F\u4E0D\u6B63\u786E"),!1;let n=this._getIndexByTid(e);if(n===-1)return console.warn(`[TaskQueue] \u6CA1\u6709\u627E\u5230id=${e}\u7684\u4EFB\u52A1`),!1;let r=this._createTask(t);return this._task.splice(n,1,r),r.tid}remove(e){let t=this._getIndexByTid(e);return t===-1?(console.warn(`[TaskQueue] remove\u65B9\u6CD5\u4F20\u5165\u7684id\uFF1A${e}\u627E\u4E0D\u5230\u5BF9\u5E94\u7684task`),!1):(this._task.splice(t,1),!0)}clear(){this._task.length=0}start(){this.started=!0,!this.activeTask&&this._task.length&&this.exec()}stop(){this.started=!1}async exec(){if(!this.started||!this._task.length)return!1;let e=this._task.shift();this.activeTask=e,this.dispatchEvent({type:"active-task-start",task:e});try{await e.run()}catch(t){console.warn("[task run err]",t,e)}return this.activeTask=null,this.dispatchEvent({type:"active-task-end",task:e}),this.exec()}};var qi={path:{},cheapMaximumDistance:20,needStartPoi:!1,startPoi:{},positionNavigation:{},offsetY:150,directionEmitThreshold:5,disablePathAnimation:!1,speed:1},An=class extends dt{path=null;fetchRoadStatus=!1;paths=[];curPathIndex=0;curFloorPath=null;translatePath=null;currentPathPosition=null;options;pathTween=null;startPoi=null;movedDistance=0;pathStart=[0,0];tweenUtil=new Dt;taskQueue=new ve;animationPathOptions={cPathIndex:0};cPath=[];positionNavigation;constructor(e,t={},n){super(e),!n&&typeof t=="object"&&(n=t),this.options=Object.assign({},qi,n);let{apiDomain:r,apiPath:{roadNetwork:i},apiInfo:o}=this.bmap.config;this.positionNavigation=new ke(this,{simulationSpeed:this.options.speed,...this.options.positionNavigation}),this.registryEvent()}get curFloorPathLength(){return this.curFloorPath?.distance??0}get curFloorPathPoints(){return this.curFloorPath?.points??[]}registryEvent(){this.bmap.context.addEventListener("update",this.onUpdate),this.bmap.addEventListener("switch_floor_after",this.onSwitchFloor),this.positionNavigation.addEventListener("navigation-info",this.onNavigationInfo)}onNavigationInfo=({info:e})=>{if(this.dispatchEvent({type:"navigation-info",info:e}),!e.offset){if(e.routeIndex!==this.curPathIndex)return;this.toPositionByTask(e.pos)}};toPositionByTask(e){let n=this.taskQueue.getTasks().find(i=>i.meta.type==="toPosition")?.tid,r={run:()=>this.toPositionBySpeed(e,this.options.speed),meta:{type:"toPosition"}};n?this.taskQueue.replace(n,r):this.taskQueue.add(r)}pauseAnimation(){this.taskQueue.clear(),this.positionNavigation.pause(),this.tweenUtil.pause()}continueAnimation(){this.tweenUtil.continue(),this.positionNavigation.tweenUtil.continue()}clearTween(){this.tweenUtil.clear(),this.taskQueue.clear(),this.bmap.context.control.enabled=!0}unRegistryEvent(){this.bmap.context.removeEventListener("update",this.onUpdate),this.bmap.removeEventListener("switch_floor_after",this.onSwitchFloor),this.positionNavigation.removeEventListener("navigation-info",this.onNavigationInfo)}onUpdate=()=>{this.tweenUtil.update()};clearPath(){this.path&&(this.bmap.context.scene.remove(this.path),this.path.dispose(),this.path=null,this.clearTween()),this.startPoi&&(this.bmap.context.currentFloor?.poiLayer2.removePoi(this.startPoi),this.startPoi=null),this.translatePath=null}setCurFloorPath(e){e===null?(this.curFloorPath=null,this.currentPathPosition=null):(this.curFloorPath=e,this.currentPathPosition=e.points[0]),this.movedDistance=0,this.clearTween()}setCurPathIndex(e){this.curPathIndex=e,this.paths[e]?.floor===this.bmap.context.currentFloor?.name?(this.setCurFloorPath(this.paths[e]),this.renderPath(this.translatePoints(this.curFloorPathPoints))):this.clearPath()}onSwitchFloor=({data:{curFloor:e}})=>{if(this.clearTween(),this.paths[this.curPathIndex]){let t=this.paths[this.curPathIndex];this.setCurFloorPath(t??null),t?this.renderPath(this.translatePoints(t.points)):this.clearPath()}else this.clearPath()};addPath(e,t=0){this.paths=e,this.curPathIndex=t,this.clearTween();let n=this.bmap.context.currentFloor?.name,r=e[t];if(n&&r?.floor===n)if(this.setCurFloorPath(r),this.bmap.currentBuildGround)this.renderPath(this.translatePoints(r.points));else{let i=()=>{this.bmap.removeEventListener("center-change",i),this.renderPath(this.translatePoints(r.points))};this.bmap.addEventListener("center-change",i)}else this.clearPath();this.dispatchEvent({type:"add-path",paths:e})}translatePoints(e){let[t,n]=this.bmap.buildingCenter;return e.map(r=>[r[0]-t,r[1]-n])}renderPath(e){this.translatePath=e;let t=this.catmullRomCurve3(e);this.cPath=t,this.animationPathOptions={cPathIndex:0},this.pathStart=t[0],this.path?this.path.updatePoints(t):(this.path=new ze(this,this.options.path),this.path.create(t),this.path.position.z=this.bmap.context.currentFloor.groundMaxHeight+.5,this.bmap.context.scene.add(this.path)),this.path.movePath(0),this.startPoi&&(this.bmap.context.currentFloor?.poiLayer2.removePoi(this.startPoi),this.startPoi=null),this.options.needStartPoi&&(this.startPoi=new q(this.bmap.context,{...this.options.startPoi,id:"navigation_start_poi",position:{x:t[0][0],y:t[0][1],z:.51},collision_enable:!1})||null,this.bmap.context.currentFloor?.poiLayer2.pushPoi(this.startPoi)),this.dispatchEvent({type:"render-path",path:this.path})}catmullRomCurve3(e){return cn(e,!1,!0,.1,170,2.5)}getPathDirection(){if(!this.curFloorPath||!this.currentPathPosition||this.curFloorPathPoints.length<2)return null;let e=Pt(this.curFloorPathPoints,this.currentPathPosition),t=this.curFloorPathPoints[e],n=this.curFloorPathPoints[e+1],r=new wt.Vector3(n[0]-t[0],n[1]-t[1],0).normalize(),i=new wt.Vector3(0,1,0).normalize(),o=r.angleTo(i),a=new wt.Vector3().crossVectors(i,r);return(Object.is(a.y,0)?-1:1)*o}async changeCameraToPathUp(e=100){let t=this.getPathDirection();if(t===null)return;let n=this.bmap.context.control.getAzimuthalAngle();Math.abs(n-t)>Math.PI&&(n>0?t=Math.PI*2+t:t=t-Math.PI*2);let r=Math.abs(t-this.bmap.context.control.getAzimuthalAngle());if(r<.01)return;let{control:i}=this.bmap.context,o=e/Math.PI*6*r;return Z(new Promise(a=>{let l={azimuthal:i.getAzimuthalAngle()},u={azimuthal:t},c=new Yt.Tween(l,this.tweenUtil.group).to(u,o).easing(Yt.Easing.Quadratic.InOut).onUpdate(async()=>{this.startPoi&&i.target.copy(this.startPoi.position),i.setAzimuthalAngle(l.azimuthal,!0),i.setTargetByOffset(this.options.offsetY)}).onComplete(()=>{i.enabled=!0,this.tweenUtil.remove(c),a(!0)}).onStart(()=>{i.enabled=!1}).start()}),o+500).finally(()=>{this.bmap.context.control.enabled=!0})}async initNavigationCamera(e=1e3){let n=this.taskQueue.getTasks().find(i=>i.meta.type==="initNavigationCamera")?.tid,r={run:()=>Z((async()=>{await this.initCameraZoom(e/2),await this.changeCameraToPathUp(e/4),await this.translateCameraToStartPoi(e/4)})(),e+500).finally(()=>{this.bmap.context.control.enabled=!0}),meta:{type:"initNavigationCamera"}};n?this.taskQueue.replace(n,r):this.taskQueue.add(r)}async translateCameraToStartPoi(e=100){if(!this.startPoi)return;let{clientSize:{width:t,height:n},camera:r,control:i}=this.bmap.context,o=Math.round(t/2),a=Math.round(n/2),l=i.target.clone(),u=y(this.startPoi.position,r,t,n),c=u.x-o,h=a-u.y+this.options.offsetY;if(console.log("start",l.clone()),!(Math.abs(c)<=1&&Math.abs(h)<=1)){if(Math.abs(c)>=1){let p=new wt.Vector3;p.setFromMatrixColumn(r.matrix,0),p.normalize(),p.multiplyScalar(c/r.zoom),l.add(new wt.Vector3(p.x,p.y,0))}if(Math.abs(h)>=1){let p=new wt.Vector3;p.setFromMatrixColumn(r.matrix,1),p.normalize(),p.multiplyScalar(h/r.zoom),l.add(new wt.Vector3(p.x,p.y,0))}return console.log("start1",l.clone()),Z(new Promise(p=>{let d=i.target.clone();console.log(d,l,e);let m=new Yt.Tween(d,this.tweenUtil.group).to(l,e).onUpdate(()=>{this.bmap.context.control.setCameraPositionByTarget(d,0)}).onComplete(()=>{this.bmap.context.control.setCameraPositionByTarget(l,0),this.tweenUtil.remove(m),this.bmap.context.control.enabled=!0,p(!0)}).onStart(()=>{this.bmap.context.control.enabled=!1}).start()}),e+500).then(()=>{this.bmap.context.control.enabled=!0})}}async initCameraZoom(e=100){if(!this.startPoi)return;let{clientSize:{width:t,height:n},currentFloor:r}=this.bmap.context,{max:i,min:o}=r.box,l=Math.min(t/(i.x-o.x),n/(i.y-o.y))*(i.x-o.x)/40;return this.bmap.context.setZoom(l,this.startPoi.position,e).finally(()=>{this.bmap.context.control.enabled=!0})}toPosition(e,t){this.positionNavigation.toPosition(e,t)}startSimulation(){this.positionNavigation.startSimulation()}setSimulationSpeed(e){this.positionNavigation.changeSimulationSpeed(e)}async toPositionBySpeed(e,t){let{currentPathPosition:n,curFloorPath:r,curFloorPathPoints:i}=this;if(!r||!n)return null;let o=this.movedDistance,a=fn(i,e);if(o===-1||a===-1||a<=o)return null;let l=a-o;if(!l)return;let u=Math.min(l/t,1);return this.pathTween&&this.clearTween(),Z(new Promise(c=>{let h=this.pathTween=new Yt.Tween({distance:0},this.tweenUtil.group).to({distance:l},u*1e3).onUpdate(async p=>{this.moveDistance(p.distance+o,h)}).onComplete(()=>{this.tweenUtil.remove(h),c(!0)}).start()}),u*1e3+500).finally(()=>{this.bmap.context.control.enabled=!0})}async moveDistance(e,t){this.movedDistance=e,this.path?.movePath(this.movedDistance/this.curFloorPathLength);let n=ee(this.curFloorPathPoints,this.movedDistance);if(n===null)return;this.currentPathPosition=n;let r=this.translatePoints([n])[0];this.startPoi&&(this.startPoi.position.setX(r[0]).setY(r[1]),this.options.disablePathAnimation||this.bmap.context.control.setTargetByOffset(this.options.offsetY,this.startPoi.position.clone())),this.options.disablePathAnimation||(t?.pause(),await this.changeCameraToPathUp(500/this.options.speed),t?.resume())}setStartPoiRotate(e){if(this.startPoi){let n=(this.bmap.context.control.getAzimuthalAngle()*180/Math.PI+360)%360;this.startPoi.options.icon_rotate=(360-e-n)%360}}dispose(){this.tweenUtil.dispose(),this.unRegistryEvent(),this.path?.dispose(),this.startPoi?.dispose(),this.positionNavigation.dispose()}};var Kr=require("three"),In=class extends dt{poiLayer;floors=[];group=new Kr.Group;constructor(e){super(e),this.poiLayer=new Ut(e.context)}show(e){let t=e[0].userData.height;e.forEach(i=>{i.poiLayer2.pois.forEach(o=>{o.position.setZ(o.position.z+t),o.options.depth_test=!0,this.poiLayer.pushPoi(o)}),i.poiLayer2.pois.length=0,i.poiLayer2.dispose(),i.position.z=t,t+=i.userData.height});let{scene:n,currentFloor:r}=this.bmap.context;r&&(n.remove(r),r.dispose()),this.group.add(this.poiLayer,...e),n.add(this.group),this.floors=e,this.fitCamera(),this.bmap.context.cameraBound.updateBox()}hide(){let{scene:e}=this.bmap.context;e.remove(this.group),this.poiLayer.clear(),this.floors.forEach(t=>{t.dispose()}),this.floors=[],this.group.clear()}fitCamera(){let{context:e,config:t,type:n}=this.bmap;e.cameraBound.setEnable(!1),e.control.minZoom=0,e.control.maxZoom=1/0,e.camera.zoom=1,e.setAzimuthalAngle(t.control.defaultAzimuthal,0),e.setPolarAngle(t.control.defaultPolar,0),e.fitCameraToObject(this.group,void 0,0);let r=e.camera.zoom;e.control.minZoom=r,e.control.maxZoom=r*25,n==="3d"&&e.fitCameraToObject(this.group,t.defaultPadding,0,!1),this.bmap.basicZoom=e.camera.zoom,e.control.addEventListener("change",this.bmap.onControlChange.bind(this.bmap)),this.bmap.onControlChange(),e.cameraBound.setEnable(!0)}dispose(){this.poiLayer.dispose(),this.floors.forEach(e=>e.dispose()),this.floors=[]}};var Zr=require("three");function xe(s){let e=new Blob([s],{type:"text/javascript"}),t=URL.createObjectURL(e),n=new Worker(t);return URL.revokeObjectURL(t),n}function Rn(){return xe(`var XP=Object.create;var Jd=Object.defineProperty,YP=Object.defineProperties,$P=Object.getOwnPropertyDescriptor,ZP=Object.getOwnPropertyDescriptors,JP=Object.getOwnPropertyNames,qv=Object.getOwnPropertySymbols,KP=Object.getPrototypeOf,Xv=Object.prototype.hasOwnProperty,QP=Object.prototype.propertyIsEnumerable;var Zd=(r,t,e)=>t in r?Jd(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,qc=(r,t)=>{for(var e in t||(t={}))Xv.call(t,e)&&Zd(r,e,t[e]);if(qv)for(var e of qv(t))QP.call(t,e)&&Zd(r,e,t[e]);return r},Yv=(r,t)=>YP(r,ZP(t));var ce=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports);var jP=(r,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of JP(t))!Xv.call(r,a)&&a!==e&&Jd(r,a,{get:()=>t[a],enumerable:!(o=$P(t,a))||o.enumerable});return r};var Nr=(r,t,e)=>(e=r!=null?XP(KP(r)):{},jP(t||!r||!r.__esModule?Jd(e,"default",{value:r,enumerable:!0}):e,r));var Ii=(r,t,e)=>Zd(r,typeof t!="symbol"?t+"":t,e);var Zv=ce((Pz,$v)=>{var Kd=class{constructor(){this.keys=new Set,this.queue=[]}sort(){this.queue.sort((t,e)=>t.priority-e.priority)}set(t,e){let o=Number(e);if(isNaN(o))throw new TypeError('"priority" must be a number');return this.keys.has(t)?this.queue.map(a=>(a.key===t&&Object.assign(a,{priority:o}),a)):(this.keys.add(t),this.queue.push({key:t,priority:o})),this.sort(),this.queue.length}next(){let t=this.queue.shift();return this.keys.delete(t.key),t}isEmpty(){return this.queue.length===0}has(t){return this.keys.has(t)}get(t){return this.queue.find(e=>e.key===t)}};$v.exports=Kd});var Qv=ce((Iz,Kv)=>{function Jv(r,t){let e=new Map;for(let[o,a]of r)o!==t&&a instanceof Map?e.set(o,Jv(a,t)):o!==t&&e.set(o,a);return e}Kv.exports=Jv});var e_=ce((Rz,t_)=>{function tI(r){let t=Number(r);return!(isNaN(t)||t<=0)}function jv(r){let t=new Map;return Object.keys(r).forEach(o=>{let a=r[o];if(a!==null&&typeof a=="object"&&!Array.isArray(a))return t.set(o,jv(a));if(!tI(a))throw new Error(\`Could not add node at key "\${o}", make sure it's a valid node\`,a);return t.set(o,Number(a))}),t}t_.exports=jv});var i_=ce((Lz,r_)=>{function n_(r){if(!(r instanceof Map))throw new Error(\`Invalid graph: Expected Map instead found \${typeof r}\`);r.forEach((t,e)=>{if(typeof t=="object"&&t instanceof Map){n_(t);return}if(typeof t!="number"||t<=0)throw new Error(\`Values must be numbers greater than 0. Found value \${t} at \${e}\`)})}r_.exports=n_});var u_=ce((Nz,a_)=>{var eI=Zv(),nI=Qv(),o_=e_(),s_=i_(),Qd=class{constructor(t){t instanceof Map?(s_(t),this.graph=t):t?this.graph=o_(t):this.graph=new Map}addNode(t,e){let o;return e instanceof Map?(s_(e),o=e):o=o_(e),this.graph.set(t,o),this}addVertex(t,e){return this.addNode(t,e)}removeNode(t){return this.graph=nI(this.graph,t),this}path(t,e,o={}){if(!this.graph.size)return o.cost?{path:null,cost:0}:null;let a=new Set,c=new eI,p=new Map,d=[],g=0,y=[];if(o.avoid&&(y=[].concat(o.avoid)),y.includes(t))throw new Error(\`Starting node (\${t}) cannot be avoided\`);if(y.includes(e))throw new Error(\`Ending node (\${e}) cannot be avoided\`);for(c.set(t,0);!c.isEmpty();){let _=c.next();if(_.key===e){g=_.priority;let x=_.key;for(;p.has(x);)d.push(x),x=p.get(x);break}a.add(_.key),(this.graph.get(_.key)||new Map).forEach((x,b)=>{if(a.has(b)||y.includes(b))return null;if(!c.has(b))return p.set(b,_.key),c.set(b,_.priority+x);let P=c.get(b).priority,I=_.priority+x;return I<P?(p.set(b,_.key),c.set(b,I)):null})}return d.length?(o.trim?d.shift():d=d.concat([t]),o.reverse||(d=d.reverse()),o.cost?{path:d,cost:g}:d):o.cost?{path:null,cost:0}:null}shortestPath(...t){return this.path(...t)}};a_.exports=Qd});var Qh=ce((Hz,Q1)=>{"use strict";var K1=Object.getOwnPropertySymbols,rD=Object.prototype.hasOwnProperty,iD=Object.prototype.propertyIsEnumerable;function oD(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function sD(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de",Object.getOwnPropertyNames(r)[0]==="5")return!1;for(var t={},e=0;e<10;e++)t["_"+String.fromCharCode(e)]=e;var o=Object.getOwnPropertyNames(t).map(function(c){return t[c]});if(o.join("")!=="0123456789")return!1;var a={};return"abcdefghijklmnopqrst".split("").forEach(function(c){a[c]=c}),Object.keys(Object.assign({},a)).join("")==="abcdefghijklmnopqrst"}catch(c){return!1}}Q1.exports=sD()?Object.assign:function(r,t){for(var e,o=oD(r),a,c=1;c<arguments.length;c++){e=Object(arguments[c]);for(var p in e)rD.call(e,p)&&(o[p]=e[p]);if(K1){a=K1(e);for(var d=0;d<a.length;d++)iD.call(e,a[d])&&(o[a[d]]=e[a[d]])}}return o}});var Sm=ce((wm,Mm)=>{(function(r,t){typeof wm=="object"&&typeof Mm!="undefined"?Mm.exports=t():typeof define=="function"&&define.amd?define(t):(r=r||self).RBush=t()})(wm,function(){"use strict";function r(M,E,N,A,U){(function z($,q,D,G,Q){for(;G>D;){if(G-D>600){var _t=G-D+1,Z=q-D+1,Dt=Math.log(_t),et=.5*Math.exp(2*Dt/3),vt=.5*Math.sqrt(Dt*et*(_t-et)/_t)*(Z-_t/2<0?-1:1),It=Math.max(D,Math.floor(q-Z*et/_t+vt)),Pt=Math.min(G,Math.floor(q+(_t-Z)*et/_t+vt));z($,q,It,Pt,Q)}var Et=$[q],yt=D,Y=G;for(t($,D,q),Q($[G],Et)>0&&t($,D,G);yt<Y;){for(t($,yt,Y),yt++,Y--;Q($[yt],Et)<0;)yt++;for(;Q($[Y],Et)>0;)Y--}Q($[D],Et)===0?t($,D,Y):t($,++Y,G),Y<=q&&(D=Y+1),q<=Y&&(G=Y-1)}})(M,E,N||0,A||M.length-1,U||e)}function t(M,E,N){var A=M[E];M[E]=M[N],M[N]=A}function e(M,E){return M<E?-1:M>E?1:0}var o=function(M){M===void 0&&(M=9),this._maxEntries=Math.max(4,M),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function a(M,E,N){if(!N)return E.indexOf(M);for(var A=0;A<E.length;A++)if(N(M,E[A]))return A;return-1}function c(M,E){p(M,0,M.children.length,E,M)}function p(M,E,N,A,U){U||(U=P(null)),U.minX=1/0,U.minY=1/0,U.maxX=-1/0,U.maxY=-1/0;for(var z=E;z<N;z++){var $=M.children[z];d(U,M.leaf?A($):$)}return U}function d(M,E){return M.minX=Math.min(M.minX,E.minX),M.minY=Math.min(M.minY,E.minY),M.maxX=Math.max(M.maxX,E.maxX),M.maxY=Math.max(M.maxY,E.maxY),M}function g(M,E){return M.minX-E.minX}function y(M,E){return M.minY-E.minY}function _(M){return(M.maxX-M.minX)*(M.maxY-M.minY)}function w(M){return M.maxX-M.minX+(M.maxY-M.minY)}function x(M,E){return M.minX<=E.minX&&M.minY<=E.minY&&E.maxX<=M.maxX&&E.maxY<=M.maxY}function b(M,E){return E.minX<=M.maxX&&E.minY<=M.maxY&&E.maxX>=M.minX&&E.maxY>=M.minY}function P(M){return{children:M,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function I(M,E,N,A,U){for(var z=[E,N];z.length;)if(!((N=z.pop())-(E=z.pop())<=A)){var $=E+Math.ceil((N-E)/A/2)*A;r(M,$,E,N,U),z.push(E,$,$,N)}}return o.prototype.all=function(){return this._all(this.data,[])},o.prototype.search=function(M){var E=this.data,N=[];if(!b(M,E))return N;for(var A=this.toBBox,U=[];E;){for(var z=0;z<E.children.length;z++){var $=E.children[z],q=E.leaf?A($):$;b(M,q)&&(E.leaf?N.push($):x(M,q)?this._all($,N):U.push($))}E=U.pop()}return N},o.prototype.collides=function(M){var E=this.data;if(!b(M,E))return!1;for(var N=[];E;){for(var A=0;A<E.children.length;A++){var U=E.children[A],z=E.leaf?this.toBBox(U):U;if(b(M,z)){if(E.leaf||x(M,z))return!0;N.push(U)}}E=N.pop()}return!1},o.prototype.load=function(M){if(!M||!M.length)return this;if(M.length<this._minEntries){for(var E=0;E<M.length;E++)this.insert(M[E]);return this}var N=this._build(M.slice(),0,M.length-1,0);if(this.data.children.length)if(this.data.height===N.height)this._splitRoot(this.data,N);else{if(this.data.height<N.height){var A=this.data;this.data=N,N=A}this._insert(N,this.data.height-N.height-1,!0)}else this.data=N;return this},o.prototype.insert=function(M){return M&&this._insert(M,this.data.height-1),this},o.prototype.clear=function(){return this.data=P([]),this},o.prototype.remove=function(M,E){if(!M)return this;for(var N,A,U,z=this.data,$=this.toBBox(M),q=[],D=[];z||q.length;){if(z||(z=q.pop(),A=q[q.length-1],N=D.pop(),U=!0),z.leaf){var G=a(M,z.children,E);if(G!==-1)return z.children.splice(G,1),q.push(z),this._condense(q),this}U||z.leaf||!x(z,$)?A?(N++,z=A.children[N],U=!1):z=null:(q.push(z),D.push(N),N=0,A=z,z=z.children[0])}return this},o.prototype.toBBox=function(M){return M},o.prototype.compareMinX=function(M,E){return M.minX-E.minX},o.prototype.compareMinY=function(M,E){return M.minY-E.minY},o.prototype.toJSON=function(){return this.data},o.prototype.fromJSON=function(M){return this.data=M,this},o.prototype._all=function(M,E){for(var N=[];M;)M.leaf?E.push.apply(E,M.children):N.push.apply(N,M.children),M=N.pop();return E},o.prototype._build=function(M,E,N,A){var U,z=N-E+1,$=this._maxEntries;if(z<=$)return c(U=P(M.slice(E,N+1)),this.toBBox),U;A||(A=Math.ceil(Math.log(z)/Math.log($)),$=Math.ceil(z/Math.pow($,A-1))),(U=P([])).leaf=!1,U.height=A;var q=Math.ceil(z/$),D=q*Math.ceil(Math.sqrt($));I(M,E,N,D,this.compareMinX);for(var G=E;G<=N;G+=D){var Q=Math.min(G+D-1,N);I(M,G,Q,q,this.compareMinY);for(var _t=G;_t<=Q;_t+=q){var Z=Math.min(_t+q-1,Q);U.children.push(this._build(M,_t,Z,A-1))}}return c(U,this.toBBox),U},o.prototype._chooseSubtree=function(M,E,N,A){for(;A.push(E),!E.leaf&&A.length-1!==N;){for(var U=1/0,z=1/0,$=void 0,q=0;q<E.children.length;q++){var D=E.children[q],G=_(D),Q=(_t=M,Z=D,(Math.max(Z.maxX,_t.maxX)-Math.min(Z.minX,_t.minX))*(Math.max(Z.maxY,_t.maxY)-Math.min(Z.minY,_t.minY))-G);Q<z?(z=Q,U=G<U?G:U,$=D):Q===z&&G<U&&(U=G,$=D)}E=$||E.children[0]}var _t,Z;return E},o.prototype._insert=function(M,E,N){var A=N?M:this.toBBox(M),U=[],z=this._chooseSubtree(A,this.data,E,U);for(z.children.push(M),d(z,A);E>=0&&U[E].children.length>this._maxEntries;)this._split(U,E),E--;this._adjustParentBBoxes(A,U,E)},o.prototype._split=function(M,E){var N=M[E],A=N.children.length,U=this._minEntries;this._chooseSplitAxis(N,U,A);var z=this._chooseSplitIndex(N,U,A),$=P(N.children.splice(z,N.children.length-z));$.height=N.height,$.leaf=N.leaf,c(N,this.toBBox),c($,this.toBBox),E?M[E-1].children.push($):this._splitRoot(N,$)},o.prototype._splitRoot=function(M,E){this.data=P([M,E]),this.data.height=M.height+1,this.data.leaf=!1,c(this.data,this.toBBox)},o.prototype._chooseSplitIndex=function(M,E,N){for(var A,U,z,$,q,D,G,Q=1/0,_t=1/0,Z=E;Z<=N-E;Z++){var Dt=p(M,0,Z,this.toBBox),et=p(M,Z,N,this.toBBox),vt=(U=Dt,z=et,$=void 0,q=void 0,D=void 0,G=void 0,$=Math.max(U.minX,z.minX),q=Math.max(U.minY,z.minY),D=Math.min(U.maxX,z.maxX),G=Math.min(U.maxY,z.maxY),Math.max(0,D-$)*Math.max(0,G-q)),It=_(Dt)+_(et);vt<Q?(Q=vt,A=Z,_t=It<_t?It:_t):vt===Q&&It<_t&&(_t=It,A=Z)}return A||N-E},o.prototype._chooseSplitAxis=function(M,E,N){var A=M.leaf?this.compareMinX:g,U=M.leaf?this.compareMinY:y;this._allDistMargin(M,E,N,A)<this._allDistMargin(M,E,N,U)&&M.children.sort(A)},o.prototype._allDistMargin=function(M,E,N,A){M.children.sort(A);for(var U=this.toBBox,z=p(M,0,E,U),$=p(M,N-E,N,U),q=w(z)+w($),D=E;D<N-E;D++){var G=M.children[D];d(z,M.leaf?U(G):G),q+=w(z)}for(var Q=N-E-1;Q>=E;Q--){var _t=M.children[Q];d($,M.leaf?U(_t):_t),q+=w($)}return q},o.prototype._adjustParentBBoxes=function(M,E,N){for(var A=N;A>=0;A--)d(E[A],M)},o.prototype._condense=function(M){for(var E=M.length-1,N=void 0;E>=0;E--)M[E].children.length===0?E>0?(N=M[E-1].children).splice(N.indexOf(M[E]),1):this.clear():c(M[E],this.toBBox)},o})});var j1=ce((bm,Tm)=>{(function(r,t){typeof bm=="object"&&typeof Tm!="undefined"?Tm.exports=t():typeof define=="function"&&define.amd?define(t):(r=r||self,r.TinyQueue=t())})(bm,function(){"use strict";var r=function(o,a){if(o===void 0&&(o=[]),a===void 0&&(a=t),this.data=o,this.length=this.data.length,this.compare=a,this.length>0)for(var c=(this.length>>1)-1;c>=0;c--)this._down(c)};r.prototype.push=function(o){this.data.push(o),this.length++,this._up(this.length-1)},r.prototype.pop=function(){if(this.length!==0){var o=this.data[0],a=this.data.pop();return this.length--,this.length>0&&(this.data[0]=a,this._down(0)),o}},r.prototype.peek=function(){return this.data[0]},r.prototype._up=function(o){for(var a=this,c=a.data,p=a.compare,d=c[o];o>0;){var g=o-1>>1,y=c[g];if(p(d,y)>=0)break;c[o]=y,o=g}c[o]=d},r.prototype._down=function(o){for(var a=this,c=a.data,p=a.compare,d=this.length>>1,g=c[o];o<d;){var y=(o<<1)+1,_=c[y],w=y+1;if(w<this.length&&p(c[w],_)<0&&(y=w,_=c[w]),p(_,g)>=0)break;c[o]=_,o=y}c[o]=g};function t(e,o){return e<o?-1:e>o?1:0}return r})});var ex=ce(($z,tx)=>{tx.exports=function(t,e,o,a){var c=t[0],p=t[1],d=!1;o===void 0&&(o=0),a===void 0&&(a=e.length);for(var g=(a-o)/2,y=0,_=g-1;y<g;_=y++){var w=e[o+y*2+0],x=e[o+y*2+1],b=e[o+_*2+0],P=e[o+_*2+1],I=x>p!=P>p&&c<(b-w)*(p-x)/(P-x)+w;I&&(d=!d)}return d}});var rx=ce((Zz,nx)=>{nx.exports=function(t,e,o,a){var c=t[0],p=t[1],d=!1;o===void 0&&(o=0),a===void 0&&(a=e.length);for(var g=a-o,y=0,_=g-1;y<g;_=y++){var w=e[y+o][0],x=e[y+o][1],b=e[_+o][0],P=e[_+o][1],I=x>p!=P>p&&c<(b-w)*(p-x)/(P-x)+w;I&&(d=!d)}return d}});var sx=ce((Jz,ep)=>{var ix=ex(),ox=rx();ep.exports=function(t,e,o,a){return e.length>0&&Array.isArray(e[0])?ox(t,e,o,a):ix(t,e,o,a)};ep.exports.nested=ox;ep.exports.flat=ix});var ux=ce((np,ax)=>{(function(r,t){typeof np=="object"&&typeof ax!="undefined"?t(np):typeof define=="function"&&define.amd?define(["exports"],t):t((r=r||self).predicates={})})(np,function(r){"use strict";let e=33306690738754706e-32;function o(b,P,I,M,E){let N,A,U,z,$=P[0],q=M[0],D=0,G=0;q>$==q>-$?(N=$,$=P[++D]):(N=q,q=M[++G]);let Q=0;if(D<b&&G<I)for(q>$==q>-$?(U=N-((A=$+N)-$),$=P[++D]):(U=N-((A=q+N)-q),q=M[++G]),N=A,U!==0&&(E[Q++]=U);D<b&&G<I;)q>$==q>-$?(U=N-((A=N+$)-(z=A-N))+($-z),$=P[++D]):(U=N-((A=N+q)-(z=A-N))+(q-z),q=M[++G]),N=A,U!==0&&(E[Q++]=U);for(;D<b;)U=N-((A=N+$)-(z=A-N))+($-z),$=P[++D],N=A,U!==0&&(E[Q++]=U);for(;G<I;)U=N-((A=N+q)-(z=A-N))+(q-z),q=M[++G],N=A,U!==0&&(E[Q++]=U);return N===0&&Q!==0||(E[Q++]=N),Q}function a(b){return new Float64Array(b)}let c=33306690738754716e-32,p=22204460492503146e-32,d=11093356479670487e-47,g=a(4),y=a(8),_=a(12),w=a(16),x=a(4);r.orient2d=function(b,P,I,M,E,N){let A=(P-N)*(I-E),U=(b-E)*(M-N),z=A-U;if(A===0||U===0||A>0!=U>0)return z;let $=Math.abs(A+U);return Math.abs(z)>=c*$?z:-function(q,D,G,Q,_t,Z,Dt){let et,vt,It,Pt,Et,yt,Y,ht,Mt,zt,At,$t,ue,le,Qt,me,Xt,Ee,ft=q-_t,He=G-_t,te=D-Z,fe=Q-Z;Et=(Qt=(ht=ft-(Y=(yt=134217729*ft)-(yt-ft)))*(zt=fe-(Mt=(yt=134217729*fe)-(yt-fe)))-((le=ft*fe)-Y*Mt-ht*Mt-Y*zt))-(At=Qt-(Xt=(ht=te-(Y=(yt=134217729*te)-(yt-te)))*(zt=He-(Mt=(yt=134217729*He)-(yt-He)))-((me=te*He)-Y*Mt-ht*Mt-Y*zt))),g[0]=Qt-(At+Et)+(Et-Xt),Et=(ue=le-(($t=le+At)-(Et=$t-le))+(At-Et))-(At=ue-me),g[1]=ue-(At+Et)+(Et-me),Et=(Ee=$t+At)-$t,g[2]=$t-(Ee-Et)+(At-Et),g[3]=Ee;let de=function(Vn,$n){let j=$n[0];for(let H=1;H<Vn;H++)j+=$n[H];return j}(4,g),Ue=p*Dt;if(de>=Ue||-de>=Ue||(et=q-(ft+(Et=q-ft))+(Et-_t),It=G-(He+(Et=G-He))+(Et-_t),vt=D-(te+(Et=D-te))+(Et-Z),Pt=Q-(fe+(Et=Q-fe))+(Et-Z),et===0&&vt===0&&It===0&&Pt===0)||(Ue=d*Dt+e*Math.abs(de),(de+=ft*Pt+fe*et-(te*It+He*vt))>=Ue||-de>=Ue))return de;Et=(Qt=(ht=et-(Y=(yt=134217729*et)-(yt-et)))*(zt=fe-(Mt=(yt=134217729*fe)-(yt-fe)))-((le=et*fe)-Y*Mt-ht*Mt-Y*zt))-(At=Qt-(Xt=(ht=vt-(Y=(yt=134217729*vt)-(yt-vt)))*(zt=He-(Mt=(yt=134217729*He)-(yt-He)))-((me=vt*He)-Y*Mt-ht*Mt-Y*zt))),x[0]=Qt-(At+Et)+(Et-Xt),Et=(ue=le-(($t=le+At)-(Et=$t-le))+(At-Et))-(At=ue-me),x[1]=ue-(At+Et)+(Et-me),Et=(Ee=$t+At)-$t,x[2]=$t-(Ee-Et)+(At-Et),x[3]=Ee;let be=o(4,g,4,x,y);Et=(Qt=(ht=ft-(Y=(yt=134217729*ft)-(yt-ft)))*(zt=Pt-(Mt=(yt=134217729*Pt)-(yt-Pt)))-((le=ft*Pt)-Y*Mt-ht*Mt-Y*zt))-(At=Qt-(Xt=(ht=te-(Y=(yt=134217729*te)-(yt-te)))*(zt=It-(Mt=(yt=134217729*It)-(yt-It)))-((me=te*It)-Y*Mt-ht*Mt-Y*zt))),x[0]=Qt-(At+Et)+(Et-Xt),Et=(ue=le-(($t=le+At)-(Et=$t-le))+(At-Et))-(At=ue-me),x[1]=ue-(At+Et)+(Et-me),Et=(Ee=$t+At)-$t,x[2]=$t-(Ee-Et)+(At-Et),x[3]=Ee;let kt=o(be,y,4,x,_);Et=(Qt=(ht=et-(Y=(yt=134217729*et)-(yt-et)))*(zt=Pt-(Mt=(yt=134217729*Pt)-(yt-Pt)))-((le=et*Pt)-Y*Mt-ht*Mt-Y*zt))-(At=Qt-(Xt=(ht=vt-(Y=(yt=134217729*vt)-(yt-vt)))*(zt=It-(Mt=(yt=134217729*It)-(yt-It)))-((me=vt*It)-Y*Mt-ht*Mt-Y*zt))),x[0]=Qt-(At+Et)+(Et-Xt),Et=(ue=le-(($t=le+At)-(Et=$t-le))+(At-Et))-(At=ue-me),x[1]=ue-(At+Et)+(Et-me),Et=(Ee=$t+At)-$t,x[2]=$t-(Ee-Et)+(At-Et),x[3]=Ee;let ye=o(kt,_,4,x,w);return w[ye-1]}(b,P,I,M,E,N,$)},r.orient2dfast=function(b,P,I,M,E,N){return(P-N)*(I-E)-(b-E)*(M-N)},Object.defineProperty(r,"__esModule",{value:!0})})});var dx=ce((Kz,Im)=>{"use strict";var lx=Sm(),ip=j1(),uD=sx(),lD=ux().orient2d;ip.default&&(ip=ip.default);Im.exports=px;Im.exports.default=px;function px(r,t,e){t=Math.max(0,t===void 0?2:t),e=e||0;var o=dD(r),a=new lx(16);a.toBBox=function(N){return{minX:N[0],minY:N[1],maxX:N[0],maxY:N[1]}},a.compareMinX=function(N,A){return N[0]-A[0]},a.compareMinY=function(N,A){return N[1]-A[1]},a.load(r);for(var c=[],p=0,d;p<o.length;p++){var g=o[p];a.remove(g),d=hx(g,d),c.push(d)}var y=new lx(16);for(p=0;p<c.length;p++)y.insert(Am(c[p]));for(var _=t*t,w=e*e;c.length;){var x=c.shift(),b=x.p,P=x.next.p,I=Cm(b,P);if(!(I<w)){var M=I/_;g=cD(a,x.prev.p,b,P,x.next.next.p,M,y),g&&Math.min(Cm(g,b),Cm(g,P))<=M&&(c.push(x),c.push(hx(g,x)),a.remove(g),y.remove(x),y.insert(Am(x)),y.insert(Am(x.next)))}}x=d;var E=[];do E.push(x.p),x=x.next;while(x!==d);return E.push(x.p),E}function cD(r,t,e,o,a,c,p){for(var d=new ip([],fD),g=r.data;g;){for(var y=0;y<g.children.length;y++){var _=g.children[y],w=g.leaf?Pm(_,e,o):hD(e,o,_);w>c||d.push({node:_,dist:w})}for(;d.length&&!d.peek().node.children;){var x=d.pop(),b=x.node,P=Pm(b,t,e),I=Pm(b,o,a);if(x.dist<P&&x.dist<I&&fx(e,b,p)&&fx(o,b,p))return b}g=d.pop(),g&&(g=g.node)}return null}function fD(r,t){return r.dist-t.dist}function hD(r,t,e){if(cx(r,e)||cx(t,e))return 0;var o=rp(r[0],r[1],t[0],t[1],e.minX,e.minY,e.maxX,e.minY);if(o===0)return 0;var a=rp(r[0],r[1],t[0],t[1],e.minX,e.minY,e.minX,e.maxY);if(a===0)return 0;var c=rp(r[0],r[1],t[0],t[1],e.maxX,e.minY,e.maxX,e.maxY);if(c===0)return 0;var p=rp(r[0],r[1],t[0],t[1],e.minX,e.maxY,e.maxX,e.maxY);return p===0?0:Math.min(o,a,c,p)}function cx(r,t){return r[0]>=t.minX&&r[0]<=t.maxX&&r[1]>=t.minY&&r[1]<=t.maxY}function fx(r,t,e){for(var o=Math.min(r[0],t[0]),a=Math.min(r[1],t[1]),c=Math.max(r[0],t[0]),p=Math.max(r[1],t[1]),d=e.search({minX:o,minY:a,maxX:c,maxY:p}),g=0;g<d.length;g++)if(pD(d[g].p,d[g].next.p,r,t))return!1;return!0}function ic(r,t,e){return lD(r[0],r[1],t[0],t[1],e[0],e[1])}function pD(r,t,e,o){return r!==o&&t!==e&&ic(r,t,e)>0!=ic(r,t,o)>0&&ic(e,o,r)>0!=ic(e,o,t)>0}function Am(r){var t=r.p,e=r.next.p;return r.minX=Math.min(t[0],e[0]),r.minY=Math.min(t[1],e[1]),r.maxX=Math.max(t[0],e[0]),r.maxY=Math.max(t[1],e[1]),r}function dD(r){for(var t=r[0],e=r[0],o=r[0],a=r[0],c=0;c<r.length;c++){var p=r[c];p[0]<t[0]&&(t=p),p[0]>o[0]&&(o=p),p[1]<e[1]&&(e=p),p[1]>a[1]&&(a=p)}var d=[t,e,o,a],g=d.slice();for(c=0;c<r.length;c++)uD(r[c],d)||g.push(r[c]);return mD(g)}function hx(r,t){var e={p:r,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return t?(e.next=t.next,e.prev=t,t.next.prev=e,t.next=e):(e.prev=e,e.next=e),e}function Cm(r,t){var e=r[0]-t[0],o=r[1]-t[1];return e*e+o*o}function Pm(r,t,e){var o=t[0],a=t[1],c=e[0]-o,p=e[1]-a;if(c!==0||p!==0){var d=((r[0]-o)*c+(r[1]-a)*p)/(c*c+p*p);d>1?(o=e[0],a=e[1]):d>0&&(o+=c*d,a+=p*d)}return c=r[0]-o,p=r[1]-a,c*c+p*p}function rp(r,t,e,o,a,c,p,d){var g=e-r,y=o-t,_=p-a,w=d-c,x=r-a,b=t-c,P=g*g+y*y,I=g*_+y*w,M=_*_+w*w,E=g*x+y*b,N=_*x+w*b,A=P*M-I*I,U,z,$,q,D=A,G=A;A===0?(z=0,D=1,q=N,G=M):(z=I*N-M*E,q=P*N-I*E,z<0?(z=0,q=N,G=M):z>D&&(z=D,q=N+I,G=M)),q<0?(q=0,-E<0?z=0:-E>P?z=D:(z=-E,D=P)):q>G&&(q=G,-E+I<0?z=0:-E+I>P?z=D:(z=-E+I,D=P)),U=z===0?0:z/D,$=q===0?0:q/G;var Q=(1-U)*r+U*e,_t=(1-U)*t+U*o,Z=(1-$)*a+$*p,Dt=(1-$)*c+$*d,et=Z-Q,vt=Dt-_t;return et*et+vt*vt}function gD(r,t){return r[0]===t[0]?r[1]-t[1]:r[0]-t[0]}function mD(r){r.sort(gD);for(var t=[],e=0;e<r.length;e++){for(;t.length>=2&&ic(t[t.length-2],t[t.length-1],r[e])<=0;)t.pop();t.push(r[e])}for(var o=[],a=r.length-1;a>=0;a--){for(;o.length>=2&&ic(o[o.length-2],o[o.length-1],r[a])<=0;)o.pop();o.push(r[a])}return o.pop(),t.pop(),t.concat(o)}});var xx=ce((Lm,Nm)=>{(function(r,t){typeof Lm=="object"&&typeof Nm!="undefined"?Nm.exports=t():typeof define=="function"&&define.amd?define(t):r.quickselect=t()})(Lm,function(){"use strict";function r(a,c,p,d,g){t(a,c,p||0,d||a.length-1,g||o)}function t(a,c,p,d,g){for(;d>p;){if(d-p>600){var y=d-p+1,_=c-p+1,w=Math.log(y),x=.5*Math.exp(2*w/3),b=.5*Math.sqrt(w*x*(y-x)/y)*(_-y/2<0?-1:1),P=Math.max(p,Math.floor(c-_*x/y+b)),I=Math.min(d,Math.floor(c+(y-_)*x/y+b));t(a,c,P,I,g)}var M=a[c],E=p,N=d;for(e(a,p,c),g(a[d],M)>0&&e(a,p,d);E<N;){for(e(a,E,N),E++,N--;g(a[E],M)<0;)E++;for(;g(a[N],M)>0;)N--}g(a[p],M)===0?e(a,p,N):(N++,e(a,N,d)),N<=c&&(p=N+1),c<=N&&(d=N-1)}}function e(a,c,p){var d=a[c];a[c]=a[p],a[p]=d}function o(a,c){return a<c?-1:a>c?1:0}return r})});var Um=ce((Mk,Fm)=>{"use strict";Fm.exports=lf;Fm.exports.default=lf;var PD=xx();function lf(r,t){if(!(this instanceof lf))return new lf(r,t);this._maxEntries=Math.max(4,r||9),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),t&&this._initFormat(t),this.clear()}lf.prototype={all:function(){return this._all(this.data,[])},search:function(r){var t=this.data,e=[],o=this.toBBox;if(!sp(r,t))return e;for(var a=[],c,p,d,g;t;){for(c=0,p=t.children.length;c<p;c++)d=t.children[c],g=t.leaf?o(d):d,sp(r,g)&&(t.leaf?e.push(d):Dm(r,g)?this._all(d,e):a.push(d));t=a.pop()}return e},collides:function(r){var t=this.data,e=this.toBBox;if(!sp(r,t))return!1;for(var o=[],a,c,p,d;t;){for(a=0,c=t.children.length;a<c;a++)if(p=t.children[a],d=t.leaf?e(p):p,sp(r,d)){if(t.leaf||Dm(r,d))return!0;o.push(p)}t=o.pop()}return!1},load:function(r){if(!(r&&r.length))return this;if(r.length<this._minEntries){for(var t=0,e=r.length;t<e;t++)this.insert(r[t]);return this}var o=this._build(r.slice(),0,r.length-1,0);if(!this.data.children.length)this.data=o;else if(this.data.height===o.height)this._splitRoot(this.data,o);else{if(this.data.height<o.height){var a=this.data;this.data=o,o=a}this._insert(o,this.data.height-o.height-1,!0)}return this},insert:function(r){return r&&this._insert(r,this.data.height-1),this},clear:function(){return this.data=ac([]),this},remove:function(r,t){if(!r)return this;for(var e=this.data,o=this.toBBox(r),a=[],c=[],p,d,g,y;e||a.length;){if(e||(e=a.pop(),d=a[a.length-1],p=c.pop(),y=!0),e.leaf&&(g=ID(r,e.children,t),g!==-1))return e.children.splice(g,1),a.push(e),this._condense(a),this;!y&&!e.leaf&&Dm(e,o)?(a.push(e),c.push(p),p=0,d=e,e=e.children[0]):d?(p++,e=d.children[p],y=!1):e=null}return this},toBBox:function(r){return r},compareMinX:Ex,compareMinY:wx,toJSON:function(){return this.data},fromJSON:function(r){return this.data=r,this},_all:function(r,t){for(var e=[];r;)r.leaf?t.push.apply(t,r.children):e.push.apply(e,r.children),r=e.pop();return t},_build:function(r,t,e,o){var a=e-t+1,c=this._maxEntries,p;if(a<=c)return p=ac(r.slice(t,e+1)),sc(p,this.toBBox),p;o||(o=Math.ceil(Math.log(a)/Math.log(c)),c=Math.ceil(a/Math.pow(c,o-1))),p=ac([]),p.leaf=!1,p.height=o;var d=Math.ceil(a/c),g=d*Math.ceil(Math.sqrt(c)),y,_,w,x;for(Mx(r,t,e,g,this.compareMinX),y=t;y<=e;y+=g)for(w=Math.min(y+g-1,e),Mx(r,y,w,d,this.compareMinY),_=y;_<=w;_+=d)x=Math.min(_+d-1,w),p.children.push(this._build(r,_,x,o-1));return sc(p,this.toBBox),p},_chooseSubtree:function(r,t,e,o){for(var a,c,p,d,g,y,_,w;o.push(t),!(t.leaf||o.length-1===e);){for(_=w=1/0,a=0,c=t.children.length;a<c;a++)p=t.children[a],g=Om(p),y=RD(r,p)-g,y<w?(w=y,_=g<_?g:_,d=p):y===w&&g<_&&(_=g,d=p);t=d||t.children[0]}return t},_insert:function(r,t,e){var o=this.toBBox,a=e?r:o(r),c=[],p=this._chooseSubtree(a,this.data,t,c);for(p.children.push(r),uf(p,a);t>=0&&c[t].children.length>this._maxEntries;)this._split(c,t),t--;this._adjustParentBBoxes(a,c,t)},_split:function(r,t){var e=r[t],o=e.children.length,a=this._minEntries;this._chooseSplitAxis(e,a,o);var c=this._chooseSplitIndex(e,a,o),p=ac(e.children.splice(c,e.children.length-c));p.height=e.height,p.leaf=e.leaf,sc(e,this.toBBox),sc(p,this.toBBox),t?r[t-1].children.push(p):this._splitRoot(e,p)},_splitRoot:function(r,t){this.data=ac([r,t]),this.data.height=r.height+1,this.data.leaf=!1,sc(this.data,this.toBBox)},_chooseSplitIndex:function(r,t,e){var o,a,c,p,d,g,y,_;for(g=y=1/0,o=t;o<=e-t;o++)a=af(r,0,o,this.toBBox),c=af(r,o,e,this.toBBox),p=LD(a,c),d=Om(a)+Om(c),p<g?(g=p,_=o,y=d<y?d:y):p===g&&d<y&&(y=d,_=o);return _},_chooseSplitAxis:function(r,t,e){var o=r.leaf?this.compareMinX:Ex,a=r.leaf?this.compareMinY:wx,c=this._allDistMargin(r,t,e,o),p=this._allDistMargin(r,t,e,a);c<p&&r.children.sort(o)},_allDistMargin:function(r,t,e,o){r.children.sort(o);var a=this.toBBox,c=af(r,0,t,a),p=af(r,e-t,e,a),d=op(c)+op(p),g,y;for(g=t;g<e-t;g++)y=r.children[g],uf(c,r.leaf?a(y):y),d+=op(c);for(g=e-t-1;g>=t;g--)y=r.children[g],uf(p,r.leaf?a(y):y),d+=op(p);return d},_adjustParentBBoxes:function(r,t,e){for(var o=e;o>=0;o--)uf(t[o],r)},_condense:function(r){for(var t=r.length-1,e;t>=0;t--)r[t].children.length===0?t>0?(e=r[t-1].children,e.splice(e.indexOf(r[t]),1)):this.clear():sc(r[t],this.toBBox)},_initFormat:function(r){var t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(r[0])),this.compareMinY=new Function("a","b",t.join(r[1])),this.toBBox=new Function("a","return {minX: a"+r[0]+", minY: a"+r[1]+", maxX: a"+r[2]+", maxY: a"+r[3]+"};")}};function ID(r,t,e){if(!e)return t.indexOf(r);for(var o=0;o<t.length;o++)if(e(r,t[o]))return o;return-1}function sc(r,t){af(r,0,r.children.length,t,r)}function af(r,t,e,o,a){a||(a=ac(null)),a.minX=1/0,a.minY=1/0,a.maxX=-1/0,a.maxY=-1/0;for(var c=t,p;c<e;c++)p=r.children[c],uf(a,r.leaf?o(p):p);return a}function uf(r,t){return r.minX=Math.min(r.minX,t.minX),r.minY=Math.min(r.minY,t.minY),r.maxX=Math.max(r.maxX,t.maxX),r.maxY=Math.max(r.maxY,t.maxY),r}function Ex(r,t){return r.minX-t.minX}function wx(r,t){return r.minY-t.minY}function Om(r){return(r.maxX-r.minX)*(r.maxY-r.minY)}function op(r){return r.maxX-r.minX+(r.maxY-r.minY)}function RD(r,t){return(Math.max(t.maxX,r.maxX)-Math.min(t.minX,r.minX))*(Math.max(t.maxY,r.maxY)-Math.min(t.minY,r.minY))}function LD(r,t){var e=Math.max(r.minX,t.minX),o=Math.max(r.minY,t.minY),a=Math.min(r.maxX,t.maxX),c=Math.min(r.maxY,t.maxY);return Math.max(0,a-e)*Math.max(0,c-o)}function Dm(r,t){return r.minX<=t.minX&&r.minY<=t.minY&&t.maxX<=r.maxX&&t.maxY<=r.maxY}function sp(r,t){return t.minX<=r.maxX&&t.minY<=r.maxY&&t.maxX>=r.minX&&t.maxY>=r.minY}function ac(r){return{children:r,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Mx(r,t,e,o,a){for(var c=[t,e],p;c.length;)e=c.pop(),t=c.pop(),!(e-t<=o)&&(p=t+Math.ceil((e-t)/o/2)*o,PD(r,p,t,e,a),c.push(t,p,p,e))}});var Px=ce((F5,Vm)=>{"use strict";Vm.exports=cp;Vm.exports.default=cp;function cp(r,t,e){e=e||2;var o=t&&t.length,a=o?t[0]*e:r.length,c=Tx(r,0,a,e,!0),p=[];if(!c||c.next===c.prev)return p;var d,g,y,_,w,x,b;if(o&&(c=HD(r,t,c,e)),r.length>80*e){d=y=r[0],g=_=r[1];for(var P=e;P<a;P+=e)w=r[P],x=r[P+1],w<d&&(d=w),x<g&&(g=x),w>y&&(y=w),x>_&&(_=x);b=Math.max(y-d,_-g),b=b!==0?32767/b:0}return hf(c,p,e,d,g,b,0),p}function Tx(r,t,e,o,a){var c,p;if(a===Hm(r,t,e,o)>0)for(c=t;c<e;c+=o)p=bx(c,r[c],r[c+1],p);else for(c=e-o;c>=t;c-=o)p=bx(c,r[c],r[c+1],p);return p&&fp(p,p.next)&&(df(p),p=p.next),p}function al(r,t){if(!r)return r;t||(t=r);var e=r,o;do if(o=!1,!e.steiner&&(fp(e,e.next)||Vr(e.prev,e,e.next)===0)){if(df(e),e=t=e.prev,e===e.next)break;o=!0}else e=e.next;while(o||e!==t);return t}function hf(r,t,e,o,a,c,p){if(r){!p&&c&&YD(r,o,a,c);for(var d=r,g,y;r.prev!==r.next;){if(g=r.prev,y=r.next,c?zD(r,o,a,c):BD(r)){t.push(g.i/e|0),t.push(r.i/e|0),t.push(y.i/e|0),df(r),r=y.next,d=y.next;continue}if(r=y,r===d){p?p===1?(r=GD(al(r),t,e),hf(r,t,e,o,a,c,2)):p===2&&kD(r,t,e,o,a,c):hf(al(r),t,e,o,a,c,1);break}}}}function BD(r){var t=r.prev,e=r,o=r.next;if(Vr(t,e,o)>=0)return!1;for(var a=t.x,c=e.x,p=o.x,d=t.y,g=e.y,y=o.y,_=a<c?a<p?a:p:c<p?c:p,w=d<g?d<y?d:y:g<y?g:y,x=a>c?a>p?a:p:c>p?c:p,b=d>g?d>y?d:y:g>y?g:y,P=o.next;P!==t;){if(P.x>=_&&P.x<=x&&P.y>=w&&P.y<=b&&cc(a,d,c,g,p,y,P.x,P.y)&&Vr(P.prev,P,P.next)>=0)return!1;P=P.next}return!0}function zD(r,t,e,o){var a=r.prev,c=r,p=r.next;if(Vr(a,c,p)>=0)return!1;for(var d=a.x,g=c.x,y=p.x,_=a.y,w=c.y,x=p.y,b=d<g?d<y?d:y:g<y?g:y,P=_<w?_<x?_:x:w<x?w:x,I=d>g?d>y?d:y:g>y?g:y,M=_>w?_>x?_:x:w>x?w:x,E=Gm(b,P,t,e,o),N=Gm(I,M,t,e,o),A=r.prevZ,U=r.nextZ;A&&A.z>=E&&U&&U.z<=N;){if(A.x>=b&&A.x<=I&&A.y>=P&&A.y<=M&&A!==a&&A!==p&&cc(d,_,g,w,y,x,A.x,A.y)&&Vr(A.prev,A,A.next)>=0||(A=A.prevZ,U.x>=b&&U.x<=I&&U.y>=P&&U.y<=M&&U!==a&&U!==p&&cc(d,_,g,w,y,x,U.x,U.y)&&Vr(U.prev,U,U.next)>=0))return!1;U=U.nextZ}for(;A&&A.z>=E;){if(A.x>=b&&A.x<=I&&A.y>=P&&A.y<=M&&A!==a&&A!==p&&cc(d,_,g,w,y,x,A.x,A.y)&&Vr(A.prev,A,A.next)>=0)return!1;A=A.prevZ}for(;U&&U.z<=N;){if(U.x>=b&&U.x<=I&&U.y>=P&&U.y<=M&&U!==a&&U!==p&&cc(d,_,g,w,y,x,U.x,U.y)&&Vr(U.prev,U,U.next)>=0)return!1;U=U.nextZ}return!0}function GD(r,t,e){var o=r;do{var a=o.prev,c=o.next.next;!fp(a,c)&&Ax(a,o,o.next,c)&&pf(a,c)&&pf(c,a)&&(t.push(a.i/e|0),t.push(o.i/e|0),t.push(c.i/e|0),df(o),df(o.next),o=r=c),o=o.next}while(o!==r);return al(o)}function kD(r,t,e,o,a,c){var p=r;do{for(var d=p.next.next;d!==p.prev;){if(p.i!==d.i&&JD(p,d)){var g=Cx(p,d);p=al(p,p.next),g=al(g,g.next),hf(p,t,e,o,a,c,0),hf(g,t,e,o,a,c,0);return}d=d.next}p=p.next}while(p!==r)}function HD(r,t,e,o){var a=[],c,p,d,g,y;for(c=0,p=t.length;c<p;c++)d=t[c]*o,g=c<p-1?t[c+1]*o:r.length,y=Tx(r,d,g,o,!1),y===y.next&&(y.steiner=!0),a.push(ZD(y));for(a.sort(VD),c=0;c<a.length;c++)e=WD(a[c],e);return e}function VD(r,t){return r.x-t.x}function WD(r,t){var e=qD(r,t);if(!e)return t;var o=Cx(e,r);return al(o,o.next),al(e,e.next)}function qD(r,t){var e=t,o=r.x,a=r.y,c=-1/0,p;do{if(a<=e.y&&a>=e.next.y&&e.next.y!==e.y){var d=e.x+(a-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(d<=o&&d>c&&(c=d,p=e.x<e.next.x?e:e.next,d===o))return p}e=e.next}while(e!==t);if(!p)return null;var g=p,y=p.x,_=p.y,w=1/0,x;e=p;do o>=e.x&&e.x>=y&&o!==e.x&&cc(a<_?o:c,a,y,_,a<_?c:o,a,e.x,e.y)&&(x=Math.abs(a-e.y)/(o-e.x),pf(e,r)&&(x<w||x===w&&(e.x>p.x||e.x===p.x&&XD(p,e)))&&(p=e,w=x)),e=e.next;while(e!==g);return p}function XD(r,t){return Vr(r.prev,r,t.prev)<0&&Vr(t.next,r,r.next)<0}function YD(r,t,e,o){var a=r;do a.z===0&&(a.z=Gm(a.x,a.y,t,e,o)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==r);a.prevZ.nextZ=null,a.prevZ=null,$D(a)}function $D(r){var t,e,o,a,c,p,d,g,y=1;do{for(e=r,r=null,c=null,p=0;e;){for(p++,o=e,d=0,t=0;t<y&&(d++,o=o.nextZ,!!o);t++);for(g=y;d>0||g>0&&o;)d!==0&&(g===0||!o||e.z<=o.z)?(a=e,e=e.nextZ,d--):(a=o,o=o.nextZ,g--),c?c.nextZ=a:r=a,a.prevZ=c,c=a;e=o}c.nextZ=null,y*=2}while(p>1);return r}function Gm(r,t,e,o,a){return r=(r-e)*a|0,t=(t-o)*a|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,r|t<<1}function ZD(r){var t=r,e=r;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==r);return e}function cc(r,t,e,o,a,c,p,d){return(a-p)*(t-d)>=(r-p)*(c-d)&&(r-p)*(o-d)>=(e-p)*(t-d)&&(e-p)*(c-d)>=(a-p)*(o-d)}function JD(r,t){return r.next.i!==t.i&&r.prev.i!==t.i&&!KD(r,t)&&(pf(r,t)&&pf(t,r)&&QD(r,t)&&(Vr(r.prev,r,t.prev)||Vr(r,t.prev,t))||fp(r,t)&&Vr(r.prev,r,r.next)>0&&Vr(t.prev,t,t.next)>0)}function Vr(r,t,e){return(t.y-r.y)*(e.x-t.x)-(t.x-r.x)*(e.y-t.y)}function fp(r,t){return r.x===t.x&&r.y===t.y}function Ax(r,t,e,o){var a=lp(Vr(r,t,e)),c=lp(Vr(r,t,o)),p=lp(Vr(e,o,r)),d=lp(Vr(e,o,t));return!!(a!==c&&p!==d||a===0&&up(r,e,t)||c===0&&up(r,o,t)||p===0&&up(e,r,o)||d===0&&up(e,t,o))}function up(r,t,e){return t.x<=Math.max(r.x,e.x)&&t.x>=Math.min(r.x,e.x)&&t.y<=Math.max(r.y,e.y)&&t.y>=Math.min(r.y,e.y)}function lp(r){return r>0?1:r<0?-1:0}function KD(r,t){var e=r;do{if(e.i!==r.i&&e.next.i!==r.i&&e.i!==t.i&&e.next.i!==t.i&&Ax(e,e.next,r,t))return!0;e=e.next}while(e!==r);return!1}function pf(r,t){return Vr(r.prev,r,r.next)<0?Vr(r,t,r.next)>=0&&Vr(r,r.prev,t)>=0:Vr(r,t,r.prev)<0||Vr(r,r.next,t)<0}function QD(r,t){var e=r,o=!1,a=(r.x+t.x)/2,c=(r.y+t.y)/2;do e.y>c!=e.next.y>c&&e.next.y!==e.y&&a<(e.next.x-e.x)*(c-e.y)/(e.next.y-e.y)+e.x&&(o=!o),e=e.next;while(e!==r);return o}function Cx(r,t){var e=new km(r.i,r.x,r.y),o=new km(t.i,t.x,t.y),a=r.next,c=t.prev;return r.next=t,t.prev=r,e.next=a,a.prev=e,o.next=e,e.prev=o,c.next=o,o.prev=c,o}function bx(r,t,e,o){var a=new km(r,t,e);return o?(a.next=o.next,a.prev=o,o.next.prev=a,o.next=a):(a.prev=a,a.next=a),a}function df(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function km(r,t,e){this.i=r,this.x=t,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}cp.deviation=function(r,t,e,o){var a=t&&t.length,c=a?t[0]*e:r.length,p=Math.abs(Hm(r,0,c,e));if(a)for(var d=0,g=t.length;d<g;d++){var y=t[d]*e,_=d<g-1?t[d+1]*e:r.length;p-=Math.abs(Hm(r,y,_,e))}var w=0;for(d=0;d<o.length;d+=3){var x=o[d]*e,b=o[d+1]*e,P=o[d+2]*e;w+=Math.abs((r[x]-r[P])*(r[b+1]-r[x+1])-(r[x]-r[b])*(r[P+1]-r[x+1]))}return p===0&&w===0?0:Math.abs((w-p)/p)};function Hm(r,t,e,o){for(var a=0,c=t,p=e-o;c<e;c+=o)a+=(r[p]-r[c])*(r[c+1]+r[p+1]),p=c;return a}cp.flatten=function(r){for(var t=r[0][0].length,e={vertices:[],holes:[],dimensions:t},o=0,a=0;a<r.length;a++){for(var c=0;c<r[a].length;c++)for(var p=0;p<t;p++)e.vertices.push(r[a][c][p]);a>0&&(o+=r[a-1].length,e.holes.push(o))}return e}});var $m=ce(Ie=>{"use strict";Object.defineProperty(Ie,"__esModule",{value:!0});Ie.earthRadius=63710088e-1;Ie.factors={centimeters:Ie.earthRadius*100,centimetres:Ie.earthRadius*100,degrees:Ie.earthRadius/111325,feet:Ie.earthRadius*3.28084,inches:Ie.earthRadius*39.37,kilometers:Ie.earthRadius/1e3,kilometres:Ie.earthRadius/1e3,meters:Ie.earthRadius,metres:Ie.earthRadius,miles:Ie.earthRadius/1609.344,millimeters:Ie.earthRadius*1e3,millimetres:Ie.earthRadius*1e3,nauticalmiles:Ie.earthRadius/1852,radians:1,yards:Ie.earthRadius*1.0936};Ie.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/Ie.earthRadius,yards:1.0936133};Ie.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function Au(r,t,e){e===void 0&&(e={});var o={type:"Feature"};return(e.id===0||e.id)&&(o.id=e.id),e.bbox&&(o.bbox=e.bbox),o.properties=t||{},o.geometry=r,o}Ie.feature=Au;function t3(r,t,e){switch(e===void 0&&(e={}),r){case"Point":return Wm(t).geometry;case"LineString":return Xm(t).geometry;case"Polygon":return qm(t).geometry;case"MultiPoint":return Rx(t).geometry;case"MultiLineString":return Ix(t).geometry;case"MultiPolygon":return Lx(t).geometry;default:throw new Error(r+" is invalid")}}Ie.geometry=t3;function Wm(r,t,e){if(e===void 0&&(e={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!hp(r[0])||!hp(r[1]))throw new Error("coordinates must contain numbers");var o={type:"Point",coordinates:r};return Au(o,t,e)}Ie.point=Wm;function e3(r,t,e){return e===void 0&&(e={}),pp(r.map(function(o){return Wm(o,t)}),e)}Ie.points=e3;function qm(r,t,e){e===void 0&&(e={});for(var o=0,a=r;o<a.length;o++){var c=a[o];if(c.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var p=0;p<c[c.length-1].length;p++)if(c[c.length-1][p]!==c[0][p])throw new Error("First and last Position are not equivalent.")}var d={type:"Polygon",coordinates:r};return Au(d,t,e)}Ie.polygon=qm;function n3(r,t,e){return e===void 0&&(e={}),pp(r.map(function(o){return qm(o,t)}),e)}Ie.polygons=n3;function Xm(r,t,e){if(e===void 0&&(e={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var o={type:"LineString",coordinates:r};return Au(o,t,e)}Ie.lineString=Xm;function r3(r,t,e){return e===void 0&&(e={}),pp(r.map(function(o){return Xm(o,t)}),e)}Ie.lineStrings=r3;function pp(r,t){t===void 0&&(t={});var e={type:"FeatureCollection"};return t.id&&(e.id=t.id),t.bbox&&(e.bbox=t.bbox),e.features=r,e}Ie.featureCollection=pp;function Ix(r,t,e){e===void 0&&(e={});var o={type:"MultiLineString",coordinates:r};return Au(o,t,e)}Ie.multiLineString=Ix;function Rx(r,t,e){e===void 0&&(e={});var o={type:"MultiPoint",coordinates:r};return Au(o,t,e)}Ie.multiPoint=Rx;function Lx(r,t,e){e===void 0&&(e={});var o={type:"MultiPolygon",coordinates:r};return Au(o,t,e)}Ie.multiPolygon=Lx;function i3(r,t,e){e===void 0&&(e={});var o={type:"GeometryCollection",geometries:r};return Au(o,t,e)}Ie.geometryCollection=i3;function o3(r,t){if(t===void 0&&(t=0),t&&!(t>=0))throw new Error("precision must be a positive number");var e=Math.pow(10,t||0);return Math.round(r*e)/e}Ie.round=o3;function Nx(r,t){t===void 0&&(t="kilometers");var e=Ie.factors[t];if(!e)throw new Error(t+" units is invalid");return r*e}Ie.radiansToLength=Nx;function Ym(r,t){t===void 0&&(t="kilometers");var e=Ie.factors[t];if(!e)throw new Error(t+" units is invalid");return r/e}Ie.lengthToRadians=Ym;function s3(r,t){return Ox(Ym(r,t))}Ie.lengthToDegrees=s3;function a3(r){var t=r%360;return t<0&&(t+=360),t}Ie.bearingToAzimuth=a3;function Ox(r){var t=r%(2*Math.PI);return t*180/Math.PI}Ie.radiansToDegrees=Ox;function u3(r){var t=r%360;return t*Math.PI/180}Ie.degreesToRadians=u3;function l3(r,t,e){if(t===void 0&&(t="kilometers"),e===void 0&&(e="kilometers"),!(r>=0))throw new Error("length must be a positive number");return Nx(Ym(r,t),e)}Ie.convertLength=l3;function c3(r,t,e){if(t===void 0&&(t="meters"),e===void 0&&(e="kilometers"),!(r>=0))throw new Error("area must be a positive number");var o=Ie.areaFactors[t];if(!o)throw new Error("invalid original units");var a=Ie.areaFactors[e];if(!a)throw new Error("invalid final units");return r/o*a}Ie.convertArea=c3;function hp(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}Ie.isNumber=hp;function f3(r){return!!r&&r.constructor===Object}Ie.isObject=f3;function h3(r){if(!r)throw new Error("bbox is required");if(!Array.isArray(r))throw new Error("bbox must be an Array");if(r.length!==4&&r.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");r.forEach(function(t){if(!hp(t))throw new Error("bbox must only contain numbers")})}Ie.validateBBox=h3;function p3(r){if(!r)throw new Error("id is required");if(["string","number"].indexOf(typeof r)===-1)throw new Error("id must be a number or a string")}Ie.validateId=p3});var Jm=ce(_i=>{"use strict";Object.defineProperty(_i,"__esModule",{value:!0});var oo=$m();function gf(r,t,e){if(r!==null)for(var o,a,c,p,d,g,y,_=0,w=0,x,b=r.type,P=b==="FeatureCollection",I=b==="Feature",M=P?r.features.length:1,E=0;E<M;E++){y=P?r.features[E].geometry:I?r.geometry:r,x=y?y.type==="GeometryCollection":!1,d=x?y.geometries.length:1;for(var N=0;N<d;N++){var A=0,U=0;if(p=x?y.geometries[N]:y,p!==null){g=p.coordinates;var z=p.type;switch(_=e&&(z==="Polygon"||z==="MultiPolygon")?1:0,z){case null:break;case"Point":if(t(g,w,E,A,U)===!1)return!1;w++,A++;break;case"LineString":case"MultiPoint":for(o=0;o<g.length;o++){if(t(g[o],w,E,A,U)===!1)return!1;w++,z==="MultiPoint"&&A++}z==="LineString"&&A++;break;case"Polygon":case"MultiLineString":for(o=0;o<g.length;o++){for(a=0;a<g[o].length-_;a++){if(t(g[o][a],w,E,A,U)===!1)return!1;w++}z==="MultiLineString"&&A++,z==="Polygon"&&U++}z==="Polygon"&&A++;break;case"MultiPolygon":for(o=0;o<g.length;o++){for(U=0,a=0;a<g[o].length;a++){for(c=0;c<g[o][a].length-_;c++){if(t(g[o][a][c],w,E,A,U)===!1)return!1;w++}U++}A++}break;case"GeometryCollection":for(o=0;o<p.geometries.length;o++)if(gf(p.geometries[o],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function d3(r,t,e,o){var a=e;return gf(r,function(c,p,d,g,y){p===0&&e===void 0?a=c:a=t(a,c,p,d,g,y)},o),a}function Dx(r,t){var e;switch(r.type){case"FeatureCollection":for(e=0;e<r.features.length&&t(r.features[e].properties,e)!==!1;e++);break;case"Feature":t(r.properties,0);break}}function g3(r,t,e){var o=e;return Dx(r,function(a,c){c===0&&e===void 0?o=a:o=t(o,a,c)}),o}function Fx(r,t){if(r.type==="Feature")t(r,0);else if(r.type==="FeatureCollection")for(var e=0;e<r.features.length&&t(r.features[e],e)!==!1;e++);}function m3(r,t,e){var o=e;return Fx(r,function(a,c){c===0&&e===void 0?o=a:o=t(o,a,c)}),o}function y3(r){var t=[];return gf(r,function(e){t.push(e)}),t}function Zm(r,t){var e,o,a,c,p,d,g,y,_,w,x=0,b=r.type==="FeatureCollection",P=r.type==="Feature",I=b?r.features.length:1;for(e=0;e<I;e++){for(d=b?r.features[e].geometry:P?r.geometry:r,y=b?r.features[e].properties:P?r.properties:{},_=b?r.features[e].bbox:P?r.bbox:void 0,w=b?r.features[e].id:P?r.id:void 0,g=d?d.type==="GeometryCollection":!1,p=g?d.geometries.length:1,a=0;a<p;a++){if(c=g?d.geometries[a]:d,c===null){if(t(null,x,y,_,w)===!1)return!1;continue}switch(c.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(c,x,y,_,w)===!1)return!1;break}case"GeometryCollection":{for(o=0;o<c.geometries.length;o++)if(t(c.geometries[o],x,y,_,w)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}x++}}function v3(r,t,e){var o=e;return Zm(r,function(a,c,p,d,g){c===0&&e===void 0?o=a:o=t(o,a,c,p,d,g)}),o}function dp(r,t){Zm(r,function(e,o,a,c,p){var d=e===null?null:e.type;switch(d){case null:case"Point":case"LineString":case"Polygon":return t(oo.feature(e,a,{bbox:c,id:p}),o,0)===!1?!1:void 0}var g;switch(d){case"MultiPoint":g="Point";break;case"MultiLineString":g="LineString";break;case"MultiPolygon":g="Polygon";break}for(var y=0;y<e.coordinates.length;y++){var _=e.coordinates[y],w={type:g,coordinates:_};if(t(oo.feature(w,a),o,y)===!1)return!1}})}function _3(r,t,e){var o=e;return dp(r,function(a,c,p){c===0&&p===0&&e===void 0?o=a:o=t(o,a,c,p)}),o}function Ux(r,t){dp(r,function(e,o,a){var c=0;if(e.geometry){var p=e.geometry.type;if(!(p==="Point"||p==="MultiPoint")){var d,g=0,y=0,_=0;if(gf(e,function(w,x,b,P,I){if(d===void 0||o>g||P>y||I>_){d=w,g=o,y=P,_=I,c=0;return}var M=oo.lineString([d,w],e.properties);if(t(M,o,a,I,c)===!1)return!1;c++,d=w})===!1)return!1}}})}function x3(r,t,e){var o=e,a=!1;return Ux(r,function(c,p,d,g,y){a===!1&&e===void 0?o=c:o=t(o,c,p,d,g,y),a=!0}),o}function Bx(r,t){if(!r)throw new Error("geojson is required");dp(r,function(e,o,a){if(e.geometry!==null){var c=e.geometry.type,p=e.geometry.coordinates;switch(c){case"LineString":if(t(e,o,a,0,0)===!1)return!1;break;case"Polygon":for(var d=0;d<p.length;d++)if(t(oo.lineString(p[d],e.properties),o,a,d)===!1)return!1;break}}})}function E3(r,t,e){var o=e;return Bx(r,function(a,c,p,d){c===0&&e===void 0?o=a:o=t(o,a,c,p,d)}),o}function w3(r,t){if(t=t||{},!oo.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,o=t.multiFeatureIndex||0,a=t.geometryIndex||0,c=t.segmentIndex||0,p=t.properties,d;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),p=p||r.features[e].properties,d=r.features[e].geometry;break;case"Feature":p=p||r.properties,d=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":d=r;break;default:throw new Error("geojson is invalid")}if(d===null)return null;var g=d.coordinates;switch(d.type){case"Point":case"MultiPoint":return null;case"LineString":return c<0&&(c=g.length+c-1),oo.lineString([g[c],g[c+1]],p,t);case"Polygon":return a<0&&(a=g.length+a),c<0&&(c=g[a].length+c-1),oo.lineString([g[a][c],g[a][c+1]],p,t);case"MultiLineString":return o<0&&(o=g.length+o),c<0&&(c=g[o].length+c-1),oo.lineString([g[o][c],g[o][c+1]],p,t);case"MultiPolygon":return o<0&&(o=g.length+o),a<0&&(a=g[o].length+a),c<0&&(c=g[o][a].length-c-1),oo.lineString([g[o][a][c],g[o][a][c+1]],p,t)}throw new Error("geojson is invalid")}function M3(r,t){if(t=t||{},!oo.isObject(t))throw new Error("options is invalid");var e=t.featureIndex||0,o=t.multiFeatureIndex||0,a=t.geometryIndex||0,c=t.coordIndex||0,p=t.properties,d;switch(r.type){case"FeatureCollection":e<0&&(e=r.features.length+e),p=p||r.features[e].properties,d=r.features[e].geometry;break;case"Feature":p=p||r.properties,d=r.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":d=r;break;default:throw new Error("geojson is invalid")}if(d===null)return null;var g=d.coordinates;switch(d.type){case"Point":return oo.point(g,p,t);case"MultiPoint":return o<0&&(o=g.length+o),oo.point(g[o],p,t);case"LineString":return c<0&&(c=g.length+c),oo.point(g[c],p,t);case"Polygon":return a<0&&(a=g.length+a),c<0&&(c=g[a].length+c),oo.point(g[a][c],p,t);case"MultiLineString":return o<0&&(o=g.length+o),c<0&&(c=g[o].length+c),oo.point(g[o][c],p,t);case"MultiPolygon":return o<0&&(o=g.length+o),a<0&&(a=g[o].length+a),c<0&&(c=g[o][a].length-c),oo.point(g[o][a][c],p,t)}throw new Error("geojson is invalid")}_i.coordAll=y3;_i.coordEach=gf;_i.coordReduce=d3;_i.featureEach=Fx;_i.featureReduce=m3;_i.findPoint=M3;_i.findSegment=w3;_i.flattenEach=dp;_i.flattenReduce=_3;_i.geomEach=Zm;_i.geomReduce=v3;_i.lineEach=Bx;_i.lineReduce=E3;_i.propEach=Dx;_i.propReduce=g3;_i.segmentEach=Ux;_i.segmentReduce=x3});var zx=ce(Qm=>{"use strict";Object.defineProperty(Qm,"__esModule",{value:!0});var S3=Jm();function Km(r){var t=[1/0,1/0,-1/0,-1/0];return S3.coordEach(r,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}Km.default=Km;Qm.default=Km});var gp=ce((Q5,jm)=>{var da=Sm(),kx=$m(),Hx=Jm(),fc=zx().default,b3=Hx.featureEach,J5=Hx.coordEach,K5=kx.polygon,Gx=kx.featureCollection;function Vx(r){var t=new da(r);return t.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:fc(e),da.prototype.insert.call(this,e)},t.load=function(e){var o=[];return Array.isArray(e)?e.forEach(function(a){if(a.type!=="Feature")throw new Error("invalid features");a.bbox=a.bbox?a.bbox:fc(a),o.push(a)}):b3(e,function(a){if(a.type!=="Feature")throw new Error("invalid features");a.bbox=a.bbox?a.bbox:fc(a),o.push(a)}),da.prototype.load.call(this,o)},t.remove=function(e,o){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:fc(e),da.prototype.remove.call(this,e,o)},t.clear=function(){return da.prototype.clear.call(this)},t.search=function(e){var o=da.prototype.search.call(this,this.toBBox(e));return Gx(o)},t.collides=function(e){return da.prototype.collides.call(this,this.toBBox(e))},t.all=function(){var e=da.prototype.all.call(this);return Gx(e)},t.toJSON=function(){return da.prototype.toJSON.call(this)},t.fromJSON=function(e){return da.prototype.fromJSON.call(this,e)},t.toBBox=function(e){var o;if(e.bbox)o=e.bbox;else if(Array.isArray(e)&&e.length===4)o=e;else if(Array.isArray(e)&&e.length===6)o=[e[0],e[1],e[3],e[4]];else if(e.type==="Feature")o=fc(e);else if(e.type==="FeatureCollection")o=fc(e);else throw new Error("invalid geojson");return{minX:o[0],minY:o[1],maxX:o[2],maxY:o[3]}},t}jm.exports=Vx;jm.exports.default=Vx});var o0=ce((a6,jx)=>{"use strict";var Qx=Object.prototype.toString;jx.exports=function(t){var e=Qx.call(t),o=e==="[object Arguments]";return o||(o=e!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&Qx.call(t.callee)==="[object Function]"),o}});var uE=ce((u6,aE)=>{"use strict";var sE;Object.keys||(vf=Object.prototype.hasOwnProperty,s0=Object.prototype.toString,tE=o0(),a0=Object.prototype.propertyIsEnumerable,eE=!a0.call({toString:null},"toString"),nE=a0.call(function(){},"prototype"),_f=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],xp=function(r){var t=r.constructor;return t&&t.prototype===r},rE={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},iE=function(){if(typeof window=="undefined")return!1;for(var r in window)try{if(!rE["$"+r]&&vf.call(window,r)&&window[r]!==null&&typeof window[r]=="object")try{xp(window[r])}catch(t){return!0}}catch(t){return!0}return!1}(),oE=function(r){if(typeof window=="undefined"||!iE)return xp(r);try{return xp(r)}catch(t){return!1}},sE=function(t){var e=t!==null&&typeof t=="object",o=s0.call(t)==="[object Function]",a=tE(t),c=e&&s0.call(t)==="[object String]",p=[];if(!e&&!o&&!a)throw new TypeError("Object.keys called on a non-object");var d=nE&&o;if(c&&t.length>0&&!vf.call(t,0))for(var g=0;g<t.length;++g)p.push(String(g));if(a&&t.length>0)for(var y=0;y<t.length;++y)p.push(String(y));else for(var _ in t)!(d&&_==="prototype")&&vf.call(t,_)&&p.push(String(_));if(eE)for(var w=oE(t),x=0;x<_f.length;++x)!(w&&_f[x]==="constructor")&&vf.call(t,_f[x])&&p.push(_f[x]);return p});var vf,s0,tE,a0,eE,nE,_f,xp,rE,iE,oE;aE.exports=sE});var u0=ce((l6,fE)=>{"use strict";var D3=Array.prototype.slice,F3=o0(),lE=Object.keys,Ep=lE?function(t){return lE(t)}:uE(),cE=Object.keys;Ep.shim=function(){if(Object.keys){var t=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);t||(Object.keys=function(o){return F3(o)?cE(D3.call(o)):cE(o)})}else Object.keys=Ep;return Object.keys||Ep};fE.exports=Ep});var l0=ce((c6,hE)=>{"use strict";hE.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},e=Symbol("test"),o=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(o)!=="[object Symbol]")return!1;var a=42;t[e]=a;for(e in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var p=Object.getOwnPropertyDescriptor(t,e);if(p.value!==a||p.enumerable!==!0)return!1}return!0}});var wp=ce((f6,pE)=>{"use strict";var U3=l0();pE.exports=function(){return U3()&&!!Symbol.toStringTag}});var gE=ce((h6,dE)=>{"use strict";dE.exports=Error});var yE=ce((p6,mE)=>{"use strict";mE.exports=EvalError});var _E=ce((d6,vE)=>{"use strict";vE.exports=RangeError});var EE=ce((g6,xE)=>{"use strict";xE.exports=ReferenceError});var c0=ce((m6,wE)=>{"use strict";wE.exports=SyntaxError});var ul=ce((y6,ME)=>{"use strict";ME.exports=TypeError});var bE=ce((v6,SE)=>{"use strict";SE.exports=URIError});var CE=ce((_6,AE)=>{"use strict";var TE=typeof Symbol!="undefined"&&Symbol,B3=l0();AE.exports=function(){return typeof TE!="function"||typeof Symbol!="function"||typeof TE("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:B3()}});var IE=ce((x6,PE)=>{"use strict";var f0={__proto__:null,foo:{}},z3=Object;PE.exports=function(){return{__proto__:f0}.foo===f0.foo&&!(f0 instanceof z3)}});var NE=ce((E6,LE)=>{"use strict";var G3="Function.prototype.bind called on incompatible ",k3=Object.prototype.toString,H3=Math.max,V3="[object Function]",RE=function(t,e){for(var o=[],a=0;a<t.length;a+=1)o[a]=t[a];for(var c=0;c<e.length;c+=1)o[c+t.length]=e[c];return o},W3=function(t,e){for(var o=[],a=e||0,c=0;a<t.length;a+=1,c+=1)o[c]=t[a];return o},q3=function(r,t){for(var e="",o=0;o<r.length;o+=1)e+=r[o],o+1<r.length&&(e+=t);return e};LE.exports=function(t){var e=this;if(typeof e!="function"||k3.apply(e)!==V3)throw new TypeError(G3+e);for(var o=W3(arguments,1),a,c=function(){if(this instanceof a){var _=e.apply(this,RE(o,arguments));return Object(_)===_?_:this}return e.apply(t,RE(o,arguments))},p=H3(0,e.length-o.length),d=[],g=0;g<p;g++)d[g]="$"+g;if(a=Function("binder","return function ("+q3(d,",")+"){ return binder.apply(this,arguments); }")(c),e.prototype){var y=function(){};y.prototype=e.prototype,a.prototype=new y,y.prototype=null}return a}});var Mp=ce((w6,OE)=>{"use strict";var X3=NE();OE.exports=Function.prototype.bind||X3});var FE=ce((M6,DE)=>{"use strict";var Y3=Function.prototype.call,$3=Object.prototype.hasOwnProperty,Z3=Mp();DE.exports=Z3.call(Y3,$3)});var mc=ce((S6,kE)=>{"use strict";var zn,J3=gE(),K3=yE(),Q3=_E(),j3=EE(),gc=c0(),dc=ul(),tF=bE(),GE=Function,h0=function(r){try{return GE('"use strict"; return ('+r+").constructor;")()}catch(t){}},ll=Object.getOwnPropertyDescriptor;if(ll)try{ll({},"")}catch(r){ll=null}var p0=function(){throw new dc},eF=ll?function(){try{return arguments.callee,p0}catch(r){try{return ll(arguments,"callee").get}catch(t){return p0}}}():p0,hc=CE()(),nF=IE()(),Di=Object.getPrototypeOf||(nF?function(r){return r.__proto__}:null),pc={},rF=typeof Uint8Array=="undefined"||!Di?zn:Di(Uint8Array),cl={__proto__:null,"%AggregateError%":typeof AggregateError=="undefined"?zn:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?zn:ArrayBuffer,"%ArrayIteratorPrototype%":hc&&Di?Di([][Symbol.iterator]()):zn,"%AsyncFromSyncIteratorPrototype%":zn,"%AsyncFunction%":pc,"%AsyncGenerator%":pc,"%AsyncGeneratorFunction%":pc,"%AsyncIteratorPrototype%":pc,"%Atomics%":typeof Atomics=="undefined"?zn:Atomics,"%BigInt%":typeof BigInt=="undefined"?zn:BigInt,"%BigInt64Array%":typeof BigInt64Array=="undefined"?zn:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array=="undefined"?zn:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?zn:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":J3,"%eval%":eval,"%EvalError%":K3,"%Float32Array%":typeof Float32Array=="undefined"?zn:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?zn:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?zn:FinalizationRegistry,"%Function%":GE,"%GeneratorFunction%":pc,"%Int8Array%":typeof Int8Array=="undefined"?zn:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?zn:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?zn:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":hc&&Di?Di(Di([][Symbol.iterator]())):zn,"%JSON%":typeof JSON=="object"?JSON:zn,"%Map%":typeof Map=="undefined"?zn:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!hc||!Di?zn:Di(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?zn:Promise,"%Proxy%":typeof Proxy=="undefined"?zn:Proxy,"%RangeError%":Q3,"%ReferenceError%":j3,"%Reflect%":typeof Reflect=="undefined"?zn:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?zn:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!hc||!Di?zn:Di(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?zn:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":hc&&Di?Di(""[Symbol.iterator]()):zn,"%Symbol%":hc?Symbol:zn,"%SyntaxError%":gc,"%ThrowTypeError%":eF,"%TypedArray%":rF,"%TypeError%":dc,"%Uint8Array%":typeof Uint8Array=="undefined"?zn:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?zn:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?zn:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?zn:Uint32Array,"%URIError%":tF,"%WeakMap%":typeof WeakMap=="undefined"?zn:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?zn:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?zn:WeakSet};if(Di)try{null.error}catch(r){UE=Di(Di(r)),cl["%Error.prototype%"]=UE}var UE,iF=function r(t){var e;if(t==="%AsyncFunction%")e=h0("async function () {}");else if(t==="%GeneratorFunction%")e=h0("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=h0("async function* () {}");else if(t==="%AsyncGenerator%"){var o=r("%AsyncGeneratorFunction%");o&&(e=o.prototype)}else if(t==="%AsyncIteratorPrototype%"){var a=r("%AsyncGenerator%");a&&Di&&(e=Di(a.prototype))}return cl[t]=e,e},BE={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},xf=Mp(),Sp=FE(),oF=xf.call(Function.call,Array.prototype.concat),sF=xf.call(Function.apply,Array.prototype.splice),zE=xf.call(Function.call,String.prototype.replace),bp=xf.call(Function.call,String.prototype.slice),aF=xf.call(Function.call,RegExp.prototype.exec),uF=/[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g,lF=/\\\\(\\\\)?/g,cF=function(t){var e=bp(t,0,1),o=bp(t,-1);if(e==="%"&&o!=="%")throw new gc("invalid intrinsic syntax, expected closing \`%\`");if(o==="%"&&e!=="%")throw new gc("invalid intrinsic syntax, expected opening \`%\`");var a=[];return zE(t,uF,function(c,p,d,g){a[a.length]=d?zE(g,lF,"$1"):p||c}),a},fF=function(t,e){var o=t,a;if(Sp(BE,o)&&(a=BE[o],o="%"+a[0]+"%"),Sp(cl,o)){var c=cl[o];if(c===pc&&(c=iF(o)),typeof c=="undefined"&&!e)throw new dc("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:a,name:o,value:c}}throw new gc("intrinsic "+t+" does not exist!")};kE.exports=function(t,e){if(typeof t!="string"||t.length===0)throw new dc("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new dc('"allowMissing" argument must be a boolean');if(aF(/^%?[^%]*%?$/,t)===null)throw new gc("\`%\` may not be present anywhere but at the beginning and end of the intrinsic name");var o=cF(t),a=o.length>0?o[0]:"",c=fF("%"+a+"%",e),p=c.name,d=c.value,g=!1,y=c.alias;y&&(a=y[0],sF(o,oF([0,1],y)));for(var _=1,w=!0;_<o.length;_+=1){var x=o[_],b=bp(x,0,1),P=bp(x,-1);if((b==='"'||b==="'"||b==="\`"||P==='"'||P==="'"||P==="\`")&&b!==P)throw new gc("property names with quotes must have matching quotes");if((x==="constructor"||!w)&&(g=!0),a+="."+x,p="%"+a+"%",Sp(cl,p))d=cl[p];else if(d!=null){if(!(x in d)){if(!e)throw new dc("base intrinsic for "+t+" exists, but the property is not available.");return}if(ll&&_+1>=o.length){var I=ll(d,x);w=!!I,w&&"get"in I&&!("originalValue"in I.get)?d=I.get:d=d[x]}else w=Sp(d,x),d=d[x];w&&!g&&(cl[p]=d)}}return d}});var Ap=ce((b6,HE)=>{"use strict";var hF=mc(),Tp=hF("%Object.defineProperty%",!0)||!1;if(Tp)try{Tp({},"a",{value:1})}catch(r){Tp=!1}HE.exports=Tp});var d0=ce((T6,VE)=>{"use strict";var pF=mc(),Cp=pF("%Object.getOwnPropertyDescriptor%",!0);if(Cp)try{Cp([],"length")}catch(r){Cp=null}VE.exports=Cp});var Pp=ce((A6,XE)=>{"use strict";var WE=Ap(),dF=c0(),yc=ul(),qE=d0();XE.exports=function(t,e,o){if(!t||typeof t!="object"&&typeof t!="function")throw new yc("\`obj\` must be an object or a function\`");if(typeof e!="string"&&typeof e!="symbol")throw new yc("\`property\` must be a string or a symbol\`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new yc("\`nonEnumerable\`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new yc("\`nonWritable\`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new yc("\`nonConfigurable\`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new yc("\`loose\`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,p=arguments.length>5?arguments[5]:null,d=arguments.length>6?arguments[6]:!1,g=!!qE&&qE(t,e);if(WE)WE(t,e,{configurable:p===null&&g?g.configurable:!p,enumerable:a===null&&g?g.enumerable:!a,value:o,writable:c===null&&g?g.writable:!c});else if(d||!a&&!c&&!p)t[e]=o;else throw new dF("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var Ip=ce((C6,$E)=>{"use strict";var g0=Ap(),YE=function(){return!!g0};YE.hasArrayLengthDefineBug=function(){if(!g0)return null;try{return g0([],"length",{value:1}).length!==1}catch(t){return!0}};$E.exports=YE});var jE=ce((P6,QE)=>{"use strict";var gF=mc(),ZE=Pp(),mF=Ip()(),JE=d0(),KE=ul(),yF=gF("%Math.floor%");QE.exports=function(t,e){if(typeof t!="function")throw new KE("\`fn\` is not a function");if(typeof e!="number"||e<0||e>4294967295||yF(e)!==e)throw new KE("\`length\` must be a positive 32-bit integer");var o=arguments.length>2&&!!arguments[2],a=!0,c=!0;if("length"in t&&JE){var p=JE(t,"length");p&&!p.configurable&&(a=!1),p&&!p.writable&&(c=!1)}return(a||c||!o)&&(mF?ZE(t,"length",e,!0,!0):ZE(t,"length",e)),t}});var Np=ce((I6,Rp)=>{"use strict";var m0=Mp(),Lp=mc(),vF=jE(),_F=ul(),nw=Lp("%Function.prototype.apply%"),rw=Lp("%Function.prototype.call%"),iw=Lp("%Reflect.apply%",!0)||m0.call(rw,nw),tw=Ap(),xF=Lp("%Math.max%");Rp.exports=function(t){if(typeof t!="function")throw new _F("a function is required");var e=iw(m0,rw,arguments);return vF(e,1+xF(0,t.length-(arguments.length-1)),!0)};var ew=function(){return iw(m0,nw,arguments)};tw?tw(Rp.exports,"apply",{value:ew}):Rp.exports.apply=ew});var y0=ce((R6,aw)=>{"use strict";var ow=mc(),sw=Np(),EF=sw(ow("String.prototype.indexOf"));aw.exports=function(t,e){var o=ow(t,!!e);return typeof o=="function"&&EF(t,".prototype.")>-1?sw(o):o}});var cw=ce((L6,lw)=>{"use strict";var wF=wp()(),MF=y0(),v0=MF("Object.prototype.toString"),Op=function(t){return wF&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:v0(t)==="[object Arguments]"},uw=function(t){return Op(t)?!0:t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&v0(t)!=="[object Array]"&&v0(t.callee)==="[object Function]"},SF=function(){return Op(arguments)}();Op.isLegacyArguments=uw;lw.exports=SF?Op:uw});var vc=ce((N6,dw)=>{"use strict";var bF=u0(),TF=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",AF=Object.prototype.toString,CF=Array.prototype.concat,fw=Pp(),PF=function(r){return typeof r=="function"&&AF.call(r)==="[object Function]"},hw=Ip()(),IF=function(r,t,e,o){if(t in r){if(o===!0){if(r[t]===e)return}else if(!PF(o)||!o())return}hw?fw(r,t,e,!0):fw(r,t,e)},pw=function(r,t){var e=arguments.length>2?arguments[2]:{},o=bF(t);TF&&(o=CF.call(o,Object.getOwnPropertySymbols(t)));for(var a=0;a<o.length;a+=1)IF(r,o[a],t[o[a]],e[o[a]])};pw.supportsDescriptors=!!hw;dw.exports=pw});var _0=ce((O6,mw)=>{"use strict";var gw=function(r){return r!==r};mw.exports=function(t,e){return t===0&&e===0?1/t===1/e:!!(t===e||gw(t)&&gw(e))}});var x0=ce((D6,yw)=>{"use strict";var RF=_0();yw.exports=function(){return typeof Object.is=="function"?Object.is:RF}});var _w=ce((F6,vw)=>{"use strict";var LF=x0(),NF=vc();vw.exports=function(){var t=LF();return NF(Object,{is:t},{is:function(){return Object.is!==t}}),t}});var Mw=ce((U6,ww)=>{"use strict";var OF=vc(),DF=Np(),FF=_0(),xw=x0(),UF=_w(),Ew=DF(xw(),Object);OF(Ew,{getPolyfill:xw,implementation:FF,shim:UF});ww.exports=Ew});var Cw=ce((B6,Aw)=>{"use strict";var E0=y0(),Sw=wp()(),bw,Tw,w0,M0;Sw&&(bw=E0("Object.prototype.hasOwnProperty"),Tw=E0("RegExp.prototype.exec"),w0={},Dp=function(){throw w0},M0={toString:Dp,valueOf:Dp},typeof Symbol.toPrimitive=="symbol"&&(M0[Symbol.toPrimitive]=Dp));var Dp,BF=E0("Object.prototype.toString"),zF=Object.getOwnPropertyDescriptor,GF="[object RegExp]";Aw.exports=Sw?function(t){if(!t||typeof t!="object")return!1;var e=zF(t,"lastIndex"),o=e&&bw(e,"value");if(!o)return!1;try{Tw(t,M0)}catch(a){return a===w0}}:function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:BF(t)===GF}});var Iw=ce((z6,Pw)=>{"use strict";var wf=function(){return typeof function(){}.name=="string"},Ef=Object.getOwnPropertyDescriptor;if(Ef)try{Ef([],"length")}catch(r){Ef=null}wf.functionsHaveConfigurableNames=function(){if(!wf()||!Ef)return!1;var t=Ef(function(){},"name");return!!t&&!!t.configurable};var kF=Function.prototype.bind;wf.boundFunctionsHaveNames=function(){return wf()&&typeof kF=="function"&&function(){}.bind().name!==""};Pw.exports=wf});var Nw=ce((G6,Lw)=>{"use strict";var Rw=Pp(),HF=Ip()(),VF=Iw().functionsHaveConfigurableNames(),WF=ul();Lw.exports=function(t,e){if(typeof t!="function")throw new WF("\`fn\` is not a function");var o=arguments.length>2&&!!arguments[2];return(!o||VF)&&(HF?Rw(t,"name",e,!0,!0):Rw(t,"name",e)),t}});var S0=ce((k6,Ow)=>{"use strict";var qF=Nw(),XF=ul(),YF=Object;Ow.exports=qF(function(){if(this==null||this!==YF(this))throw new XF("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t},"get flags",!0)});var b0=ce((H6,Dw)=>{"use strict";var $F=S0(),ZF=vc().supportsDescriptors,JF=Object.getOwnPropertyDescriptor;Dw.exports=function(){if(ZF&&/a/mig.flags==="gim"){var t=JF(RegExp.prototype,"flags");if(t&&typeof t.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var e="",o={};if(Object.defineProperty(o,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(o,"sticky",{get:function(){e+="y"}}),t.get.call(o),e==="dy")return t.get}}return $F}});var Bw=ce((V6,Uw)=>{"use strict";var KF=vc().supportsDescriptors,QF=b0(),jF=Object.getOwnPropertyDescriptor,tU=Object.defineProperty,eU=TypeError,Fw=Object.getPrototypeOf,nU=/a/;Uw.exports=function(){if(!KF||!Fw)throw new eU("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=QF(),e=Fw(nU),o=jF(e,"flags");return(!o||o.get!==t)&&tU(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}});var Hw=ce((W6,kw)=>{"use strict";var rU=vc(),iU=Np(),oU=S0(),zw=b0(),sU=Bw(),Gw=iU(zw());rU(Gw,{getPolyfill:zw,implementation:oU,shim:sU});kw.exports=Gw});var Ww=ce((q6,Vw)=>{"use strict";var aU=Date.prototype.getDay,uU=function(t){try{return aU.call(t),!0}catch(e){return!1}},lU=Object.prototype.toString,cU="[object Date]",fU=wp()();Vw.exports=function(t){return typeof t!="object"||t===null?!1:fU?uU(t):lU.call(t)===cU}});var T0=ce((X6,eM)=>{var qw=u0(),Xw=cw(),Yw=Mw(),$w=Cw(),Zw=Hw(),Jw=Ww(),Kw=Date.prototype.getTime;function tM(r,t,e){var o=e||{};return(o.strict?Yw(r,t):r===t)?!0:!r||!t||typeof r!="object"&&typeof t!="object"?o.strict?Yw(r,t):r==t:hU(r,t,o)}function Qw(r){return r==null}function jw(r){return!(!r||typeof r!="object"||typeof r.length!="number"||typeof r.copy!="function"||typeof r.slice!="function"||r.length>0&&typeof r[0]!="number")}function hU(r,t,e){var o,a;if(typeof r!=typeof t||Qw(r)||Qw(t)||r.prototype!==t.prototype||Xw(r)!==Xw(t))return!1;var c=$w(r),p=$w(t);if(c!==p)return!1;if(c||p)return r.source===t.source&&Zw(r)===Zw(t);if(Jw(r)&&Jw(t))return Kw.call(r)===Kw.call(t);var d=jw(r),g=jw(t);if(d!==g)return!1;if(d||g){if(r.length!==t.length)return!1;for(o=0;o<r.length;o++)if(r[o]!==t[o])return!1;return!0}if(typeof r!=typeof t)return!1;try{var y=qw(r),_=qw(t)}catch(w){return!1}if(y.length!==_.length)return!1;for(y.sort(),_.sort(),o=y.length-1;o>=0;o--)if(y[o]!=_[o])return!1;for(o=y.length-1;o>=0;o--)if(a=y[o],!tM(r[a],t[a],e))return!1;return!0}eM.exports=tM});var B0=ce((QW,uM)=>{var nB=T0(),ga=function(r){this.precision=r&&r.precision?r.precision:17,this.direction=r&&r.direction?r.direction:!1,this.pseudoNode=r&&r.pseudoNode?r.pseudoNode:!1,this.objectComparator=r&&r.objectComparator?r.objectComparator:rB};ga.prototype.compare=function(r,t){if(r.type!==t.type||!aM(r,t))return!1;switch(r.type){case"Point":return this.compareCoord(r.coordinates,t.coordinates);case"LineString":return this.compareLine(r.coordinates,t.coordinates,0,!1);case"Polygon":return this.comparePolygon(r,t);case"Feature":return this.compareFeature(r,t);default:if(r.type.indexOf("Multi")===0){var e=this,o=sM(r),a=sM(t);return o.every(function(c){return this.some(function(p){return e.compare(c,p)})},a)}}return!1};function sM(r){return r.coordinates.map(function(t){return{type:r.type.replace("Multi",""),coordinates:t}})}function aM(r,t){return r.hasOwnProperty("coordinates")?r.coordinates.length===t.coordinates.length:r.length===t.length}ga.prototype.compareCoord=function(r,t){if(r.length!==t.length)return!1;for(var e=0;e<r.length;e++)if(r[e].toFixed(this.precision)!==t[e].toFixed(this.precision))return!1;return!0};ga.prototype.compareLine=function(r,t,e,o){if(!aM(r,t))return!1;var a=this.pseudoNode?r:this.removePseudo(r),c=this.pseudoNode?t:this.removePseudo(t);if(!(o&&!this.compareCoord(a[0],c[0])&&(c=this.fixStartIndex(c,a),!c))){var p=this.compareCoord(a[e],c[e]);return this.direction||p?this.comparePath(a,c):this.compareCoord(a[e],c[c.length-(1+e)])?this.comparePath(a.slice().reverse(),c):!1}};ga.prototype.fixStartIndex=function(r,t){for(var e,o=-1,a=0;a<r.length;a++)if(this.compareCoord(r[a],t[0])){o=a;break}return o>=0&&(e=[].concat(r.slice(o,r.length),r.slice(1,o+1))),e};ga.prototype.comparePath=function(r,t){var e=this;return r.every(function(o,a){return e.compareCoord(o,this[a])},t)};ga.prototype.comparePolygon=function(r,t){if(this.compareLine(r.coordinates[0],t.coordinates[0],1,!0)){var e=r.coordinates.slice(1,r.coordinates.length),o=t.coordinates.slice(1,t.coordinates.length),a=this;return e.every(function(c){return this.some(function(p){return a.compareLine(c,p,1,!0)})},o)}else return!1};ga.prototype.compareFeature=function(r,t){return r.id!==t.id||!this.objectComparator(r.properties,t.properties)||!this.compareBBox(r,t)?!1:this.compare(r.geometry,t.geometry)};ga.prototype.compareBBox=function(r,t){return!!(!r.bbox&&!t.bbox||r.bbox&&t.bbox&&this.compareCoord(r.bbox,t.bbox))};ga.prototype.removePseudo=function(r){return r};function rB(r,t){return nB(r,t,{strict:!0})}uM.exports=ga});var lM=ce((cq,Bp)=>{function Pu(r,t,e,o){this.dataset=[],this.epsilon=1,this.minPts=2,this.distance=this._euclideanDistance,this.clusters=[],this.noise=[],this._visited=[],this._assigned=[],this._datasetLength=0,this._init(r,t,e,o)}Pu.prototype.run=function(r,t,e,o){this._init(r,t,e,o);for(var a=0;a<this._datasetLength;a++)if(this._visited[a]!==1){this._visited[a]=1;var c=this._regionQuery(a);if(c.length<this.minPts)this.noise.push(a);else{var p=this.clusters.length;this.clusters.push([]),this._addToCluster(a,p),this._expandCluster(p,c)}}return this.clusters};Pu.prototype._init=function(r,t,e,o){if(r){if(!(r instanceof Array))throw Error("Dataset must be of type array, "+typeof r+" given");this.dataset=r,this.clusters=[],this.noise=[],this._datasetLength=r.length,this._visited=new Array(this._datasetLength),this._assigned=new Array(this._datasetLength)}t&&(this.epsilon=t),e&&(this.minPts=e),o&&(this.distance=o)};Pu.prototype._expandCluster=function(r,t){for(var e=0;e<t.length;e++){var o=t[e];if(this._visited[o]!==1){this._visited[o]=1;var a=this._regionQuery(o);a.length>=this.minPts&&(t=this._mergeArrays(t,a))}this._assigned[o]!==1&&this._addToCluster(o,r)}};Pu.prototype._addToCluster=function(r,t){this.clusters[t].push(r),this._assigned[r]=1};Pu.prototype._regionQuery=function(r){for(var t=[],e=0;e<this._datasetLength;e++){var o=this.distance(this.dataset[r],this.dataset[e]);o<this.epsilon&&t.push(e)}return t};Pu.prototype._mergeArrays=function(r,t){for(var e=t.length,o=0;o<e;o++){var a=t[o];r.indexOf(a)<0&&r.push(a)}return r};Pu.prototype._euclideanDistance=function(r,t){for(var e=0,o=Math.min(r.length,t.length);o--;)e+=(r[o]-t[o])*(r[o]-t[o]);return Math.sqrt(e)};typeof Bp!="undefined"&&Bp.exports&&(Bp.exports=Pu)});var cM=ce((fq,zp)=>{function Iu(r,t,e){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(r,t,e)}Iu.prototype.init=function(r,t,e){this.assignments=[],this.centroids=[],typeof r!="undefined"&&(this.dataset=r),typeof t!="undefined"&&(this.k=t),typeof e!="undefined"&&(this.distance=e)};Iu.prototype.run=function(r,t){this.init(r,t);for(var e=this.dataset.length,o=0;o<this.k;o++)this.centroids[o]=this.randomCentroid();for(var a=!0;a;){a=this.assign();for(var c=0;c<this.k;c++){for(var p=new Array(_),d=0,g=0;g<_;g++)p[g]=0;for(var y=0;y<e;y++){var _=this.dataset[y].length;if(c===this.assignments[y]){for(var g=0;g<_;g++)p[g]+=this.dataset[y][g];d++}}if(d>0){for(var g=0;g<_;g++)p[g]/=d;this.centroids[c]=p}else this.centroids[c]=this.randomCentroid(),a=!0}}return this.getClusters()};Iu.prototype.randomCentroid=function(){var r=this.dataset.length-1,t,e;do e=Math.round(Math.random()*r),t=this.dataset[e];while(this.centroids.indexOf(t)>=0);return t};Iu.prototype.assign=function(){for(var r=!1,t=this.dataset.length,e,o=0;o<t;o++)e=this.argmin(this.dataset[o],this.centroids,this.distance),e!=this.assignments[o]&&(this.assignments[o]=e,r=!0);return r};Iu.prototype.getClusters=function(){for(var r=new Array(this.k),t,e=0;e<this.assignments.length;e++)t=this.assignments[e],typeof r[t]=="undefined"&&(r[t]=[]),r[t].push(e);return r};Iu.prototype.argmin=function(r,t,e){for(var o=Number.MAX_VALUE,a=0,c=t.length,p,d=0;d<c;d++)p=e(r,t[d]),p<o&&(o=p,a=d);return a};Iu.prototype.distance=function(r,t){for(var e=0,o=Math.min(r.length,t.length);o--;){var a=r[o]-t[o];e+=a*a}return Math.sqrt(e)};typeof zp!="undefined"&&zp.exports&&(zp.exports=Iu)});var z0=ce((hq,Gp)=>{function ma(r,t,e){this._queue=[],this._priorities=[],this._sorting="desc",this._init(r,t,e)}ma.prototype.insert=function(r,t){for(var e=this._queue.length,o=e;o--;){var a=this._priorities[o];this._sorting==="desc"?t>a&&(e=o):t<a&&(e=o)}this._insertAt(r,t,e)};ma.prototype.remove=function(r){for(var t=this._queue.length;t--;){var e=this._queue[t];if(r===e){this._queue.splice(t,1),this._priorities.splice(t,1);break}}};ma.prototype.forEach=function(r){this._queue.forEach(r)};ma.prototype.getElements=function(){return this._queue};ma.prototype.getElementPriority=function(r){return this._priorities[r]};ma.prototype.getPriorities=function(){return this._priorities};ma.prototype.getElementsWithPriorities=function(){for(var r=[],t=0,e=this._queue.length;t<e;t++)r.push([this._queue[t],this._priorities[t]]);return r};ma.prototype._init=function(r,t,e){if(r&&t){if(this._queue=[],this._priorities=[],r.length!==t.length)throw new Error("Arrays must have the same length");for(var o=0;o<r.length;o++)this.insert(r[o],t[o])}e&&(this._sorting=e)};ma.prototype._insertAt=function(r,t,e){this._queue.length===e?(this._queue.push(r),this._priorities.push(t)):(this._queue.splice(e,0,r),this._priorities.splice(e,0,t))};typeof Gp!="undefined"&&Gp.exports&&(Gp.exports=ma)});var hM=ce((pq,xc)=>{typeof xc!="undefined"&&xc.exports&&(fM=z0());var fM;function Ja(r,t,e,o){this.epsilon=1,this.minPts=1,this.distance=this._euclideanDistance,this._reachability=[],this._processed=[],this._coreDistance=0,this._orderedList=[],this._init(r,t,e,o)}Ja.prototype.run=function(r,t,e,o){this._init(r,t,e,o);for(var a=0,c=this.dataset.length;a<c;a++)if(this._processed[a]!==1){this._processed[a]=1,this.clusters.push([a]);var p=this.clusters.length-1;this._orderedList.push(a);var d=new fM(null,null,"asc"),g=this._regionQuery(a);this._distanceToCore(a)!==void 0&&(this._updateQueue(a,g,d),this._expandCluster(p,d))}return this.clusters};Ja.prototype.getReachabilityPlot=function(){for(var r=[],t=0,e=this._orderedList.length;t<e;t++){var o=this._orderedList[t],a=this._reachability[o];r.push([o,a])}return r};Ja.prototype._init=function(r,t,e,o){if(r){if(!(r instanceof Array))throw Error("Dataset must be of type array, "+typeof r+" given");this.dataset=r,this.clusters=[],this._reachability=new Array(this.dataset.length),this._processed=new Array(this.dataset.length),this._coreDistance=0,this._orderedList=[]}t&&(this.epsilon=t),e&&(this.minPts=e),o&&(this.distance=o)};Ja.prototype._updateQueue=function(r,t,e){var o=this;this._coreDistance=this._distanceToCore(r),t.forEach(function(a){if(o._processed[a]===void 0){var c=o.distance(o.dataset[r],o.dataset[a]),p=Math.max(o._coreDistance,c);o._reachability[a]===void 0?(o._reachability[a]=p,e.insert(a,p)):p<o._reachability[a]&&(o._reachability[a]=p,e.remove(a),e.insert(a,p))}})};Ja.prototype._expandCluster=function(r,t){for(var e=t.getElements(),o=0,a=e.length;o<a;o++){var c=e[o];if(this._processed[c]===void 0){var p=this._regionQuery(c);this._processed[c]=1,this.clusters[r].push(c),this._orderedList.push(c),this._distanceToCore(c)!==void 0&&(this._updateQueue(c,p,t),this._expandCluster(r,t))}}};Ja.prototype._distanceToCore=function(r){for(var t=this.epsilon,e=0;e<t;e++){var o=this._regionQuery(r,e);if(o.length>=this.minPts)return e}};Ja.prototype._regionQuery=function(r,t){t=t||this.epsilon;for(var e=[],o=0,a=this.dataset.length;o<a;o++)this.distance(this.dataset[r],this.dataset[o])<t&&e.push(o);return e};Ja.prototype._euclideanDistance=function(r,t){for(var e=0,o=Math.min(r.length,t.length);o--;)e+=(r[o]-t[o])*(r[o]-t[o]);return Math.sqrt(e)};typeof xc!="undefined"&&xc.exports&&(xc.exports=Ja)});var pM=ce((dq,kp)=>{typeof kp!="undefined"&&kp.exports&&(kp.exports={DBSCAN:lM(),KMEANS:cM(),OPTICS:hM(),PriorityQueue:z0()})});var G0=ce((xq,gM)=>{"use strict";gM.exports={eudist:function(t,e,o){for(var a=t.length,c=0,p=0;p<a;p++){var d=(t[p]||0)-(e[p]||0);c+=d*d}return o?Math.sqrt(c):c},mandist:function(t,e,o){for(var a=t.length,c=0,p=0;p<a;p++)c+=Math.abs((t[p]||0)-(e[p]||0));return o?Math.sqrt(c):c},dist:function(t,e,o){var a=Math.abs(t-e);return o?a:a*a}}});var vM=ce((Eq,yM)=>{"use strict";var mM=G0(),lB=mM.eudist,cB=mM.dist;yM.exports={kmrand:function(t,e){for(var o={},a=[],c=e<<2,p=t.length,d=t[0].length>0;a.length<e&&c-- >0;){var g=t[Math.floor(Math.random()*p)],y=d?g.join("_"):""+g;o[y]||(o[y]=!0,a.push(g))}if(a.length<e)throw new Error("Error initializating clusters");return a},kmpp:function(t,e){var o=t[0].length?lB:cB,a=[],c=t.length,p=t[0].length>0,d={},g=t[Math.floor(Math.random()*c)],y=p?g.join("_"):""+g;for(a.push(g),d[y]=!0;a.length<e;){for(var _=[],w=a.length,x=0,b=[],P=0;P<c;P++){for(var I=1/0,M=0;M<w;M++){var E=o(t[P],a[M]);E<=I&&(I=E)}_[P]=I}for(var N=0;N<c;N++)x+=_[N];for(var A=0;A<c;A++)b[A]={i:A,v:t[A],pr:_[A]/x,cs:0};b.sort(function(q,D){return q.pr-D.pr}),b[0].cs=b[0].pr;for(var U=1;U<c;U++)b[U].cs=b[U-1].cs+b[U].pr;for(var z=Math.random(),$=0;$<c-1&&b[$++].cs<z;);a.push(b[$-1].v)}return a}}});var MM=ce((Sq,wM)=>{"use strict";var k0=G0(),EM=vM(),fB=k0.eudist,wq=k0.mandist,Mq=k0.dist,hB=EM.kmrand,pB=EM.kmpp,_M=1e4;function xM(r,t,e){e=e||[];for(var o=0;o<r;o++)e[o]=t;return e}function dB(r,t,e,o){var a=[],c=[],p=[],d=[],g=!1,y=o||_M,_=r.length,w=r[0].length,x=w>0,b=[];if(e)e=="kmrand"?a=hB(r,t):e=="kmpp"?a=pB(r,t):a=e;else for(var P={};a.length<t;){var I=Math.floor(Math.random()*_);P[I]||(P[I]=!0,a.push(r[I]))}do{xM(t,0,b);for(var M=0;M<_;M++){for(var E=1/0,N=0,A=0;A<t;A++){var d=x?fB(r[M],a[A]):Math.abs(r[M]-a[A]);d<=E&&(E=d,N=A)}p[M]=N,b[N]++}for(var U=[],c=[],z=0,$=0;$<t;$++)U[$]=x?xM(w,0,U[$]):0,c[$]=a[$];if(x){for(var q=0;q<t;q++)a[q]=[];for(var D=0;D<_;D++)for(var G=p[D],Q=U[G],_t=r[D],Z=0;Z<w;Z++)Q[Z]+=_t[Z];g=!0;for(var Dt=0;Dt<t;Dt++){for(var et=a[Dt],vt=U[Dt],It=c[Dt],Pt=b[Dt],Et=0;Et<w;Et++)et[Et]=vt[Et]/Pt||0;if(g){for(var yt=0;yt<w;yt++)if(It[yt]!=et[yt]){g=!1;break}}}}else{for(var Y=0;Y<_;Y++){var ht=p[Y];U[ht]+=r[Y]}for(var Mt=0;Mt<t;Mt++)a[Mt]=U[Mt]/b[Mt]||0;g=!0;for(var zt=0;zt<t;zt++)if(c[zt]!=a[zt]){g=!1;break}}g=g||--y<=0}while(!g);return{it:_M-y,k:t,idxs:p,centroids:a}}wM.exports=dB});var bc=ce((Y0,$0)=>{(function(r,t){typeof Y0=="object"&&typeof $0!="undefined"?$0.exports=t():typeof define=="function"&&define.amd?define(t):(r=typeof globalThis!="undefined"?globalThis:r||self,r.polygonClipping=t())})(Y0,function(){"use strict";function r(tt,C){var L={label:0,sent:function(){if(X[0]&1)throw X[1];return X[1]},trys:[],ops:[]},F,J,X,pt;return pt={next:st(0),throw:st(1),return:st(2)},typeof Symbol=="function"&&(pt[Symbol.iterator]=function(){return this}),pt;function st(ut){return function(nt){return k([ut,nt])}}function k(ut){if(F)throw new TypeError("Generator is already executing.");for(;L;)try{if(F=1,J&&(X=ut[0]&2?J.return:ut[0]?J.throw||((X=J.return)&&X.call(J),0):J.next)&&!(X=X.call(J,ut[1])).done)return X;switch(J=0,X&&(ut=[ut[0]&2,X.value]),ut[0]){case 0:case 1:X=ut;break;case 4:return L.label++,{value:ut[1],done:!1};case 5:L.label++,J=ut[1],ut=[0];continue;case 7:ut=L.ops.pop(),L.trys.pop();continue;default:if(X=L.trys,!(X=X.length>0&&X[X.length-1])&&(ut[0]===6||ut[0]===2)){L=0;continue}if(ut[0]===3&&(!X||ut[1]>X[0]&&ut[1]<X[3])){L.label=ut[1];break}if(ut[0]===6&&L.label<X[1]){L.label=X[1],X=ut;break}if(X&&L.label<X[2]){L.label=X[2],L.ops.push(ut);break}X[2]&&L.ops.pop(),L.trys.pop();continue}ut=C.call(tt,L)}catch(nt){ut=[6,nt],J=0}finally{F=X=0}if(ut[0]&5)throw ut[1];return{value:ut[0]?ut[1]:void 0,done:!0}}}var t=function(){function tt(C,L){this.next=null,this.key=C,this.data=L,this.left=null,this.right=null}return tt}();function e(tt,C){return tt>C?1:tt<C?-1:0}function o(tt,C,L){for(var F=new t(null,null),J=F,X=F;;){var pt=L(tt,C.key);if(pt<0){if(C.left===null)break;if(L(tt,C.left.key)<0){var st=C.left;if(C.left=st.right,st.right=C,C=st,C.left===null)break}X.left=C,X=C,C=C.left}else if(pt>0){if(C.right===null)break;if(L(tt,C.right.key)>0){var st=C.right;if(C.right=st.left,st.left=C,C=st,C.right===null)break}J.right=C,J=C,C=C.right}else break}return J.right=C.left,X.left=C.right,C.left=F.right,C.right=F.left,C}function a(tt,C,L,F){var J=new t(tt,C);if(L===null)return J.left=J.right=null,J;L=o(tt,L,F);var X=F(tt,L.key);return X<0?(J.left=L.left,J.right=L,L.left=null):X>=0&&(J.right=L.right,J.left=L,L.right=null),J}function c(tt,C,L){var F=null,J=null;if(C){C=o(tt,C,L);var X=L(C.key,tt);X===0?(F=C.left,J=C.right):X<0?(J=C.right,C.right=null,F=C):(F=C.left,C.left=null,J=C)}return{left:F,right:J}}function p(tt,C,L){return C===null?tt:(tt===null||(C=o(tt.key,C,L),C.left=tt),C)}function d(tt,C,L,F,J){if(tt){F(""+C+(L?"\\u2514\\u2500\\u2500 ":"\\u251C\\u2500\\u2500 ")+J(tt)+\`
|
|
106
106
|
\`);var X=C+(L?" ":"\\u2502 ");tt.left&&d(tt.left,X,!1,F,J),tt.right&&d(tt.right,X,!0,F,J)}}var g=function(){function tt(C){C===void 0&&(C=e),this._root=null,this._size=0,this._comparator=C}return tt.prototype.insert=function(C,L){return this._size++,this._root=a(C,L,this._root,this._comparator)},tt.prototype.add=function(C,L){var F=new t(C,L);this._root===null&&(F.left=F.right=null,this._size++,this._root=F);var J=this._comparator,X=o(C,this._root,J),pt=J(C,X.key);return pt===0?this._root=X:(pt<0?(F.left=X.left,F.right=X,X.left=null):pt>0&&(F.right=X.right,F.left=X,X.right=null),this._size++,this._root=F),this._root},tt.prototype.remove=function(C){this._root=this._remove(C,this._root,this._comparator)},tt.prototype._remove=function(C,L,F){var J;if(L===null)return null;L=o(C,L,F);var X=F(C,L.key);return X===0?(L.left===null?J=L.right:(J=o(C,L.left,F),J.right=L.right),this._size--,J):L},tt.prototype.pop=function(){var C=this._root;if(C){for(;C.left;)C=C.left;return this._root=o(C.key,this._root,this._comparator),this._root=this._remove(C.key,this._root,this._comparator),{key:C.key,data:C.data}}return null},tt.prototype.findStatic=function(C){for(var L=this._root,F=this._comparator;L;){var J=F(C,L.key);if(J===0)return L;J<0?L=L.left:L=L.right}return null},tt.prototype.find=function(C){return this._root&&(this._root=o(C,this._root,this._comparator),this._comparator(C,this._root.key)!==0)?null:this._root},tt.prototype.contains=function(C){for(var L=this._root,F=this._comparator;L;){var J=F(C,L.key);if(J===0)return!0;J<0?L=L.left:L=L.right}return!1},tt.prototype.forEach=function(C,L){for(var F=this._root,J=[],X=!1;!X;)F!==null?(J.push(F),F=F.left):J.length!==0?(F=J.pop(),C.call(L,F),F=F.right):X=!0;return this},tt.prototype.range=function(C,L,F,J){for(var X=[],pt=this._comparator,st=this._root,k;X.length!==0||st;)if(st)X.push(st),st=st.left;else{if(st=X.pop(),k=pt(st.key,L),k>0)break;if(pt(st.key,C)>=0&&F.call(J,st))return this;st=st.right}return this},tt.prototype.keys=function(){var C=[];return this.forEach(function(L){var F=L.key;return C.push(F)}),C},tt.prototype.values=function(){var C=[];return this.forEach(function(L){var F=L.data;return C.push(F)}),C},tt.prototype.min=function(){return this._root?this.minNode(this._root).key:null},tt.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},tt.prototype.minNode=function(C){if(C===void 0&&(C=this._root),C)for(;C.left;)C=C.left;return C},tt.prototype.maxNode=function(C){if(C===void 0&&(C=this._root),C)for(;C.right;)C=C.right;return C},tt.prototype.at=function(C){for(var L=this._root,F=!1,J=0,X=[];!F;)if(L)X.push(L),L=L.left;else if(X.length>0){if(L=X.pop(),J===C)return L;J++,L=L.right}else F=!0;return null},tt.prototype.next=function(C){var L=this._root,F=null;if(C.right){for(F=C.right;F.left;)F=F.left;return F}for(var J=this._comparator;L;){var X=J(C.key,L.key);if(X===0)break;X<0?(F=L,L=L.left):L=L.right}return F},tt.prototype.prev=function(C){var L=this._root,F=null;if(C.left!==null){for(F=C.left;F.right;)F=F.right;return F}for(var J=this._comparator;L;){var X=J(C.key,L.key);if(X===0)break;X<0?L=L.left:(F=L,L=L.right)}return F},tt.prototype.clear=function(){return this._root=null,this._size=0,this},tt.prototype.toList=function(){return w(this._root)},tt.prototype.load=function(C,L,F){L===void 0&&(L=[]),F===void 0&&(F=!1);var J=C.length,X=this._comparator;if(F&&P(C,L,0,J-1,X),this._root===null)this._root=y(C,L,0,J),this._size=J;else{var pt=b(this.toList(),_(C,L),X);J=this._size+J,this._root=x({head:pt},0,J)}return this},tt.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(tt.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(tt.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),tt.prototype.toString=function(C){C===void 0&&(C=function(F){return String(F.key)});var L=[];return d(this._root,"",!0,function(F){return L.push(F)},C),L.join("")},tt.prototype.update=function(C,L,F){var J=this._comparator,X=c(C,this._root,J),pt=X.left,st=X.right;J(C,L)<0?st=a(L,F,st,J):pt=a(L,F,pt,J),this._root=p(pt,st,J)},tt.prototype.split=function(C){return c(C,this._root,this._comparator)},tt.prototype[Symbol.iterator]=function(){var C,L,F;return r(this,function(J){switch(J.label){case 0:C=this._root,L=[],F=!1,J.label=1;case 1:return F?[3,6]:C===null?[3,2]:(L.push(C),C=C.left,[3,5]);case 2:return L.length===0?[3,4]:(C=L.pop(),[4,C]);case 3:return J.sent(),C=C.right,[3,5];case 4:F=!0,J.label=5;case 5:return[3,1];case 6:return[2]}})},tt}();function y(tt,C,L,F){var J=F-L;if(J>0){var X=L+Math.floor(J/2),pt=tt[X],st=C[X],k=new t(pt,st);return k.left=y(tt,C,L,X),k.right=y(tt,C,X+1,F),k}return null}function _(tt,C){for(var L=new t(null,null),F=L,J=0;J<tt.length;J++)F=F.next=new t(tt[J],C[J]);return F.next=null,L.next}function w(tt){for(var C=tt,L=[],F=!1,J=new t(null,null),X=J;!F;)C?(L.push(C),C=C.left):L.length>0?(C=X=X.next=L.pop(),C=C.right):F=!0;return X.next=null,J.next}function x(tt,C,L){var F=L-C;if(F>0){var J=C+Math.floor(F/2),X=x(tt,C,J),pt=tt.head;return pt.left=X,tt.head=tt.head.next,pt.right=x(tt,J+1,L),pt}return null}function b(tt,C,L){for(var F=new t(null,null),J=F,X=tt,pt=C;X!==null&&pt!==null;)L(X.key,pt.key)<0?(J.next=X,X=X.next):(J.next=pt,pt=pt.next),J=J.next;return X!==null?J.next=X:pt!==null&&(J.next=pt),F.next}function P(tt,C,L,F,J){if(!(L>=F)){for(var X=tt[L+F>>1],pt=L-1,st=F+1;;){do pt++;while(J(tt[pt],X)<0);do st--;while(J(tt[st],X)>0);if(pt>=st)break;var k=tt[pt];tt[pt]=tt[st],tt[st]=k,k=C[pt],C[pt]=C[st],C[st]=k}P(tt,C,L,st,J),P(tt,C,st+1,F,J)}}let I=(tt,C)=>tt.ll.x<=C.x&&C.x<=tt.ur.x&&tt.ll.y<=C.y&&C.y<=tt.ur.y,M=(tt,C)=>{if(C.ur.x<tt.ll.x||tt.ur.x<C.ll.x||C.ur.y<tt.ll.y||tt.ur.y<C.ll.y)return null;let L=tt.ll.x<C.ll.x?C.ll.x:tt.ll.x,F=tt.ur.x<C.ur.x?tt.ur.x:C.ur.x,J=tt.ll.y<C.ll.y?C.ll.y:tt.ll.y,X=tt.ur.y<C.ur.y?tt.ur.y:C.ur.y;return{ll:{x:L,y:J},ur:{x:F,y:X}}},E=Number.EPSILON;E===void 0&&(E=Math.pow(2,-52));let N=E*E,A=(tt,C)=>{if(-E<tt&&tt<E&&-E<C&&C<E)return 0;let L=tt-C;return L*L<N*tt*C?0:tt<C?-1:1};class U{constructor(){this.reset()}reset(){this.xRounder=new z,this.yRounder=new z}round(C,L){return{x:this.xRounder.round(C),y:this.yRounder.round(L)}}}class z{constructor(){this.tree=new g,this.round(0)}round(C){let L=this.tree.add(C),F=this.tree.prev(L);if(F!==null&&A(L.key,F.key)===0)return this.tree.remove(C),F.key;let J=this.tree.next(L);return J!==null&&A(L.key,J.key)===0?(this.tree.remove(C),J.key):C}}let $=new U,q=11102230246251565e-32,D=134217729,G=(3+8*q)*q;function Q(tt,C,L,F,J){let X,pt,st,k,ut=C[0],nt=F[0],lt=0,dt=0;nt>ut==nt>-ut?(X=ut,ut=C[++lt]):(X=nt,nt=F[++dt]);let at=0;if(lt<tt&&dt<L)for(nt>ut==nt>-ut?(pt=ut+X,st=X-(pt-ut),ut=C[++lt]):(pt=nt+X,st=X-(pt-nt),nt=F[++dt]),X=pt,st!==0&&(J[at++]=st);lt<tt&&dt<L;)nt>ut==nt>-ut?(pt=X+ut,k=pt-X,st=X-(pt-k)+(ut-k),ut=C[++lt]):(pt=X+nt,k=pt-X,st=X-(pt-k)+(nt-k),nt=F[++dt]),X=pt,st!==0&&(J[at++]=st);for(;lt<tt;)pt=X+ut,k=pt-X,st=X-(pt-k)+(ut-k),ut=C[++lt],X=pt,st!==0&&(J[at++]=st);for(;dt<L;)pt=X+nt,k=pt-X,st=X-(pt-k)+(nt-k),nt=F[++dt],X=pt,st!==0&&(J[at++]=st);return(X!==0||at===0)&&(J[at++]=X),at}function _t(tt,C){let L=C[0];for(let F=1;F<tt;F++)L+=C[F];return L}function Z(tt){return new Float64Array(tt)}let Dt=(3+16*q)*q,et=(2+12*q)*q,vt=(9+64*q)*q*q,It=Z(4),Pt=Z(8),Et=Z(12),yt=Z(16),Y=Z(4);function ht(tt,C,L,F,J,X,pt){let st,k,ut,nt,lt,dt,at,Bt,qt,we,oe,Ve,je,ur,Qn,wr,Rr,er,Me=tt-J,nr=L-J,hr=C-X,lr=F-X;ur=Me*lr,dt=D*Me,at=dt-(dt-Me),Bt=Me-at,dt=D*lr,qt=dt-(dt-lr),we=lr-qt,Qn=Bt*we-(ur-at*qt-Bt*qt-at*we),wr=hr*nr,dt=D*hr,at=dt-(dt-hr),Bt=hr-at,dt=D*nr,qt=dt-(dt-nr),we=nr-qt,Rr=Bt*we-(wr-at*qt-Bt*qt-at*we),oe=Qn-Rr,lt=Qn-oe,It[0]=Qn-(oe+lt)+(lt-Rr),Ve=ur+oe,lt=Ve-ur,je=ur-(Ve-lt)+(oe-lt),oe=je-wr,lt=je-oe,It[1]=je-(oe+lt)+(lt-wr),er=Ve+oe,lt=er-Ve,It[2]=Ve-(er-lt)+(oe-lt),It[3]=er;let Zn=_t(4,It),K=et*pt;if(Zn>=K||-Zn>=K||(lt=tt-Me,st=tt-(Me+lt)+(lt-J),lt=L-nr,ut=L-(nr+lt)+(lt-J),lt=C-hr,k=C-(hr+lt)+(lt-X),lt=F-lr,nt=F-(lr+lt)+(lt-X),st===0&&k===0&&ut===0&&nt===0)||(K=vt*pt+G*Math.abs(Zn),Zn+=Me*nt+lr*st-(hr*ut+nr*k),Zn>=K||-Zn>=K))return Zn;ur=st*lr,dt=D*st,at=dt-(dt-st),Bt=st-at,dt=D*lr,qt=dt-(dt-lr),we=lr-qt,Qn=Bt*we-(ur-at*qt-Bt*qt-at*we),wr=k*nr,dt=D*k,at=dt-(dt-k),Bt=k-at,dt=D*nr,qt=dt-(dt-nr),we=nr-qt,Rr=Bt*we-(wr-at*qt-Bt*qt-at*we),oe=Qn-Rr,lt=Qn-oe,Y[0]=Qn-(oe+lt)+(lt-Rr),Ve=ur+oe,lt=Ve-ur,je=ur-(Ve-lt)+(oe-lt),oe=je-wr,lt=je-oe,Y[1]=je-(oe+lt)+(lt-wr),er=Ve+oe,lt=er-Ve,Y[2]=Ve-(er-lt)+(oe-lt),Y[3]=er;let xt=Q(4,It,4,Y,Pt);ur=Me*nt,dt=D*Me,at=dt-(dt-Me),Bt=Me-at,dt=D*nt,qt=dt-(dt-nt),we=nt-qt,Qn=Bt*we-(ur-at*qt-Bt*qt-at*we),wr=hr*ut,dt=D*hr,at=dt-(dt-hr),Bt=hr-at,dt=D*ut,qt=dt-(dt-ut),we=ut-qt,Rr=Bt*we-(wr-at*qt-Bt*qt-at*we),oe=Qn-Rr,lt=Qn-oe,Y[0]=Qn-(oe+lt)+(lt-Rr),Ve=ur+oe,lt=Ve-ur,je=ur-(Ve-lt)+(oe-lt),oe=je-wr,lt=je-oe,Y[1]=je-(oe+lt)+(lt-wr),er=Ve+oe,lt=er-Ve,Y[2]=Ve-(er-lt)+(oe-lt),Y[3]=er;let Lt=Q(xt,Pt,4,Y,Et);ur=st*nt,dt=D*st,at=dt-(dt-st),Bt=st-at,dt=D*nt,qt=dt-(dt-nt),we=nt-qt,Qn=Bt*we-(ur-at*qt-Bt*qt-at*we),wr=k*ut,dt=D*k,at=dt-(dt-k),Bt=k-at,dt=D*ut,qt=dt-(dt-ut),we=ut-qt,Rr=Bt*we-(wr-at*qt-Bt*qt-at*we),oe=Qn-Rr,lt=Qn-oe,Y[0]=Qn-(oe+lt)+(lt-Rr),Ve=ur+oe,lt=Ve-ur,je=ur-(Ve-lt)+(oe-lt),oe=je-wr,lt=je-oe,Y[1]=je-(oe+lt)+(lt-wr),er=Ve+oe,lt=er-Ve,Y[2]=Ve-(er-lt)+(oe-lt),Y[3]=er;let wt=Q(Lt,Et,4,Y,yt);return yt[wt-1]}function Mt(tt,C,L,F,J,X){let pt=(C-X)*(L-J),st=(tt-J)*(F-X),k=pt-st,ut=Math.abs(pt+st);return Math.abs(k)>=Dt*ut?k:-ht(tt,C,L,F,J,X,ut)}let zt=(tt,C)=>tt.x*C.y-tt.y*C.x,At=(tt,C)=>tt.x*C.x+tt.y*C.y,$t=(tt,C,L)=>{let F=Mt(tt.x,tt.y,C.x,C.y,L.x,L.y);return F>0?-1:F<0?1:0},ue=tt=>Math.sqrt(At(tt,tt)),le=(tt,C,L)=>{let F={x:C.x-tt.x,y:C.y-tt.y},J={x:L.x-tt.x,y:L.y-tt.y};return zt(J,F)/ue(J)/ue(F)},Qt=(tt,C,L)=>{let F={x:C.x-tt.x,y:C.y-tt.y},J={x:L.x-tt.x,y:L.y-tt.y};return At(J,F)/ue(J)/ue(F)},me=(tt,C,L)=>C.y===0?null:{x:tt.x+C.x/C.y*(L-tt.y),y:L},Xt=(tt,C,L)=>C.x===0?null:{x:L,y:tt.y+C.y/C.x*(L-tt.x)},Ee=(tt,C,L,F)=>{if(C.x===0)return Xt(L,F,tt.x);if(F.x===0)return Xt(tt,C,L.x);if(C.y===0)return me(L,F,tt.y);if(F.y===0)return me(tt,C,L.y);let J=zt(C,F);if(J==0)return null;let X={x:L.x-tt.x,y:L.y-tt.y},pt=zt(X,C)/J,st=zt(X,F)/J,k=tt.x+st*C.x,ut=L.x+pt*F.x,nt=tt.y+st*C.y,lt=L.y+pt*F.y,dt=(k+ut)/2,at=(nt+lt)/2;return{x:dt,y:at}};class ft{static compare(C,L){let F=ft.comparePoints(C.point,L.point);return F!==0?F:(C.point!==L.point&&C.link(L),C.isLeft!==L.isLeft?C.isLeft?1:-1:te.compare(C.segment,L.segment))}static comparePoints(C,L){return C.x<L.x?-1:C.x>L.x?1:C.y<L.y?-1:C.y>L.y?1:0}constructor(C,L){C.events===void 0?C.events=[this]:C.events.push(this),this.point=C,this.isLeft=L}link(C){if(C.point===this.point)throw new Error("Tried to link already linked events");let L=C.point.events;for(let F=0,J=L.length;F<J;F++){let X=L[F];this.point.events.push(X),X.point=this.point}this.checkForConsuming()}checkForConsuming(){let C=this.point.events.length;for(let L=0;L<C;L++){let F=this.point.events[L];if(F.segment.consumedBy===void 0)for(let J=L+1;J<C;J++){let X=this.point.events[J];X.consumedBy===void 0&&F.otherSE.point.events===X.otherSE.point.events&&F.segment.consume(X.segment)}}}getAvailableLinkedEvents(){let C=[];for(let L=0,F=this.point.events.length;L<F;L++){let J=this.point.events[L];J!==this&&!J.segment.ringOut&&J.segment.isInResult()&&C.push(J)}return C}getLeftmostComparator(C){let L=new Map,F=J=>{let X=J.otherSE;L.set(J,{sine:le(this.point,C.point,X.point),cosine:Qt(this.point,C.point,X.point)})};return(J,X)=>{L.has(J)||F(J),L.has(X)||F(X);let{sine:pt,cosine:st}=L.get(J),{sine:k,cosine:ut}=L.get(X);return pt>=0&&k>=0?st<ut?1:st>ut?-1:0:pt<0&&k<0?st<ut?-1:st>ut?1:0:k<pt?-1:k>pt?1:0}}}let He=0;class te{static compare(C,L){let F=C.leftSE.point.x,J=L.leftSE.point.x,X=C.rightSE.point.x,pt=L.rightSE.point.x;if(pt<F)return 1;if(X<J)return-1;let st=C.leftSE.point.y,k=L.leftSE.point.y,ut=C.rightSE.point.y,nt=L.rightSE.point.y;if(F<J){if(k<st&&k<ut)return 1;if(k>st&&k>ut)return-1;let lt=C.comparePoint(L.leftSE.point);if(lt<0)return 1;if(lt>0)return-1;let dt=L.comparePoint(C.rightSE.point);return dt!==0?dt:-1}if(F>J){if(st<k&&st<nt)return-1;if(st>k&&st>nt)return 1;let lt=L.comparePoint(C.leftSE.point);if(lt!==0)return lt;let dt=C.comparePoint(L.rightSE.point);return dt<0?1:dt>0?-1:1}if(st<k)return-1;if(st>k)return 1;if(X<pt){let lt=L.comparePoint(C.rightSE.point);if(lt!==0)return lt}if(X>pt){let lt=C.comparePoint(L.rightSE.point);if(lt<0)return 1;if(lt>0)return-1}if(X!==pt){let lt=ut-st,dt=X-F,at=nt-k,Bt=pt-J;if(lt>dt&&at<Bt)return 1;if(lt<dt&&at>Bt)return-1}return X>pt?1:X<pt||ut<nt?-1:ut>nt?1:C.id<L.id?-1:C.id>L.id?1:0}constructor(C,L,F,J){this.id=++He,this.leftSE=C,C.segment=this,C.otherSE=L,this.rightSE=L,L.segment=this,L.otherSE=C,this.rings=F,this.windings=J}static fromRing(C,L,F){let J,X,pt,st=ft.comparePoints(C,L);if(st<0)J=C,X=L,pt=1;else if(st>0)J=L,X=C,pt=-1;else throw new Error(\`Tried to create degenerate segment at [\${C.x}, \${C.y}]\`);let k=new ft(J,!0),ut=new ft(X,!1);return new te(k,ut,[F],[pt])}replaceRightSE(C){this.rightSE=C,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){let C=this.leftSE.point.y,L=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:C<L?C:L},ur:{x:this.rightSE.point.x,y:C>L?C:L}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(C){return C.x===this.leftSE.point.x&&C.y===this.leftSE.point.y||C.x===this.rightSE.point.x&&C.y===this.rightSE.point.y}comparePoint(C){if(this.isAnEndpoint(C))return 0;let L=this.leftSE.point,F=this.rightSE.point,J=this.vector();if(L.x===F.x)return C.x===L.x?0:C.x<L.x?1:-1;let X=(C.y-L.y)/J.y,pt=L.x+X*J.x;if(C.x===pt)return 0;let st=(C.x-L.x)/J.x,k=L.y+st*J.y;return C.y===k?0:C.y<k?-1:1}getIntersection(C){let L=this.bbox(),F=C.bbox(),J=M(L,F);if(J===null)return null;let X=this.leftSE.point,pt=this.rightSE.point,st=C.leftSE.point,k=C.rightSE.point,ut=I(L,st)&&this.comparePoint(st)===0,nt=I(F,X)&&C.comparePoint(X)===0,lt=I(L,k)&&this.comparePoint(k)===0,dt=I(F,pt)&&C.comparePoint(pt)===0;if(nt&&ut)return dt&&!lt?pt:!dt&<?k:null;if(nt)return lt&&X.x===k.x&&X.y===k.y?null:X;if(ut)return dt&&pt.x===st.x&&pt.y===st.y?null:st;if(dt&<)return null;if(dt)return pt;if(lt)return k;let at=Ee(X,this.vector(),st,C.vector());return at===null||!I(J,at)?null:$.round(at.x,at.y)}split(C){let L=[],F=C.events!==void 0,J=new ft(C,!0),X=new ft(C,!1),pt=this.rightSE;this.replaceRightSE(X),L.push(X),L.push(J);let st=new te(J,pt,this.rings.slice(),this.windings.slice());return ft.comparePoints(st.leftSE.point,st.rightSE.point)>0&&st.swapEvents(),ft.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),F&&(J.checkForConsuming(),X.checkForConsuming()),L}swapEvents(){let C=this.rightSE;this.rightSE=this.leftSE,this.leftSE=C,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let L=0,F=this.windings.length;L<F;L++)this.windings[L]*=-1}consume(C){let L=this,F=C;for(;L.consumedBy;)L=L.consumedBy;for(;F.consumedBy;)F=F.consumedBy;let J=te.compare(L,F);if(J!==0){if(J>0){let X=L;L=F,F=X}if(L.prev===F){let X=L;L=F,F=X}for(let X=0,pt=F.rings.length;X<pt;X++){let st=F.rings[X],k=F.windings[X],ut=L.rings.indexOf(st);ut===-1?(L.rings.push(st),L.windings.push(k)):L.windings[ut]+=k}F.rings=null,F.windings=null,F.consumedBy=L,F.leftSE.consumedBy=L.leftSE,F.rightSE.consumedBy=L.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{let C=this.prev.consumedBy||this.prev;this._beforeState=C.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;let C=this.beforeState();this._afterState={rings:C.rings.slice(0),windings:C.windings.slice(0),multiPolys:[]};let L=this._afterState.rings,F=this._afterState.windings,J=this._afterState.multiPolys;for(let st=0,k=this.rings.length;st<k;st++){let ut=this.rings[st],nt=this.windings[st],lt=L.indexOf(ut);lt===-1?(L.push(ut),F.push(nt)):F[lt]+=nt}let X=[],pt=[];for(let st=0,k=L.length;st<k;st++){if(F[st]===0)continue;let ut=L[st],nt=ut.poly;if(pt.indexOf(nt)===-1)if(ut.isExterior)X.push(nt);else{pt.indexOf(nt)===-1&&pt.push(nt);let lt=X.indexOf(ut.poly);lt!==-1&&X.splice(lt,1)}}for(let st=0,k=X.length;st<k;st++){let ut=X[st].multiPoly;J.indexOf(ut)===-1&&J.push(ut)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;let C=this.beforeState().multiPolys,L=this.afterState().multiPolys;switch(rt.type){case"union":{let F=C.length===0,J=L.length===0;this._isInResult=F!==J;break}case"intersection":{let F,J;C.length<L.length?(F=C.length,J=L.length):(F=L.length,J=C.length),this._isInResult=J===rt.numMultiPolys&&F<J;break}case"xor":{let F=Math.abs(C.length-L.length);this._isInResult=F%2===1;break}case"difference":{let F=J=>J.length===1&&J[0].isSubject;this._isInResult=F(C)!==F(L);break}default:throw new Error(\`Unrecognized operation type found \${rt.type}\`)}return this._isInResult}}class fe{constructor(C,L,F){if(!Array.isArray(C)||C.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=L,this.isExterior=F,this.segments=[],typeof C[0][0]!="number"||typeof C[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let J=$.round(C[0][0],C[0][1]);this.bbox={ll:{x:J.x,y:J.y},ur:{x:J.x,y:J.y}};let X=J;for(let pt=1,st=C.length;pt<st;pt++){if(typeof C[pt][0]!="number"||typeof C[pt][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let k=$.round(C[pt][0],C[pt][1]);k.x===X.x&&k.y===X.y||(this.segments.push(te.fromRing(X,k,this)),k.x<this.bbox.ll.x&&(this.bbox.ll.x=k.x),k.y<this.bbox.ll.y&&(this.bbox.ll.y=k.y),k.x>this.bbox.ur.x&&(this.bbox.ur.x=k.x),k.y>this.bbox.ur.y&&(this.bbox.ur.y=k.y),X=k)}(J.x!==X.x||J.y!==X.y)&&this.segments.push(te.fromRing(X,J,this))}getSweepEvents(){let C=[];for(let L=0,F=this.segments.length;L<F;L++){let J=this.segments[L];C.push(J.leftSE),C.push(J.rightSE)}return C}}class de{constructor(C,L){if(!Array.isArray(C))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new fe(C[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let F=1,J=C.length;F<J;F++){let X=new fe(C[F],this,!1);X.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=X.bbox.ll.x),X.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=X.bbox.ll.y),X.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=X.bbox.ur.x),X.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=X.bbox.ur.y),this.interiorRings.push(X)}this.multiPoly=L}getSweepEvents(){let C=this.exteriorRing.getSweepEvents();for(let L=0,F=this.interiorRings.length;L<F;L++){let J=this.interiorRings[L].getSweepEvents();for(let X=0,pt=J.length;X<pt;X++)C.push(J[X])}return C}}class Ue{constructor(C,L){if(!Array.isArray(C))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof C[0][0][0]=="number"&&(C=[C])}catch(F){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let F=0,J=C.length;F<J;F++){let X=new de(C[F],this);X.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=X.bbox.ll.x),X.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=X.bbox.ll.y),X.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=X.bbox.ur.x),X.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=X.bbox.ur.y),this.polys.push(X)}this.isSubject=L}getSweepEvents(){let C=[];for(let L=0,F=this.polys.length;L<F;L++){let J=this.polys[L].getSweepEvents();for(let X=0,pt=J.length;X<pt;X++)C.push(J[X])}return C}}class be{static factory(C){let L=[];for(let F=0,J=C.length;F<J;F++){let X=C[F];if(!X.isInResult()||X.ringOut)continue;let pt=null,st=X.leftSE,k=X.rightSE,ut=[st],nt=st.point,lt=[];for(;pt=st,st=k,ut.push(st),st.point!==nt;)for(;;){let dt=st.getAvailableLinkedEvents();if(dt.length===0){let qt=ut[0].point,we=ut[ut.length-1].point;throw new Error(\`Unable to complete output ring starting at [\${qt.x}, \${qt.y}]. Last matching segment found ends at [\${we.x}, \${we.y}].\`)}if(dt.length===1){k=dt[0].otherSE;break}let at=null;for(let qt=0,we=lt.length;qt<we;qt++)if(lt[qt].point===st.point){at=qt;break}if(at!==null){let qt=lt.splice(at)[0],we=ut.splice(qt.index);we.unshift(we[0].otherSE),L.push(new be(we.reverse()));continue}lt.push({index:ut.length,point:st.point});let Bt=st.getLeftmostComparator(pt);k=dt.sort(Bt)[0].otherSE;break}L.push(new be(ut))}return L}constructor(C){this.events=C;for(let L=0,F=C.length;L<F;L++)C[L].segment.ringOut=this;this.poly=null}getGeom(){let C=this.events[0].point,L=[C];for(let ut=1,nt=this.events.length-1;ut<nt;ut++){let lt=this.events[ut].point,dt=this.events[ut+1].point;$t(lt,C,dt)!==0&&(L.push(lt),C=lt)}if(L.length===1)return null;let F=L[0],J=L[1];$t(F,C,J)===0&&L.shift(),L.push(L[0]);let X=this.isExteriorRing()?1:-1,pt=this.isExteriorRing()?0:L.length-1,st=this.isExteriorRing()?L.length:-1,k=[];for(let ut=pt;ut!=st;ut+=X)k.push([L[ut].x,L[ut].y]);return k}isExteriorRing(){if(this._isExteriorRing===void 0){let C=this.enclosingRing();this._isExteriorRing=C?!C.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let C=this.events[0];for(let J=1,X=this.events.length;J<X;J++){let pt=this.events[J];ft.compare(C,pt)>0&&(C=pt)}let L=C.segment.prevInResult(),F=L?L.prevInResult():null;for(;;){if(!L)return null;if(!F)return L.ringOut;if(F.ringOut!==L.ringOut)return F.ringOut.enclosingRing()!==L.ringOut?L.ringOut:L.ringOut.enclosingRing();L=F.prevInResult(),F=L?L.prevInResult():null}}}class kt{constructor(C){this.exteriorRing=C,C.poly=this,this.interiorRings=[]}addInterior(C){this.interiorRings.push(C),C.poly=this}getGeom(){let C=[this.exteriorRing.getGeom()];if(C[0]===null)return null;for(let L=0,F=this.interiorRings.length;L<F;L++){let J=this.interiorRings[L].getGeom();J!==null&&C.push(J)}return C}}class ye{constructor(C){this.rings=C,this.polys=this._composePolys(C)}getGeom(){let C=[];for(let L=0,F=this.polys.length;L<F;L++){let J=this.polys[L].getGeom();J!==null&&C.push(J)}return C}_composePolys(C){let L=[];for(let F=0,J=C.length;F<J;F++){let X=C[F];if(!X.poly)if(X.isExteriorRing())L.push(new kt(X));else{let pt=X.enclosingRing();pt.poly||L.push(new kt(pt)),pt.poly.addInterior(X)}}return L}}class Vn{constructor(C){let L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:te.compare;this.queue=C,this.tree=new g(L),this.segments=[]}process(C){let L=C.segment,F=[];if(C.consumedBy)return C.isLeft?this.queue.remove(C.otherSE):this.tree.remove(L),F;let J=C.isLeft?this.tree.add(L):this.tree.find(L);if(!J)throw new Error(\`Unable to find segment #\${L.id} [\${L.leftSE.point.x}, \${L.leftSE.point.y}] -> [\${L.rightSE.point.x}, \${L.rightSE.point.y}] in SweepLine tree.\`);let X=J,pt=J,st,k;for(;st===void 0;)X=this.tree.prev(X),X===null?st=null:X.key.consumedBy===void 0&&(st=X.key);for(;k===void 0;)pt=this.tree.next(pt),pt===null?k=null:pt.key.consumedBy===void 0&&(k=pt.key);if(C.isLeft){let ut=null;if(st){let lt=st.getIntersection(L);if(lt!==null&&(L.isAnEndpoint(lt)||(ut=lt),!st.isAnEndpoint(lt))){let dt=this._splitSafely(st,lt);for(let at=0,Bt=dt.length;at<Bt;at++)F.push(dt[at])}}let nt=null;if(k){let lt=k.getIntersection(L);if(lt!==null&&(L.isAnEndpoint(lt)||(nt=lt),!k.isAnEndpoint(lt))){let dt=this._splitSafely(k,lt);for(let at=0,Bt=dt.length;at<Bt;at++)F.push(dt[at])}}if(ut!==null||nt!==null){let lt=null;ut===null?lt=nt:nt===null?lt=ut:lt=ft.comparePoints(ut,nt)<=0?ut:nt,this.queue.remove(L.rightSE),F.push(L.rightSE);let dt=L.split(lt);for(let at=0,Bt=dt.length;at<Bt;at++)F.push(dt[at])}F.length>0?(this.tree.remove(L),F.push(C)):(this.segments.push(L),L.prev=st)}else{if(st&&k){let ut=st.getIntersection(k);if(ut!==null){if(!st.isAnEndpoint(ut)){let nt=this._splitSafely(st,ut);for(let lt=0,dt=nt.length;lt<dt;lt++)F.push(nt[lt])}if(!k.isAnEndpoint(ut)){let nt=this._splitSafely(k,ut);for(let lt=0,dt=nt.length;lt<dt;lt++)F.push(nt[lt])}}}this.tree.remove(L)}return F}_splitSafely(C,L){this.tree.remove(C);let F=C.rightSE;this.queue.remove(F);let J=C.split(L);return J.push(F),C.consumedBy===void 0&&this.tree.add(C),J}}let $n=typeof process!="undefined"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,j=typeof process!="undefined"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class H{run(C,L,F){rt.type=C,$.reset();let J=[new Ue(L,!0)];for(let lt=0,dt=F.length;lt<dt;lt++)J.push(new Ue(F[lt],!1));if(rt.numMultiPolys=J.length,rt.type==="difference"){let lt=J[0],dt=1;for(;dt<J.length;)M(J[dt].bbox,lt.bbox)!==null?dt++:J.splice(dt,1)}if(rt.type==="intersection")for(let lt=0,dt=J.length;lt<dt;lt++){let at=J[lt];for(let Bt=lt+1,qt=J.length;Bt<qt;Bt++)if(M(at.bbox,J[Bt].bbox)===null)return[]}let X=new g(ft.compare);for(let lt=0,dt=J.length;lt<dt;lt++){let at=J[lt].getSweepEvents();for(let Bt=0,qt=at.length;Bt<qt;Bt++)if(X.insert(at[Bt]),X.size>$n)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}let pt=new Vn(X),st=X.size,k=X.pop();for(;k;){let lt=k.key;if(X.size===st){let at=lt.segment;throw new Error(\`Unable to pop() \${lt.isLeft?"left":"right"} SweepEvent [\${lt.point.x}, \${lt.point.y}] from segment #\${at.id} [\${at.leftSE.point.x}, \${at.leftSE.point.y}] -> [\${at.rightSE.point.x}, \${at.rightSE.point.y}] from queue.\`)}if(X.size>$n)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(pt.segments.length>j)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");let dt=pt.process(lt);for(let at=0,Bt=dt.length;at<Bt;at++){let qt=dt[at];qt.consumedBy===void 0&&X.insert(qt)}st=X.size,k=X.pop()}$.reset();let ut=be.factory(pt.segments);return new ye(ut).getGeom()}}let rt=new H;var Kt={union:function(tt){for(var C=arguments.length,L=new Array(C>1?C-1:0),F=1;F<C;F++)L[F-1]=arguments[F];return rt.run("union",tt,L)},intersection:function(tt){for(var C=arguments.length,L=new Array(C>1?C-1:0),F=1;F<C;F++)L[F-1]=arguments[F];return rt.run("intersection",tt,L)},xor:function(tt){for(var C=arguments.length,L=new Array(C>1?C-1:0),F=1;F<C;F++)L[F-1]=arguments[F];return rt.run("xor",tt,L)},difference:function(tt){for(var C=arguments.length,L=new Array(C>1?C-1:0),F=1;F<C;F++)L[F-1]=arguments[F];return rt.run("difference",tt,L)}};return Kt})});var HM=ce((qp,kM)=>{(function(r,t){typeof qp=="object"&&typeof kM!="undefined"?t(qp):typeof define=="function"&&define.amd?define(["exports"],t):t(r.jsts={})})(qp,function(r){"use strict";function t(){}function e(n){this.message=n||""}function o(n){this.message=n||""}function a(n){this.message=n||""}function c(){}function p(n){return n===null?Qn:n.color}function d(n){return n===null?null:n.parent}function g(n,i){n!==null&&(n.color=i)}function y(n){return n===null?null:n.left}function _(n){return n===null?null:n.right}function w(){this.root_=null,this.size_=0}function x(){}function b(){this.array_=[],arguments[0]instanceof st&&this.addAll(arguments[0])}function P(){}function I(n){this.message=n||""}function M(){this.array_=[]}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(n){if(this===void 0||this===null)throw new TypeError(this+" is not an object");var i=Object(this),s=Math.max(Math.min(i.length,9007199254740991),0)||0,l=1 in arguments&&parseInt(Number(arguments[1]),10)||0;l=l<0?Math.max(s+l,0):Math.min(l,s);var h=2 in arguments&&arguments[2]!==void 0?parseInt(Number(arguments[2]),10)||0:s;for(h=h<0?Math.max(s+arguments[2],0):Math.min(h,s);l<h;)i[l]=n,++l;return i},writable:!0}),Number.isFinite=Number.isFinite||function(n){return typeof n=="number"&&isFinite(n)},Number.isInteger=Number.isInteger||function(n){return typeof n=="number"&&isFinite(n)&&Math.floor(n)===n},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(n){return n!=n},Math.trunc=Math.trunc||function(n){return n<0?Math.ceil(n):Math.floor(n)};var E=function(){};E.prototype.interfaces_=function(){return[]},E.prototype.getClass=function(){return E},E.prototype.equalsWithTolerance=function(n,i,s){return Math.abs(n-i)<=s};var N=function(n){function i(s){n.call(this,s),this.name="IllegalArgumentException",this.message=s,this.stack=new n().stack}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i}(Error),A=function(){},U={MAX_VALUE:{configurable:!0}};A.isNaN=function(n){return Number.isNaN(n)},A.doubleToLongBits=function(n){return n},A.longBitsToDouble=function(n){return n},A.isInfinite=function(n){return!Number.isFinite(n)},U.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(A,U);var z=function(){},$=function(){},q=function(){},D=function n(){if(this.x=null,this.y=null,this.z=null,arguments.length===0)this.x=0,this.y=0,this.z=n.NULL_ORDINATE;else if(arguments.length===1){var i=arguments[0];this.x=i.x,this.y=i.y,this.z=i.z}else arguments.length===2?(this.x=arguments[0],this.y=arguments[1],this.z=n.NULL_ORDINATE):arguments.length===3&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},G={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};D.prototype.setOrdinate=function(n,i){switch(n){case D.X:this.x=i;break;case D.Y:this.y=i;break;case D.Z:this.z=i;break;default:throw new N("Invalid ordinate index: "+n)}},D.prototype.equals2D=function(){if(arguments.length===1){var n=arguments[0];return this.x===n.x&&this.y===n.y}if(arguments.length===2){var i=arguments[0],s=arguments[1];return!!E.equalsWithTolerance(this.x,i.x,s)&&!!E.equalsWithTolerance(this.y,i.y,s)}},D.prototype.getOrdinate=function(n){switch(n){case D.X:return this.x;case D.Y:return this.y;case D.Z:return this.z}throw new N("Invalid ordinate index: "+n)},D.prototype.equals3D=function(n){return this.x===n.x&&this.y===n.y&&(this.z===n.z||A.isNaN(this.z))&&A.isNaN(n.z)},D.prototype.equals=function(n){return n instanceof D&&this.equals2D(n)},D.prototype.equalInZ=function(n,i){return E.equalsWithTolerance(this.z,n.z,i)},D.prototype.compareTo=function(n){var i=n;return this.x<i.x?-1:this.x>i.x?1:this.y<i.y?-1:this.y>i.y?1:0},D.prototype.clone=function(){},D.prototype.copy=function(){return new D(this)},D.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},D.prototype.distance3D=function(n){var i=this.x-n.x,s=this.y-n.y,l=this.z-n.z;return Math.sqrt(i*i+s*s+l*l)},D.prototype.distance=function(n){var i=this.x-n.x,s=this.y-n.y;return Math.sqrt(i*i+s*s)},D.prototype.hashCode=function(){var n=17;return n=37*n+D.hashCode(this.x),n=37*n+D.hashCode(this.y)},D.prototype.setCoordinate=function(n){this.x=n.x,this.y=n.y,this.z=n.z},D.prototype.interfaces_=function(){return[z,$,t]},D.prototype.getClass=function(){return D},D.hashCode=function(){if(arguments.length===1){var n=arguments[0],i=A.doubleToLongBits(n);return Math.trunc((i^i)>>>32)}},G.DimensionalComparator.get=function(){return Q},G.serialVersionUID.get=function(){return 6683108902428367e3},G.NULL_ORDINATE.get=function(){return A.NaN},G.X.get=function(){return 0},G.Y.get=function(){return 1},G.Z.get=function(){return 2},Object.defineProperties(D,G);var Q=function(n){if(this._dimensionsToTest=2,arguments.length!==0){if(arguments.length===1){var i=arguments[0];if(i!==2&&i!==3)throw new N("only 2 or 3 dimensions may be specified");this._dimensionsToTest=i}}};Q.prototype.compare=function(n,i){var s=n,l=i,h=Q.compare(s.x,l.x);if(h!==0)return h;var v=Q.compare(s.y,l.y);return v!==0?v:this._dimensionsToTest<=2?0:Q.compare(s.z,l.z)},Q.prototype.interfaces_=function(){return[q]},Q.prototype.getClass=function(){return Q},Q.compare=function(n,i){return n<i?-1:n>i?1:A.isNaN(n)?A.isNaN(i)?0:-1:A.isNaN(i)?1:0};var _t=function(){};_t.prototype.create=function(){},_t.prototype.interfaces_=function(){return[]},_t.prototype.getClass=function(){return _t};var Z=function(){},Dt={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};Z.prototype.interfaces_=function(){return[]},Z.prototype.getClass=function(){return Z},Z.toLocationSymbol=function(n){switch(n){case Z.EXTERIOR:return"e";case Z.BOUNDARY:return"b";case Z.INTERIOR:return"i";case Z.NONE:return"-"}throw new N("Unknown location value: "+n)},Dt.INTERIOR.get=function(){return 0},Dt.BOUNDARY.get=function(){return 1},Dt.EXTERIOR.get=function(){return 2},Dt.NONE.get=function(){return-1},Object.defineProperties(Z,Dt);var et=function(n,i){return n.interfaces_&&n.interfaces_().indexOf(i)>-1},vt=function(){},It={LOG_10:{configurable:!0}};vt.prototype.interfaces_=function(){return[]},vt.prototype.getClass=function(){return vt},vt.log10=function(n){var i=Math.log(n);return A.isInfinite(i)||A.isNaN(i)?i:i/vt.LOG_10},vt.min=function(n,i,s,l){var h=n;return i<h&&(h=i),s<h&&(h=s),l<h&&(h=l),h},vt.clamp=function(){if(typeof arguments[2]=="number"&&typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var n=arguments[0],i=arguments[1],s=arguments[2];return n<i?i:n>s?s:n}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var l=arguments[0],h=arguments[1],v=arguments[2];return l<h?h:l>v?v:l}},vt.wrap=function(n,i){return n<0?i- -n%i:n%i},vt.max=function(){if(arguments.length===3){var n=arguments[0],i=arguments[1],s=arguments[2],l=n;return i>l&&(l=i),s>l&&(l=s),l}if(arguments.length===4){var h=arguments[0],v=arguments[1],S=arguments[2],R=arguments[3],V=h;return v>V&&(V=v),S>V&&(V=S),R>V&&(V=R),V}},vt.average=function(n,i){return(n+i)/2},It.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(vt,It);var Pt=function(n){this.str=n};Pt.prototype.append=function(n){this.str+=n},Pt.prototype.setCharAt=function(n,i){this.str=this.str.substr(0,n)+i+this.str.substr(n+1)},Pt.prototype.toString=function(n){return this.str};var Et=function(n){this.value=n};Et.prototype.intValue=function(){return this.value},Et.prototype.compareTo=function(n){return this.value<n?-1:this.value>n?1:0},Et.isNaN=function(n){return Number.isNaN(n)};var yt=function(){};yt.isWhitespace=function(n){return n<=32&&n>=0||n===127},yt.toUpperCase=function(n){return n.toUpperCase()};var Y=function n(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var i=arguments[0];this.init(i)}else if(arguments[0]instanceof n){var s=arguments[0];this.init(s)}else if(typeof arguments[0]=="string"){var l=arguments[0];n.call(this,n.parse(l))}}else if(arguments.length===2){var h=arguments[0],v=arguments[1];this.init(h,v)}},ht={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};Y.prototype.le=function(n){return(this._hi<n._hi||this._hi===n._hi)&&this._lo<=n._lo},Y.prototype.extractSignificantDigits=function(n,i){var s=this.abs(),l=Y.magnitude(s._hi),h=Y.TEN.pow(l);(s=s.divide(h)).gt(Y.TEN)?(s=s.divide(Y.TEN),l+=1):s.lt(Y.ONE)&&(s=s.multiply(Y.TEN),l-=1);for(var v=l+1,S=new Pt,R=Y.MAX_PRINT_DIGITS-1,V=0;V<=R;V++){n&&V===v&&S.append(".");var ot=Math.trunc(s._hi);if(ot<0)break;var St=!1,bt=0;ot>9?(St=!0,bt="9"):bt="0"+ot,S.append(bt),s=s.subtract(Y.valueOf(ot)).multiply(Y.TEN),St&&s.selfAdd(Y.TEN);var Yt=!0,Jt=Y.magnitude(s._hi);if(Jt<0&&Math.abs(Jt)>=R-V&&(Yt=!1),!Yt)break}return i[0]=l,S.toString()},Y.prototype.sqr=function(){return this.multiply(this)},Y.prototype.doubleValue=function(){return this._hi+this._lo},Y.prototype.subtract=function(){if(arguments[0]instanceof Y){var n=arguments[0];return this.add(n.negate())}if(typeof arguments[0]=="number"){var i=arguments[0];return this.add(-i)}},Y.prototype.equals=function(){if(arguments.length===1){var n=arguments[0];return this._hi===n._hi&&this._lo===n._lo}},Y.prototype.isZero=function(){return this._hi===0&&this._lo===0},Y.prototype.selfSubtract=function(){if(arguments[0]instanceof Y){var n=arguments[0];return this.isNaN()?this:this.selfAdd(-n._hi,-n._lo)}if(typeof arguments[0]=="number"){var i=arguments[0];return this.isNaN()?this:this.selfAdd(-i,0)}},Y.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},Y.prototype.min=function(n){return this.le(n)?this:n},Y.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof Y){var n=arguments[0];return this.selfDivide(n._hi,n._lo)}if(typeof arguments[0]=="number"){var i=arguments[0];return this.selfDivide(i,0)}}else if(arguments.length===2){var s=arguments[0],l=arguments[1],h=null,v=null,S=null,R=null,V=null,ot=null,St=null,bt=null;return V=this._hi/s,ot=Y.SPLIT*V,h=ot-V,bt=Y.SPLIT*s,h=ot-h,v=V-h,S=bt-s,St=V*s,S=bt-S,R=s-S,bt=h*S-St+h*R+v*S+v*R,ot=(this._hi-St-bt+this._lo-V*l)/s,bt=V+ot,this._hi=bt,this._lo=V-bt+ot,this}},Y.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},Y.prototype.divide=function(){if(arguments[0]instanceof Y){var n=arguments[0],i=null,s=null,l=null,h=null,v=null,S=null,R=null,V=null;return s=(v=this._hi/n._hi)-(i=(S=Y.SPLIT*v)-(i=S-v)),V=i*(l=(V=Y.SPLIT*n._hi)-(l=V-n._hi))-(R=v*n._hi)+i*(h=n._hi-l)+s*l+s*h,S=(this._hi-R-V+this._lo-v*n._lo)/n._hi,new Y(V=v+S,v-V+S)}if(typeof arguments[0]=="number"){var ot=arguments[0];return A.isNaN(ot)?Y.createNaN():Y.copy(this).selfDivide(ot,0)}},Y.prototype.ge=function(n){return(this._hi>n._hi||this._hi===n._hi)&&this._lo>=n._lo},Y.prototype.pow=function(n){if(n===0)return Y.valueOf(1);var i=new Y(this),s=Y.valueOf(1),l=Math.abs(n);if(l>1)for(;l>0;)l%2==1&&s.selfMultiply(i),(l/=2)>0&&(i=i.sqr());else s=i;return n<0?s.reciprocal():s},Y.prototype.ceil=function(){if(this.isNaN())return Y.NaN;var n=Math.ceil(this._hi),i=0;return n===this._hi&&(i=Math.ceil(this._lo)),new Y(n,i)},Y.prototype.compareTo=function(n){var i=n;return this._hi<i._hi?-1:this._hi>i._hi?1:this._lo<i._lo?-1:this._lo>i._lo?1:0},Y.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},Y.prototype.setValue=function(){if(arguments[0]instanceof Y){var n=arguments[0];return this.init(n),this}if(typeof arguments[0]=="number"){var i=arguments[0];return this.init(i),this}},Y.prototype.max=function(n){return this.ge(n)?this:n},Y.prototype.sqrt=function(){if(this.isZero())return Y.valueOf(0);if(this.isNegative())return Y.NaN;var n=1/Math.sqrt(this._hi),i=this._hi*n,s=Y.valueOf(i),l=this.subtract(s.sqr())._hi*(.5*n);return s.add(l)},Y.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof Y){var n=arguments[0];return this.selfAdd(n._hi,n._lo)}if(typeof arguments[0]=="number"){var i=arguments[0],s=null,l=null,h=null,v=null,S=null,R=null;return h=this._hi+i,S=h-this._hi,v=h-S,v=i-S+(this._hi-v),R=v+this._lo,s=h+R,l=R+(h-s),this._hi=s+l,this._lo=l+(s-this._hi),this}}else if(arguments.length===2){var V=arguments[0],ot=arguments[1],St=null,bt=null,Yt=null,Jt=null,se=null,_e=null,Cn=null;Jt=this._hi+V,bt=this._lo+ot,se=Jt-(_e=Jt-this._hi),Yt=bt-(Cn=bt-this._lo);var Xn=(St=Jt+(_e=(se=V-_e+(this._hi-se))+bt))+(_e=(Yt=ot-Cn+(this._lo-Yt))+(_e+(Jt-St))),ui=_e+(St-Xn);return this._hi=Xn,this._lo=ui,this}},Y.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof Y){var n=arguments[0];return this.selfMultiply(n._hi,n._lo)}if(typeof arguments[0]=="number"){var i=arguments[0];return this.selfMultiply(i,0)}}else if(arguments.length===2){var s=arguments[0],l=arguments[1],h=null,v=null,S=null,R=null,V=null,ot=null;h=(V=Y.SPLIT*this._hi)-this._hi,ot=Y.SPLIT*s,h=V-h,v=this._hi-h,S=ot-s;var St=(V=this._hi*s)+(ot=h*(S=ot-S)-V+h*(R=s-S)+v*S+v*R+(this._hi*l+this._lo*s)),bt=ot+(h=V-St);return this._hi=St,this._lo=bt,this}},Y.prototype.selfSqr=function(){return this.selfMultiply(this)},Y.prototype.floor=function(){if(this.isNaN())return Y.NaN;var n=Math.floor(this._hi),i=0;return n===this._hi&&(i=Math.floor(this._lo)),new Y(n,i)},Y.prototype.negate=function(){return this.isNaN()?this:new Y(-this._hi,-this._lo)},Y.prototype.clone=function(){},Y.prototype.multiply=function(){if(arguments[0]instanceof Y){var n=arguments[0];return n.isNaN()?Y.createNaN():Y.copy(this).selfMultiply(n)}if(typeof arguments[0]=="number"){var i=arguments[0];return A.isNaN(i)?Y.createNaN():Y.copy(this).selfMultiply(i,0)}},Y.prototype.isNaN=function(){return A.isNaN(this._hi)},Y.prototype.intValue=function(){return Math.trunc(this._hi)},Y.prototype.toString=function(){var n=Y.magnitude(this._hi);return n>=-3&&n<=20?this.toStandardNotation():this.toSciNotation()},Y.prototype.toStandardNotation=function(){var n=this.getSpecialNumberString();if(n!==null)return n;var i=new Array(1).fill(null),s=this.extractSignificantDigits(!0,i),l=i[0]+1,h=s;if(s.charAt(0)===".")h="0"+s;else if(l<0)h="0."+Y.stringOfChar("0",-l)+s;else if(s.indexOf(".")===-1){var v=l-s.length;h=s+Y.stringOfChar("0",v)+".0"}return this.isNegative()?"-"+h:h},Y.prototype.reciprocal=function(){var n=null,i=null,s=null,l=null,h=null,v=null,S=null,R=null;i=(h=1/this._hi)-(n=(v=Y.SPLIT*h)-(n=v-h)),s=(R=Y.SPLIT*this._hi)-this._hi;var V=h+(v=(1-(S=h*this._hi)-(R=n*(s=R-s)-S+n*(l=this._hi-s)+i*s+i*l)-h*this._lo)/this._hi);return new Y(V,h-V+v)},Y.prototype.toSciNotation=function(){if(this.isZero())return Y.SCI_NOT_ZERO;var n=this.getSpecialNumberString();if(n!==null)return n;var i=new Array(1).fill(null),s=this.extractSignificantDigits(!1,i),l=Y.SCI_NOT_EXPONENT_CHAR+i[0];if(s.charAt(0)==="0")throw new Error("Found leading zero: "+s);var h="";s.length>1&&(h=s.substring(1));var v=s.charAt(0)+"."+h;return this.isNegative()?"-"+v+l:v+l},Y.prototype.abs=function(){return this.isNaN()?Y.NaN:this.isNegative()?this.negate():new Y(this)},Y.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0},Y.prototype.lt=function(n){return(this._hi<n._hi||this._hi===n._hi)&&this._lo<n._lo},Y.prototype.add=function(){if(arguments[0]instanceof Y){var n=arguments[0];return Y.copy(this).selfAdd(n)}if(typeof arguments[0]=="number"){var i=arguments[0];return Y.copy(this).selfAdd(i)}},Y.prototype.init=function(){if(arguments.length===1){if(typeof arguments[0]=="number"){var n=arguments[0];this._hi=n,this._lo=0}else if(arguments[0]instanceof Y){var i=arguments[0];this._hi=i._hi,this._lo=i._lo}}else if(arguments.length===2){var s=arguments[0],l=arguments[1];this._hi=s,this._lo=l}},Y.prototype.gt=function(n){return(this._hi>n._hi||this._hi===n._hi)&&this._lo>n._lo},Y.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0},Y.prototype.trunc=function(){return this.isNaN()?Y.NaN:this.isPositive()?this.floor():this.ceil()},Y.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},Y.prototype.interfaces_=function(){return[t,z,$]},Y.prototype.getClass=function(){return Y},Y.sqr=function(n){return Y.valueOf(n).selfMultiply(n)},Y.valueOf=function(){if(typeof arguments[0]=="string"){var n=arguments[0];return Y.parse(n)}if(typeof arguments[0]=="number"){var i=arguments[0];return new Y(i)}},Y.sqrt=function(n){return Y.valueOf(n).sqrt()},Y.parse=function(n){for(var i=0,s=n.length;yt.isWhitespace(n.charAt(i));)i++;var l=!1;if(i<s){var h=n.charAt(i);h!=="-"&&h!=="+"||(i++,h==="-"&&(l=!0))}for(var v=new Y,S=0,R=0,V=0;!(i>=s);){var ot=n.charAt(i);if(i++,yt.isDigit(ot)){var St=ot-"0";v.selfMultiply(Y.TEN),v.selfAdd(St),S++}else{if(ot!=="."){if(ot==="e"||ot==="E"){var bt=n.substring(i);try{V=Et.parseInt(bt)}catch(Cn){throw Cn instanceof Error?new Error("Invalid exponent "+bt+" in string "+n):Cn}break}throw new Error("Unexpected character '"+ot+"' at position "+i+" in string "+n)}R=S}}var Yt=v,Jt=S-R-V;if(Jt===0)Yt=v;else if(Jt>0){var se=Y.TEN.pow(Jt);Yt=v.divide(se)}else if(Jt<0){var _e=Y.TEN.pow(-Jt);Yt=v.multiply(_e)}return l?Yt.negate():Yt},Y.createNaN=function(){return new Y(A.NaN,A.NaN)},Y.copy=function(n){return new Y(n)},Y.magnitude=function(n){var i=Math.abs(n),s=Math.log(i)/Math.log(10),l=Math.trunc(Math.floor(s));return 10*Math.pow(10,l)<=i&&(l+=1),l},Y.stringOfChar=function(n,i){for(var s=new Pt,l=0;l<i;l++)s.append(n);return s.toString()},ht.PI.get=function(){return new Y(3.141592653589793,12246467991473532e-32)},ht.TWO_PI.get=function(){return new Y(6.283185307179586,24492935982947064e-32)},ht.PI_2.get=function(){return new Y(1.5707963267948966,6123233995736766e-32)},ht.E.get=function(){return new Y(2.718281828459045,14456468917292502e-32)},ht.NaN.get=function(){return new Y(A.NaN,A.NaN)},ht.EPS.get=function(){return 123259516440783e-46},ht.SPLIT.get=function(){return 134217729},ht.MAX_PRINT_DIGITS.get=function(){return 32},ht.TEN.get=function(){return Y.valueOf(10)},ht.ONE.get=function(){return Y.valueOf(1)},ht.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},ht.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(Y,ht);var Mt=function(){},zt={DP_SAFE_EPSILON:{configurable:!0}};Mt.prototype.interfaces_=function(){return[]},Mt.prototype.getClass=function(){return Mt},Mt.orientationIndex=function(n,i,s){var l=Mt.orientationIndexFilter(n,i,s);if(l<=1)return l;var h=Y.valueOf(i.x).selfAdd(-n.x),v=Y.valueOf(i.y).selfAdd(-n.y),S=Y.valueOf(s.x).selfAdd(-i.x),R=Y.valueOf(s.y).selfAdd(-i.y);return h.selfMultiply(R).selfSubtract(v.selfMultiply(S)).signum()},Mt.signOfDet2x2=function(n,i,s,l){return n.multiply(l).selfSubtract(i.multiply(s)).signum()},Mt.intersection=function(n,i,s,l){var h=Y.valueOf(l.y).selfSubtract(s.y).selfMultiply(Y.valueOf(i.x).selfSubtract(n.x)),v=Y.valueOf(l.x).selfSubtract(s.x).selfMultiply(Y.valueOf(i.y).selfSubtract(n.y)),S=h.subtract(v),R=Y.valueOf(l.x).selfSubtract(s.x).selfMultiply(Y.valueOf(n.y).selfSubtract(s.y)),V=Y.valueOf(l.y).selfSubtract(s.y).selfMultiply(Y.valueOf(n.x).selfSubtract(s.x)),ot=R.subtract(V).selfDivide(S).doubleValue(),St=Y.valueOf(n.x).selfAdd(Y.valueOf(i.x).selfSubtract(n.x).selfMultiply(ot)).doubleValue(),bt=Y.valueOf(i.x).selfSubtract(n.x).selfMultiply(Y.valueOf(n.y).selfSubtract(s.y)),Yt=Y.valueOf(i.y).selfSubtract(n.y).selfMultiply(Y.valueOf(n.x).selfSubtract(s.x)),Jt=bt.subtract(Yt).selfDivide(S).doubleValue(),se=Y.valueOf(s.y).selfAdd(Y.valueOf(l.y).selfSubtract(s.y).selfMultiply(Jt)).doubleValue();return new D(St,se)},Mt.orientationIndexFilter=function(n,i,s){var l=null,h=(n.x-s.x)*(i.y-s.y),v=(n.y-s.y)*(i.x-s.x),S=h-v;if(h>0){if(v<=0)return Mt.signum(S);l=h+v}else{if(!(h<0)||v>=0)return Mt.signum(S);l=-h-v}var R=Mt.DP_SAFE_EPSILON*l;return S>=R||-S>=R?Mt.signum(S):2},Mt.signum=function(n){return n>0?1:n<0?-1:0},zt.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(Mt,zt);var At=function(){},$t={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};$t.X.get=function(){return 0},$t.Y.get=function(){return 1},$t.Z.get=function(){return 2},$t.M.get=function(){return 3},At.prototype.setOrdinate=function(n,i,s){},At.prototype.size=function(){},At.prototype.getOrdinate=function(n,i){},At.prototype.getCoordinate=function(){},At.prototype.getCoordinateCopy=function(n){},At.prototype.getDimension=function(){},At.prototype.getX=function(n){},At.prototype.clone=function(){},At.prototype.expandEnvelope=function(n){},At.prototype.copy=function(){},At.prototype.getY=function(n){},At.prototype.toCoordinateArray=function(){},At.prototype.interfaces_=function(){return[$]},At.prototype.getClass=function(){return At},Object.defineProperties(At,$t);var ue=function(){},le=function(n){function i(){n.call(this,"Projective point not representable on the Cartesian plane.")}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(ue),Qt=function(){};Qt.arraycopy=function(n,i,s,l,h){for(var v=0,S=i;S<i+h;S++)s[l+v]=n[S],v++},Qt.getProperty=function(n){return{"line.separator":\`
|
|
107
107
|
\`}[n]};var me=function n(){if(this.x=null,this.y=null,this.w=null,arguments.length===0)this.x=0,this.y=0,this.w=1;else if(arguments.length===1){var i=arguments[0];this.x=i.x,this.y=i.y,this.w=1}else if(arguments.length===2){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var s=arguments[0],l=arguments[1];this.x=s,this.y=l,this.w=1}else if(arguments[0]instanceof n&&arguments[1]instanceof n){var h=arguments[0],v=arguments[1];this.x=h.y*v.w-v.y*h.w,this.y=v.x*h.w-h.x*v.w,this.w=h.x*v.y-v.x*h.y}else if(arguments[0]instanceof D&&arguments[1]instanceof D){var S=arguments[0],R=arguments[1];this.x=S.y-R.y,this.y=R.x-S.x,this.w=S.x*R.y-R.x*S.y}}else if(arguments.length===3){var V=arguments[0],ot=arguments[1],St=arguments[2];this.x=V,this.y=ot,this.w=St}else if(arguments.length===4){var bt=arguments[0],Yt=arguments[1],Jt=arguments[2],se=arguments[3],_e=bt.y-Yt.y,Cn=Yt.x-bt.x,Xn=bt.x*Yt.y-Yt.x*bt.y,ui=Jt.y-se.y,rs=se.x-Jt.x,Fs=Jt.x*se.y-se.x*Jt.y;this.x=Cn*Fs-rs*Xn,this.y=ui*Xn-_e*Fs,this.w=_e*rs-ui*Cn}};me.prototype.getY=function(){var n=this.y/this.w;if(A.isNaN(n)||A.isInfinite(n))throw new le;return n},me.prototype.getX=function(){var n=this.x/this.w;if(A.isNaN(n)||A.isInfinite(n))throw new le;return n},me.prototype.getCoordinate=function(){var n=new D;return n.x=this.getX(),n.y=this.getY(),n},me.prototype.interfaces_=function(){return[]},me.prototype.getClass=function(){return me},me.intersection=function(n,i,s,l){var h=n.y-i.y,v=i.x-n.x,S=n.x*i.y-i.x*n.y,R=s.y-l.y,V=l.x-s.x,ot=s.x*l.y-l.x*s.y,St=h*V-R*v,bt=(v*ot-V*S)/St,Yt=(R*S-h*ot)/St;if(A.isNaN(bt)||A.isInfinite(bt)||A.isNaN(Yt)||A.isInfinite(Yt))throw new le;return new D(bt,Yt)};var Xt=function n(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,arguments.length===0)this.init();else if(arguments.length===1){if(arguments[0]instanceof D){var i=arguments[0];this.init(i.x,i.x,i.y,i.y)}else if(arguments[0]instanceof n){var s=arguments[0];this.init(s)}}else if(arguments.length===2){var l=arguments[0],h=arguments[1];this.init(l.x,h.x,l.y,h.y)}else if(arguments.length===4){var v=arguments[0],S=arguments[1],R=arguments[2],V=arguments[3];this.init(v,S,R,V)}},Ee={serialVersionUID:{configurable:!0}};Xt.prototype.getArea=function(){return this.getWidth()*this.getHeight()},Xt.prototype.equals=function(n){if(!(n instanceof Xt))return!1;var i=n;return this.isNull()?i.isNull():this._maxx===i.getMaxX()&&this._maxy===i.getMaxY()&&this._minx===i.getMinX()&&this._miny===i.getMinY()},Xt.prototype.intersection=function(n){if(this.isNull()||n.isNull()||!this.intersects(n))return new Xt;var i=this._minx>n._minx?this._minx:n._minx,s=this._miny>n._miny?this._miny:n._miny,l=this._maxx<n._maxx?this._maxx:n._maxx,h=this._maxy<n._maxy?this._maxy:n._maxy;return new Xt(i,l,s,h)},Xt.prototype.isNull=function(){return this._maxx<this._minx},Xt.prototype.getMaxX=function(){return this._maxx},Xt.prototype.covers=function(){if(arguments.length===1){if(arguments[0]instanceof D){var n=arguments[0];return this.covers(n.x,n.y)}if(arguments[0]instanceof Xt){var i=arguments[0];return!this.isNull()&&!i.isNull()&&i.getMinX()>=this._minx&&i.getMaxX()<=this._maxx&&i.getMinY()>=this._miny&&i.getMaxY()<=this._maxy}}else if(arguments.length===2){var s=arguments[0],l=arguments[1];return!this.isNull()&&s>=this._minx&&s<=this._maxx&&l>=this._miny&&l<=this._maxy}},Xt.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof Xt){var n=arguments[0];return!this.isNull()&&!n.isNull()&&!(n._minx>this._maxx||n._maxx<this._minx||n._miny>this._maxy||n._maxy<this._miny)}if(arguments[0]instanceof D){var i=arguments[0];return this.intersects(i.x,i.y)}}else if(arguments.length===2){var s=arguments[0],l=arguments[1];return!this.isNull()&&!(s>this._maxx||s<this._minx||l>this._maxy||l<this._miny)}},Xt.prototype.getMinY=function(){return this._miny},Xt.prototype.getMinX=function(){return this._minx},Xt.prototype.expandToInclude=function(){if(arguments.length===1){if(arguments[0]instanceof D){var n=arguments[0];this.expandToInclude(n.x,n.y)}else if(arguments[0]instanceof Xt){var i=arguments[0];if(i.isNull())return null;this.isNull()?(this._minx=i.getMinX(),this._maxx=i.getMaxX(),this._miny=i.getMinY(),this._maxy=i.getMaxY()):(i._minx<this._minx&&(this._minx=i._minx),i._maxx>this._maxx&&(this._maxx=i._maxx),i._miny<this._miny&&(this._miny=i._miny),i._maxy>this._maxy&&(this._maxy=i._maxy))}}else if(arguments.length===2){var s=arguments[0],l=arguments[1];this.isNull()?(this._minx=s,this._maxx=s,this._miny=l,this._maxy=l):(s<this._minx&&(this._minx=s),s>this._maxx&&(this._maxx=s),l<this._miny&&(this._miny=l),l>this._maxy&&(this._maxy=l))}},Xt.prototype.minExtent=function(){if(this.isNull())return 0;var n=this.getWidth(),i=this.getHeight();return n<i?n:i},Xt.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},Xt.prototype.compareTo=function(n){var i=n;return this.isNull()?i.isNull()?0:-1:i.isNull()?1:this._minx<i._minx?-1:this._minx>i._minx?1:this._miny<i._miny?-1:this._miny>i._miny?1:this._maxx<i._maxx?-1:this._maxx>i._maxx?1:this._maxy<i._maxy?-1:this._maxy>i._maxy?1:0},Xt.prototype.translate=function(n,i){if(this.isNull())return null;this.init(this.getMinX()+n,this.getMaxX()+n,this.getMinY()+i,this.getMaxY()+i)},Xt.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},Xt.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},Xt.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},Xt.prototype.maxExtent=function(){if(this.isNull())return 0;var n=this.getWidth(),i=this.getHeight();return n>i?n:i},Xt.prototype.expandBy=function(){if(arguments.length===1){var n=arguments[0];this.expandBy(n,n)}else if(arguments.length===2){var i=arguments[0],s=arguments[1];if(this.isNull())return null;this._minx-=i,this._maxx+=i,this._miny-=s,this._maxy+=s,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},Xt.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof Xt){var n=arguments[0];return this.covers(n)}if(arguments[0]instanceof D){var i=arguments[0];return this.covers(i)}}else if(arguments.length===2){var s=arguments[0],l=arguments[1];return this.covers(s,l)}},Xt.prototype.centre=function(){return this.isNull()?null:new D((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},Xt.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof D){var n=arguments[0];this.init(n.x,n.x,n.y,n.y)}else if(arguments[0]instanceof Xt){var i=arguments[0];this._minx=i._minx,this._maxx=i._maxx,this._miny=i._miny,this._maxy=i._maxy}}else if(arguments.length===2){var s=arguments[0],l=arguments[1];this.init(s.x,l.x,s.y,l.y)}else if(arguments.length===4){var h=arguments[0],v=arguments[1],S=arguments[2],R=arguments[3];h<v?(this._minx=h,this._maxx=v):(this._minx=v,this._maxx=h),S<R?(this._miny=S,this._maxy=R):(this._miny=R,this._maxy=S)}},Xt.prototype.getMaxY=function(){return this._maxy},Xt.prototype.distance=function(n){if(this.intersects(n))return 0;var i=0;this._maxx<n._minx?i=n._minx-this._maxx:this._minx>n._maxx&&(i=this._minx-n._maxx);var s=0;return this._maxy<n._miny?s=n._miny-this._maxy:this._miny>n._maxy&&(s=this._miny-n._maxy),i===0?s:s===0?i:Math.sqrt(i*i+s*s)},Xt.prototype.hashCode=function(){var n=17;return n=37*n+D.hashCode(this._minx),n=37*n+D.hashCode(this._maxx),n=37*n+D.hashCode(this._miny),n=37*n+D.hashCode(this._maxy)},Xt.prototype.interfaces_=function(){return[z,t]},Xt.prototype.getClass=function(){return Xt},Xt.intersects=function(){if(arguments.length===3){var n=arguments[0],i=arguments[1],s=arguments[2];return s.x>=(n.x<i.x?n.x:i.x)&&s.x<=(n.x>i.x?n.x:i.x)&&s.y>=(n.y<i.y?n.y:i.y)&&s.y<=(n.y>i.y?n.y:i.y)}if(arguments.length===4){var l=arguments[0],h=arguments[1],v=arguments[2],S=arguments[3],R=Math.min(v.x,S.x),V=Math.max(v.x,S.x),ot=Math.min(l.x,h.x),St=Math.max(l.x,h.x);return!(ot>V)&&!(St<R)&&(R=Math.min(v.y,S.y),V=Math.max(v.y,S.y),ot=Math.min(l.y,h.y),St=Math.max(l.y,h.y),!(ot>V)&&!(St<R))}},Ee.serialVersionUID.get=function(){return 5873921885273102e3},Object.defineProperties(Xt,Ee);var ft={typeStr:/^\\s*(\\w+)\\s*\\(\\s*(.*)\\s*\\)\\s*$/,emptyTypeStr:/^\\s*(\\w+)\\s*EMPTY\\s*$/,spaces:/\\s+/,parenComma:/\\)\\s*,\\s*\\(/,doubleParenComma:/\\)\\s*\\)\\s*,\\s*\\(\\s*\\(/,trimParens:/^\\s*\\(?(.*?)\\)?\\s*$/},He=function(n){this.geometryFactory=n||new Ce};He.prototype.read=function(n){var i,s,l;n=n.replace(/[\\n\\r]/g," ");var h=ft.typeStr.exec(n);if(n.search("EMPTY")!==-1&&((h=ft.emptyTypeStr.exec(n))[2]=void 0),h&&(s=h[1].toLowerCase(),l=h[2],fe[s]&&(i=fe[s].apply(this,[l]))),i===void 0)throw new Error("Could not parse WKT "+n);return i},He.prototype.write=function(n){return this.extractGeometry(n)},He.prototype.extractGeometry=function(n){var i=n.getGeometryType().toLowerCase();if(!te[i])return null;var s=i.toUpperCase();return n.isEmpty()?s+" EMPTY":s+"("+te[i].apply(this,[n])+")"};var te={coordinate:function(n){return n.x+" "+n.y},point:function(n){return te.coordinate.call(this,n._coordinates._coordinates[0])},multipoint:function(n){for(var i=[],s=0,l=n._geometries.length;s<l;++s)i.push("("+te.point.apply(this,[n._geometries[s]])+")");return i.join(",")},linestring:function(n){for(var i=[],s=0,l=n._points._coordinates.length;s<l;++s)i.push(te.coordinate.apply(this,[n._points._coordinates[s]]));return i.join(",")},linearring:function(n){for(var i=[],s=0,l=n._points._coordinates.length;s<l;++s)i.push(te.coordinate.apply(this,[n._points._coordinates[s]]));return i.join(",")},multilinestring:function(n){for(var i=[],s=0,l=n._geometries.length;s<l;++s)i.push("("+te.linestring.apply(this,[n._geometries[s]])+")");return i.join(",")},polygon:function(n){var i=[];i.push("("+te.linestring.apply(this,[n._shell])+")");for(var s=0,l=n._holes.length;s<l;++s)i.push("("+te.linestring.apply(this,[n._holes[s]])+")");return i.join(",")},multipolygon:function(n){for(var i=[],s=0,l=n._geometries.length;s<l;++s)i.push("("+te.polygon.apply(this,[n._geometries[s]])+")");return i.join(",")},geometrycollection:function(n){for(var i=[],s=0,l=n._geometries.length;s<l;++s)i.push(this.extractGeometry(n._geometries[s]));return i.join(",")}},fe={point:function(n){if(n===void 0)return this.geometryFactory.createPoint();var i=n.trim().split(ft.spaces);return this.geometryFactory.createPoint(new D(Number.parseFloat(i[0]),Number.parseFloat(i[1])))},multipoint:function(n){if(n===void 0)return this.geometryFactory.createMultiPoint();for(var i,s=n.trim().split(","),l=[],h=0,v=s.length;h<v;++h)i=s[h].replace(ft.trimParens,"$1"),l.push(fe.point.apply(this,[i]));return this.geometryFactory.createMultiPoint(l)},linestring:function(n){if(n===void 0)return this.geometryFactory.createLineString();for(var i,s=n.trim().split(","),l=[],h=0,v=s.length;h<v;++h)i=s[h].trim().split(ft.spaces),l.push(new D(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLineString(l)},linearring:function(n){if(n===void 0)return this.geometryFactory.createLinearRing();for(var i,s=n.trim().split(","),l=[],h=0,v=s.length;h<v;++h)i=s[h].trim().split(ft.spaces),l.push(new D(Number.parseFloat(i[0]),Number.parseFloat(i[1])));return this.geometryFactory.createLinearRing(l)},multilinestring:function(n){if(n===void 0)return this.geometryFactory.createMultiLineString();for(var i,s=n.trim().split(ft.parenComma),l=[],h=0,v=s.length;h<v;++h)i=s[h].replace(ft.trimParens,"$1"),l.push(fe.linestring.apply(this,[i]));return this.geometryFactory.createMultiLineString(l)},polygon:function(n){if(n===void 0)return this.geometryFactory.createPolygon();for(var i,s,l,h,v=n.trim().split(ft.parenComma),S=[],R=0,V=v.length;R<V;++R)i=v[R].replace(ft.trimParens,"$1"),s=fe.linestring.apply(this,[i]),l=this.geometryFactory.createLinearRing(s._points),R===0?h=l:S.push(l);return this.geometryFactory.createPolygon(h,S)},multipolygon:function(n){if(n===void 0)return this.geometryFactory.createMultiPolygon();for(var i,s=n.trim().split(ft.doubleParenComma),l=[],h=0,v=s.length;h<v;++h)i=s[h].replace(ft.trimParens,"$1"),l.push(fe.polygon.apply(this,[i]));return this.geometryFactory.createMultiPolygon(l)},geometrycollection:function(n){if(n===void 0)return this.geometryFactory.createGeometryCollection();for(var i=(n=n.replace(/,\\s*([A-Za-z])/g,"|$1")).trim().split("|"),s=[],l=0,h=i.length;l<h;++l)s.push(this.read(i[l]));return this.geometryFactory.createGeometryCollection(s)}},de=function(n){this.parser=new He(n)};de.prototype.write=function(n){return this.parser.write(n)},de.toLineString=function(n,i){if(arguments.length!==2)throw new Error("Not implemented");return"LINESTRING ( "+n.x+" "+n.y+", "+i.x+" "+i.y+" )"};var Ue=function(n){function i(s){n.call(this,s),this.name="RuntimeException",this.message=s,this.stack=new n().stack}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i}(Error),be=function(n){function i(){if(n.call(this),arguments.length===0)n.call(this);else if(arguments.length===1){var s=arguments[0];n.call(this,s)}}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(Ue),kt=function(){};kt.prototype.interfaces_=function(){return[]},kt.prototype.getClass=function(){return kt},kt.shouldNeverReachHere=function(){if(arguments.length===0)kt.shouldNeverReachHere(null);else if(arguments.length===1){var n=arguments[0];throw new be("Should never reach here"+(n!==null?": "+n:""))}},kt.isTrue=function(){var n,i;if(arguments.length===1)n=arguments[0],kt.isTrue(n,null);else if(arguments.length===2&&(n=arguments[0],i=arguments[1],!n))throw i===null?new be:new be(i)},kt.equals=function(){var n,i,s;if(arguments.length===2)n=arguments[0],i=arguments[1],kt.equals(n,i,null);else if(arguments.length===3&&(n=arguments[0],i=arguments[1],s=arguments[2],!i.equals(n)))throw new be("Expected "+n+" but encountered "+i+(s!==null?": "+s:""))};var ye=function(){this._result=null,this._inputLines=Array(2).fill().map(function(){return Array(2)}),this._intPt=new Array(2).fill(null),this._intLineIndex=null,this._isProper=null,this._pa=null,this._pb=null,this._precisionModel=null,this._intPt[0]=new D,this._intPt[1]=new D,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},Vn={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};ye.prototype.getIndexAlongSegment=function(n,i){return this.computeIntLineIndex(),this._intLineIndex[n][i]},ye.prototype.getTopologySummary=function(){var n=new Pt;return this.isEndPoint()&&n.append(" endpoint"),this._isProper&&n.append(" proper"),this.isCollinear()&&n.append(" collinear"),n.toString()},ye.prototype.computeIntersection=function(n,i,s,l){this._inputLines[0][0]=n,this._inputLines[0][1]=i,this._inputLines[1][0]=s,this._inputLines[1][1]=l,this._result=this.computeIntersect(n,i,s,l)},ye.prototype.getIntersectionNum=function(){return this._result},ye.prototype.computeIntLineIndex=function(){if(arguments.length===0)this._intLineIndex===null&&(this._intLineIndex=Array(2).fill().map(function(){return Array(2)}),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(arguments.length===1){var n=arguments[0];this.getEdgeDistance(n,0)>this.getEdgeDistance(n,1)?(this._intLineIndex[n][0]=0,this._intLineIndex[n][1]=1):(this._intLineIndex[n][0]=1,this._intLineIndex[n][1]=0)}},ye.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},ye.prototype.setPrecisionModel=function(n){this._precisionModel=n},ye.prototype.isInteriorIntersection=function(){if(arguments.length===0)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(arguments.length===1){for(var n=arguments[0],i=0;i<this._result;i++)if(!this._intPt[i].equals2D(this._inputLines[n][0])&&!this._intPt[i].equals2D(this._inputLines[n][1]))return!0;return!1}},ye.prototype.getIntersection=function(n){return this._intPt[n]},ye.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},ye.prototype.hasIntersection=function(){return this._result!==ye.NO_INTERSECTION},ye.prototype.getEdgeDistance=function(n,i){return ye.computeEdgeDistance(this._intPt[i],this._inputLines[n][0],this._inputLines[n][1])},ye.prototype.isCollinear=function(){return this._result===ye.COLLINEAR_INTERSECTION},ye.prototype.toString=function(){return de.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+de.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},ye.prototype.getEndpoint=function(n,i){return this._inputLines[n][i]},ye.prototype.isIntersection=function(n){for(var i=0;i<this._result;i++)if(this._intPt[i].equals2D(n))return!0;return!1},ye.prototype.getIntersectionAlongSegment=function(n,i){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[n][i]]},ye.prototype.interfaces_=function(){return[]},ye.prototype.getClass=function(){return ye},ye.computeEdgeDistance=function(n,i,s){var l=Math.abs(s.x-i.x),h=Math.abs(s.y-i.y),v=-1;if(n.equals(i))v=0;else if(n.equals(s))v=l>h?l:h;else{var S=Math.abs(n.x-i.x),R=Math.abs(n.y-i.y);(v=l>h?S:R)!==0||n.equals(i)||(v=Math.max(S,R))}return kt.isTrue(!(v===0&&!n.equals(i)),"Bad distance calculation"),v},ye.nonRobustComputeEdgeDistance=function(n,i,s){var l=n.x-i.x,h=n.y-i.y,v=Math.sqrt(l*l+h*h);return kt.isTrue(!(v===0&&!n.equals(i)),"Invalid distance calculation"),v},Vn.DONT_INTERSECT.get=function(){return 0},Vn.DO_INTERSECT.get=function(){return 1},Vn.COLLINEAR.get=function(){return 2},Vn.NO_INTERSECTION.get=function(){return 0},Vn.POINT_INTERSECTION.get=function(){return 1},Vn.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(ye,Vn);var $n=function(n){function i(){n.apply(this,arguments)}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.isInSegmentEnvelopes=function(s){var l=new Xt(this._inputLines[0][0],this._inputLines[0][1]),h=new Xt(this._inputLines[1][0],this._inputLines[1][1]);return l.contains(s)&&h.contains(s)},i.prototype.computeIntersection=function(){if(arguments.length!==3)return n.prototype.computeIntersection.apply(this,arguments);var s=arguments[0],l=arguments[1],h=arguments[2];if(this._isProper=!1,Xt.intersects(l,h,s)&&rt.orientationIndex(l,h,s)===0&&rt.orientationIndex(h,l,s)===0)return this._isProper=!0,(s.equals(l)||s.equals(h))&&(this._isProper=!1),this._result=n.POINT_INTERSECTION,null;this._result=n.NO_INTERSECTION},i.prototype.normalizeToMinimum=function(s,l,h,v,S){S.x=this.smallestInAbsValue(s.x,l.x,h.x,v.x),S.y=this.smallestInAbsValue(s.y,l.y,h.y,v.y),s.x-=S.x,s.y-=S.y,l.x-=S.x,l.y-=S.y,h.x-=S.x,h.y-=S.y,v.x-=S.x,v.y-=S.y},i.prototype.safeHCoordinateIntersection=function(s,l,h,v){var S=null;try{S=me.intersection(s,l,h,v)}catch(R){if(!(R instanceof le))throw R;S=i.nearestEndpoint(s,l,h,v)}return S},i.prototype.intersection=function(s,l,h,v){var S=this.intersectionWithNormalization(s,l,h,v);return this.isInSegmentEnvelopes(S)||(S=new D(i.nearestEndpoint(s,l,h,v))),this._precisionModel!==null&&this._precisionModel.makePrecise(S),S},i.prototype.smallestInAbsValue=function(s,l,h,v){var S=s,R=Math.abs(S);return Math.abs(l)<R&&(S=l,R=Math.abs(l)),Math.abs(h)<R&&(S=h,R=Math.abs(h)),Math.abs(v)<R&&(S=v),S},i.prototype.checkDD=function(s,l,h,v,S){var R=Mt.intersection(s,l,h,v),V=this.isInSegmentEnvelopes(R);Qt.out.println("DD in env = "+V+" --------------------- "+R),S.distance(R)>1e-4&&Qt.out.println("Distance = "+S.distance(R))},i.prototype.intersectionWithNormalization=function(s,l,h,v){var S=new D(s),R=new D(l),V=new D(h),ot=new D(v),St=new D;this.normalizeToEnvCentre(S,R,V,ot,St);var bt=this.safeHCoordinateIntersection(S,R,V,ot);return bt.x+=St.x,bt.y+=St.y,bt},i.prototype.computeCollinearIntersection=function(s,l,h,v){var S=Xt.intersects(s,l,h),R=Xt.intersects(s,l,v),V=Xt.intersects(h,v,s),ot=Xt.intersects(h,v,l);return S&&R?(this._intPt[0]=h,this._intPt[1]=v,n.COLLINEAR_INTERSECTION):V&&ot?(this._intPt[0]=s,this._intPt[1]=l,n.COLLINEAR_INTERSECTION):S&&V?(this._intPt[0]=h,this._intPt[1]=s,!h.equals(s)||R||ot?n.COLLINEAR_INTERSECTION:n.POINT_INTERSECTION):S&&ot?(this._intPt[0]=h,this._intPt[1]=l,!h.equals(l)||R||V?n.COLLINEAR_INTERSECTION:n.POINT_INTERSECTION):R&&V?(this._intPt[0]=v,this._intPt[1]=s,!v.equals(s)||S||ot?n.COLLINEAR_INTERSECTION:n.POINT_INTERSECTION):R&&ot?(this._intPt[0]=v,this._intPt[1]=l,!v.equals(l)||S||V?n.COLLINEAR_INTERSECTION:n.POINT_INTERSECTION):n.NO_INTERSECTION},i.prototype.normalizeToEnvCentre=function(s,l,h,v,S){var R=s.x<l.x?s.x:l.x,V=s.y<l.y?s.y:l.y,ot=s.x>l.x?s.x:l.x,St=s.y>l.y?s.y:l.y,bt=h.x<v.x?h.x:v.x,Yt=h.y<v.y?h.y:v.y,Jt=h.x>v.x?h.x:v.x,se=h.y>v.y?h.y:v.y,_e=((R>bt?R:bt)+(ot<Jt?ot:Jt))/2,Cn=((V>Yt?V:Yt)+(St<se?St:se))/2;S.x=_e,S.y=Cn,s.x-=S.x,s.y-=S.y,l.x-=S.x,l.y-=S.y,h.x-=S.x,h.y-=S.y,v.x-=S.x,v.y-=S.y},i.prototype.computeIntersect=function(s,l,h,v){if(this._isProper=!1,!Xt.intersects(s,l,h,v))return n.NO_INTERSECTION;var S=rt.orientationIndex(s,l,h),R=rt.orientationIndex(s,l,v);if(S>0&&R>0||S<0&&R<0)return n.NO_INTERSECTION;var V=rt.orientationIndex(h,v,s),ot=rt.orientationIndex(h,v,l);return V>0&&ot>0||V<0&&ot<0?n.NO_INTERSECTION:S===0&&R===0&&V===0&&ot===0?this.computeCollinearIntersection(s,l,h,v):(S===0||R===0||V===0||ot===0?(this._isProper=!1,s.equals2D(h)||s.equals2D(v)?this._intPt[0]=s:l.equals2D(h)||l.equals2D(v)?this._intPt[0]=l:S===0?this._intPt[0]=new D(h):R===0?this._intPt[0]=new D(v):V===0?this._intPt[0]=new D(s):ot===0&&(this._intPt[0]=new D(l))):(this._isProper=!0,this._intPt[0]=this.intersection(s,l,h,v)),n.POINT_INTERSECTION)},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i.nearestEndpoint=function(s,l,h,v){var S=s,R=rt.distancePointLine(s,h,v),V=rt.distancePointLine(l,h,v);return V<R&&(R=V,S=l),(V=rt.distancePointLine(h,s,l))<R&&(R=V,S=h),(V=rt.distancePointLine(v,s,l))<R&&(R=V,S=v),S},i}(ye),j=function(){};j.prototype.interfaces_=function(){return[]},j.prototype.getClass=function(){return j},j.orientationIndex=function(n,i,s){var l=i.x-n.x,h=i.y-n.y,v=s.x-i.x,S=s.y-i.y;return j.signOfDet2x2(l,h,v,S)},j.signOfDet2x2=function(n,i,s,l){var h=null,v=null,S=null;if(h=1,n===0||l===0)return i===0||s===0?0:i>0?s>0?-h:h:s>0?h:-h;if(i===0||s===0)return l>0?n>0?h:-h:n>0?-h:h;if(i>0?l>0?i<=l||(h=-h,v=n,n=s,s=v,v=i,i=l,l=v):i<=-l?(h=-h,s=-s,l=-l):(v=n,n=-s,s=v,v=i,i=-l,l=v):l>0?-i<=l?(h=-h,n=-n,i=-i):(v=-n,n=s,s=v,v=-i,i=l,l=v):i>=l?(n=-n,i=-i,s=-s,l=-l):(h=-h,v=-n,n=-s,s=v,v=-i,i=-l,l=v),n>0){if(!(s>0)||!(n<=s))return h}else{if(s>0||!(n>=s))return-h;h=-h,n=-n,s=-s}for(;;){if(S=Math.floor(s/n),s-=S*n,(l-=S*i)<0)return-h;if(l>i)return h;if(n>s+s){if(i<l+l)return h}else{if(i>l+l)return-h;s=n-s,l=i-l,h=-h}if(l===0)return s===0?0:-h;if(s===0||(S=Math.floor(n/s),n-=S*s,(i-=S*l)<0))return h;if(i>l)return-h;if(s>n+n){if(l<i+i)return-h}else{if(l>i+i)return h;n=s-n,i=l-i,h=-h}if(i===0)return n===0?0:h;if(n===0)return-h}};var H=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var n=arguments[0];this._p=n};H.prototype.countSegment=function(n,i){if(n.x<this._p.x&&i.x<this._p.x)return null;if(this._p.x===i.x&&this._p.y===i.y)return this._isPointOnSegment=!0,null;if(n.y===this._p.y&&i.y===this._p.y){var s=n.x,l=i.x;return s>l&&(s=i.x,l=n.x),this._p.x>=s&&this._p.x<=l&&(this._isPointOnSegment=!0),null}if(n.y>this._p.y&&i.y<=this._p.y||i.y>this._p.y&&n.y<=this._p.y){var h=n.x-this._p.x,v=n.y-this._p.y,S=i.x-this._p.x,R=i.y-this._p.y,V=j.signOfDet2x2(h,v,S,R);if(V===0)return this._isPointOnSegment=!0,null;R<v&&(V=-V),V>0&&this._crossingCount++}},H.prototype.isPointInPolygon=function(){return this.getLocation()!==Z.EXTERIOR},H.prototype.getLocation=function(){return this._isPointOnSegment?Z.BOUNDARY:this._crossingCount%2==1?Z.INTERIOR:Z.EXTERIOR},H.prototype.isOnSegment=function(){return this._isPointOnSegment},H.prototype.interfaces_=function(){return[]},H.prototype.getClass=function(){return H},H.locatePointInRing=function(){if(arguments[0]instanceof D&&et(arguments[1],At)){for(var n=arguments[0],i=arguments[1],s=new H(n),l=new D,h=new D,v=1;v<i.size();v++)if(i.getCoordinate(v,l),i.getCoordinate(v-1,h),s.countSegment(l,h),s.isOnSegment())return s.getLocation();return s.getLocation()}if(arguments[0]instanceof D&&arguments[1]instanceof Array){for(var S=arguments[0],R=arguments[1],V=new H(S),ot=1;ot<R.length;ot++){var St=R[ot],bt=R[ot-1];if(V.countSegment(St,bt),V.isOnSegment())return V.getLocation()}return V.getLocation()}};var rt=function(){},Wt={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};rt.prototype.interfaces_=function(){return[]},rt.prototype.getClass=function(){return rt},rt.orientationIndex=function(n,i,s){return Mt.orientationIndex(n,i,s)},rt.signedArea=function(){if(arguments[0]instanceof Array){var n=arguments[0];if(n.length<3)return 0;for(var i=0,s=n[0].x,l=1;l<n.length-1;l++){var h=n[l].x-s,v=n[l+1].y;i+=h*(n[l-1].y-v)}return i/2}if(et(arguments[0],At)){var S=arguments[0],R=S.size();if(R<3)return 0;var V=new D,ot=new D,St=new D;S.getCoordinate(0,ot),S.getCoordinate(1,St);var bt=ot.x;St.x-=bt;for(var Yt=0,Jt=1;Jt<R-1;Jt++)V.y=ot.y,ot.x=St.x,ot.y=St.y,S.getCoordinate(Jt+1,St),St.x-=bt,Yt+=ot.x*(V.y-St.y);return Yt/2}},rt.distanceLineLine=function(n,i,s,l){if(n.equals(i))return rt.distancePointLine(n,s,l);if(s.equals(l))return rt.distancePointLine(l,n,i);var h=!1;if(Xt.intersects(n,i,s,l)){var v=(i.x-n.x)*(l.y-s.y)-(i.y-n.y)*(l.x-s.x);if(v===0)h=!0;else{var S=(n.y-s.y)*(l.x-s.x)-(n.x-s.x)*(l.y-s.y),R=((n.y-s.y)*(i.x-n.x)-(n.x-s.x)*(i.y-n.y))/v,V=S/v;(V<0||V>1||R<0||R>1)&&(h=!0)}}else h=!0;return h?vt.min(rt.distancePointLine(n,s,l),rt.distancePointLine(i,s,l),rt.distancePointLine(s,n,i),rt.distancePointLine(l,n,i)):0},rt.isPointInRing=function(n,i){return rt.locatePointInRing(n,i)!==Z.EXTERIOR},rt.computeLength=function(n){var i=n.size();if(i<=1)return 0;var s=0,l=new D;n.getCoordinate(0,l);for(var h=l.x,v=l.y,S=1;S<i;S++){n.getCoordinate(S,l);var R=l.x,V=l.y,ot=R-h,St=V-v;s+=Math.sqrt(ot*ot+St*St),h=R,v=V}return s},rt.isCCW=function(n){var i=n.length-1;if(i<3)throw new N("Ring has fewer than 4 points, so orientation cannot be determined");for(var s=n[0],l=0,h=1;h<=i;h++){var v=n[h];v.y>s.y&&(s=v,l=h)}var S=l;do(S-=1)<0&&(S=i);while(n[S].equals2D(s)&&S!==l);var R=l;do R=(R+1)%i;while(n[R].equals2D(s)&&R!==l);var V=n[S],ot=n[R];if(V.equals2D(s)||ot.equals2D(s)||V.equals2D(ot))return!1;var St=rt.computeOrientation(V,s,ot),bt=!1;return bt=St===0?V.x>ot.x:St>0,bt},rt.locatePointInRing=function(n,i){return H.locatePointInRing(n,i)},rt.distancePointLinePerpendicular=function(n,i,s){var l=(s.x-i.x)*(s.x-i.x)+(s.y-i.y)*(s.y-i.y),h=((i.y-n.y)*(s.x-i.x)-(i.x-n.x)*(s.y-i.y))/l;return Math.abs(h)*Math.sqrt(l)},rt.computeOrientation=function(n,i,s){return rt.orientationIndex(n,i,s)},rt.distancePointLine=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];if(i.length===0)throw new N("Line array must contain at least one vertex");for(var s=n.distance(i[0]),l=0;l<i.length-1;l++){var h=rt.distancePointLine(n,i[l],i[l+1]);h<s&&(s=h)}return s}if(arguments.length===3){var v=arguments[0],S=arguments[1],R=arguments[2];if(S.x===R.x&&S.y===R.y)return v.distance(S);var V=(R.x-S.x)*(R.x-S.x)+(R.y-S.y)*(R.y-S.y),ot=((v.x-S.x)*(R.x-S.x)+(v.y-S.y)*(R.y-S.y))/V;if(ot<=0)return v.distance(S);if(ot>=1)return v.distance(R);var St=((S.y-v.y)*(R.x-S.x)-(S.x-v.x)*(R.y-S.y))/V;return Math.abs(St)*Math.sqrt(V)}},rt.isOnLine=function(n,i){for(var s=new $n,l=1;l<i.length;l++){var h=i[l-1],v=i[l];if(s.computeIntersection(n,h,v),s.hasIntersection())return!0}return!1},Wt.CLOCKWISE.get=function(){return-1},Wt.RIGHT.get=function(){return rt.CLOCKWISE},Wt.COUNTERCLOCKWISE.get=function(){return 1},Wt.LEFT.get=function(){return rt.COUNTERCLOCKWISE},Wt.COLLINEAR.get=function(){return 0},Wt.STRAIGHT.get=function(){return rt.COLLINEAR},Object.defineProperties(rt,Wt);var Gt=function(){};Gt.prototype.filter=function(n){},Gt.prototype.interfaces_=function(){return[]},Gt.prototype.getClass=function(){return Gt};var Ct=function(){var n=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=n,this._SRID=n.getSRID()},he={serialVersionUID:{configurable:!0},SORTINDEX_POINT:{configurable:!0},SORTINDEX_MULTIPOINT:{configurable:!0},SORTINDEX_LINESTRING:{configurable:!0},SORTINDEX_LINEARRING:{configurable:!0},SORTINDEX_MULTILINESTRING:{configurable:!0},SORTINDEX_POLYGON:{configurable:!0},SORTINDEX_MULTIPOLYGON:{configurable:!0},SORTINDEX_GEOMETRYCOLLECTION:{configurable:!0},geometryChangedFilter:{configurable:!0}};Ct.prototype.isGeometryCollection=function(){return this.getSortIndex()===Ct.SORTINDEX_GEOMETRYCOLLECTION},Ct.prototype.getFactory=function(){return this._factory},Ct.prototype.getGeometryN=function(n){return this},Ct.prototype.getArea=function(){return 0},Ct.prototype.isRectangle=function(){return!1},Ct.prototype.equals=function(){if(arguments[0]instanceof Ct){var n=arguments[0];return n!==null&&this.equalsTopo(n)}if(arguments[0]instanceof Object){var i=arguments[0];if(!(i instanceof Ct))return!1;var s=i;return this.equalsExact(s)}},Ct.prototype.equalsExact=function(n){return this===n||this.equalsExact(n,0)},Ct.prototype.geometryChanged=function(){this.apply(Ct.geometryChangedFilter)},Ct.prototype.geometryChangedAction=function(){this._envelope=null},Ct.prototype.equalsNorm=function(n){return n!==null&&this.norm().equalsExact(n.norm())},Ct.prototype.getLength=function(){return 0},Ct.prototype.getNumGeometries=function(){return 1},Ct.prototype.compareTo=function(){if(arguments.length===1){var n=arguments[0],i=n;return this.getSortIndex()!==i.getSortIndex()?this.getSortIndex()-i.getSortIndex():this.isEmpty()&&i.isEmpty()?0:this.isEmpty()?-1:i.isEmpty()?1:this.compareToSameClass(n)}if(arguments.length===2){var s=arguments[0],l=arguments[1];return this.getSortIndex()!==s.getSortIndex()?this.getSortIndex()-s.getSortIndex():this.isEmpty()&&s.isEmpty()?0:this.isEmpty()?-1:s.isEmpty()?1:this.compareToSameClass(s,l)}},Ct.prototype.getUserData=function(){return this._userData},Ct.prototype.getSRID=function(){return this._SRID},Ct.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},Ct.prototype.checkNotGeometryCollection=function(n){if(n.getSortIndex()===Ct.SORTINDEX_GEOMETRYCOLLECTION)throw new N("This method does not support GeometryCollection arguments")},Ct.prototype.equal=function(n,i,s){return s===0?n.equals(i):n.distance(i)<=s},Ct.prototype.norm=function(){var n=this.copy();return n.normalize(),n},Ct.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},Ct.prototype.getEnvelopeInternal=function(){return this._envelope===null&&(this._envelope=this.computeEnvelopeInternal()),new Xt(this._envelope)},Ct.prototype.setSRID=function(n){this._SRID=n},Ct.prototype.setUserData=function(n){this._userData=n},Ct.prototype.compare=function(n,i){for(var s=n.iterator(),l=i.iterator();s.hasNext()&&l.hasNext();){var h=s.next(),v=l.next(),S=h.compareTo(v);if(S!==0)return S}return s.hasNext()?1:l.hasNext()?-1:0},Ct.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},Ct.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===Ct.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===Ct.SORTINDEX_MULTIPOINT||this.getSortIndex()===Ct.SORTINDEX_MULTILINESTRING||this.getSortIndex()===Ct.SORTINDEX_MULTIPOLYGON},Ct.prototype.interfaces_=function(){return[$,z,t]},Ct.prototype.getClass=function(){return Ct},Ct.hasNonEmptyElements=function(n){for(var i=0;i<n.length;i++)if(!n[i].isEmpty())return!0;return!1},Ct.hasNullElements=function(n){for(var i=0;i<n.length;i++)if(n[i]===null)return!0;return!1},he.serialVersionUID.get=function(){return 8763622679187377e3},he.SORTINDEX_POINT.get=function(){return 0},he.SORTINDEX_MULTIPOINT.get=function(){return 1},he.SORTINDEX_LINESTRING.get=function(){return 2},he.SORTINDEX_LINEARRING.get=function(){return 3},he.SORTINDEX_MULTILINESTRING.get=function(){return 4},he.SORTINDEX_POLYGON.get=function(){return 5},he.SORTINDEX_MULTIPOLYGON.get=function(){return 6},he.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},he.geometryChangedFilter.get=function(){return Kt},Object.defineProperties(Ct,he);var Kt=function(){};Kt.interfaces_=function(){return[Gt]},Kt.filter=function(n){n.geometryChangedAction()};var tt=function(){};tt.prototype.filter=function(n){},tt.prototype.interfaces_=function(){return[]},tt.prototype.getClass=function(){return tt};var C=function(){},L={Mod2BoundaryNodeRule:{configurable:!0},EndPointBoundaryNodeRule:{configurable:!0},MultiValentEndPointBoundaryNodeRule:{configurable:!0},MonoValentEndPointBoundaryNodeRule:{configurable:!0},MOD2_BOUNDARY_RULE:{configurable:!0},ENDPOINT_BOUNDARY_RULE:{configurable:!0},MULTIVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},MONOVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},OGC_SFS_BOUNDARY_RULE:{configurable:!0}};C.prototype.isInBoundary=function(n){},C.prototype.interfaces_=function(){return[]},C.prototype.getClass=function(){return C},L.Mod2BoundaryNodeRule.get=function(){return F},L.EndPointBoundaryNodeRule.get=function(){return J},L.MultiValentEndPointBoundaryNodeRule.get=function(){return X},L.MonoValentEndPointBoundaryNodeRule.get=function(){return pt},L.MOD2_BOUNDARY_RULE.get=function(){return new F},L.ENDPOINT_BOUNDARY_RULE.get=function(){return new J},L.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new X},L.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new pt},L.OGC_SFS_BOUNDARY_RULE.get=function(){return C.MOD2_BOUNDARY_RULE},Object.defineProperties(C,L);var F=function(){};F.prototype.isInBoundary=function(n){return n%2==1},F.prototype.interfaces_=function(){return[C]},F.prototype.getClass=function(){return F};var J=function(){};J.prototype.isInBoundary=function(n){return n>0},J.prototype.interfaces_=function(){return[C]},J.prototype.getClass=function(){return J};var X=function(){};X.prototype.isInBoundary=function(n){return n>1},X.prototype.interfaces_=function(){return[C]},X.prototype.getClass=function(){return X};var pt=function(){};pt.prototype.isInBoundary=function(n){return n===1},pt.prototype.interfaces_=function(){return[C]},pt.prototype.getClass=function(){return pt};var st=function(){};st.prototype.add=function(){},st.prototype.addAll=function(){},st.prototype.isEmpty=function(){},st.prototype.iterator=function(){},st.prototype.size=function(){},st.prototype.toArray=function(){},st.prototype.remove=function(){},(e.prototype=new Error).name="IndexOutOfBoundsException";var k=function(){};k.prototype.hasNext=function(){},k.prototype.next=function(){},k.prototype.remove=function(){};var ut=function(n){function i(){n.apply(this,arguments)}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.get=function(){},i.prototype.set=function(){},i.prototype.isEmpty=function(){},i}(st);(o.prototype=new Error).name="NoSuchElementException";var nt=function(n){function i(){n.call(this),this.array_=[],arguments[0]instanceof st&&this.addAll(arguments[0])}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.ensureCapacity=function(){},i.prototype.interfaces_=function(){return[n,st]},i.prototype.add=function(s){return arguments.length===1?this.array_.push(s):this.array_.splice(arguments[0],arguments[1]),!0},i.prototype.clear=function(){this.array_=[]},i.prototype.addAll=function(s){for(var l=s.iterator();l.hasNext();)this.add(l.next());return!0},i.prototype.set=function(s,l){var h=this.array_[s];return this.array_[s]=l,h},i.prototype.iterator=function(){return new lt(this)},i.prototype.get=function(s){if(s<0||s>=this.size())throw new e;return this.array_[s]},i.prototype.isEmpty=function(){return this.array_.length===0},i.prototype.size=function(){return this.array_.length},i.prototype.toArray=function(){for(var s=[],l=0,h=this.array_.length;l<h;l++)s.push(this.array_[l]);return s},i.prototype.remove=function(s){for(var l=!1,h=0,v=this.array_.length;h<v;h++)if(this.array_[h]===s){this.array_.splice(h,1),l=!0;break}return l},i}(ut),lt=function(n){function i(s){n.call(this),this.arrayList_=s,this.position_=0}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new o;return this.arrayList_.get(this.position_++)},i.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},i.prototype.set=function(s){return this.arrayList_.set(this.position_-1,s)},i.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},i}(k),dt=function(n){function i(){if(n.call(this),arguments.length!==0){if(arguments.length===1){var l=arguments[0];this.ensureCapacity(l.length),this.add(l,!0)}else if(arguments.length===2){var h=arguments[0],v=arguments[1];this.ensureCapacity(h.length),this.add(h,v)}}}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={coordArrayType:{configurable:!0}};return s.coordArrayType.get=function(){return new Array(0).fill(null)},i.prototype.getCoordinate=function(l){return this.get(l)},i.prototype.addAll=function(){if(arguments.length===2){for(var l=arguments[0],h=arguments[1],v=!1,S=l.iterator();S.hasNext();)this.add(S.next(),h),v=!0;return v}return n.prototype.addAll.apply(this,arguments)},i.prototype.clone=function(){for(var l=n.prototype.clone.call(this),h=0;h<this.size();h++)l.add(h,this.get(h).copy());return l},i.prototype.toCoordinateArray=function(){return this.toArray(i.coordArrayType)},i.prototype.add=function(){if(arguments.length===1){var l=arguments[0];n.prototype.add.call(this,l)}else if(arguments.length===2){if(arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var h=arguments[0],v=arguments[1];return this.add(h,v,!0),!0}if(arguments[0]instanceof D&&typeof arguments[1]=="boolean"){var S=arguments[0];if(!arguments[1]&&this.size()>=1&&this.get(this.size()-1).equals2D(S))return null;n.prototype.add.call(this,S)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var R=arguments[0],V=arguments[1];return this.add(R,V),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var ot=arguments[0],St=arguments[1];if(arguments[2])for(var bt=0;bt<ot.length;bt++)this.add(ot[bt],St);else for(var Yt=ot.length-1;Yt>=0;Yt--)this.add(ot[Yt],St);return!0}if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof D){var Jt=arguments[0],se=arguments[1];if(!arguments[2]){var _e=this.size();if(_e>0&&(Jt>0&&this.get(Jt-1).equals2D(se)||Jt<_e&&this.get(Jt).equals2D(se)))return null}n.prototype.add.call(this,Jt,se)}}else if(arguments.length===4){var Cn=arguments[0],Xn=arguments[1],ui=arguments[2],rs=arguments[3],Fs=1;ui>rs&&(Fs=-1);for(var Dc=ui;Dc!==rs;Dc+=Fs)this.add(Cn[Dc],Xn);return!0}},i.prototype.closeRing=function(){this.size()>0&&this.add(new D(this.get(0)),!1)},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},Object.defineProperties(i,s),i}(nt),at=function(){},Bt={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};Bt.ForwardComparator.get=function(){return qt},Bt.BidirectionalComparator.get=function(){return we},Bt.coordArrayType.get=function(){return new Array(0).fill(null)},at.prototype.interfaces_=function(){return[]},at.prototype.getClass=function(){return at},at.isRing=function(n){return!(n.length<4)&&!!n[0].equals2D(n[n.length-1])},at.ptNotInList=function(n,i){for(var s=0;s<n.length;s++){var l=n[s];if(at.indexOf(l,i)<0)return l}return null},at.scroll=function(n,i){var s=at.indexOf(i,n);if(s<0)return null;var l=new Array(n.length).fill(null);Qt.arraycopy(n,s,l,0,n.length-s),Qt.arraycopy(n,0,l,n.length-s,s),Qt.arraycopy(l,0,n,0,n.length)},at.equals=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];if(n===i)return!0;if(n===null||i===null||n.length!==i.length)return!1;for(var s=0;s<n.length;s++)if(!n[s].equals(i[s]))return!1;return!0}if(arguments.length===3){var l=arguments[0],h=arguments[1],v=arguments[2];if(l===h)return!0;if(l===null||h===null||l.length!==h.length)return!1;for(var S=0;S<l.length;S++)if(v.compare(l[S],h[S])!==0)return!1;return!0}},at.intersection=function(n,i){for(var s=new dt,l=0;l<n.length;l++)i.intersects(n[l])&&s.add(n[l],!0);return s.toCoordinateArray()},at.hasRepeatedPoints=function(n){for(var i=1;i<n.length;i++)if(n[i-1].equals(n[i]))return!0;return!1},at.removeRepeatedPoints=function(n){return at.hasRepeatedPoints(n)?new dt(n,!1).toCoordinateArray():n},at.reverse=function(n){for(var i=n.length-1,s=Math.trunc(i/2),l=0;l<=s;l++){var h=n[l];n[l]=n[i-l],n[i-l]=h}},at.removeNull=function(n){for(var i=0,s=0;s<n.length;s++)n[s]!==null&&i++;var l=new Array(i).fill(null);if(i===0)return l;for(var h=0,v=0;v<n.length;v++)n[v]!==null&&(l[h++]=n[v]);return l},at.copyDeep=function(){if(arguments.length===1){for(var n=arguments[0],i=new Array(n.length).fill(null),s=0;s<n.length;s++)i[s]=new D(n[s]);return i}if(arguments.length===5)for(var l=arguments[0],h=arguments[1],v=arguments[2],S=arguments[3],R=arguments[4],V=0;V<R;V++)v[S+V]=new D(l[h+V])},at.isEqualReversed=function(n,i){for(var s=0;s<n.length;s++){var l=n[s],h=i[n.length-s-1];if(l.compareTo(h)!==0)return!1}return!0},at.envelope=function(n){for(var i=new Xt,s=0;s<n.length;s++)i.expandToInclude(n[s]);return i},at.toCoordinateArray=function(n){return n.toArray(at.coordArrayType)},at.atLeastNCoordinatesOrNothing=function(n,i){return i.length>=n?i:[]},at.indexOf=function(n,i){for(var s=0;s<i.length;s++)if(n.equals(i[s]))return s;return-1},at.increasingDirection=function(n){for(var i=0;i<Math.trunc(n.length/2);i++){var s=n.length-1-i,l=n[i].compareTo(n[s]);if(l!==0)return l}return 1},at.compare=function(n,i){for(var s=0;s<n.length&&s<i.length;){var l=n[s].compareTo(i[s]);if(l!==0)return l;s++}return s<i.length?-1:s<n.length?1:0},at.minCoordinate=function(n){for(var i=null,s=0;s<n.length;s++)(i===null||i.compareTo(n[s])>0)&&(i=n[s]);return i},at.extract=function(n,i,s){i=vt.clamp(i,0,n.length);var l=(s=vt.clamp(s,-1,n.length))-i+1;s<0&&(l=0),i>=n.length&&(l=0),s<i&&(l=0);var h=new Array(l).fill(null);if(l===0)return h;for(var v=0,S=i;S<=s;S++)h[v++]=n[S];return h},Object.defineProperties(at,Bt);var qt=function(){};qt.prototype.compare=function(n,i){return at.compare(n,i)},qt.prototype.interfaces_=function(){return[q]},qt.prototype.getClass=function(){return qt};var we=function(){};we.prototype.compare=function(n,i){var s=n,l=i;if(s.length<l.length)return-1;if(s.length>l.length)return 1;if(s.length===0)return 0;var h=at.compare(s,l);return at.isEqualReversed(s,l)?0:h},we.prototype.OLDcompare=function(n,i){var s=n,l=i;if(s.length<l.length)return-1;if(s.length>l.length)return 1;if(s.length===0)return 0;for(var h=at.increasingDirection(s),v=at.increasingDirection(l),S=h>0?0:s.length-1,R=v>0?0:s.length-1,V=0;V<s.length;V++){var ot=s[S].compareTo(l[R]);if(ot!==0)return ot;S+=h,R+=v}return 0},we.prototype.interfaces_=function(){return[q]},we.prototype.getClass=function(){return we};var oe=function(){};oe.prototype.get=function(){},oe.prototype.put=function(){},oe.prototype.size=function(){},oe.prototype.values=function(){},oe.prototype.entrySet=function(){};var Ve=function(n){function i(){n.apply(this,arguments)}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i}(oe);(a.prototype=new Error).name="OperationNotSupported",(c.prototype=new st).contains=function(){};var je=function(n){function i(){n.call(this),this.array_=[],arguments[0]instanceof st&&this.addAll(arguments[0])}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.contains=function(s){for(var l=0,h=this.array_.length;l<h;l++)if(this.array_[l]===s)return!0;return!1},i.prototype.add=function(s){return!this.contains(s)&&(this.array_.push(s),!0)},i.prototype.addAll=function(s){for(var l=s.iterator();l.hasNext();)this.add(l.next());return!0},i.prototype.remove=function(s){throw new Error},i.prototype.size=function(){return this.array_.length},i.prototype.isEmpty=function(){return this.array_.length===0},i.prototype.toArray=function(){for(var s=[],l=0,h=this.array_.length;l<h;l++)s.push(this.array_[l]);return s},i.prototype.iterator=function(){return new ur(this)},i}(c),ur=function(n){function i(s){n.call(this),this.hashSet_=s,this.position_=0}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new o;return this.hashSet_.array_[this.position_++]},i.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},i.prototype.remove=function(){throw new a},i}(k),Qn=0;(w.prototype=new Ve).get=function(n){for(var i=this.root_;i!==null;){var s=n.compareTo(i.key);if(s<0)i=i.left;else{if(!(s>0))return i.value;i=i.right}}return null},w.prototype.put=function(n,i){if(this.root_===null)return this.root_={key:n,value:i,left:null,right:null,parent:null,color:Qn,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var s,l,h=this.root_;do if(s=h,(l=n.compareTo(h.key))<0)h=h.left;else{if(!(l>0)){var v=h.value;return h.value=i,v}h=h.right}while(h!==null);var S={key:n,left:null,right:null,value:i,parent:s,color:Qn,getValue:function(){return this.value},getKey:function(){return this.key}};return l<0?s.left=S:s.right=S,this.fixAfterInsertion(S),this.size_++,null},w.prototype.fixAfterInsertion=function(n){for(n.color=1;n!=null&&n!==this.root_&&n.parent.color===1;)if(d(n)===y(d(d(n)))){var i=_(d(d(n)));p(i)===1?(g(d(n),Qn),g(i,Qn),g(d(d(n)),1),n=d(d(n))):(n===_(d(n))&&(n=d(n),this.rotateLeft(n)),g(d(n),Qn),g(d(d(n)),1),this.rotateRight(d(d(n))))}else{var s=y(d(d(n)));p(s)===1?(g(d(n),Qn),g(s,Qn),g(d(d(n)),1),n=d(d(n))):(n===y(d(n))&&(n=d(n),this.rotateRight(n)),g(d(n),Qn),g(d(d(n)),1),this.rotateLeft(d(d(n))))}this.root_.color=Qn},w.prototype.values=function(){var n=new nt,i=this.getFirstEntry();if(i!==null)for(n.add(i.value);(i=w.successor(i))!==null;)n.add(i.value);return n},w.prototype.entrySet=function(){var n=new je,i=this.getFirstEntry();if(i!==null)for(n.add(i);(i=w.successor(i))!==null;)n.add(i);return n},w.prototype.rotateLeft=function(n){if(n!=null){var i=n.right;n.right=i.left,i.left!=null&&(i.left.parent=n),i.parent=n.parent,n.parent===null?this.root_=i:n.parent.left===n?n.parent.left=i:n.parent.right=i,i.left=n,n.parent=i}},w.prototype.rotateRight=function(n){if(n!=null){var i=n.left;n.left=i.right,i.right!=null&&(i.right.parent=n),i.parent=n.parent,n.parent===null?this.root_=i:n.parent.right===n?n.parent.right=i:n.parent.left=i,i.right=n,n.parent=i}},w.prototype.getFirstEntry=function(){var n=this.root_;if(n!=null)for(;n.left!=null;)n=n.left;return n},w.successor=function(n){if(n===null)return null;if(n.right!==null){for(var i=n.right;i.left!==null;)i=i.left;return i}for(var s=n.parent,l=n;s!==null&&l===s.right;)l=s,s=s.parent;return s},w.prototype.size=function(){return this.size_};var wr=function(){};wr.prototype.interfaces_=function(){return[]},wr.prototype.getClass=function(){return wr},x.prototype=new c,(b.prototype=new x).contains=function(n){for(var i=0,s=this.array_.length;i<s;i++)if(this.array_[i].compareTo(n)===0)return!0;return!1},b.prototype.add=function(n){if(this.contains(n))return!1;for(var i=0,s=this.array_.length;i<s;i++)if(this.array_[i].compareTo(n)===1)return this.array_.splice(i,0,n),!0;return this.array_.push(n),!0},b.prototype.addAll=function(n){for(var i=n.iterator();i.hasNext();)this.add(i.next());return!0},b.prototype.remove=function(n){throw new a},b.prototype.size=function(){return this.array_.length},b.prototype.isEmpty=function(){return this.array_.length===0},b.prototype.toArray=function(){for(var n=[],i=0,s=this.array_.length;i<s;i++)n.push(this.array_[i]);return n},b.prototype.iterator=function(){return new Rr(this)};var Rr=function(n){this.treeSet_=n,this.position_=0};Rr.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new o;return this.treeSet_.array_[this.position_++]},Rr.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},Rr.prototype.remove=function(){throw new a};var er=function(){};er.sort=function(){var n,i,s,l,h=arguments[0];if(arguments.length===1)l=function(S,R){return S.compareTo(R)},h.sort(l);else if(arguments.length===2)s=arguments[1],l=function(S,R){return s.compare(S,R)},h.sort(l);else if(arguments.length===3){(i=h.slice(arguments[1],arguments[2])).sort();var v=h.slice(0,arguments[1]).concat(i,h.slice(arguments[2],h.length));for(h.splice(0,h.length),n=0;n<v.length;n++)h.push(v[n])}else if(arguments.length===4)for(i=h.slice(arguments[1],arguments[2]),s=arguments[3],l=function(S,R){return s.compare(S,R)},i.sort(l),v=h.slice(0,arguments[1]).concat(i,h.slice(arguments[2],h.length)),h.splice(0,h.length),n=0;n<v.length;n++)h.push(v[n])},er.asList=function(n){for(var i=new nt,s=0,l=n.length;s<l;s++)i.add(n[s]);return i};var Me=function(){},nr={P:{configurable:!0},L:{configurable:!0},A:{configurable:!0},FALSE:{configurable:!0},TRUE:{configurable:!0},DONTCARE:{configurable:!0},SYM_FALSE:{configurable:!0},SYM_TRUE:{configurable:!0},SYM_DONTCARE:{configurable:!0},SYM_P:{configurable:!0},SYM_L:{configurable:!0},SYM_A:{configurable:!0}};nr.P.get=function(){return 0},nr.L.get=function(){return 1},nr.A.get=function(){return 2},nr.FALSE.get=function(){return-1},nr.TRUE.get=function(){return-2},nr.DONTCARE.get=function(){return-3},nr.SYM_FALSE.get=function(){return"F"},nr.SYM_TRUE.get=function(){return"T"},nr.SYM_DONTCARE.get=function(){return"*"},nr.SYM_P.get=function(){return"0"},nr.SYM_L.get=function(){return"1"},nr.SYM_A.get=function(){return"2"},Me.prototype.interfaces_=function(){return[]},Me.prototype.getClass=function(){return Me},Me.toDimensionSymbol=function(n){switch(n){case Me.FALSE:return Me.SYM_FALSE;case Me.TRUE:return Me.SYM_TRUE;case Me.DONTCARE:return Me.SYM_DONTCARE;case Me.P:return Me.SYM_P;case Me.L:return Me.SYM_L;case Me.A:return Me.SYM_A}throw new N("Unknown dimension value: "+n)},Me.toDimensionValue=function(n){switch(yt.toUpperCase(n)){case Me.SYM_FALSE:return Me.FALSE;case Me.SYM_TRUE:return Me.TRUE;case Me.SYM_DONTCARE:return Me.DONTCARE;case Me.SYM_P:return Me.P;case Me.SYM_L:return Me.L;case Me.SYM_A:return Me.A}throw new N("Unknown dimension symbol: "+n)},Object.defineProperties(Me,nr);var hr=function(){};hr.prototype.filter=function(n){},hr.prototype.interfaces_=function(){return[]},hr.prototype.getClass=function(){return hr};var lr=function(){};lr.prototype.filter=function(n,i){},lr.prototype.isDone=function(){},lr.prototype.isGeometryChanged=function(){},lr.prototype.interfaces_=function(){return[]},lr.prototype.getClass=function(){return lr};var Zn=function(n){function i(l,h){if(n.call(this,h),this._geometries=l||[],n.hasNullElements(this._geometries))throw new N("geometries must not contain null elements")}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={serialVersionUID:{configurable:!0}};return i.prototype.computeEnvelopeInternal=function(){for(var l=new Xt,h=0;h<this._geometries.length;h++)l.expandToInclude(this._geometries[h].getEnvelopeInternal());return l},i.prototype.getGeometryN=function(l){return this._geometries[l]},i.prototype.getSortIndex=function(){return n.SORTINDEX_GEOMETRYCOLLECTION},i.prototype.getCoordinates=function(){for(var l=new Array(this.getNumPoints()).fill(null),h=-1,v=0;v<this._geometries.length;v++)for(var S=this._geometries[v].getCoordinates(),R=0;R<S.length;R++)l[++h]=S[R];return l},i.prototype.getArea=function(){for(var l=0,h=0;h<this._geometries.length;h++)l+=this._geometries[h].getArea();return l},i.prototype.equalsExact=function(){if(arguments.length===2){var l=arguments[0],h=arguments[1];if(!this.isEquivalentClass(l))return!1;var v=l;if(this._geometries.length!==v._geometries.length)return!1;for(var S=0;S<this._geometries.length;S++)if(!this._geometries[S].equalsExact(v._geometries[S],h))return!1;return!0}return n.prototype.equalsExact.apply(this,arguments)},i.prototype.normalize=function(){for(var l=0;l<this._geometries.length;l++)this._geometries[l].normalize();er.sort(this._geometries)},i.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},i.prototype.getBoundaryDimension=function(){for(var l=Me.FALSE,h=0;h<this._geometries.length;h++)l=Math.max(l,this._geometries[h].getBoundaryDimension());return l},i.prototype.getDimension=function(){for(var l=Me.FALSE,h=0;h<this._geometries.length;h++)l=Math.max(l,this._geometries[h].getDimension());return l},i.prototype.getLength=function(){for(var l=0,h=0;h<this._geometries.length;h++)l+=this._geometries[h].getLength();return l},i.prototype.getNumPoints=function(){for(var l=0,h=0;h<this._geometries.length;h++)l+=this._geometries[h].getNumPoints();return l},i.prototype.getNumGeometries=function(){return this._geometries.length},i.prototype.reverse=function(){for(var l=this._geometries.length,h=new Array(l).fill(null),v=0;v<this._geometries.length;v++)h[v]=this._geometries[v].reverse();return this.getFactory().createGeometryCollection(h)},i.prototype.compareToSameClass=function(){if(arguments.length===1){var l=arguments[0],h=new b(er.asList(this._geometries)),v=new b(er.asList(l._geometries));return this.compare(h,v)}if(arguments.length===2){for(var S=arguments[0],R=arguments[1],V=S,ot=this.getNumGeometries(),St=V.getNumGeometries(),bt=0;bt<ot&&bt<St;){var Yt=this.getGeometryN(bt),Jt=V.getGeometryN(bt),se=Yt.compareToSameClass(Jt,R);if(se!==0)return se;bt++}return bt<ot?1:bt<St?-1:0}},i.prototype.apply=function(){if(et(arguments[0],tt))for(var l=arguments[0],h=0;h<this._geometries.length;h++)this._geometries[h].apply(l);else if(et(arguments[0],lr)){var v=arguments[0];if(this._geometries.length===0)return null;for(var S=0;S<this._geometries.length&&(this._geometries[S].apply(v),!v.isDone());S++);v.isGeometryChanged()&&this.geometryChanged()}else if(et(arguments[0],hr)){var R=arguments[0];R.filter(this);for(var V=0;V<this._geometries.length;V++)this._geometries[V].apply(R)}else if(et(arguments[0],Gt)){var ot=arguments[0];ot.filter(this);for(var St=0;St<this._geometries.length;St++)this._geometries[St].apply(ot)}},i.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),kt.shouldNeverReachHere(),null},i.prototype.clone=function(){var l=n.prototype.clone.call(this);l._geometries=new Array(this._geometries.length).fill(null);for(var h=0;h<this._geometries.length;h++)l._geometries[h]=this._geometries[h].clone();return l},i.prototype.getGeometryType=function(){return"GeometryCollection"},i.prototype.copy=function(){for(var l=new Array(this._geometries.length).fill(null),h=0;h<l.length;h++)l[h]=this._geometries[h].copy();return new i(l,this._factory)},i.prototype.isEmpty=function(){for(var l=0;l<this._geometries.length;l++)if(!this._geometries[l].isEmpty())return!1;return!0},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},s.serialVersionUID.get=function(){return-5694727726395021e3},Object.defineProperties(i,s),i}(Ct),K=function(n){function i(){n.apply(this,arguments)}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={serialVersionUID:{configurable:!0}};return i.prototype.getSortIndex=function(){return Ct.SORTINDEX_MULTILINESTRING},i.prototype.equalsExact=function(){if(arguments.length===2){var l=arguments[0],h=arguments[1];return!!this.isEquivalentClass(l)&&n.prototype.equalsExact.call(this,l,h)}return n.prototype.equalsExact.apply(this,arguments)},i.prototype.getBoundaryDimension=function(){return this.isClosed()?Me.FALSE:0},i.prototype.isClosed=function(){if(this.isEmpty())return!1;for(var l=0;l<this._geometries.length;l++)if(!this._geometries[l].isClosed())return!1;return!0},i.prototype.getDimension=function(){return 1},i.prototype.reverse=function(){for(var l=this._geometries.length,h=new Array(l).fill(null),v=0;v<this._geometries.length;v++)h[l-1-v]=this._geometries[v].reverse();return this.getFactory().createMultiLineString(h)},i.prototype.getBoundary=function(){return new xt(this).getBoundary()},i.prototype.getGeometryType=function(){return"MultiLineString"},i.prototype.copy=function(){for(var l=new Array(this._geometries.length).fill(null),h=0;h<l.length;h++)l[h]=this._geometries[h].copy();return new i(l,this._factory)},i.prototype.interfaces_=function(){return[wr]},i.prototype.getClass=function(){return i},s.serialVersionUID.get=function(){return 8166665132445434e3},Object.defineProperties(i,s),i}(Zn),xt=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,arguments.length===1){var n=arguments[0],i=C.MOD2_BOUNDARY_RULE;this._geom=n,this._geomFact=n.getFactory(),this._bnRule=i}else if(arguments.length===2){var s=arguments[0],l=arguments[1];this._geom=s,this._geomFact=s.getFactory(),this._bnRule=l}};xt.prototype.boundaryMultiLineString=function(n){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var i=this.computeBoundaryCoordinates(n);return i.length===1?this._geomFact.createPoint(i[0]):this._geomFact.createMultiPointFromCoords(i)},xt.prototype.getBoundary=function(){return this._geom instanceof jt?this.boundaryLineString(this._geom):this._geom instanceof K?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},xt.prototype.boundaryLineString=function(n){return this._geom.isEmpty()?this.getEmptyMultiPoint():n.isClosed()?this._bnRule.isInBoundary(2)?n.getStartPoint():this._geomFact.createMultiPoint():this._geomFact.createMultiPoint([n.getStartPoint(),n.getEndPoint()])},xt.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},xt.prototype.computeBoundaryCoordinates=function(n){var i=new nt;this._endpointMap=new w;for(var s=0;s<n.getNumGeometries();s++){var l=n.getGeometryN(s);l.getNumPoints()!==0&&(this.addEndpoint(l.getCoordinateN(0)),this.addEndpoint(l.getCoordinateN(l.getNumPoints()-1)))}for(var h=this._endpointMap.entrySet().iterator();h.hasNext();){var v=h.next(),S=v.getValue().count;this._bnRule.isInBoundary(S)&&i.add(v.getKey())}return at.toCoordinateArray(i)},xt.prototype.addEndpoint=function(n){var i=this._endpointMap.get(n);i===null&&(i=new Lt,this._endpointMap.put(n,i)),i.count++},xt.prototype.interfaces_=function(){return[]},xt.prototype.getClass=function(){return xt},xt.getBoundary=function(){if(arguments.length===1){var n=arguments[0];return new xt(n).getBoundary()}if(arguments.length===2){var i=arguments[0],s=arguments[1];return new xt(i,s).getBoundary()}};var Lt=function(){this.count=null};Lt.prototype.interfaces_=function(){return[]},Lt.prototype.getClass=function(){return Lt};var wt=function(){},Ot={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};wt.prototype.interfaces_=function(){return[]},wt.prototype.getClass=function(){return wt},wt.chars=function(n,i){for(var s=new Array(i).fill(null),l=0;l<i;l++)s[l]=n;return String(s)},wt.getStackTrace=function(){if(arguments.length===1){var n=arguments[0],i=new function(){},s=new function(){}(i);return n.printStackTrace(s),i.toString()}if(arguments.length===2){for(var l=arguments[0],h=arguments[1],v="",S=new function(){}(new function(){}(wt.getStackTrace(l))),R=0;R<h;R++)try{v+=S.readLine()+wt.NEWLINE}catch(V){if(!(V instanceof P))throw V;kt.shouldNeverReachHere()}return v}},wt.split=function(n,i){for(var s=i.length,l=new nt,h=""+n,v=h.indexOf(i);v>=0;){var S=h.substring(0,v);l.add(S),v=(h=h.substring(v+s)).indexOf(i)}h.length>0&&l.add(h);for(var R=new Array(l.size()).fill(null),V=0;V<R.length;V++)R[V]=l.get(V);return R},wt.toString=function(){if(arguments.length===1){var n=arguments[0];return wt.SIMPLE_ORDINATE_FORMAT.format(n)}},wt.spaces=function(n){return wt.chars(" ",n)},Ot.NEWLINE.get=function(){return Qt.getProperty("line.separator")},Ot.SIMPLE_ORDINATE_FORMAT.get=function(){return new function(){}("0.#")},Object.defineProperties(wt,Ot);var Zt=function(){};Zt.prototype.interfaces_=function(){return[]},Zt.prototype.getClass=function(){return Zt},Zt.copyCoord=function(n,i,s,l){for(var h=Math.min(n.getDimension(),s.getDimension()),v=0;v<h;v++)s.setOrdinate(l,v,n.getOrdinate(i,v))},Zt.isRing=function(n){var i=n.size();return i===0||!(i<=3)&&n.getOrdinate(0,At.X)===n.getOrdinate(i-1,At.X)&&n.getOrdinate(0,At.Y)===n.getOrdinate(i-1,At.Y)},Zt.isEqual=function(n,i){var s=n.size();if(s!==i.size())return!1;for(var l=Math.min(n.getDimension(),i.getDimension()),h=0;h<s;h++)for(var v=0;v<l;v++){var S=n.getOrdinate(h,v),R=i.getOrdinate(h,v);if(n.getOrdinate(h,v)!==i.getOrdinate(h,v)&&(!A.isNaN(S)||!A.isNaN(R)))return!1}return!0},Zt.extend=function(n,i,s){var l=n.create(s,i.getDimension()),h=i.size();if(Zt.copy(i,0,l,0,h),h>0)for(var v=h;v<s;v++)Zt.copy(i,h-1,l,v,1);return l},Zt.reverse=function(n){for(var i=n.size()-1,s=Math.trunc(i/2),l=0;l<=s;l++)Zt.swap(n,l,i-l)},Zt.swap=function(n,i,s){if(i===s)return null;for(var l=0;l<n.getDimension();l++){var h=n.getOrdinate(i,l);n.setOrdinate(i,l,n.getOrdinate(s,l)),n.setOrdinate(s,l,h)}},Zt.copy=function(n,i,s,l,h){for(var v=0;v<h;v++)Zt.copyCoord(n,i+v,s,l+v)},Zt.toString=function(){if(arguments.length===1){var n=arguments[0],i=n.size();if(i===0)return"()";var s=n.getDimension(),l=new Pt;l.append("(");for(var h=0;h<i;h++){h>0&&l.append(" ");for(var v=0;v<s;v++)v>0&&l.append(","),l.append(wt.toString(n.getOrdinate(h,v)))}return l.append(")"),l.toString()}},Zt.ensureValidRing=function(n,i){var s=i.size();return s===0?i:s<=3?Zt.createClosedRing(n,i,4):i.getOrdinate(0,At.X)===i.getOrdinate(s-1,At.X)&&i.getOrdinate(0,At.Y)===i.getOrdinate(s-1,At.Y)?i:Zt.createClosedRing(n,i,s+1)},Zt.createClosedRing=function(n,i,s){var l=n.create(s,i.getDimension()),h=i.size();Zt.copy(i,0,l,0,h);for(var v=h;v<s;v++)Zt.copy(i,0,l,v,1);return l};var jt=function(n){function i(l,h){n.call(this,h),this._points=null,this.init(l)}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={serialVersionUID:{configurable:!0}};return i.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new Xt:this._points.expandEnvelope(new Xt)},i.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},i.prototype.getSortIndex=function(){return n.SORTINDEX_LINESTRING},i.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},i.prototype.equalsExact=function(){if(arguments.length===2){var l=arguments[0],h=arguments[1];if(!this.isEquivalentClass(l))return!1;var v=l;if(this._points.size()!==v._points.size())return!1;for(var S=0;S<this._points.size();S++)if(!this.equal(this._points.getCoordinate(S),v._points.getCoordinate(S),h))return!1;return!0}return n.prototype.equalsExact.apply(this,arguments)},i.prototype.normalize=function(){for(var l=0;l<Math.trunc(this._points.size()/2);l++){var h=this._points.size()-1-l;if(!this._points.getCoordinate(l).equals(this._points.getCoordinate(h)))return this._points.getCoordinate(l).compareTo(this._points.getCoordinate(h))>0&&Zt.reverse(this._points),null}},i.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},i.prototype.getBoundaryDimension=function(){return this.isClosed()?Me.FALSE:0},i.prototype.isClosed=function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},i.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},i.prototype.getDimension=function(){return 1},i.prototype.getLength=function(){return rt.computeLength(this._points)},i.prototype.getNumPoints=function(){return this._points.size()},i.prototype.reverse=function(){var l=this._points.copy();return Zt.reverse(l),this.getFactory().createLineString(l)},i.prototype.compareToSameClass=function(){if(arguments.length===1){for(var l=arguments[0],h=0,v=0;h<this._points.size()&&v<l._points.size();){var S=this._points.getCoordinate(h).compareTo(l._points.getCoordinate(v));if(S!==0)return S;h++,v++}return h<this._points.size()?1:v<l._points.size()?-1:0}if(arguments.length===2){var R=arguments[0];return arguments[1].compare(this._points,R._points)}},i.prototype.apply=function(){if(et(arguments[0],tt))for(var l=arguments[0],h=0;h<this._points.size();h++)l.filter(this._points.getCoordinate(h));else if(et(arguments[0],lr)){var v=arguments[0];if(this._points.size()===0)return null;for(var S=0;S<this._points.size()&&(v.filter(this._points,S),!v.isDone());S++);v.isGeometryChanged()&&this.geometryChanged()}else et(arguments[0],hr)?arguments[0].filter(this):et(arguments[0],Gt)&&arguments[0].filter(this)},i.prototype.getBoundary=function(){return new xt(this).getBoundary()},i.prototype.isEquivalentClass=function(l){return l instanceof i},i.prototype.clone=function(){var l=n.prototype.clone.call(this);return l._points=this._points.clone(),l},i.prototype.getCoordinateN=function(l){return this._points.getCoordinate(l)},i.prototype.getGeometryType=function(){return"LineString"},i.prototype.copy=function(){return new i(this._points.copy(),this._factory)},i.prototype.getCoordinateSequence=function(){return this._points},i.prototype.isEmpty=function(){return this._points.size()===0},i.prototype.init=function(l){if(l===null&&(l=this.getFactory().getCoordinateSequenceFactory().create([])),l.size()===1)throw new N("Invalid number of points in LineString (found "+l.size()+" - must be 0 or >= 2)");this._points=l},i.prototype.isCoordinate=function(l){for(var h=0;h<this._points.size();h++)if(this._points.getCoordinate(h).equals(l))return!0;return!1},i.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},i.prototype.getPointN=function(l){return this.getFactory().createPoint(this._points.getCoordinate(l))},i.prototype.interfaces_=function(){return[wr]},i.prototype.getClass=function(){return i},s.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(i,s),i}(Ct),Te=function(){};Te.prototype.interfaces_=function(){return[]},Te.prototype.getClass=function(){return Te};var ge=function(n){function i(l,h){n.call(this,h),this._coordinates=l||null,this.init(this._coordinates)}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={serialVersionUID:{configurable:!0}};return i.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new Xt;var l=new Xt;return l.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),l},i.prototype.getSortIndex=function(){return n.SORTINDEX_POINT},i.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},i.prototype.equalsExact=function(){if(arguments.length===2){var l=arguments[0],h=arguments[1];return!!this.isEquivalentClass(l)&&(!(!this.isEmpty()||!l.isEmpty())||this.isEmpty()===l.isEmpty()&&this.equal(l.getCoordinate(),this.getCoordinate(),h))}return n.prototype.equalsExact.apply(this,arguments)},i.prototype.normalize=function(){},i.prototype.getCoordinate=function(){return this._coordinates.size()!==0?this._coordinates.getCoordinate(0):null},i.prototype.getBoundaryDimension=function(){return Me.FALSE},i.prototype.getDimension=function(){return 0},i.prototype.getNumPoints=function(){return this.isEmpty()?0:1},i.prototype.reverse=function(){return this.copy()},i.prototype.getX=function(){if(this.getCoordinate()===null)throw new Error("getX called on empty Point");return this.getCoordinate().x},i.prototype.compareToSameClass=function(){if(arguments.length===1){var l=arguments[0];return this.getCoordinate().compareTo(l.getCoordinate())}if(arguments.length===2){var h=arguments[0];return arguments[1].compare(this._coordinates,h._coordinates)}},i.prototype.apply=function(){if(et(arguments[0],tt)){var l=arguments[0];if(this.isEmpty())return null;l.filter(this.getCoordinate())}else if(et(arguments[0],lr)){var h=arguments[0];if(this.isEmpty())return null;h.filter(this._coordinates,0),h.isGeometryChanged()&&this.geometryChanged()}else et(arguments[0],hr)?arguments[0].filter(this):et(arguments[0],Gt)&&arguments[0].filter(this)},i.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},i.prototype.clone=function(){var l=n.prototype.clone.call(this);return l._coordinates=this._coordinates.clone(),l},i.prototype.getGeometryType=function(){return"Point"},i.prototype.copy=function(){return new i(this._coordinates.copy(),this._factory)},i.prototype.getCoordinateSequence=function(){return this._coordinates},i.prototype.getY=function(){if(this.getCoordinate()===null)throw new Error("getY called on empty Point");return this.getCoordinate().y},i.prototype.isEmpty=function(){return this._coordinates.size()===0},i.prototype.init=function(l){l===null&&(l=this.getFactory().getCoordinateSequenceFactory().create([])),kt.isTrue(l.size()<=1),this._coordinates=l},i.prototype.isSimple=function(){return!0},i.prototype.interfaces_=function(){return[Te]},i.prototype.getClass=function(){return i},s.serialVersionUID.get=function(){return 4902022702746615e3},Object.defineProperties(i,s),i}(Ct),Ne=function(){};Ne.prototype.interfaces_=function(){return[]},Ne.prototype.getClass=function(){return Ne};var pe=function(n){function i(l,h,v){if(n.call(this,v),this._shell=null,this._holes=null,l===null&&(l=this.getFactory().createLinearRing()),h===null&&(h=[]),n.hasNullElements(h))throw new N("holes must not contain null elements");if(l.isEmpty()&&n.hasNonEmptyElements(h))throw new N("shell is empty but holes are not");this._shell=l,this._holes=h}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={serialVersionUID:{configurable:!0}};return i.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},i.prototype.getSortIndex=function(){return n.SORTINDEX_POLYGON},i.prototype.getCoordinates=function(){if(this.isEmpty())return[];for(var l=new Array(this.getNumPoints()).fill(null),h=-1,v=this._shell.getCoordinates(),S=0;S<v.length;S++)l[++h]=v[S];for(var R=0;R<this._holes.length;R++)for(var V=this._holes[R].getCoordinates(),ot=0;ot<V.length;ot++)l[++h]=V[ot];return l},i.prototype.getArea=function(){var l=0;l+=Math.abs(rt.signedArea(this._shell.getCoordinateSequence()));for(var h=0;h<this._holes.length;h++)l-=Math.abs(rt.signedArea(this._holes[h].getCoordinateSequence()));return l},i.prototype.isRectangle=function(){if(this.getNumInteriorRing()!==0||this._shell===null||this._shell.getNumPoints()!==5)return!1;for(var l=this._shell.getCoordinateSequence(),h=this.getEnvelopeInternal(),v=0;v<5;v++){var S=l.getX(v);if(S!==h.getMinX()&&S!==h.getMaxX())return!1;var R=l.getY(v);if(R!==h.getMinY()&&R!==h.getMaxY())return!1}for(var V=l.getX(0),ot=l.getY(0),St=1;St<=4;St++){var bt=l.getX(St),Yt=l.getY(St);if(bt!==V==(Yt!==ot))return!1;V=bt,ot=Yt}return!0},i.prototype.equalsExact=function(){if(arguments.length===2){var l=arguments[0],h=arguments[1];if(!this.isEquivalentClass(l))return!1;var v=l,S=this._shell,R=v._shell;if(!S.equalsExact(R,h)||this._holes.length!==v._holes.length)return!1;for(var V=0;V<this._holes.length;V++)if(!this._holes[V].equalsExact(v._holes[V],h))return!1;return!0}return n.prototype.equalsExact.apply(this,arguments)},i.prototype.normalize=function(){if(arguments.length===0){this.normalize(this._shell,!0);for(var l=0;l<this._holes.length;l++)this.normalize(this._holes[l],!1);er.sort(this._holes)}else if(arguments.length===2){var h=arguments[0],v=arguments[1];if(h.isEmpty())return null;var S=new Array(h.getCoordinates().length-1).fill(null);Qt.arraycopy(h.getCoordinates(),0,S,0,S.length);var R=at.minCoordinate(h.getCoordinates());at.scroll(S,R),Qt.arraycopy(S,0,h.getCoordinates(),0,S.length),h.getCoordinates()[S.length]=S[0],rt.isCCW(h.getCoordinates())===v&&at.reverse(h.getCoordinates())}},i.prototype.getCoordinate=function(){return this._shell.getCoordinate()},i.prototype.getNumInteriorRing=function(){return this._holes.length},i.prototype.getBoundaryDimension=function(){return 1},i.prototype.getDimension=function(){return 2},i.prototype.getLength=function(){var l=0;l+=this._shell.getLength();for(var h=0;h<this._holes.length;h++)l+=this._holes[h].getLength();return l},i.prototype.getNumPoints=function(){for(var l=this._shell.getNumPoints(),h=0;h<this._holes.length;h++)l+=this._holes[h].getNumPoints();return l},i.prototype.reverse=function(){var l=this.copy();l._shell=this._shell.copy().reverse(),l._holes=new Array(this._holes.length).fill(null);for(var h=0;h<this._holes.length;h++)l._holes[h]=this._holes[h].copy().reverse();return l},i.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},i.prototype.compareToSameClass=function(){if(arguments.length===1){var l=arguments[0],h=this._shell,v=l._shell;return h.compareToSameClass(v)}if(arguments.length===2){var S=arguments[0],R=arguments[1],V=S,ot=this._shell,St=V._shell,bt=ot.compareToSameClass(St,R);if(bt!==0)return bt;for(var Yt=this.getNumInteriorRing(),Jt=V.getNumInteriorRing(),se=0;se<Yt&&se<Jt;){var _e=this.getInteriorRingN(se),Cn=V.getInteriorRingN(se),Xn=_e.compareToSameClass(Cn,R);if(Xn!==0)return Xn;se++}return se<Yt?1:se<Jt?-1:0}},i.prototype.apply=function(l){if(et(l,tt)){this._shell.apply(l);for(var h=0;h<this._holes.length;h++)this._holes[h].apply(l)}else if(et(l,lr)){if(this._shell.apply(l),!l.isDone())for(var v=0;v<this._holes.length&&(this._holes[v].apply(l),!l.isDone());v++);l.isGeometryChanged()&&this.geometryChanged()}else if(et(l,hr))l.filter(this);else if(et(l,Gt)){l.filter(this),this._shell.apply(l);for(var S=0;S<this._holes.length;S++)this._holes[S].apply(l)}},i.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();var l=new Array(this._holes.length+1).fill(null);l[0]=this._shell;for(var h=0;h<this._holes.length;h++)l[h+1]=this._holes[h];return l.length<=1?this.getFactory().createLinearRing(l[0].getCoordinateSequence()):this.getFactory().createMultiLineString(l)},i.prototype.clone=function(){var l=n.prototype.clone.call(this);l._shell=this._shell.clone(),l._holes=new Array(this._holes.length).fill(null);for(var h=0;h<this._holes.length;h++)l._holes[h]=this._holes[h].clone();return l},i.prototype.getGeometryType=function(){return"Polygon"},i.prototype.copy=function(){for(var l=this._shell.copy(),h=new Array(this._holes.length).fill(null),v=0;v<h.length;v++)h[v]=this._holes[v].copy();return new i(l,h,this._factory)},i.prototype.getExteriorRing=function(){return this._shell},i.prototype.isEmpty=function(){return this._shell.isEmpty()},i.prototype.getInteriorRingN=function(l){return this._holes[l]},i.prototype.interfaces_=function(){return[Ne]},i.prototype.getClass=function(){return i},s.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(i,s),i}(Ct),Oe=function(n){function i(){n.apply(this,arguments)}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={serialVersionUID:{configurable:!0}};return i.prototype.getSortIndex=function(){return Ct.SORTINDEX_MULTIPOINT},i.prototype.isValid=function(){return!0},i.prototype.equalsExact=function(){if(arguments.length===2){var l=arguments[0],h=arguments[1];return!!this.isEquivalentClass(l)&&n.prototype.equalsExact.call(this,l,h)}return n.prototype.equalsExact.apply(this,arguments)},i.prototype.getCoordinate=function(){if(arguments.length===1){var l=arguments[0];return this._geometries[l].getCoordinate()}return n.prototype.getCoordinate.apply(this,arguments)},i.prototype.getBoundaryDimension=function(){return Me.FALSE},i.prototype.getDimension=function(){return 0},i.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},i.prototype.getGeometryType=function(){return"MultiPoint"},i.prototype.copy=function(){for(var l=new Array(this._geometries.length).fill(null),h=0;h<l.length;h++)l[h]=this._geometries[h].copy();return new i(l,this._factory)},i.prototype.interfaces_=function(){return[Te]},i.prototype.getClass=function(){return i},s.serialVersionUID.get=function(){return-8048474874175356e3},Object.defineProperties(i,s),i}(Zn),Tn=function(n){function i(l,h){l instanceof D&&h instanceof Ce&&(l=h.getCoordinateSequenceFactory().create(l)),n.call(this,l,h),this.validateConstruction()}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return i.prototype.getSortIndex=function(){return Ct.SORTINDEX_LINEARRING},i.prototype.getBoundaryDimension=function(){return Me.FALSE},i.prototype.isClosed=function(){return!!this.isEmpty()||n.prototype.isClosed.call(this)},i.prototype.reverse=function(){var l=this._points.copy();return Zt.reverse(l),this.getFactory().createLinearRing(l)},i.prototype.validateConstruction=function(){if(!this.isEmpty()&&!n.prototype.isClosed.call(this))throw new N("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<i.MINIMUM_VALID_SIZE)throw new N("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},i.prototype.getGeometryType=function(){return"LinearRing"},i.prototype.copy=function(){return new i(this._points.copy(),this._factory)},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},s.MINIMUM_VALID_SIZE.get=function(){return 4},s.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(i,s),i}(jt),Bn=function(n){function i(){n.apply(this,arguments)}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={serialVersionUID:{configurable:!0}};return i.prototype.getSortIndex=function(){return Ct.SORTINDEX_MULTIPOLYGON},i.prototype.equalsExact=function(){if(arguments.length===2){var l=arguments[0],h=arguments[1];return!!this.isEquivalentClass(l)&&n.prototype.equalsExact.call(this,l,h)}return n.prototype.equalsExact.apply(this,arguments)},i.prototype.getBoundaryDimension=function(){return 1},i.prototype.getDimension=function(){return 2},i.prototype.reverse=function(){for(var l=this._geometries.length,h=new Array(l).fill(null),v=0;v<this._geometries.length;v++)h[v]=this._geometries[v].reverse();return this.getFactory().createMultiPolygon(h)},i.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();for(var l=new nt,h=0;h<this._geometries.length;h++)for(var v=this._geometries[h].getBoundary(),S=0;S<v.getNumGeometries();S++)l.add(v.getGeometryN(S));var R=new Array(l.size()).fill(null);return this.getFactory().createMultiLineString(l.toArray(R))},i.prototype.getGeometryType=function(){return"MultiPolygon"},i.prototype.copy=function(){for(var l=new Array(this._geometries.length).fill(null),h=0;h<l.length;h++)l[h]=this._geometries[h].copy();return new i(l,this._factory)},i.prototype.interfaces_=function(){return[Ne]},i.prototype.getClass=function(){return i},s.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(i,s),i}(Zn),rr=function(n){this._factory=n||null,this._isUserDataCopied=!1},Ki={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};rr.prototype.setCopyUserData=function(n){this._isUserDataCopied=n},rr.prototype.edit=function(n,i){if(n===null)return null;var s=this.editInternal(n,i);return this._isUserDataCopied&&s.setUserData(n.getUserData()),s},rr.prototype.editInternal=function(n,i){return this._factory===null&&(this._factory=n.getFactory()),n instanceof Zn?this.editGeometryCollection(n,i):n instanceof pe?this.editPolygon(n,i):n instanceof ge?i.edit(n,this._factory):n instanceof jt?i.edit(n,this._factory):(kt.shouldNeverReachHere("Unsupported Geometry class: "+n.getClass().getName()),null)},rr.prototype.editGeometryCollection=function(n,i){for(var s=i.edit(n,this._factory),l=new nt,h=0;h<s.getNumGeometries();h++){var v=this.edit(s.getGeometryN(h),i);v===null||v.isEmpty()||l.add(v)}return s.getClass()===Oe?this._factory.createMultiPoint(l.toArray([])):s.getClass()===K?this._factory.createMultiLineString(l.toArray([])):s.getClass()===Bn?this._factory.createMultiPolygon(l.toArray([])):this._factory.createGeometryCollection(l.toArray([]))},rr.prototype.editPolygon=function(n,i){var s=i.edit(n,this._factory);if(s===null&&(s=this._factory.createPolygon(null)),s.isEmpty())return s;var l=this.edit(s.getExteriorRing(),i);if(l===null||l.isEmpty())return this._factory.createPolygon();for(var h=new nt,v=0;v<s.getNumInteriorRing();v++){var S=this.edit(s.getInteriorRingN(v),i);S===null||S.isEmpty()||h.add(S)}return this._factory.createPolygon(l,h.toArray([]))},rr.prototype.interfaces_=function(){return[]},rr.prototype.getClass=function(){return rr},rr.GeometryEditorOperation=function(){},Ki.NoOpGeometryOperation.get=function(){return pr},Ki.CoordinateOperation.get=function(){return ze},Ki.CoordinateSequenceOperation.get=function(){return Is},Object.defineProperties(rr,Ki);var pr=function(){};pr.prototype.edit=function(n,i){return n},pr.prototype.interfaces_=function(){return[rr.GeometryEditorOperation]},pr.prototype.getClass=function(){return pr};var ze=function(){};ze.prototype.edit=function(n,i){var s=this.editCoordinates(n.getCoordinates(),n);return s===null?n:n instanceof Tn?i.createLinearRing(s):n instanceof jt?i.createLineString(s):n instanceof ge?s.length>0?i.createPoint(s[0]):i.createPoint():n},ze.prototype.interfaces_=function(){return[rr.GeometryEditorOperation]},ze.prototype.getClass=function(){return ze};var Is=function(){};Is.prototype.edit=function(n,i){return n instanceof Tn?i.createLinearRing(this.edit(n.getCoordinateSequence(),n)):n instanceof jt?i.createLineString(this.edit(n.getCoordinateSequence(),n)):n instanceof ge?i.createPoint(this.edit(n.getCoordinateSequence(),n)):n},Is.prototype.interfaces_=function(){return[rr.GeometryEditorOperation]},Is.prototype.getClass=function(){return Is};var De=function(){if(this._dimension=3,this._coordinates=null,arguments.length===1){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var n=arguments[0];this._coordinates=new Array(n).fill(null);for(var i=0;i<n;i++)this._coordinates[i]=new D}else if(et(arguments[0],At)){var s=arguments[0];if(s===null)return this._coordinates=new Array(0).fill(null),null;this._dimension=s.getDimension(),this._coordinates=new Array(s.size()).fill(null);for(var l=0;l<this._coordinates.length;l++)this._coordinates[l]=s.getCoordinateCopy(l)}}else if(arguments.length===2){if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var h=arguments[0],v=arguments[1];this._coordinates=h,this._dimension=v,h===null&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var S=arguments[0],R=arguments[1];this._coordinates=new Array(S).fill(null),this._dimension=R;for(var V=0;V<S;V++)this._coordinates[V]=new D}}},Yo={serialVersionUID:{configurable:!0}};De.prototype.setOrdinate=function(n,i,s){switch(i){case At.X:this._coordinates[n].x=s;break;case At.Y:this._coordinates[n].y=s;break;case At.Z:this._coordinates[n].z=s;break;default:throw new N("invalid ordinateIndex")}},De.prototype.size=function(){return this._coordinates.length},De.prototype.getOrdinate=function(n,i){switch(i){case At.X:return this._coordinates[n].x;case At.Y:return this._coordinates[n].y;case At.Z:return this._coordinates[n].z}return A.NaN},De.prototype.getCoordinate=function(){if(arguments.length===1){var n=arguments[0];return this._coordinates[n]}if(arguments.length===2){var i=arguments[0],s=arguments[1];s.x=this._coordinates[i].x,s.y=this._coordinates[i].y,s.z=this._coordinates[i].z}},De.prototype.getCoordinateCopy=function(n){return new D(this._coordinates[n])},De.prototype.getDimension=function(){return this._dimension},De.prototype.getX=function(n){return this._coordinates[n].x},De.prototype.clone=function(){for(var n=new Array(this.size()).fill(null),i=0;i<this._coordinates.length;i++)n[i]=this._coordinates[i].clone();return new De(n,this._dimension)},De.prototype.expandEnvelope=function(n){for(var i=0;i<this._coordinates.length;i++)n.expandToInclude(this._coordinates[i]);return n},De.prototype.copy=function(){for(var n=new Array(this.size()).fill(null),i=0;i<this._coordinates.length;i++)n[i]=this._coordinates[i].copy();return new De(n,this._dimension)},De.prototype.toString=function(){if(this._coordinates.length>0){var n=new Pt(17*this._coordinates.length);n.append("("),n.append(this._coordinates[0]);for(var i=1;i<this._coordinates.length;i++)n.append(", "),n.append(this._coordinates[i]);return n.append(")"),n.toString()}return"()"},De.prototype.getY=function(n){return this._coordinates[n].y},De.prototype.toCoordinateArray=function(){return this._coordinates},De.prototype.interfaces_=function(){return[At,t]},De.prototype.getClass=function(){return De},Yo.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(De,Yo);var Ui=function(){},$o={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};Ui.prototype.readResolve=function(){return Ui.instance()},Ui.prototype.create=function(){if(arguments.length===1){if(arguments[0]instanceof Array){var n=arguments[0];return new De(n)}if(et(arguments[0],At)){var i=arguments[0];return new De(i)}}else if(arguments.length===2){var s=arguments[0],l=arguments[1];return l>3&&(l=3),l<2?new De(s):new De(s,l)}},Ui.prototype.interfaces_=function(){return[_t,t]},Ui.prototype.getClass=function(){return Ui},Ui.instance=function(){return Ui.instanceObject},$o.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},$o.instanceObject.get=function(){return new Ui},Object.defineProperties(Ui,$o);var Ka=function(n){function i(){n.call(this),this.map_=new Map}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.get=function(s){return this.map_.get(s)||null},i.prototype.put=function(s,l){return this.map_.set(s,l),l},i.prototype.values=function(){for(var s=new nt,l=this.map_.values(),h=l.next();!h.done;)s.add(h.value),h=l.next();return s},i.prototype.entrySet=function(){var s=new je;return this.map_.entries().forEach(function(l){return s.add(l)}),s},i.prototype.size=function(){return this.map_.size()},i}(oe),Se=function n(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=n.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof ci){var i=arguments[0];this._modelType=i,i===n.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var s=arguments[0];this._modelType=n.FIXED,this.setScale(s)}else if(arguments[0]instanceof n){var l=arguments[0];this._modelType=l._modelType,this._scale=l._scale}}},Qi={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};Se.prototype.equals=function(n){if(!(n instanceof Se))return!1;var i=n;return this._modelType===i._modelType&&this._scale===i._scale},Se.prototype.compareTo=function(n){var i=n,s=this.getMaximumSignificantDigits(),l=i.getMaximumSignificantDigits();return new Et(s).compareTo(new Et(l))},Se.prototype.getScale=function(){return this._scale},Se.prototype.isFloating=function(){return this._modelType===Se.FLOATING||this._modelType===Se.FLOATING_SINGLE},Se.prototype.getType=function(){return this._modelType},Se.prototype.toString=function(){var n="UNKNOWN";return this._modelType===Se.FLOATING?n="Floating":this._modelType===Se.FLOATING_SINGLE?n="Floating-Single":this._modelType===Se.FIXED&&(n="Fixed (Scale="+this.getScale()+")"),n},Se.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var n=arguments[0];return A.isNaN(n)||this._modelType===Se.FLOATING_SINGLE?n:this._modelType===Se.FIXED?Math.round(n*this._scale)/this._scale:n}if(arguments[0]instanceof D){var i=arguments[0];if(this._modelType===Se.FLOATING)return null;i.x=this.makePrecise(i.x),i.y=this.makePrecise(i.y)}},Se.prototype.getMaximumSignificantDigits=function(){var n=16;return this._modelType===Se.FLOATING?n=16:this._modelType===Se.FLOATING_SINGLE?n=6:this._modelType===Se.FIXED&&(n=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),n},Se.prototype.setScale=function(n){this._scale=Math.abs(n)},Se.prototype.interfaces_=function(){return[t,z]},Se.prototype.getClass=function(){return Se},Se.mostPrecise=function(n,i){return n.compareTo(i)>=0?n:i},Qi.serialVersionUID.get=function(){return 7777263578777804e3},Qi.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(Se,Qi);var ci=function n(i){this._name=i||null,n.nameToTypeMap.put(i,this)},fi={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};ci.prototype.readResolve=function(){return ci.nameToTypeMap.get(this._name)},ci.prototype.toString=function(){return this._name},ci.prototype.interfaces_=function(){return[t]},ci.prototype.getClass=function(){return ci},fi.serialVersionUID.get=function(){return-552860263173159e4},fi.nameToTypeMap.get=function(){return new Ka},Object.defineProperties(ci,fi),Se.Type=ci,Se.FIXED=new ci("FIXED"),Se.FLOATING=new ci("FLOATING"),Se.FLOATING_SINGLE=new ci("FLOATING SINGLE");var Ce=function n(){this._precisionModel=new Se,this._SRID=0,this._coordinateSequenceFactory=n.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?et(arguments[0],_t)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof Se&&(this._precisionModel=arguments[0]):arguments.length===2?(this._precisionModel=arguments[0],this._SRID=arguments[1]):arguments.length===3&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},Du={serialVersionUID:{configurable:!0}};Ce.prototype.toGeometry=function(n){return n.isNull()?this.createPoint(null):n.getMinX()===n.getMaxX()&&n.getMinY()===n.getMaxY()?this.createPoint(new D(n.getMinX(),n.getMinY())):n.getMinX()===n.getMaxX()||n.getMinY()===n.getMaxY()?this.createLineString([new D(n.getMinX(),n.getMinY()),new D(n.getMaxX(),n.getMaxY())]):this.createPolygon(this.createLinearRing([new D(n.getMinX(),n.getMinY()),new D(n.getMinX(),n.getMaxY()),new D(n.getMaxX(),n.getMaxY()),new D(n.getMaxX(),n.getMinY()),new D(n.getMinX(),n.getMinY())]),null)},Ce.prototype.createLineString=function(n){return n?n instanceof Array?new jt(this.getCoordinateSequenceFactory().create(n),this):et(n,At)?new jt(n,this):void 0:new jt(this.getCoordinateSequenceFactory().create([]),this)},Ce.prototype.createMultiLineString=function(){if(arguments.length===0)return new K(null,this);if(arguments.length===1){var n=arguments[0];return new K(n,this)}},Ce.prototype.buildGeometry=function(n){for(var i=null,s=!1,l=!1,h=n.iterator();h.hasNext();){var v=h.next(),S=v.getClass();i===null&&(i=S),S!==i&&(s=!0),v.isGeometryCollectionOrDerived()&&(l=!0)}if(i===null)return this.createGeometryCollection();if(s||l)return this.createGeometryCollection(Ce.toGeometryArray(n));var R=n.iterator().next();if(n.size()>1){if(R instanceof pe)return this.createMultiPolygon(Ce.toPolygonArray(n));if(R instanceof jt)return this.createMultiLineString(Ce.toLineStringArray(n));if(R instanceof ge)return this.createMultiPoint(Ce.toPointArray(n));kt.shouldNeverReachHere("Unhandled class: "+R.getClass().getName())}return R},Ce.prototype.createMultiPointFromCoords=function(n){return this.createMultiPoint(n!==null?this.getCoordinateSequenceFactory().create(n):null)},Ce.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof D){var n=arguments[0];return this.createPoint(n!==null?this.getCoordinateSequenceFactory().create([n]):null)}if(et(arguments[0],At)){var i=arguments[0];return new ge(i,this)}}},Ce.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},Ce.prototype.createPolygon=function(){if(arguments.length===0)return new pe(null,null,this);if(arguments.length===1){if(et(arguments[0],At)){var n=arguments[0];return this.createPolygon(this.createLinearRing(n))}if(arguments[0]instanceof Array){var i=arguments[0];return this.createPolygon(this.createLinearRing(i))}if(arguments[0]instanceof Tn){var s=arguments[0];return this.createPolygon(s,null)}}else if(arguments.length===2){var l=arguments[0],h=arguments[1];return new pe(l,h,this)}},Ce.prototype.getSRID=function(){return this._SRID},Ce.prototype.createGeometryCollection=function(){if(arguments.length===0)return new Zn(null,this);if(arguments.length===1){var n=arguments[0];return new Zn(n,this)}},Ce.prototype.createGeometry=function(n){return new rr(this).edit(n,{edit:function(){if(arguments.length===2){var i=arguments[0];return this._coordinateSequenceFactory.create(i)}}})},Ce.prototype.getPrecisionModel=function(){return this._precisionModel},Ce.prototype.createLinearRing=function(){if(arguments.length===0)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Array){var n=arguments[0];return this.createLinearRing(n!==null?this.getCoordinateSequenceFactory().create(n):null)}if(et(arguments[0],At)){var i=arguments[0];return new Tn(i,this)}}},Ce.prototype.createMultiPolygon=function(){if(arguments.length===0)return new Bn(null,this);if(arguments.length===1){var n=arguments[0];return new Bn(n,this)}},Ce.prototype.createMultiPoint=function(){if(arguments.length===0)return new Oe(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var n=arguments[0];return new Oe(n,this)}if(arguments[0]instanceof Array){var i=arguments[0];return this.createMultiPoint(i!==null?this.getCoordinateSequenceFactory().create(i):null)}if(et(arguments[0],At)){var s=arguments[0];if(s===null)return this.createMultiPoint(new Array(0).fill(null));for(var l=new Array(s.size()).fill(null),h=0;h<s.size();h++){var v=this.getCoordinateSequenceFactory().create(1,s.getDimension());Zt.copy(s,h,v,0,1),l[h]=this.createPoint(v)}return this.createMultiPoint(l)}}},Ce.prototype.interfaces_=function(){return[t]},Ce.prototype.getClass=function(){return Ce},Ce.toMultiPolygonArray=function(n){var i=new Array(n.size()).fill(null);return n.toArray(i)},Ce.toGeometryArray=function(n){if(n===null)return null;var i=new Array(n.size()).fill(null);return n.toArray(i)},Ce.getDefaultCoordinateSequenceFactory=function(){return Ui.instance()},Ce.toMultiLineStringArray=function(n){var i=new Array(n.size()).fill(null);return n.toArray(i)},Ce.toLineStringArray=function(n){var i=new Array(n.size()).fill(null);return n.toArray(i)},Ce.toMultiPointArray=function(n){var i=new Array(n.size()).fill(null);return n.toArray(i)},Ce.toLinearRingArray=function(n){var i=new Array(n.size()).fill(null);return n.toArray(i)},Ce.toPointArray=function(n){var i=new Array(n.size()).fill(null);return n.toArray(i)},Ce.toPolygonArray=function(n){var i=new Array(n.size()).fill(null);return n.toArray(i)},Ce.createPointFromInternalCoord=function(n,i){return i.getPrecisionModel().makePrecise(n),i.getFactory().createPoint(n)},Du.serialVersionUID.get=function(){return-6820524753094096e3},Object.defineProperties(Ce,Du);var Qa=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],ml=function(n){this.geometryFactory=n||new Ce};ml.prototype.read=function(n){var i,s=(i=typeof n=="string"?JSON.parse(n):n).type;if(!ao[s])throw new Error("Unknown GeoJSON type: "+i.type);return Qa.indexOf(s)!==-1?ao[s].apply(this,[i.coordinates]):s==="GeometryCollection"?ao[s].apply(this,[i.geometries]):ao[s].apply(this,[i])},ml.prototype.write=function(n){var i=n.getGeometryType();if(!So[i])throw new Error("Geometry is not supported");return So[i].apply(this,[n])};var ao={Feature:function(n){var i={};for(var s in n)i[s]=n[s];if(n.geometry){var l=n.geometry.type;if(!ao[l])throw new Error("Unknown GeoJSON type: "+n.type);i.geometry=this.read(n.geometry)}return n.bbox&&(i.bbox=ao.bbox.apply(this,[n.bbox])),i},FeatureCollection:function(n){var i={};if(n.features){i.features=[];for(var s=0;s<n.features.length;++s)i.features.push(this.read(n.features[s]))}return n.bbox&&(i.bbox=this.parse.bbox.apply(this,[n.bbox])),i},coordinates:function(n){for(var i=[],s=0;s<n.length;++s){var l=n[s];i.push(new D(l[0],l[1]))}return i},bbox:function(n){return this.geometryFactory.createLinearRing([new D(n[0],n[1]),new D(n[2],n[1]),new D(n[2],n[3]),new D(n[0],n[3]),new D(n[0],n[1])])},Point:function(n){var i=new D(n[0],n[1]);return this.geometryFactory.createPoint(i)},MultiPoint:function(n){for(var i=[],s=0;s<n.length;++s)i.push(ao.Point.apply(this,[n[s]]));return this.geometryFactory.createMultiPoint(i)},LineString:function(n){var i=ao.coordinates.apply(this,[n]);return this.geometryFactory.createLineString(i)},MultiLineString:function(n){for(var i=[],s=0;s<n.length;++s)i.push(ao.LineString.apply(this,[n[s]]));return this.geometryFactory.createMultiLineString(i)},Polygon:function(n){for(var i=ao.coordinates.apply(this,[n[0]]),s=this.geometryFactory.createLinearRing(i),l=[],h=1;h<n.length;++h){var v=n[h],S=ao.coordinates.apply(this,[v]),R=this.geometryFactory.createLinearRing(S);l.push(R)}return this.geometryFactory.createPolygon(s,l)},MultiPolygon:function(n){for(var i=[],s=0;s<n.length;++s){var l=n[s];i.push(ao.Polygon.apply(this,[l]))}return this.geometryFactory.createMultiPolygon(i)},GeometryCollection:function(n){for(var i=[],s=0;s<n.length;++s){var l=n[s];i.push(this.read(l))}return this.geometryFactory.createGeometryCollection(i)}},So={coordinate:function(n){return[n.x,n.y]},Point:function(n){return{type:"Point",coordinates:So.coordinate.apply(this,[n.getCoordinate()])}},MultiPoint:function(n){for(var i=[],s=0;s<n._geometries.length;++s){var l=n._geometries[s],h=So.Point.apply(this,[l]);i.push(h.coordinates)}return{type:"MultiPoint",coordinates:i}},LineString:function(n){for(var i=[],s=n.getCoordinates(),l=0;l<s.length;++l){var h=s[l];i.push(So.coordinate.apply(this,[h]))}return{type:"LineString",coordinates:i}},MultiLineString:function(n){for(var i=[],s=0;s<n._geometries.length;++s){var l=n._geometries[s],h=So.LineString.apply(this,[l]);i.push(h.coordinates)}return{type:"MultiLineString",coordinates:i}},Polygon:function(n){var i=[],s=So.LineString.apply(this,[n._shell]);i.push(s.coordinates);for(var l=0;l<n._holes.length;++l){var h=n._holes[l],v=So.LineString.apply(this,[h]);i.push(v.coordinates)}return{type:"Polygon",coordinates:i}},MultiPolygon:function(n){for(var i=[],s=0;s<n._geometries.length;++s){var l=n._geometries[s],h=So.Polygon.apply(this,[l]);i.push(h.coordinates)}return{type:"MultiPolygon",coordinates:i}},GeometryCollection:function(n){for(var i=[],s=0;s<n._geometries.length;++s){var l=n._geometries[s],h=l.getGeometryType();i.push(So[h].apply(this,[l]))}return{type:"GeometryCollection",geometries:i}}},Fu=function(n){this.geometryFactory=n||new Ce,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new ml(this.geometryFactory)};Fu.prototype.read=function(n){var i=this.parser.read(n);return this.precisionModel.getType()===Se.FIXED&&this.reducePrecision(i),i},Fu.prototype.reducePrecision=function(n){var i,s;if(n.coordinate)this.precisionModel.makePrecise(n.coordinate);else if(n.points)for(i=0,s=n.points.length;i<s;i++)this.precisionModel.makePrecise(n.points[i]);else if(n.geometries)for(i=0,s=n.geometries.length;i<s;i++)this.reducePrecision(n.geometries[i])};var _a=function(){this.parser=new ml(this.geometryFactory)};_a.prototype.write=function(n){return this.parser.write(n)};var Ht=function(){},Uu={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};Ht.prototype.interfaces_=function(){return[]},Ht.prototype.getClass=function(){return Ht},Ht.opposite=function(n){return n===Ht.LEFT?Ht.RIGHT:n===Ht.RIGHT?Ht.LEFT:n},Uu.ON.get=function(){return 0},Uu.LEFT.get=function(){return 1},Uu.RIGHT.get=function(){return 2},Object.defineProperties(Ht,Uu),(I.prototype=new Error).name="EmptyStackException",(M.prototype=new ut).add=function(n){return this.array_.push(n),!0},M.prototype.get=function(n){if(n<0||n>=this.size())throw new Error;return this.array_[n]},M.prototype.push=function(n){return this.array_.push(n),n},M.prototype.pop=function(n){if(this.array_.length===0)throw new I;return this.array_.pop()},M.prototype.peek=function(){if(this.array_.length===0)throw new I;return this.array_[this.array_.length-1]},M.prototype.empty=function(){return this.array_.length===0},M.prototype.isEmpty=function(){return this.empty()},M.prototype.search=function(n){return this.array_.indexOf(n)},M.prototype.size=function(){return this.array_.length},M.prototype.toArray=function(){for(var n=[],i=0,s=this.array_.length;i<s;i++)n.push(this.array_[i]);return n};var bo=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};bo.prototype.getCoordinate=function(){return this._minCoord},bo.prototype.getRightmostSide=function(n,i){var s=this.getRightmostSideOfSegment(n,i);return s<0&&(s=this.getRightmostSideOfSegment(n,i-1)),s<0&&(this._minCoord=null,this.checkForRightmostCoordinate(n)),s},bo.prototype.findRightmostEdgeAtVertex=function(){var n=this._minDe.getEdge().getCoordinates();kt.isTrue(this._minIndex>0&&this._minIndex<n.length,"rightmost point expected to be interior vertex of edge");var i=n[this._minIndex-1],s=n[this._minIndex+1],l=rt.computeOrientation(this._minCoord,s,i),h=!1;(i.y<this._minCoord.y&&s.y<this._minCoord.y&&l===rt.COUNTERCLOCKWISE||i.y>this._minCoord.y&&s.y>this._minCoord.y&&l===rt.CLOCKWISE)&&(h=!0),h&&(this._minIndex=this._minIndex-1)},bo.prototype.getRightmostSideOfSegment=function(n,i){var s=n.getEdge().getCoordinates();if(i<0||i+1>=s.length||s[i].y===s[i+1].y)return-1;var l=Ht.LEFT;return s[i].y<s[i+1].y&&(l=Ht.RIGHT),l},bo.prototype.getEdge=function(){return this._orientedDe},bo.prototype.checkForRightmostCoordinate=function(n){for(var i=n.getEdge().getCoordinates(),s=0;s<i.length-1;s++)(this._minCoord===null||i[s].x>this._minCoord.x)&&(this._minDe=n,this._minIndex=s,this._minCoord=i[s])},bo.prototype.findRightmostEdgeAtNode=function(){var n=this._minDe.getNode().getEdges();this._minDe=n.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},bo.prototype.findEdge=function(n){for(var i=n.iterator();i.hasNext();){var s=i.next();s.isForward()&&this.checkForRightmostCoordinate(s)}kt.isTrue(this._minIndex!==0||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),this._minIndex===0?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe,this.getRightmostSide(this._minDe,this._minIndex)===Ht.LEFT&&(this._orientedDe=this._minDe.getSym())},bo.prototype.interfaces_=function(){return[]},bo.prototype.getClass=function(){return bo};var Zo=function(n){function i(s,l){n.call(this,i.msgWithCoord(s,l)),this.pt=l?new D(l):null,this.name="TopologyException"}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.getCoordinate=function(){return this.pt},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i.msgWithCoord=function(s,l){return l?s:s+" [ "+l+" ]"},i}(Ue),Bu=function(){this.array_=[]};Bu.prototype.addLast=function(n){this.array_.push(n)},Bu.prototype.removeFirst=function(){return this.array_.shift()},Bu.prototype.isEmpty=function(){return this.array_.length===0};var Jr=function(){this._finder=null,this._dirEdgeList=new nt,this._nodes=new nt,this._rightMostCoord=null,this._env=null,this._finder=new bo};Jr.prototype.clearVisitedEdges=function(){for(var n=this._dirEdgeList.iterator();n.hasNext();)n.next().setVisited(!1)},Jr.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Jr.prototype.computeNodeDepth=function(n){for(var i=null,s=n.getEdges().iterator();s.hasNext();){var l=s.next();if(l.isVisited()||l.getSym().isVisited()){i=l;break}}if(i===null)throw new Zo("unable to find edge to compute depths at "+n.getCoordinate());n.getEdges().computeDepths(i);for(var h=n.getEdges().iterator();h.hasNext();){var v=h.next();v.setVisited(!0),this.copySymDepths(v)}},Jr.prototype.computeDepth=function(n){this.clearVisitedEdges();var i=this._finder.getEdge();i.setEdgeDepths(Ht.RIGHT,n),this.copySymDepths(i),this.computeDepths(i)},Jr.prototype.create=function(n){this.addReachable(n),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},Jr.prototype.findResultEdges=function(){for(var n=this._dirEdgeList.iterator();n.hasNext();){var i=n.next();i.getDepth(Ht.RIGHT)>=1&&i.getDepth(Ht.LEFT)<=0&&!i.isInteriorAreaEdge()&&i.setInResult(!0)}},Jr.prototype.computeDepths=function(n){var i=new je,s=new Bu,l=n.getNode();for(s.addLast(l),i.add(l),n.setVisited(!0);!s.isEmpty();){var h=s.removeFirst();i.add(h),this.computeNodeDepth(h);for(var v=h.getEdges().iterator();v.hasNext();){var S=v.next().getSym();if(!S.isVisited()){var R=S.getNode();i.contains(R)||(s.addLast(R),i.add(R))}}}},Jr.prototype.compareTo=function(n){var i=n;return this._rightMostCoord.x<i._rightMostCoord.x?-1:this._rightMostCoord.x>i._rightMostCoord.x?1:0},Jr.prototype.getEnvelope=function(){if(this._env===null){for(var n=new Xt,i=this._dirEdgeList.iterator();i.hasNext();)for(var s=i.next().getEdge().getCoordinates(),l=0;l<s.length-1;l++)n.expandToInclude(s[l]);this._env=n}return this._env},Jr.prototype.addReachable=function(n){var i=new M;for(i.add(n);!i.empty();){var s=i.pop();this.add(s,i)}},Jr.prototype.copySymDepths=function(n){var i=n.getSym();i.setDepth(Ht.LEFT,n.getDepth(Ht.RIGHT)),i.setDepth(Ht.RIGHT,n.getDepth(Ht.LEFT))},Jr.prototype.add=function(n,i){n.setVisited(!0),this._nodes.add(n);for(var s=n.getEdges().iterator();s.hasNext();){var l=s.next();this._dirEdgeList.add(l);var h=l.getSym().getNode();h.isVisited()||i.push(h)}},Jr.prototype.getNodes=function(){return this._nodes},Jr.prototype.getDirectedEdges=function(){return this._dirEdgeList},Jr.prototype.interfaces_=function(){return[z]},Jr.prototype.getClass=function(){return Jr};var Wn=function n(){if(this.location=null,arguments.length===1){if(arguments[0]instanceof Array){var i=arguments[0];this.init(i.length)}else if(Number.isInteger(arguments[0])){var s=arguments[0];this.init(1),this.location[Ht.ON]=s}else if(arguments[0]instanceof n){var l=arguments[0];if(this.init(l.location.length),l!==null)for(var h=0;h<this.location.length;h++)this.location[h]=l.location[h]}}else if(arguments.length===3){var v=arguments[0],S=arguments[1],R=arguments[2];this.init(3),this.location[Ht.ON]=v,this.location[Ht.LEFT]=S,this.location[Ht.RIGHT]=R}};Wn.prototype.setAllLocations=function(n){for(var i=0;i<this.location.length;i++)this.location[i]=n},Wn.prototype.isNull=function(){for(var n=0;n<this.location.length;n++)if(this.location[n]!==Z.NONE)return!1;return!0},Wn.prototype.setAllLocationsIfNull=function(n){for(var i=0;i<this.location.length;i++)this.location[i]===Z.NONE&&(this.location[i]=n)},Wn.prototype.isLine=function(){return this.location.length===1},Wn.prototype.merge=function(n){if(n.location.length>this.location.length){var i=new Array(3).fill(null);i[Ht.ON]=this.location[Ht.ON],i[Ht.LEFT]=Z.NONE,i[Ht.RIGHT]=Z.NONE,this.location=i}for(var s=0;s<this.location.length;s++)this.location[s]===Z.NONE&&s<n.location.length&&(this.location[s]=n.location[s])},Wn.prototype.getLocations=function(){return this.location},Wn.prototype.flip=function(){if(this.location.length<=1)return null;var n=this.location[Ht.LEFT];this.location[Ht.LEFT]=this.location[Ht.RIGHT],this.location[Ht.RIGHT]=n},Wn.prototype.toString=function(){var n=new Pt;return this.location.length>1&&n.append(Z.toLocationSymbol(this.location[Ht.LEFT])),n.append(Z.toLocationSymbol(this.location[Ht.ON])),this.location.length>1&&n.append(Z.toLocationSymbol(this.location[Ht.RIGHT])),n.toString()},Wn.prototype.setLocations=function(n,i,s){this.location[Ht.ON]=n,this.location[Ht.LEFT]=i,this.location[Ht.RIGHT]=s},Wn.prototype.get=function(n){return n<this.location.length?this.location[n]:Z.NONE},Wn.prototype.isArea=function(){return this.location.length>1},Wn.prototype.isAnyNull=function(){for(var n=0;n<this.location.length;n++)if(this.location[n]===Z.NONE)return!0;return!1},Wn.prototype.setLocation=function(){if(arguments.length===1){var n=arguments[0];this.setLocation(Ht.ON,n)}else if(arguments.length===2){var i=arguments[0],s=arguments[1];this.location[i]=s}},Wn.prototype.init=function(n){this.location=new Array(n).fill(null),this.setAllLocations(Z.NONE)},Wn.prototype.isEqualOnSide=function(n,i){return this.location[i]===n.location[i]},Wn.prototype.allPositionsEqual=function(n){for(var i=0;i<this.location.length;i++)if(this.location[i]!==n)return!1;return!0},Wn.prototype.interfaces_=function(){return[]},Wn.prototype.getClass=function(){return Wn};var An=function n(){if(this.elt=new Array(2).fill(null),arguments.length===1){if(Number.isInteger(arguments[0])){var i=arguments[0];this.elt[0]=new Wn(i),this.elt[1]=new Wn(i)}else if(arguments[0]instanceof n){var s=arguments[0];this.elt[0]=new Wn(s.elt[0]),this.elt[1]=new Wn(s.elt[1])}}else if(arguments.length===2){var l=arguments[0],h=arguments[1];this.elt[0]=new Wn(Z.NONE),this.elt[1]=new Wn(Z.NONE),this.elt[l].setLocation(h)}else if(arguments.length===3){var v=arguments[0],S=arguments[1],R=arguments[2];this.elt[0]=new Wn(v,S,R),this.elt[1]=new Wn(v,S,R)}else if(arguments.length===4){var V=arguments[0],ot=arguments[1],St=arguments[2],bt=arguments[3];this.elt[0]=new Wn(Z.NONE,Z.NONE,Z.NONE),this.elt[1]=new Wn(Z.NONE,Z.NONE,Z.NONE),this.elt[V].setLocations(ot,St,bt)}};An.prototype.getGeometryCount=function(){var n=0;return this.elt[0].isNull()||n++,this.elt[1].isNull()||n++,n},An.prototype.setAllLocations=function(n,i){this.elt[n].setAllLocations(i)},An.prototype.isNull=function(n){return this.elt[n].isNull()},An.prototype.setAllLocationsIfNull=function(){if(arguments.length===1){var n=arguments[0];this.setAllLocationsIfNull(0,n),this.setAllLocationsIfNull(1,n)}else if(arguments.length===2){var i=arguments[0],s=arguments[1];this.elt[i].setAllLocationsIfNull(s)}},An.prototype.isLine=function(n){return this.elt[n].isLine()},An.prototype.merge=function(n){for(var i=0;i<2;i++)this.elt[i]===null&&n.elt[i]!==null?this.elt[i]=new Wn(n.elt[i]):this.elt[i].merge(n.elt[i])},An.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},An.prototype.getLocation=function(){if(arguments.length===1){var n=arguments[0];return this.elt[n].get(Ht.ON)}if(arguments.length===2){var i=arguments[0],s=arguments[1];return this.elt[i].get(s)}},An.prototype.toString=function(){var n=new Pt;return this.elt[0]!==null&&(n.append("A:"),n.append(this.elt[0].toString())),this.elt[1]!==null&&(n.append(" B:"),n.append(this.elt[1].toString())),n.toString()},An.prototype.isArea=function(){if(arguments.length===0)return this.elt[0].isArea()||this.elt[1].isArea();if(arguments.length===1){var n=arguments[0];return this.elt[n].isArea()}},An.prototype.isAnyNull=function(n){return this.elt[n].isAnyNull()},An.prototype.setLocation=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];this.elt[n].setLocation(Ht.ON,i)}else if(arguments.length===3){var s=arguments[0],l=arguments[1],h=arguments[2];this.elt[s].setLocation(l,h)}},An.prototype.isEqualOnSide=function(n,i){return this.elt[0].isEqualOnSide(n.elt[0],i)&&this.elt[1].isEqualOnSide(n.elt[1],i)},An.prototype.allPositionsEqual=function(n,i){return this.elt[n].allPositionsEqual(i)},An.prototype.toLine=function(n){this.elt[n].isArea()&&(this.elt[n]=new Wn(this.elt[n].location[0]))},An.prototype.interfaces_=function(){return[]},An.prototype.getClass=function(){return An},An.toLineLabel=function(n){for(var i=new An(Z.NONE),s=0;s<2;s++)i.setLocation(s,n.getLocation(s));return i};var Mr=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new nt,this._pts=new nt,this._label=new An(Z.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new nt,this._geometryFactory=null;var n=arguments[0],i=arguments[1];this._geometryFactory=i,this.computePoints(n),this.computeRing()};Mr.prototype.computeRing=function(){if(this._ring!==null)return null;for(var n=new Array(this._pts.size()).fill(null),i=0;i<this._pts.size();i++)n[i]=this._pts.get(i);this._ring=this._geometryFactory.createLinearRing(n),this._isHole=rt.isCCW(this._ring.getCoordinates())},Mr.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},Mr.prototype.computePoints=function(n){this._startDe=n;var i=n,s=!0;do{if(i===null)throw new Zo("Found null DirectedEdge");if(i.getEdgeRing()===this)throw new Zo("Directed Edge visited twice during ring-building at "+i.getCoordinate());this._edges.add(i);var l=i.getLabel();kt.isTrue(l.isArea()),this.mergeLabel(l),this.addPoints(i.getEdge(),i.isForward(),s),s=!1,this.setEdgeRing(i,this),i=this.getNext(i)}while(i!==this._startDe)},Mr.prototype.getLinearRing=function(){return this._ring},Mr.prototype.getCoordinate=function(n){return this._pts.get(n)},Mr.prototype.computeMaxNodeDegree=function(){this._maxNodeDegree=0;var n=this._startDe;do{var i=n.getNode().getEdges().getOutgoingDegree(this);i>this._maxNodeDegree&&(this._maxNodeDegree=i),n=this.getNext(n)}while(n!==this._startDe);this._maxNodeDegree*=2},Mr.prototype.addPoints=function(n,i,s){var l=n.getCoordinates();if(i){var h=1;s&&(h=0);for(var v=h;v<l.length;v++)this._pts.add(l[v])}else{var S=l.length-2;s&&(S=l.length-1);for(var R=S;R>=0;R--)this._pts.add(l[R])}},Mr.prototype.isHole=function(){return this._isHole},Mr.prototype.setInResult=function(){var n=this._startDe;do n.getEdge().setInResult(!0),n=n.getNext();while(n!==this._startDe)},Mr.prototype.containsPoint=function(n){var i=this.getLinearRing();if(!i.getEnvelopeInternal().contains(n)||!rt.isPointInRing(n,i.getCoordinates()))return!1;for(var s=this._holes.iterator();s.hasNext();)if(s.next().containsPoint(n))return!1;return!0},Mr.prototype.addHole=function(n){this._holes.add(n)},Mr.prototype.isShell=function(){return this._shell===null},Mr.prototype.getLabel=function(){return this._label},Mr.prototype.getEdges=function(){return this._edges},Mr.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},Mr.prototype.getShell=function(){return this._shell},Mr.prototype.mergeLabel=function(){if(arguments.length===1){var n=arguments[0];this.mergeLabel(n,0),this.mergeLabel(n,1)}else if(arguments.length===2){var i=arguments[0],s=arguments[1],l=i.getLocation(s,Ht.RIGHT);if(l===Z.NONE)return null;if(this._label.getLocation(s)===Z.NONE)return this._label.setLocation(s,l),null}},Mr.prototype.setShell=function(n){this._shell=n,n!==null&&n.addHole(this)},Mr.prototype.toPolygon=function(n){for(var i=new Array(this._holes.size()).fill(null),s=0;s<this._holes.size();s++)i[s]=this._holes.get(s).getLinearRing();return n.createPolygon(this.getLinearRing(),i)},Mr.prototype.interfaces_=function(){return[]},Mr.prototype.getClass=function(){return Mr};var rd=function(n){function i(){var s=arguments[0],l=arguments[1];n.call(this,s,l)}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.setEdgeRing=function(s,l){s.setMinEdgeRing(l)},i.prototype.getNext=function(s){return s.getNextMin()},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(Mr),Lf=function(n){function i(){var s=arguments[0],l=arguments[1];n.call(this,s,l)}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.buildMinimalRings=function(){var s=new nt,l=this._startDe;do{if(l.getMinEdgeRing()===null){var h=new rd(l,this._geometryFactory);s.add(h)}l=l.getNext()}while(l!==this._startDe);return s},i.prototype.setEdgeRing=function(s,l){s.setEdgeRing(l)},i.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var s=this._startDe;do s.getNode().getEdges().linkMinimalDirectedEdges(this),s=s.getNext();while(s!==this._startDe)},i.prototype.getNext=function(s){return s.getNext()},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(Mr),Bi=function(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,arguments.length!==0){if(arguments.length===1){var n=arguments[0];this._label=n}}};Bi.prototype.setVisited=function(n){this._isVisited=n},Bi.prototype.setInResult=function(n){this._isInResult=n},Bi.prototype.isCovered=function(){return this._isCovered},Bi.prototype.isCoveredSet=function(){return this._isCoveredSet},Bi.prototype.setLabel=function(n){this._label=n},Bi.prototype.getLabel=function(){return this._label},Bi.prototype.setCovered=function(n){this._isCovered=n,this._isCoveredSet=!0},Bi.prototype.updateIM=function(n){kt.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(n)},Bi.prototype.isInResult=function(){return this._isInResult},Bi.prototype.isVisited=function(){return this._isVisited},Bi.prototype.interfaces_=function(){return[]},Bi.prototype.getClass=function(){return Bi};var yl=function(n){function i(){n.call(this),this._coord=null,this._edges=null;var s=arguments[0],l=arguments[1];this._coord=s,this._edges=l,this._label=new An(0,Z.NONE)}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.isIncidentEdgeInResult=function(){for(var s=this.getEdges().getEdges().iterator();s.hasNext();)if(s.next().getEdge().isInResult())return!0;return!1},i.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},i.prototype.getCoordinate=function(){return this._coord},i.prototype.print=function(s){s.println("node "+this._coord+" lbl: "+this._label)},i.prototype.computeIM=function(s){},i.prototype.computeMergedLocation=function(s,l){var h=Z.NONE;if(h=this._label.getLocation(l),!s.isNull(l)){var v=s.getLocation(l);h!==Z.BOUNDARY&&(h=v)}return h},i.prototype.setLabel=function(){if(arguments.length!==2)return n.prototype.setLabel.apply(this,arguments);var s=arguments[0],l=arguments[1];this._label===null?this._label=new An(s,l):this._label.setLocation(s,l)},i.prototype.getEdges=function(){return this._edges},i.prototype.mergeLabel=function(){if(arguments[0]instanceof i){var s=arguments[0];this.mergeLabel(s._label)}else if(arguments[0]instanceof An)for(var l=arguments[0],h=0;h<2;h++){var v=this.computeMergedLocation(l,h);this._label.getLocation(h)===Z.NONE&&this._label.setLocation(h,v)}},i.prototype.add=function(s){this._edges.insert(s),s.setNode(this)},i.prototype.setLabelBoundary=function(s){if(this._label===null)return null;var l=Z.NONE;this._label!==null&&(l=this._label.getLocation(s));var h=null;switch(l){case Z.BOUNDARY:h=Z.INTERIOR;break;case Z.INTERIOR:default:h=Z.BOUNDARY}this._label.setLocation(s,h)},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(Bi),To=function(){this.nodeMap=new w,this.nodeFact=null;var n=arguments[0];this.nodeFact=n};To.prototype.find=function(n){return this.nodeMap.get(n)},To.prototype.addNode=function(){if(arguments[0]instanceof D){var n=arguments[0],i=this.nodeMap.get(n);return i===null&&(i=this.nodeFact.createNode(n),this.nodeMap.put(n,i)),i}if(arguments[0]instanceof yl){var s=arguments[0],l=this.nodeMap.get(s.getCoordinate());return l===null?(this.nodeMap.put(s.getCoordinate(),s),s):(l.mergeLabel(s),l)}},To.prototype.print=function(n){for(var i=this.iterator();i.hasNext();)i.next().print(n)},To.prototype.iterator=function(){return this.nodeMap.values().iterator()},To.prototype.values=function(){return this.nodeMap.values()},To.prototype.getBoundaryNodes=function(n){for(var i=new nt,s=this.iterator();s.hasNext();){var l=s.next();l.getLabel().getLocation(n)===Z.BOUNDARY&&i.add(l)}return i},To.prototype.add=function(n){var i=n.getCoordinate();this.addNode(i).add(n)},To.prototype.interfaces_=function(){return[]},To.prototype.getClass=function(){return To};var kn=function(){},xa={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};kn.prototype.interfaces_=function(){return[]},kn.prototype.getClass=function(){return kn},kn.isNorthern=function(n){return n===kn.NE||n===kn.NW},kn.isOpposite=function(n,i){return n===i?!1:(n-i+4)%4===2},kn.commonHalfPlane=function(n,i){if(n===i)return n;if((n-i+4)%4===2)return-1;var s=n<i?n:i;return s===0&&(n>i?n:i)===3?3:s},kn.isInHalfPlane=function(n,i){return i===kn.SE?n===kn.SE||n===kn.SW:n===i||n===i+1},kn.quadrant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var n=arguments[0],i=arguments[1];if(n===0&&i===0)throw new N("Cannot compute the quadrant for point ( "+n+", "+i+" )");return n>=0?i>=0?kn.NE:kn.SE:i>=0?kn.NW:kn.SW}if(arguments[0]instanceof D&&arguments[1]instanceof D){var s=arguments[0],l=arguments[1];if(l.x===s.x&&l.y===s.y)throw new N("Cannot compute the quadrant for two identical points "+s);return l.x>=s.x?l.y>=s.y?kn.NE:kn.SE:l.y>=s.y?kn.NW:kn.SW}},xa.NE.get=function(){return 0},xa.NW.get=function(){return 1},xa.SW.get=function(){return 2},xa.SE.get=function(){return 3},Object.defineProperties(kn,xa);var Kr=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,arguments.length===1){var n=arguments[0];this._edge=n}else if(arguments.length===3){var i=arguments[0],s=arguments[1],l=arguments[2];this._edge=i,this.init(s,l),this._label=null}else if(arguments.length===4){var h=arguments[0],v=arguments[1],S=arguments[2],R=arguments[3];this._edge=h,this.init(v,S),this._label=R}};Kr.prototype.compareDirection=function(n){return this._dx===n._dx&&this._dy===n._dy?0:this._quadrant>n._quadrant?1:this._quadrant<n._quadrant?-1:rt.computeOrientation(n._p0,n._p1,this._p1)},Kr.prototype.getDy=function(){return this._dy},Kr.prototype.getCoordinate=function(){return this._p0},Kr.prototype.setNode=function(n){this._node=n},Kr.prototype.print=function(n){var i=Math.atan2(this._dy,this._dx),s=this.getClass().getName(),l=s.lastIndexOf("."),h=s.substring(l+1);n.print(" "+h+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+i+" "+this._label)},Kr.prototype.compareTo=function(n){var i=n;return this.compareDirection(i)},Kr.prototype.getDirectedCoordinate=function(){return this._p1},Kr.prototype.getDx=function(){return this._dx},Kr.prototype.getLabel=function(){return this._label},Kr.prototype.getEdge=function(){return this._edge},Kr.prototype.getQuadrant=function(){return this._quadrant},Kr.prototype.getNode=function(){return this._node},Kr.prototype.toString=function(){var n=Math.atan2(this._dy,this._dx),i=this.getClass().getName(),s=i.lastIndexOf(".");return" "+i.substring(s+1)+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+n+" "+this._label},Kr.prototype.computeLabel=function(n){},Kr.prototype.init=function(n,i){this._p0=n,this._p1=i,this._dx=i.x-n.x,this._dy=i.y-n.y,this._quadrant=kn.quadrant(this._dx,this._dy),kt.isTrue(!(this._dx===0&&this._dy===0),"EdgeEnd with identical endpoints found")},Kr.prototype.interfaces_=function(){return[z]},Kr.prototype.getClass=function(){return Kr};var Cc=function(n){function i(){var s=arguments[0],l=arguments[1];if(n.call(this,s),this._isForward=null,this._isInResult=!1,this._isVisited=!1,this._sym=null,this._next=null,this._nextMin=null,this._edgeRing=null,this._minEdgeRing=null,this._depth=[0,-999,-999],this._isForward=l,l)this.init(s.getCoordinate(0),s.getCoordinate(1));else{var h=s.getNumPoints()-1;this.init(s.getCoordinate(h),s.getCoordinate(h-1))}this.computeDirectedLabel()}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.getNextMin=function(){return this._nextMin},i.prototype.getDepth=function(s){return this._depth[s]},i.prototype.setVisited=function(s){this._isVisited=s},i.prototype.computeDirectedLabel=function(){this._label=new An(this._edge.getLabel()),this._isForward||this._label.flip()},i.prototype.getNext=function(){return this._next},i.prototype.setDepth=function(s,l){if(this._depth[s]!==-999&&this._depth[s]!==l)throw new Zo("assigned depths do not match",this.getCoordinate());this._depth[s]=l},i.prototype.isInteriorAreaEdge=function(){for(var s=!0,l=0;l<2;l++)this._label.isArea(l)&&this._label.getLocation(l,Ht.LEFT)===Z.INTERIOR&&this._label.getLocation(l,Ht.RIGHT)===Z.INTERIOR||(s=!1);return s},i.prototype.setNextMin=function(s){this._nextMin=s},i.prototype.print=function(s){n.prototype.print.call(this,s),s.print(" "+this._depth[Ht.LEFT]+"/"+this._depth[Ht.RIGHT]),s.print(" ("+this.getDepthDelta()+")"),this._isInResult&&s.print(" inResult")},i.prototype.setMinEdgeRing=function(s){this._minEdgeRing=s},i.prototype.isLineEdge=function(){var s=this._label.isLine(0)||this._label.isLine(1),l=!this._label.isArea(0)||this._label.allPositionsEqual(0,Z.EXTERIOR),h=!this._label.isArea(1)||this._label.allPositionsEqual(1,Z.EXTERIOR);return s&&l&&h},i.prototype.setEdgeRing=function(s){this._edgeRing=s},i.prototype.getMinEdgeRing=function(){return this._minEdgeRing},i.prototype.getDepthDelta=function(){var s=this._edge.getDepthDelta();return this._isForward||(s=-s),s},i.prototype.setInResult=function(s){this._isInResult=s},i.prototype.getSym=function(){return this._sym},i.prototype.isForward=function(){return this._isForward},i.prototype.getEdge=function(){return this._edge},i.prototype.printEdge=function(s){this.print(s),s.print(" "),this._isForward?this._edge.print(s):this._edge.printReverse(s)},i.prototype.setSym=function(s){this._sym=s},i.prototype.setVisitedEdge=function(s){this.setVisited(s),this._sym.setVisited(s)},i.prototype.setEdgeDepths=function(s,l){var h=this.getEdge().getDepthDelta();this._isForward||(h=-h);var v=1;s===Ht.LEFT&&(v=-1);var S=Ht.opposite(s),R=l+h*v;this.setDepth(s,l),this.setDepth(S,R)},i.prototype.getEdgeRing=function(){return this._edgeRing},i.prototype.isInResult=function(){return this._isInResult},i.prototype.setNext=function(s){this._next=s},i.prototype.isVisited=function(){return this._isVisited},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i.depthFactor=function(s,l){return s===Z.EXTERIOR&&l===Z.INTERIOR?1:s===Z.INTERIOR&&l===Z.EXTERIOR?-1:0},i}(Kr),ja=function(){};ja.prototype.createNode=function(n){return new yl(n,null)},ja.prototype.interfaces_=function(){return[]},ja.prototype.getClass=function(){return ja};var cr=function(){if(this._edges=new nt,this._nodes=null,this._edgeEndList=new nt,arguments.length===0)this._nodes=new To(new ja);else if(arguments.length===1){var n=arguments[0];this._nodes=new To(n)}};cr.prototype.printEdges=function(n){n.println("Edges:");for(var i=0;i<this._edges.size();i++){n.println("edge "+i+":");var s=this._edges.get(i);s.print(n),s.eiList.print(n)}},cr.prototype.find=function(n){return this._nodes.find(n)},cr.prototype.addNode=function(){if(arguments[0]instanceof yl){var n=arguments[0];return this._nodes.addNode(n)}if(arguments[0]instanceof D){var i=arguments[0];return this._nodes.addNode(i)}},cr.prototype.getNodeIterator=function(){return this._nodes.iterator()},cr.prototype.linkResultDirectedEdges=function(){for(var n=this._nodes.iterator();n.hasNext();)n.next().getEdges().linkResultDirectedEdges()},cr.prototype.debugPrintln=function(n){Qt.out.println(n)},cr.prototype.isBoundaryNode=function(n,i){var s=this._nodes.find(i);if(s===null)return!1;var l=s.getLabel();return l!==null&&l.getLocation(n)===Z.BOUNDARY},cr.prototype.linkAllDirectedEdges=function(){for(var n=this._nodes.iterator();n.hasNext();)n.next().getEdges().linkAllDirectedEdges()},cr.prototype.matchInSameDirection=function(n,i,s,l){return!!n.equals(s)&&rt.computeOrientation(n,i,l)===rt.COLLINEAR&&kn.quadrant(n,i)===kn.quadrant(s,l)},cr.prototype.getEdgeEnds=function(){return this._edgeEndList},cr.prototype.debugPrint=function(n){Qt.out.print(n)},cr.prototype.getEdgeIterator=function(){return this._edges.iterator()},cr.prototype.findEdgeInSameDirection=function(n,i){for(var s=0;s<this._edges.size();s++){var l=this._edges.get(s),h=l.getCoordinates();if(this.matchInSameDirection(n,i,h[0],h[1])||this.matchInSameDirection(n,i,h[h.length-1],h[h.length-2]))return l}return null},cr.prototype.insertEdge=function(n){this._edges.add(n)},cr.prototype.findEdgeEnd=function(n){for(var i=this.getEdgeEnds().iterator();i.hasNext();){var s=i.next();if(s.getEdge()===n)return s}return null},cr.prototype.addEdges=function(n){for(var i=n.iterator();i.hasNext();){var s=i.next();this._edges.add(s);var l=new Cc(s,!0),h=new Cc(s,!1);l.setSym(h),h.setSym(l),this.add(l),this.add(h)}},cr.prototype.add=function(n){this._nodes.add(n),this._edgeEndList.add(n)},cr.prototype.getNodes=function(){return this._nodes.values()},cr.prototype.findEdge=function(n,i){for(var s=0;s<this._edges.size();s++){var l=this._edges.get(s),h=l.getCoordinates();if(n.equals(h[0])&&i.equals(h[1]))return l}return null},cr.prototype.interfaces_=function(){return[]},cr.prototype.getClass=function(){return cr},cr.linkResultDirectedEdges=function(n){for(var i=n.iterator();i.hasNext();)i.next().getEdges().linkResultDirectedEdges()};var Ei=function(){this._geometryFactory=null,this._shellList=new nt;var n=arguments[0];this._geometryFactory=n};Ei.prototype.sortShellsAndHoles=function(n,i,s){for(var l=n.iterator();l.hasNext();){var h=l.next();h.isHole()?s.add(h):i.add(h)}},Ei.prototype.computePolygons=function(n){for(var i=new nt,s=n.iterator();s.hasNext();){var l=s.next().toPolygon(this._geometryFactory);i.add(l)}return i},Ei.prototype.placeFreeHoles=function(n,i){for(var s=i.iterator();s.hasNext();){var l=s.next();if(l.getShell()===null){var h=this.findEdgeRingContaining(l,n);if(h===null)throw new Zo("unable to assign hole to a shell",l.getCoordinate(0));l.setShell(h)}}},Ei.prototype.buildMinimalEdgeRings=function(n,i,s){for(var l=new nt,h=n.iterator();h.hasNext();){var v=h.next();if(v.getMaxNodeDegree()>2){v.linkDirectedEdgesForMinimalEdgeRings();var S=v.buildMinimalRings(),R=this.findShell(S);R!==null?(this.placePolygonHoles(R,S),i.add(R)):s.addAll(S)}else l.add(v)}return l},Ei.prototype.containsPoint=function(n){for(var i=this._shellList.iterator();i.hasNext();)if(i.next().containsPoint(n))return!0;return!1},Ei.prototype.buildMaximalEdgeRings=function(n){for(var i=new nt,s=n.iterator();s.hasNext();){var l=s.next();if(l.isInResult()&&l.getLabel().isArea()&&l.getEdgeRing()===null){var h=new Lf(l,this._geometryFactory);i.add(h),h.setInResult()}}return i},Ei.prototype.placePolygonHoles=function(n,i){for(var s=i.iterator();s.hasNext();){var l=s.next();l.isHole()&&l.setShell(n)}},Ei.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},Ei.prototype.findEdgeRingContaining=function(n,i){for(var s=n.getLinearRing(),l=s.getEnvelopeInternal(),h=s.getCoordinateN(0),v=null,S=null,R=i.iterator();R.hasNext();){var V=R.next(),ot=V.getLinearRing(),St=ot.getEnvelopeInternal();v!==null&&(S=v.getLinearRing().getEnvelopeInternal());var bt=!1;St.contains(l)&&rt.isPointInRing(h,ot.getCoordinates())&&(bt=!0),bt&&(v===null||S.contains(St))&&(v=V)}return v},Ei.prototype.findShell=function(n){for(var i=0,s=null,l=n.iterator();l.hasNext();){var h=l.next();h.isHole()||(s=h,i++)}return kt.isTrue(i<=1,"found two shells in MinimalEdgeRing list"),s},Ei.prototype.add=function(){if(arguments.length===1){var n=arguments[0];this.add(n.getEdgeEnds(),n.getNodes())}else if(arguments.length===2){var i=arguments[0],s=arguments[1];cr.linkResultDirectedEdges(s);var l=this.buildMaximalEdgeRings(i),h=new nt,v=this.buildMinimalEdgeRings(l,this._shellList,h);this.sortShellsAndHoles(v,this._shellList,h),this.placeFreeHoles(this._shellList,h)}},Ei.prototype.interfaces_=function(){return[]},Ei.prototype.getClass=function(){return Ei};var jn=function(){};jn.prototype.getBounds=function(){},jn.prototype.interfaces_=function(){return[]},jn.prototype.getClass=function(){return jn};var Xe=function(){this._bounds=null,this._item=null;var n=arguments[0],i=arguments[1];this._bounds=n,this._item=i};Xe.prototype.getItem=function(){return this._item},Xe.prototype.getBounds=function(){return this._bounds},Xe.prototype.interfaces_=function(){return[jn,t]},Xe.prototype.getClass=function(){return Xe};var hs=function(){this._size=null,this._items=null,this._size=0,this._items=new nt,this._items.add(null)};hs.prototype.poll=function(){if(this.isEmpty())return null;var n=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),n},hs.prototype.size=function(){return this._size},hs.prototype.reorder=function(n){for(var i=null,s=this._items.get(n);2*n<=this._size&&((i=2*n)!==this._size&&this._items.get(i+1).compareTo(this._items.get(i))<0&&i++,this._items.get(i).compareTo(s)<0);n=i)this._items.set(n,this._items.get(i));this._items.set(n,s)},hs.prototype.clear=function(){this._size=0,this._items.clear()},hs.prototype.isEmpty=function(){return this._size===0},hs.prototype.add=function(n){this._items.add(null),this._size+=1;var i=this._size;for(this._items.set(0,n);n.compareTo(this._items.get(Math.trunc(i/2)))<0;i/=2)this._items.set(i,this._items.get(Math.trunc(i/2)));this._items.set(i,n)},hs.prototype.interfaces_=function(){return[]},hs.prototype.getClass=function(){return hs};var Rs=function(){};Rs.prototype.visitItem=function(n){},Rs.prototype.interfaces_=function(){return[]},Rs.prototype.getClass=function(){return Rs};var Ea=function(){};Ea.prototype.insert=function(n,i){},Ea.prototype.remove=function(n,i){},Ea.prototype.query=function(){},Ea.prototype.interfaces_=function(){return[]},Ea.prototype.getClass=function(){return Ea};var Ar=function(){if(this._childBoundables=new nt,this._bounds=null,this._level=null,arguments.length!==0){if(arguments.length===1){var n=arguments[0];this._level=n}}},Nf={serialVersionUID:{configurable:!0}};Ar.prototype.getLevel=function(){return this._level},Ar.prototype.size=function(){return this._childBoundables.size()},Ar.prototype.getChildBoundables=function(){return this._childBoundables},Ar.prototype.addChildBoundable=function(n){kt.isTrue(this._bounds===null),this._childBoundables.add(n)},Ar.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Ar.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds},Ar.prototype.interfaces_=function(){return[jn,t]},Ar.prototype.getClass=function(){return Ar},Nf.serialVersionUID.get=function(){return 6493722185909574e3},Object.defineProperties(Ar,Nf);var uo=function(){};uo.reverseOrder=function(){return{compare:function(n,i){return i.compareTo(n)}}},uo.min=function(n){return uo.sort(n),n.get(0)},uo.sort=function(n,i){var s=n.toArray();i?er.sort(s,i):er.sort(s);for(var l=n.iterator(),h=0,v=s.length;h<v;h++)l.next(),l.set(s[h])},uo.singletonList=function(n){var i=new nt;return i.add(n),i};var _r=function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var n=arguments[0],i=arguments[1],s=arguments[2];this._boundable1=n,this._boundable2=i,this._itemDistance=s,this._distance=this.distance()};_r.prototype.expandToQueue=function(n,i){var s=_r.isComposite(this._boundable1),l=_r.isComposite(this._boundable2);if(s&&l)return _r.area(this._boundable1)>_r.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,n,i),null):(this.expand(this._boundable2,this._boundable1,n,i),null);if(s)return this.expand(this._boundable1,this._boundable2,n,i),null;if(l)return this.expand(this._boundable2,this._boundable1,n,i),null;throw new N("neither boundable is composite")},_r.prototype.isLeaves=function(){return!(_r.isComposite(this._boundable1)||_r.isComposite(this._boundable2))},_r.prototype.compareTo=function(n){var i=n;return this._distance<i._distance?-1:this._distance>i._distance?1:0},_r.prototype.expand=function(n,i,s,l){for(var h=n.getChildBoundables().iterator();h.hasNext();){var v=h.next(),S=new _r(v,i,this._itemDistance);S.getDistance()<l&&s.add(S)}},_r.prototype.getBoundable=function(n){return n===0?this._boundable1:this._boundable2},_r.prototype.getDistance=function(){return this._distance},_r.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},_r.prototype.interfaces_=function(){return[z]},_r.prototype.getClass=function(){return _r},_r.area=function(n){return n.getBounds().getArea()},_r.isComposite=function(n){return n instanceof Ar};var Fr=function n(){if(this._root=null,this._built=!1,this._itemBoundables=new nt,this._nodeCapacity=null,arguments.length===0){var i=n.DEFAULT_NODE_CAPACITY;this._nodeCapacity=i}else if(arguments.length===1){var s=arguments[0];kt.isTrue(s>1,"Node capacity must be greater than 1"),this._nodeCapacity=s}},Ur={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};Fr.prototype.getNodeCapacity=function(){return this._nodeCapacity},Fr.prototype.lastNode=function(n){return n.get(n.size()-1)},Fr.prototype.size=function(){if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.size(this._root));if(arguments.length===1){for(var n=0,i=arguments[0].getChildBoundables().iterator();i.hasNext();){var s=i.next();s instanceof Ar?n+=this.size(s):s instanceof Xe&&(n+=1)}return n}},Fr.prototype.removeItem=function(n,i){for(var s=null,l=n.getChildBoundables().iterator();l.hasNext();){var h=l.next();h instanceof Xe&&h.getItem()===i&&(s=h)}return s!==null&&(n.getChildBoundables().remove(s),!0)},Fr.prototype.itemsTree=function(){if(arguments.length===0){this.build();var n=this.itemsTree(this._root);return n===null?new nt:n}if(arguments.length===1){for(var i=arguments[0],s=new nt,l=i.getChildBoundables().iterator();l.hasNext();){var h=l.next();if(h instanceof Ar){var v=this.itemsTree(h);v!==null&&s.add(v)}else h instanceof Xe?s.add(h.getItem()):kt.shouldNeverReachHere()}return s.size()<=0?null:s}},Fr.prototype.insert=function(n,i){kt.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new Xe(n,i))},Fr.prototype.boundablesAtLevel=function(){if(arguments.length===1){var n=arguments[0],i=new nt;return this.boundablesAtLevel(n,this._root,i),i}if(arguments.length===3){var s=arguments[0],l=arguments[1],h=arguments[2];if(kt.isTrue(s>-2),l.getLevel()===s)return h.add(l),null;for(var v=l.getChildBoundables().iterator();v.hasNext();){var S=v.next();S instanceof Ar?this.boundablesAtLevel(s,S,h):(kt.isTrue(S instanceof Xe),s===-1&&h.add(S))}return null}},Fr.prototype.query=function(){if(arguments.length===1){var n=arguments[0];this.build();var i=new nt;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),n)&&this.query(n,this._root,i),i}if(arguments.length===2){var s=arguments[0],l=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),s)&&this.query(s,this._root,l)}else if(arguments.length===3){if(et(arguments[2],Rs)&&arguments[0]instanceof Object&&arguments[1]instanceof Ar)for(var h=arguments[0],v=arguments[1],S=arguments[2],R=v.getChildBoundables(),V=0;V<R.size();V++){var ot=R.get(V);this.getIntersectsOp().intersects(ot.getBounds(),h)&&(ot instanceof Ar?this.query(h,ot,S):ot instanceof Xe?S.visitItem(ot.getItem()):kt.shouldNeverReachHere())}else if(et(arguments[2],ut)&&arguments[0]instanceof Object&&arguments[1]instanceof Ar)for(var St=arguments[0],bt=arguments[1],Yt=arguments[2],Jt=bt.getChildBoundables(),se=0;se<Jt.size();se++){var _e=Jt.get(se);this.getIntersectsOp().intersects(_e.getBounds(),St)&&(_e instanceof Ar?this.query(St,_e,Yt):_e instanceof Xe?Yt.add(_e.getItem()):kt.shouldNeverReachHere())}}},Fr.prototype.build=function(){if(this._built)return null;this._root=this._itemBoundables.isEmpty()?this.createNode(0):this.createHigherLevels(this._itemBoundables,-1),this._itemBoundables=null,this._built=!0},Fr.prototype.getRoot=function(){return this.build(),this._root},Fr.prototype.remove=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];return this.build(),!!this.getIntersectsOp().intersects(this._root.getBounds(),n)&&this.remove(n,this._root,i)}if(arguments.length===3){var s=arguments[0],l=arguments[1],h=arguments[2],v=this.removeItem(l,h);if(v)return!0;for(var S=null,R=l.getChildBoundables().iterator();R.hasNext();){var V=R.next();if(this.getIntersectsOp().intersects(V.getBounds(),s)&&V instanceof Ar&&(v=this.remove(s,V,h))){S=V;break}}return S!==null&&S.getChildBoundables().isEmpty()&&l.getChildBoundables().remove(S),v}},Fr.prototype.createHigherLevels=function(n,i){kt.isTrue(!n.isEmpty());var s=this.createParentBoundables(n,i+1);return s.size()===1?s.get(0):this.createHigherLevels(s,i+1)},Fr.prototype.depth=function(){if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(arguments.length===1){for(var n=0,i=arguments[0].getChildBoundables().iterator();i.hasNext();){var s=i.next();if(s instanceof Ar){var l=this.depth(s);l>n&&(n=l)}}return n+1}},Fr.prototype.createParentBoundables=function(n,i){kt.isTrue(!n.isEmpty());var s=new nt;s.add(this.createNode(i));var l=new nt(n);uo.sort(l,this.getComparator());for(var h=l.iterator();h.hasNext();){var v=h.next();this.lastNode(s).getChildBoundables().size()===this.getNodeCapacity()&&s.add(this.createNode(i)),this.lastNode(s).addChildBoundable(v)}return s},Fr.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},Fr.prototype.interfaces_=function(){return[t]},Fr.prototype.getClass=function(){return Fr},Fr.compareDoubles=function(n,i){return n>i?1:n<i?-1:0},Ur.IntersectsOp.get=function(){return Pc},Ur.serialVersionUID.get=function(){return-3886435814360241e3},Ur.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(Fr,Ur);var Pc=function(){},Ao=function(){};Ao.prototype.distance=function(n,i){},Ao.prototype.interfaces_=function(){return[]},Ao.prototype.getClass=function(){return Ao};var Ic=function(n){function i(l){l=l||i.DEFAULT_NODE_CAPACITY,n.call(this,l)}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return i.prototype.createParentBoundablesFromVerticalSlices=function(l,h){kt.isTrue(l.length>0);for(var v=new nt,S=0;S<l.length;S++)v.addAll(this.createParentBoundablesFromVerticalSlice(l[S],h));return v},i.prototype.createNode=function(l){return new vl(l)},i.prototype.size=function(){return arguments.length===0?n.prototype.size.call(this):n.prototype.size.apply(this,arguments)},i.prototype.insert=function(){if(arguments.length!==2)return n.prototype.insert.apply(this,arguments);var l=arguments[0],h=arguments[1];if(l.isNull())return null;n.prototype.insert.call(this,l,h)},i.prototype.getIntersectsOp=function(){return i.intersectsOp},i.prototype.verticalSlices=function(l,h){for(var v=Math.trunc(Math.ceil(l.size()/h)),S=new Array(h).fill(null),R=l.iterator(),V=0;V<h;V++){S[V]=new nt;for(var ot=0;R.hasNext()&&ot<v;){var St=R.next();S[V].add(St),ot++}}return S},i.prototype.query=function(){if(arguments.length===1){var l=arguments[0];return n.prototype.query.call(this,l)}if(arguments.length===2){var h=arguments[0],v=arguments[1];n.prototype.query.call(this,h,v)}else if(arguments.length===3){if(et(arguments[2],Rs)&&arguments[0]instanceof Object&&arguments[1]instanceof Ar){var S=arguments[0],R=arguments[1],V=arguments[2];n.prototype.query.call(this,S,R,V)}else if(et(arguments[2],ut)&&arguments[0]instanceof Object&&arguments[1]instanceof Ar){var ot=arguments[0],St=arguments[1],bt=arguments[2];n.prototype.query.call(this,ot,St,bt)}}},i.prototype.getComparator=function(){return i.yComparator},i.prototype.createParentBoundablesFromVerticalSlice=function(l,h){return n.prototype.createParentBoundables.call(this,l,h)},i.prototype.remove=function(){if(arguments.length===2){var l=arguments[0],h=arguments[1];return n.prototype.remove.call(this,l,h)}return n.prototype.remove.apply(this,arguments)},i.prototype.depth=function(){return arguments.length===0?n.prototype.depth.call(this):n.prototype.depth.apply(this,arguments)},i.prototype.createParentBoundables=function(l,h){kt.isTrue(!l.isEmpty());var v=Math.trunc(Math.ceil(l.size()/this.getNodeCapacity())),S=new nt(l);uo.sort(S,i.xComparator);var R=this.verticalSlices(S,Math.trunc(Math.ceil(Math.sqrt(v))));return this.createParentBoundablesFromVerticalSlices(R,h)},i.prototype.nearestNeighbour=function(){if(arguments.length===1){if(et(arguments[0],Ao)){var l=arguments[0],h=new _r(this.getRoot(),this.getRoot(),l);return this.nearestNeighbour(h)}if(arguments[0]instanceof _r){var v=arguments[0];return this.nearestNeighbour(v,A.POSITIVE_INFINITY)}}else if(arguments.length===2){if(arguments[0]instanceof i&&et(arguments[1],Ao)){var S=arguments[0],R=arguments[1],V=new _r(this.getRoot(),S.getRoot(),R);return this.nearestNeighbour(V)}if(arguments[0]instanceof _r&&typeof arguments[1]=="number"){var ot=arguments[0],St=arguments[1],bt=null,Yt=new hs;for(Yt.add(ot);!Yt.isEmpty()&&St>0;){var Jt=Yt.poll(),se=Jt.getDistance();if(se>=St)break;Jt.isLeaves()?(St=se,bt=Jt):Jt.expandToQueue(Yt,St)}return[bt.getBoundable(0).getItem(),bt.getBoundable(1).getItem()]}}else if(arguments.length===3){var _e=arguments[0],Cn=arguments[1],Xn=arguments[2],ui=new Xe(_e,Cn),rs=new _r(this.getRoot(),ui,Xn);return this.nearestNeighbour(rs)[0]}},i.prototype.interfaces_=function(){return[Ea,t]},i.prototype.getClass=function(){return i},i.centreX=function(l){return i.avg(l.getMinX(),l.getMaxX())},i.avg=function(l,h){return(l+h)/2},i.centreY=function(l){return i.avg(l.getMinY(),l.getMaxY())},s.STRtreeNode.get=function(){return vl},s.serialVersionUID.get=function(){return 0x39920f7d5f261e0},s.xComparator.get=function(){return{interfaces_:function(){return[q]},compare:function(l,h){return n.compareDoubles(i.centreX(l.getBounds()),i.centreX(h.getBounds()))}}},s.yComparator.get=function(){return{interfaces_:function(){return[q]},compare:function(l,h){return n.compareDoubles(i.centreY(l.getBounds()),i.centreY(h.getBounds()))}}},s.intersectsOp.get=function(){return{interfaces_:function(){return[n.IntersectsOp]},intersects:function(l,h){return l.intersects(h)}}},s.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(i,s),i}(Fr),vl=function(n){function i(){var s=arguments[0];n.call(this,s)}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.computeBounds=function(){for(var s=null,l=this.getChildBoundables().iterator();l.hasNext();){var h=l.next();s===null?s=new Xt(h.getBounds()):s.expandToInclude(h.getBounds())}return s},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(Ar),ir=function(){};ir.prototype.interfaces_=function(){return[]},ir.prototype.getClass=function(){return ir},ir.relativeSign=function(n,i){return n<i?-1:n>i?1:0},ir.compare=function(n,i,s){if(i.equals2D(s))return 0;var l=ir.relativeSign(i.x,s.x),h=ir.relativeSign(i.y,s.y);switch(n){case 0:return ir.compareValue(l,h);case 1:return ir.compareValue(h,l);case 2:return ir.compareValue(h,-l);case 3:return ir.compareValue(-l,h);case 4:return ir.compareValue(-l,-h);case 5:return ir.compareValue(-h,-l);case 6:return ir.compareValue(-h,l);case 7:return ir.compareValue(l,-h)}return kt.shouldNeverReachHere("invalid octant value"),0},ir.compareValue=function(n,i){return n<0?-1:n>0?1:i<0?-1:i>0?1:0};var ps=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var n=arguments[0],i=arguments[1],s=arguments[2],l=arguments[3];this._segString=n,this.coord=new D(i),this.segmentIndex=s,this._segmentOctant=l,this._isInterior=!i.equals2D(n.getCoordinate(s))};ps.prototype.getCoordinate=function(){return this.coord},ps.prototype.print=function(n){n.print(this.coord),n.print(" seg # = "+this.segmentIndex)},ps.prototype.compareTo=function(n){var i=n;return this.segmentIndex<i.segmentIndex?-1:this.segmentIndex>i.segmentIndex?1:this.coord.equals2D(i.coord)?0:ir.compare(this._segmentOctant,this.coord,i.coord)},ps.prototype.isEndPoint=function(n){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===n},ps.prototype.isInterior=function(){return this._isInterior},ps.prototype.interfaces_=function(){return[z]},ps.prototype.getClass=function(){return ps};var Qr=function(){this._nodeMap=new w,this._edge=null;var n=arguments[0];this._edge=n};Qr.prototype.getSplitCoordinates=function(){var n=new dt;this.addEndpoints();for(var i=this.iterator(),s=i.next();i.hasNext();){var l=i.next();this.addEdgeCoordinates(s,l,n),s=l}return n.toCoordinateArray()},Qr.prototype.addCollapsedNodes=function(){var n=new nt;this.findCollapsesFromInsertedNodes(n),this.findCollapsesFromExistingVertices(n);for(var i=n.iterator();i.hasNext();){var s=i.next().intValue();this.add(this._edge.getCoordinate(s),s)}},Qr.prototype.print=function(n){n.println("Intersections:");for(var i=this.iterator();i.hasNext();)i.next().print(n)},Qr.prototype.findCollapsesFromExistingVertices=function(n){for(var i=0;i<this._edge.size()-2;i++){var s=this._edge.getCoordinate(i),l=this._edge.getCoordinate(i+2);s.equals2D(l)&&n.add(new Et(i+1))}},Qr.prototype.addEdgeCoordinates=function(n,i,s){var l=this._edge.getCoordinate(i.segmentIndex),h=i.isInterior()||!i.coord.equals2D(l);s.add(new D(n.coord),!1);for(var v=n.segmentIndex+1;v<=i.segmentIndex;v++)s.add(this._edge.getCoordinate(v));h&&s.add(new D(i.coord))},Qr.prototype.iterator=function(){return this._nodeMap.values().iterator()},Qr.prototype.addSplitEdges=function(n){this.addEndpoints(),this.addCollapsedNodes();for(var i=this.iterator(),s=i.next();i.hasNext();){var l=i.next(),h=this.createSplitEdge(s,l);n.add(h),s=l}},Qr.prototype.findCollapseIndex=function(n,i,s){if(!n.coord.equals2D(i.coord))return!1;var l=i.segmentIndex-n.segmentIndex;return i.isInterior()||l--,l===1&&(s[0]=n.segmentIndex+1,!0)},Qr.prototype.findCollapsesFromInsertedNodes=function(n){for(var i=new Array(1).fill(null),s=this.iterator(),l=s.next();s.hasNext();){var h=s.next();this.findCollapseIndex(l,h,i)&&n.add(new Et(i[0])),l=h}},Qr.prototype.getEdge=function(){return this._edge},Qr.prototype.addEndpoints=function(){var n=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(n),n)},Qr.prototype.createSplitEdge=function(n,i){var s=i.segmentIndex-n.segmentIndex+2,l=this._edge.getCoordinate(i.segmentIndex),h=i.isInterior()||!i.coord.equals2D(l);h||s--;var v=new Array(s).fill(null),S=0;v[S++]=new D(n.coord);for(var R=n.segmentIndex+1;R<=i.segmentIndex;R++)v[S++]=this._edge.getCoordinate(R);return h&&(v[S]=new D(i.coord)),new dr(v,this._edge.getData())},Qr.prototype.add=function(n,i){var s=new ps(this._edge,n,i,this._edge.getSegmentOctant(i)),l=this._nodeMap.get(s);return l!==null?(kt.isTrue(l.coord.equals2D(n),"Found equal nodes with different coordinates"),l):(this._nodeMap.put(s,s),s)},Qr.prototype.checkSplitEdgesCorrectness=function(n){var i=this._edge.getCoordinates(),s=n.get(0).getCoordinate(0);if(!s.equals2D(i[0]))throw new Ue("bad split edge start point at "+s);var l=n.get(n.size()-1).getCoordinates(),h=l[l.length-1];if(!h.equals2D(i[i.length-1]))throw new Ue("bad split edge end point at "+h)},Qr.prototype.interfaces_=function(){return[]},Qr.prototype.getClass=function(){return Qr};var Zs=function(){};Zs.prototype.interfaces_=function(){return[]},Zs.prototype.getClass=function(){return Zs},Zs.octant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var n=arguments[0],i=arguments[1];if(n===0&&i===0)throw new N("Cannot compute the octant for point ( "+n+", "+i+" )");var s=Math.abs(n),l=Math.abs(i);return n>=0?i>=0?s>=l?0:1:s>=l?7:6:i>=0?s>=l?3:2:s>=l?4:5}if(arguments[0]instanceof D&&arguments[1]instanceof D){var h=arguments[0],v=arguments[1],S=v.x-h.x,R=v.y-h.y;if(S===0&&R===0)throw new N("Cannot compute the octant for two identical points "+h);return Zs.octant(S,R)}};var Co=function(){};Co.prototype.getCoordinates=function(){},Co.prototype.size=function(){},Co.prototype.getCoordinate=function(n){},Co.prototype.isClosed=function(){},Co.prototype.setData=function(n){},Co.prototype.getData=function(){},Co.prototype.interfaces_=function(){return[]},Co.prototype.getClass=function(){return Co};var tu=function(){};tu.prototype.addIntersection=function(n,i){},tu.prototype.interfaces_=function(){return[Co]},tu.prototype.getClass=function(){return tu};var dr=function(){this._nodeList=new Qr(this),this._pts=null,this._data=null;var n=arguments[0],i=arguments[1];this._pts=n,this._data=i};dr.prototype.getCoordinates=function(){return this._pts},dr.prototype.size=function(){return this._pts.length},dr.prototype.getCoordinate=function(n){return this._pts[n]},dr.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},dr.prototype.getSegmentOctant=function(n){return n===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(n),this.getCoordinate(n+1))},dr.prototype.setData=function(n){this._data=n},dr.prototype.safeOctant=function(n,i){return n.equals2D(i)?0:Zs.octant(n,i)},dr.prototype.getData=function(){return this._data},dr.prototype.addIntersection=function(){if(arguments.length===2){var n=arguments[0],i=arguments[1];this.addIntersectionNode(n,i)}else if(arguments.length===4){var s=arguments[0],l=arguments[1],h=arguments[3],v=new D(s.getIntersection(h));this.addIntersection(v,l)}},dr.prototype.toString=function(){return de.toLineString(new De(this._pts))},dr.prototype.getNodeList=function(){return this._nodeList},dr.prototype.addIntersectionNode=function(n,i){var s=i,l=s+1;if(l<this._pts.length){var h=this._pts[l];n.equals2D(h)&&(s=l)}return this._nodeList.add(n,s)},dr.prototype.addIntersections=function(n,i,s){for(var l=0;l<n.getIntersectionNum();l++)this.addIntersection(n,i,s,l)},dr.prototype.interfaces_=function(){return[tu]},dr.prototype.getClass=function(){return dr},dr.getNodedSubstrings=function(){if(arguments.length===1){var n=arguments[0],i=new nt;return dr.getNodedSubstrings(n,i),i}if(arguments.length===2)for(var s=arguments[0],l=arguments[1],h=s.iterator();h.hasNext();)h.next().getNodeList().addSplitEdges(l)};var ne=function(){if(this.p0=null,this.p1=null,arguments.length===0)this.p0=new D,this.p1=new D;else if(arguments.length===1){var n=arguments[0];this.p0=new D(n.p0),this.p1=new D(n.p1)}else if(arguments.length===2)this.p0=arguments[0],this.p1=arguments[1];else if(arguments.length===4){var i=arguments[0],s=arguments[1],l=arguments[2],h=arguments[3];this.p0=new D(i,s),this.p1=new D(l,h)}},Of={serialVersionUID:{configurable:!0}};ne.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},ne.prototype.orientationIndex=function(){if(arguments[0]instanceof ne){var n=arguments[0],i=rt.orientationIndex(this.p0,this.p1,n.p0),s=rt.orientationIndex(this.p0,this.p1,n.p1);return i>=0&&s>=0||i<=0&&s<=0?Math.max(i,s):0}if(arguments[0]instanceof D){var l=arguments[0];return rt.orientationIndex(this.p0,this.p1,l)}},ne.prototype.toGeometry=function(n){return n.createLineString([this.p0,this.p1])},ne.prototype.isVertical=function(){return this.p0.x===this.p1.x},ne.prototype.equals=function(n){if(!(n instanceof ne))return!1;var i=n;return this.p0.equals(i.p0)&&this.p1.equals(i.p1)},ne.prototype.intersection=function(n){var i=new $n;return i.computeIntersection(this.p0,this.p1,n.p0,n.p1),i.hasIntersection()?i.getIntersection(0):null},ne.prototype.project=function(){if(arguments[0]instanceof D){var n=arguments[0];if(n.equals(this.p0)||n.equals(this.p1))return new D(n);var i=this.projectionFactor(n),s=new D;return s.x=this.p0.x+i*(this.p1.x-this.p0.x),s.y=this.p0.y+i*(this.p1.y-this.p0.y),s}if(arguments[0]instanceof ne){var l=arguments[0],h=this.projectionFactor(l.p0),v=this.projectionFactor(l.p1);if(h>=1&&v>=1||h<=0&&v<=0)return null;var S=this.project(l.p0);h<0&&(S=this.p0),h>1&&(S=this.p1);var R=this.project(l.p1);return v<0&&(R=this.p0),v>1&&(R=this.p1),new ne(S,R)}},ne.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},ne.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},ne.prototype.getCoordinate=function(n){return n===0?this.p0:this.p1},ne.prototype.distancePerpendicular=function(n){return rt.distancePointLinePerpendicular(n,this.p0,this.p1)},ne.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},ne.prototype.midPoint=function(){return ne.midPoint(this.p0,this.p1)},ne.prototype.projectionFactor=function(n){if(n.equals(this.p0))return 0;if(n.equals(this.p1))return 1;var i=this.p1.x-this.p0.x,s=this.p1.y-this.p0.y,l=i*i+s*s;return l<=0?A.NaN:((n.x-this.p0.x)*i+(n.y-this.p0.y)*s)/l},ne.prototype.closestPoints=function(n){var i=this.intersection(n);if(i!==null)return[i,i];var s=new Array(2).fill(null),l=A.MAX_VALUE,h=null,v=this.closestPoint(n.p0);l=v.distance(n.p0),s[0]=v,s[1]=n.p0;var S=this.closestPoint(n.p1);(h=S.distance(n.p1))<l&&(l=h,s[0]=S,s[1]=n.p1);var R=n.closestPoint(this.p0);(h=R.distance(this.p0))<l&&(l=h,s[0]=this.p0,s[1]=R);var V=n.closestPoint(this.p1);return(h=V.distance(this.p1))<l&&(l=h,s[0]=this.p1,s[1]=V),s},ne.prototype.closestPoint=function(n){var i=this.projectionFactor(n);return i>0&&i<1?this.project(n):this.p0.distance(n)<this.p1.distance(n)?this.p0:this.p1},ne.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},ne.prototype.getLength=function(){return this.p0.distance(this.p1)},ne.prototype.compareTo=function(n){var i=n,s=this.p0.compareTo(i.p0);return s!==0?s:this.p1.compareTo(i.p1)},ne.prototype.reverse=function(){var n=this.p0;this.p0=this.p1,this.p1=n},ne.prototype.equalsTopo=function(n){return this.p0.equals(n.p0)&&(this.p1.equals(n.p1)||this.p0.equals(n.p1))&&this.p1.equals(n.p0)},ne.prototype.lineIntersection=function(n){try{return me.intersection(this.p0,this.p1,n.p0,n.p1)}catch(i){if(!(i instanceof le))throw i}return null},ne.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},ne.prototype.pointAlongOffset=function(n,i){var s=this.p0.x+n*(this.p1.x-this.p0.x),l=this.p0.y+n*(this.p1.y-this.p0.y),h=this.p1.x-this.p0.x,v=this.p1.y-this.p0.y,S=Math.sqrt(h*h+v*v),R=0,V=0;if(i!==0){if(S<=0)throw new Error("Cannot compute offset from zero-length line segment");R=i*h/S,V=i*v/S}return new D(s-V,l+R)},ne.prototype.setCoordinates=function(){if(arguments.length===1){var n=arguments[0];this.setCoordinates(n.p0,n.p1)}else if(arguments.length===2){var i=arguments[0],s=arguments[1];this.p0.x=i.x,this.p0.y=i.y,this.p1.x=s.x,this.p1.y=s.y}},ne.prototype.segmentFraction=function(n){var i=this.projectionFactor(n);return i<0?i=0:(i>1||A.isNaN(i))&&(i=1),i},ne.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},ne.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},ne.prototype.distance=function(){if(arguments[0]instanceof ne){var n=arguments[0];return rt.distanceLineLine(this.p0,this.p1,n.p0,n.p1)}if(arguments[0]instanceof D){var i=arguments[0];return rt.distancePointLine(i,this.p0,this.p1)}},ne.prototype.pointAlong=function(n){var i=new D;return i.x=this.p0.x+n*(this.p1.x-this.p0.x),i.y=this.p0.y+n*(this.p1.y-this.p0.y),i},ne.prototype.hashCode=function(){var n=A.doubleToLongBits(this.p0.x);n^=31*A.doubleToLongBits(this.p0.y);var i=Math.trunc(n)^Math.trunc(n>>32),s=A.doubleToLongBits(this.p1.x);return s^=31*A.doubleToLongBits(this.p1.y),i^(Math.trunc(s)^Math.trunc(s>>32))},ne.prototype.interfaces_=function(){return[z,t]},ne.prototype.getClass=function(){return ne},ne.midPoint=function(n,i){return new D((n.x+i.x)/2,(n.y+i.y)/2)},Of.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(ne,Of);var wi=function(){this.tempEnv1=new Xt,this.tempEnv2=new Xt,this._overlapSeg1=new ne,this._overlapSeg2=new ne};wi.prototype.overlap=function(){if(arguments.length!==2){if(arguments.length===4){var n=arguments[0],i=arguments[1],s=arguments[2],l=arguments[3];n.getLineSegment(i,this._overlapSeg1),s.getLineSegment(l,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}},wi.prototype.interfaces_=function(){return[]},wi.prototype.getClass=function(){return wi};var Mi=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var n=arguments[0],i=arguments[1],s=arguments[2],l=arguments[3];this._pts=n,this._start=i,this._end=s,this._context=l};Mi.prototype.getLineSegment=function(n,i){i.p0=this._pts[n],i.p1=this._pts[n+1]},Mi.prototype.computeSelect=function(n,i,s,l){var h=this._pts[i],v=this._pts[s];if(l.tempEnv1.init(h,v),s-i==1)return l.select(this,i),null;if(!n.intersects(l.tempEnv1))return null;var S=Math.trunc((i+s)/2);i<S&&this.computeSelect(n,i,S,l),S<s&&this.computeSelect(n,S,s,l)},Mi.prototype.getCoordinates=function(){for(var n=new Array(this._end-this._start+1).fill(null),i=0,s=this._start;s<=this._end;s++)n[i++]=this._pts[s];return n},Mi.prototype.computeOverlaps=function(n,i){this.computeOverlapsInternal(this._start,this._end,n,n._start,n._end,i)},Mi.prototype.setId=function(n){this._id=n},Mi.prototype.select=function(n,i){this.computeSelect(n,this._start,this._end,i)},Mi.prototype.getEnvelope=function(){if(this._env===null){var n=this._pts[this._start],i=this._pts[this._end];this._env=new Xt(n,i)}return this._env},Mi.prototype.getEndIndex=function(){return this._end},Mi.prototype.getStartIndex=function(){return this._start},Mi.prototype.getContext=function(){return this._context},Mi.prototype.getId=function(){return this._id},Mi.prototype.computeOverlapsInternal=function(n,i,s,l,h,v){var S=this._pts[n],R=this._pts[i],V=s._pts[l],ot=s._pts[h];if(i-n==1&&h-l==1)return v.overlap(this,n,s,l),null;if(v.tempEnv1.init(S,R),v.tempEnv2.init(V,ot),!v.tempEnv1.intersects(v.tempEnv2))return null;var St=Math.trunc((n+i)/2),bt=Math.trunc((l+h)/2);n<St&&(l<bt&&this.computeOverlapsInternal(n,St,s,l,bt,v),bt<h&&this.computeOverlapsInternal(n,St,s,bt,h,v)),St<i&&(l<bt&&this.computeOverlapsInternal(St,i,s,l,bt,v),bt<h&&this.computeOverlapsInternal(St,i,s,bt,h,v))},Mi.prototype.interfaces_=function(){return[]},Mi.prototype.getClass=function(){return Mi};var lo=function(){};lo.prototype.interfaces_=function(){return[]},lo.prototype.getClass=function(){return lo},lo.getChainStartIndices=function(n){var i=0,s=new nt;s.add(new Et(i));do{var l=lo.findChainEnd(n,i);s.add(new Et(l)),i=l}while(i<n.length-1);return lo.toIntArray(s)},lo.findChainEnd=function(n,i){for(var s=i;s<n.length-1&&n[s].equals2D(n[s+1]);)s++;if(s>=n.length-1)return n.length-1;for(var l=kn.quadrant(n[s],n[s+1]),h=i+1;h<n.length&&!(!n[h-1].equals2D(n[h])&&kn.quadrant(n[h-1],n[h])!==l);)h++;return h-1},lo.getChains=function(){if(arguments.length===1){var n=arguments[0];return lo.getChains(n,null)}if(arguments.length===2){for(var i=arguments[0],s=arguments[1],l=new nt,h=lo.getChainStartIndices(i),v=0;v<h.length-1;v++){var S=new Mi(i,h[v],h[v+1],s);l.add(S)}return l}},lo.toIntArray=function(n){for(var i=new Array(n.size()).fill(null),s=0;s<i.length;s++)i[s]=n.get(s).intValue();return i};var zi=function(){};zi.prototype.computeNodes=function(n){},zi.prototype.getNodedSubstrings=function(){},zi.prototype.interfaces_=function(){return[]},zi.prototype.getClass=function(){return zi};var Js=function(){if(this._segInt=null,arguments.length!==0){if(arguments.length===1){var n=arguments[0];this.setSegmentIntersector(n)}}};Js.prototype.setSegmentIntersector=function(n){this._segInt=n},Js.prototype.interfaces_=function(){return[zi]},Js.prototype.getClass=function(){return Js};var zu=function(n){function i(l){l?n.call(this,l):n.call(this),this._monoChains=new nt,this._index=new Ic,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var s={SegmentOverlapAction:{configurable:!0}};return i.prototype.getMonotoneChains=function(){return this._monoChains},i.prototype.getNodedSubstrings=function(){return dr.getNodedSubstrings(this._nodedSegStrings)},i.prototype.getIndex=function(){return this._index},i.prototype.add=function(l){for(var h=lo.getChains(l.getCoordinates(),l).iterator();h.hasNext();){var v=h.next();v.setId(this._idCounter++),this._index.insert(v.getEnvelope(),v),this._monoChains.add(v)}},i.prototype.computeNodes=function(l){this._nodedSegStrings=l;for(var h=l.iterator();h.hasNext();)this.add(h.next());this.intersectChains()},i.prototype.intersectChains=function(){for(var l=new xr(this._segInt),h=this._monoChains.iterator();h.hasNext();)for(var v=h.next(),S=this._index.query(v.getEnvelope()).iterator();S.hasNext();){var R=S.next();if(R.getId()>v.getId()&&(v.computeOverlaps(R,l),this._nOverlaps++),this._segInt.isDone())return null}},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},s.SegmentOverlapAction.get=function(){return xr},Object.defineProperties(i,s),i}(Js),xr=function(n){function i(){n.call(this),this._si=null;var s=arguments[0];this._si=s}return n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i,i.prototype.overlap=function(){if(arguments.length!==4)return n.prototype.overlap.apply(this,arguments);var s=arguments[0],l=arguments[1],h=arguments[2],v=arguments[3],S=s.getContext(),R=h.getContext();this._si.processIntersections(S,l,R,v)},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},i}(wi),Fe=function n(){if(this._quadrantSegments=n.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=n.CAP_ROUND,this._joinStyle=n.JOIN_ROUND,this._mitreLimit=n.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=n.DEFAULT_SIMPLIFY_FACTOR,arguments.length!==0){if(arguments.length===1){var i=arguments[0];this.setQuadrantSegments(i)}else if(arguments.length===2){var s=arguments[0],l=arguments[1];this.setQuadrantSegments(s),this.setEndCapStyle(l)}else if(arguments.length===4){var h=arguments[0],v=arguments[1],S=arguments[2],R=arguments[3];this.setQuadrantSegments(h),this.setEndCapStyle(v),this.setJoinStyle(S),this.setMitreLimit(R)}}},Po={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};Fe.prototype.getEndCapStyle=function(){return this._endCapStyle},Fe.prototype.isSingleSided=function(){return this._isSingleSided},Fe.prototype.setQuadrantSegments=function(n){this._quadrantSegments=n,this._quadrantSegments===0&&(this._joinStyle=Fe.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=Fe.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),n<=0&&(this._quadrantSegments=1),this._joinStyle!==Fe.JOIN_ROUND&&(this._quadrantSegments=Fe.DEFAULT_QUADRANT_SEGMENTS)},Fe.prototype.getJoinStyle=function(){return this._joinStyle},Fe.prototype.setJoinStyle=function(n){this._joinStyle=n},Fe.prototype.setSimplifyFactor=function(n){this._simplifyFactor=n<0?0:n},Fe.prototype.getSimplifyFactor=function(){return this._simplifyFactor},Fe.prototype.getQuadrantSegments=function(){return this._quadrantSegments},Fe.prototype.setEndCapStyle=function(n){this._endCapStyle=n},Fe.prototype.getMitreLimit=function(){return this._mitreLimit},Fe.prototype.setMitreLimit=function(n){this._mitreLimit=n},Fe.prototype.setSingleSided=function(n){this._isSingleSided=n},Fe.prototype.interfaces_=function(){return[]},Fe.prototype.getClass=function(){return Fe},Fe.bufferDistanceError=function(n){var i=Math.PI/2/n;return 1-Math.cos(i/2)},Po.CAP_ROUND.get=function(){return 1},Po.CAP_FLAT.get=function(){return 2},Po.CAP_SQUARE.get=function(){return 3},Po.JOIN_ROUND.get=function(){return 1},Po.JOIN_MITRE.get=function(){return 2},Po.JOIN_BEVEL.get=function(){return 3},Po.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},Po.DEFAULT_MITRE_LIMIT.get=function(){return 5},Po.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01},Object.defineProperties(Fe,Po);var gr=function(n){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=rt.COUNTERCLOCKWISE,this._inputLine=n||null},wa={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};gr.prototype.isDeletable=function(n,i,s,l){var h=this._inputLine[n],v=this._inputLine[i],S=this._inputLine[s];return!!this.isConcave(h,v,S)&&!!this.isShallow(h,v,S,l)&&this.isShallowSampled(h,v,n,s,l)},gr.prototype.deleteShallowConcavities=function(){for(var n=1,i=this.findNextNonDeletedIndex(n),s=this.findNextNonDeletedIndex(i),l=!1;s<this._inputLine.length;){var h=!1;this.isDeletable(n,i,s,this._distanceTol)&&(this._isDeleted[i]=gr.DELETE,h=!0,l=!0),n=h?s:i,i=this.findNextNonDeletedIndex(n),s=this.findNextNonDeletedIndex(i)}return l},gr.prototype.isShallowConcavity=function(n,i,s,l){return rt.computeOrientation(n,i,s)!==this._angleOrientation?!1:rt.distancePointLine(i,n,s)<l},gr.prototype.isShallowSampled=function(n,i,s,l,h){var v=Math.trunc((l-s)/gr.NUM_PTS_TO_CHECK);v<=0&&(v=1);for(var S=s;S<l;S+=v)if(!this.isShallow(n,i,this._inputLine[S],h))return!1;return!0},gr.prototype.isConcave=function(n,i,s){var l=rt.computeOrientation(n,i,s)===this._angleOrientation;return l},gr.prototype.simplify=function(n){this._distanceTol=Math.abs(n),n<0&&(this._angleOrientation=rt.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var i=!1;do i=this.deleteShallowConcavities();while(i);return this.collapseLine()},gr.prototype.findNextNonDeletedIndex=function(n){for(var i=n+1;i<this._inputLine.length&&this._isDeleted[i]===gr.DELETE;)i++;return i},gr.prototype.isShallow=function(n,i,s,l){return rt.distancePointLine(i,n,s)<l},gr.prototype.collapseLine=function(){for(var n=new dt,i=0;i<this._inputLine.length;i++)this._isDeleted[i]!==gr.DELETE&&n.add(this._inputLine[i]);return n.toCoordinateArray()},gr.prototype.interfaces_=function(){return[]},gr.prototype.getClass=function(){return gr},gr.simplify=function(n,i){return new gr(n).simplify(i)},wa.INIT.get=function(){return 0},wa.DELETE.get=function(){return 1},wa.KEEP.get=function(){return 1},wa.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(gr,wa);var Gi=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new nt},Df={COORDINATE_ARRAY_TYPE:{configurable:!0}};Gi.prototype.getCoordinates=function(){return this._ptList.toArray(Gi.COORDINATE_ARRAY_TYPE)},Gi.prototype.setPrecisionModel=function(n){this._precisionModel=n},Gi.prototype.addPt=function(n){var i=new D(n);if(this._precisionModel.makePrecise(i),this.isRedundant(i))return null;this._ptList.add(i)},Gi.prototype.revere=function(){},Gi.prototype.addPts=function(n,i){if(i)for(var s=0;s<n.length;s++)this.addPt(n[s]);else for(var l=n.length-1;l>=0;l--)this.addPt(n[l])},Gi.prototype.isRedundant=function(n){if(this._ptList.size()<1)return!1;var i=this._ptList.get(this._ptList.size()-1);return n.distance(i)<this._minimimVertexDistance},Gi.prototype.toString=function(){return new Ce().createLineString(this.getCoordinates()).toString()},Gi.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var n=new D(this._ptList.get(0)),i=this._ptList.get(this._ptList.size()-1);if(n.equals(i))return null;this._ptList.add(n)},Gi.prototype.setMinimumVertexDistance=function(n){this._minimimVertexDistance=n},Gi.prototype.interfaces_=function(){return[]},Gi.prototype.getClass=function(){return Gi},Df.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(Gi,Df);var Ge=function(){},Ks={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};Ge.prototype.interfaces_=function(){return[]},Ge.prototype.getClass=function(){return Ge},Ge.toDegrees=function(n){return 180*n/Math.PI},Ge.normalize=function(n){for(;n>Math.PI;)n-=Ge.PI_TIMES_2;for(;n<=-Math.PI;)n+=Ge.PI_TIMES_2;return n},Ge.angle=function(){if(arguments.length===1){var n=arguments[0];return Math.atan2(n.y,n.x)}if(arguments.length===2){var i=arguments[0],s=arguments[1],l=s.x-i.x,h=s.y-i.y;return Math.atan2(h,l)}},Ge.isAcute=function(n,i,s){var l=n.x-i.x,h=n.y-i.y;return l*(s.x-i.x)+h*(s.y-i.y)>0},Ge.isObtuse=function(n,i,s){var l=n.x-i.x,h=n.y-i.y;return l*(s.x-i.x)+h*(s.y-i.y)<0},Ge.interiorAngle=function(n,i,s){var l=Ge.angle(i,n),h=Ge.angle(i,s);return Math.abs(h-l)},Ge.normalizePositive=function(n){if(n<0){for(;n<0;)n+=Ge.PI_TIMES_2;n>=Ge.PI_TIMES_2&&(n=0)}else{for(;n>=Ge.PI_TIMES_2;)n-=Ge.PI_TIMES_2;n<0&&(n=0)}return n},Ge.angleBetween=function(n,i,s){var l=Ge.angle(i,n),h=Ge.angle(i,s);return Ge.diff(l,h)},Ge.diff=function(n,i){var s=null;return(s=n<i?i-n:n-i)>Math.PI&&(s=2*Math.PI-s),s},Ge.toRadians=function(n){return n*Math.PI/180},Ge.getTurn=function(n,i){var s=Math.sin(i-n);return s>0?Ge.COUNTERCLOCKWISE:s<0?Ge.CLOCKWISE:Ge.NONE},Ge.angleBetweenOriented=function(n,i,s){var l=Ge.angle(i,n),h=Ge.angle(i,s)-l;return h<=-Math.PI?h+Ge.PI_TIMES_2:h>Math.PI?h-Ge.PI_TIMES_2:h},Ks.PI_TIMES_2.get=function(){return 2*Math.PI},Ks.PI_OVER_2.get=function(){return Math.PI/2},Ks.PI_OVER_4.get=function(){return Math.PI/4},Ks.COUNTERCLOCKWISE.get=function(){return rt.COUNTERCLOCKWISE},Ks.CLOCKWISE.get=function(){return rt.CLOCKWISE},Ks.NONE.get=function(){return rt.COLLINEAR},Object.defineProperties(Ge,Ks);var qn=function n(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new ne,this._seg1=new ne,this._offset0=new ne,this._offset1=new ne,this._side=0,this._hasNarrowConcaveAngle=!1;var i=arguments[0],s=arguments[1],l=arguments[2];this._precisionModel=i,this._bufParams=s,this._li=new $n,this._filletAngleQuantum=Math.PI/2/s.getQuadrantSegments(),s.getQuadrantSegments()>=8&&s.getJoinStyle()===Fe.JOIN_ROUND&&(this._closingSegLengthFactor=n.MAX_CLOSING_SEG_LEN_FACTOR),this.init(l)},ds={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};qn.prototype.addNextSegment=function(n,i){if(this._s0=this._s1,this._s1=this._s2,this._s2=n,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var s=rt.computeOrientation(this._s0,this._s1,this._s2),l=s===rt.CLOCKWISE&&this._side===Ht.LEFT||s===rt.COUNTERCLOCKWISE&&this._side===Ht.RIGHT;s===0?this.addCollinear(i):l?this.addOutsideTurn(s,i):this.addInsideTurn(s,i)},qn.prototype.addLineEndCap=function(n,i){var s=new ne(n,i),l=new ne;this.computeOffsetSegment(s,Ht.LEFT,this._distance,l);var h=new ne;this.computeOffsetSegment(s,Ht.RIGHT,this._distance,h);var v=i.x-n.x,S=i.y-n.y,R=Math.atan2(S,v);switch(this._bufParams.getEndCapStyle()){case Fe.CAP_ROUND:this._segList.addPt(l.p1),this.addFilletArc(i,R+Math.PI/2,R-Math.PI/2,rt.CLOCKWISE,this._distance),this._segList.addPt(h.p1);break;case Fe.CAP_FLAT:this._segList.addPt(l.p1),this._segList.addPt(h.p1);break;case Fe.CAP_SQUARE:var V=new D;V.x=Math.abs(this._distance)*Math.cos(R),V.y=Math.abs(this._distance)*Math.sin(R);var ot=new D(l.p1.x+V.x,l.p1.y+V.y),St=new D(h.p1.x+V.x,h.p1.y+V.y);this._segList.addPt(ot),this._segList.addPt(St)}},qn.prototype.getCoordinates=function(){return this._segList.getCoordinates()},qn.prototype.addMitreJoin=function(n,i,s,l){var h=!0,v=null;try{v=me.intersection(i.p0,i.p1,s.p0,s.p1),(l<=0?1:v.distance(n)/Math.abs(l))>this._bufParams.getMitreLimit()&&(h=!1)}catch(S){if(!(S instanceof le))throw S;v=new D(0,0),h=!1}h?this._segList.addPt(v):this.addLimitedMitreJoin(i,s,l,this._bufParams.getMitreLimit())},qn.prototype.addFilletCorner=function(n,i,s,l,h){var v=i.x-n.x,S=i.y-n.y,R=Math.atan2(S,v),V=s.x-n.x,ot=s.y-n.y,St=Math.atan2(ot,V);l===rt.CLOCKWISE?R<=St&&(R+=2*Math.PI):R>=St&&(R-=2*Math.PI),this._segList.addPt(i),this.addFilletArc(n,R,St,l,h),this._segList.addPt(s)},qn.prototype.addOutsideTurn=function(n,i){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*qn.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===Fe.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===Fe.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(i&&this._segList.addPt(this._offset0.p1),this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,n,this._distance),this._segList.addPt(this._offset1.p0))},qn.prototype.createSquare=function(n){this._segList.addPt(new D(n.x+this._distance,n.y+this._distance)),this._segList.addPt(new D(n.x+this._distance,n.y-this._distance)),this._segList.addPt(new D(n.x-this._distance,n.y-this._distance)),this._segList.addPt(new D(n.x-this._distance,n.y+this._distance)),this._segList.closeRing()},qn.prototype.addSegments=function(n,i){this._segList.addPts(n,i)},qn.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},qn.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},qn.prototype.initSideSegments=function(n,i,s){this._s1=n,this._s2=i,this._side=s,this._seg1.setCoordinates(n,i),this.computeOffsetSegment(this._seg1,s,this._distance,this._offset1)},qn.prototype.addLimitedMitreJoin=function(n,i,s,l){var h=this._seg0.p1,v=Ge.angle(h,this._seg0.p0),S=Ge.angleBetweenOriented(this._seg0.p0,h,this._seg1.p1)/2,R=Ge.normalize(v+S),V=Ge.normalize(R+Math.PI),ot=l*s,St=s-ot*Math.abs(Math.sin(S)),bt=h.x+ot*Math.cos(V),Yt=h.y+ot*Math.sin(V),Jt=new D(bt,Yt),se=new ne(h,Jt),_e=se.pointAlongOffset(1,St),Cn=se.pointAlongOffset(1,-St);this._side===Ht.LEFT?(this._segList.addPt(_e),this._segList.addPt(Cn)):(this._segList.addPt(Cn),this._segList.addPt(_e))},qn.prototype.computeOffsetSegment=function(n,i,s,l){var h=i===Ht.LEFT?1:-1,v=n.p1.x-n.p0.x,S=n.p1.y-n.p0.y,R=Math.sqrt(v*v+S*S),V=h*s*v/R,ot=h*s*S/R;l.p0.x=n.p0.x-ot,l.p0.y=n.p0.y+V,l.p1.x=n.p1.x-ot,l.p1.y=n.p1.y+V},qn.prototype.addFilletArc=function(n,i,s,l,h){var v=l===rt.CLOCKWISE?-1:1,S=Math.abs(i-s),R=Math.trunc(S/this._filletAngleQuantum+.5);if(R<1)return null;for(var V=S/R,ot=0,St=new D;ot<S;){var bt=i+v*ot;St.x=n.x+h*Math.cos(bt),St.y=n.y+h*Math.sin(bt),this._segList.addPt(St),ot+=V}},qn.prototype.addInsideTurn=function(n,i){if(this._li.computeIntersection(this._offset0.p0,this._offset0.p1,this._offset1.p0,this._offset1.p1),this._li.hasIntersection())this._segList.addPt(this._li.getIntersection(0));else if(this._hasNarrowConcaveAngle=!0,this._offset0.p1.distance(this._offset1.p0)<this._distance*qn.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var s=new D((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(s);var l=new D((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(l)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},qn.prototype.createCircle=function(n){var i=new D(n.x+this._distance,n.y);this._segList.addPt(i),this.addFilletArc(n,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},qn.prototype.addBevelJoin=function(n,i){this._segList.addPt(n.p1),this._segList.addPt(i.p0)},qn.prototype.init=function(n){this._distance=n,this._maxCurveSegmentError=n*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Gi,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(n*qn.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},qn.prototype.addCollinear=function(n){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===Fe.JOIN_BEVEL||this._bufParams.getJoinStyle()===Fe.JOIN_MITRE?(n&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,rt.CLOCKWISE,this._distance))},qn.prototype.closeRing=function(){this._segList.closeRing()},qn.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},qn.prototype.interfaces_=function(){return[]},qn.prototype.getClass=function(){return qn},ds.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001},ds.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001},ds.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},ds.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(qn,ds);var hi=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var n=arguments[0],i=arguments[1];this._precisionModel=n,this._bufParams=i};hi.prototype.getOffsetCurve=function(n,i){if(this._distance=i,i===0)return null;var s=i<0,l=Math.abs(i),h=this.getSegGen(l);n.length<=1?this.computePointCurve(n[0],h):this.computeOffsetCurve(n,s,h);var v=h.getCoordinates();return s&&at.reverse(v),v},hi.prototype.computeSingleSidedBufferCurve=function(n,i,s){var l=this.simplifyTolerance(this._distance);if(i){s.addSegments(n,!0);var h=gr.simplify(n,-l),v=h.length-1;s.initSideSegments(h[v],h[v-1],Ht.LEFT),s.addFirstSegment();for(var S=v-2;S>=0;S--)s.addNextSegment(h[S],!0)}else{s.addSegments(n,!1);var R=gr.simplify(n,l),V=R.length-1;s.initSideSegments(R[0],R[1],Ht.LEFT),s.addFirstSegment();for(var ot=2;ot<=V;ot++)s.addNextSegment(R[ot],!0)}s.addLastSegment(),s.closeRing()},hi.prototype.computeRingBufferCurve=function(n,i,s){var l=this.simplifyTolerance(this._distance);i===Ht.RIGHT&&(l=-l);var h=gr.simplify(n,l),v=h.length-1;s.initSideSegments(h[v-1],h[0],i);for(var S=1;S<=v;S++){var R=S!==1;s.addNextSegment(h[S],R)}s.closeRing()},hi.prototype.computeLineBufferCurve=function(n,i){var s=this.simplifyTolerance(this._distance),l=gr.simplify(n,s),h=l.length-1;i.initSideSegments(l[0],l[1],Ht.LEFT);for(var v=2;v<=h;v++)i.addNextSegment(l[v],!0);i.addLastSegment(),i.addLineEndCap(l[h-1],l[h]);var S=gr.simplify(n,-s),R=S.length-1;i.initSideSegments(S[R],S[R-1],Ht.LEFT);for(var V=R-2;V>=0;V--)i.addNextSegment(S[V],!0);i.addLastSegment(),i.addLineEndCap(S[1],S[0]),i.closeRing()},hi.prototype.computePointCurve=function(n,i){switch(this._bufParams.getEndCapStyle()){case Fe.CAP_ROUND:i.createCircle(n);break;case Fe.CAP_SQUARE:i.createSquare(n)}},hi.prototype.getLineCurve=function(n,i){if(this._distance=i,i<0&&!this._bufParams.isSingleSided()||i===0)return null;var s=Math.abs(i),l=this.getSegGen(s);if(n.length<=1)this.computePointCurve(n[0],l);else if(this._bufParams.isSingleSided()){var h=i<0;this.computeSingleSidedBufferCurve(n,h,l)}else this.computeLineBufferCurve(n,l);return l.getCoordinates()},hi.prototype.getBufferParameters=function(){return this._bufParams},hi.prototype.simplifyTolerance=function(n){return n*this._bufParams.getSimplifyFactor()},hi.prototype.getRingCurve=function(n,i,s){if(this._distance=s,n.length<=2)return this.getLineCurve(n,s);if(s===0)return hi.copyCoordinates(n);var l=this.getSegGen(s);return this.computeRingBufferCurve(n,i,l),l.getCoordinates()},hi.prototype.computeOffsetCurve=function(n,i,s){var l=this.simplifyTolerance(this._distance);if(i){var h=gr.simplify(n,-l),v=h.length-1;s.initSideSegments(h[v],h[v-1],Ht.LEFT),s.addFirstSegment();for(var S=v-2;S>=0;S--)s.addNextSegment(h[S],!0)}else{var R=gr.simplify(n,l),V=R.length-1;s.initSideSegments(R[0],R[1],Ht.LEFT),s.addFirstSegment();for(var ot=2;ot<=V;ot++)s.addNextSegment(R[ot],!0)}s.addLastSegment()},hi.prototype.getSegGen=function(n){return new qn(this._precisionModel,this._bufParams,n)},hi.prototype.interfaces_=function(){return[]},hi.prototype.getClass=function(){return hi},hi.copyCoordinates=function(n){for(var i=new Array(n.length).fill(null),s=0;s<i.length;s++)i[s]=new D(n[s]);return i};var Qs=function(){this._subgraphs=null,this._seg=new ne,this._cga=new rt;var n=arguments[0];this._subgraphs=n},Rc={DepthSegment:{configurable:!0}};Qs.prototype.findStabbedSegments=function(){if(arguments.length===1){for(var n=arguments[0],i=new nt,s=this._subgraphs.iterator();s.hasNext();){var l=s.next(),h=l.getEnvelope();n.y<h.getMinY()||n.y>h.getMaxY()||this.findStabbedSegments(n,l.getDirectedEdges(),i)}return i}if(arguments.length===3){if(et(arguments[2],ut)&&arguments[0]instanceof D&&arguments[1]instanceof Cc){for(var v=arguments[0],S=arguments[1],R=arguments[2],V=S.getEdge().getCoordinates(),ot=0;ot<V.length-1;ot++)if(this._seg.p0=V[ot],this._seg.p1=V[ot+1],this._seg.p0.y>this._seg.p1.y&&this._seg.reverse(),!(Math.max(this._seg.p0.x,this._seg.p1.x)<v.x)&&!(this._seg.isHorizontal()||v.y<this._seg.p0.y||v.y>this._seg.p1.y||rt.computeOrientation(this._seg.p0,this._seg.p1,v)===rt.RIGHT)){var St=S.getDepth(Ht.LEFT);this._seg.p0.equals(V[ot])||(St=S.getDepth(Ht.RIGHT));var bt=new gs(this._seg,St);R.add(bt)}}else if(et(arguments[2],ut)&&arguments[0]instanceof D&&et(arguments[1],ut))for(var Yt=arguments[0],Jt=arguments[1],se=arguments[2],_e=Jt.iterator();_e.hasNext();){var Cn=_e.next();Cn.isForward()&&this.findStabbedSegments(Yt,Cn,se)}}},Qs.prototype.getDepth=function(n){var i=this.findStabbedSegments(n);return i.size()===0?0:uo.min(i)._leftDepth},Qs.prototype.interfaces_=function(){return[]},Qs.prototype.getClass=function(){return Qs},Rc.DepthSegment.get=function(){return gs},Object.defineProperties(Qs,Rc);var gs=function(){this._upwardSeg=null,this._leftDepth=null;var n=arguments[0],i=arguments[1];this._upwardSeg=new ne(n),this._leftDepth=i};gs.prototype.compareTo=function(n){var i=n;if(this._upwardSeg.minX()>=i._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=i._upwardSeg.minX())return-1;var s=this._upwardSeg.orientationIndex(i._upwardSeg);return s!==0||(s=-1*i._upwardSeg.orientationIndex(this._upwardSeg))!=0?s:this._upwardSeg.compareTo(i._upwardSeg)},gs.prototype.compareX=function(n,i){var s=n.p0.compareTo(i.p0);return s!==0?s:n.p1.compareTo(i.p1)},gs.prototype.toString=function(){return this._upwardSeg.toString()},gs.prototype.interfaces_=function(){return[z]},gs.prototype.getClass=function(){return gs};var We=function(n,i,s){this.p0=n||null,this.p1=i||null,this.p2=s||null};We.prototype.area=function(){return We.area(this.p0,this.p1,this.p2)},We.prototype.signedArea=function(){return We.signedArea(this.p0,this.p1,this.p2)},We.prototype.interpolateZ=function(n){if(n===null)throw new N("Supplied point is null.");return We.interpolateZ(n,this.p0,this.p1,this.p2)},We.prototype.longestSideLength=function(){return We.longestSideLength(this.p0,this.p1,this.p2)},We.prototype.isAcute=function(){return We.isAcute(this.p0,this.p1,this.p2)},We.prototype.circumcentre=function(){return We.circumcentre(this.p0,this.p1,this.p2)},We.prototype.area3D=function(){return We.area3D(this.p0,this.p1,this.p2)},We.prototype.centroid=function(){return We.centroid(this.p0,this.p1,this.p2)},We.prototype.inCentre=function(){return We.inCentre(this.p0,this.p1,this.p2)},We.prototype.interfaces_=function(){return[]},We.prototype.getClass=function(){return We},We.area=function(n,i,s){return Math.abs(((s.x-n.x)*(i.y-n.y)-(i.x-n.x)*(s.y-n.y))/2)},We.signedArea=function(n,i,s){return((s.x-n.x)*(i.y-n.y)-(i.x-n.x)*(s.y-n.y))/2},We.det=function(n,i,s,l){return n*l-i*s},We.interpolateZ=function(n,i,s,l){var h=i.x,v=i.y,S=s.x-h,R=l.x-h,V=s.y-v,ot=l.y-v,St=S*ot-R*V,bt=n.x-h,Yt=n.y-v,Jt=(ot*bt-R*Yt)/St,se=(-V*bt+S*Yt)/St;return i.z+Jt*(s.z-i.z)+se*(l.z-i.z)},We.longestSideLength=function(n,i,s){var l=n.distance(i),h=i.distance(s),v=s.distance(n),S=l;return h>S&&(S=h),v>S&&(S=v),S},We.isAcute=function(n,i,s){return!!Ge.isAcute(n,i,s)&&!!Ge.isAcute(i,s,n)&&!!Ge.isAcute(s,n,i)},We.circumcentre=function(n,i,s){var l=s.x,h=s.y,v=n.x-l,S=n.y-h,R=i.x-l,V=i.y-h,ot=2*We.det(v,S,R,V),St=We.det(S,v*v+S*S,V,R*R+V*V),bt=We.det(v,v*v+S*S,R,R*R+V*V);return new D(l-St/ot,h+bt/ot)},We.perpendicularBisector=function(n,i){var s=i.x-n.x,l=i.y-n.y,h=new me(n.x+s/2,n.y+l/2,1),v=new me(n.x-l+s/2,n.y+s+l/2,1);return new me(h,v)},We.angleBisector=function(n,i,s){var l=i.distance(n),h=l/(l+i.distance(s)),v=s.x-n.x,S=s.y-n.y;return new D(n.x+h*v,n.y+h*S)},We.area3D=function(n,i,s){var l=i.x-n.x,h=i.y-n.y,v=i.z-n.z,S=s.x-n.x,R=s.y-n.y,V=s.z-n.z,ot=h*V-v*R,St=v*S-l*V,bt=l*R-h*S,Yt=ot*ot+St*St+bt*bt,Jt=Math.sqrt(Yt)/2;return Jt},We.centroid=function(n,i,s){var l=(n.x+i.x+s.x)/3,h=(n.y+i.y+s.y)/3;return new D(l,h)},We.inCentre=function(n,i,s){var l=i.distance(s),h=n.distance(s),v=n.distance(i),S=l+h+v,R=(l*n.x+h*i.x+v*s.x)/S,V=(l*n.y+h*i.y+v*s.y)/S;return new D(R,V)};var ki=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new nt;var n=arguments[0],i=arguments[1],s=arguments[2];this._inputGeom=n,this._distance=i,this._curveBuilder=s};ki.prototype.addPoint=function(n){if(this._distance<=0)return null;var i=n.getCoordinates(),s=this._curveBuilder.getLineCurve(i,this._distance);this.addCurve(s,Z.EXTERIOR,Z.INTERIOR)},ki.prototype.addPolygon=function(n){var i=this._distance,s=Ht.LEFT;this._distance<0&&(i=-this._distance,s=Ht.RIGHT);var l=n.getExteriorRing(),h=at.removeRepeatedPoints(l.getCoordinates());if(this._distance<0&&this.isErodedCompletely(l,this._distance)||this._distance<=0&&h.length<3)return null;this.addPolygonRing(h,i,s,Z.EXTERIOR,Z.INTERIOR);for(var v=0;v<n.getNumInteriorRing();v++){var S=n.getInteriorRingN(v),R=at.removeRepeatedPoints(S.getCoordinates());this._distance>0&&this.isErodedCompletely(S,-this._distance)||this.addPolygonRing(R,i,Ht.opposite(s),Z.INTERIOR,Z.EXTERIOR)}},ki.prototype.isTriangleErodedCompletely=function(n,i){var s=new We(n[0],n[1],n[2]),l=s.inCentre();return rt.distancePointLine(l,s.p0,s.p1)<Math.abs(i)},ki.prototype.addLineString=function(n){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var i=at.removeRepeatedPoints(n.getCoordinates()),s=this._curveBuilder.getLineCurve(i,this._distance);this.addCurve(s,Z.EXTERIOR,Z.INTERIOR)},ki.prototype.addCurve=function(n,i,s){if(n===null||n.length<2)return null;var l=new dr(n,new An(0,Z.BOUNDARY,i,s));this._curveList.add(l)},ki.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},ki.prototype.addPolygonRing=function(n,i,s,l,h){if(i===0&&n.length<Tn.MINIMUM_VALID_SIZE)return null;var v=l,S=h;n.length>=Tn.MINIMUM_VALID_SIZE&&rt.isCCW(n)&&(v=h,S=l,s=Ht.opposite(s));var R=this._curveBuilder.getRingCurve(n,s,i);this.addCurve(R,v,S)},ki.prototype.add=function(n){if(n.isEmpty())return null;n instanceof pe?this.addPolygon(n):n instanceof jt?this.addLineString(n):n instanceof ge?this.addPoint(n):n instanceof Oe?this.addCollection(n):n instanceof K?this.addCollection(n):n instanceof Bn?this.addCollection(n):n instanceof Zn&&this.addCollection(n)},ki.prototype.isErodedCompletely=function(n,i){var s=n.getCoordinates();if(s.length<4)return i<0;if(s.length===4)return this.isTriangleErodedCompletely(s,i);var l=n.getEnvelopeInternal(),h=Math.min(l.getHeight(),l.getWidth());return i<0&&2*Math.abs(i)>h},ki.prototype.addCollection=function(n){for(var i=0;i<n.getNumGeometries();i++){var s=n.getGeometryN(i);this.add(s)}},ki.prototype.interfaces_=function(){return[]},ki.prototype.getClass=function(){return ki};var eu=function(){};eu.prototype.locate=function(n){},eu.prototype.interfaces_=function(){return[]},eu.prototype.getClass=function(){return eu};var co=function(){this._parent=null,this._atStart=null,this._max=null,this._index=null,this._subcollectionIterator=null;var n=arguments[0];this._parent=n,this._atStart=!0,this._index=0,this._max=n.getNumGeometries()};co.prototype.next=function(){if(this._atStart)return this._atStart=!1,co.isAtomic(this._parent)&&this._index++,this._parent;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return this._subcollectionIterator.next();this._subcollectionIterator=null}if(this._index>=this._max)throw new o;var n=this._parent.getGeometryN(this._index++);return n instanceof Zn?(this._subcollectionIterator=new co(n),this._subcollectionIterator.next()):n},co.prototype.remove=function(){throw new Error(this.getClass().getName())},co.prototype.hasNext=function(){if(this._atStart)return!0;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},co.prototype.interfaces_=function(){return[k]},co.prototype.getClass=function(){return co},co.isAtomic=function(n){return!(n instanceof Zn)};var pi=function(){this._geom=null;var n=arguments[0];this._geom=n};pi.prototype.locate=function(n){return pi.locate(n,this._geom)},pi.prototype.interfaces_=function(){return[eu]},pi.prototype.getClass=function(){return pi},pi.isPointInRing=function(n,i){return!!i.getEnvelopeInternal().intersects(n)&&rt.isPointInRing(n,i.getCoordinates())},pi.containsPointInPolygon=function(n,i){if(i.isEmpty())return!1;var s=i.getExteriorRing();if(!pi.isPointInRing(n,s))return!1;for(var l=0;l<i.getNumInteriorRing();l++){var h=i.getInteriorRingN(l);if(pi.isPointInRing(n,h))return!1}return!0},pi.containsPoint=function(n,i){if(i instanceof pe)return pi.containsPointInPolygon(n,i);if(i instanceof Zn)for(var s=new co(i);s.hasNext();){var l=s.next();if(l!==i&&pi.containsPoint(n,l))return!0}return!1},pi.locate=function(n,i){return i.isEmpty()?Z.EXTERIOR:pi.containsPoint(n,i)?Z.INTERIOR:Z.EXTERIOR};var jr=function(){this._edgeMap=new w,this._edgeList=null,this._ptInAreaLocation=[Z.NONE,Z.NONE]};jr.prototype.getNextCW=function(n){this.getEdges();var i=this._edgeList.indexOf(n),s=i-1;return i===0&&(s=this._edgeList.size()-1),this._edgeList.get(s)},jr.prototype.propagateSideLabels=function(n){for(var i=Z.NONE,s=this.iterator();s.hasNext();){var l=s.next().getLabel();l.isArea(n)&&l.getLocation(n,Ht.LEFT)!==Z.NONE&&(i=l.getLocation(n,Ht.LEFT))}if(i===Z.NONE)return null;for(var h=i,v=this.iterator();v.hasNext();){var S=v.next(),R=S.getLabel();if(R.getLocation(n,Ht.ON)===Z.NONE&&R.setLocation(n,Ht.ON,h),R.isArea(n)){var V=R.getLocation(n,Ht.LEFT),ot=R.getLocation(n,Ht.RIGHT);if(ot!==Z.NONE){if(ot!==h)throw new Zo("side location conflict",S.getCoordinate());V===Z.NONE&&kt.shouldNeverReachHere("found single null side (at "+S.getCoordinate()+")"),h=V}else kt.isTrue(R.getLocation(n,Ht.LEFT)===Z.NONE,"found single null side"),R.setLocation(n,Ht.RIGHT,h),R.setLocation(n,Ht.LEFT,h)}}},jr.prototype.getCoordinate=function(){var n=this.iterator();return n.hasNext()?n.next().getCoordinate():null},jr.prototype.print=function(n){Qt.out.println("EdgeEndStar: "+this.getCoordinate());for(var i=this.iterator();i.hasNext();)i.next().print(n)},jr.prototype.isAreaLabelsConsistent=function(n){return this.computeEdgeEndLabels(n.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},jr.prototype.checkAreaLabelsConsistent=function(n){var i=this.getEdges();if(i.size()<=0)return!0;var s=i.size()-1,l=i.get(s).getLabel().getLocation(n,Ht.LEFT);kt.isTrue(l!==Z.NONE,"Found unlabelled area edge");for(var h=l,v=this.iterator();v.hasNext();){var S=v.next().getLabel();kt.isTrue(S.isArea(n),"Found non-area edge");var R=S.getLocation(n,Ht.LEFT),V=S.getLocation(n,Ht.RIGHT);if(R===V||V!==h)return!1;h=R}return!0},jr.prototype.findIndex=function(n){this.iterator();for(var i=0;i<this._edgeList.size();i++)if(this._edgeList.get(i)===n)return i;return-1},jr.prototype.iterator=function(){return this.getEdges().iterator()},jr.prototype.getEdges=function(){return this._edgeList===null&&(this._edgeList=new nt(this._edgeMap.values())),this._edgeList},jr.prototype.getLocation=function(n,i,s){return this._ptInAreaLocation[n]===Z.NONE&&(this._ptInAreaLocation[n]=pi.locate(i,s[n].getGeometry())),this._ptInAreaLocation[n]},jr.prototype.toString=function(){var n=new Pt;n.append("EdgeEndStar: "+this.getCoordinate()),n.append(\`
|
|
108
108
|
\`);for(var i=this.iterator();i.hasNext();){var s=i.next();n.append(s),n.append(\`
|