PageSourceSearch

https://pprn971guadeloupe.fr/assets/js/BufferOp.bundle.js

js pprn971guadeloupe.fr collected 2026-10-08 06:10:59 UTC 61,760 bytes, 2 lines download raw bytes

1"use strict";(self.rspackChunklizmap_web_client=self.rspackChunklizmap_web_client||[]).push([[253],{2394(t,e,s){s.d(e,{A:()=>a});var i=s(4810),n=s(2922);class r{constructor(){r.constructor_.apply(this,arguments)}static constructor_(){this._pts=null,this._orientation=null;let t=arguments[0];this._pts=t,this._orientation=r.orientation(t)}static orientation(t){return 1===n.A.increasingDirection(t)}static compareOriented(t,e,s,i){let n=e?1:-1,r=i?1:-1,o=e?t.length:-1,l=i?s.length:-1,a=e?0:t.length-1,h=i?0:s.length-1;for(;;){let e=t[a].compareTo(s[h]);if(0!==e)return e;let i=(a+=n)===o,d=(h+=r)===l;if(i&&!d)return -1;if(!i&&d)return 1;if(i&&d)return 0}}compareTo(t){return r.compareOriented(this._pts,this._orientation,t._pts,t._orientation)}get interfaces_(){return[i.A]}}var o=s(5029),l=s(2995);class a{constructor(){a.constructor_.apply(this,arguments)}static constructor_(){this._edges=new o.A,this._ocaMap=new l.A}print(t){t.print("MULTILINESTRING ( ");for(let e=0;e<this._edges.size();e++){let s=this._edges.get(e);e>0&&t.print(","),t.print("(");let i=s.getCoordinates();for(let e=0;e<i.length;e++)e>0&&t.print(","),t.print(i[e].x+" "+i[e].y);t.println(")")}t.print(")  ")}addAll(t){for(let e=t.iterator();e.hasNext();)this.add(e.next())}findEdgeIndex(t){for(let e=0;e<this._edges.size();e++)if(this._edges.get(e).equals(t))return e;return -1}iterator(){return this._edges.iterator()}getEdges(){return this._edges}get(t){return this._edges.get(t)}findEqualEdge(t){let e=new r(t.getCoordinates());return this._ocaMap.get(e)}add(t){this._edges.add(t);let e=new r(t.getCoordinates());this._ocaMap.put(e,t)}}},9778(t,e,s){var i=s(9318);class n{constructor(){n.constructor_.apply(this,arguments)}static constructor_(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;let t=arguments[0],e=arguments[1],s=arguments[2],i=arguments[3];this._pts=t,this._start=e,this._end=s,this._context=i}computeOverlaps(){if(2==arguments.length){let t=arguments[0],e=arguments[1];this.computeOverlaps(this._start,this._end,t,t._start,t._end,e)}else if(6==arguments.length){let t=arguments[0],e=arguments[1],s=arguments[2],i=arguments[3],n=arguments[4],r=arguments[5];if(e-t==1&&n-i==1)return r.overlap(this,t,s,i),null;if(!this.overlaps(t,e,s,i,n))return null;let o=Math.trunc((t+e)/2),l=Math.trunc((i+n)/2);t<o&&(i<l&&this.computeOverlaps(t,o,s,i,l,r),l<n&&this.computeOverlaps(t,o,s,l,n,r)),o<e&&(i<l&&this.computeOverlaps(o,e,s,i,l,r),l<n&&this.computeOverlaps(o,e,s,l,n,r))}}setId(t){this._id=t}select(t,e){this.computeSelect(t,this._start,this._end,e)}getEnvelope(){if(null===this._env){let t=this._pts[this._start],e=this._pts[this._end];this._env=new i.A(t,e)}return this._env}overlaps(t,e,s,n,r){return i.A.intersects(this._pts[t],this._pts[e],s._pts[n],s._pts[r])}getEndIndex(){return this._end}getStartIndex(){return this._start}getContext(){return this._context}getId(){return this._id}getLineSegment(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]}computeSelect(t,e,s,i){let n=this._pts[e],r=this._pts[s];if(s-e==1)return i.select(this,e),null;if(!t.intersects(n,r))return null;let o=Math.trunc((e+s)/2);e<o&&this.computeSelect(t,e,o,i),o<s&&this.computeSelect(t,o,s,i)}getCoordinates(){let t=Array(this._end-this._start+1).fill(null),e=0;for(let s=this._start;s<=this._end;s++)t[e++]=this._pts[s];return t}}s.d(e,{A:()=>n})},4850(t,e,s){s.d(e,{A:()=>g});var i=s(2506),n=s(4973),r=s(591);class o{constructor(){o.constructor_.apply(this,arguments)}static constructor_(){this._overlapSeg1=new r.A,this._overlapSeg2=new r.A}overlap(){if(2==arguments.length)arguments[0],arguments[1];else if(4==arguments.length){let t=arguments[0],e=arguments[1],s=arguments[2],i=arguments[3];t.getLineSegment(e,this._overlapSeg1),s.getLineSegment(i,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}}var l=s(9778),a=s(5029),h=s(3706);class d{static findChainEnd(t,e){let s=e;for(;s<t.length-1&&t[s].equals2D(t[s+1]);)s++;if(s>=t.length-1)return t.length-1;let i=h.A.quadrant(t[s],t[s+1]),n=e+1;for(;n<t.length&&(t[n-1].equals2D(t[n])||h.A.quadrant(t[n-1],t[n])===i);)n++;return n-1}static getChains(){if(1==arguments.length){let t=arguments[0];return d.getChains(t,null)}if(2==arguments.length){let t=arguments[0],e=arguments[1],s=new a.A,i=0;
1do{let n=d.findChainEnd(t,i),r=new l.A(t,i,n,e);s.add(r),i=n}while(i<t.length-1);return s}}}var c=s(3863);class _{constructor(){_.constructor_.apply(this,arguments)}static constructor_(){if(this._segInt=null,0==arguments.length);else if(1==arguments.length){let t=arguments[0];this.setSegmentIntersector(t)}}setSegmentIntersector(t){this._segInt=t}get interfaces_(){return[c.A]}}class g extends _{constructor(){super(),g.constructor_.apply(this,arguments)}static constructor_(){if(this._monoChains=new a.A,this._index=new i.A,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0,0==arguments.length);else if(1==arguments.length){let t=arguments[0];_.constructor_.call(this,t)}}getMonotoneChains(){return this._monoChains}getNodedSubstrings(){return n.A.getNodedSubstrings(this._nodedSegStrings)}getIndex(){return this._index}add(t){let e=d.getChains(t.getCoordinates(),t);for(let t=e.iterator();t.hasNext();){let e=t.next();e.setId(this._idCounter++),this._index.insert(e.getEnvelope(),e),this._monoChains.add(e)}}computeNodes(t){this._nodedSegStrings=t;for(let e=t.iterator();e.hasNext();)this.add(e.next());this.intersectChains()}intersectChains(){let t=new u(this._segInt);for(let e=this._monoChains.iterator();e.hasNext();){let s=e.next(),i=this._index.query(s.getEnvelope());for(let e=i.iterator();e.hasNext();){let i=e.next();if(i.getId()>s.getId()&&(s.computeOverlaps(i,t),this._nOverlaps++),this._segInt.isDone())return null}}}}class u extends o{constructor(){super(),u.constructor_.apply(this,arguments)}static constructor_(){this._si=null;let t=arguments[0];this._si=t}overlap(){if(4!=arguments.length)return super.overlap.apply(this,arguments);{let t=arguments[0],e=arguments[1],s=arguments[2],i=arguments[3],n=t.getContext(),r=s.getContext();this._si.processIntersections(n,e,r,i)}}}g.SegmentOverlapAction=u},4973(t,e,s){s.d(e,{A:()=>S});var i=s(8464),n=s(3190),r=s(6861);class o{static relativeSign(t,e){return t<e?-1:+(t>e)}static compareValue(t,e){return t<0?-1:t>0?1:e<0?-1:+(e>0)}static compare(t,e,s){if(e.equals2D(s))return 0;let i=o.relativeSign(e.x,s.x),n=o.relativeSign(e.y,s.y);switch(t){case 0:return o.compareValue(i,n);case 1:return o.compareValue(n,i);case 2:return o.compareValue(n,-i);case 3:return o.compareValue(-i,n);case 4:return o.compareValue(-i,-n);case 5:return o.compareValue(-n,-i);case 6:return o.compareValue(-n,i);case 7:return o.compareValue(i,-n)}return r.A.shouldNeverReachHere("invalid octant value"),0}}var l=s(4810);class a{constructor(){a.constructor_.apply(this,arguments)}static constructor_(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;let t=arguments[0],e=arguments[1],s=arguments[2],i=arguments[3];this._segString=t,this.coord=new n.A(e),this.segmentIndex=s,this._segmentOctant=i,this._isInterior=!e.equals2D(t.getCoordinate(s))}getCoordinate(){return this.coord}print(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)}compareTo(t){return this.segmentIndex<t.segmentIndex?-1:this.segmentIndex>t.segmentIndex?1:this.coord.equals2D(t.coord)?0:this._isInterior?t._isInterior?o.compare(this._segmentOctant,this.coord,t.coord):1:-1}isEndPoint(t){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===t}toString(){return this.segmentIndex+":"+this.coord.toString()}isInterior(){return this._isInterior}get interfaces_(){return[l.A]}}var h=s(4510);s(8277);var d=s(5029),c=s(2995),_=s(7811);class g{constructor(){g.constructor_.apply(this,arguments)}static constructor_(){this._nodeMap=new c.A,this._edge=null;let t=arguments[0];this._edge=t}getSplitCoordinates(){let t=new i.A;this.addEndpoints();let e=this.iterator(),s=e.next();for(;e.hasNext();){let i=e.next();this.addEdgeCoordinates(s,i,t),s=i}return t.toCoordinateArray()}print(t){t.println("Intersections:");for(let e=this.iterator();e.hasNext();)e.next().print(t)}findCollapsesFromExistingVertices(t){for(let e=0;e<this._edge.size()-2;e++){let s=this._edge.getCoordinate(e);this._edge.getCoordinate(e+1);let i=this._edge.getCoordinate(e+2);s.equals2D(i)&&t.add(h.A.valueOf(e+1))}}addEdgeCoordinates(t,e,s){let i=this.createSplitEdgePts(t,e);s.add(i,!1)}findCollapseIndex(t,e,s){if(!t.coord.equals2D(e.coord))return!1;let i=e.segmentIndex-t.segmentIndex;return!e.isInterior()&&i--,1===i&&(s[0]=t.segmentIndex+1,!0)}findCollapsesFromInsertedNodes(t){let e=[,].fill(null),s=this.iterator(),i=s.next();for(;s.hasNext();){let n=s.next();this.findCollapseIndex(i,n,e)&&t.add(h.A.valueOf(e[0])),i=n}}getEdge(){return this._edge}addEndpoints(){let t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)}createSplitEdge(t,e){return new S(this.createSplitEdgePts(t,e),this._edge.getData())}add(t,e){let s=new a(this._edge,t,e,this._edge.getSegmentOctant(e)),i=this._nodeMap.get(s);return null!==i?(r.A.isTrue(i.coord.equals2D(t),"Found equal nodes with different c
1oordinates"),i):(this._nodeMap.put(s,s),s)}checkSplitEdgesCorrectness(t){let e=this._edge.getCoordinates(),s=t.get(0).getCoordinate(0);if(!s.equals2D(e[0]))throw new _.A("bad split edge start point at "+s);let i=t.get(t.size()-1).getCoordinates(),n=i[i.length-1];if(!n.equals2D(e[e.length-1]))throw new _.A("bad split edge end point at "+n)}addCollapsedNodes(){let t=new d.A;this.findCollapsesFromInsertedNodes(t),this.findCollapsesFromExistingVertices(t);for(let e=t.iterator();e.hasNext();){let t=e.next().intValue();this.add(this._edge.getCoordinate(t),t)}}createSplitEdgePts(t,e){let s=e.segmentIndex-t.segmentIndex+2;if(2===s)return[new n.A(t.coord),new n.A(e.coord)];let i=this._edge.getCoordinate(e.segmentIndex),r=e.isInterior()||!e.coord.equals2D(i);!r&&s--;let o=Array(s).fill(null),l=0;o[l++]=new n.A(t.coord);for(let s=t.segmentIndex+1;s<=e.segmentIndex;s++)o[l++]=this._edge.getCoordinate(s);return r&&(o[l]=new n.A(e.coord)),o}iterator(){return this._nodeMap.values().iterator()}addSplitEdges(t){this.addEndpoints(),this.addCollapsedNodes();let e=this.iterator(),s=e.next();for(;e.hasNext();){let i=e.next(),n=this.createSplitEdge(s,i);t.add(n),s=i}}}var u=s(1619),p=s(8641),f=s(9704),m=s(2315);class A{addIntersection(t,e){}get interfaces_(){return[m.A]}}class S{constructor(){S.constructor_.apply(this,arguments)}static constructor_(){this._nodeList=new g(this),this._pts=null,this._data=null;let t=arguments[0],e=arguments[1];this._pts=t,this._data=e}static getNodedSubstrings(){if(1==arguments.length){let t=arguments[0],e=new d.A;return S.getNodedSubstrings(t,e),e}if(2==arguments.length){let t=arguments[0],e=arguments[1];for(let s=t.iterator();s.hasNext();)s.next().getNodeList().addSplitEdges(e)}}getCoordinates(){return this._pts}size(){return this._pts.length}getCoordinate(t){return this._pts[t]}isClosed(){return this._pts[0].equals(this._pts[this._pts.length-1])}getSegmentOctant(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))}toString(){return u.A.toLineString(new p.A(this._pts))}getNodeList(){return this._nodeList}addIntersectionNode(t,e){let s=e,i=s+1;if(i<this._pts.length){let e=this._pts[i];t.equals2D(e)&&(s=i)}return this._nodeList.add(t,s)}addIntersections(t,e,s){for(let i=0;i<t.getIntersectionNum();i++)this.addIntersection(t,e,s,i)}setData(t){this._data=t}safeOctant(t,e){return t.equals2D(e)?0:f.A.octant(t,e)}getData(){return this._data}addIntersection(){if(2==arguments.length){let t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(4==arguments.length){let t=arguments[0],e=arguments[1],s=(arguments[2],arguments[3]),i=new n.A(t.getIntersection(s));this.addIntersection(i,e)}}get interfaces_(){return[A]}}},3863(t,e,s){class i{getNodedSubstrings(){}computeNodes(t){}}s.d(e,{A:()=>i})},9704(t,e,s){var i=s(3190),n=s(5696);class r{static octant(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){let t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new n.A("Cannot compute the octant for point ( "+t+", "+e+" )");let s=Math.abs(t),i=Math.abs(e);if(t>=0)if(e>=0)if(s>=i)return 0;else return 1;else if(s>=i)return 7;else return 6;if(e>=0)if(s>=i)return 3;else return 2;if(s>=i)return 4;else return 5}if(arguments[0]instanceof i.A&&arguments[1]instanceof i.A){let t=arguments[0],e=arguments[1],s=e.x-t.x,i=e.y-t.y;if(0===s&&0===i)throw new n.A("Cannot compute the octant for two identical points "+t);return r.octant(s,i)}}}s.d(e,{A:()=>r})},4052(t,e,s){class i{isDone(){}processIntersections(t,e,s,i){}}s.d(e,{A:()=>i})},2315(t,e,s){class i{getCoordinates(){}size(){}getCoordinate(t){}isClosed(){}setData(t){}getData(){}}s.d(e,{A:()=>i})},9569(t,e,s){s.r(e),s.d(e,{default:()=>tN});class i{constructor(){i.constructor_.apply(this,arguments)}static constructor_(){if(this._quadrantSegments=i.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=i.CAP_ROUND,this._joinStyle=i.JOIN_ROUND,this._mitreLimit=i.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=i.DEFAULT_SIMPLIFY_FACTOR,0==arguments.length);else if(1==arguments.length){let t=arguments[0];this.setQuadrantSegments(t)}else if(2==arguments.length){let t=arguments[0],e=arguments[1];this.setQuadrantSegments(t),this.setEndCapStyle(e)}else if(4==arguments.length){let t=arguments[0],e=arguments[1],s=arguments[2],i=arguments[3];this.setQuadrantSegments(t),this.setEndCapStyle(e),this.setJoinStyle(s),this.setMitreLimit(i)}}static bufferDistanceError(t){return 1-Math.cos(Math.PI/2/t/2)}getEndCapStyle(){return this._endCapStyle}isSingleSided(){return this._isSingleSided}setQuadrantSegments(t){this._quadrantSegments=t,0===this._quadrantSegments&&(this._joinStyle=i.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=i.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==i.JOIN_ROUND&&(this._quadrantSegments=i.DEFAULT_QUADRANT_SEGMENTS)}getJoinStyle(){return this._joinStyle}setJoinStyle(t){this._joinStyle=t}setSimplifyFactor(t){this._simplifyFactor=t<0?0:t}getSimplifyFactor(){return this._simplifyFactor}getQuadrantSegments(){return this._quadrantSegments}setEndCapStyle(t){this._endCapStyle=t}getMitreLimit(){return this._mitreLimit}setMitreLimit(t){this._mitreLimit=t}setSingleSided(t){this._isSingleSided=t}}i.CAP_ROUND=1,i.CAP_FLAT=2,i.CAP_SQUARE=3,i.JOIN_ROUND=1,i.JOIN_MITRE=2,i.JOIN_BEVEL=3,i.DEFAULT_QUADRANT_SEGMENTS=8,i.DEFAULT_MITRE_LIMIT=5,i.DEFAULT_SIMPLIFY_FACTOR=.01;var n=s(2579),r=s(3190),o=s(4973),l=s(1715),a=s(2922),h=s(5029),d=s(6378),c=s(3863);class _{constructor(){_.constructor_.apply(this,arguments)}static constructor_(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,2==arguments.length){let t=arguments[0],e=arguments[1];_.constructor_.call(this,t,e,0,0)}else if(4==arguments.length){let t=arguments[0],e=arguments[1];arguments[2],arguments[3],this._noder=t,this._scaleFactor=e,this._isScaled=!this.isIntegerPrecision()}}rescale(){if((0,n.A)(arguments[0],d.A)){let t=arguments[0];for(let e=t.iterator();e.hasNext();){let t=e.next();this.rescale(t.getCoordinates())}}else if(arguments[0]instanceof Array){let t=arguments[0];for(let e=0;e<t.length;e++)t[e].x=t[e].x/this._scaleFactor+this._offsetX,t[e].y=t[e].y/this._scaleFactor+this._offsetY;2===t.length&&t[0].equals2D(t[1])&&l.A.out.println(t)}}scale(){if((0,n.A)(arguments[0],d.A)){let t=arguments[0],e=new h.A(t.size());for(let s=t.iterator();s.hasNext();){let t=s.next();e.add(new o.A(this.scale(t.getCoordinates()),t.getData()))}return e}if(arguments[0]instanceof Array){let t=arguments[0],e=Array(t.length).fill(null);for(let s=0;s<t.length;s++)e[s]=new r.A(Math.round((t[s].x-this._offsetX)*this._scaleFactor),Math.round((t[s].y-this._offsetY)*this._scaleFactor),t[s].getZ());return a.A.removeRepeatedPoints(e)}}isIntegerPrecision(){return 1===this._scaleFactor}getNodedSubstrings(){let t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t}computeNodes(t){let e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)}get interfaces_(){return[c.A]}}var g=s(9374),u=s(6138),p=s(4179),f=s(7811),m=s(8523),A=s(3834);class S{constructor(){S.constructor_.apply(this,arguments)}static constructor_(){this._li=new A.A,this._segStrings=null;let t=arguments[0];this._segStrings=t}checkEndPtVertexIntersections(){if(0==arguments.length)for(let t=this._segStrings.iterator();t.hasNext();){let e=t.next().getCoordinates();this.checkEndPtVertexIntersections(e[0],this._segStrings),this.checkEndPtVertexIntersections(e[e.length-1],this._segStrings)}else if(2==arguments.length){let t=arguments[0],e=arguments[1];for(let s=e.iterator();s.hasNext();){let e=s.next().getCoordinates();for(let s=1;s<e.length-1;s++)if(e[s].equals(t))throw new f.A("found endpt/interior pt intersection at index "+s+" :pt "+t)}}}checkInteriorIntersections(){if(0==arguments.length)for(let t=this._segStrings.iterator();t.hasNext();){let e=t.next();for(let t=this._segStrings.iterator();t.hasNext();){let s=t.next();this.checkInteriorIntersections(e,s)}}else if(2==arguments.length){let t=arguments[0],e=arguments[1],s=t.getCoordinates(),i=e.getCoordinates();for(let n=0;n<s.length-1;n++)for(let s=0;s<i.length-1;s++)this.checkInteriorIntersections(t,n,e,s)}else if(4==arguments.length){let t=arguments[0],e=arguments[1],s=arguments[2],i=arguments[3];if(t===s&&e===i)return null;let n=t.getCoordinates()[e],r=t.getCoordinates()[e+1],o=s.getCoordinates()[i],l=s.getCoordinates()[i+1];if(this._li.computeIntersection(n,r,o,l),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,n,r)||this.hasInteriorIntersection(this._li,o,l)))throw new f.A("found non-noded intersection at "+n+"-"+r+" and "+o+"-"+l)}}checkValid(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()}checkCollapses(){if(0==arguments.length)for(let t=this._segStrings.iterator();t.hasNext();){let e=t.next();this.checkCollapses(e)}else if(1==arguments.length){let t=arguments[0],e=t.getCoordinates();for(let t=0;t<e.length-2;t++)this.checkCollapse(e[t],e[t+1],e[t+2])}}hasInteriorIntersection(t,e,s){for(let i=0;i<t.getIntersectionNum();i++){let n=t.getIntersection(i);if(!(n.equals(e)||n.equals(s)))return!0}return!1}checkCollapse(t,e,s){if(t.equals(s))throw new f.A("found non-noded collapse at "+S.fact.createLineString([t,e,s]))}}S.fact=new m.A;var x=s(4850),I=s(5696),y=s(9318),C=s(6861);class E{constructor(){E.constructor_.apply(this,arguments)}static constructor_(){this._li=null,this._pt=null,this._originalPt=null,this._ptScaled=null,this._p0Scaled=null,this._p1Scaled=null,this._scaleFactor=null,this._minx=null,this._max
1x=null,this._miny=null,this._maxy=null,this._corner=[,,,,].fill(null),this._safeEnv=null;let t=arguments[0],e=arguments[1],s=arguments[2];if(this._originalPt=t,this._pt=t,this._scaleFactor=e,this._li=s,e<=0)throw new I.A("Scale factor must be non-zero");1!==e&&(this._pt=new r.A(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new r.A,this._p1Scaled=new r.A),this.initCorners(this._pt)}intersectsScaled(t,e){let s=Math.min(t.x,e.x),i=Math.max(t.x,e.x),n=Math.min(t.y,e.y),r=Math.max(t.y,e.y),o=this._maxx<s||this._minx>i||this._maxy<n||this._miny>r;if(o)return!1;let l=this.intersectsToleranceSquare(t,e);return C.A.isTrue(!(o&&l),"Found bad envelope test"),l}copyScaled(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)}getSafeEnvelope(){if(null===this._safeEnv){let t=E.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new y.A(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv}intersectsPixelClosure(t,e){return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),!!this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),!!this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),!!this._li.hasIntersection())))}intersectsToleranceSquare(t,e){let s=!1,i=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!this._li.isProper()||
1(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),!!this._li.isProper()||(this._li.hasIntersection()&&(s=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),!!this._li.isProper()||(this._li.hasIntersection()&&(i=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),!!(this._li.isProper()||s&&i||t.equals(this._pt)||e.equals(this._pt)))))}addSnappedNode(t,e){let s=t.getCoordinate(e),i=t.getCoordinate(e+1);return!!this.intersects(s,i)&&(t.addIntersection(this.getCoordinate(),e),!0)}initCorners(t){this._minx=t.x-.5,this._maxx=t.x+.5,this._miny=t.y-.5,this._maxy=t.y+.5,this._corner[0]=new r.A(this._maxx,this._maxy),this._corner[1]=new r.A(this._minx,this._maxy),this._corner[2]=new r.A(this._minx,this._miny),this._corner[3]=new r.A(this._maxx,this._miny)}intersects(t,e){return 1===this._scaleFactor?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))}scale(t){return Math.round(t*this._scaleFactor)}getCoordinate(){return this._originalPt}}E.SAFE_ENV_EXPANSION_FACTOR=.75;var w=s(2713),L=s(591);class N{constructor(){N.constructor_.apply(this,arguments)}static constructor_(){this.selectedSegment=new L.A}select(){if(1==arguments.length)arguments[0];else if(2==arguments.length){let t=arguments[0],e=arguments[1];t.getLineSegment(e,this.selectedSegment),this.select(this.selectedSegment)}}}var P=s(9778),R=s(9783);class T{constructor(){T.constructor_.apply(this,arguments)}static constructor_(){this._index=null;let t=arguments[0];this._index=t}snap(){if(1==arguments.length){let t=arguments[0];return this.snap(t,null,-1)}if(3==arguments.length){let t=arguments[0],e=arguments[1],s=arguments[2],i=t.getSafeEnvelope(),n=new M(t,e,s);return this._index.query(i,new class{get interfaces_(){return[R.A]}visitItem(t){t.select(i,n)}}),n.isNodeAdded()}}}class M extends N{constructor(){super(),M.constructor_.apply(this,arguments)}static constructor_(){this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;let t=arguments[0],e=arguments[1],s=arguments[2];this._hotPixel=t,this._parentEdge=e,this._hotPixelVertexIndex=s}select(){if(!(2==arguments.length&&Number.isInteger(arguments[1]))||!(arguments[0]instanceof P.A))return super.select.apply(this,arguments);{let t=arguments[0],e=arguments[1],s=t.getContext();if(this._parentEdge===s&&(e===this._hotPixelVertexIndex||e+1===this._hotPixelVertexIndex))return null;this._isNodeAdded|=this._hotPixel.addSnappedNode(s,e)}}isNodeAdded(){return this._isNodeAdded}}T.HotPixelSnapAction=M;var v=s(4052);class O{constructor(){O.constructor_.apply(this,arguments)}static constructor_(){this._li=null,this._interiorIntersections=null;let t=arguments[0];this._li=t,this._interiorIntersections=new h.A}isDone(){return!1}processIntersections(t,e,s,i){if(t===s&&e===i)return null;let n=t.getCoordinates()[e],r=t.getCoordinates()[e+1],o=s.getCoordinates()[i],l=s.getCoordinates()[i+1];if(this._li.computeIntersection(n,r,o,l),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(let t=0;t<this._li.getIntersectionNum();t++)this._interiorIntersections.add(this._li.getIntersection(t));t.addIntersections(this._li,e,0),s.addIntersections(this._li,i,1)}}getInteriorIntersections(){return this._interiorIntersections}get interfaces_(){return[v.A]}}class D{constructor(){D.constructor_.apply(this,arguments)}static constructor_(){this._pm=null,this._li=null,this._scaleFactor=null,this._noder=null,this._pointSnapper=null,this._nodedSegStrings=null;let t=arguments[0];this._pm=t,this._li=new A.A,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()}checkCorrectness(t){let e=new S(o.A.getNodedSubstrings(t));try{e.checkValid()}catch(t){if(t instanceof w.A)t.printStackTrace();else throw t}finally{}}getNodedSubstrings(){return o.A.getNodedSubstrings(this._nodedSegStrings)}snapRound(t,e){let s=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(s),this.computeVertexSnaps(t)}findInteriorIntersections(t,e){let s=new O(e);return this._noder.setSegmentIntersector(s),this._noder.computeNodes(t),s.getInteriorIntersections()}computeVertexSnaps(){if((0,n.A)(arguments[0],d.A)){let t=arguments[0];for(let e=t.iterator();e.hasNext();){let t=e.next();this.computeVertexSnaps(t)}}else if(arguments[0]instanceof o.A){let t=arguments[0],e=t.getCoordinates();for(let s=0;s<e.length;s++){let i=new E(e[s],this._scaleFactor,this._li);this._pointSnapper.snap(i,t,s)&&t.addIntersection(e[s],s)}}}computeNodes(t){this._nodedSegStrings=t,this._noder=new x.A,this._pointSnapper=new T(this._noder.getIndex()),this.snapRound(t,this._li)}computeIntersectionSnaps(t){for(let e=t.iterator();e.hasNext();){let t=new E(e.next(),this._scaleFactor,this._li);this._pointSnapper.snap(t)}}get interfaces_(){return[c.A]}}var b=s(9602),F=s(2881),V=s(8324),G=s(3937),q=s(736),U=s(3031);class k{constructor(){k.constructor_.apply(this,arguments)}static constructor_(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null}getCoordinate(){return this._minCoord}getRightmostSide(t,e){let s=this.getRightmostSideOfSegment(t,e);return s<0&&(s=this.getRightmostSideOfSegment(t,e-1)),s<0&&(this._minCoord=null,this.checkForRightmostCoordinate(t)),s}findRightmostEdgeAtVertex(){let t=this._minDe.getEdge().getCoordinates();C.A.isTrue(this._minIndex>0&&this._minIndex<t.length,"rightmost point expected to be interior vertex of edge");let e=t[this._minIndex-1],s=t[this._minIndex+1],i=U.A.index(this._minCoord,s,e),n=!1;e.y<this._minCoord.y&&s.y<this._minCoord.y&&i===U.A.COUNTERCLOCKWISE?n=!0:e.
1y>this._minCoord.y&&s.y>this._minCoord.y&&i===U.A.CLOCKWISE&&(n=!0),n&&(this._minIndex=this._minIndex-1)}getRightmostSideOfSegment(t,e){let s=t.getEdge().getCoordinates();if(e<0||e+1>=s.length||s[e].y===s[e+1].y)return -1;let i=G.A.LEFT;return s[e].y<s[e+1].y&&(i=G.A.RIGHT),i}getEdge(){return this._orientedDe}checkForRightmostCoordinate(t){let e=t.getEdge().getCoordinates();for(let s=0;s<e.length-1;s++)(null===this._minCoord||e[s].x>this._minCoord.x)&&(this._minDe=t,this._minIndex=s,this._minCoord=e[s])}findRightmostEdgeAtNode(){let t=this._minDe.getNode().getEdges();this._minDe=t.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)}findEdge(t){for(let e=t.iterator();e.hasNext();){let t=e.next();t.isForward()&&this.checkForRightmostCoordinate(t)}C.A.isTrue(0!==this._minIndex||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),0===this._minIndex?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe,this.getRightmostSide(this._minDe,this._minIndex)===G.A.LEFT&&(this._orientedDe=this._minDe.getSym())}}class X{constructor(){this.array=[]}addLast(t){this.array.push(t)}removeFirst(){return this.array.shift()}isEmpty(){return 0===this.array.length}}var B=s(4810);class H{constructor(){H.constructor_.apply(this,arguments)}static constructor_(){this._finder=null,this._dirEdgeList=new h.A,this._nodes=new h.A,this._rightMostCoord=null,this._env=null,this._finder=new k}clearVisitedEdges(){for(let t=this._dirEdgeList.iterator();t.hasNext();)t.next().setVisited(!1)}compareTo(t){return this._rightMostCoord.x<t._rightMostCoord.x?-1:+(this._rightMostCoord.x>t._rightMostCoord.x)}getEnvelope(){if(null===this._env){let t=new y.A;for(let e=this._dirEdgeList.iterator();e.hasNext();){let s=e.next().getEdge().getCoordinates();for(let e=0;e<s.length-1;e++)t.expandToInclude(s[e])}this._env=t}return this._env}addReachable(t){let e=new q.A;for(e.add(t);!e.empty();){let t=e.pop();this.add(t,e)}}copySymDepths(t){let e=t.getSym();e.setDepth(G.A.LEFT,t.getDepth(G.A.RIGHT)),e.setDepth(G.A.RIGHT,t.getDepth(G.A.LEFT))}add(t,e){t.setVisited(!0),this._nodes.add(t);for(let s=t.getEdges().iterator();s.hasNext();){let t=s.next();this._dirEdgeList.add(t);let i=t.getSym().getNode();i.isVisited()||e.push(i)}}getRightmostCoordinate(){return this._rightMostCoord}computeNodeDepth(t){let e=null;for(let s=t.getEdges().iterator();s.hasNext();){let t=s.next();if(t.isVisited()||t.getSym().isVisited()){e=t;break}}if(null===e)throw new g.A("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(e);for(let e=t.getEdges().iterator();e.hasNext();){let t=e.next();t.setVisited(!0),this.copySymDepths(t)}}computeDepth(t){this.clearVisitedEdges();let e=this._finder.getEdge();e.getNode(),e.getLabel(),e.setEdgeDepths(G.A.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)}create(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()}findResultEdges(){for(let t=this._dirEdgeList.iterator();t.hasNext();){let e=t.next();e.getDepth(G.A.RIGHT)>=1&&0>=e.getDepth(G.A.LEFT)&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}}computeDepths(t){let e=new V.A,s=new X,i=t.getNode();for(s.addLast(i),e.add(i),t.setVisited(!0);!s.isEmpty();){let t=s.removeFirst();e.add(t),this.computeNodeDepth(t);for(let i=t.getEdges().iterator();i.hasNext();){let t=i.next().getSym();if(t.isVisited())continue;let n=t.getNode();e.contains(n)||(s.addLast(n),e.add(n))}}}getNodes(){return this._nodes}getDirectedEdges(){return this._dirEdgeList}get interfaces_(){return[B.A]}}var J=s(8464),z=s(3217);class Q{constructor(){Q.constructor_.apply(this,arguments)}static constructor_(){this._inputLine=null,this._distanceTol=null,this._isDeleted=null,this._angleOrientation=U.A.COUNTERCLOCKWISE;let t=arguments[0];this._inputLine=t}static simplify(t,e){return new Q(t).simplify(e)}isDeletable(t,e,s,i){let n=this._inputLine[t],r=this._inputLine[e],o=this._inputLine[s];return!!this.isConcave(n,r,o)&&!!this.isShallow(n,r,o,i)&&this.isShallowSampled(n,r,t,s,i)}deleteShallowConcavities(){let t=1,e=this.findNextNonDeletedIndex(t),s=this.findNextNonDeletedIndex(e),i=!1;for(;s<this._inputLine.length;){let n=!1;this.isDeletable(t,e,s,this._distanceTol)&&(this._isDeleted[e]=Q.DELETE,n=!0,i=!0),t=n?s:e,e=this.findNextNonDeletedIndex(t),s=this.findNextNonDeletedIndex(e)}return i}isShallowConcavity(t,e,s,i){return U.A.index(t,e,s)===this._angleOrientation&&z.A.pointToSegment(e,t,s)<i}isShallowSampled(t,e,s,i,n){let r=Math.trunc((i-s)/Q.NUM_PTS_TO_CHECK);r<=0&&(r=1);for(let o=s;o<i;o+=r)if(!this.isShallow(t,e,this._inputLine[o],n))return!1;return!0}isConcave(t,e,s){return U.A.index(t,e,s)===this._angleOrientation}simplify(t){this._distanceTol=Math.abs(t),t<0&&(this._angleOrientation=U.A.CLOCKWISE),this._isDeleted=Array(this._inputLine.length).fill(null);let e=!1;do e=this.deleteShallowConcavities();while(e);return this.collapseLine()}findNextNonDeletedIndex(t){let e=t+1;for(;e<this._inputLine.length&&this._isDeleted[e]===Q.DELETE;)e++;return e}isShallow(t,e,s,i){return z.A.pointToSegment(e,t,s)<i}collapseLine(){let t=new J.A;for(let e=0;e<this._inputLine.length;e++)this._isDeleted[e]!==Q.DELETE&&t.add(this._inputLine[e]);return t.toCoordinateArray()}}Q.INIT=0,Q.DELETE=1,Q.KEEP=1,Q.NUM_PTS_TO_CHECK=10;class W{constructor(){W.constructor_.apply(this,arguments)}static constructor_(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new h.A}getCoordinates(){return this._ptList.toArray(W.COORDINATE_ARRAY_TYPE)}setPrecisionModel(t){this._precisionModel=t}addPt(t){let e=new r.A(t);if(this._precisionModel.makePrecise(e),this.isRedundant(e))return null;this._ptList.add(e)}reverse(){}addPts(t,e){if(e)for(let e=0;e<t.length;e++)this.addPt(t[e]);else for(let e=t.length-1;e>=0;e--)this.addPt(t[e])}isRedundant(t){if(1>this._ptList.size())return!1;let e=this._ptList.get(this._ptList.size()-1);return t.distance(e)<this._minimimVertexDistance}toString(){return new m.A().createLineString(this.getCoordinates()).toString()}closeRing(){if(1>this._ptList.size())return null;let t=new r.A(this._ptList.get(0)),e=this._ptList.get(this._ptList.size()-1);if(t.equals(e))return null;this._ptList.add(t)}setMinimumVertexDistance(t){this._minimimVertexDistance=t}}W.COORDINATE_ARRAY_TYPE=[].fill(null);var K=s(9784);class Y{static toDegrees(t){return 180*t/Math.PI}static isAcute(t,e,s){let i=t.x-e.x,n=t.y-e.y;return i*(s.x-e.x)+n*(s.y-e.y)>0}static isObtuse(t,e,s){let i=t.x-e.x,n=t.y-e.y;return i*(s.x-e.x)+n*(s.y-e.y)<0}static interiorAngle(t,e,s){let i=Y.angle(e,t);return Math.abs(Y.angle(e,s)-i)}static normalizePositive(t){if(t<0){for(;t<0;)t+=Y.PI_TIMES_2;t>=Y.PI_TIMES_2&&(t=0)}else{for(;t>=Y.PI_TIMES_2;)t-=Y.PI_TIMES_2;t<0&&(t=0)}return t}static angleBetween(t,e,s){let i=Y.angle(e,t),n=Y.angle(e,s);return Y.diff(i,n)}static diff(t,e){let s=null;return(s=t<e?e-t:t-e)>Math.PI&&(s=2*Math.PI-s),s}static toRadians(t){return t*Math.PI/180}static normalize(t){for(;t>Math.PI;)t-=Y.PI_TIMES_2;for(;t<=-Math.PI;)t+=Y.PI_TIMES_2;return t}static angle(){if(1==arguments.length){let t=arguments[0];return Math.atan2(t.y,t.x)}if(2==arguments.length){let t=arguments[0],e=arguments[1],s=e.x-t.x;return Math.atan2(e.y-t.y,s)}}static getTurn(t,e){let s=Math.sin(e-t);return s>0?Y.COUNTERCLOCKWISE:s<0?Y.CLOCKWISE:Y.NONE}static angleBetweenOriented(t,e,s){let i=Y.angle(e,t),n=Y.angle(e,s)-i;return n<=-Math.PI?n+Y.PI_TIMES_2:n>Math.PI?n-Y.PI_TIMES_2:n}
1}Y.PI_TIMES_2=2*Math.PI,Y.PI_OVER_2=Math.PI/2,Y.PI_OVER_4=Math.PI/4,Y.COUNTERCLOCKWISE=U.A.COUNTERCLOCKWISE,Y.CLOCKWISE=U.A.CLOCKWISE,Y.NONE=U.A.COLLINEAR;class Z{constructor(){Z.constructor_.apply(this,arguments)}static constructor_(){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 L.A,this._seg1=new L.A,this._offset0=new L.A,this._offset1=new L.A,this._side=0,this._hasNarrowConcaveAngle=!1;let t=arguments[0],e=arguments[1],s=arguments[2];this._precisionModel=t,this._bufParams=e,this._li=new A.A,this._filletAngleQuantum=Math.PI/2/e.getQuadrantSegments(),e.getQuadrantSegments()>=8&&e.getJoinStyle()===i.JOIN_ROUND&&(this._closingSegLengthFactor=Z.MAX_CLOSING_SEG_LEN_FACTOR),this.init(s)}getCoordinates(){return this._segList.getCoordinates()}addMitreJoin(t,e,s,i){let n=K.A.intersection(e.p0,e.p1,s.p0,s.p1);if(null!==n&&(i<=0?1:n.distance(t)/Math.abs(i))<=this._bufParams.getMitreLimit())return this._segList.addPt(n),null;this.addLimitedMitreJoin(e,s,i,this._bufParams.getMitreLimit())}addLastSegment(){this._segList.addPt(this._offset1.p1)}initSideSegments(t,e,s){this._s1=t,this._s2=e,this._side=s,this._seg1.setCoordinates(t,e),this.computeOffsetSegment(this._seg1,s,this._distance,this._offset1)}addLimitedMitreJoin(t,e,s,i){let n=this._seg0.p1,o=Y.angle(n,this._seg0.p0),l=Y.angleBetweenOriented(this._seg0.p0,n,this._seg1.p1)/2,a=Y.normalize(o+l),h=Y.normalize(a+Math.PI),d=i*s,c=s-d*Math.abs(Math.sin(l)),_=n.x+d*Math.cos(h),g=n.y+d*Math.sin(h),u=new r.A(_,g),p=new L.A(n,u),f=p.pointAlongOffset(1,c),m=p.pointAlongOffset(1,-c);this._side===G.A.LEFT?(this._segList.addPt(f),this._segList.addPt(m)):(this._segList.addPt(m),this._segList.addPt(f))}addDirectedFillet(t,e,s,i,n){let o=i===U.A.CLOCKWISE?-1:1,l=Math.abs(e-s),a=Math.trunc(l/this._filletAngleQuantum+.5);if(a<1)return null;let h=l/a,d=new r.A;for(let s=0;s<a;s++){let i=e+o*s*h;d.x=t.x+n*Math.cos(i),d.y=t.y+n*Math.sin(i),this._segList.addPt(d)}}computeOffsetSegment(t,e,s,i){let n=e===G.A.LEFT?1:-1,r=t.p1.x-t.p0.x,o=t.p1.y-t.p0.y,l=Math.sqrt(r*r+o*o),a=n*s*r/l,h=n*s*o/l;i.p0.x=t.p0.x-h,i.p0.y=t.p0.y+a,i.p1.x=t.p1.x-h,i.p1.y=t.p1.y+a}addInsideTurn(t,e){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*Z.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){let t=new r.A((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(t);let e=new r.A((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(e)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}}createCircle(t){let e=new r.A(t.x+this._distance,t.y);this._segList.addPt(e),this.addDirectedFillet(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()}addBevelJoin(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)}init(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new W,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*Z.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)}addCollinear(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===i.JOIN_BEVEL||this._bufParams.getJoinStyle()===i.JOIN_MITRE?(t&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addCornerFillet(this._s1,this._offset0.p1,this._offset1.p0,U.A.CLOCKWISE,this._distance))}addNextSegment(t,e){if(this._s0=this._s1,this._s1=this._s2,this._s2=t,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;let s=U.A.index(this._s0,this._s1,this._s2),i=s===U.A.CLOCKWISE&&this._side===G.A.LEFT||s===U.A.COUNTERCLOCKWISE&&this._side===G.A.RIGHT;0===s?this.addCollinear(e):i?this.addOutsideTurn(s,e):this.addInsideTurn(s,e)}addLineEndCap(t,e){let s=new L.A(t,e),n=new L.A;this.computeOffsetSegment(s,G.A.LEFT,this._distance,n);let o=new L.A;this.computeOffsetSegment(s,G.A.RIGHT,this._distance,o);let l=e.x-t.x,a=Math.atan2(e.y-t.y,l);switch(this._bufParams.getEndCapStyle()){case i.CAP_ROUND:this._segList.addPt(n.p1),this.addDirectedFillet(e,a+Math.PI/2,a-Math.PI/2,U.A.CLOCKWISE,this._distance),this._segList.addPt(o.p1);break;case i.CAP_FLAT:this._segList.addPt(n.p1),this._segList.addPt(o.p1);break;case i.CAP_SQUARE:let h=new r.A;h.x=Math.abs(this._distance)*Math.cos(a),h.y=Math.abs(this._distance)*Math.sin(a);let d=new r.A(n.p1.x+h.x,n.p1.y+h.y),c=new r.A(o.p1.x+h.x,o.p1.y+h.y);this._segList.addPt(d),this._segList.addPt(c)}}addOutsideTurn(t,e){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*Z.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===i.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===i.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(e&&this._segList.addPt(this._offset0.p1),this.addCornerFillet(this._s1,this._offset0.p1,this._offset1.p0,t,this._distance),this._segList.addPt(this._offset1.p0))}createSquare(t){this._segList.addPt(new r.A(t.x+this._distance,t.y+this._distance)),this._segList.addPt(new r.A(t.x+this._distance,t.y-this._distance)),this._segList.addPt(new r.A(t.x-this._distance,t.y-this._distance)),this._segList.addPt(new r.A(t.x-this._distance,t.y+this._distance)),this._segList.closeRing()}addSegments(t,e){this._segList.addPts(t,e)}addFirstSegment(){this._segList.addPt(this._offset1.p0)}
1addCornerFillet(t,e,s,i,n){let r=e.x-t.x,o=Math.atan2(e.y-t.y,r),l=s.x-t.x,a=Math.atan2(s.y-t.y,l);i===U.A.CLOCKWISE?o<=a&&(o+=2*Math.PI):o>=a&&(o-=2*Math.PI),this._segList.addPt(e),this.addDirectedFillet(t,o,a,i,n),this._segList.addPt(s)}closeRing(){this._segList.closeRing()}hasNarrowConcaveAngle(){return this._hasNarrowConcaveAngle}}Z.OFFSET_SEGMENT_SEPARATION_FACTOR=.001,Z.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR=.001,Z.CURVE_VERTEX_SNAP_DISTANCE_FACTOR=1e-6,Z.MAX_CLOSING_SEG_LEN_FACTOR=80;class j{constructor(){j.constructor_.apply(this,arguments)}static constructor_(){this._distance=0,this._precisionModel=null,this._bufParams=null;let t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e}static copyCoordinates(t){let e=Array(t.length).fill(null);for(let s=0;s<e.length;s++)e[s]=new r.A(t[s]);return e}getOffsetCurve(t,e){if(this._distance=e,0===e)return null;let s=e<0,i=Math.abs(e),n=this.getSegGen(i);t.length<=1?this.computePointCurve(t[0],n):this.computeOffsetCurve(t,s,n);let r=n.getCoordinates();return s&&a.A.reverse(r),r}computeSingleSidedBufferCurve(t,e,s){let i=this.simplifyTolerance(this._distance);if(e){s.addSegments(t,!0);let e=Q.simplify(t,-i),n=e.length-1;s.initSideSegments(e[n],e[n-1],G.A.LEFT),s.addFirstSegment();for(let t=n-2;t>=0;t--)s.addNextSegment(e[t],!0)}else{s.addSegments(t,!1);let e=Q.simplify(t,i),n=e.length-1;s.initSideSegments(e[0],e[1],G.A.LEFT),s.addFirstSegment();for(let t=2;t<=n;t++)s.addNextSegment(e[t],!0)}s.addLastSegment(),s.closeRing()}computeRingBufferCurve(t,e,s){let i=this.simplifyTolerance(this._distance);e===G.A.RIGHT&&(i=-i);let n=Q.simplify(t,i),r=n.length-1;s.initSideSegments(n[r-1],n[0],e);for(let t=1;t<=r;t++){let e=1!==t;s.addNextSegment(n[t],e)}s.closeRing()}computeLineBufferCurve(t,e){let s=this.simplifyTolerance(this._distance),i=Q.simplify(t,s),n=i.length-1;e.initSideSegments(i[0],i[1],G.A.LEFT);for(let t=2;t<=n;t++)e.addNextSegment(i[t],!0);e.addLastSegment(),e.addLineEndCap(i[n-1],i[n]);let r=Q.simplify(t,-s),o=r.length-1;e.initSideSegments(r[o],r[o-1],G.A.LEFT);for(let t=o-2;t>=0;t--)e.addNextSegment(r[t],!0);e.addLastSegment(),e.addLineEndCap(r[1],r[0]),e.closeRing()}computePointCurve(t,e){switch(this._bufParams.getEndCapStyle()){case i.CAP_ROUND:e.createCircle(t);break;case i.CAP_SQUARE:e.createSquare(t)}}getLineCurve(t,e){if(this._distance=e,this.isLineOffsetEmpty(e))return null;let s=Math.abs(e),i=this.getSegGen(s);return t.length<=1?this.computePointCurve(t[0],i):this._bufParams.isSingleSided()?this.computeSingleSidedBufferCurve(t,e<0,i):this.computeLineBufferCurve(t,i),i.getCoordinates()}getBufferParameters(){return this._bufParams}simplifyTolerance(t){return t*this._bufParams.getSimplifyFactor()}getRingCurve(t,e,s){if(this._distance=s,t.length<=2)return this.getLineCurve(t,s);if(0===s)return j.copyCoordinates(t);let i=this.getSegGen(s);return this.computeRingBufferCurve(t,e,i),i.getCoordinates()}computeOffsetCurve(t,e,s){let i=this.simplifyTolerance(this._distance);if(e){let e=Q.simplify(t,-i),n=e.length-1;s.initSideSegments(e[n],e[n-1],G.A.LEFT),s.addFirstSegment();for(let t=n-2;t>=0;t--)s.addNextSegment(e[t],!0)}else{let e=Q.simplify(t,i),n=e.length-1;s.initSideSegments(e[0],e[1],G.A.LEFT),s.addFirstSegment();for(let t=2;t<=n;t++)s.addNextSegment(e[t],!0)}s.addLastSegment()}isLineOffsetEmpty(t){return!(0!==t&&(!(t<0)||this._bufParams.isSingleSided()))}getSegGen(t){return new Z(this._precisionModel,this._bufParams,t)}}var $=s(6313),tt=s(2711),te=s(9916),ts=s(9513),ti=s(946),tn=s(1407);class tr{constructor(){tr.constructor_.apply(this,arguments)}static constructor_(){this._subgraphs=null,this._seg=new L.A;let t=arguments[0];this._subgraphs=t}findStabbedSegments(){if(1==arguments.length){let t=arguments[0],e=new h.A;for(let s=this._subgraphs.iterator();s.hasNext();){let i=s.next(),n=i.getEnvelope();t.y<n.getMinY()||t.y>n.getMaxY()||this.findStabbedSegments(t,i.getDirectedEdges(),e)}return e}if(3==arguments.length){if((0,n.A)(arguments[2],ti.A)&&arguments[0]instanceof r.A&&arguments[1]instanceof tn.A){let t=arguments[0],e=arguments[1],s=arguments[2],i=e.getEdge().getCoordinates();for(let n=0;n<i.length-1;n++){if(this._seg.p0=i[n],this._seg.p1=i[n+1],this._seg.p0.y>this._seg.p1.y&&this._seg.reverse(),Math.max(this._seg.p0.x,this._seg.p1.x)<t.x||this._seg.isHorizontal()||t.y<this._seg.p0.y||t.y>this._seg.p1.y||U.A.index(this._seg.p0,this._seg.p1,t)===U.A.RIGHT)continue;let r=e.getDepth(G.A.LEFT);this._seg.p0.equals(i[n])||(r=e.getDepth(G.A.RIGHT));let o=new to(this._seg,r);s.add(o)}}else if((0,n.A)(arguments[2],ti.A)&&arguments[0]instanceof r.A&&(0,n.A)(arguments[1],ti.A)){let t=arguments[0],e=arguments[1],s=arguments[2];for(let i=e.iterator();i.hasNext();){let e=i.next();e.isForward()&&this.findStabbedSegments(t,e,s)}}}}getDepth(t){let e=this.findStabbedSegments(t);return 0===e.size()?0:$.A.min(e)._leftDepth}}class to{constructor(){to.constructor_.apply(this,arguments)}static constructor_(){this._upwardSeg=null,this._leftDepth=null;let t=arguments[0],e=arguments[1];this._upwardSeg=new L.A(t),this._leftDepth=e}compareX(t,e){let s=t.p0.compareTo(e.p0);return 0!==s?s:t.p1.compareTo(e.p1)}toString(){return this._upwardSeg.toString()}compareTo(t){if(this._upwardSeg.minX()>=t._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=t._upwardSeg.minX())return -1;let e=this._upwardSeg.orientationIndex(t._upwardSeg);return 0!==e||0!=(e=-1*t._upwardSeg.orientationIndex(this._upwardSeg))?e:this._upwardSeg.compareTo(t._upwardSeg)}get interfaces_(){return[B.A]}}tr.DepthSegment=to;var tl=s(7807),ta=s(2674),th=s(4333),td=s(3739),tc=s(1362),t_=s(2424);class tg extends w.A{constructor(){super(),tg.constructor_.apply(this,arguments)}static constructor_(){w.A.constructor_.call(this,"Projective point not representable on the Cartesian plane.")}}var tu=s(4199);class tp{constructor(){tp.constructor_.apply(this,arguments)}static constructor_(){if(this.x=null,this.y=null,this.w=null,0==arguments.length)this.x=0,this.y=0,this.w=1;else if(1==arguments.length){let t=arguments[0];this.x=t.x,this.y=t.y,this.w=1}else if(2==arguments.length){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){let t=arguments[0],e=arguments[1];this.x=t,this.y=e,this.w=1}else if(arguments[0]instanceof tp&&arguments[1]instanceof tp){let t=arguments[0],e=arguments[1];this.x=t.y*e.w-e.y*t.w,this.y=e.x*t.w-t.x*e.w,this.w=t.x*e.y-e.x*t.y}else if(arguments[0]instanceof r.A&&arguments[1]instanceof r.A){let t=arguments[0],e=arguments[1];this.x=t.y-e.y,this.y=e.x-t.x,this.w=t.x*e.y-e.x*t.y}}else if(3==arguments.length){let t=arguments[0],e=arguments[1],s=arguments[2];this.x=t,this.y=e,this.w=s}else if(4==arguments.length){let t=arguments[0],e=arguments[1],s=arguments[2],i=arguments[3],n=t.y-e.y,r=e.x-t.x,o=t.x*e.y-e.x*t.y,l=s.y-i.y,a=i.x-s.x,h=s.x*i.y-i.x*s.y;this.x=r*h-a*o,this.y=l*o-n*h,this.w=n*a-l*r}}getCoordinate(){let t=new r.A;return t.x=this.getX(),t.y=this.getY(),t}getX(){let t=this.x/this.w;if(tu.A.isNaN(t)||tu.A.isInfinite(t))throw new tg;return t}getY(){let t=this.y/this.w;if(tu.A.isNaN(t)||tu.A.isInfinite(t))throw new tg;return t}}class tf{constructor(){tf.constructor_.apply(this,arguments)}static constructor_(){this.p0=null,this.p1=null,this.p2=null;let t=arguments[0],e=arguments[1],s=arguments[2];this.p0=t,this.p1=e,this.p2=s}static isAcute(t,e,s){return!!Y.isAcute(t,e,s)&&!!Y.isAcute(e,s,t)&&!!Y.isAcute(s,t,e)}static circumcentre(t,e,s){let i=s.x,n=s.y,o=t.x-i,l=t.y-n,a=e.x-i,h=e.y-n,d=2*tf.det(o,l,a,h),c=tf.det(l,o*o+l*l,h,a*a+h*h),_=tf.det(o,o*o+l*l,a,a*a+h*h);return new r.A(i-c/d,n+_/d)}static perpendicularBisector(t,e){let s=e.x-t.x,i=e.y-t.y,n=new tp(t.x+s/2,t.y+i/2,1),r=new tp(t.x-i+s/2,t.y+s+i/2,1);return new tp(n,r)}static angleBisector(t,e,s){let i=e.distance(t),n=i/(i+e.distance(s)),o=s.x-t.x,l=s.y-t.y;return new r.A(t.x+n*o,t.y+n*l)}static inCentre(t,e,s){let i=e.distance(s),n=t.distance(s),o=t.distance(e),l=i+n+o,a=(i*t.x+n*e.x+o*s.x)/l,h=(i*t.y+n*e.y+o*s.y)/l;return new r.A(a,h)}static area(t,e,s){return Math.abs(((s.x-t.x)*(e.y-t.y)-(e.x-t.x)*(s.y-t.y))/2)}static signedArea(t,e,s){return((s.x-t.x)*(e.y-t.y)-(e.x-t.x)*(s.y-t.y))/2}static det(t,e,s,i){return t*i-e*s}static interpolateZ(t,e,s,i){let n=e.x,r=e.y,o=s.x-n,l=i.x-n,a=s.y-r,h=i.y-r,d=o*h-l*a,c=t.x-n,_=t.y-r;return e.getZ()+(h*c-l*_)/d*(s.getZ()-e.getZ())+(-a*c+o*_)/d*(i.getZ()-e.getZ())}static longestSideLength(t,e,s){let i=t.distance(e),n=e.distance(s),r=s.distance(t),o=i;return n>o&&(o=n),r>o&&(o=r),o}static circumcentreDD(t,e,s){let i=t_.A.valueOf(t.x).subtract(s.x),n=t_.A.valueOf(t.y).subtract(s.y),o=t_.A.valueOf(e.x).subtract(s.x),l=t_.A.valueOf(e.y).subtract(s.y),a=t_.A.determinant(i,n,o,l).multiply(2),h=i.sqr().add(n.sqr()),d=o.sqr().add(l.sqr()),c=t_.A.determinant(n,h,l,d),_=t_.A.determinant(i,h,o,d),g=t_.A.valueOf(s.x).subtract(c.divide(a)).doubleValue(),u=t_.A.valueOf(s.y).add(_.divi
1de(a)).doubleValue();return new r.A(g,u)}static area3D(t,e,s){let i=e.x-t.x,n=e.y-t.y,r=e.getZ()-t.getZ(),o=s.x-t.x,l=s.y-t.y,a=s.getZ()-t.getZ(),h=n*a-r*l,d=r*o-i*a,c=i*l-n*o;return Math.sqrt(h*h+d*d+c*c)/2}static centroid(t,e,s){let i=(t.x+e.x+s.x)/3,n=(t.y+e.y+s.y)/3;return new r.A(i,n)}interpolateZ(t){if(null===t)throw new I.A("Supplied point is null.");return tf.interpolateZ(t,this.p0,this.p1,this.p2)}longestSideLength(){return tf.longestSideLength(this.p0,this.p1,this.p2)}isAcute(){return tf.isAcute(this.p0,this.p1,this.p2)}circumcentre(){return tf.circumcentre(this.p0,this.p1,this.p2)}inCentre(){return tf.inCentre(this.p0,this.p1,this.p2)}area(){return tf.area(this.p0,this.p1,this.p2)}signedArea(){return tf.signedArea(this.p0,this.p1,this.p2)}area3D(){return tf.area3D(this.p0,this.p1,this.p2)}centroid(){return tf.centroid(this.p0,this.p1,this.p2)}}var tm=s(7193),tA=s(7739),tS=s(3478),tx=s(8277);class tI{constructor(){tI.constructor_.apply(this,arguments)}static constructor_(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new h.A;let t=arguments[0],e=arguments[1],s=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=s}addRingSide(t,e,s,i,n){if(0===e&&t.length<th.A.MINIMUM_VALID_SIZE)return null;let r=i,o=n;t.length>=th.A.MINIMUM_VALID_SIZE&&U.A.isCCW(t)&&(r=n,o=i,s=G.A.opposite(s));let l=this._curveBuilder.getRingCurve(t,s,e);this.addCurve(l,r,o)}addRingBothSides(t,e){this.addRingSide(t,e,G.A.LEFT,F.A.EXTERIOR,F.A.INTERIOR),this.addRingSide(t,e,G.A.RIGHT,F.A.INTERIOR,F.A.EXTERIOR)}addPoint(t){if(this._distance<=0)return null;let e=t.getCoordinates(),s=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(s,F.A.EXTERIOR,F.A.INTERIOR)}addPolygon(t){let e=this._distance,s=G.A.LEFT;this._distance<0&&(e=-this._distance,s=G.A.RIGHT);let i=t.getExteriorRing(),n=a.A.removeRepeatedPoints(i.getCoordinates());if(this._distance<0&&this.isErodedCompletely(i,this._distance)||this._distance<=0&&n.length<3)return null;this.addRingSide(n,e,s,F.A.EXTERIOR,F.A.INTERIOR);for(let i=0;i<t.getNumInteriorRing();i++){let n=t.getInteriorRingN(i),r=a.A.removeRepeatedPoints(n.getCoordinates());this._distance>0&&this.isErodedCompletely(n,-this._distance)||this.addRingSide(r,e,G.A.opposite(s),F.A.INTERIOR,F.A.EXTERIOR)}}isTriangleErodedCompletely(t,e){let s=new tf(t[0],t[1],t[2]),i=s.inCentre();return z.A.pointToSegment(i,s.p0,s.p1)<Math.abs(e)}addLineString(t){if(this._curveBuilder.isLineOffsetEmpty(this._distance))return null;let e=a.A.removeRepeatedPoints(t.getCoordinates());if(a.A.isRing(e)&&!this._curveBuilder.getBufferParameters().isSingleSided())this.addRingBothSides(e,this._distance);else{let t=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(t,F.A.EXTERIOR,F.A.INTERIOR)}}add(t){if(t.isEmpty())return null;if(t instanceof tm.A)this.addPolygon(t);else if(t instanceof tl.A)this.addLineString(t);else if(t instanceof ta.A)this.addPoint(t);else if(t instanceof tA.A)this.addCollection(t);else if(t instanceof tc.A)this.addCollection(t);else if(t instanceof td.A)this.addCollection(t);else if(t instanceof tS.A)this.addCollection(t);else throw new tx.A(t.getGeometryType())}addCurve(t,e,s){if(null===t||t.length<2)return null;let i=new o.A(t,new tt.A(0,F.A.BOUNDARY,e,s));this._curveList.add(i)}getCurves(){return this.add(this._inputGeom),this._curveList}isErodedCompletely(t,e){let s=t.getCoordinates();if(s.length<4)return e<0;if(4===s.length)return this.isTriangleErodedCompletely(s,e);let i=t.getEnvelopeInternal(),n=Math.min(i.getHeight(),i.getWidth());return!!(e<0&&2*Math.abs(e)>n)}addCollection(t){for(let e=0;e<t.getNumGeometries();e++){let s=t.getGeometryN(e);this.add(s)}}}var ty=s(1271),tC=s(2394);class tE{constructor(){tE.constructor_.apply(this,arguments)}static constructor_(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._hasInterior=!1,this._properIntersectionPoint=null,this._li=null,this._isSelfIntersection=null,this.numIntersections=0,this.numInteriorIntersections=0,this.numProperIntersections=0,this.numTests=0;let t=arguments[0];this._li=t}static isAdjacentSegments(t,e){return 1===Math.abs(t-e)}isTrivialIntersection(t,e,s,i){if(t===s&&1===this._li.getIntersectionNum()){if(tE.isAdjacentSegments(e,i))return!0;
1if(t.isClosed()){let s=t.size()-1;if(0===e&&i===s||0===i&&e===s)return!0}}return!1}getProperIntersectionPoint(){return this._properIntersectionPoint}hasProperInteriorIntersection(){return this._hasProperInterior}getLineIntersector(){return this._li}hasProperIntersection(){return this._hasProper}processIntersections(t,e,s,i){if(t===s&&e===i)return null;this.numTests++;let n=t.getCoordinates()[e],r=t.getCoordinates()[e+1],o=s.getCoordinates()[i],l=s.getCoordinates()[i+1];this._li.computeIntersection(n,r,o,l),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),!this.isTrivialIntersection(t,e,s,i)&&(this._hasIntersection=!0,t.addIntersections(this._li,e,0),s.addIntersections(this._li,i,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))}hasIntersection(){return this._hasIntersection}isDone(){return!1}hasInteriorIntersection(){return this._hasInterior}get interfaces_(){return[v.A]}}var tw=s(4864);class tL{constructor(){tL.constructor_.apply(this,arguments)}static constructor_(){this._bufParams=null,this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new tC.A;let t=arguments[0];this._bufParams=t}static convertSegStrings(t){let e=new m.A,s=new h.A;for(;t.hasNext();){let i=t.next(),n=e.createLineString(i.getCoordinates());s.add(n)}return e.buildGeometry(s)}static depthDelta(t){let e=t.getLocation(0,G.A.LEFT),s=t.getLocation(0,G.A.RIGHT);return e===F.A.INTERIOR&&s===F.A.EXTERIOR?1:e===F.A.EXTERIOR&&s===F.A.INTERIOR?-1:0}createEmptyResultGeometry(){return this._geomFact.createPolygon()}getNoder(t){if(null!==this._workingNoder)return this._workingNoder;let e=new x.A,s=new A.A;return s.setPrecisionModel(t),e.setSegmentIntersector(new tE(s)),e}buffer(t,e){let s=this._workingPrecisionModel;null===s&&(s=t.getPrecisionModel()),this._geomFact=t.getFactory();let i=new tI(t,e,new j(s,this._bufParams)).getCurves();if(0>=i.size())return this.createEmptyResultGeometry();this.computeNodedEdges(i,s),this._graph=new te.A(new ty.A),this._graph.addEdges(this._edgeList.getEdges());let n=this.createSubgraphs(this._graph),r=new ts.A(this._geomFact);this.buildSubgraphs(n,r);let o=r.getPolygons();return 0>=o.size()?this.createEmptyResultGeometry():this._geomFact.buildGeometry(o)}computeNodedEdges(t,e){let s=this.getNoder(e);s.computeNodes(t);let i=s.getNodedSubstrings();for(let t=i.iterator();t.hasNext();){let e=t.next(),s=e.getCoordinates();if(2===s.length&&s[0].equals2D(s[1]))continue;let i=e.getData(),n=new tw.A(e.getCoordinates(),new tt.A(i));this.insertUniqueEdge(n)}}setNoder(t){this._workingNoder=t}setWorkingPrecisionModel(t){this._workingPrecisionModel=t}insertUniqueEdge(t){let e=this._edgeList.findEqualEdge(t);if(null!==e){let s=e.getLabel(),i=t.getLabel();e.isPointwiseEqual(t)||(i=new tt.A(t.getLabel())).flip(),s.merge(i);let n=tL.depthDelta(i),r=e.getDepthDelta();e.setDepthDelta(r+n)}else this._edgeList.add(t),t.setDepthDelta(tL.depthDelta(t.getLabel()))}buildSubgraphs(t,e){let s=new h.A;for(let i=t.iterator();i.hasNext();){let t=i.next(),n=t.getRightmostCoordinate(),r=new tr(s).getDepth(n);t.computeDepth(r),t.findResultEdges(),s.add(t),e.add(t.getDirectedEdges(),t.getNodes())}}createSubgraphs(t){let e=new h.A;for(let s=t.getNodes().iterator();s.hasNext();){let t=s.next();if(!t.isVisited()){let s=new H;s.create(t),e.add(s)}}return $.A.sort(e,$.A.reverseOrder()),e}}class tN{constructor(){tN.constructor_.apply(this,arguments)}static constructor_(){if(this._argGeom=null,this._distance=null,this._bufParams=new i,this._resultGeometry=null,this._saveException=null,1==arguments.length){let t=arguments[0];this._argGeom=t}else if(2==arguments.length){let t=arguments[0],e=arguments[1];this._argGeom=t,this._bufParams=e}}static bufferOp(){if(2==arguments.length){let t=arguments[0],e=arguments[1];return new tN(t).getResultGeometry(e)}if(3==arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof b.A&&"number"==typeof arguments[1]){let t=arguments[0],e=arguments[1],s=arguments[2],i=new tN(t);return i.setQuadrantSegments(s),i.getResultGeometry(e)}else if(arguments[2]instanceof i&&arguments[0]instanceof b.A&&"number"==typeof arguments[1]){let t=arguments[0],e=arguments[1],s=arguments[2];return new tN(t,s).getResultGeometry(e)}}else if(4==arguments.length){let t=arguments[0],e=arguments[1],s=arguments[2],i=arguments[3],n=new tN(t);return n.setQuadrantSegments(s),n.setEndCapStyle(i),n.getResultGeometry(e)}}static precisionScaleFactor(t,e,s){let i=t.getEnvelopeInternal();return Math.pow(10,s-Math.trunc(Math.log(u.A.max(Math.abs(i.getMaxX()),Math.abs(i.getMaxY()),Math.abs(i.getMinX()),Math.abs(i.getMinY()))+2*(e>0?e:0))/Math.log(10)+1))}bufferFixedPrecision(t){let e=new _(new D(new p.A(1)),t.getScale()),s=new tL(this._bufParams);s.setWorkingPrecisionModel(t),s.setNoder(e),this._resultGeometry=s.buffer(this._argGeom,this._distance)}bufferReducedPrecision(){if(0==arguments.length){for(let t=tN.MAX_PRECISION_DIGITS;t>=0;t--){try{this.bufferReducedPrecision(t)}catch(t){if(t instanceof g.A)this._saveException=t;else throw t}finally{}if(null!==this._resultGeometry)return null}throw this._saveException}if(1==arguments.length){let t=arguments[0],e=tN.precisionScaleFactor(this._argGeom,this._distance,t),s=new p.A(e);this.bufferFixedPrecision(s)}}bufferOriginalPrecision(){try{let t=new tL(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(t){if(t instanceof f.A)this._saveException=t;else throw t}finally{}}getResultGeometry(t){return this._distance=t,this.computeGeometry(),this._resultGeometry}setEndCapStyle(t){this._bufParams.setEndCapStyle(t)}computeGeometry(){if(this.bufferOriginalPrecision(),null!==this._resultGeometry)return null;let t=this._argGeom.getFactory().getPrecisionModel();t.getType()===p.A.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()}setQuadrantSegments(t){this._bufParams.setQuadrantSegments(t)}}tN.CAP_ROUND=i.CAP_ROUND,tN.CAP_BUTT=i.CAP_FLAT,tN.CAP_FLAT=i.CAP_FLAT,tN.CAP_SQUARE=i.CAP_SQUARE,tN.MAX_PRECISION_DIGITS=12},9513(t,e,s){var i=s(948),n=s(9374),r=s(9843),o=s(2922),l=s(5029),a=s(6861),h=s(9916);class d{constructor(){d.constructor_.apply(this,arguments)}static constructor_(){this._geometryFactory=null,this._shellList=new l.A;let t=arguments[0];this._geometryFactory=t}static findEdgeRingContaining(t,e){let s=t.getLinearRing(),n=s.getEnvelopeInternal(),r=s.getCoordinateN(0),l=null,a=null;for(let t=e.iterator();t.hasNext();){let e=t.next(),h=e.getLinearRing(),d=h.getEnvelopeInternal();if(d.equals(n)||!d.contains(n))continue;r=o.A.ptNotInList(s.getCoordinates(),h.getCoordinates());let c=!1;i.A.isInRing(r,h.getCoordinates())&&(c=!0),c&&(null===l||a.contains(d))&&(a=(l=e).getLinearRing().getEnvelopeInternal())}return l}sortShellsAndHoles(t,e,s){for(let i=t.iterator();i.hasNext();){let t=i.next();t.isHole()?s.add(t):e.add(t)}}computePolygons(t){let e=new l.A;for(let s=t.iterator();s.hasNext();){let t=s.next().toPolygon(this._geometryFactory);e.add(t)}return e}placeFreeHoles(t,e){for(let s=e.iterator();s.hasNext();){let e=s.next();if(null===e.getShell()){let s=d.findEdgeRingContaining(e,t);if(null===s)throw new n.A("unable to assign hole to a shell",e.getCoordinate(0));e.setShell(s)}}}buildMinimalEdgeRings(t,e,s){let i=new l.A;for(let n=t.iterator();n.hasNext();){let t=n.next();if(t.getMaxNodeDegree()>2){t.linkDirectedEdgesForMinimalEdgeRings();let i=t.buildMinimalRings(),n=this.findShell(i);null!==n?(this.placePolygonHoles(n,i),e.add(n)):s.addAll(i)}else i.add(t)}return i}buildMaximalEdgeRings(t){let e=new l.A;for(let s=t.iterator();s.hasNext();){let t=s.next();if(t.isInResult()&&t.getLabel().isArea()&&null===t.getEdgeRing()){let s=new r.A(t,this._geometryFactory);e.add(s),s.setInResult()}}return e}placePolygonHoles(t,e){for(let s=e.iterator();s.hasNext();){let e=s.next();e.isHole()&&e.setShell(t)}}getPolygons(){return this.computePolygons(this._shellList)}findShell(t){let e=0,s=null;for(let i=t.iterator();i.hasNext();){let t=i.next();!t.isHole()&&(s=t,e++)}return a.A.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),s}
1add(){if(1==arguments.length){let t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(2==arguments.length){let t=arguments[0],e=arguments[1];h.A.linkResultDirectedEdges(e);let s=this.buildMaximalEdgeRings(t),i=new l.A,n=this.buildMinimalEdgeRings(s,this._shellList,i);this.sortShellsAndHoles(n,this._shellList,i),this.placeFreeHoles(this._shellList,i)}}}s.d(e,{A:()=>d})}}]);
2//# sourceMappingURL=BufferOp.bundle.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.