ow-eengine-power 2.7.4 → 2.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18557,11 +18557,11 @@ class Lh {
18557
18557
  loadLineTower() {
18558
18558
  this.lineConstruction.loadLineTower();
18559
18559
  }
18560
- //设置显隐
18560
+ //设置线路显隐
18561
18561
  setLineVisible(t) {
18562
18562
  this.lineConstruction.setLineVisible(t);
18563
18563
  }
18564
- //设置显隐
18564
+ //树木设置显隐
18565
18565
  setTreeVisible(t) {
18566
18566
  this.terrainConstruction.setTreeVisible(t);
18567
18567
  }
@@ -18792,7 +18792,7 @@ class Lh {
18792
18792
  * @param circuit 回路数:0-全部回路,1-回路1,2-回路2,默认1
18793
18793
  * @param phase 相序:ABC-全部,A-A相,B-B相,C-C相,AB-A/B相,AC-A/C相,BC-B/C相,默认ABC
18794
18794
  */
18795
- LineChannelTerrainVerificationByTowerRange(t, e, r, i = 100, n = 2e3, o = !1, f = !0, u = [], l = 1, a = "ABC") {
18795
+ LineChannelTerrainVerificationByTowerRange(t, e, r, i = 100, n = 2e3, o = !1, f = !0, u = [], l = 0, a = "ABC") {
18796
18796
  debugger;
18797
18797
  const c = this.LineInfo.towers;
18798
18798
  let p = -1, d = -1;
@@ -4,7 +4,7 @@
4
4
  `)}return t.toString()},Qt.prototype.computeEdgeEndLabels=function(t){for(var e=this.iterator();e.hasNext();){var r=e.next();r.computeLabel(t)}},Qt.prototype.computeLabelling=function(t){var e=this;this.computeEdgeEndLabels(t[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var r=[!1,!1],i=this.iterator();i.hasNext();)for(var n=i.next(),o=n.getLabel(),f=0;f<2;f++)o.isLine(f)&&o.getLocation(f)===P.BOUNDARY&&(r[f]=!0);for(var u=this.iterator();u.hasNext();)for(var l=u.next(),a=l.getLabel(),c=0;c<2;c++)if(a.isAnyNull(c)){var p=P.NONE;if(r[c])p=P.EXTERIOR;else{var d=l.getCoordinate();p=e.getLocation(c,d,t)}a.setAllLocationsIfNull(c,p)}},Qt.prototype.getDegree=function(){return this._edgeMap.size()},Qt.prototype.insertEdgeEnd=function(t,e){this._edgeMap.put(t,e),this._edgeList=null},Qt.prototype.interfaces_=function(){return[]},Qt.prototype.getClass=function(){return Qt};var Qf=function(s){function t(){s.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.linkResultDirectedEdges=function(){var r=this;this.getResultAreaEdges();for(var i=null,n=null,o=this._SCANNING_FOR_INCOMING,f=0;f<this._resultAreaEdgeList.size();f++){var u=r._resultAreaEdgeList.get(f),l=u.getSym();if(u.getLabel().isArea())switch(i===null&&u.isInResult()&&(i=u),o){case r._SCANNING_FOR_INCOMING:if(!l.isInResult())continue;n=l,o=r._LINKING_TO_OUTGOING;break;case r._LINKING_TO_OUTGOING:if(!u.isInResult())continue;n.setNext(u),o=r._SCANNING_FOR_INCOMING;break}}if(o===this._LINKING_TO_OUTGOING){if(i===null)throw new Zi("no outgoing dirEdge found",this.getCoordinate());Q.isTrue(i.isInResult(),"unable to link last incoming dirEdge"),n.setNext(i)}},t.prototype.insert=function(r){var i=r;this.insertEdgeEnd(i,i)},t.prototype.getRightmostEdge=function(){var r=this.getEdges(),i=r.size();if(i<1)return null;var n=r.get(0);if(i===1)return n;var o=r.get(i-1),f=n.getQuadrant(),u=o.getQuadrant();return lt.isNorthern(f)&&lt.isNorthern(u)?n:!lt.isNorthern(f)&&!lt.isNorthern(u)?o:n.getDy()!==0?n:o.getDy()!==0?o:(Q.shouldNeverReachHere("found two horizontal edges incident on node"),null)},t.prototype.print=function(r){Xt.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var i=this.iterator();i.hasNext();){var n=i.next();r.print("out "),n.print(r),r.println(),r.print("in "),n.getSym().print(r),r.println()}},t.prototype.getResultAreaEdges=function(){var r=this;if(this._resultAreaEdgeList!==null)return this._resultAreaEdgeList;this._resultAreaEdgeList=new k;for(var i=this.iterator();i.hasNext();){var n=i.next();(n.isInResult()||n.getSym().isInResult())&&r._resultAreaEdgeList.add(n)}return this._resultAreaEdgeList},t.prototype.updateLabelling=function(r){for(var i=this.iterator();i.hasNext();){var n=i.next(),o=n.getLabel();o.setAllLocationsIfNull(0,r.getLocation(0)),o.setAllLocationsIfNull(1,r.getLocation(1))}},t.prototype.linkAllDirectedEdges=function(){var r=this;this.getEdges();for(var i=null,n=null,o=this._edgeList.size()-1;o>=0;o--){var f=r._edgeList.get(o),u=f.getSym();n===null&&(n=u),i!==null&&u.setNext(i),i=f}n.setNext(i)},t.prototype.computeDepths=function(){var r=this;if(arguments.length===1){var i=arguments[0],n=this.findIndex(i),o=i.getDepth(F.LEFT),f=i.getDepth(F.RIGHT),u=this.computeDepths(n+1,this._edgeList.size(),o),l=this.computeDepths(0,n,u);if(l!==f)throw new Zi("depth mismatch at "+i.getCoordinate())}else if(arguments.length===3){for(var a=arguments[0],c=arguments[1],p=arguments[2],d=p,h=a;h<c;h++){var m=r._edgeList.get(h);m.setEdgeDepths(F.RIGHT,d),d=m.getDepth(F.LEFT)}return d}},t.prototype.mergeSymLabels=function(){for(var r=this.iterator();r.hasNext();){var i=r.next(),n=i.getLabel();n.merge(i.getSym().getLabel())}},t.prototype.linkMinimalDirectedEdges=function(r){for(var i=this,n=null,o=null,f=this._SCANNING_FOR_INCOMING,u=this._resultAreaEdgeList.size()-1;u>=0;u--){var l=i._resultAreaEdgeList.get(u),a=l.getSym();switch(n===null&&l.getEdgeRing()===r&&(n=l),f){case i._SCANNING_FOR_INCOMING:if(a.getEdgeRing()!==r)continue;o=a,f=i._LINKING_TO_OUTGOING;break;case i._LINKING_TO_OUTGOING:if(l.getEdgeRing()!==r)continue;o.setNextMin(l),f=i._SCANNING_FOR_INCOMING;break}}f===this._LINKING_TO_OUTGOING&&(Q.isTrue(n!==null,"found null for first outgoing dirEdge"),Q.isTrue(n.getEdgeRing()===r,"unable to link last incoming dirEdge"),o.setNextMin(n))},t.prototype.getOutgoingDegree=function(){if(arguments.length===0){for(var r=0,i=this.iterator();i.hasNext();){var n=i.next();n.isInResult()&&r++}return r}else if(arguments.length===1){for(var o=arguments[0],f=0,u=this.iterator();u.hasNext();){var l=u.next();l.getEdgeRing()===o&&f++}return f}},t.prototype.getLabel=function(){return this._label},t.prototype.findCoveredLineEdges=function(){for(var r=P.NONE,i=this.iterator();i.hasNext();){var n=i.next(),o=n.getSym();if(!n.isLineEdge()){if(n.isInResult()){r=P.INTERIOR;break}if(o.isInResult()){r=P.EXTERIOR;break}}}if(r===P.NONE)return null;for(var f=r,u=this.iterator();u.hasNext();){var l=u.next(),a=l.getSym();l.isLineEdge()?l.getEdge().setCovered(f===P.INTERIOR):(l.isInResult()&&(f=P.EXTERIOR),a.isInResult()&&(f=P.INTERIOR))}},t.prototype.computeLabelling=function(r){var i=this;s.prototype.computeLabelling.call(this,r),this._label=new ht(P.NONE);for(var n=this.iterator();n.hasNext();)for(var o=n.next(),f=o.getEdge(),u=f.getLabel(),l=0;l<2;l++){var a=u.getLocation(l);(a===P.INTERIOR||a===P.BOUNDARY)&&i._label.setLocation(l,P.INTERIOR)}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Qt),da=function(s){function t(){s.apply(this,arguments)}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.createNode=function(r){return new In(r,new Qf)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(ms),ar=function s(){this._pts=null,this._orientation=null;var t=arguments[0];this._pts=t,this._orientation=s.orientation(t)};ar.prototype.compareTo=function(t){var e=t,r=ar.compareOriented(this._pts,this._orientation,e._pts,e._orientation);return r},ar.prototype.interfaces_=function(){return[Be]},ar.prototype.getClass=function(){return ar},ar.orientation=function(t){return $.increasingDirection(t)===1},ar.compareOriented=function(t,e,r,i){for(var n=e?1:-1,o=i?1:-1,f=e?t.length:-1,u=i?r.length:-1,l=e?0:t.length-1,a=i?0:r.length-1;;){var c=t[l].compareTo(r[a]);if(c!==0)return c;l+=n,a+=o;var p=l===f,d=a===u;if(p&&!d)return-1;if(!p&&d)return 1;if(p&&d)return 0}};var Qe=function(){this._edges=new k,this._ocaMap=new jt};Qe.prototype.print=function(t){var e=this;t.print("MULTILINESTRING ( ");for(var r=0;r<this._edges.size();r++){var i=e._edges.get(r);r>0&&t.print(","),t.print("(");for(var n=i.getCoordinates(),o=0;o<n.length;o++)o>0&&t.print(","),t.print(n[o].x+" "+n[o].y);t.println(")")}t.print(") ")},Qe.prototype.addAll=function(t){for(var e=this,r=t.iterator();r.hasNext();)e.add(r.next())},Qe.prototype.findEdgeIndex=function(t){for(var e=this,r=0;r<this._edges.size();r++)if(e._edges.get(r).equals(t))return r;return-1},Qe.prototype.iterator=function(){return this._edges.iterator()},Qe.prototype.getEdges=function(){return this._edges},Qe.prototype.get=function(t){return this._edges.get(t)},Qe.prototype.findEqualEdge=function(t){var e=new ar(t.getCoordinates()),r=this._ocaMap.get(e);return r},Qe.prototype.add=function(t){this._edges.add(t);var e=new ar(t.getCoordinates());this._ocaMap.put(e,t)},Qe.prototype.interfaces_=function(){return[]},Qe.prototype.getClass=function(){return Qe};var Lr=function(){};Lr.prototype.processIntersections=function(t,e,r,i){},Lr.prototype.isDone=function(){},Lr.prototype.interfaces_=function(){return[]},Lr.prototype.getClass=function(){return Lr};var Ne=function(){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;var t=arguments[0];this._li=t};Ne.prototype.isTrivialIntersection=function(t,e,r,i){if(t===r&&this._li.getIntersectionNum()===1){if(Ne.isAdjacentSegments(e,i))return!0;if(t.isClosed()){var n=t.size()-1;if(e===0&&i===n||i===0&&e===n)return!0}}return!1},Ne.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Ne.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Ne.prototype.getLineIntersector=function(){return this._li},Ne.prototype.hasProperIntersection=function(){return this._hasProper},Ne.prototype.processIntersections=function(t,e,r,i){if(t===r&&e===i)return null;this.numTests++;var n=t.getCoordinates()[e],o=t.getCoordinates()[e+1],f=r.getCoordinates()[i],u=r.getCoordinates()[i+1];this._li.computeIntersection(n,o,f,u),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(t,e,r,i)||(this._hasIntersection=!0,t.addIntersections(this._li,e,0),r.addIntersections(this._li,i,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},Ne.prototype.hasIntersection=function(){return this._hasIntersection},Ne.prototype.isDone=function(){return!1},Ne.prototype.hasInteriorIntersection=function(){return this._hasInterior},Ne.prototype.interfaces_=function(){return[Lr]},Ne.prototype.getClass=function(){return Ne},Ne.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var mi=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],r=arguments[2];this.coord=new A(t),this.segmentIndex=e,this.dist=r};mi.prototype.getSegmentIndex=function(){return this.segmentIndex},mi.prototype.getCoordinate=function(){return this.coord},mi.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)},mi.prototype.compareTo=function(t){var e=t;return this.compare(e.segmentIndex,e.dist)},mi.prototype.isEndPoint=function(t){return this.segmentIndex===0&&this.dist===0||this.segmentIndex===t},mi.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},mi.prototype.getDistance=function(){return this.dist},mi.prototype.compare=function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0},mi.prototype.interfaces_=function(){return[Be]},mi.prototype.getClass=function(){return mi};var Di=function(){this._nodeMap=new jt,this.edge=null;var t=arguments[0];this.edge=t};Di.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){var r=e.next();r.print(t)}},Di.prototype.iterator=function(){return this._nodeMap.values().iterator()},Di.prototype.addSplitEdges=function(t){var e=this;this.addEndpoints();for(var r=this.iterator(),i=r.next();r.hasNext();){var n=r.next(),o=e.createSplitEdge(i,n);t.add(o),i=n}},Di.prototype.addEndpoints=function(){var t=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[t],t,0)},Di.prototype.createSplitEdge=function(t,e){var r=this,i=e.segmentIndex-t.segmentIndex+2,n=this.edge.pts[e.segmentIndex],o=e.dist>0||!e.coord.equals2D(n);o||i--;var f=new Array(i).fill(null),u=0;f[u++]=new A(t.coord);for(var l=t.segmentIndex+1;l<=e.segmentIndex;l++)f[u++]=r.edge.pts[l];return o&&(f[u]=e.coord),new An(f,new ht(this.edge._label))},Di.prototype.add=function(t,e,r){var i=new mi(t,e,r),n=this._nodeMap.get(i);return n!==null?n:(this._nodeMap.put(i,i),i)},Di.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();){var r=e.next();if(r.coord.equals(t))return!0}return!1},Di.prototype.interfaces_=function(){return[]},Di.prototype.getClass=function(){return Di};var Ar=function(){};Ar.prototype.getChainStartIndices=function(t){var e=this,r=0,i=new k;i.add(new ni(r));do{var n=e.findChainEnd(t,r);i.add(new ni(n)),r=n}while(r<t.length-1);var o=Ar.toIntArray(i);return o},Ar.prototype.findChainEnd=function(t,e){for(var r=lt.quadrant(t[e],t[e+1]),i=e+1;i<t.length;){var n=lt.quadrant(t[i-1],t[i]);if(n!==r)break;i++}return i-1},Ar.prototype.interfaces_=function(){return[]},Ar.prototype.getClass=function(){return Ar},Ar.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),r=0;r<e.length;r++)e[r]=t.get(r).intValue();return e};var Ji=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new G,this.env2=new G;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new Ar;this.startIndex=e.getChainStartIndices(this.pts)};Ji.prototype.getCoordinates=function(){return this.pts},Ji.prototype.getMaxX=function(t){var e=this.pts[this.startIndex[t]].x,r=this.pts[this.startIndex[t+1]].x;return e>r?e:r},Ji.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,r=this.pts[this.startIndex[t+1]].x;return e<r?e:r},Ji.prototype.computeIntersectsForChain=function(){if(arguments.length===4){var t=arguments[0],e=arguments[1],r=arguments[2],i=arguments[3];this.computeIntersectsForChain(this.startIndex[t],this.startIndex[t+1],e,e.startIndex[r],e.startIndex[r+1],i)}else if(arguments.length===6){var n=arguments[0],o=arguments[1],f=arguments[2],u=arguments[3],l=arguments[4],a=arguments[5],c=this.pts[n],p=this.pts[o],d=f.pts[u],h=f.pts[l];if(o-n===1&&l-u===1)return a.addIntersections(this.e,n,f.e,u),null;if(this.env1.init(c,p),this.env2.init(d,h),!this.env1.intersects(this.env2))return null;var m=Math.trunc((n+o)/2),_=Math.trunc((u+l)/2);n<m&&(u<_&&this.computeIntersectsForChain(n,m,f,u,_,a),_<l&&this.computeIntersectsForChain(n,m,f,_,l,a)),m<o&&(u<_&&this.computeIntersectsForChain(m,o,f,u,_,a),_<l&&this.computeIntersectsForChain(m,o,f,_,l,a))}},Ji.prototype.getStartIndexes=function(){return this.startIndex},Ji.prototype.computeIntersects=function(t,e){for(var r=this,i=0;i<this.startIndex.length-1;i++)for(var n=0;n<t.startIndex.length-1;n++)r.computeIntersectsForChain(i,t,n,e)},Ji.prototype.interfaces_=function(){return[]},Ji.prototype.getClass=function(){return Ji};var zt=function s(){var t=this;this._depth=Array(2).fill().map(function(){return Array(3)});for(var e=0;e<2;e++)for(var r=0;r<3;r++)t._depth[e][r]=s.NULL_VALUE},ma={NULL_VALUE:{configurable:!0}};zt.prototype.getDepth=function(t,e){return this._depth[t][e]},zt.prototype.setDepth=function(t,e,r){this._depth[t][e]=r},zt.prototype.isNull=function(){var t=this;if(arguments.length===0){for(var e=0;e<2;e++)for(var r=0;r<3;r++)if(t._depth[e][r]!==zt.NULL_VALUE)return!1;return!0}else if(arguments.length===1){var i=arguments[0];return this._depth[i][1]===zt.NULL_VALUE}else if(arguments.length===2){var n=arguments[0],o=arguments[1];return this._depth[n][o]===zt.NULL_VALUE}},zt.prototype.normalize=function(){for(var t=this,e=0;e<2;e++)if(!t.isNull(e)){var r=t._depth[e][1];t._depth[e][2]<r&&(r=t._depth[e][2]),r<0&&(r=0);for(var i=1;i<3;i++){var n=0;t._depth[e][i]>r&&(n=1),t._depth[e][i]=n}}},zt.prototype.getDelta=function(t){return this._depth[t][F.RIGHT]-this._depth[t][F.LEFT]},zt.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?P.EXTERIOR:P.INTERIOR},zt.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},zt.prototype.add=function(){var t=this;if(arguments.length===1)for(var e=arguments[0],r=0;r<2;r++)for(var i=1;i<3;i++){var n=e.getLocation(r,i);(n===P.EXTERIOR||n===P.INTERIOR)&&(t.isNull(r,i)?t._depth[r][i]=zt.depthAtLocation(n):t._depth[r][i]+=zt.depthAtLocation(n))}else if(arguments.length===3){var o=arguments[0],f=arguments[1],u=arguments[2];u===P.INTERIOR&&this._depth[o][f]++}},zt.prototype.interfaces_=function(){return[]},zt.prototype.getClass=function(){return zt},zt.depthAtLocation=function(t){return t===P.EXTERIOR?0:t===P.INTERIOR?1:zt.NULL_VALUE},ma.NULL_VALUE.get=function(){return-1},Object.defineProperties(zt,ma);var An=function(s){function t(){if(s.call(this),this.pts=null,this._env=null,this.eiList=new Di(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new zt,this._depthDelta=0,arguments.length===1){var e=arguments[0];t.call(this,e,null)}else if(arguments.length===2){var r=arguments[0],i=arguments[1];this.pts=r,this._label=i}}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.getDepth=function(){return this._depth},t.prototype.getCollapsedEdge=function(){var r=new Array(2).fill(null);r[0]=this.pts[0],r[1]=this.pts[1];var i=new t(r,ht.toLineLabel(this._label));return i},t.prototype.isIsolated=function(){return this._isIsolated},t.prototype.getCoordinates=function(){return this.pts},t.prototype.setIsolated=function(r){this._isIsolated=r},t.prototype.setName=function(r){this._name=r},t.prototype.equals=function(r){var i=this;if(!(r instanceof t))return!1;var n=r;if(this.pts.length!==n.pts.length)return!1;for(var o=!0,f=!0,u=this.pts.length,l=0;l<this.pts.length;l++)if(i.pts[l].equals2D(n.pts[l])||(o=!1),i.pts[l].equals2D(n.pts[--u])||(f=!1),!o&&!f)return!1;return!0},t.prototype.getCoordinate=function(){if(arguments.length===0)return this.pts.length>0?this.pts[0]:null;if(arguments.length===1){var r=arguments[0];return this.pts[r]}},t.prototype.print=function(r){var i=this;r.print("edge "+this._name+": "),r.print("LINESTRING (");for(var n=0;n<this.pts.length;n++)n>0&&r.print(","),r.print(i.pts[n].x+" "+i.pts[n].y);r.print(") "+this._label+" "+this._depthDelta)},t.prototype.computeIM=function(r){t.updateIM(this._label,r)},t.prototype.isCollapsed=function(){return!this._label.isArea()||this.pts.length!==3?!1:!!this.pts[0].equals(this.pts[2])},t.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},t.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},t.prototype.getDepthDelta=function(){return this._depthDelta},t.prototype.getNumPoints=function(){return this.pts.length},t.prototype.printReverse=function(r){var i=this;r.print("edge "+this._name+": ");for(var n=this.pts.length-1;n>=0;n--)r.print(i.pts[n]+" ");r.println("")},t.prototype.getMonotoneChainEdge=function(){return this._mce===null&&(this._mce=new Ji(this)),this._mce},t.prototype.getEnvelope=function(){var r=this;if(this._env===null){this._env=new G;for(var i=0;i<this.pts.length;i++)r._env.expandToInclude(r.pts[i])}return this._env},t.prototype.addIntersection=function(r,i,n,o){var f=new A(r.getIntersection(o)),u=i,l=r.getEdgeDistance(n,o),a=u+1;if(a<this.pts.length){var c=this.pts[a];f.equals2D(c)&&(u=a,l=0)}this.eiList.add(f,u,l)},t.prototype.toString=function(){var r=this,i=new si;i.append("edge "+this._name+": "),i.append("LINESTRING (");for(var n=0;n<this.pts.length;n++)n>0&&i.append(","),i.append(r.pts[n].x+" "+r.pts[n].y);return i.append(") "+this._label+" "+this._depthDelta),i.toString()},t.prototype.isPointwiseEqual=function(r){var i=this;if(this.pts.length!==r.pts.length)return!1;for(var n=0;n<this.pts.length;n++)if(!i.pts[n].equals2D(r.pts[n]))return!1;return!0},t.prototype.setDepthDelta=function(r){this._depthDelta=r},t.prototype.getEdgeIntersectionList=function(){return this.eiList},t.prototype.addIntersections=function(r,i,n){for(var o=this,f=0;f<r.getIntersectionNum();f++)o.addIntersection(r,i,n,f)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.updateIM=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];i.setAtLeastIfValid(r.getLocation(0,F.ON),r.getLocation(1,F.ON),1),r.isArea()&&(i.setAtLeastIfValid(r.getLocation(0,F.LEFT),r.getLocation(1,F.LEFT),2),i.setAtLeastIfValid(r.getLocation(0,F.RIGHT),r.getLocation(1,F.RIGHT),2))}else return s.prototype.updateIM.apply(this,arguments)},t}(Ee),re=function(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new Qe,this._bufParams=t||null};re.prototype.setWorkingPrecisionModel=function(t){this._workingPrecisionModel=t},re.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(e!==null){var r=e.getLabel(),i=t.getLabel();e.isPointwiseEqual(t)||(i=new ht(t.getLabel()),i.flip()),r.merge(i);var n=re.depthDelta(i),o=e.getDepthDelta(),f=o+n;e.setDepthDelta(f)}else this._edgeList.add(t),t.setDepthDelta(re.depthDelta(t.getLabel()))},re.prototype.buildSubgraphs=function(t,e){for(var r=new k,i=t.iterator();i.hasNext();){var n=i.next(),o=n.getRightmostCoordinate(),f=new Ur(r),u=f.getDepth(o);n.computeDepth(u),n.findResultEdges(),r.add(n),e.add(n.getDirectedEdges(),n.getNodes())}},re.prototype.createSubgraphs=function(t){for(var e=new k,r=t.getNodes().iterator();r.hasNext();){var i=r.next();if(!i.isVisited()){var n=new ee;n.create(i),e.add(n)}}return Je.sort(e,Je.reverseOrder()),e},re.prototype.createEmptyResultGeometry=function(){var t=this._geomFact.createPolygon();return t},re.prototype.getNoder=function(t){if(this._workingNoder!==null)return this._workingNoder;var e=new lo,r=new vr;return r.setPrecisionModel(t),e.setSegmentIntersector(new Ne(r)),e},re.prototype.buffer=function(t,e){var r=this._workingPrecisionModel;r===null&&(r=t.getPrecisionModel()),this._geomFact=t.getFactory();var i=new pe(r,this._bufParams),n=new Ge(t,e,i),o=n.getCurves();if(o.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(o,r),this._graph=new _t(new da),this._graph.addEdges(this._edgeList.getEdges());var f=this.createSubgraphs(this._graph),u=new Ce(this._geomFact);this.buildSubgraphs(f,u);var l=u.getPolygons();if(l.size()<=0)return this.createEmptyResultGeometry();var a=this._geomFact.buildGeometry(l);return a},re.prototype.computeNodedEdges=function(t,e){var r=this,i=this.getNoder(e);i.computeNodes(t);for(var n=i.getNodedSubstrings(),o=n.iterator();o.hasNext();){var f=o.next(),u=f.getCoordinates();if(!(u.length===2&&u[0].equals2D(u[1]))){var l=f.getData(),a=new An(f.getCoordinates(),new ht(l));r.insertUniqueEdge(a)}}},re.prototype.setNoder=function(t){this._workingNoder=t},re.prototype.interfaces_=function(){return[]},re.prototype.getClass=function(){return re},re.depthDelta=function(t){var e=t.getLocation(0,F.LEFT),r=t.getLocation(0,F.RIGHT);return e===P.INTERIOR&&r===P.EXTERIOR?1:e===P.EXTERIOR&&r===P.INTERIOR?-1:0},re.convertSegStrings=function(t){for(var e=new tt,r=new k;t.hasNext();){var i=t.next(),n=e.createLineString(i.getCoordinates());r.add(n)}return e.buildGeometry(r)};var fr=function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,arguments.length===2){var t=arguments[0],e=arguments[1];this._noder=t,this._scaleFactor=e,this._offsetX=0,this._offsetY=0,this._isScaled=!this.isIntegerPrecision()}else if(arguments.length===4){var r=arguments[0],i=arguments[1],n=arguments[2],o=arguments[3];this._noder=r,this._scaleFactor=i,this._offsetX=n,this._offsetY=o,this._isScaled=!this.isIntegerPrecision()}};fr.prototype.rescale=function(){var t=this;if(H(arguments[0],Dt))for(var e=arguments[0],r=e.iterator();r.hasNext();){var i=r.next();t.rescale(i.getCoordinates())}else if(arguments[0]instanceof Array){for(var n=arguments[0],o=0;o<n.length;o++)n[o].x=n[o].x/t._scaleFactor+t._offsetX,n[o].y=n[o].y/t._scaleFactor+t._offsetY;n.length===2&&n[0].equals2D(n[1])&&Xt.out.println(n)}},fr.prototype.scale=function(){var t=this;if(H(arguments[0],Dt)){for(var e=arguments[0],r=new k,i=e.iterator();i.hasNext();){var n=i.next();r.add(new At(t.scale(n.getCoordinates()),n.getData()))}return r}else if(arguments[0]instanceof Array){for(var o=arguments[0],f=new Array(o.length).fill(null),u=0;u<o.length;u++)f[u]=new A(Math.round((o[u].x-t._offsetX)*t._scaleFactor),Math.round((o[u].y-t._offsetY)*t._scaleFactor),o[u].z);var l=$.removeRepeatedPoints(f);return l}},fr.prototype.isIntegerPrecision=function(){return this._scaleFactor===1},fr.prototype.getNodedSubstrings=function(){var t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t},fr.prototype.computeNodes=function(t){var e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)},fr.prototype.interfaces_=function(){return[Tr]},fr.prototype.getClass=function(){return fr};var yi=function(){this._li=new vr,this._segStrings=null;var t=arguments[0];this._segStrings=t},ya={fact:{configurable:!0}};yi.prototype.checkEndPtVertexIntersections=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();){var r=e.next(),i=r.getCoordinates();t.checkEndPtVertexIntersections(i[0],t._segStrings),t.checkEndPtVertexIntersections(i[i.length-1],t._segStrings)}else if(arguments.length===2){for(var n=arguments[0],o=arguments[1],f=o.iterator();f.hasNext();)for(var u=f.next(),l=u.getCoordinates(),a=1;a<l.length-1;a++)if(l[a].equals(n))throw new Xi("found endpt/interior pt intersection at index "+a+" :pt "+n)}},yi.prototype.checkInteriorIntersections=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();)for(var r=e.next(),i=this._segStrings.iterator();i.hasNext();){var n=i.next();t.checkInteriorIntersections(r,n)}else if(arguments.length===2)for(var o=arguments[0],f=arguments[1],u=o.getCoordinates(),l=f.getCoordinates(),a=0;a<u.length-1;a++)for(var c=0;c<l.length-1;c++)t.checkInteriorIntersections(o,a,f,c);else if(arguments.length===4){var p=arguments[0],d=arguments[1],h=arguments[2],m=arguments[3];if(p===h&&d===m)return null;var _=p.getCoordinates()[d],W=p.getCoordinates()[d+1],C=h.getCoordinates()[m],T=h.getCoordinates()[m+1];if(this._li.computeIntersection(_,W,C,T),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,_,W)||this.hasInteriorIntersection(this._li,C,T)))throw new Xi("found non-noded intersection at "+_+"-"+W+" and "+C+"-"+T)}},yi.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},yi.prototype.checkCollapses=function(){var t=this;if(arguments.length===0)for(var e=this._segStrings.iterator();e.hasNext();){var r=e.next();t.checkCollapses(r)}else if(arguments.length===1)for(var i=arguments[0],n=i.getCoordinates(),o=0;o<n.length-2;o++)t.checkCollapse(n[o],n[o+1],n[o+2])},yi.prototype.hasInteriorIntersection=function(t,e,r){for(var i=0;i<t.getIntersectionNum();i++){var n=t.getIntersection(i);if(!(n.equals(e)||n.equals(r)))return!0}return!1},yi.prototype.checkCollapse=function(t,e,r){if(t.equals(r))throw new Xi("found non-noded collapse at "+yi.fact.createLineString([t,e,r]))},yi.prototype.interfaces_=function(){return[]},yi.prototype.getClass=function(){return yi},ya.fact.get=function(){return new tt},Object.defineProperties(yi,ya);var ge=function(){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._maxx=null,this._miny=null,this._maxy=null,this._corner=new Array(4).fill(null),this._safeEnv=null;var t=arguments[0],e=arguments[1],r=arguments[2];if(this._originalPt=t,this._pt=t,this._scaleFactor=e,this._li=r,e<=0)throw new yt("Scale factor must be non-zero");e!==1&&(this._pt=new A(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new A,this._p1Scaled=new A),this.initCorners(this._pt)},va={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};ge.prototype.intersectsScaled=function(t,e){var r=Math.min(t.x,e.x),i=Math.max(t.x,e.x),n=Math.min(t.y,e.y),o=Math.max(t.y,e.y),f=this._maxx<r||this._minx>i||this._maxy<n||this._miny>o;if(f)return!1;var u=this.intersectsToleranceSquare(t,e);return Q.isTrue(!(f&&u),"Found bad envelope test"),u},ge.prototype.initCorners=function(t){var e=.5;this._minx=t.x-e,this._maxx=t.x+e,this._miny=t.y-e,this._maxy=t.y+e,this._corner[0]=new A(this._maxx,this._maxy),this._corner[1]=new A(this._minx,this._maxy),this._corner[2]=new A(this._minx,this._miny),this._corner[3]=new A(this._maxx,this._miny)},ge.prototype.intersects=function(t,e){return this._scaleFactor===1?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},ge.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},ge.prototype.getCoordinate=function(){return this._originalPt},ge.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},ge.prototype.getSafeEnvelope=function(){if(this._safeEnv===null){var t=ge.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new G(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},ge.prototype.intersectsPixelClosure=function(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()))},ge.prototype.intersectsToleranceSquare=function(t,e){var r=!1,i=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.isProper()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.isProper())||(this._li.hasIntersection()&&(r=!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())||r&&i||t.equals(this._pt)||e.equals(this._pt))},ge.prototype.addSnappedNode=function(t,e){var r=t.getCoordinate(e),i=t.getCoordinate(e+1);return this.intersects(r,i)?(t.addIntersection(this.getCoordinate(),e),!0):!1},ge.prototype.interfaces_=function(){return[]},ge.prototype.getClass=function(){return ge},va.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75},Object.defineProperties(ge,va);var Ks=function(){this.tempEnv1=new G,this.selectedSegment=new z};Ks.prototype.select=function(){if(arguments.length!==1){if(arguments.length===2){var t=arguments[0],e=arguments[1];t.getLineSegment(e,this.selectedSegment),this.select(this.selectedSegment)}}},Ks.prototype.interfaces_=function(){return[]},Ks.prototype.getClass=function(){return Ks};var Cs=function(){this._index=null;var t=arguments[0];this._index=t},_a={HotPixelSnapAction:{configurable:!0}};Cs.prototype.snap=function(){if(arguments.length===1){var t=arguments[0];return this.snap(t,null,-1)}else if(arguments.length===3){var e=arguments[0],r=arguments[1],i=arguments[2],n=e.getSafeEnvelope(),o=new Ca(e,r,i);return this._index.query(n,{interfaces_:function(){return[nr]},visitItem:function(f){var u=f;u.select(n,o)}}),o.isNodeAdded()}},Cs.prototype.interfaces_=function(){return[]},Cs.prototype.getClass=function(){return Cs},_a.HotPixelSnapAction.get=function(){return Ca},Object.defineProperties(Cs,_a);var Ca=function(s){function t(){s.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var e=arguments[0],r=arguments[1],i=arguments[2];this._hotPixel=e,this._parentEdge=r,this._hotPixelVertexIndex=i}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.isNodeAdded=function(){return this._isNodeAdded},t.prototype.select=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1],n=r.getContext();if(this._parentEdge!==null&&n===this._parentEdge&&i===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(n,i)}else return s.prototype.select.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Ks),qr=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new k};qr.prototype.processIntersections=function(t,e,r,i){var n=this;if(t===r&&e===i)return null;var o=t.getCoordinates()[e],f=t.getCoordinates()[e+1],u=r.getCoordinates()[i],l=r.getCoordinates()[i+1];if(this._li.computeIntersection(o,f,u,l),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var a=0;a<this._li.getIntersectionNum();a++)n._interiorIntersections.add(n._li.getIntersection(a));t.addIntersections(this._li,e,0),r.addIntersections(this._li,i,1)}},qr.prototype.isDone=function(){return!1},qr.prototype.getInteriorIntersections=function(){return this._interiorIntersections},qr.prototype.interfaces_=function(){return[Lr]},qr.prototype.getClass=function(){return qr};var bi=function(){this._pm=null,this._li=null,this._scaleFactor=null,this._noder=null,this._pointSnapper=null,this._nodedSegStrings=null;var t=arguments[0];this._pm=t,this._li=new vr,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()};bi.prototype.checkCorrectness=function(t){var e=At.getNodedSubstrings(t),r=new yi(e);try{r.checkValid()}catch(i){if(i instanceof $o)i.printStackTrace();else throw i}finally{}},bi.prototype.getNodedSubstrings=function(){return At.getNodedSubstrings(this._nodedSegStrings)},bi.prototype.snapRound=function(t,e){var r=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(r),this.computeVertexSnaps(t)},bi.prototype.findInteriorIntersections=function(t,e){var r=new qr(e);return this._noder.setSegmentIntersector(r),this._noder.computeNodes(t),r.getInteriorIntersections()},bi.prototype.computeVertexSnaps=function(){var t=this;if(H(arguments[0],Dt))for(var e=arguments[0],r=e.iterator();r.hasNext();){var i=r.next();t.computeVertexSnaps(i)}else if(arguments[0]instanceof At)for(var n=arguments[0],o=n.getCoordinates(),f=0;f<o.length;f++){var u=new ge(o[f],t._scaleFactor,t._li),l=t._pointSnapper.snap(u,n,f);l&&n.addIntersection(o[f],f)}},bi.prototype.computeNodes=function(t){this._nodedSegStrings=t,this._noder=new lo,this._pointSnapper=new Cs(this._noder.getIndex()),this.snapRound(t,this._li)},bi.prototype.computeIntersectionSnaps=function(t){for(var e=this,r=t.iterator();r.hasNext();){var i=r.next(),n=new ge(i,e._scaleFactor,e._li);e._pointSnapper.snap(n)}},bi.prototype.interfaces_=function(){return[Tr]},bi.prototype.getClass=function(){return bi};var Yt=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new at,this._resultGeometry=null,this._saveException=null,arguments.length===1){var t=arguments[0];this._argGeom=t}else if(arguments.length===2){var e=arguments[0],r=arguments[1];this._argGeom=e,this._bufParams=r}},Ws={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};Yt.prototype.bufferFixedPrecision=function(t){var e=new fr(new bi(new ot(1)),t.getScale()),r=new re(this._bufParams);r.setWorkingPrecisionModel(t),r.setNoder(e),this._resultGeometry=r.buffer(this._argGeom,this._distance)},Yt.prototype.bufferReducedPrecision=function(){var t=this;if(arguments.length===0){for(var e=Yt.MAX_PRECISION_DIGITS;e>=0;e--){try{t.bufferReducedPrecision(e)}catch(o){if(o instanceof Zi)t._saveException=o;else throw o}finally{}if(t._resultGeometry!==null)return null}throw this._saveException}else if(arguments.length===1){var r=arguments[0],i=Yt.precisionScaleFactor(this._argGeom,this._distance,r),n=new ot(i);this.bufferFixedPrecision(n)}},Yt.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===ot.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},Yt.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},Yt.prototype.bufferOriginalPrecision=function(){try{var t=new re(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(e){if(e instanceof Xi)this._saveException=e;else throw e}finally{}},Yt.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},Yt.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},Yt.prototype.interfaces_=function(){return[]},Yt.prototype.getClass=function(){return Yt},Yt.bufferOp=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],r=new Yt(t),i=r.getResultGeometry(e);return i}else if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof U&&typeof arguments[1]=="number"){var n=arguments[0],o=arguments[1],f=arguments[2],u=new Yt(n);u.setQuadrantSegments(f);var l=u.getResultGeometry(o);return l}else if(arguments[2]instanceof at&&arguments[0]instanceof U&&typeof arguments[1]=="number"){var a=arguments[0],c=arguments[1],p=arguments[2],d=new Yt(a,p),h=d.getResultGeometry(c);return h}}else if(arguments.length===4){var m=arguments[0],_=arguments[1],W=arguments[2],C=arguments[3],T=new Yt(m);T.setQuadrantSegments(W),T.setEndCapStyle(C);var L=T.getResultGeometry(_);return L}},Yt.precisionScaleFactor=function(t,e,r){var i=t.getEnvelopeInternal(),n=we.max(Math.abs(i.getMaxX()),Math.abs(i.getMaxY()),Math.abs(i.getMinX()),Math.abs(i.getMinY())),o=e>0?e:0,f=n+2*o,u=Math.trunc(Math.log(f)/Math.log(10)+1),l=r-u,a=Math.pow(10,l);return a},Ws.CAP_ROUND.get=function(){return at.CAP_ROUND},Ws.CAP_BUTT.get=function(){return at.CAP_FLAT},Ws.CAP_FLAT.get=function(){return at.CAP_FLAT},Ws.CAP_SQUARE.get=function(){return at.CAP_SQUARE},Ws.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(Yt,Ws);var se=function(){this._pt=[new A,new A],this._distance=j.NaN,this._isNull=!0};se.prototype.getCoordinates=function(){return this._pt},se.prototype.getCoordinate=function(t){return this._pt[t]},se.prototype.setMinimum=function(){if(arguments.length===1){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],r=arguments[1];if(this._isNull)return this.initialize(e,r),null;var i=e.distance(r);i<this._distance&&this.initialize(e,r,i)}},se.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(arguments.length===3){var r=arguments[0],i=arguments[1],n=arguments[2];this._pt[0].setCoordinate(r),this._pt[1].setCoordinate(i),this._distance=n,this._isNull=!1}},se.prototype.getDistance=function(){return this._distance},se.prototype.setMaximum=function(){if(arguments.length===1){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],r=arguments[1];if(this._isNull)return this.initialize(e,r),null;var i=e.distance(r);i>this._distance&&this.initialize(e,r,i)}},se.prototype.interfaces_=function(){return[]},se.prototype.getClass=function(){return se};var Ri=function(){};Ri.prototype.interfaces_=function(){return[]},Ri.prototype.getClass=function(){return Ri},Ri.computeDistance=function(){if(arguments[2]instanceof se&&arguments[0]instanceof Ct&&arguments[1]instanceof A)for(var t=arguments[0],e=arguments[1],r=arguments[2],i=t.getCoordinates(),n=new z,o=0;o<i.length-1;o++){n.setCoordinates(i[o],i[o+1]);var f=n.closestPoint(e);r.setMinimum(f,e)}else if(arguments[2]instanceof se&&arguments[0]instanceof bt&&arguments[1]instanceof A){var u=arguments[0],l=arguments[1],a=arguments[2];Ri.computeDistance(u.getExteriorRing(),l,a);for(var c=0;c<u.getNumInteriorRing();c++)Ri.computeDistance(u.getInteriorRingN(c),l,a)}else if(arguments[2]instanceof se&&arguments[0]instanceof U&&arguments[1]instanceof A){var p=arguments[0],d=arguments[1],h=arguments[2];if(p instanceof Ct)Ri.computeDistance(p,d,h);else if(p instanceof bt)Ri.computeDistance(p,d,h);else if(p instanceof te)for(var m=p,_=0;_<m.getNumGeometries();_++){var W=m.getGeometryN(_);Ri.computeDistance(W,d,h)}else h.setMinimum(p.getCoordinate(),d)}else if(arguments[2]instanceof se&&arguments[0]instanceof z&&arguments[1]instanceof A){var C=arguments[0],T=arguments[1],L=arguments[2],w=C.closestPoint(T);L.setMinimum(w,T)}};var wr=function(t){this._maxPtDist=new se,this._inputGeom=t||null},co={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};wr.prototype.computeMaxMidpointDistance=function(t){var e=new ur(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},wr.prototype.computeMaxVertexDistance=function(t){var e=new Hr(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},wr.prototype.findDistance=function(t){return this.computeMaxVertexDistance(t),this.computeMaxMidpointDistance(t),this._maxPtDist.getDistance()},wr.prototype.getDistancePoints=function(){return this._maxPtDist},wr.prototype.interfaces_=function(){return[]},wr.prototype.getClass=function(){return wr},co.MaxPointDistanceFilter.get=function(){return Hr},co.MaxMidpointDistanceFilter.get=function(){return ur},Object.defineProperties(wr,co);var Hr=function(t){this._maxPtDist=new se,this._minPtDist=new se,this._geom=t||null};Hr.prototype.filter=function(t){this._minPtDist.initialize(),Ri.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Hr.prototype.getMaxPointDistance=function(){return this._maxPtDist},Hr.prototype.interfaces_=function(){return[Ai]},Hr.prototype.getClass=function(){return Hr};var ur=function(t){this._maxPtDist=new se,this._minPtDist=new se,this._geom=t||null};ur.prototype.filter=function(t,e){if(e===0)return null;var r=t.getCoordinate(e-1),i=t.getCoordinate(e),n=new A((r.x+i.x)/2,(r.y+i.y)/2);this._minPtDist.initialize(),Ri.computeDistance(this._geom,n,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},ur.prototype.isDone=function(){return!1},ur.prototype.isGeometryChanged=function(){return!1},ur.prototype.getMaxPointDistance=function(){return this._maxPtDist},ur.prototype.interfaces_=function(){return[Ke]},ur.prototype.getClass=function(){return ur};var Qi=function(t){this._comps=t||null};Qi.prototype.filter=function(t){t instanceof bt&&this._comps.add(t)},Qi.prototype.interfaces_=function(){return[ui]},Qi.prototype.getClass=function(){return Qi},Qi.getPolygons=function(){if(arguments.length===1){var t=arguments[0];return Qi.getPolygons(t,new k)}else if(arguments.length===2){var e=arguments[0],r=arguments[1];return e instanceof bt?r.add(e):e instanceof te&&e.apply(new Qi(r)),r}};var Ut=function(){if(this._lines=null,this._isForcedToLineString=!1,arguments.length===1){var t=arguments[0];this._lines=t}else if(arguments.length===2){var e=arguments[0],r=arguments[1];this._lines=e,this._isForcedToLineString=r}};Ut.prototype.filter=function(t){if(this._isForcedToLineString&&t instanceof wi){var e=t.getFactory().createLineString(t.getCoordinateSequence());return this._lines.add(e),null}t instanceof Ct&&this._lines.add(t)},Ut.prototype.setForceToLineString=function(t){this._isForcedToLineString=t},Ut.prototype.interfaces_=function(){return[zi]},Ut.prototype.getClass=function(){return Ut},Ut.getGeometry=function(){if(arguments.length===1){var t=arguments[0];return t.getFactory().buildGeometry(Ut.getLines(t))}else if(arguments.length===2){var e=arguments[0],r=arguments[1];return e.getFactory().buildGeometry(Ut.getLines(e,r))}},Ut.getLines=function(){if(arguments.length===1){var t=arguments[0];return Ut.getLines(t,!1)}else if(arguments.length===2){if(H(arguments[0],Dt)&&H(arguments[1],Dt)){for(var e=arguments[0],r=arguments[1],i=e.iterator();i.hasNext();){var n=i.next();Ut.getLines(n,r)}return r}else if(arguments[0]instanceof U&&typeof arguments[1]=="boolean"){var o=arguments[0],f=arguments[1],u=new k;return o.apply(new Ut(u,f)),u}else if(arguments[0]instanceof U&&H(arguments[1],Dt)){var l=arguments[0],a=arguments[1];return l instanceof Ct?a.add(l):l.apply(new Ut(a)),a}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&H(arguments[0],Dt)&&H(arguments[1],Dt)){for(var c=arguments[0],p=arguments[1],d=arguments[2],h=c.iterator();h.hasNext();){var m=h.next();Ut.getLines(m,p,d)}return p}else if(typeof arguments[2]=="boolean"&&arguments[0]instanceof U&&H(arguments[1],Dt)){var _=arguments[0],W=arguments[1],C=arguments[2];return _.apply(new Ut(W,C)),W}}};var $e=function(){if(this._boundaryRule=Fe.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,arguments.length!==0){if(arguments.length===1){var t=arguments[0];if(t===null)throw new yt("Rule must be non-null");this._boundaryRule=t}}};$e.prototype.locateInternal=function(){var t=this;if(arguments[0]instanceof A&&arguments[1]instanceof bt){var e=arguments[0],r=arguments[1];if(r.isEmpty())return P.EXTERIOR;var i=r.getExteriorRing(),n=this.locateInPolygonRing(e,i);if(n===P.EXTERIOR)return P.EXTERIOR;if(n===P.BOUNDARY)return P.BOUNDARY;for(var o=0;o<r.getNumInteriorRing();o++){var f=r.getInteriorRingN(o),u=t.locateInPolygonRing(e,f);if(u===P.INTERIOR)return P.EXTERIOR;if(u===P.BOUNDARY)return P.BOUNDARY}return P.INTERIOR}else if(arguments[0]instanceof A&&arguments[1]instanceof Ct){var l=arguments[0],a=arguments[1];if(!a.getEnvelopeInternal().intersects(l))return P.EXTERIOR;var c=a.getCoordinates();return!a.isClosed()&&(l.equals(c[0])||l.equals(c[c.length-1]))?P.BOUNDARY:V.isOnLine(l,c)?P.INTERIOR:P.EXTERIOR}else if(arguments[0]instanceof A&&arguments[1]instanceof _e){var p=arguments[0],d=arguments[1],h=d.getCoordinate();return h.equals2D(p)?P.INTERIOR:P.EXTERIOR}},$e.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?V.locatePointInRing(t,e.getCoordinates()):P.EXTERIOR},$e.prototype.intersects=function(t,e){return this.locate(t,e)!==P.EXTERIOR},$e.prototype.updateLocationInfo=function(t){t===P.INTERIOR&&(this._isIn=!0),t===P.BOUNDARY&&this._numBoundaries++},$e.prototype.computeLocation=function(t,e){var r=this;if(e instanceof _e&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof Ct)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof bt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Wr)for(var i=e,n=0;n<i.getNumGeometries();n++){var o=i.getGeometryN(n);r.updateLocationInfo(r.locateInternal(t,o))}else if(e instanceof Ei)for(var f=e,u=0;u<f.getNumGeometries();u++){var l=f.getGeometryN(u);r.updateLocationInfo(r.locateInternal(t,l))}else if(e instanceof te)for(var a=new Ni(e);a.hasNext();){var c=a.next();c!==e&&r.computeLocation(t,c)}},$e.prototype.locate=function(t,e){return e.isEmpty()?P.EXTERIOR:e instanceof Ct?this.locateInternal(t,e):e instanceof bt?this.locateInternal(t,e):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(t,e),this._boundaryRule.isInBoundary(this._numBoundaries)?P.BOUNDARY:this._numBoundaries>0||this._isIn?P.INTERIOR:P.EXTERIOR)},$e.prototype.interfaces_=function(){return[]},$e.prototype.getClass=function(){return $e};var ne=function s(){if(this._component=null,this._segIndex=null,this._pt=null,arguments.length===2){var t=arguments[0],e=arguments[1];s.call(this,t,s.INSIDE_AREA,e)}else if(arguments.length===3){var r=arguments[0],i=arguments[1],n=arguments[2];this._component=r,this._segIndex=i,this._pt=n}},Wa={INSIDE_AREA:{configurable:!0}};ne.prototype.isInsideArea=function(){return this._segIndex===ne.INSIDE_AREA},ne.prototype.getCoordinate=function(){return this._pt},ne.prototype.getGeometryComponent=function(){return this._component},ne.prototype.getSegmentIndex=function(){return this._segIndex},ne.prototype.interfaces_=function(){return[]},ne.prototype.getClass=function(){return ne},Wa.INSIDE_AREA.get=function(){return-1},Object.defineProperties(ne,Wa);var hr=function(t){this._pts=t||null};hr.prototype.filter=function(t){t instanceof _e&&this._pts.add(t)},hr.prototype.interfaces_=function(){return[ui]},hr.prototype.getClass=function(){return hr},hr.getPoints=function(){if(arguments.length===1){var t=arguments[0];return t instanceof _e?Je.singletonList(t):hr.getPoints(t,new k)}else if(arguments.length===2){var e=arguments[0],r=arguments[1];return e instanceof _e?r.add(e):e instanceof te&&e.apply(new hr(r)),r}};var Zr=function(){this._locations=null;var t=arguments[0];this._locations=t};Zr.prototype.filter=function(t){(t instanceof _e||t instanceof Ct||t instanceof bt)&&this._locations.add(new ne(t,0,t.getCoordinate()))},Zr.prototype.interfaces_=function(){return[ui]},Zr.prototype.getClass=function(){return Zr},Zr.getLocations=function(t){var e=new k;return t.apply(new Zr(e)),e};var qt=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new $e,this._minDistanceLocation=null,this._minDistance=j.MAX_VALUE,arguments.length===2){var t=arguments[0],e=arguments[1];this._geom=[t,e],this._terminateDistance=0}else if(arguments.length===3){var r=arguments[0],i=arguments[1],n=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=r,this._geom[1]=i,this._terminateDistance=n}};qt.prototype.computeContainmentDistance=function(){var t=this;if(arguments.length===0){var e=new Array(2).fill(null);if(this.computeContainmentDistance(0,e),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,e)}else if(arguments.length===2){var r=arguments[0],i=arguments[1],n=1-r,o=Qi.getPolygons(this._geom[r]);if(o.size()>0){var f=Zr.getLocations(this._geom[n]);if(this.computeContainmentDistance(f,o,i),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[n]=i[0],this._minDistanceLocation[r]=i[1],null}}else if(arguments.length===3){if(arguments[2]instanceof Array&&H(arguments[0],He)&&H(arguments[1],He)){for(var u=arguments[0],l=arguments[1],a=arguments[2],c=0;c<u.size();c++)for(var p=u.get(c),d=0;d<l.size();d++)if(t.computeContainmentDistance(p,l.get(d),a),t._minDistance<=t._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof ne&&arguments[1]instanceof bt){var h=arguments[0],m=arguments[1],_=arguments[2],W=h.getCoordinate();if(P.EXTERIOR!==this._ptLocator.locate(W,m))return this._minDistance=0,_[0]=h,_[1]=new ne(m,W),null}}},qt.prototype.computeMinDistanceLinesPoints=function(t,e,r){for(var i=this,n=0;n<t.size();n++)for(var o=t.get(n),f=0;f<e.size();f++){var u=e.get(f);if(i.computeMinDistance(o,u,r),i._minDistance<=i._terminateDistance)return null}},qt.prototype.computeFacetDistance=function(){var t=new Array(2).fill(null),e=Ut.getLines(this._geom[0]),r=Ut.getLines(this._geom[1]),i=hr.getPoints(this._geom[0]),n=hr.getPoints(this._geom[1]);if(this.computeMinDistanceLines(e,r,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance||(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(e,n,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance)||(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(r,i,t),this.updateMinDistance(t,!0),this._minDistance<=this._terminateDistance))return null;t[0]=null,t[1]=null,this.computeMinDistancePoints(i,n,t),this.updateMinDistance(t,!1)},qt.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},qt.prototype.updateMinDistance=function(t,e){if(t[0]===null)return null;e?(this._minDistanceLocation[0]=t[1],this._minDistanceLocation[1]=t[0]):(this._minDistanceLocation[0]=t[0],this._minDistanceLocation[1]=t[1])},qt.prototype.nearestPoints=function(){this.computeMinDistance();var t=[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()];return t},qt.prototype.computeMinDistance=function(){var t=this;if(arguments.length===0){if(this._minDistanceLocation!==null||(this._minDistanceLocation=new Array(2).fill(null),this.computeContainmentDistance(),this._minDistance<=this._terminateDistance))return null;this.computeFacetDistance()}else if(arguments.length===3){if(arguments[2]instanceof Array&&arguments[0]instanceof Ct&&arguments[1]instanceof _e){var e=arguments[0],r=arguments[1],i=arguments[2];if(e.getEnvelopeInternal().distance(r.getEnvelopeInternal())>this._minDistance)return null;for(var n=e.getCoordinates(),o=r.getCoordinate(),f=0;f<n.length-1;f++){var u=V.distancePointLine(o,n[f],n[f+1]);if(u<t._minDistance){t._minDistance=u;var l=new z(n[f],n[f+1]),a=l.closestPoint(o);i[0]=new ne(e,f,a),i[1]=new ne(r,0,o)}if(t._minDistance<=t._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof Ct&&arguments[1]instanceof Ct){var c=arguments[0],p=arguments[1],d=arguments[2];if(c.getEnvelopeInternal().distance(p.getEnvelopeInternal())>this._minDistance)return null;for(var h=c.getCoordinates(),m=p.getCoordinates(),_=0;_<h.length-1;_++)for(var W=0;W<m.length-1;W++){var C=V.distanceLineLine(h[_],h[_+1],m[W],m[W+1]);if(C<t._minDistance){t._minDistance=C;var T=new z(h[_],h[_+1]),L=new z(m[W],m[W+1]),w=T.closestPoints(L);d[0]=new ne(c,_,w[0]),d[1]=new ne(p,W,w[1])}if(t._minDistance<=t._terminateDistance)return null}}}},qt.prototype.computeMinDistancePoints=function(t,e,r){for(var i=this,n=0;n<t.size();n++)for(var o=t.get(n),f=0;f<e.size();f++){var u=e.get(f),l=o.getCoordinate().distance(u.getCoordinate());if(l<i._minDistance&&(i._minDistance=l,r[0]=new ne(o,0,o.getCoordinate()),r[1]=new ne(u,0,u.getCoordinate())),i._minDistance<=i._terminateDistance)return null}},qt.prototype.distance=function(){if(this._geom[0]===null||this._geom[1]===null)throw new yt("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},qt.prototype.computeMinDistanceLines=function(t,e,r){for(var i=this,n=0;n<t.size();n++)for(var o=t.get(n),f=0;f<e.size();f++){var u=e.get(f);if(i.computeMinDistance(o,u,r),i._minDistance<=i._terminateDistance)return null}},qt.prototype.interfaces_=function(){return[]},qt.prototype.getClass=function(){return qt},qt.distance=function(t,e){var r=new qt(t,e);return r.distance()},qt.isWithinDistance=function(t,e,r){var i=new qt(t,e,r);return i.distance()<=r},qt.nearestPoints=function(t,e){var r=new qt(t,e);return r.nearestPoints()};var $t=function(){this._pt=[new A,new A],this._distance=j.NaN,this._isNull=!0};$t.prototype.getCoordinates=function(){return this._pt},$t.prototype.getCoordinate=function(t){return this._pt[t]},$t.prototype.setMinimum=function(){if(arguments.length===1){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],r=arguments[1];if(this._isNull)return this.initialize(e,r),null;var i=e.distance(r);i<this._distance&&this.initialize(e,r,i)}},$t.prototype.initialize=function(){if(arguments.length===0)this._isNull=!0;else if(arguments.length===2){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(arguments.length===3){var r=arguments[0],i=arguments[1],n=arguments[2];this._pt[0].setCoordinate(r),this._pt[1].setCoordinate(i),this._distance=n,this._isNull=!1}},$t.prototype.toString=function(){return qe.toLineString(this._pt[0],this._pt[1])},$t.prototype.getDistance=function(){return this._distance},$t.prototype.setMaximum=function(){if(arguments.length===1){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(arguments.length===2){var e=arguments[0],r=arguments[1];if(this._isNull)return this.initialize(e,r),null;var i=e.distance(r);i>this._distance&&this.initialize(e,r,i)}},$t.prototype.interfaces_=function(){return[]},$t.prototype.getClass=function(){return $t};var vi=function(){};vi.prototype.interfaces_=function(){return[]},vi.prototype.getClass=function(){return vi},vi.computeDistance=function(){if(arguments[2]instanceof $t&&arguments[0]instanceof Ct&&arguments[1]instanceof A)for(var t=arguments[0],e=arguments[1],r=arguments[2],i=new z,n=t.getCoordinates(),o=0;o<n.length-1;o++){i.setCoordinates(n[o],n[o+1]);var f=i.closestPoint(e);r.setMinimum(f,e)}else if(arguments[2]instanceof $t&&arguments[0]instanceof bt&&arguments[1]instanceof A){var u=arguments[0],l=arguments[1],a=arguments[2];vi.computeDistance(u.getExteriorRing(),l,a);for(var c=0;c<u.getNumInteriorRing();c++)vi.computeDistance(u.getInteriorRingN(c),l,a)}else if(arguments[2]instanceof $t&&arguments[0]instanceof U&&arguments[1]instanceof A){var p=arguments[0],d=arguments[1],h=arguments[2];if(p instanceof Ct)vi.computeDistance(p,d,h);else if(p instanceof bt)vi.computeDistance(p,d,h);else if(p instanceof te)for(var m=p,_=0;_<m.getNumGeometries();_++){var W=m.getGeometryN(_);vi.computeDistance(W,d,h)}else h.setMinimum(p.getCoordinate(),d)}else if(arguments[2]instanceof $t&&arguments[0]instanceof z&&arguments[1]instanceof A){var C=arguments[0],T=arguments[1],L=arguments[2],w=C.closestPoint(T);L.setMinimum(w,T)}};var Xe=function(){this._g0=null,this._g1=null,this._ptDist=new $t,this._densifyFrac=0;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e},po={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};Xe.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},Xe.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new yt("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},Xe.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},Xe.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Xe.prototype.computeOrientedDistance=function(t,e,r){var i=new Kr(e);if(t.apply(i),r.setMaximum(i.getMaxPointDistance()),this._densifyFrac>0){var n=new lr(e,this._densifyFrac);t.apply(n),r.setMaximum(n.getMaxPointDistance())}},Xe.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Xe.prototype.interfaces_=function(){return[]},Xe.prototype.getClass=function(){return Xe},Xe.distance=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],r=new Xe(t,e);return r.distance()}else if(arguments.length===3){var i=arguments[0],n=arguments[1],o=arguments[2],f=new Xe(i,n);return f.setDensifyFraction(o),f.distance()}},po.MaxPointDistanceFilter.get=function(){return Kr},po.MaxDensifiedByFractionDistanceFilter.get=function(){return lr},Object.defineProperties(Xe,po);var Kr=function(){this._maxPtDist=new $t,this._minPtDist=new $t,this._euclideanDist=new vi,this._geom=null;var t=arguments[0];this._geom=t};Kr.prototype.filter=function(t){this._minPtDist.initialize(),vi.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Kr.prototype.getMaxPointDistance=function(){return this._maxPtDist},Kr.prototype.interfaces_=function(){return[Ai]},Kr.prototype.getClass=function(){return Kr};var lr=function(){this._maxPtDist=new $t,this._minPtDist=new $t,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};lr.prototype.filter=function(t,e){var r=this;if(e===0)return null;for(var i=t.getCoordinate(e-1),n=t.getCoordinate(e),o=(n.x-i.x)/this._numSubSegs,f=(n.y-i.y)/this._numSubSegs,u=0;u<this._numSubSegs;u++){var l=i.x+u*o,a=i.y+u*f,c=new A(l,a);r._minPtDist.initialize(),vi.computeDistance(r._geom,c,r._minPtDist),r._maxPtDist.setMaximum(r._minPtDist)}},lr.prototype.isDone=function(){return!1},lr.prototype.isGeometryChanged=function(){return!1},lr.prototype.getMaxPointDistance=function(){return this._maxPtDist},lr.prototype.interfaces_=function(){return[Ke]},lr.prototype.getClass=function(){return lr};var Te=function(t,e,r){this._minValidDistance=null,this._maxValidDistance=null,this._minDistanceFound=null,this._maxDistanceFound=null,this._isValid=!0,this._errMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._bufDistance=e||null,this._result=r||null},go={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};Te.prototype.checkMaximumDistance=function(t,e,r){var i=new Xe(e,t);if(i.setDensifyFraction(.25),this._maxDistanceFound=i.orientedDistance(),this._maxDistanceFound>r){this._isValid=!1;var n=i.getCoordinates();this._errorLocation=n[1],this._errorIndicator=t.getFactory().createLineString(n),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+qe.toLineString(n[0],n[1])+")"}},Te.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=Te.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,this._input.isEmpty()||this._result.isEmpty()?!0:(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),Te.VERBOSE&&Xt.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},Te.prototype.checkNegativeValid=function(){if(!(this._input instanceof bt||this._input instanceof Ei||this._input instanceof te))return null;var t=this.getPolygonLines(this._input);if(this.checkMinimumDistance(t,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(t,this._result,this._maxValidDistance)},Te.prototype.getErrorIndicator=function(){return this._errorIndicator},Te.prototype.checkMinimumDistance=function(t,e,r){var i=new qt(t,e,r);if(this._minDistanceFound=i.distance(),this._minDistanceFound<r){this._isValid=!1;var n=i.nearestPoints();this._errorLocation=i.nearestPoints()[1],this._errorIndicator=t.getFactory().createLineString(n),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+qe.toLineString(n[0],n[1])+" )"}},Te.prototype.checkPositiveValid=function(){var t=this._result.getBoundary();if(this.checkMinimumDistance(this._input,t,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(this._input,t,this._maxValidDistance)},Te.prototype.getErrorLocation=function(){return this._errorLocation},Te.prototype.getPolygonLines=function(t){for(var e=new k,r=new Ut(e),i=Qi.getPolygons(t),n=i.iterator();n.hasNext();){var o=n.next();o.apply(r)}return t.getFactory().buildGeometry(e)},Te.prototype.getErrorMessage=function(){return this._errMsg},Te.prototype.interfaces_=function(){return[]},Te.prototype.getClass=function(){return Te},go.VERBOSE.get=function(){return!1},go.MAX_DISTANCE_DIFF_FRAC.get=function(){return .012},Object.defineProperties(Te,go);var Ht=function(t,e,r){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._distance=e||null,this._result=r||null},mo={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};Ht.prototype.isValid=function(){return this.checkPolygonal(),this._isValid?(this.checkExpectedEmpty(),this._isValid?(this.checkEnvelope(),this._isValid?(this.checkArea(),this._isValid?(this.checkDistance(),this._isValid):this._isValid):this._isValid):this._isValid):this._isValid},Ht.prototype.checkEnvelope=function(){if(this._distance<0)return null;var t=this._distance*Ht.MAX_ENV_DIFF_FRAC;t===0&&(t=.001);var e=new G(this._input.getEnvelopeInternal());e.expandBy(this._distance);var r=new G(this._result.getEnvelopeInternal());r.expandBy(t),r.contains(e)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(r)),this.report("Envelope")},Ht.prototype.checkDistance=function(){var t=new Te(this._input,this._distance,this._result);t.isValid()||(this._isValid=!1,this._errorMsg=t.getErrorMessage(),this._errorLocation=t.getErrorLocation(),this._errorIndicator=t.getErrorIndicator()),this.report("Distance")},Ht.prototype.checkArea=function(){var t=this._input.getArea(),e=this._result.getArea();this._distance>0&&t>e&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&t<e&&(this._isValid=!1,this._errorMsg="Area of negative buffer is larger than input",this._errorIndicator=this._result),this.report("Area")},Ht.prototype.checkPolygonal=function(){this._result instanceof bt||this._result instanceof Ei||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},Ht.prototype.getErrorIndicator=function(){return this._errorIndicator},Ht.prototype.getErrorLocation=function(){return this._errorLocation},Ht.prototype.checkExpectedEmpty=function(){if(this._input.getDimension()>=2||this._distance>0)return null;this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),this.report("ExpectedEmpty")},Ht.prototype.report=function(t){if(!Ht.VERBOSE)return null;Xt.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},Ht.prototype.getErrorMessage=function(){return this._errorMsg},Ht.prototype.interfaces_=function(){return[]},Ht.prototype.getClass=function(){return Ht},Ht.isValidMsg=function(t,e,r){var i=new Ht(t,e,r);return i.isValid()?null:i.getErrorMessage()},Ht.isValid=function(t,e,r){var i=new Ht(t,e,r);return!!i.isValid()},mo.VERBOSE.get=function(){return!1},mo.MAX_ENV_DIFF_FRAC.get=function(){return .012},Object.defineProperties(Ht,mo);var _i=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};_i.prototype.getCoordinates=function(){return this._pts},_i.prototype.size=function(){return this._pts.length},_i.prototype.getCoordinate=function(t){return this._pts[t]},_i.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},_i.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:zr.octant(this.getCoordinate(t),this.getCoordinate(t+1))},_i.prototype.setData=function(t){this._data=t},_i.prototype.getData=function(){return this._data},_i.prototype.toString=function(){return qe.toLineString(new Lt(this._pts))},_i.prototype.interfaces_=function(){return[Si]},_i.prototype.getClass=function(){return _i};var Vt=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new k,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};Vt.prototype.getInteriorIntersection=function(){return this._interiorIntersection},Vt.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},Vt.prototype.getIntersectionSegments=function(){return this._intSegments},Vt.prototype.count=function(){return this._intersectionCount},Vt.prototype.getIntersections=function(){return this._intersections},Vt.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Vt.prototype.setKeepIntersections=function(t){this._keepIntersections=t},Vt.prototype.processIntersections=function(t,e,r,i){if(!this._findAllIntersections&&this.hasIntersection()||t===r&&e===i)return null;if(this._isCheckEndSegmentsOnly){var n=this.isEndSegment(t,e)||this.isEndSegment(r,i);if(!n)return null}var o=t.getCoordinates()[e],f=t.getCoordinates()[e+1],u=r.getCoordinates()[i],l=r.getCoordinates()[i+1];this._li.computeIntersection(o,f,u,l),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=o,this._intSegments[1]=f,this._intSegments[2]=u,this._intSegments[3]=l,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},Vt.prototype.isEndSegment=function(t,e){return e===0||e>=t.size()-2},Vt.prototype.hasIntersection=function(){return this._interiorIntersection!==null},Vt.prototype.isDone=function(){return this._findAllIntersections?!1:this._interiorIntersection!==null},Vt.prototype.interfaces_=function(){return[Lr]},Vt.prototype.getClass=function(){return Vt},Vt.createAllIntersectionsFinder=function(t){var e=new Vt(t);return e.setFindAllIntersections(!0),e},Vt.createAnyIntersectionFinder=function(t){return new Vt(t)},Vt.createIntersectionCounter=function(t){var e=new Vt(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var ti=function(){this._li=new vr,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};ti.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()},ti.prototype.getIntersections=function(){return this._segInt.getIntersections()},ti.prototype.isValid=function(){return this.execute(),this._isValid},ti.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},ti.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new Vt(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new lo;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},ti.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Zi(this.getErrorMessage(),this._segInt.getInteriorIntersection())},ti.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+qe.toLineString(t[0],t[1])+" and "+qe.toLineString(t[2],t[3])},ti.prototype.interfaces_=function(){return[]},ti.prototype.getClass=function(){return ti},ti.computeIntersections=function(t){var e=new ti(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var Er=function s(){this._nv=null;var t=arguments[0];this._nv=new ti(s.toSegmentStrings(t))};Er.prototype.checkValid=function(){this._nv.checkValid()},Er.prototype.interfaces_=function(){return[]},Er.prototype.getClass=function(){return Er},Er.toSegmentStrings=function(t){for(var e=new k,r=t.iterator();r.hasNext();){var i=r.next();e.add(new _i(i.getCoordinates(),i))}return e},Er.checkValid=function(t){var e=new Er(t);e.checkValid()};var jr=function(t){this._mapOp=t};jr.prototype.map=function(t){for(var e=this,r=new k,i=0;i<t.getNumGeometries();i++){var n=e._mapOp.map(t.getGeometryN(i));n.isEmpty()||r.add(n)}return t.getFactory().createGeometryCollection(tt.toGeometryArray(r))},jr.prototype.interfaces_=function(){return[]},jr.prototype.getClass=function(){return jr},jr.map=function(t,e){var r=new jr(e);return r.map(t)};var Ci=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new k,this._resultLineList=new k;var t=arguments[0],e=arguments[1],r=arguments[2];this._op=t,this._geometryFactory=e,this._ptLocator=r};Ci.prototype.collectLines=function(t){for(var e=this,r=this._op.getGraph().getEdgeEnds().iterator();r.hasNext();){var i=r.next();e.collectLineEdge(i,t,e._lineEdgesList),e.collectBoundaryTouchEdge(i,t,e._lineEdgesList)}},Ci.prototype.labelIsolatedLine=function(t,e){var r=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,r)},Ci.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList},Ci.prototype.collectLineEdge=function(t,e,r){var i=t.getLabel(),n=t.getEdge();t.isLineEdge()&&!t.isVisited()&&J.isResultOfOp(i,e)&&!n.isCovered()&&(r.add(n),t.setVisitedEdge(!0))},Ci.prototype.findCoveredLineEdges=function(){for(var t=this,e=this._op.getGraph().getNodes().iterator();e.hasNext();){var r=e.next();r.getEdges().findCoveredLineEdges()}for(var i=this._op.getGraph().getEdgeEnds().iterator();i.hasNext();){var n=i.next(),o=n.getEdge();if(n.isLineEdge()&&!o.isCoveredSet()){var f=t._op.isCoveredByA(n.getCoordinate());o.setCovered(f)}}},Ci.prototype.labelIsolatedLines=function(t){for(var e=this,r=t.iterator();r.hasNext();){var i=r.next(),n=i.getLabel();i.isIsolated()&&(n.isNull(0)?e.labelIsolatedLine(i,0):e.labelIsolatedLine(i,1))}},Ci.prototype.buildLines=function(t){for(var e=this,r=this._lineEdgesList.iterator();r.hasNext();){var i=r.next(),n=e._geometryFactory.createLineString(i.getCoordinates());e._resultLineList.add(n),i.setInResult(!0)}},Ci.prototype.collectBoundaryTouchEdge=function(t,e,r){var i=t.getLabel();if(t.isLineEdge()||t.isVisited()||t.isInteriorAreaEdge()||t.getEdge().isInResult())return null;Q.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),J.isResultOfOp(i,e)&&e===J.INTERSECTION&&(r.add(t.getEdge()),t.setVisitedEdge(!0))},Ci.prototype.interfaces_=function(){return[]},Ci.prototype.getClass=function(){return Ci};var Jr=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new k;var t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e};Jr.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var r=this._geometryFactory.createPoint(e);this._resultPointList.add(r)}},Jr.prototype.extractNonCoveredResultNodes=function(t){for(var e=this,r=this._op.getGraph().getNodes().iterator();r.hasNext();){var i=r.next();if(!i.isInResult()&&!i.isIncidentEdgeInResult()&&(i.getEdges().getDegree()===0||t===J.INTERSECTION)){var n=i.getLabel();J.isResultOfOp(n,t)&&e.filterCoveredNodeToPoint(i)}}},Jr.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},Jr.prototype.interfaces_=function(){return[]},Jr.prototype.getClass=function(){return Jr};var de=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};de.prototype.transformPoint=function(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},de.prototype.transformPolygon=function(t,e){var r=this,i=!0,n=this.transformLinearRing(t.getExteriorRing(),t);(n===null||!(n instanceof wi)||n.isEmpty())&&(i=!1);for(var o=new k,f=0;f<t.getNumInteriorRing();f++){var u=r.transformLinearRing(t.getInteriorRingN(f),t);u===null||u.isEmpty()||(u instanceof wi||(i=!1),o.add(u))}if(i)return this._factory.createPolygon(n,o.toArray([]));var l=new k;return n!==null&&l.add(n),l.addAll(o),this._factory.buildGeometry(l)},de.prototype.createCoordinateSequence=function(t){return this._factory.getCoordinateSequenceFactory().create(t)},de.prototype.getInputGeometry=function(){return this._inputGeom},de.prototype.transformMultiLineString=function(t,e){for(var r=this,i=new k,n=0;n<t.getNumGeometries();n++){var o=r.transformLineString(t.getGeometryN(n),t);o!==null&&(o.isEmpty()||i.add(o))}return this._factory.buildGeometry(i)},de.prototype.transformCoordinates=function(t,e){return this.copy(t)},de.prototype.transformLineString=function(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},de.prototype.transformMultiPoint=function(t,e){for(var r=this,i=new k,n=0;n<t.getNumGeometries();n++){var o=r.transformPoint(t.getGeometryN(n),t);o!==null&&(o.isEmpty()||i.add(o))}return this._factory.buildGeometry(i)},de.prototype.transformMultiPolygon=function(t,e){for(var r=this,i=new k,n=0;n<t.getNumGeometries();n++){var o=r.transformPolygon(t.getGeometryN(n),t);o!==null&&(o.isEmpty()||i.add(o))}return this._factory.buildGeometry(i)},de.prototype.copy=function(t){return t.copy()},de.prototype.transformGeometryCollection=function(t,e){for(var r=this,i=new k,n=0;n<t.getNumGeometries();n++){var o=r.transform(t.getGeometryN(n));o!==null&&(r._pruneEmptyGeometry&&o.isEmpty()||i.add(o))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(tt.toGeometryArray(i)):this._factory.buildGeometry(i)},de.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof _e)return this.transformPoint(t,null);if(t instanceof ds)return this.transformMultiPoint(t,null);if(t instanceof wi)return this.transformLinearRing(t,null);if(t instanceof Ct)return this.transformLineString(t,null);if(t instanceof Wr)return this.transformMultiLineString(t,null);if(t instanceof bt)return this.transformPolygon(t,null);if(t instanceof Ei)return this.transformMultiPolygon(t,null);if(t instanceof te)return this.transformGeometryCollection(t,null);throw new yt("Unknown Geometry subtype: "+t.getClass().getName())},de.prototype.transformLinearRing=function(t,e){var r=this.transformCoordinates(t.getCoordinateSequence(),t);if(r===null)return this._factory.createLinearRing(null);var i=r.size();return i>0&&i<4&&!this._preserveType?this._factory.createLineString(r):this._factory.createLinearRing(r)},de.prototype.interfaces_=function(){return[]},de.prototype.getClass=function(){return de};var Mi=function s(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new z,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof Ct&&typeof arguments[1]=="number"){var t=arguments[0],e=arguments[1];s.call(this,t.getCoordinates(),e)}else if(arguments[0]instanceof Array&&typeof arguments[1]=="number"){var r=arguments[0],i=arguments[1];this._srcPts=r,this._isClosed=s.isClosed(r),this._snapTolerance=i}};Mi.prototype.snapVertices=function(t,e){for(var r=this,i=this._isClosed?t.size()-1:t.size(),n=0;n<i;n++){var o=t.get(n),f=r.findSnapForVertex(o,e);f!==null&&(t.set(n,new A(f)),n===0&&r._isClosed&&t.set(t.size()-1,new A(f)))}},Mi.prototype.findSnapForVertex=function(t,e){for(var r=this,i=0;i<e.length;i++){if(t.equals2D(e[i]))return null;if(t.distance(e[i])<r._snapTolerance)return e[i]}return null},Mi.prototype.snapTo=function(t){var e=new Bs(this._srcPts);this.snapVertices(e,t),this.snapSegments(e,t);var r=e.toCoordinateArray();return r},Mi.prototype.snapSegments=function(t,e){var r=this;if(e.length===0)return null;var i=e.length;e[0].equals2D(e[e.length-1])&&(i=e.length-1);for(var n=0;n<i;n++){var o=e[n],f=r.findSegmentIndexToSnap(o,t);f>=0&&t.add(f+1,new A(o),!1)}},Mi.prototype.findSegmentIndexToSnap=function(t,e){for(var r=this,i=j.MAX_VALUE,n=-1,o=0;o<e.size()-1;o++){if(r._seg.p0=e.get(o),r._seg.p1=e.get(o+1),r._seg.p0.equals2D(t)||r._seg.p1.equals2D(t)){if(r._allowSnappingToSourceVertices)continue;return-1}var f=r._seg.distance(t);f<r._snapTolerance&&f<i&&(i=f,n=o)}return n},Mi.prototype.setAllowSnappingToSourceVertices=function(t){this._allowSnappingToSourceVertices=t},Mi.prototype.interfaces_=function(){return[]},Mi.prototype.getClass=function(){return Mi},Mi.isClosed=function(t){return t.length<=1?!1:t[0].equals2D(t[t.length-1])};var wt=function(t){this._srcGeom=t||null},Ta={SNAP_PRECISION_FACTOR:{configurable:!0}};wt.prototype.snapTo=function(t,e){var r=this.extractTargetCoordinates(t),i=new Ia(e,r);return i.transform(this._srcGeom)},wt.prototype.snapToSelf=function(t,e){var r=this.extractTargetCoordinates(this._srcGeom),i=new Ia(t,r,!0),n=i.transform(this._srcGeom),o=n;return e&&H(o,sr)&&(o=n.buffer(0)),o},wt.prototype.computeSnapTolerance=function(t){var e=this.computeMinimumSegmentLength(t),r=e/10;return r},wt.prototype.extractTargetCoordinates=function(t){for(var e=new fi,r=t.getCoordinates(),i=0;i<r.length;i++)e.add(r[i]);return e.toArray(new Array(0).fill(null))},wt.prototype.computeMinimumSegmentLength=function(t){for(var e=j.MAX_VALUE,r=0;r<t.length-1;r++){var i=t[r].distance(t[r+1]);i<e&&(e=i)}return e},wt.prototype.interfaces_=function(){return[]},wt.prototype.getClass=function(){return wt},wt.snap=function(t,e,r){var i=new Array(2).fill(null),n=new wt(t);i[0]=n.snapTo(e,r);var o=new wt(e);return i[1]=o.snapTo(i[0],r),i},wt.computeOverlaySnapTolerance=function(){if(arguments.length===1){var t=arguments[0],e=wt.computeSizeBasedSnapTolerance(t),r=t.getPrecisionModel();if(r.getType()===ot.FIXED){var i=1/r.getScale()*2/1.415;i>e&&(e=i)}return e}else if(arguments.length===2){var n=arguments[0],o=arguments[1];return Math.min(wt.computeOverlaySnapTolerance(n),wt.computeOverlaySnapTolerance(o))}},wt.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal(),r=Math.min(e.getHeight(),e.getWidth()),i=r*wt.SNAP_PRECISION_FACTOR;return i},wt.snapToSelf=function(t,e,r){var i=new wt(t);return i.snapToSelf(e,r)},Ta.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(wt,Ta);var Ia=function(s){function t(e,r,i){s.call(this),this._snapTolerance=e||null,this._snapPts=r||null,this._isSelfSnap=i!==void 0?i:!1}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.snapLine=function(r,i){var n=new Mi(r,this._snapTolerance);return n.setAllowSnappingToSourceVertices(this._isSelfSnap),n.snapTo(i)},t.prototype.transformCoordinates=function(r,i){var n=r.toCoordinateArray(),o=this.snapLine(n,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(o)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(de),oe=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};oe.prototype.getCommon=function(){return j.longBitsToDouble(this._commonBits)},oe.prototype.add=function(t){var e=j.doubleToLongBits(t);if(this._isFirst)return this._commonBits=e,this._commonSignExp=oe.signExpBits(this._commonBits),this._isFirst=!1,null;var r=oe.signExpBits(e);if(r!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=oe.numCommonMostSigMantissaBits(this._commonBits,e),this._commonBits=oe.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))},oe.prototype.toString=function(){if(arguments.length===1){var t=arguments[0],e=j.longBitsToDouble(t),r=j.toBinaryString(t),i="0000000000000000000000000000000000000000000000000000000000000000"+r,n=i.substring(i.length-64),o=n.substring(0,1)+" "+n.substring(1,12)+"(exp) "+n.substring(12)+" [ "+e+" ]";return o}},oe.prototype.interfaces_=function(){return[]},oe.prototype.getClass=function(){return oe},oe.getBit=function(t,e){var r=1<<e;return t&r?1:0},oe.signExpBits=function(t){return t>>52},oe.zeroLowerBits=function(t,e){var r=(1<<e)-1,i=~r,n=t&i;return n},oe.numCommonMostSigMantissaBits=function(t,e){for(var r=0,i=52;i>=0;i--){if(oe.getBit(t,i)!==oe.getBit(e,i))return r;r++}return 52};var cr=function(){this._commonCoord=null,this._ccFilter=new Qr},yo={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};cr.prototype.addCommonBits=function(t){var e=new pr(this._commonCoord);t.apply(e),t.geometryChanged()},cr.prototype.removeCommonBits=function(t){if(this._commonCoord.x===0&&this._commonCoord.y===0)return t;var e=new A(this._commonCoord);e.x=-e.x,e.y=-e.y;var r=new pr(e);return t.apply(r),t.geometryChanged(),t},cr.prototype.getCommonCoordinate=function(){return this._commonCoord},cr.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},cr.prototype.interfaces_=function(){return[]},cr.prototype.getClass=function(){return cr},yo.CommonCoordinateFilter.get=function(){return Qr},yo.Translater.get=function(){return pr},Object.defineProperties(cr,yo);var Qr=function(){this._commonBitsX=new oe,this._commonBitsY=new oe};Qr.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},Qr.prototype.getCommonCoordinate=function(){return new A(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},Qr.prototype.interfaces_=function(){return[Ai]},Qr.prototype.getClass=function(){return Qr};var pr=function(){this.trans=null;var t=arguments[0];this.trans=t};pr.prototype.filter=function(t,e){var r=t.getOrdinate(e,0)+this.trans.x,i=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,r),t.setOrdinate(e,1,i)},pr.prototype.isDone=function(){return!1},pr.prototype.isGeometryChanged=function(){return!0},pr.prototype.interfaces_=function(){return[Ke]},pr.prototype.getClass=function(){return pr};var Gt=function(t,e){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=t,this._geom[1]=e,this.computeSnapTolerance()};Gt.prototype.selfSnap=function(t){var e=new wt(t),r=e.snapTo(t,this._snapTolerance);return r},Gt.prototype.removeCommonBits=function(t){this._cbr=new cr,this._cbr.add(t[0]),this._cbr.add(t[1]);var e=new Array(2).fill(null);return e[0]=this._cbr.removeCommonBits(t[0].copy()),e[1]=this._cbr.removeCommonBits(t[1].copy()),e},Gt.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},Gt.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),r=J.overlayOp(e[0],e[1],t);return this.prepareResult(r)},Gt.prototype.checkValid=function(t){t.isValid()||Xt.out.println("Snapped geometry is invalid")},Gt.prototype.computeSnapTolerance=function(){this._snapTolerance=wt.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},Gt.prototype.snap=function(t){var e=this.removeCommonBits(t),r=wt.snap(e[0],e[1],this._snapTolerance);return r},Gt.prototype.interfaces_=function(){return[]},Gt.prototype.getClass=function(){return Gt},Gt.overlayOp=function(t,e,r){var i=new Gt(t,e);return i.getResultGeometry(r)},Gt.union=function(t,e){return Gt.overlayOp(t,e,J.UNION)},Gt.intersection=function(t,e){return Gt.overlayOp(t,e,J.INTERSECTION)},Gt.symDifference=function(t,e){return Gt.overlayOp(t,e,J.SYMDIFFERENCE)},Gt.difference=function(t,e){return Gt.overlayOp(t,e,J.DIFFERENCE)};var ae=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};ae.prototype.getResultGeometry=function(t){var e=null,r=!1,i=null;try{e=J.overlayOp(this._geom[0],this._geom[1],t);var n=!0;n&&(r=!0)}catch(o){if(o instanceof Xi)i=o;else throw o}finally{}if(!r)try{e=Gt.overlayOp(this._geom[0],this._geom[1],t)}catch(o){throw o instanceof Xi?i:o}finally{}return e},ae.prototype.interfaces_=function(){return[]},ae.prototype.getClass=function(){return ae},ae.overlayOp=function(t,e,r){var i=new ae(t,e);return i.getResultGeometry(r)},ae.union=function(t,e){return ae.overlayOp(t,e,J.UNION)},ae.intersection=function(t,e){return ae.overlayOp(t,e,J.INTERSECTION)},ae.symDifference=function(t,e){return ae.overlayOp(t,e,J.SYMDIFFERENCE)},ae.difference=function(t,e){return ae.overlayOp(t,e,J.DIFFERENCE)};var js=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};js.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},js.prototype.interfaces_=function(){return[]},js.prototype.getClass=function(){return js};var Ie=function s(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,arguments.length===2){var t=arguments[0],e=arguments[1];this._eventType=s.DELETE,this._xValue=t,this._insertEvent=e}else if(arguments.length===3){var r=arguments[0],i=arguments[1],n=arguments[2];this._eventType=s.INSERT,this._label=r,this._xValue=i,this._obj=n}},vo={INSERT:{configurable:!0},DELETE:{configurable:!0}};Ie.prototype.isDelete=function(){return this._eventType===Ie.DELETE},Ie.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},Ie.prototype.getObject=function(){return this._obj},Ie.prototype.compareTo=function(t){var e=t;return this._xValue<e._xValue?-1:this._xValue>e._xValue?1:this._eventType<e._eventType?-1:this._eventType>e._eventType?1:0},Ie.prototype.getInsertEvent=function(){return this._insertEvent},Ie.prototype.isInsert=function(){return this._eventType===Ie.INSERT},Ie.prototype.isSameLabel=function(t){return this._label===null?!1:this._label===t._label},Ie.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},Ie.prototype.interfaces_=function(){return[Be]},Ie.prototype.getClass=function(){return Ie},vo.INSERT.get=function(){return 1},vo.DELETE.get=function(){return 2},Object.defineProperties(Ie,vo);var wn=function(){};wn.prototype.interfaces_=function(){return[]},wn.prototype.getClass=function(){return wn};var Zt=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var t=arguments[0],e=arguments[1],r=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=r};Zt.prototype.isTrivialIntersection=function(t,e,r,i){if(t===r&&this._li.getIntersectionNum()===1){if(Zt.isAdjacentSegments(e,i))return!0;if(t.isClosed()){var n=t.getNumPoints()-1;if(e===0&&i===n||i===0&&e===n)return!0}}return!1},Zt.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Zt.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},Zt.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Zt.prototype.isBoundaryPointInternal=function(t,e){for(var r=e.iterator();r.hasNext();){var i=r.next(),n=i.getCoordinate();if(t.isIntersection(n))return!0}return!1},Zt.prototype.hasProperIntersection=function(){return this._hasProper},Zt.prototype.hasIntersection=function(){return this._hasIntersection},Zt.prototype.isDone=function(){return this._isDone},Zt.prototype.isBoundaryPoint=function(t,e){return e===null?!1:!!(this.isBoundaryPointInternal(t,e[0])||this.isBoundaryPointInternal(t,e[1]))},Zt.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},Zt.prototype.addIntersections=function(t,e,r,i){if(t===r&&e===i)return null;this.numTests++;var n=t.getCoordinates()[e],o=t.getCoordinates()[e+1],f=r.getCoordinates()[i],u=r.getCoordinates()[i+1];this._li.computeIntersection(n,o,f,u),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),r.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,r,i)||(this._hasIntersection=!0,(this._includeProper||!this._li.isProper())&&(t.addIntersections(this._li,e,0),r.addIntersections(this._li,i,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},Zt.prototype.interfaces_=function(){return[]},Zt.prototype.getClass=function(){return Zt},Zt.isAdjacentSegments=function(t,e){return Math.abs(t-e)===1};var $f=function(s){function t(){s.call(this),this.events=new k,this.nOverlaps=null}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.prepareEvents=function(){var r=this;Je.sort(this.events);for(var i=0;i<this.events.size();i++){var n=r.events.get(i);n.isDelete()&&n.getInsertEvent().setDeleteEventIndex(i)}},t.prototype.computeIntersections=function(){var r=this;if(arguments.length===1){var i=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var n=0;n<this.events.size();n++){var o=r.events.get(n);if(o.isInsert()&&r.processOverlaps(n,o.getDeleteEventIndex(),o,i),i.isDone())break}}else if(arguments.length===3){if(arguments[2]instanceof Zt&&H(arguments[0],He)&&H(arguments[1],He)){var f=arguments[0],u=arguments[1],l=arguments[2];this.addEdges(f,f),this.addEdges(u,u),this.computeIntersections(l)}else if(typeof arguments[2]=="boolean"&&H(arguments[0],He)&&arguments[1]instanceof Zt){var a=arguments[0],c=arguments[1],p=arguments[2];p?this.addEdges(a,null):this.addEdges(a),this.computeIntersections(c)}}},t.prototype.addEdge=function(r,i){for(var n=this,o=r.getMonotoneChainEdge(),f=o.getStartIndexes(),u=0;u<f.length-1;u++){var l=new js(o,u),a=new Ie(i,o.getMinX(u),l);n.events.add(a),n.events.add(new Ie(o.getMaxX(u),a))}},t.prototype.processOverlaps=function(r,i,n,o){for(var f=this,u=n.getObject(),l=r;l<i;l++){var a=f.events.get(l);if(a.isInsert()){var c=a.getObject();n.isSameLabel(a)||(u.computeIntersections(c,o),f.nOverlaps++)}}},t.prototype.addEdges=function(){var r=this;if(arguments.length===1)for(var i=arguments[0],n=i.iterator();n.hasNext();){var o=n.next();r.addEdge(o,o)}else if(arguments.length===2)for(var f=arguments[0],u=arguments[1],l=f.iterator();l.hasNext();){var a=l.next();r.addEdge(a,u)}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(wn),Bi=function(){this._min=j.POSITIVE_INFINITY,this._max=j.NEGATIVE_INFINITY},La={NodeComparator:{configurable:!0}};Bi.prototype.getMin=function(){return this._min},Bi.prototype.intersects=function(t,e){return!(this._min>e||this._max<t)},Bi.prototype.getMax=function(){return this._max},Bi.prototype.toString=function(){return qe.toLineString(new A(this._min,0),new A(this._max,0))},Bi.prototype.interfaces_=function(){return[]},Bi.prototype.getClass=function(){return Bi},La.NodeComparator.get=function(){return Js},Object.defineProperties(Bi,La);var Js=function(){};Js.prototype.compare=function(t,e){var r=t,i=e,n=(r._min+r._max)/2,o=(i._min+i._max)/2;return n<o?-1:n>o?1:0},Js.prototype.interfaces_=function(){return[ss]},Js.prototype.getClass=function(){return Js};var tu=function(s){function t(){s.call(this),this._item=null;var e=arguments[0],r=arguments[1],i=arguments[2];this._min=e,this._max=r,this._item=i}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.query=function(r,i,n){if(!this.intersects(r,i))return null;n.visitItem(this._item)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Bi),eu=function(s){function t(){s.call(this),this._node1=null,this._node2=null;var e=arguments[0],r=arguments[1];this._node1=e,this._node2=r,this.buildExtent(this._node1,this._node2)}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.buildExtent=function(r,i){this._min=Math.min(r._min,i._min),this._max=Math.max(r._max,i._max)},t.prototype.query=function(r,i,n){if(!this.intersects(r,i))return null;this._node1!==null&&this._node1.query(r,i,n),this._node2!==null&&this._node2.query(r,i,n)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Bi),Oi=function(){this._leaves=new k,this._root=null,this._level=0};Oi.prototype.buildTree=function(){var t=this;Je.sort(this._leaves,new Bi.NodeComparator);for(var e=this._leaves,r=null,i=new k;;){if(t.buildLevel(e,i),i.size()===1)return i.get(0);r=e,e=i,i=r}},Oi.prototype.insert=function(t,e,r){if(this._root!==null)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new tu(t,e,r))},Oi.prototype.query=function(t,e,r){this.init(),this._root.query(t,e,r)},Oi.prototype.buildRoot=function(){if(this._root!==null)return null;this._root=this.buildTree()},Oi.prototype.printNode=function(t){Xt.out.println(qe.toLineString(new A(t._min,this._level),new A(t._max,this._level)))},Oi.prototype.init=function(){if(this._root!==null)return null;this.buildRoot()},Oi.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var r=0;r<t.size();r+=2){var i=t.get(r),n=r+1<t.size()?t.get(r):null;if(n===null)e.add(i);else{var o=new eu(t.get(r),t.get(r+1));e.add(o)}}},Oi.prototype.interfaces_=function(){return[]},Oi.prototype.getClass=function(){return Oi};var Ts=function(){this._items=new k};Ts.prototype.visitItem=function(t){this._items.add(t)},Ts.prototype.getItems=function(){return this._items},Ts.prototype.interfaces_=function(){return[nr]},Ts.prototype.getClass=function(){return Ts};var Is=function(){this._index=null;var t=arguments[0];if(!H(t,sr))throw new yt("Argument must be Polygonal");this._index=new Pr(t)},_o={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};Is.prototype.locate=function(t){var e=new ai(t),r=new Ls(e);return this._index.query(t.y,t.y,r),e.getLocation()},Is.prototype.interfaces_=function(){return[_s]},Is.prototype.getClass=function(){return Is},_o.SegmentVisitor.get=function(){return Ls},_o.IntervalIndexedGeometry.get=function(){return Pr},Object.defineProperties(Is,_o);var Ls=function(){this._counter=null;var t=arguments[0];this._counter=t};Ls.prototype.visitItem=function(t){var e=t;this._counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))},Ls.prototype.interfaces_=function(){return[nr]},Ls.prototype.getClass=function(){return Ls};var Pr=function(){this._index=new Oi;var t=arguments[0];this.init(t)};Pr.prototype.init=function(t){for(var e=this,r=Ut.getLines(t),i=r.iterator();i.hasNext();){var n=i.next(),o=n.getCoordinates();e.addLine(o)}},Pr.prototype.addLine=function(t){for(var e=this,r=1;r<t.length;r++){var i=new z(t[r-1],t[r]),n=Math.min(i.p0.y,i.p1.y),o=Math.max(i.p0.y,i.p1.y);e._index.insert(n,o,i)}},Pr.prototype.query=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],r=new Ts;return this._index.query(t,e,r),r.getItems()}else if(arguments.length===3){var i=arguments[0],n=arguments[1],o=arguments[2];this._index.query(i,n,o)}},Pr.prototype.interfaces_=function(){return[]},Pr.prototype.getClass=function(){return Pr};var Qs=function(s){function t(){if(s.call(this),this._parentGeom=null,this._lineEdgeMap=new na,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new $e,arguments.length===2){var e=arguments[0],r=arguments[1],i=Fe.OGC_SFS_BOUNDARY_RULE;this._argIndex=e,this._parentGeom=r,this._boundaryNodeRule=i,r!==null&&this.add(r)}else if(arguments.length===3){var n=arguments[0],o=arguments[1],f=arguments[2];this._argIndex=n,this._parentGeom=o,this._boundaryNodeRule=f,o!==null&&this.add(o)}}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.insertBoundaryPoint=function(r,i){var n=this._nodes.addNode(i),o=n.getLabel(),f=1,u=P.NONE;u=o.getLocation(r,F.ON),u===P.BOUNDARY&&f++;var l=t.determineBoundary(this._boundaryNodeRule,f);o.setLocation(r,l)},t.prototype.computeSelfNodes=function(){if(arguments.length===2){var r=arguments[0],i=arguments[1];return this.computeSelfNodes(r,i,!1)}else if(arguments.length===3){var n=arguments[0],o=arguments[1],f=arguments[2],u=new Zt(n,!0,!1);u.setIsDoneIfProperInt(f);var l=this.createEdgeSetIntersector(),a=this._parentGeom instanceof wi||this._parentGeom instanceof bt||this._parentGeom instanceof Ei,c=o||!a;return l.computeIntersections(this._edges,u,c),this.addSelfIntersectionNodes(this._argIndex),u}},t.prototype.computeSplitEdges=function(r){for(var i=this._edges.iterator();i.hasNext();){var n=i.next();n.eiList.addSplitEdges(r)}},t.prototype.computeEdgeIntersections=function(r,i,n){var o=new Zt(i,n,!0);o.setBoundaryNodes(this.getBoundaryNodes(),r.getBoundaryNodes());var f=this.createEdgeSetIntersector();return f.computeIntersections(this._edges,r._edges,o),o},t.prototype.getGeometry=function(){return this._parentGeom},t.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},t.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},t.prototype.addPoint=function(){if(arguments[0]instanceof _e){var r=arguments[0],i=r.getCoordinate();this.insertPoint(this._argIndex,i,P.INTERIOR)}else if(arguments[0]instanceof A){var n=arguments[0];this.insertPoint(this._argIndex,n,P.INTERIOR)}},t.prototype.addPolygon=function(r){var i=this;this.addPolygonRing(r.getExteriorRing(),P.EXTERIOR,P.INTERIOR);for(var n=0;n<r.getNumInteriorRing();n++){var o=r.getInteriorRingN(n);i.addPolygonRing(o,P.INTERIOR,P.EXTERIOR)}},t.prototype.addEdge=function(r){this.insertEdge(r);var i=r.getCoordinates();this.insertPoint(this._argIndex,i[0],P.BOUNDARY),this.insertPoint(this._argIndex,i[i.length-1],P.BOUNDARY)},t.prototype.addLineString=function(r){var i=$.removeRepeatedPoints(r.getCoordinates());if(i.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=i[0],null;var n=new An(i,new ht(this._argIndex,P.INTERIOR));this._lineEdgeMap.put(r,n),this.insertEdge(n),Q.isTrue(i.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,i[0]),this.insertBoundaryPoint(this._argIndex,i[i.length-1])},t.prototype.getInvalidPoint=function(){return this._invalidPoint},t.prototype.getBoundaryPoints=function(){for(var r=this.getBoundaryNodes(),i=new Array(r.size()).fill(null),n=0,o=r.iterator();o.hasNext();){var f=o.next();i[n++]=f.getCoordinate().copy()}return i},t.prototype.getBoundaryNodes=function(){return this._boundaryNodes===null&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},t.prototype.addSelfIntersectionNode=function(r,i,n){if(this.isBoundaryNode(r,i))return null;n===P.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(r,i):this.insertPoint(r,i,n)},t.prototype.addPolygonRing=function(r,i,n){if(r.isEmpty())return null;var o=$.removeRepeatedPoints(r.getCoordinates());if(o.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=o[0],null;var f=i,u=n;V.isCCW(o)&&(f=n,u=i);var l=new An(o,new ht(this._argIndex,P.BOUNDARY,f,u));this._lineEdgeMap.put(r,l),this.insertEdge(l),this.insertPoint(this._argIndex,o[0],P.BOUNDARY)},t.prototype.insertPoint=function(r,i,n){var o=this._nodes.addNode(i),f=o.getLabel();f===null?o._label=new ht(r,n):f.setLocation(r,n)},t.prototype.createEdgeSetIntersector=function(){return new $f},t.prototype.addSelfIntersectionNodes=function(r){for(var i=this,n=this._edges.iterator();n.hasNext();)for(var o=n.next(),f=o.getLabel().getLocation(r),u=o.eiList.iterator();u.hasNext();){var l=u.next();i.addSelfIntersectionNode(r,l.coord,f)}},t.prototype.add=function(){if(arguments.length===1){var r=arguments[0];if(r.isEmpty())return null;if(r instanceof Ei&&(this._useBoundaryDeterminationRule=!1),r instanceof bt)this.addPolygon(r);else if(r instanceof Ct)this.addLineString(r);else if(r instanceof _e)this.addPoint(r);else if(r instanceof ds)this.addCollection(r);else if(r instanceof Wr)this.addCollection(r);else if(r instanceof Ei)this.addCollection(r);else if(r instanceof te)this.addCollection(r);else throw new Error(r.getClass().getName())}else return s.prototype.add.apply(this,arguments)},t.prototype.addCollection=function(r){for(var i=this,n=0;n<r.getNumGeometries();n++){var o=r.getGeometryN(n);i.add(o)}},t.prototype.locate=function(r){return H(this._parentGeom,sr)&&this._parentGeom.getNumGeometries()>50?(this._areaPtLocator===null&&(this._areaPtLocator=new Is(this._parentGeom)),this._areaPtLocator.locate(r)):this._ptLocator.locate(r,this._parentGeom)},t.prototype.findEdge=function(){if(arguments.length===1){var r=arguments[0];return this._lineEdgeMap.get(r)}else return s.prototype.findEdge.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.determineBoundary=function(r,i){return r.isInBoundary(i)?P.BOUNDARY:P.INTERIOR},t}(_t),As=function(){if(this._li=new vr,this._resultPrecisionModel=null,this._arg=null,arguments.length===1){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new Qs(0,t)}else if(arguments.length===2){var e=arguments[0],r=arguments[1],i=Fe.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(r.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(r.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Qs(0,e,i),this._arg[1]=new Qs(1,r,i)}else if(arguments.length===3){var n=arguments[0],o=arguments[1],f=arguments[2];n.getPrecisionModel().compareTo(o.getPrecisionModel())>=0?this.setComputationPrecision(n.getPrecisionModel()):this.setComputationPrecision(o.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Qs(0,n,f),this._arg[1]=new Qs(1,o,f)}};As.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},As.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},As.prototype.interfaces_=function(){return[]},As.prototype.getClass=function(){return As};var Sr=function(){};Sr.prototype.interfaces_=function(){return[]},Sr.prototype.getClass=function(){return Sr},Sr.map=function(){if(arguments[0]instanceof U&&H(arguments[1],Sr.MapOp)){for(var t=arguments[0],e=arguments[1],r=new k,i=0;i<t.getNumGeometries();i++){var n=e.map(t.getGeometryN(i));n!==null&&r.add(n)}return t.getFactory().buildGeometry(r)}else if(H(arguments[0],Dt)&&H(arguments[1],Sr.MapOp)){for(var o=arguments[0],f=arguments[1],u=new k,l=o.iterator();l.hasNext();){var a=l.next(),c=f.map(a);c!==null&&u.add(c)}return u}},Sr.MapOp=function(){};var J=function(s){function t(){var e=arguments[0],r=arguments[1];s.call(this,e,r),this._ptLocator=new $e,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new Qe,this._resultPolyList=new k,this._resultLineList=new k,this._resultPointList=new k,this._graph=new _t(new da),this._geomFact=e.getFactory()}return s&&(t.__proto__=s),t.prototype=Object.create(s&&s.prototype),t.prototype.constructor=t,t.prototype.insertUniqueEdge=function(r){var i=this._edgeList.findEqualEdge(r);if(i!==null){var n=i.getLabel(),o=r.getLabel();i.isPointwiseEqual(r)||(o=new ht(r.getLabel()),o.flip());var f=i.getDepth();f.isNull()&&f.add(n),f.add(o),n.merge(o)}else this._edgeList.add(r)},t.prototype.getGraph=function(){return this._graph},t.prototype.cancelDuplicateResultEdges=function(){for(var r=this._graph.getEdgeEnds().iterator();r.hasNext();){var i=r.next(),n=i.getSym();i.isInResult()&&n.isInResult()&&(i.setInResult(!1),n.setInResult(!1))}},t.prototype.isCoveredByLA=function(r){return!!(this.isCovered(r,this._resultLineList)||this.isCovered(r,this._resultPolyList))},t.prototype.computeGeometry=function(r,i,n,o){var f=new k;return f.addAll(r),f.addAll(i),f.addAll(n),f.isEmpty()?t.createEmptyResult(o,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(f)},t.prototype.mergeSymLabels=function(){for(var r=this._graph.getNodes().iterator();r.hasNext();){var i=r.next();i.getEdges().mergeSymLabels()}},t.prototype.isCovered=function(r,i){for(var n=this,o=i.iterator();o.hasNext();){var f=o.next(),u=n._ptLocator.locate(r,f);if(u!==P.EXTERIOR)return!0}return!1},t.prototype.replaceCollapsedEdges=function(){for(var r=new k,i=this._edgeList.iterator();i.hasNext();){var n=i.next();n.isCollapsed()&&(i.remove(),r.add(n.getCollapsedEdge()))}this._edgeList.addAll(r)},t.prototype.updateNodeLabelling=function(){for(var r=this._graph.getNodes().iterator();r.hasNext();){var i=r.next(),n=i.getEdges().getLabel();i.getLabel().merge(n)}},t.prototype.getResultGeometry=function(r){return this.computeOverlay(r),this._resultGeom},t.prototype.insertUniqueEdges=function(r){for(var i=this,n=r.iterator();n.hasNext();){var o=n.next();i.insertUniqueEdge(o)}},t.prototype.computeOverlay=function(r){this.copyPoints(0),this.copyPoints(1),this._arg[0].computeSelfNodes(this._li,!1),this._arg[1].computeSelfNodes(this._li,!1),this._arg[0].computeEdgeIntersections(this._arg[1],this._li,!0);var i=new k;this._arg[0].computeSplitEdges(i),this._arg[1].computeSplitEdges(i),this.insertUniqueEdges(i),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),Er.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(r),this.cancelDuplicateResultEdges();var n=new Ce(this._geomFact);n.add(this._graph),this._resultPolyList=n.getPolygons();var o=new Ci(this,this._geomFact,this._ptLocator);this._resultLineList=o.build(r);var f=new Jr(this,this._geomFact,this._ptLocator);this._resultPointList=f.build(r),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,r)},t.prototype.labelIncompleteNode=function(r,i){var n=this._ptLocator.locate(r.getCoordinate(),this._arg[i].getGeometry());r.getLabel().setLocation(i,n)},t.prototype.copyPoints=function(r){for(var i=this,n=this._arg[r].getNodeIterator();n.hasNext();){var o=n.next(),f=i._graph.addNode(o.getCoordinate());f.setLabel(r,o.getLabel().getLocation(r))}},t.prototype.findResultAreaEdges=function(r){for(var i=this._graph.getEdgeEnds().iterator();i.hasNext();){var n=i.next(),o=n.getLabel();o.isArea()&&!n.isInteriorAreaEdge()&&t.isResultOfOp(o.getLocation(0,F.RIGHT),o.getLocation(1,F.RIGHT),r)&&n.setInResult(!0)}},t.prototype.computeLabelsFromDepths=function(){for(var r=this._edgeList.iterator();r.hasNext();){var i=r.next(),n=i.getLabel(),o=i.getDepth();if(!o.isNull()){o.normalize();for(var f=0;f<2;f++)!n.isNull(f)&&n.isArea()&&!o.isNull(f)&&(o.getDelta(f)===0?n.toLine(f):(Q.isTrue(!o.isNull(f,F.LEFT),"depth of LEFT side has not been initialized"),n.setLocation(f,F.LEFT,o.getLocation(f,F.LEFT)),Q.isTrue(!o.isNull(f,F.RIGHT),"depth of RIGHT side has not been initialized"),n.setLocation(f,F.RIGHT,o.getLocation(f,F.RIGHT))))}}},t.prototype.computeLabelling=function(){for(var r=this,i=this._graph.getNodes().iterator();i.hasNext();){var n=i.next();n.getEdges().computeLabelling(r._arg)}this.mergeSymLabels(),this.updateNodeLabelling()},t.prototype.labelIncompleteNodes=function(){for(var r=this,i=this._graph.getNodes().iterator();i.hasNext();){var n=i.next(),o=n.getLabel();n.isIsolated()&&(o.isNull(0)?r.labelIncompleteNode(n,0):r.labelIncompleteNode(n,1)),n.getEdges().updateLabelling(o)}},t.prototype.isCoveredByA=function(r){return!!this.isCovered(r,this._resultPolyList)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(As);J.overlayOp=function(s,t,e){var r=new J(s,t),i=r.getResultGeometry(e);return i},J.intersection=function(s,t){if(s.isEmpty()||t.isEmpty())return J.createEmptyResult(J.INTERSECTION,s,t,s.getFactory());if(s.isGeometryCollection()){var e=t;return jr.map(s,{interfaces_:function(){return[Sr.MapOp]},map:function(r){return r.intersection(e)}})}return s.checkNotGeometryCollection(s),s.checkNotGeometryCollection(t),ae.overlayOp(s,t,J.INTERSECTION)},J.symDifference=function(s,t){if(s.isEmpty()||t.isEmpty()){if(s.isEmpty()&&t.isEmpty())return J.createEmptyResult(J.SYMDIFFERENCE,s,t,s.getFactory());if(s.isEmpty())return t.copy();if(t.isEmpty())return s.copy()}return s.checkNotGeometryCollection(s),s.checkNotGeometryCollection(t),ae.overlayOp(s,t,J.SYMDIFFERENCE)},J.resultDimension=function(s,t,e){var r=t.getDimension(),i=e.getDimension(),n=-1;switch(s){case J.INTERSECTION:n=Math.min(r,i);break;case J.UNION:n=Math.max(r,i);break;case J.DIFFERENCE:n=r;break;case J.SYMDIFFERENCE:n=Math.max(r,i);break}return n},J.createEmptyResult=function(s,t,e,r){var i=null;switch(J.resultDimension(s,t,e)){case-1:i=r.createGeometryCollection(new Array(0).fill(null));break;case 0:i=r.createPoint();break;case 1:i=r.createLineString();break;case 2:i=r.createPolygon();break}return i},J.difference=function(s,t){return s.isEmpty()?J.createEmptyResult(J.DIFFERENCE,s,t,s.getFactory()):t.isEmpty()?s.copy():(s.checkNotGeometryCollection(s),s.checkNotGeometryCollection(t),ae.overlayOp(s,t,J.DIFFERENCE))},J.isResultOfOp=function(){if(arguments.length===2){var s=arguments[0],t=arguments[1],e=s.getLocation(0),r=s.getLocation(1);return J.isResultOfOp(e,r,t)}else if(arguments.length===3){var i=arguments[0],n=arguments[1],o=arguments[2];switch(i===P.BOUNDARY&&(i=P.INTERIOR),n===P.BOUNDARY&&(n=P.INTERIOR),o){case J.INTERSECTION:return i===P.INTERIOR&&n===P.INTERIOR;case J.UNION:return i===P.INTERIOR||n===P.INTERIOR;case J.DIFFERENCE:return i===P.INTERIOR&&n!==P.INTERIOR;case J.SYMDIFFERENCE:return i===P.INTERIOR&&n!==P.INTERIOR||i!==P.INTERIOR&&n===P.INTERIOR}return!1}},J.INTERSECTION=1,J.UNION=2,J.DIFFERENCE=3,J.SYMDIFFERENCE=4;var gr=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new $e,this._seg=new z;var t=arguments[0],e=arguments[1];this._g=t,this._boundaryDistanceTolerance=e,this._linework=this.extractLinework(t)};gr.prototype.isWithinToleranceOfBoundary=function(t){for(var e=this,r=0;r<this._linework.getNumGeometries();r++)for(var i=e._linework.getGeometryN(r),n=i.getCoordinateSequence(),o=0;o<n.size()-1;o++){n.getCoordinate(o,e._seg.p0),n.getCoordinate(o+1,e._seg.p1);var f=e._seg.distance(t);if(f<=e._boundaryDistanceTolerance)return!0}return!1},gr.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?P.BOUNDARY:this._ptLocator.locate(t,this._g)},gr.prototype.extractLinework=function(t){var e=new ws;t.apply(e);var r=e.getLinework(),i=tt.toLineStringArray(r);return t.getFactory().createMultiLineString(i)},gr.prototype.interfaces_=function(){return[]},gr.prototype.getClass=function(){return gr};var ws=function(){this._linework=null,this._linework=new k};ws.prototype.getLinework=function(){return this._linework},ws.prototype.filter=function(t){var e=this;if(t instanceof bt){var r=t;this._linework.add(r.getExteriorRing());for(var i=0;i<r.getNumInteriorRing();i++)e._linework.add(r.getInteriorRingN(i))}},ws.prototype.interfaces_=function(){return[ui]},ws.prototype.getClass=function(){return ws};var Nr=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t};Nr.prototype.extractPoints=function(t,e,r){for(var i=this,n=t.getCoordinates(),o=0;o<n.length-1;o++)i.computeOffsetPoints(n[o],n[o+1],e,r)},Nr.prototype.setSidesToGenerate=function(t,e){this._doLeft=t,this._doRight=e},Nr.prototype.getPoints=function(t){for(var e=this,r=new k,i=Ut.getLines(this._g),n=i.iterator();n.hasNext();){var o=n.next();e.extractPoints(o,t,r)}return r},Nr.prototype.computeOffsetPoints=function(t,e,r,i){var n=e.x-t.x,o=e.y-t.y,f=Math.sqrt(n*n+o*o),u=r*n/f,l=r*o/f,a=(e.x+t.x)/2,c=(e.y+t.y)/2;if(this._doLeft){var p=new A(a-l,c+u);i.add(p)}if(this._doRight){var d=new A(a+l,c-u);i.add(d)}},Nr.prototype.interfaces_=function(){return[]},Nr.prototype.getClass=function(){return Nr};var De=function s(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=s.TOLERANCE,this._testCoords=new k;var t=arguments[0],e=arguments[1],r=arguments[2];this._boundaryDistanceTolerance=s.computeBoundaryDistanceTolerance(t,e),this._geom=[t,e,r],this._locFinder=[new gr(this._geom[0],this._boundaryDistanceTolerance),new gr(this._geom[1],this._boundaryDistanceTolerance),new gr(this._geom[2],this._boundaryDistanceTolerance)]},Aa={TOLERANCE:{configurable:!0}};De.prototype.reportResult=function(t,e,r){Xt.out.println("Overlay result invalid - A:"+P.toLocationSymbol(e[0])+" B:"+P.toLocationSymbol(e[1])+" expected:"+(r?"i":"e")+" actual:"+P.toLocationSymbol(e[2]))},De.prototype.isValid=function(t){this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]);var e=this.checkValid(t);return e},De.prototype.checkValid=function(){var t=this;if(arguments.length===1){for(var e=arguments[0],r=0;r<this._testCoords.size();r++){var i=t._testCoords.get(r);if(!t.checkValid(e,i))return t._invalidLocation=i,!1}return!0}else if(arguments.length===2){var n=arguments[0],o=arguments[1];return this._location[0]=this._locFinder[0].getLocation(o),this._location[1]=this._locFinder[1].getLocation(o),this._location[2]=this._locFinder[2].getLocation(o),De.hasLocation(this._location,P.BOUNDARY)?!0:this.isValidResult(n,this._location)}},De.prototype.addTestPts=function(t){var e=new Nr(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))},De.prototype.isValidResult=function(t,e){var r=J.isResultOfOp(e[0],e[1],t),i=e[2]===P.INTERIOR,n=!(r^i);return n||this.reportResult(t,e,r),n},De.prototype.getInvalidLocation=function(){return this._invalidLocation},De.prototype.interfaces_=function(){return[]},De.prototype.getClass=function(){return De},De.hasLocation=function(t,e){for(var r=0;r<3;r++)if(t[r]===e)return!0;return!1},De.computeBoundaryDistanceTolerance=function(t,e){return Math.min(wt.computeSizeBasedSnapTolerance(t),wt.computeSizeBasedSnapTolerance(e))},De.isValid=function(t,e,r,i){var n=new De(t,e,i);return n.isValid(r)},Aa.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(De,Aa);var be=function s(t){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=s.extractFactory(t),this._inputGeoms=t};be.prototype.extractElements=function(t,e){var r=this;if(t===null)return null;for(var i=0;i<t.getNumGeometries();i++){var n=t.getGeometryN(i);r._skipEmpty&&n.isEmpty()||e.add(n)}},be.prototype.combine=function(){for(var t=this,e=new k,r=this._inputGeoms.iterator();r.hasNext();){var i=r.next();t.extractElements(i,e)}return e.size()===0?this._geomFactory!==null?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(e)},be.prototype.interfaces_=function(){return[]},be.prototype.getClass=function(){return be},be.combine=function(){if(arguments.length===1){var t=arguments[0],e=new be(t);return e.combine()}else if(arguments.length===2){var r=arguments[0],i=arguments[1],n=new be(be.createList(r,i));return n.combine()}else if(arguments.length===3){var o=arguments[0],f=arguments[1],u=arguments[2],l=new be(be.createList(o,f,u));return l.combine()}},be.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},be.createList=function(){if(arguments.length===2){var t=arguments[0],e=arguments[1],r=new k;return r.add(t),r.add(e),r}else if(arguments.length===3){var i=arguments[0],n=arguments[1],o=arguments[2],f=new k;return f.add(i),f.add(n),f.add(o),f}};var Nt=function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,this._inputPolys===null&&(this._inputPolys=new k)},wa={STRTREE_NODE_CAPACITY:{configurable:!0}};Nt.prototype.reduceToGeometries=function(t){for(var e=this,r=new k,i=t.iterator();i.hasNext();){var n=i.next(),o=null;H(n,He)?o=e.unionTree(n):n instanceof U&&(o=n),r.add(o)}return r},Nt.prototype.extractByEnvelope=function(t,e,r){for(var i=new k,n=0;n<e.getNumGeometries();n++){var o=e.getGeometryN(n);o.getEnvelopeInternal().intersects(t)?i.add(o):r.add(o)}return this._geomFactory.buildGeometry(i)},Nt.prototype.unionOptimized=function(t,e){var r=t.getEnvelopeInternal(),i=e.getEnvelopeInternal();if(!r.intersects(i)){var n=be.combine(t,e);return n}if(t.getNumGeometries()<=1&&e.getNumGeometries()<=1)return this.unionActual(t,e);var o=r.intersection(i);return this.unionUsingEnvelopeIntersection(t,e,o)},Nt.prototype.union=function(){if(this._inputPolys===null)throw new Error("union() method cannot be called twice");if(this._inputPolys.isEmpty())return null;this._geomFactory=this._inputPolys.iterator().next().getFactory();for(var t=new ua(Nt.STRTREE_NODE_CAPACITY),e=this._inputPolys.iterator();e.hasNext();){var r=e.next();t.insert(r.getEnvelopeInternal(),r)}this._inputPolys=null;var i=t.itemsTree(),n=this.unionTree(i);return n},Nt.prototype.binaryUnion=function(){if(arguments.length===1){var t=arguments[0];return this.binaryUnion(t,0,t.size())}else if(arguments.length===3){var e=arguments[0],r=arguments[1],i=arguments[2];if(i-r<=1){var n=Nt.getGeometry(e,r);return this.unionSafe(n,null)}else{if(i-r===2)return this.unionSafe(Nt.getGeometry(e,r),Nt.getGeometry(e,r+1));var o=Math.trunc((i+r)/2),f=this.binaryUnion(e,r,o),u=this.binaryUnion(e,o,i);return this.unionSafe(f,u)}}},Nt.prototype.repeatedUnion=function(t){for(var e=null,r=t.iterator();r.hasNext();){var i=r.next();e===null?e=i.copy():e=e.union(i)}return e},Nt.prototype.unionSafe=function(t,e){return t===null&&e===null?null:t===null?e.copy():e===null?t.copy():this.unionOptimized(t,e)},Nt.prototype.unionActual=function(t,e){return Nt.restrictToPolygons(t.union(e))},Nt.prototype.unionTree=function(t){var e=this.reduceToGeometries(t),r=this.binaryUnion(e);return r},Nt.prototype.unionUsingEnvelopeIntersection=function(t,e,r){var i=new k,n=this.extractByEnvelope(r,t,i),o=this.extractByEnvelope(r,e,i),f=this.unionActual(n,o);i.add(f);var u=be.combine(i);return u},Nt.prototype.bufferUnion=function(){if(arguments.length===1){var t=arguments[0],e=t.get(0).getFactory(),r=e.buildGeometry(t),i=r.buffer(0);return i}else if(arguments.length===2){var n=arguments[0],o=arguments[1],f=n.getFactory(),u=f.createGeometryCollection([n,o]),l=u.buffer(0);return l}},Nt.prototype.interfaces_=function(){return[]},Nt.prototype.getClass=function(){return Nt},Nt.restrictToPolygons=function(t){if(H(t,sr))return t;var e=Qi.getPolygons(t);return e.size()===1?e.get(0):t.getFactory().createMultiPolygon(tt.toPolygonArray(e))},Nt.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},Nt.union=function(t){var e=new Nt(t);return e.union()},wa.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(Nt,wa);var En=function(){};En.prototype.interfaces_=function(){return[]},En.prototype.getClass=function(){return En},En.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return J.createEmptyResult(J.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),ae.overlayOp(t,e,J.UNION)};function Dr(){return new Pn}function Pn(){this.reset()}Pn.prototype={constructor:Pn,reset:function(){this.s=this.t=0},add:function(s){Ea(Sn,s,this.t),Ea(this,Sn.s,this.s),this.s?this.t+=Sn.t:this.s=Sn.t},valueOf:function(){return this.s}};var Sn=new Pn;function Ea(s,t,e){var r=s.s=t+e,i=r-t,n=r-i;s.t=t-n+(e-i)}var Tt=1e-6,pt=Math.PI,$i=pt/2,Pa=pt/4,tr=pt*2,br=180/pt,Wi=pt/180,fe=Math.abs,iu=Math.atan,Es=Math.atan2,Mt=Math.cos,Bt=Math.sin,Ps=Math.sqrt;function Sa(s){return s>1?0:s<-1?pt:Math.acos(s)}function $r(s){return s>1?$i:s<-1?-$i:Math.asin(s)}function $s(){}function Nn(s,t){s&&Da.hasOwnProperty(s.type)&&Da[s.type](s,t)}var Na={Feature:function(s,t){Nn(s.geometry,t)},FeatureCollection:function(s,t){for(var e=s.features,r=-1,i=e.length;++r<i;)Nn(e[r].geometry,t)}},Da={Sphere:function(s,t){t.sphere()},Point:function(s,t){s=s.coordinates,t.point(s[0],s[1],s[2])},MultiPoint:function(s,t){for(var e=s.coordinates,r=-1,i=e.length;++r<i;)s=e[r],t.point(s[0],s[1],s[2])},LineString:function(s,t){Co(s.coordinates,t,0)},MultiLineString:function(s,t){for(var e=s.coordinates,r=-1,i=e.length;++r<i;)Co(e[r],t,0)},Polygon:function(s,t){ba(s.coordinates,t)},MultiPolygon:function(s,t){for(var e=s.coordinates,r=-1,i=e.length;++r<i;)ba(e[r],t)},GeometryCollection:function(s,t){for(var e=s.geometries,r=-1,i=e.length;++r<i;)Nn(e[r],t)}};function Co(s,t,e){var r=-1,i=s.length-e,n;for(t.lineStart();++r<i;)n=s[r],t.point(n[0],n[1],n[2]);t.lineEnd()}function ba(s,t){var e=-1,r=s.length;for(t.polygonStart();++e<r;)Co(s[e],t,1);t.polygonEnd()}function ru(s,t){s&&Na.hasOwnProperty(s.type)?Na[s.type](s,t):Nn(s,t)}Dr(),Dr();function Wo(s){return[Es(s[1],s[0]),$r(s[2])]}function Ss(s){var t=s[0],e=s[1],r=Mt(e);return[r*Mt(t),r*Bt(t),Bt(e)]}function Dn(s,t){return s[0]*t[0]+s[1]*t[1]+s[2]*t[2]}function bn(s,t){return[s[1]*t[2]-s[2]*t[1],s[2]*t[0]-s[0]*t[2],s[0]*t[1]-s[1]*t[0]]}function To(s,t){s[0]+=t[0],s[1]+=t[1],s[2]+=t[2]}function Rn(s,t){return[s[0]*t,s[1]*t,s[2]*t]}function Io(s){var t=Ps(s[0]*s[0]+s[1]*s[1]+s[2]*s[2]);s[0]/=t,s[1]/=t,s[2]/=t}Dr();function Ra(s,t){function e(r,i){return r=s(r,i),t(r[0],r[1])}return s.invert&&t.invert&&(e.invert=function(r,i){return r=t.invert(r,i),r&&s.invert(r[0],r[1])}),e}function Lo(s,t){return[s>pt?s-tr:s<-pt?s+tr:s,t]}Lo.invert=Lo;function su(s,t,e){return(s%=tr)?t||e?Ra(Ba(s),Oa(t,e)):Ba(s):t||e?Oa(t,e):Lo}function Ma(s){return function(t,e){return t+=s,[t>pt?t-tr:t<-pt?t+tr:t,e]}}function Ba(s){var t=Ma(s);return t.invert=Ma(-s),t}function Oa(s,t){var e=Mt(s),r=Bt(s),i=Mt(t),n=Bt(t);function o(f,u){var l=Mt(u),a=Mt(f)*l,c=Bt(f)*l,p=Bt(u),d=p*e+a*r;return[Es(c*i-d*n,a*e-p*r),$r(d*i+c*n)]}return o.invert=function(f,u){var l=Mt(u),a=Mt(f)*l,c=Bt(f)*l,p=Bt(u),d=p*i-c*n;return[Es(c*i+p*n,a*e+d*r),$r(d*e-a*r)]},o}function nu(s,t,e,r,i,n){if(e){var o=Mt(t),f=Bt(t),u=r*e;i==null?(i=t+r*tr,n=t-u/2):(i=Fa(o,i),n=Fa(o,n),(r>0?i<n:i>n)&&(i+=r*tr));for(var l,a=i;r>0?a>n:a<n;a-=u)l=Wo([o,-f*Mt(a),-f*Bt(a)]),s.point(l[0],l[1])}}function Fa(s,t){t=Ss(t),t[0]-=s,Io(t);var e=Sa(-t[1]);return((-t[2]<0?-e:e)+tr-Tt)%tr}function xa(){var s=[],t;return{point:function(e,r){t.push([e,r])},lineStart:function(){s.push(t=[])},lineEnd:$s,rejoin:function(){s.length>1&&s.push(s.pop().concat(s.shift()))},result:function(){var e=s;return s=[],t=null,e}}}function ou(s,t,e,r,i,n){var o=s[0],f=s[1],u=t[0],l=t[1],a=0,c=1,p=u-o,d=l-f,h;if(h=e-o,!(!p&&h>0)){if(h/=p,p<0){if(h<a)return;h<c&&(c=h)}else if(p>0){if(h>c)return;h>a&&(a=h)}if(h=i-o,!(!p&&h<0)){if(h/=p,p<0){if(h>c)return;h>a&&(a=h)}else if(p>0){if(h<a)return;h<c&&(c=h)}if(h=r-f,!(!d&&h>0)){if(h/=d,d<0){if(h<a)return;h<c&&(c=h)}else if(d>0){if(h>c)return;h>a&&(a=h)}if(h=n-f,!(!d&&h<0)){if(h/=d,d<0){if(h>c)return;h>a&&(a=h)}else if(d>0){if(h<a)return;h<c&&(c=h)}return a>0&&(s[0]=o+a*p,s[1]=f+a*d),c<1&&(t[0]=o+c*p,t[1]=f+c*d),!0}}}}}function Mn(s,t){return fe(s[0]-t[0])<Tt&&fe(s[1]-t[1])<Tt}function Bn(s,t,e,r){this.x=s,this.z=t,this.o=e,this.e=r,this.v=!1,this.n=this.p=null}function ka(s,t,e,r,i){var n=[],o=[],f,u;if(s.forEach(function(h){if(!((m=h.length-1)<=0)){var m,_=h[0],W=h[m],C;if(Mn(_,W)){for(i.lineStart(),f=0;f<m;++f)i.point((_=h[f])[0],_[1]);i.lineEnd();return}n.push(C=new Bn(_,h,null,!0)),o.push(C.o=new Bn(_,null,C,!1)),n.push(C=new Bn(W,h,null,!1)),o.push(C.o=new Bn(W,null,C,!0))}}),!!n.length){for(o.sort(t),Va(n),Va(o),f=0,u=o.length;f<u;++f)o[f].e=e=!e;for(var l=n[0],a,c;;){for(var p=l,d=!0;p.v;)if((p=p.n)===l)return;a=p.z,i.lineStart();do{if(p.v=p.o.v=!0,p.e){if(d)for(f=0,u=a.length;f<u;++f)i.point((c=a[f])[0],c[1]);else r(p.x,p.n.x,1,i);p=p.n}else{if(d)for(a=p.p.z,f=a.length-1;f>=0;--f)i.point((c=a[f])[0],c[1]);else r(p.x,p.p.x,-1,i);p=p.p}p=p.o,a=p.z,d=!d}while(!p.v);i.lineEnd()}}}function Va(s){if(t=s.length){for(var t,e=0,r=s[0],i;++e<t;)r.n=i=s[e],i.p=r,r=i;r.n=i=s[0],i.p=r}}function Ga(s,t){return s<t?-1:s>t?1:s>=t?0:NaN}function au(s){return s.length===1&&(s=fu(s)),{left:function(t,e,r,i){for(r==null&&(r=0),i==null&&(i=t.length);r<i;){var n=r+i>>>1;s(t[n],e)<0?r=n+1:i=n}return r},right:function(t,e,r,i){for(r==null&&(r=0),i==null&&(i=t.length);r<i;){var n=r+i>>>1;s(t[n],e)>0?i=n:r=n+1}return r}}}function fu(s){return function(t,e){return Ga(s(t),e)}}au(Ga);function Xa(s){for(var t=s.length,e,r=-1,i=0,n,o;++r<t;)i+=s[r].length;for(n=new Array(i);--t>=0;)for(o=s[t],e=o.length;--e>=0;)n[--i]=o[e];return n}var tn=1e9,On=-tn;function uu(s,t,e,r){function i(l,a){return s<=l&&l<=e&&t<=a&&a<=r}function n(l,a,c,p){var d=0,h=0;if(l==null||(d=o(l,c))!==(h=o(a,c))||u(l,a)<0^c>0)do p.point(d===0||d===3?s:e,d>1?r:t);while((d=(d+c+4)%4)!==h);else p.point(a[0],a[1])}function o(l,a){return fe(l[0]-s)<Tt?a>0?0:3:fe(l[0]-e)<Tt?a>0?2:1:fe(l[1]-t)<Tt?a>0?1:0:a>0?3:2}function f(l,a){return u(l.x,a.x)}function u(l,a){var c=o(l,1),p=o(a,1);return c!==p?c-p:c===0?a[1]-l[1]:c===1?l[0]-a[0]:c===2?l[1]-a[1]:a[0]-l[0]}return function(l){var a=l,c=xa(),p,d,h,m,_,W,C,T,L,w,D,b={point:B,lineStart:q,lineEnd:Z,polygonStart:x,polygonEnd:M};function B(X,K){i(X,K)&&a.point(X,K)}function R(){for(var X=0,K=0,et=d.length;K<et;++K)for(var st=d[K],ut=1,ii=st.length,ze=st[0],Ot,ri,er=ze[0],Fi=ze[1];ut<ii;++ut)Ot=er,ri=Fi,ze=st[ut],er=ze[0],Fi=ze[1],ri<=r?Fi>r&&(er-Ot)*(r-ri)>(Fi-ri)*(s-Ot)&&++X:Fi<=r&&(er-Ot)*(r-ri)<(Fi-ri)*(s-Ot)&&--X;return X}function x(){a=c,p=[],d=[],D=!0}function M(){var X=R(),K=D&&X,et=(p=Xa(p)).length;(K||et)&&(l.polygonStart(),K&&(l.lineStart(),n(null,null,1,l),l.lineEnd()),et&&ka(p,f,X,n,l),l.polygonEnd()),a=l,p=d=h=null}function q(){b.point=O,d&&d.push(h=[]),w=!0,L=!1,C=T=NaN}function Z(){p&&(O(m,_),W&&L&&c.rejoin(),p.push(c.result())),b.point=B,L&&a.lineEnd()}function O(X,K){var et=i(X,K);if(d&&h.push([X,K]),w)m=X,_=K,W=et,w=!1,et&&(a.lineStart(),a.point(X,K));else if(et&&L)a.point(X,K);else{var st=[C=Math.max(On,Math.min(tn,C)),T=Math.max(On,Math.min(tn,T))],ut=[X=Math.max(On,Math.min(tn,X)),K=Math.max(On,Math.min(tn,K))];ou(st,ut,s,t,e,r)?(L||(a.lineStart(),a.point(st[0],st[1])),a.point(ut[0],ut[1]),et||a.lineEnd(),D=!1):et&&(a.lineStart(),a.point(X,K),D=!1)}C=X,T=K,L=et}return b}}var Ao=Dr();function hu(s,t){var e=t[0],r=t[1],i=[Bt(e),-Mt(e),0],n=0,o=0;Ao.reset();for(var f=0,u=s.length;f<u;++f)if(a=(l=s[f]).length)for(var l,a,c=l[a-1],p=c[0],d=c[1]/2+Pa,h=Bt(d),m=Mt(d),_=0;_<a;++_,p=C,h=L,m=w,c=W){var W=l[_],C=W[0],T=W[1]/2+Pa,L=Bt(T),w=Mt(T),D=C-p,b=D>=0?1:-1,B=b*D,R=B>pt,x=h*L;if(Ao.add(Es(x*b*Bt(B),m*w+x*Mt(B))),n+=R?D+b*tr:D,R^p>=e^C>=e){var M=bn(Ss(c),Ss(W));Io(M);var q=bn(i,M);Io(q);var Z=(R^D>=0?-1:1)*$r(q[2]);(r>Z||r===Z&&(M[0]||M[1]))&&(o+=R^D>=0?1:-1)}}return(n<-Tt||n<Tt&&Ao<-Tt)^o&1}Dr();function za(s){return s}Dr(),Dr();var Ns=1/0,Fn=Ns,en=-Ns,xn=en,Ya={point:lu,lineStart:$s,lineEnd:$s,polygonStart:$s,polygonEnd:$s,result:function(){var s=[[Ns,Fn],[en,xn]];return en=xn=-(Fn=Ns=1/0),s}};function lu(s,t){s<Ns&&(Ns=s),s>en&&(en=s),t<Fn&&(Fn=t),t>xn&&(xn=t)}Dr();function Ua(s,t,e,r){return function(i,n){var o=t(n),f=i.invert(r[0],r[1]),u=xa(),l=t(u),a=!1,c,p,d,h={point:m,lineStart:W,lineEnd:C,polygonStart:function(){h.point=T,h.lineStart=L,h.lineEnd=w,p=[],c=[]},polygonEnd:function(){h.point=m,h.lineStart=W,h.lineEnd=C,p=Xa(p);var D=hu(c,f);p.length?(a||(n.polygonStart(),a=!0),ka(p,pu,D,e,n)):D&&(a||(n.polygonStart(),a=!0),n.lineStart(),e(null,null,1,n),n.lineEnd()),a&&(n.polygonEnd(),a=!1),p=c=null},sphere:function(){n.polygonStart(),n.lineStart(),e(null,null,1,n),n.lineEnd(),n.polygonEnd()}};function m(D,b){var B=i(D,b);s(D=B[0],b=B[1])&&n.point(D,b)}function _(D,b){var B=i(D,b);o.point(B[0],B[1])}function W(){h.point=_,o.lineStart()}function C(){h.point=m,o.lineEnd()}function T(D,b){d.push([D,b]);var B=i(D,b);l.point(B[0],B[1])}function L(){l.lineStart(),d=[]}function w(){T(d[0][0],d[0][1]),l.lineEnd();var D=l.clean(),b=u.result(),B,R=b.length,x,M,q;if(d.pop(),c.push(d),d=null,!!R){if(D&1){if(M=b[0],(x=M.length-1)>0){for(a||(n.polygonStart(),a=!0),n.lineStart(),B=0;B<x;++B)n.point((q=M[B])[0],q[1]);n.lineEnd()}return}R>1&&D&2&&b.push(b.pop().concat(b.shift())),p.push(b.filter(cu))}}return h}}function cu(s){return s.length>1}function pu(s,t){return((s=s.x)[0]<0?s[1]-$i-Tt:$i-s[1])-((t=t.x)[0]<0?t[1]-$i-Tt:$i-t[1])}const qa=Ua(function(){return!0},gu,mu,[-pt,-$i]);function gu(s){var t=NaN,e=NaN,r=NaN,i;return{lineStart:function(){s.lineStart(),i=1},point:function(n,o){var f=n>0?pt:-pt,u=fe(n-t);fe(u-pt)<Tt?(s.point(t,e=(e+o)/2>0?$i:-$i),s.point(r,e),s.lineEnd(),s.lineStart(),s.point(f,e),s.point(n,e),i=0):r!==f&&u>=pt&&(fe(t-r)<Tt&&(t-=r*Tt),fe(n-f)<Tt&&(n-=f*Tt),e=du(t,e,n,o),s.point(r,e),s.lineEnd(),s.lineStart(),s.point(f,e),i=0),s.point(t=n,e=o),r=f},lineEnd:function(){s.lineEnd(),t=e=NaN},clean:function(){return 2-i}}}function du(s,t,e,r){var i,n,o=Bt(s-e);return fe(o)>Tt?iu((Bt(t)*(n=Mt(r))*Bt(e)-Bt(r)*(i=Mt(t))*Bt(s))/(i*n*o)):(t+r)/2}function mu(s,t,e,r){var i;if(s==null)i=e*$i,r.point(-pt,i),r.point(0,i),r.point(pt,i),r.point(pt,0),r.point(pt,-i),r.point(0,-i),r.point(-pt,-i),r.point(-pt,0),r.point(-pt,i);else if(fe(s[0]-t[0])>Tt){var n=s[0]<t[0]?pt:-pt;i=e*n/2,r.point(-n,i),r.point(0,i),r.point(n,i)}else r.point(t[0],t[1])}function yu(s,t){var e=Mt(s),r=e>0,i=fe(e)>Tt;function n(a,c,p,d){nu(d,s,t,p,a,c)}function o(a,c){return Mt(a)*Mt(c)>e}function f(a){var c,p,d,h,m;return{lineStart:function(){h=d=!1,m=1},point:function(_,W){var C=[_,W],T,L=o(_,W),w=r?L?0:l(_,W):L?l(_+(_<0?pt:-pt),W):0;if(!c&&(h=d=L)&&a.lineStart(),L!==d&&(T=u(c,C),(!T||Mn(c,T)||Mn(C,T))&&(C[0]+=Tt,C[1]+=Tt,L=o(C[0],C[1]))),L!==d)m=0,L?(a.lineStart(),T=u(C,c),a.point(T[0],T[1])):(T=u(c,C),a.point(T[0],T[1]),a.lineEnd()),c=T;else if(i&&c&&r^L){var D;!(w&p)&&(D=u(C,c,!0))&&(m=0,r?(a.lineStart(),a.point(D[0][0],D[0][1]),a.point(D[1][0],D[1][1]),a.lineEnd()):(a.point(D[1][0],D[1][1]),a.lineEnd(),a.lineStart(),a.point(D[0][0],D[0][1])))}L&&(!c||!Mn(c,C))&&a.point(C[0],C[1]),c=C,d=L,p=w},lineEnd:function(){d&&a.lineEnd(),c=null},clean:function(){return m|(h&&d)<<1}}}function u(a,c,p){var d=Ss(a),h=Ss(c),m=[1,0,0],_=bn(d,h),W=Dn(_,_),C=_[0],T=W-C*C;if(!T)return!p&&a;var L=e*W/T,w=-e*C/T,D=bn(m,_),b=Rn(m,L),B=Rn(_,w);To(b,B);var R=D,x=Dn(b,R),M=Dn(R,R),q=x*x-M*(Dn(b,b)-1);if(!(q<0)){var Z=Ps(q),O=Rn(R,(-x-Z)/M);if(To(O,b),O=Wo(O),!p)return O;var X=a[0],K=c[0],et=a[1],st=c[1],ut;K<X&&(ut=X,X=K,K=ut);var ii=K-X,ze=fe(ii-pt)<Tt,Ot=ze||ii<Tt;if(!ze&&st<et&&(ut=et,et=st,st=ut),Ot?ze?et+st>0^O[1]<(fe(O[0]-X)<Tt?et:st):et<=O[1]&&O[1]<=st:ii>pt^(X<=O[0]&&O[0]<=K)){var ri=Rn(R,(-x+Z)/M);return To(ri,b),[O,Wo(ri)]}}}function l(a,c){var p=r?s:pt-s,d=0;return a<-p?d|=1:a>p&&(d|=2),c<-p?d|=4:c>p&&(d|=8),d}return Ua(o,f,n,r?[0,-s]:[-pt,s-pt])}function Ha(s){return function(t){var e=new wo;for(var r in s)e[r]=s[r];return e.stream=t,e}}function wo(){}wo.prototype={constructor:wo,point:function(s,t){this.stream.point(s,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function Za(s,t,e){var r=t[1][0]-t[0][0],i=t[1][1]-t[0][1],n=s.clipExtent&&s.clipExtent();s.scale(150).translate([0,0]),n!=null&&s.clipExtent(null),ru(e,s.stream(Ya));var o=Ya.result(),f=Math.min(r/(o[1][0]-o[0][0]),i/(o[1][1]-o[0][1])),u=+t[0][0]+(r-f*(o[1][0]+o[0][0]))/2,l=+t[0][1]+(i-f*(o[1][1]+o[0][1]))/2;return n!=null&&s.clipExtent(n),s.scale(f*150).translate([u,l])}function vu(s,t,e){return Za(s,[[0,0],t],e)}var Ka=16,_u=Mt(30*Wi);function ja(s,t){return+t?Wu(s,t):Cu(s)}function Cu(s){return Ha({point:function(t,e){t=s(t,e),this.stream.point(t[0],t[1])}})}function Wu(s,t){function e(r,i,n,o,f,u,l,a,c,p,d,h,m,_){var W=l-r,C=a-i,T=W*W+C*C;if(T>4*t&&m--){var L=o+p,w=f+d,D=u+h,b=Ps(L*L+w*w+D*D),B=$r(D/=b),R=fe(fe(D)-1)<Tt||fe(n-c)<Tt?(n+c)/2:Es(w,L),x=s(R,B),M=x[0],q=x[1],Z=M-r,O=q-i,X=C*Z-W*O;(X*X/T>t||fe((W*Z+C*O)/T-.5)>.3||o*p+f*d+u*h<_u)&&(e(r,i,n,o,f,u,M,q,R,L/=b,w/=b,D,m,_),_.point(M,q),e(M,q,R,L,w,D,l,a,c,p,d,h,m,_))}}return function(r){var i,n,o,f,u,l,a,c,p,d,h,m,_={point:W,lineStart:C,lineEnd:L,polygonStart:function(){r.polygonStart(),_.lineStart=w},polygonEnd:function(){r.polygonEnd(),_.lineStart=C}};function W(B,R){B=s(B,R),r.point(B[0],B[1])}function C(){c=NaN,_.point=T,r.lineStart()}function T(B,R){var x=Ss([B,R]),M=s(B,R);e(c,p,a,d,h,m,c=M[0],p=M[1],a=B,d=x[0],h=x[1],m=x[2],Ka,r),r.point(c,p)}function L(){_.point=W,r.lineEnd()}function w(){C(),_.point=D,_.lineEnd=b}function D(B,R){T(i=B,R),n=c,o=p,f=d,u=h,l=m,_.point=T}function b(){e(c,p,a,d,h,m,n,o,i,f,u,l,Ka,r),_.lineEnd=L,L()}return _}}var Tu=Ha({point:function(s,t){this.stream.point(s*Wi,t*Wi)}});function Iu(s){return Lu(function(){return s})()}function Lu(s){var t,e=150,r=480,i=250,n,o,f=0,u=0,l=0,a=0,c=0,p,d,h=null,m=qa,_=null,W,C,T,L=za,w=.5,D=ja(M,w),b,B;function R(O){return O=d(O[0]*Wi,O[1]*Wi),[O[0]*e+n,o-O[1]*e]}function x(O){return O=d.invert((O[0]-n)/e,(o-O[1])/e),O&&[O[0]*br,O[1]*br]}function M(O,X){return O=t(O,X),[O[0]*e+n,o-O[1]*e]}R.stream=function(O){return b&&B===O?b:b=Tu(m(p,D(L(B=O))))},R.clipAngle=function(O){return arguments.length?(m=+O?yu(h=O*Wi,6*Wi):(h=null,qa),Z()):h*br},R.clipExtent=function(O){return arguments.length?(L=O==null?(_=W=C=T=null,za):uu(_=+O[0][0],W=+O[0][1],C=+O[1][0],T=+O[1][1]),Z()):_==null?null:[[_,W],[C,T]]},R.scale=function(O){return arguments.length?(e=+O,q()):e},R.translate=function(O){return arguments.length?(r=+O[0],i=+O[1],q()):[r,i]},R.center=function(O){return arguments.length?(f=O[0]%360*Wi,u=O[1]%360*Wi,q()):[f*br,u*br]},R.rotate=function(O){return arguments.length?(l=O[0]%360*Wi,a=O[1]%360*Wi,c=O.length>2?O[2]%360*Wi:0,q()):[l*br,a*br,c*br]},R.precision=function(O){return arguments.length?(D=ja(M,w=O*O),Z()):Ps(w)},R.fitExtent=function(O,X){return Za(R,O,X)},R.fitSize=function(O,X){return vu(R,O,X)};function q(){d=Ra(p=su(l,a,c),t);var O=t(f,u);return n=r-O[0]*e,o=i+O[1]*e,Z()}function Z(){return b=B=null,R}return function(){return t=s.apply(this,arguments),R.invert=t.invert&&x,q()}}function Ja(s){return function(t,e){var r=Mt(t),i=Mt(e),n=s(r*i);return[n*i*Bt(t),n*Bt(e)]}}function Qa(s){return function(t,e){var r=Ps(t*t+e*e),i=s(r),n=Bt(i),o=Mt(i);return[Es(t*n,r*o),$r(r&&e*n/r)]}}var Au=Ja(function(s){return Ps(2/(1+s))});Au.invert=Qa(function(s){return 2*$r(s/2)});var $a=Ja(function(s){return(s=Sa(s))&&s/Bt(s)});$a.invert=Qa(function(s){return s});function wu(){return Iu($a).scale(79.4188).clipAngle(180-.001)}function tf(s,t){return[s,t]}tf.invert=tf;function Eu(s,t,e){e=e||{};var r=e.units||"kilometers",i=e.steps||8;if(!s)throw new Error("geojson is required");if(typeof e!="object")throw new Error("options must be an object");if(typeof i!="number")throw new Error("steps must be an number");if(t===void 0)throw new Error("radius is required");if(i<=0)throw new Error("steps must be greater than 0");var n=[];switch(s.type){case"GeometryCollection":return Kn(s,function(o){var f=kn(o,t,r,i);f&&n.push(f)}),on(n);case"FeatureCollection":return Zn(s,function(o){var f=kn(o,t,r,i);f&&Zn(f,function(u){u&&n.push(u)})}),on(n)}return kn(s,t,r,i)}function kn(s,t,e,r){var i=s.properties||{},n=s.type==="Feature"?s.geometry:s;if(n.type==="GeometryCollection"){var o=[];return Kn(s,function(m){var _=kn(m,t,e,r);_&&o.push(_)}),on(o)}var f=Pu(n),u={type:n.type,coordinates:rf(n.coordinates,f)},l=new uo,a=l.read(u),c=qn(an(t,e),"meters"),p=Yt.bufferOp(a,c,r),d=new aa;if(p=d.write(p),!ef(p.coordinates)){var h={type:p.type,coordinates:sf(p.coordinates,f)};return yr(h,i)}}function ef(s){return Array.isArray(s[0])?ef(s[0]):isNaN(s[0])}function rf(s,t){return typeof s[0]!="object"?t(s):s.map(function(e){return rf(e,t)})}function sf(s,t){return typeof s[0]!="object"?t.invert(s):s.map(function(e){return sf(e,t)})}function Pu(s){var t=wf(s).geometry.coordinates,e=[-t[0],-t[1]];return wu().rotate(e).scale(ve)}class Su{constructor(){I(this,"LineID","myEntity1");I(this,"Tag","");I(this,"towers",[]);I(this,"ISPhaseSequence",!1);I(this,"Wairnum",0);I(this,"Type",0);I(this,"corridor_features",[]);I(this,"wireAColor","#FFFFFF");I(this,"wireBColor","#FFFFFF");I(this,"wireCColor","#FFFFFF");I(this,"wireTColor","#FFFFFF");I(this,"wireD1Color","#FFFFFF");I(this,"wireD2Color","#FFFFFF");I(this,"wireWidth",1);I(this,"LineDistanceDisplaymin",0);I(this,"LineDistanceDisplaymax",5e3)}}class Nu{constructor(){I(this,"id","");I(this,"type",0);I(this,"modelid","");I(this,"lon",0);I(this,"lat",0);I(this,"alt",0);I(this,"modelH",0);I(this,"modelurl","");I(this,"modelScale",1);I(this,"modelbox","")}}var me=(s=>(s[s.树木=0]="树木",s[s.房屋=1]="房屋",s[s.高速公路=2]="高速公路",s[s.电力线=3]="电力线",s[s.导线=4]="导线",s[s.地面=5]="地面",s[s.其他地物=6]="其他地物",s))(me||{});class Du{constructor(){I(this,"id","");I(this,"name","");I(this,"type",0);I(this,"Longitude",0);I(this,"Latitude",0);I(this,"Altitude",0);I(this,"RollX",0);I(this,"RollY",90);I(this,"RollZ",0);I(this,"towerScale",1);I(this,"towerHeight",0);I(this,"towerModelUri","");I(this,"towerPoint",[]);I(this,"Insulators",[]);I(this,"DistanceDisplaymin",0);I(this,"DistanceDisplaymax",1e3)}}class bu{constructor(){I(this,"treeId",0);I(this,"treeCoordinates",[0,0,0]);I(this,"conductorCoordinates",[0,0,0]);I(this,"horizontalDistance",0);I(this,"verticalDistance",0);I(this,"straightLineDistance",0);I(this,"clearanceDistance",0);I(this,"timestamp",0)}}class Ru{constructor(){I(this,"id","");I(this,"name","");I(this,"type",0);I(this,"WairFX","进");I(this,"linenum",1);I(this,"Wairnum",0);I(this,"PhaseSequence",0);I(this,"RollX",0);I(this,"RollY",0);I(this,"RollZ",0);I(this,"InsulatorScale",1);I(this,"InsulatorLength",0);I(this,"InsulatorModelUri","");I(this,"InsulatorPoint",[]);I(this,"DistanceDisplaymin",0);I(this,"DistanceDisplaymax",500)}}class Mu{constructor(){I(this,"name","");I(this,"X",-45);I(this,"Y",90);I(this,"Z",0)}}var Le=(s=>(s[s.A相=0]="A相",s[s.B相=1]="B相",s[s.C相=2]="C相",s[s.地线1=3]="地线1",s[s.地线2=4]="地线2",s))(Le||{}),Ti=(s=>(s[s.直线塔=0]="直线塔",s[s.耐张塔=1]="耐张塔",s[s.门架塔=2]="门架塔",s[s.换位塔=3]="换位塔",s))(Ti||{}),nf=(s=>(s[s.交流单回路=0]="交流单回路",s[s.交流双回路=1]="交流双回路",s[s.直流单回路=2]="直流单回路",s[s.直流双回路=3]="直流双回路",s[s.交流四回路=4]="交流四回路",s))(nf||{}),rn=(s=>(s[s.地线=0]="地线",s[s.回路一=1]="回路一",s[s.回路二=2]="回路二",s[s.回路三=3]="回路三",s[s.回路四=4]="回路四",s))(rn||{}),Kt=(s=>(s[s.悬垂串=0]="悬垂串",s[s.耐张串=1]="耐张串",s[s.跳线串=2]="跳线串",s[s.硬跳串=3]="硬跳串",s[s.V串=4]="V串",s[s.地线串=5]="地线串",s[s.绕跳临时=6]="绕跳临时",s))(Kt||{}),E=(s=>(s[s.单分裂=0]="单分裂",s[s.双分裂=1]="双分裂",s[s.四分裂=2]="四分裂",s[s.六分裂=3]="六分裂",s[s.八分裂=4]="八分裂",s))(E||{}),ue=(s=>(s[s.直线距离=0]="直线距离",s[s.水平距离=1]="水平距离",s[s.垂直距离=2]="垂直距离",s[s.净空距离=3]="净空距离",s[s.安全距离=4]="安全距离",s[s.线间距离测量=5]="线间距离测量",s))(ue||{});class of{constructor(){I(this,"horizontalLevels");I(this,"verticalLevels");I(this,"straightLineLevels");I(this,"clearanceLevels");I(this,"wireToWireLevels")}}class Eo{constructor(){I(this,"typeRules",new Map)}}var xt=(s=>(s[s.A相=0]="A相",s[s.B相=1]="B相",s[s.C相=2]="C相",s[s.地线1=3]="地线1",s[s.地线2=4]="地线2",s[s.全部=5]="全部",s))(xt||{});class Po{constructor(){I(this,"phaseRules",new Map)}getRules(t,e){const r=t<=e?`${t}-${e}`:`${e}-${t}`;return this.phaseRules.get(r)}setRules(t,e,r){const i=t<=e?`${t}-${e}`:`${e}-${t}`;this.phaseRules.set(i,r)}}class Bu{constructor(){I(this,"timestamp",0);I(this,"phase1",0);I(this,"wire1Coordinates",[0,0,0]);I(this,"phase2",1);I(this,"wire2Coordinates",[0,0,0]);I(this,"horizontalDistance",0);I(this,"verticalDistance",0);I(this,"straightLineDistance",0);I(this,"status","正常");I(this,"statusColor","#00ff00")}}const ei={units:"kilometers"};function Vn(s,t,e,r){const i=So(s,t),n=So(s,e),o=So(s,r),f=Math.min(i,n,o);return f===i?t:f===n?e:r}function So(s,t){if(!t||t.length===0)return console.log("fastPointToLineDistance: line is empty or null"),1/0;let e=1/0;for(let i=0;i<t.length;i++){const n=t[i],o=s[0]-n[0],f=s[1]-n[1],u=o*o+f*f;u<e&&(e=u)}const r=Math.sqrt(e);return console.log(`fastPointToLineDistance result: ${r}`),r}const Gn=()=>({horizontalLevels:[{name:"critical",minDistance:0,maxDistance:160,color:"#ff0000"},{name:"danger",minDistance:160,maxDistance:170,color:"#ff0000"},{name:"warning",minDistance:170,maxDistance:180,color:"#ffa500"},{name:"safe",minDistance:180,maxDistance:1/0,color:"#00ff00"}],verticalLevels:[{name:"critical",minDistance:0,maxDistance:160,color:"#ff0000"},{name:"danger",minDistance:160,maxDistance:170,color:"#ff0000"},{name:"warning",minDistance:170,maxDistance:180,color:"#ffa500"},{name:"safe",minDistance:180,maxDistance:1/0,color:"#00ff00"}],straightLineLevels:[{name:"critical",minDistance:0,maxDistance:160,color:"#ff0000"},{name:"danger",minDistance:160,maxDistance:170,color:"#ff0000"},{name:"warning",minDistance:170,maxDistance:180,color:"#ffa500"},{name:"safe",minDistance:180,maxDistance:1/0,color:"#00ff00"}],clearanceLevels:[{name:"critical",minDistance:0,maxDistance:10,color:"#ff0000"},{name:"danger",minDistance:10,maxDistance:15,color:"#ff6600"},{name:"warning",minDistance:15,maxDistance:20,color:"#ffa500"},{name:"safe",minDistance:20,maxDistance:1/0,color:"#00ff00"}]}),af=(()=>{const s=new Eo;return s.typeRules.set(me.树木,Gn()),s.typeRules.set(me.房屋,Gn()),s.typeRules.set(me.高速公路,Gn()),s.typeRules.set(me.电力线,Gn()),s})(),Ou=(s,t)=>s.typeRules.get(t)||new of,Rr=(s,t,e,r=af,i,n=me.树木)=>{const f=Ou(r||af,n),u=Me(s.slice(0,2)),{nearestCoord:l}=ff(s,t),a=t.findIndex(Ft=>Ft[0]==l[0]&&Ft[1]==l[1]);let c=[];if(a==0)c.push(t[0],t[1]);else if(a==t.length-1)c.push(t[t.length-2],t[t.length-1]);else{const Ft=[t[a],t[a+1]],ye=[t[a-1],t[a]];var p=Br(u,he(Ft),ei),d=Br(u,he(ye),ei);c=p>d?ye:Ft}console.log("附近的点",a,c);const h=he([c[0].slice(0,2),c[1].slice(0,2)]),m=Me(c[0].slice(0,2)),_=Me(c[1].slice(0,2));var W=Br(u,h,ei),C=ir(u,m,ei)||0,T=Math.sqrt(C*C-W*W)||0;let L=c[0].slice(0,2);T>0&&(L=Zo(h,0,T,ei).geometry.coordinates[1]);const w=ir(m,_,ei),D=Math.abs(c[0][2]-c[1][2]),b=Math.min(c[0][2],c[1][2]),B=Math.max(c[0][2],c[1][2]),R=c[0][2]>c[1][2]?B-T/w*D:T/w*D+b;console.log("高度差>>>>",D),console.log("最小高度>>>>",b),console.log("最大高度>>>>",B);const x=R-s[2],M=W*1e3,q=Math.sqrt(M*M+x*x);console.log("水平距离>>>>",M),console.log("竖直距离>>>>",x),console.log("直线距离>>>>",q);let Z="#eff819",O=g.Color.RED;const X=g.Cartesian3.fromDegrees(s[0],s[1],s[2]),K=g.Cartesian3.fromDegrees(L[0],L[1],s[2]),et=g.Cartesian3.fromDegrees(L[0],L[1],R);console.log(`坐标详情: 树木=[${s[0]}, ${s[1]}, ${s[2]}], 导线点=[${L[0]}, ${L[1]}, ${R}]`);var st=Af(Me([s[0],s[1]]),Me([L[0],L[1]])).geometry.coordinates;const ut=g.Cartesian3.fromDegrees(st[0],st[1],s[2]),ii=g.Cartesian3.fromDegrees(st[0],st[1],R-x/2),ze=g.Cartesian3.fromDegrees(L[0],L[1],R-x/2);let Ot;if(i.includes(ue.水平距离)&&(f.horizontalLevels&&(Ot=f.horizontalLevels.find(Ft=>M>=Ft.minDistance&&M<=Ft.maxDistance)),Ot)){Z=Ot.color,O=g.Color.fromCssColorString(Ot.color);const Ft={position:ut,name:"水平距离",label:{text:`水平距离${M.toFixed(1)}米`,fillColor:g.Color.fromCssColorString(Z),font:"12px sans-serif",pixelOffset:new g.Cartesian2(0,0),scaleByDistance:new g.NearFarScalar(1e3,1.5,2e3,1),disableDepthTestDistance:Number.POSITIVE_INFINITY}},ye=[];ye.push(X),ye.push(K);var ri={polyline:{show:!0,positions:ye,clampToGround:!1,width:2,material:O,shadows:g.ShadowMode.DISABLED}};e.add(Ft),e.add(ri)}if(i.includes(ue.垂直距离)&&(f.verticalLevels&&(Ot=f.verticalLevels.find(Ft=>x>=Ft.minDistance&&x<=Ft.maxDistance)),Ot)){Z=Ot.color,O=g.Color.fromCssColorString(Ot.color);const Ft={position:ze,name:"垂直距离",label:{text:`垂直距离${x.toFixed(1)}米`,fillColor:g.Color.fromCssColorString(Z),font:"12px sans-serif",pixelOffset:new g.Cartesian2(0,0),scaleByDistance:new g.NearFarScalar(1e3,1.5,2e3,1),disableDepthTestDistance:Number.POSITIVE_INFINITY}},ye=[];ye.push(K),ye.push(et);var er={polyline:{show:!0,positions:ye,clampToGround:!1,width:2,material:O,shadows:g.ShadowMode.DISABLED}};e.add(Ft),e.add(er)}if(i.includes(ue.直线距离)&&(f.straightLineLevels&&(Ot=f.straightLineLevels.find(Ft=>q>=Ft.minDistance&&q<=Ft.maxDistance)),Ot)){Z=Ot.color,O=g.Color.fromCssColorString(Ot.color);const Ft={position:ii,name:"直线距离",label:{text:`直线距离${q.toFixed(1)}米`,fillColor:g.Color.fromCssColorString(Z),font:"12px sans-serif",pixelOffset:new g.Cartesian2(0,0),scaleByDistance:new g.NearFarScalar(1e3,1.5,2e3,1),disableDepthTestDistance:Number.POSITIVE_INFINITY}},ye=[];ye.push(X),ye.push(et);var Fi={polyline:{show:!0,positions:ye,clampToGround:!1,width:2,material:O,shadows:g.ShadowMode.DISABLED}};e.add(Ft),e.add(Fi)}},Xn=(s,t,e)=>{const r=Me(s.slice(0,2)),{nearestCoord:i}=ff(s,t),n=t.findIndex(x=>x[0]==i[0]&&x[1]==i[1]);let o=[];if(n==0)o.push(t[0],t[1]);else if(n==t.length-1)o.push(t[t.length-2],t[t.length-1]);else{const x=[t[n],t[n+1]],M=[t[n-1],t[n]];var f=Br(r,he(x),ei),u=Br(r,he(M),ei);o=f>u?M:x}const l=he([o[0].slice(0,2),o[1].slice(0,2)]),a=Me(o[0].slice(0,2)),c=Me(o[1].slice(0,2));var p=Br(r,l,ei),d=ir(r,a,ei)||0,h=Math.sqrt(d*d-p*p)||0;let m=o[0].slice(0,2);h>0&&(m=Zo(l,0,h,ei).geometry.coordinates[1]);const _=ir(a,c,ei),W=Math.abs(o[0][2]-o[1][2]),C=Math.min(o[0][2],o[1][2]),T=Math.max(o[0][2],o[1][2]),L=o[0][2]>o[1][2]?T-h/_*W:h/_*W+C,w=L-s[2],D=p*1e3,b=Math.sqrt(D*D+w*w),B=parseFloat(L.toFixed(1));return{treeId:e,treeCoordinates:[s[0],s[1],s[2]],conductorCoordinates:[m[0],m[1],L],horizontalDistance:parseFloat(D.toFixed(1)),verticalDistance:parseFloat(w.toFixed(1)),straightLineDistance:parseFloat(b.toFixed(1)),clearanceDistance:B,timestamp:Date.now()}};function ff(s,t){const e=Me(s.slice(0,2)),r=[];t.forEach(f=>{r.push(Me([f[0],f[1]]))});const i=on(r),n=Ef(e,i),o=ir(e,n,ei);return{nearestCoord:n.geometry.coordinates,nearestDistance:o}}function N(s,t,e,r,i){e||(e=new g.HeadingPitchRoll);const n=g.Transforms.headingPitchRollQuaternion(s,e,r,i),o=g.Matrix4.fromRotationTranslation(g.Matrix3.fromQuaternion(n,new g.Matrix3),s,new g.Matrix4);return g.Matrix4.multiplyByPoint(o,t,new g.Cartesian3)}function Re(s,t){var e=s.cartesianToCartographic(t),r=g.Math.toDegrees(e.latitude),i=g.Math.toDegrees(e.longitude),n=e.height;return[i,r,n]}function dr(s,t,e,r){const i=t*Math.PI/180,n=s*Math.PI/180,o=r*Math.PI/180,f=e*Math.PI/180,u=Math.sin(f-n)*Math.cos(o),l=Math.cos(i)*Math.sin(o)-Math.sin(i)*Math.cos(o)*Math.cos(f-n);let a=Math.atan2(u,l)*180/Math.PI;return a=(a+360)%360,a}function v(s,t=6){const e=[];for(var r=0;r<s.length-1;r++)e.push(...Fu(s[r],s[r+1],t*-1e3,100));return e}function Fu(s,t,e,r){var i=[],n=g.Cartographic.fromCartesian(s),o=g.Cartographic.fromCartesian(t),f=n.longitude*180/Math.PI,u=n.latitude*180/Math.PI,l=o.longitude*180/Math.PI,a=o.latitude*180/Math.PI,c=Math.sqrt((f-l)*(f-l)+(u-a)*(u-a)),p=c*e,d=g.Cartesian3.clone(s),h=g.Cartesian3.clone(t),m=g.Cartesian3.distance(d,g.Cartesian3.ZERO),_=g.Cartesian3.distance(h,g.Cartesian3.ZERO);if(g.Cartesian3.normalize(d,d),g.Cartesian3.normalize(h,h),g.Cartesian3.distance(d,h)==0)return i;var W=g.Cartesian3.angleBetween(d,h);i.push(s);for(var C=1;C<r-1;C++){var T=C*1/(r-1),L=1-T,w=Math.sin(L*W)/Math.sin(W),D=Math.sin(T*W)/Math.sin(W),b=g.Cartesian3.multiplyByScalar(d,w,new g.Cartesian3),B=g.Cartesian3.multiplyByScalar(h,D,new g.Cartesian3),R=g.Cartesian3.add(b,B,new g.Cartesian3),x=T*Math.PI,M=m*L+_*T+Math.sin(x)*p;R=g.Cartesian3.multiplyByScalar(R,M,R),i.push(R)}return i.push(t),i}function xu(s,t,e=30){const r=s.length;if(r<=2||t===0||t===r-1)return!1;const i=dr(s[t-1].Longitude,s[t-1].Latitude,s[t].Longitude,s[t].Latitude);let o=dr(s[t].Longitude,s[t].Latitude,s[t+1].Longitude,s[t+1].Latitude)-i;return o>180&&(o-=360),o<-180&&(o+=360),Math.abs(o)>=e}function No(s,t,e=2){const r=s.length;if(r<=1)return 0;if(xu(s,t,15))return t<r-1?dr(s[t].Longitude,s[t].Latitude,s[t+1].Longitude,s[t+1].Latitude):dr(s[t-1].Longitude,s[t-1].Latitude,s[t].Longitude,s[t].Latitude);let i=Math.max(0,t-e),n=Math.min(r-1,t+e);if(n-i<1)return t===r-1?dr(s[t-1].Longitude,s[t-1].Latitude,s[t].Longitude,s[t].Latitude):dr(s[t].Longitude,s[t].Latitude,s[t+1].Longitude,s[t+1].Latitude);const o=[];for(let a=i;a<n;a++){const c=dr(s[a].Longitude,s[a].Latitude,s[a+1].Longitude,s[a+1].Latitude);o.push(c)}if(o.length===1)return o[0];let f=0,u=0;for(const a of o){const c=a*Math.PI/180;f+=Math.cos(c),u+=Math.sin(c)}return(Math.atan2(u,f)*180/Math.PI+360)%360}function ku(s,t){const e=s*Math.PI/180,r=t*Math.PI/180,i=Math.cos(e),n=Math.sin(e),o=Math.cos(r),f=Math.sin(r),u=i+o,l=n+f;if(Math.abs(u)<1e-10&&Math.abs(l)<1e-10)return(s+90)%360;let a=Math.atan2(l,u)*180/Math.PI;return a=(a+360)%360,a}function Vu(s,t,e){if(!t||t.length<2)return!1;const r=Me(s),i=he(t),n=Br(r,i,{units:"meters"});return console.log(`isPointInCorridor: point=[${s[0]}, ${s[1]}], distance=${n}, threshold=${e}`),n<=e}function Gu(s,t,e=2e3){if(!s||!t||t.length<2)return console.log("filterTreesInCorridor: invalid input parameters"),[];console.log(`filterTreesInCorridor: processing ${s.length} trees, ${t.length} towers, width=${e}`);const r=t.map(n=>[n.Longitude,n.Latitude]);console.log(`filterTreesInCorridor: line points extracted, first point: [${r[0][0]}, ${r[0][1]}]`);const i=s.filter(n=>{if(n.lon===void 0||n.lat===void 0)return console.warn("filterTreesInCorridor: tree missing lon/lat properties",n),!1;const o=[n.lon,n.lat],f=Vu(o,r,e);return s.indexOf(n)<5&&console.log(`Tree ${s.indexOf(n)}: [${o[0]}, ${o[1]}], inCorridor: ${f}`),f});return console.log(`filterTreesInCorridor: found ${i.length} trees in corridor`),i}function Xu(s,t=2e3){if(!s||s.length<2)return[];const e=s.map(i=>[i.Longitude,i.Latitude]),r=he(e);try{const i=Eu(r,t/1e3,{units:"kilometers"});if(i.geometry.type==="Polygon"){let n=i.geometry.coordinates[0].map(o=>[o[0],o[1]]);return n.length>=3&&uf(n)<0&&(n=n.reverse()),n}else if(i.geometry.type==="MultiPolygon"){let n=i.geometry.coordinates[0][0].map(o=>[o[0],o[1]]);return n.length>=3&&uf(n)<0&&(n=n.reverse()),n}return[]}catch{return[]}}function uf(s){if(s.length<3)return 0;let t=0;const e=s.length;for(let r=0;r<e;r++){const i=(r+1)%e;t+=s[r][0]*s[i][1],t-=s[i][0]*s[r][1]}return t/2}class zu{constructor(t,e,r){I(this,"viewer");I(this,"LineInfo");I(this,"Keym","");I(this,"dataSource2");I(this,"entityCollection2");I(this,"offsetTowers",[]);I(this,"autoCalculateRollX",!0);I(this,"towerWirePoints",new Map);I(this,"loadedWireSegments",new Set);I(this,"loadedTowerIndices",new Set);I(this,"isDynamicLoadingEnabled",!0);I(this,"isLineModelRemoved",!1);I(this,"cameraMoveHandler",null);I(this,"offsetWires11",[]);I(this,"offsetWires12",[]);I(this,"offsetWires13",[]);I(this,"offsetWires21",[]);I(this,"offsetWires22",[]);I(this,"offsetWires23",[]);I(this,"ToffsetArcWires1A",[]);I(this,"ToffsetArcWires2A",[]);I(this,"ToffsetWires1A1",[]);I(this,"ToffsetWires1A2",[]);I(this,"ToffsetArcWires1B",[]);I(this,"ToffsetArcWires2B",[]);I(this,"ToffsetWires1B1",[]);I(this,"ToffsetWires1B2",[]);I(this,"ToffsetArcWires1C",[]);I(this,"ToffsetArcWires2C",[]);I(this,"ToffsetWires1C1",[]);I(this,"ToffsetWires1C2",[]);I(this,"ToffsetArcWires1A2",[]);I(this,"ToffsetArcWires2A2",[]);I(this,"ToffsetWires2A1",[]);I(this,"ToffsetWires2A2",[]);I(this,"ToffsetArcWires1B2",[]);I(this,"ToffsetArcWires2B2",[]);I(this,"ToffsetWires2B1",[]);I(this,"ToffsetWires2B2",[]);I(this,"ToffsetArcWires1C2",[]);I(this,"ToffsetArcWires2C2",[]);I(this,"ToffsetWires2C1",[]);I(this,"ToffsetWires2C2",[]);I(this,"offsetArcWires1A",[]);I(this,"offsetArcWires1B",[]);I(this,"offsetArcWires1C",[]);I(this,"offsetArcWires2A",[]);I(this,"offsetArcWires2B",[]);I(this,"offsetArcWires2C",[]);I(this,"offsetGrouundWires1",[]);I(this,"offsetGrouundWires2",[]);I(this,"offsetGrouundWires11",[]);I(this,"offsetGrouundWires12",[]);I(this,"arcLine1A1",[]);I(this,"arcLine1B1",[]);I(this,"arcLine1C1",[]);I(this,"LinedataSource2");I(this,"LineentityCollection2");I(this,"modelCache",new Map);this.Keym=r,this.viewer=t,this.LineInfo=e,this.dataSource2=new g.CustomDataSource(this.LineInfo.LineID),this.entityCollection2=this.dataSource2.entities,this.LinedataSource2=new g.CustomDataSource(this.LineInfo.LineID+"daoxian"),this.LineentityCollection2=this.LinedataSource2.entities}createModelCacheKey(t,e,r,i){return`${t}_${e}_${r}_${i}`}getCachedModelConfig(t,e,r,i){const n=Math.max(0,r),o=Math.min(i,5e4),f=this.createModelCacheKey(t,e,n,o);if(!this.modelCache.has(f)){const u={uri:t,scale:e,distanceDisplayCondition:[n,o]};this.modelCache.set(f,u)}return this.modelCache.get(f)}addModelToCollection(t,e,r,i,n,o,f){const u=this.getCachedModelConfig(i,o,f[0],f[1]);this.entityCollection2.add(Un(t,e,r,u.uri,n,u.scale,u.distanceDisplayCondition))}setAutoCalculateRollX(t){this.autoCalculateRollX=t}getAutoCalculateRollX(){return this.autoCalculateRollX}setDynamicLoadingEnabled(t){this.isDynamicLoadingEnabled=t}getDynamicLoadingEnabled(){return this.isDynamicLoadingEnabled}setupCameraMoveListener(){this.cameraMoveHandler&&this.cameraMoveHandler(),this.cameraMoveHandler=this.viewer.camera.moveEnd.addEventListener(()=>{this.updateVisibleTowers()})}getVisibleTowerIndices(){var u;if(!this.viewer.camera||this.offsetTowers.length===0)return{start:0,end:0};const t=this.viewer.camera.position,e=((u=this.viewer.camera.positionCartographic)==null?void 0:u.height)||1e3;let r=5;e>5e4?r=2:e>1e4?r=3:e>5e3?r=5:r=10;let i=0,n=Number.MAX_VALUE;for(let l=0;l<this.offsetTowers.length;l++){const a=g.Cartesian3.distance(t,this.offsetTowers[l]);a<n&&(n=a,i=l)}const o=Math.max(0,i-r),f=Math.min(this.offsetTowers.length-1,i+r);return{start:o,end:f}}updateVisibleTowers(){const{start:t,end:e}=this.getVisibleTowerIndices();this.isLineModelRemoved||this.loadTowersInRange(t,e)}initializeLineData(){this.Keym=="OW_JPS_EEngin_001"&&(this.LineInfo.towers.forEach(t=>{this.offsetTowers.push(g.Cartesian3.fromDegrees(t.Longitude,t.Latitude,t.Altitude))}),this.autoCalculateRollX&&this.calculateTowerOrientations())}calculateTowerOrientations(){const t=this.LineInfo.towers.length;if(t!==0){if(t===1){this.LineInfo.towers[0].RollX===void 0&&(this.LineInfo.towers[0].RollX=90);return}for(let e=0;e<t;e++){let r=0;if(this.LineInfo.towers[e].type===Ti.耐张塔)if(e===0)r=(No(this.LineInfo.towers,e,3)-90+360)%360;else if(e===t-1)r=(No(this.LineInfo.towers,e,3)-90+360)%360;else{const i=this.LineInfo.towers[e-1],n=this.LineInfo.towers[e],o=this.LineInfo.towers[e+1],f=dr(i.Longitude,i.Latitude,n.Longitude,n.Latitude),u=dr(n.Longitude,n.Latitude,o.Longitude,o.Latitude);r=(ku(f,u)-90+360)%360}else r=(No(this.LineInfo.towers,e,2)-90+360)%360;this.LineInfo.towers[e].RollX=r}}}loadTowersInRange(t,e){if(t<0||e>=this.LineInfo.towers.length)return;const r=Math.max(0,t-1),i=Math.min(this.LineInfo.towers.length-1,e+1);for(let n=r;n<=i;n++)this.loadedTowerIndices.has(n)||(this.loadTowerAndCollectWirePoints(n),this.loadedTowerIndices.add(n));for(let n=r;n<i;n++){const o=`${n}-${n+1}`;this.loadedWireSegments.has(o)||(this.loadWireSegmentBetweenTowers(n,n+1),this.loadedWireSegments.add(o))}}loadTowerAndCollectWirePoints(t){const e=this.offsetTowers[t],r=new g.HeadingPitchRoll(g.Math.toRadians(this.LineInfo.towers[t].RollX),g.Math.toRadians(this.LineInfo.towers[t].RollY),g.Math.toRadians(this.LineInfo.towers[t].RollZ));this.addModelToCollection(this.LineInfo.towers[t].id,e,this.LineInfo.towers[t].name,this.LineInfo.towers[t].towerModelUri,r,this.LineInfo.towers[t].towerScale,[this.LineInfo.towers[t].DistanceDisplaymin,this.LineInfo.towers[t].DistanceDisplaymax]);const i=new g.HeadingPitchRoll(g.Math.toRadians(this.LineInfo.towers[t].RollX),0,0),n=new g.HeadingPitchRoll(g.Math.toRadians(this.LineInfo.towers[t].RollX),0,0);let o=0;const f=[];this.LineInfo.towers[t].Insulators.forEach(u=>{const l=N(e,new g.Cartesian3(this.LineInfo.towers[t].towerPoint[o].X,this.LineInfo.towers[t].towerPoint[o].Y,this.LineInfo.towers[t].towerPoint[o].Z),this.LineInfo.towers[t].type===Ti.耐张塔?n:i);let a,c;if(this.autoCalculateRollX?c=this.LineInfo.towers[t].RollX:c=u.RollX,this.LineInfo.towers[t].type===Ti.耐张塔)switch(u.type){case Kt.耐张串:a=u.WairFX==="进"?new g.HeadingPitchRoll(g.Math.toRadians(c),g.Math.toRadians(-180),g.Math.toRadians(180)):new g.HeadingPitchRoll(g.Math.toRadians(c),g.Math.toRadians(0),g.Math.toRadians(0));break;case Kt.跳线串:a=new g.HeadingPitchRoll(g.Math.toRadians(c),g.Math.toRadians(u.RollY),g.Math.toRadians(u.RollZ));break;case Kt.地线串:a=new g.HeadingPitchRoll(g.Math.toRadians(c),g.Math.toRadians(u.RollY),g.Math.toRadians(u.RollZ));break;default:a=new g.HeadingPitchRoll(g.Math.toRadians(c),g.Math.toRadians(u.RollY),g.Math.toRadians(u.RollZ))}else a=new g.HeadingPitchRoll(g.Math.toRadians(c),g.Math.toRadians(u.RollY),g.Math.toRadians(u.RollZ));this.addModelToCollection(u.id,l,u.name,u.InsulatorModelUri,a,u.InsulatorScale,[u.DistanceDisplaymin,u.DistanceDisplaymax]);const p={insulator:u,insulatorIndex:o,position:e,lineroll:i,WairPoint:[]};u.InsulatorPoint.forEach(d=>{d.Y=d.Y+this.LineInfo.towers[t].towerPoint[o].Y,d.Z=d.Z+this.LineInfo.towers[t].towerPoint[o].Z,p.WairPoint.push(N(e,new g.Cartesian3(d.X,d.Y,d.Z),i))}),f.push(p),o++}),this.towerWirePoints.set(t,f)}loadWireSegmentBetweenTowers(t,e){const r=this.towerWirePoints.get(t),i=this.towerWirePoints.get(e);!r||!i||(this.resetWireArraysForTwoTowers(),console.log(`加载导线段: ${t}-${e}`))}resetWireArraysForTwoTowers(){this.offsetWires11=[],this.offsetWires12=[],this.offsetWires13=[],this.offsetWires21=[],this.offsetWires22=[],this.offsetWires23=[],this.ToffsetWires1A1=[],this.ToffsetWires1A2=[]}getLineDataSources(){return[this.dataSource2,this.LinedataSource2]}removeLineModels(){this.isLineModelRemoved=!0,this.entityCollection2.removeAll(),this.LineentityCollection2.removeAll(),this.loadedTowerIndices.clear(),this.loadedWireSegments.clear()}restoreLineModels(){this.isLineModelRemoved=!1,this.isDynamicLoadingEnabled?(this.setupCameraMoveListener(),this.updateVisibleTowers()):this.loadAllTowersAtOnce()}loadAllTowersAtOnce(){let t=0,e=0;this.offsetTowers.forEach((r,i)=>{const n=new g.HeadingPitchRoll(g.Math.toRadians(this.LineInfo.towers[i].RollX),g.Math.toRadians(this.LineInfo.towers[i].RollY),g.Math.toRadians(this.LineInfo.towers[i].RollZ));this.addModelToCollection(this.LineInfo.towers[i].id,r,this.LineInfo.towers[i].name,this.LineInfo.towers[i].towerModelUri,n,this.LineInfo.towers[i].towerScale,[this.LineInfo.towers[i].DistanceDisplaymin,this.LineInfo.towers[i].DistanceDisplaymax]);const o=new g.HeadingPitchRoll(g.Math.toRadians(this.LineInfo.towers[i].RollX),0,0),f=new g.HeadingPitchRoll(g.Math.toRadians(this.LineInfo.towers[i].RollX),0,0);let u=0;if(this.LineInfo.towers[i].Insulators.forEach(a=>{const c=N(r,new g.Cartesian3(this.LineInfo.towers[i].towerPoint[u].X,this.LineInfo.towers[i].towerPoint[u].Y,this.LineInfo.towers[i].towerPoint[u].Z),this.LineInfo.towers[i].type===Ti.耐张塔?f:o);let p,d;if(this.autoCalculateRollX?d=this.LineInfo.towers[i].RollX:d=a.RollX,this.LineInfo.towers[i].type===Ti.耐张塔)switch(a.type){case Kt.耐张串:p=a.WairFX==="进"?new g.HeadingPitchRoll(g.Math.toRadians(d),g.Math.toRadians(-180),g.Math.toRadians(180)):new g.HeadingPitchRoll(g.Math.toRadians(d),g.Math.toRadians(0),g.Math.toRadians(0));break;case Kt.跳线串:p=new g.HeadingPitchRoll(g.Math.toRadians(d),g.Math.toRadians(a.RollY),g.Math.toRadians(a.RollZ));break;case Kt.地线串:p=new g.HeadingPitchRoll(g.Math.toRadians(d),g.Math.toRadians(a.RollY),g.Math.toRadians(a.RollZ));break;default:p=new g.HeadingPitchRoll(g.Math.toRadians(d),g.Math.toRadians(a.RollY),g.Math.toRadians(a.RollZ))}else p=new g.HeadingPitchRoll(g.Math.toRadians(d),g.Math.toRadians(a.RollY),g.Math.toRadians(a.RollZ));this.addModelToCollection(a.id,c,a.name,a.InsulatorModelUri,p,a.InsulatorScale,[a.DistanceDisplaymin,a.DistanceDisplaymax]);const h=[];switch(a.InsulatorPoint.forEach(m=>{m.Y=m.Y+this.LineInfo.towers[i].towerPoint[u].Y,m.Z=m.Z+this.LineInfo.towers[i].towerPoint[u].Z,h.push(N(r,new g.Cartesian3(m.X,m.Y,m.Z),o))}),a.linenum){case rn.回路一:if(this.LineInfo.ISPhaseSequence)if(this.LineInfo.towers[i].type==Ti.耐张塔)switch(a.PhaseSequence){case Le.A相:if(a.type==Kt.耐张串)if(a.WairFX=="进")switch(this.LineInfo.Wairnum){case E.单分裂:this.offsetWires11.push(h[0]),this.ToffsetWires1A1.push(h[0]);break;case E.双分裂:this.offsetWires11.push(h[0]),this.offsetWires11.push(h[1]),this.ToffsetWires1A1.push(h[2]),this.ToffsetWires1A1.push(h[3]);break;case E.四分裂:this.offsetWires11.push(h[0]),this.offsetWires11.push(h[1]),this.offsetWires11.push(h[2]),this.offsetWires11.push(h[3]),this.ToffsetWires1A1.push(h[4]),this.ToffsetWires1A1.push(h[5]),this.ToffsetWires1A1.push(h[6]),this.ToffsetWires1A1.push(h[7]);break;case E.六分裂:this.offsetWires11.push(h[0]),this.offsetWires11.push(h[1]),this.offsetWires11.push(h[2]),this.offsetWires11.push(h[3]),this.offsetWires11.push(h[4]),this.offsetWires11.push(h[5]),this.ToffsetWires1A1.push(h[6]),this.ToffsetWires1A1.push(h[7]),this.ToffsetWires1A1.push(h[8]),this.ToffsetWires1A1.push(h[9]),this.ToffsetWires1A1.push(h[10]),this.ToffsetWires1A1.push(h[11]);break;case E.八分裂:this.offsetWires11.push(h[0]),this.offsetWires11.push(h[1]),this.offsetWires11.push(h[2]),this.offsetWires11.push(h[3]),this.offsetWires11.push(h[4]),this.offsetWires11.push(h[5]),this.offsetWires11.push(h[6]),this.offsetWires11.push(h[7]),this.ToffsetWires1A1.push(h[8]),this.ToffsetWires1A1.push(h[9]),this.ToffsetWires1A1.push(h[10]),this.ToffsetWires1A1.push(h[11]),this.ToffsetWires1A1.push(h[12]),this.ToffsetWires1A1.push(h[13]),this.ToffsetWires1A1.push(h[14]),this.ToffsetWires1A1.push(h[15]);break}else switch(this.LineInfo.Wairnum){case E.单分裂:const m=N(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o);this.offsetWires11.push(m),this.ToffsetWires1A2.push(m);break;case E.双分裂:const _=N(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),W=N(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o);this.offsetWires11.push(_),this.offsetWires11.push(W),this.ToffsetWires1A2.push(_),this.ToffsetWires1A2.push(W);break;case E.四分裂:const C=N(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),T=N(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),L=N(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),w=N(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o);this.offsetWires11.push(C),this.offsetWires11.push(T),this.offsetWires11.push(L),this.offsetWires11.push(w),this.ToffsetWires1A2.push(C),this.ToffsetWires1A2.push(T),this.ToffsetWires1A2.push(L),this.ToffsetWires1A2.push(w);break;case E.六分裂:const D=N(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),b=N(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),B=N(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),R=N(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),x=N(r,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),M=N(r,new g.Cartesian3(a.InsulatorPoint[5].X*-1,a.InsulatorPoint[5].Y,a.InsulatorPoint[5].Z),o);this.offsetWires11.push(D),this.offsetWires11.push(b),this.offsetWires11.push(B),this.offsetWires11.push(R),this.offsetWires11.push(x),this.offsetWires11.push(M),this.ToffsetWires1A2.push(D),this.ToffsetWires1A2.push(b),this.ToffsetWires1A2.push(B),this.ToffsetWires1A2.push(R),this.ToffsetWires1A2.push(x),this.ToffsetWires1A2.push(M);break;case E.八分裂:const q=N(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),Z=N(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),O=N(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),X=N(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),K=N(r,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),et=N(r,new g.Cartesian3(a.InsulatorPoint[5].X*-1,a.InsulatorPoint[5].Y,a.InsulatorPoint[5].Z),o),st=N(r,new g.Cartesian3(a.InsulatorPoint[6].X*-1,a.InsulatorPoint[6].Y,a.InsulatorPoint[6].Z),o),ut=N(r,new g.Cartesian3(a.InsulatorPoint[7].X*-1,a.InsulatorPoint[7].Y,a.InsulatorPoint[7].Z),o);this.offsetWires11.push(q),this.offsetWires11.push(Z),this.offsetWires11.push(O),this.offsetWires11.push(X),this.offsetWires11.push(K),this.offsetWires11.push(et),this.offsetWires11.push(st),this.offsetWires11.push(ut),this.ToffsetWires1A2.push(q),this.ToffsetWires1A2.push(Z),this.ToffsetWires1A2.push(O),this.ToffsetWires1A2.push(X),this.ToffsetWires1A2.push(K),this.ToffsetWires1A2.push(et),this.ToffsetWires1A2.push(st),this.ToffsetWires1A2.push(ut);break}else if(a.type==Kt.跳线串)switch(this.LineInfo.Wairnum){case E.单分裂:this.ToffsetWires1A1.push(h[0]),this.ToffsetWires1A2.push(h[1]);break;case E.双分裂:this.ToffsetWires1A1.push(h[0]),this.ToffsetWires1A1.push(h[1]),this.ToffsetWires1A2.push(h[2]),this.ToffsetWires1A2.push(h[3]);break;case E.四分裂:this.ToffsetWires1A1.push(h[0]),this.ToffsetWires1A1.push(h[1]),this.ToffsetWires1A1.push(h[2]),this.ToffsetWires1A1.push(h[3]),this.ToffsetWires1A2.push(h[4]),this.ToffsetWires1A2.push(h[5]),this.ToffsetWires1A2.push(h[6]),this.ToffsetWires1A2.push(h[7]);break;case E.六分裂:this.ToffsetWires1A1.push(h[0]),this.ToffsetWires1A1.push(h[1]),this.ToffsetWires1A1.push(h[2]),this.ToffsetWires1A1.push(h[3]),this.ToffsetWires1A1.push(h[4]),this.ToffsetWires1A1.push(h[5]),this.ToffsetWires1A2.push(h[6]),this.ToffsetWires1A2.push(h[7]),this.ToffsetWires1A2.push(h[8]),this.ToffsetWires1A2.push(h[9]),this.ToffsetWires1A2.push(h[10]),this.ToffsetWires1A2.push(h[11]);break;case E.八分裂:this.ToffsetWires1A1.push(h[0]),this.ToffsetWires1A1.push(h[1]),this.ToffsetWires1A1.push(h[2]),this.ToffsetWires1A1.push(h[3]),this.ToffsetWires1A1.push(h[4]),this.ToffsetWires1A1.push(h[5]),this.ToffsetWires1A1.push(h[6]),this.ToffsetWires1A1.push(h[7]),this.ToffsetWires1A2.push(h[8]),this.ToffsetWires1A2.push(h[9]),this.ToffsetWires1A2.push(h[10]),this.ToffsetWires1A2.push(h[11]),this.ToffsetWires1A2.push(h[12]),this.ToffsetWires1A2.push(h[13]),this.ToffsetWires1A2.push(h[14]),this.ToffsetWires1A2.push(h[15]);break}break;case Le.B相:if(a.type==Kt.耐张串)if(a.WairFX=="进")switch(this.LineInfo.Wairnum){case E.单分裂:this.offsetWires12.push(h[0]),this.ToffsetWires1B1.push(h[1]);break;case E.双分裂:this.offsetWires12.push(h[0]),this.offsetWires12.push(h[1]),this.ToffsetWires1B1.push(h[2]),this.ToffsetWires1B1.push(h[3]);break;case E.四分裂:this.offsetWires12.push(h[0]),this.offsetWires12.push(h[1]),this.offsetWires12.push(h[2]),this.offsetWires12.push(h[3]),this.ToffsetWires1B1.push(h[4]),this.ToffsetWires1B1.push(h[5]),this.ToffsetWires1B1.push(h[6]),this.ToffsetWires1B1.push(h[7]);break;case E.六分裂:this.offsetWires12.push(h[0]),this.offsetWires12.push(h[1]),this.offsetWires12.push(h[2]),this.offsetWires12.push(h[3]),this.offsetWires12.push(h[4]),this.offsetWires12.push(h[5]),this.ToffsetWires1B1.push(h[6]),this.ToffsetWires1B1.push(h[7]),this.ToffsetWires1B1.push(h[8]),this.ToffsetWires1B1.push(h[9]),this.ToffsetWires1B1.push(h[10]),this.ToffsetWires1B1.push(h[11]);break;case E.八分裂:this.offsetWires12.push(h[0]),this.offsetWires12.push(h[1]),this.offsetWires12.push(h[2]),this.offsetWires12.push(h[3]),this.offsetWires12.push(h[4]),this.offsetWires12.push(h[5]),this.offsetWires12.push(h[6]),this.offsetWires12.push(h[7]),this.ToffsetWires1B1.push(h[8]),this.ToffsetWires1B1.push(h[9]),this.ToffsetWires1B1.push(h[10]),this.ToffsetWires1B1.push(h[11]),this.ToffsetWires1B1.push(h[12]),this.ToffsetWires1B1.push(h[13]),this.ToffsetWires1B1.push(h[14]),this.ToffsetWires1B1.push(h[15]);break}else switch(this.LineInfo.Wairnum){case E.单分裂:const m=N(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o);this.offsetWires12.push(m),this.ToffsetWires1B2.push(m);break;case E.双分裂:const _=N(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),W=N(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o);this.offsetWires12.push(_),this.offsetWires12.push(W),this.ToffsetWires1B2.push(_),this.ToffsetWires1B2.push(W);break;case E.四分裂:const C=N(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),T=N(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),L=N(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),w=N(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o);this.offsetWires12.push(C),this.offsetWires12.push(T),this.offsetWires12.push(L),this.offsetWires12.push(w),this.ToffsetWires1B2.push(C),this.ToffsetWires1B2.push(T),this.ToffsetWires1B2.push(L),this.ToffsetWires1B2.push(w);break;case E.六分裂:const D=N(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),b=N(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),B=N(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),R=N(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),x=N(r,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),M=N(r,new g.Cartesian3(a.InsulatorPoint[5].X*-1,a.InsulatorPoint[5].Y,a.InsulatorPoint[5].Z),o);this.offsetWires12.push(D),this.offsetWires12.push(b),this.offsetWires12.push(B),this.offsetWires12.push(R),this.offsetWires12.push(x),this.offsetWires12.push(M),this.ToffsetWires1B2.push(D),this.ToffsetWires1B2.push(b),this.ToffsetWires1B2.push(B),this.ToffsetWires1B2.push(R),this.ToffsetWires1B2.push(x),this.ToffsetWires1B2.push(M);break;case E.八分裂:const q=N(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),Z=N(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),O=N(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),X=N(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),K=N(r,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),et=N(r,new g.Cartesian3(a.InsulatorPoint[5].X*-1,a.InsulatorPoint[5].Y,a.InsulatorPoint[5].Z),o),st=N(r,new g.Cartesian3(a.InsulatorPoint[6].X*-1,a.InsulatorPoint[6].Y,a.InsulatorPoint[6].Z),o),ut=N(r,new g.Cartesian3(a.InsulatorPoint[7].X*-1,a.InsulatorPoint[7].Y,a.InsulatorPoint[7].Z),o);this.offsetWires12.push(q),this.offsetWires12.push(Z),this.offsetWires12.push(O),this.offsetWires12.push(X),this.offsetWires12.push(K),this.offsetWires12.push(et),this.offsetWires12.push(st),this.offsetWires12.push(ut),this.ToffsetWires1B2.push(q),this.ToffsetWires1B2.push(Z),this.ToffsetWires1B2.push(O),this.ToffsetWires1B2.push(X),this.ToffsetWires1B2.push(K),this.ToffsetWires1B2.push(et),this.ToffsetWires1B2.push(st),this.ToffsetWires1B2.push(ut);break}else if(a.type==Kt.跳线串)switch(this.LineInfo.Wairnum){case E.单分裂:this.ToffsetWires1B1.push(h[0]),this.ToffsetWires1B2.push(h[0]);break;case E.双分裂:this.ToffsetWires1B1.push(h[0]),this.ToffsetWires1B1.push(h[1]),this.ToffsetWires1B2.push(h[2]),this.ToffsetWires1B2.push(h[3]);break;case E.四分裂:this.ToffsetWires1B1.push(h[0]),this.ToffsetWires1B1.push(h[1]),this.ToffsetWires1B1.push(h[2]),this.ToffsetWires1B1.push(h[3]),this.ToffsetWires1B2.push(h[4]),this.ToffsetWires1B2.push(h[5]),this.ToffsetWires1B2.push(h[6]),this.ToffsetWires1B2.push(h[7]);break;case E.六分裂:this.ToffsetWires1B1.push(h[0]),this.ToffsetWires1B1.push(h[1]),this.ToffsetWires1B1.push(h[2]),this.ToffsetWires1B1.push(h[3]),this.ToffsetWires1B1.push(h[4]),this.ToffsetWires1B1.push(h[5]),this.ToffsetWires1B2.push(h[6]),this.ToffsetWires1B2.push(h[7]),this.ToffsetWires1B2.push(h[8]),this.ToffsetWires1B2.push(h[9]),this.ToffsetWires1B2.push(h[10]),this.ToffsetWires1B2.push(h[11]);break;case E.八分裂:this.ToffsetWires1B1.push(h[0]),this.ToffsetWires1B1.push(h[1]),this.ToffsetWires1B1.push(h[2]),this.ToffsetWires1B1.push(h[3]),this.ToffsetWires1B1.push(h[4]),this.ToffsetWires1B1.push(h[5]),this.ToffsetWires1B1.push(h[6]),this.ToffsetWires1B1.push(h[7]),this.ToffsetWires1B2.push(h[8]),this.ToffsetWires1B2.push(h[9]),this.ToffsetWires1B2.push(h[10]),this.ToffsetWires1B2.push(h[11]),this.ToffsetWires1B2.push(h[12]),this.ToffsetWires1B2.push(h[13]),this.ToffsetWires1B2.push(h[14]),this.ToffsetWires1B2.push(h[15]);break}break;case Le.C相:if(a.type==Kt.耐张串)if(a.WairFX=="进")switch(this.LineInfo.Wairnum){case E.单分裂:this.offsetWires13.push(h[0]),this.ToffsetWires1C1.push(h[1]);break;case E.双分裂:this.offsetWires13.push(h[0]),this.offsetWires13.push(h[1]),this.ToffsetWires1C1.push(h[2]),this.ToffsetWires1C1.push(h[3]);break;case E.四分裂:this.offsetWires13.push(h[0]),this.offsetWires13.push(h[1]),this.offsetWires13.push(h[2]),this.offsetWires13.push(h[3]),this.ToffsetWires1C1.push(h[4]),this.ToffsetWires1C1.push(h[5]),this.ToffsetWires1C1.push(h[6]),this.ToffsetWires1C1.push(h[7]);break;case E.六分裂:this.offsetWires13.push(h[0]),this.offsetWires13.push(h[1]),this.offsetWires13.push(h[2]),this.offsetWires13.push(h[3]),this.offsetWires13.push(h[4]),this.offsetWires13.push(h[5]),this.ToffsetWires1C1.push(h[6]),this.ToffsetWires1C1.push(h[7]),this.ToffsetWires1C1.push(h[8]),this.ToffsetWires1C1.push(h[9]),this.ToffsetWires1C1.push(h[10]),this.ToffsetWires1C1.push(h[11]);break;case E.八分裂:this.offsetWires13.push(h[0]),this.offsetWires13.push(h[1]),this.offsetWires13.push(h[2]),this.offsetWires13.push(h[3]),this.offsetWires13.push(h[4]),this.offsetWires13.push(h[5]),this.offsetWires13.push(h[6]),this.offsetWires13.push(h[7]),this.ToffsetWires1C1.push(h[8]),this.ToffsetWires1C1.push(h[9]),this.ToffsetWires1C1.push(h[10]),this.ToffsetWires1C1.push(h[11]),this.ToffsetWires1C1.push(h[12]),this.ToffsetWires1C1.push(h[13]),this.ToffsetWires1C1.push(h[14]),this.ToffsetWires1C1.push(h[15]);break}else switch(this.LineInfo.Wairnum){case E.单分裂:const m=N(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o);this.offsetWires13.push(m),this.ToffsetWires1C2.push(m);break;case E.双分裂:const _=N(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),W=N(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o);this.offsetWires13.push(_),this.offsetWires13.push(W),this.ToffsetWires1C2.push(_),this.ToffsetWires1C2.push(W);break;case E.四分裂:const C=N(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),T=N(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),L=N(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),w=N(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o);this.offsetWires13.push(C),this.offsetWires13.push(T),this.offsetWires13.push(L),this.offsetWires13.push(w),this.ToffsetWires1C2.push(C),this.ToffsetWires1C2.push(T),this.ToffsetWires1C2.push(L),this.ToffsetWires1C2.push(w);break;case E.六分裂:const D=N(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),b=N(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),B=N(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),R=N(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),x=N(r,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),M=N(r,new g.Cartesian3(a.InsulatorPoint[5].X*-1,a.InsulatorPoint[5].Y,a.InsulatorPoint[5].Z),o);this.offsetWires13.push(D),this.offsetWires13.push(b),this.offsetWires13.push(B),this.offsetWires13.push(R),this.offsetWires13.push(x),this.offsetWires13.push(M),this.ToffsetWires1C2.push(D),this.ToffsetWires1C2.push(b),this.ToffsetWires1C2.push(B),this.ToffsetWires1C2.push(R),this.ToffsetWires1C2.push(x),this.ToffsetWires1C2.push(M);break;case E.八分裂:const q=N(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),Z=N(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),O=N(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),X=N(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),K=N(r,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),et=N(r,new g.Cartesian3(a.InsulatorPoint[5].X*-1,a.InsulatorPoint[5].Y,a.InsulatorPoint[5].Z),o),st=N(r,new g.Cartesian3(a.InsulatorPoint[6].X*-1,a.InsulatorPoint[6].Y,a.InsulatorPoint[6].Z),o),ut=N(r,new g.Cartesian3(a.InsulatorPoint[7].X*-1,a.InsulatorPoint[7].Y,a.InsulatorPoint[7].Z),o);this.offsetWires13.push(q),this.offsetWires13.push(Z),this.offsetWires13.push(O),this.offsetWires13.push(X),this.offsetWires13.push(K),this.offsetWires13.push(et),this.offsetWires13.push(st),this.offsetWires13.push(ut),this.ToffsetWires1C2.push(q),this.ToffsetWires1C2.push(Z),this.ToffsetWires1C2.push(O),this.ToffsetWires1C2.push(X),this.ToffsetWires1C2.push(K),this.ToffsetWires1C2.push(et),this.ToffsetWires1C2.push(st),this.ToffsetWires1C2.push(ut);break}else if(a.type==Kt.跳线串)switch(this.LineInfo.Wairnum){case E.单分裂:this.ToffsetWires1C1.push(h[0]),this.ToffsetWires1C2.push(h[0]);break;case E.双分裂:this.ToffsetWires1C1.push(h[0]),this.ToffsetWires1C1.push(h[1]),this.ToffsetWires1C2.push(h[2]),this.ToffsetWires1C2.push(h[3]);break;case E.四分裂:this.ToffsetWires1C1.push(h[0]),this.ToffsetWires1C1.push(h[1]),this.ToffsetWires1C1.push(h[2]),this.ToffsetWires1C1.push(h[3]),this.ToffsetWires1C2.push(h[4]),this.ToffsetWires1C2.push(h[5]),this.ToffsetWires1C2.push(h[6]),this.ToffsetWires1C2.push(h[7]);break;case E.六分裂:this.ToffsetWires1C1.push(h[0]),this.ToffsetWires1C1.push(h[1]),this.ToffsetWires1C1.push(h[2]),this.ToffsetWires1C1.push(h[3]),this.ToffsetWires1C1.push(h[4]),this.ToffsetWires1C1.push(h[5]),this.ToffsetWires1C2.push(h[6]),this.ToffsetWires1C2.push(h[7]),this.ToffsetWires1C2.push(h[8]),this.ToffsetWires1C2.push(h[9]),this.ToffsetWires1C2.push(h[10]),this.ToffsetWires1C2.push(h[11]);break;case E.八分裂:this.ToffsetWires1C1.push(h[0]),this.ToffsetWires1C1.push(h[1]),this.ToffsetWires1C1.push(h[2]),this.ToffsetWires1C1.push(h[3]),this.ToffsetWires1C1.push(h[4]),this.ToffsetWires1C1.push(h[5]),this.ToffsetWires1C1.push(h[6]),this.ToffsetWires1C1.push(h[7]),this.ToffsetWires1C2.push(h[8]),this.ToffsetWires1C2.push(h[9]),this.ToffsetWires1C2.push(h[10]),this.ToffsetWires1C2.push(h[11]),this.ToffsetWires1C2.push(h[12]),this.ToffsetWires1C2.push(h[13]),this.ToffsetWires1C2.push(h[14]),this.ToffsetWires1C2.push(h[15]);break}break}else switch(a.PhaseSequence){case Le.A相:h.forEach(m=>{this.offsetWires11.push(m)});break;case Le.B相:h.forEach(m=>{this.offsetWires12.push(m)});break;case Le.C相:h.forEach(m=>{this.offsetWires13.push(m)});break}else if(this.LineInfo.towers[i].type==Ti.耐张塔)switch(u){case 2:switch(this.LineInfo.Wairnum){case E.单分裂:this.offsetWires11.push(h[0]),this.ToffsetWires1A1.push(h[0]);break;case E.双分裂:this.offsetWires11.push(h[0]),this.offsetWires11.push(h[1]),this.ToffsetWires1A1.push(h[2]),this.ToffsetWires1A1.push(h[3]);break}break;case 3:switch(this.LineInfo.Wairnum){case E.单分裂:this.ToffsetWires1A1.push(h[0]),this.ToffsetWires1A2.push(h[0]);break;case E.双分裂:this.ToffsetWires1A1.push(h[0]),this.ToffsetWires1A1.push(h[1]),this.ToffsetWires1A2.push(h[2]),this.ToffsetWires1A2.push(h[3]);break}break;case 4:switch(this.LineInfo.Wairnum){case E.单分裂:const m=N(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o);this.offsetWires11.push(m),this.ToffsetWires1A2.push(m);break;case E.双分裂:const _=N(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),W=N(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o);this.offsetWires11.push(_),this.offsetWires11.push(W),this.ToffsetWires1A2.push(_),this.ToffsetWires1A2.push(W);break}break;case 5:h.forEach(m=>{this.offsetWires12.push(m),this.ToffsetWires1B1.push(m)});break;case 6:h.forEach(m=>{this.ToffsetWires1B1.push(m),this.ToffsetWires1B2.push(m)});break;case 7:a.InsulatorPoint.forEach(m=>{const _=N(r,new g.Cartesian3(m.X*-1,m.Y,m.Z),o);this.offsetWires12.push(_),this.ToffsetWires1B2.push(_)});break;case 8:h.forEach(m=>{this.offsetWires13.push(m),this.ToffsetWires1C1.push(m)});break;case 9:h.forEach(m=>{this.ToffsetWires1C1.push(m),this.ToffsetWires1C2.push(m)});break;case 10:a.InsulatorPoint.forEach(m=>{const _=N(r,new g.Cartesian3(m.X*-1,m.Y,m.Z),o);this.offsetWires13.push(_),this.ToffsetWires1C2.push(_)});break}else switch(u){case 2:h.forEach(m=>{this.offsetWires11.push(m)});break;case 3:h.forEach(m=>{this.offsetWires12.push(m)});break;case 4:h.forEach(m=>{this.offsetWires13.push(m)});break}break;case rn.回路二:if(this.LineInfo.ISPhaseSequence)if(this.LineInfo.towers[i].type==Ti.耐张塔)switch(a.PhaseSequence){case Le.A相:if(a.type==Kt.耐张串)if(a.WairFX=="进")switch(this.LineInfo.Wairnum){case E.单分裂:this.offsetWires21.push(h[0]),this.ToffsetWires2A1.push(h[0]);break;case E.双分裂:this.offsetWires21.push(h[0]),this.offsetWires21.push(h[1]),this.ToffsetWires2A1.push(h[2]),this.ToffsetWires2A1.push(h[3]);break;case E.四分裂:this.offsetWires21.push(h[0]),this.offsetWires21.push(h[1]),this.offsetWires21.push(h[2]),this.offsetWires21.push(h[3]),this.ToffsetWires2A1.push(h[4]),this.ToffsetWires2A1.push(h[5]),this.ToffsetWires2A1.push(h[6]),this.ToffsetWires2A1.push(h[7]);break;case E.六分裂:this.offsetWires21.push(h[0]),this.offsetWires21.push(h[1]),this.offsetWires21.push(h[2]),this.offsetWires21.push(h[3]),this.offsetWires21.push(h[4]),this.offsetWires21.push(h[5]),this.ToffsetWires2A1.push(h[6]),this.ToffsetWires2A1.push(h[7]),this.ToffsetWires2A1.push(h[8]),this.ToffsetWires2A1.push(h[9]),this.ToffsetWires2A1.push(h[10]),this.ToffsetWires2A1.push(h[11]);break;case E.八分裂:this.offsetWires21.push(h[0]),this.offsetWires21.push(h[1]),this.offsetWires21.push(h[2]),this.offsetWires21.push(h[3]),this.offsetWires21.push(h[4]),this.offsetWires21.push(h[5]),this.offsetWires21.push(h[6]),this.offsetWires21.push(h[7]),this.ToffsetWires2A1.push(h[8]),this.ToffsetWires2A1.push(h[9]),this.ToffsetWires2A1.push(h[10]),this.ToffsetWires2A1.push(h[11]),this.ToffsetWires2A1.push(h[12]),this.ToffsetWires2A1.push(h[13]),this.ToffsetWires2A1.push(h[14]),this.ToffsetWires2A1.push(h[15]);break}else switch(this.LineInfo.Wairnum){case E.单分裂:const m=N(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o);this.offsetWires21.push(m),this.ToffsetWires2A2.push(m);break;case E.双分裂:const _=N(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),W=N(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o);this.offsetWires21.push(_),this.offsetWires21.push(W),this.ToffsetWires2A2.push(_),this.ToffsetWires2A2.push(W);break;case E.四分裂:const C=N(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),T=N(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),L=N(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),w=N(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o);this.offsetWires21.push(C),this.offsetWires21.push(T),this.offsetWires21.push(L),this.offsetWires21.push(w),this.ToffsetWires2A2.push(C),this.ToffsetWires2A2.push(T),this.ToffsetWires2A2.push(L),this.ToffsetWires2A2.push(w);break;case E.六分裂:const D=N(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),b=N(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),B=N(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),R=N(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),x=N(r,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),M=N(r,new g.Cartesian3(a.InsulatorPoint[5].X*-1,a.InsulatorPoint[5].Y,a.InsulatorPoint[5].Z),o);this.offsetWires21.push(D),this.offsetWires21.push(b),this.offsetWires21.push(B),this.offsetWires21.push(R),this.offsetWires21.push(x),this.offsetWires21.push(M),this.ToffsetWires2A2.push(D),this.ToffsetWires2A2.push(b),this.ToffsetWires2A2.push(B),this.ToffsetWires2A2.push(R),this.ToffsetWires2A2.push(x),this.ToffsetWires2A2.push(M);break;case E.八分裂:const q=N(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),Z=N(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),O=N(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),X=N(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),K=N(r,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),et=N(r,new g.Cartesian3(a.InsulatorPoint[5].X*-1,a.InsulatorPoint[5].Y,a.InsulatorPoint[5].Z),o),st=N(r,new g.Cartesian3(a.InsulatorPoint[6].X*-1,a.InsulatorPoint[6].Y,a.InsulatorPoint[6].Z),o),ut=N(r,new g.Cartesian3(a.InsulatorPoint[7].X*-1,a.InsulatorPoint[7].Y,a.InsulatorPoint[7].Z),o);this.offsetWires21.push(q),this.offsetWires21.push(Z),this.offsetWires21.push(O),this.offsetWires21.push(X),this.offsetWires21.push(K),this.offsetWires21.push(et),this.offsetWires21.push(st),this.offsetWires21.push(ut),this.ToffsetWires2A2.push(q),this.ToffsetWires2A2.push(Z),this.ToffsetWires2A2.push(O),this.ToffsetWires2A2.push(X),this.ToffsetWires2A2.push(K),this.ToffsetWires2A2.push(et),this.ToffsetWires2A2.push(st),this.ToffsetWires2A2.push(ut);break}else if(a.type==Kt.跳线串)switch(this.LineInfo.Wairnum){case E.单分裂:this.ToffsetWires2A1.push(h[0]),this.ToffsetWires2A2.push(h[0]);break;case E.双分裂:this.ToffsetWires2A1.push(h[0]),this.ToffsetWires2A1.push(h[1]),this.ToffsetWires2A2.push(h[2]),this.ToffsetWires2A2.push(h[3]);break;case E.四分裂:this.ToffsetWires2A1.push(h[0]),this.ToffsetWires2A1.push(h[1]),this.ToffsetWires2A1.push(h[2]),this.ToffsetWires2A1.push(h[3]),this.ToffsetWires2A2.push(h[4]),this.ToffsetWires2A2.push(h[5]),this.ToffsetWires2A2.push(h[6]),this.ToffsetWires2A2.push(h[7]);break;case E.六分裂:this.ToffsetWires2A1.push(h[0]),this.ToffsetWires2A1.push(h[1]),this.ToffsetWires2A1.push(h[2]),this.ToffsetWires2A1.push(h[3]),this.ToffsetWires2A1.push(h[4]),this.ToffsetWires2A1.push(h[5]),this.ToffsetWires2A2.push(h[6]),this.ToffsetWires2A2.push(h[7]),this.ToffsetWires2A2.push(h[8]),this.ToffsetWires2A2.push(h[9]),this.ToffsetWires2A2.push(h[10]),this.ToffsetWires2A2.push(h[11]);break;case E.八分裂:this.ToffsetWires2A1.push(h[0]),this.ToffsetWires2A1.push(h[1]),this.ToffsetWires2A1.push(h[2]),this.ToffsetWires2A1.push(h[3]),this.ToffsetWires2A1.push(h[4]),this.ToffsetWires2A1.push(h[5]),this.ToffsetWires2A1.push(h[6]),this.ToffsetWires2A1.push(h[7]),this.ToffsetWires2A2.push(h[8]),this.ToffsetWires2A2.push(h[9]),this.ToffsetWires2A2.push(h[10]),this.ToffsetWires2A2.push(h[11]),this.ToffsetWires2A2.push(h[12]),this.ToffsetWires2A2.push(h[13]),this.ToffsetWires2A2.push(h[14]),this.ToffsetWires2A2.push(h[15]);break}break;case Le.B相:if(a.type==Kt.耐张串)if(a.WairFX=="进")switch(this.LineInfo.Wairnum){case E.单分裂:this.offsetWires22.push(h[0]),this.ToffsetWires2B1.push(h[0]);break;case E.双分裂:this.offsetWires22.push(h[0]),this.offsetWires22.push(h[1]),this.ToffsetWires2B1.push(h[2]),this.ToffsetWires2B1.push(h[3]);break;case E.四分裂:this.offsetWires22.push(h[0]),this.offsetWires22.push(h[1]),this.offsetWires22.push(h[2]),this.offsetWires22.push(h[3]),this.ToffsetWires2B1.push(h[4]),this.ToffsetWires2B1.push(h[5]),this.ToffsetWires2B1.push(h[6]),this.ToffsetWires2B1.push(h[7]);break;case E.六分裂:this.offsetWires22.push(h[0]),this.offsetWires22.push(h[1]),this.offsetWires22.push(h[2]),this.offsetWires22.push(h[3]),this.offsetWires22.push(h[4]),this.offsetWires22.push(h[5]),this.ToffsetWires2B1.push(h[6]),this.ToffsetWires2B1.push(h[7]),this.ToffsetWires2B1.push(h[8]),this.ToffsetWires2B1.push(h[9]),this.ToffsetWires2B1.push(h[10]),this.ToffsetWires2B1.push(h[11]);break;case E.八分裂:this.offsetWires22.push(h[0]),this.offsetWires22.push(h[1]),this.offsetWires22.push(h[2]),this.offsetWires22.push(h[3]),this.offsetWires22.push(h[4]),this.offsetWires22.push(h[5]),this.offsetWires22.push(h[6]),this.offsetWires22.push(h[7]),this.ToffsetWires2B1.push(h[8]),this.ToffsetWires2B1.push(h[9]),this.ToffsetWires2B1.push(h[10]),this.ToffsetWires2B1.push(h[11]),this.ToffsetWires2B1.push(h[12]),this.ToffsetWires2B1.push(h[13]),this.ToffsetWires2B1.push(h[14]),this.ToffsetWires2B1.push(h[15]);break}else switch(this.LineInfo.Wairnum){case E.单分裂:const m=N(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o);this.offsetWires22.push(m),this.ToffsetWires2B2.push(m);break;case E.双分裂:const _=N(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),W=N(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o);this.offsetWires22.push(_),this.offsetWires22.push(W),this.ToffsetWires2B2.push(_),this.ToffsetWires2B2.push(W);break;case E.四分裂:const C=N(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),T=N(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),L=N(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),w=N(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o);this.offsetWires22.push(C),this.offsetWires22.push(T),this.offsetWires22.push(L),this.offsetWires22.push(w),this.ToffsetWires2B2.push(C),this.ToffsetWires2B2.push(T),this.ToffsetWires2B2.push(L),this.ToffsetWires2B2.push(w);break;case E.六分裂:const D=N(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),b=N(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),B=N(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),R=N(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),x=N(r,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),M=N(r,new g.Cartesian3(a.InsulatorPoint[5].X*-1,a.InsulatorPoint[5].Y,a.InsulatorPoint[5].Z),o);this.offsetWires22.push(D),this.offsetWires22.push(b),this.offsetWires22.push(B),this.offsetWires22.push(R),this.offsetWires22.push(x),this.offsetWires22.push(M),this.ToffsetWires2B2.push(D),this.ToffsetWires2B2.push(b),this.ToffsetWires2B2.push(B),this.ToffsetWires2B2.push(R),this.ToffsetWires2B2.push(x),this.ToffsetWires2B2.push(M);break;case E.八分裂:const q=N(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),Z=N(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),O=N(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),X=N(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),K=N(r,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),et=N(r,new g.Cartesian3(a.InsulatorPoint[5].X*-1,a.InsulatorPoint[5].Y,a.InsulatorPoint[5].Z),o),st=N(r,new g.Cartesian3(a.InsulatorPoint[6].X*-1,a.InsulatorPoint[6].Y,a.InsulatorPoint[6].Z),o),ut=N(r,new g.Cartesian3(a.InsulatorPoint[7].X*-1,a.InsulatorPoint[7].Y,a.InsulatorPoint[7].Z),o);this.offsetWires22.push(q),this.offsetWires22.push(Z),this.offsetWires22.push(O),this.offsetWires22.push(X),this.offsetWires22.push(K),this.offsetWires22.push(et),this.offsetWires22.push(st),this.offsetWires22.push(ut),this.ToffsetWires2B2.push(q),this.ToffsetWires2B2.push(Z),this.ToffsetWires2B2.push(O),this.ToffsetWires2B2.push(X),this.ToffsetWires2B2.push(K),this.ToffsetWires2B2.push(et),this.ToffsetWires2B2.push(st),this.ToffsetWires2B2.push(ut);break}else if(a.type==Kt.跳线串)switch(this.LineInfo.Wairnum){case E.单分裂:this.ToffsetWires2B1.push(h[0]),this.ToffsetWires2B2.push(h[0]);break;case E.双分裂:this.ToffsetWires2B1.push(h[0]),this.ToffsetWires2B1.push(h[1]),this.ToffsetWires2B2.push(h[2]),this.ToffsetWires2B2.push(h[3]);break;case E.四分裂:this.ToffsetWires2B1.push(h[0]),this.ToffsetWires2B1.push(h[1]),this.ToffsetWires2B1.push(h[2]),this.ToffsetWires2B1.push(h[3]),this.ToffsetWires2B2.push(h[4]),this.ToffsetWires2B2.push(h[5]),this.ToffsetWires2B2.push(h[6]),this.ToffsetWires2B2.push(h[7]);break;case E.六分裂:this.ToffsetWires2B1.push(h[0]),this.ToffsetWires2B1.push(h[1]),this.ToffsetWires2B1.push(h[2]),this.ToffsetWires2B1.push(h[3]),this.ToffsetWires2B1.push(h[4]),this.ToffsetWires2B1.push(h[5]),this.ToffsetWires2B2.push(h[6]),this.ToffsetWires2B2.push(h[7]),this.ToffsetWires2B2.push(h[8]),this.ToffsetWires2B2.push(h[9]),this.ToffsetWires2B2.push(h[10]),this.ToffsetWires2B2.push(h[11]);break;case E.八分裂:this.ToffsetWires2B1.push(h[0]),this.ToffsetWires2B1.push(h[1]),this.ToffsetWires2B1.push(h[2]),this.ToffsetWires2B1.push(h[3]),this.ToffsetWires2B1.push(h[4]),this.ToffsetWires2B1.push(h[5]),this.ToffsetWires2B1.push(h[6]),this.ToffsetWires2B1.push(h[7]),this.ToffsetWires2B2.push(h[8]),this.ToffsetWires2B2.push(h[9]),this.ToffsetWires2B2.push(h[10]),this.ToffsetWires2B2.push(h[11]),this.ToffsetWires2B2.push(h[12]),this.ToffsetWires2B2.push(h[13]),this.ToffsetWires2B2.push(h[14]),this.ToffsetWires2B2.push(h[15]);break}break;case Le.C相:if(a.type==Kt.耐张串)if(a.WairFX=="进")switch(this.LineInfo.Wairnum){case E.单分裂:this.offsetWires23.push(h[0]),this.ToffsetWires2C1.push(h[0]);break;case E.双分裂:this.offsetWires23.push(h[0]),this.offsetWires23.push(h[1]),this.ToffsetWires2C1.push(h[2]),this.ToffsetWires2C1.push(h[3]);break;case E.四分裂:this.offsetWires23.push(h[0]),this.offsetWires23.push(h[1]),this.offsetWires23.push(h[2]),this.offsetWires23.push(h[3]),this.ToffsetWires2C1.push(h[4]),this.ToffsetWires2C1.push(h[5]),this.ToffsetWires2C1.push(h[6]),this.ToffsetWires2C1.push(h[7]);break;case E.六分裂:this.offsetWires23.push(h[0]),this.offsetWires23.push(h[1]),this.offsetWires23.push(h[2]),this.offsetWires23.push(h[3]),this.offsetWires23.push(h[4]),this.offsetWires23.push(h[5]),this.ToffsetWires2C1.push(h[6]),this.ToffsetWires2C1.push(h[7]),this.ToffsetWires2C1.push(h[8]),this.ToffsetWires2C1.push(h[9]),this.ToffsetWires2C1.push(h[10]),this.ToffsetWires2C1.push(h[11]);break;case E.八分裂:this.offsetWires23.push(h[0]),this.offsetWires23.push(h[1]),this.offsetWires23.push(h[2]),this.offsetWires23.push(h[3]),this.offsetWires23.push(h[4]),this.offsetWires23.push(h[5]),this.offsetWires23.push(h[6]),this.offsetWires23.push(h[7]),this.ToffsetWires2C1.push(h[8]),this.ToffsetWires2C1.push(h[9]),this.ToffsetWires2C1.push(h[10]),this.ToffsetWires2C1.push(h[11]),this.ToffsetWires2C1.push(h[12]),this.ToffsetWires2C1.push(h[13]),this.ToffsetWires2C1.push(h[14]),this.ToffsetWires2C1.push(h[15]);break}else switch(this.LineInfo.Wairnum){case E.单分裂:const m=N(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o);this.offsetWires23.push(m),this.ToffsetWires2C2.push(m);break;case E.双分裂:const _=N(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),W=N(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o);this.offsetWires23.push(_),this.offsetWires23.push(W),this.ToffsetWires2C2.push(_),this.ToffsetWires2C2.push(W);break;case E.四分裂:const C=N(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),T=N(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),L=N(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),w=N(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o);this.offsetWires23.push(C),this.offsetWires23.push(T),this.offsetWires23.push(L),this.offsetWires23.push(w),this.ToffsetWires2C2.push(C),this.ToffsetWires2C2.push(T),this.ToffsetWires2C2.push(L),this.ToffsetWires2C2.push(w);break;case E.六分裂:const D=N(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),b=N(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),B=N(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),R=N(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),x=N(r,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),M=N(r,new g.Cartesian3(a.InsulatorPoint[5].X*-1,a.InsulatorPoint[5].Y,a.InsulatorPoint[5].Z),o);this.offsetWires23.push(D),this.offsetWires23.push(b),this.offsetWires23.push(B),this.offsetWires23.push(R),this.offsetWires23.push(x),this.offsetWires23.push(M),this.ToffsetWires2C2.push(D),this.ToffsetWires2C2.push(b),this.ToffsetWires2C2.push(B),this.ToffsetWires2C2.push(R),this.ToffsetWires2C2.push(x),this.ToffsetWires2C2.push(M);break;case E.八分裂:const q=N(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o),Z=N(r,new g.Cartesian3(a.InsulatorPoint[1].X*-1,a.InsulatorPoint[1].Y,a.InsulatorPoint[1].Z),o),O=N(r,new g.Cartesian3(a.InsulatorPoint[2].X*-1,a.InsulatorPoint[2].Y,a.InsulatorPoint[2].Z),o),X=N(r,new g.Cartesian3(a.InsulatorPoint[3].X*-1,a.InsulatorPoint[3].Y,a.InsulatorPoint[3].Z),o),K=N(r,new g.Cartesian3(a.InsulatorPoint[4].X*-1,a.InsulatorPoint[4].Y,a.InsulatorPoint[4].Z),o),et=N(r,new g.Cartesian3(a.InsulatorPoint[5].X*-1,a.InsulatorPoint[5].Y,a.InsulatorPoint[5].Z),o),st=N(r,new g.Cartesian3(a.InsulatorPoint[6].X*-1,a.InsulatorPoint[6].Y,a.InsulatorPoint[6].Z),o),ut=N(r,new g.Cartesian3(a.InsulatorPoint[7].X*-1,a.InsulatorPoint[7].Y,a.InsulatorPoint[7].Z),o);this.offsetWires23.push(q),this.offsetWires23.push(Z),this.offsetWires23.push(O),this.offsetWires23.push(X),this.offsetWires23.push(K),this.offsetWires23.push(et),this.offsetWires23.push(st),this.offsetWires23.push(ut),this.ToffsetWires2C2.push(q),this.ToffsetWires2C2.push(Z),this.ToffsetWires2C2.push(O),this.ToffsetWires2C2.push(X),this.ToffsetWires2C2.push(K),this.ToffsetWires2C2.push(et),this.ToffsetWires2C2.push(st),this.ToffsetWires2C2.push(ut);break}else if(a.type==Kt.跳线串)switch(this.LineInfo.Wairnum){case E.单分裂:this.ToffsetWires2C1.push(h[0]),this.ToffsetWires2C2.push(h[0]);break;case E.双分裂:this.ToffsetWires2C1.push(h[0]),this.ToffsetWires2C1.push(h[1]),this.ToffsetWires2C2.push(h[2]),this.ToffsetWires2C2.push(h[3]);break;case E.四分裂:this.ToffsetWires2C1.push(h[0]),this.ToffsetWires2C1.push(h[1]),this.ToffsetWires2C1.push(h[2]),this.ToffsetWires2C1.push(h[3]),this.ToffsetWires2C2.push(h[4]),this.ToffsetWires2C2.push(h[5]),this.ToffsetWires2C2.push(h[6]),this.ToffsetWires2C2.push(h[7]);break;case E.六分裂:this.ToffsetWires2C1.push(h[0]),this.ToffsetWires2C1.push(h[1]),this.ToffsetWires2C1.push(h[2]),this.ToffsetWires2C1.push(h[3]),this.ToffsetWires2C1.push(h[4]),this.ToffsetWires2C1.push(h[5]),this.ToffsetWires2C2.push(h[6]),this.ToffsetWires2C2.push(h[7]),this.ToffsetWires2C2.push(h[8]),this.ToffsetWires2C2.push(h[9]),this.ToffsetWires2C2.push(h[10]),this.ToffsetWires2C2.push(h[11]);break;case E.八分裂:this.ToffsetWires2C1.push(h[0]),this.ToffsetWires2C1.push(h[1]),this.ToffsetWires2C1.push(h[2]),this.ToffsetWires2C1.push(h[3]),this.ToffsetWires2C1.push(h[4]),this.ToffsetWires2C1.push(h[5]),this.ToffsetWires2C1.push(h[6]),this.ToffsetWires2C1.push(h[7]),this.ToffsetWires2C2.push(h[8]),this.ToffsetWires2C2.push(h[9]),this.ToffsetWires2C2.push(h[10]),this.ToffsetWires2C2.push(h[11]),this.ToffsetWires2C2.push(h[12]),this.ToffsetWires2C2.push(h[13]),this.ToffsetWires2C2.push(h[14]),this.ToffsetWires2C2.push(h[15]);break}break}else switch(a.PhaseSequence){case Le.A相:h.forEach(m=>{this.offsetWires21.push(m)});break;case Le.B相:h.forEach(m=>{this.offsetWires22.push(m)});break;case Le.C相:h.forEach(m=>{this.offsetWires23.push(m)});break}else if(this.LineInfo.towers[i].type==Ti.耐张塔)switch(u){case 11:this.offsetWires21.push(h[0]),this.ToffsetWires2A1.push(h[0]);break;case 12:this.ToffsetWires2A1.push(h[0]),this.ToffsetWires2A2.push(h[0]);break;case 13:const m=N(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o);this.offsetWires21.push(m),this.ToffsetWires2A2.push(m);break;case 14:this.offsetWires22.push(h[0]),this.ToffsetWires2B1.push(h[0]);break;case 15:this.ToffsetWires2B1.push(h[0]),this.ToffsetWires2B2.push(h[0]);break;case 16:const _=N(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o);this.offsetWires22.push(_),this.ToffsetWires2B2.push(_);break;case 17:this.offsetWires23.push(h[0]),this.ToffsetWires2C1.push(h[0]);break;case 18:this.ToffsetWires2C1.push(h[0]),this.ToffsetWires2C2.push(h[0]);break;case 19:const W=N(r,new g.Cartesian3(a.InsulatorPoint[0].X*-1,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o);this.offsetWires23.push(W),this.ToffsetWires2C2.push(W);break}else switch(u){case 5:h.forEach(m=>{this.offsetWires21.push(m)});break;case 6:h.forEach(m=>{this.offsetWires22.push(m)});break;case 7:h.forEach(m=>{this.offsetWires23.push(m)});break}break;case rn.地线:if(this.LineInfo.ISPhaseSequence)switch(a.PhaseSequence){case Le.地线1:this.offsetGrouundWires11.push(h[0]);break;case Le.地线2:this.offsetGrouundWires12.push(h[0]);break}else switch(u){case 0:this.offsetGrouundWires11.push(h[0]);break;case 1:this.offsetGrouundWires12.push(h[0]);break}break}u=u+1}),this.offsetWires11.length>0&&i>0){const a=[],c=[],p=[],d=[],h=[],m=[],_=[],W=[];switch(this.LineInfo.Wairnum){case E.单分裂:this.offsetWires11.length>=2&&(a.push(this.offsetWires11[t]),a.push(this.offsetWires11[t-1]),this.offsetArcWires1A=v(a),this.offsetArcWires1A.forEach(C=>{const T=Re(this.viewer.scene.globe.ellipsoid,C);this.arcLine1A1.push(T)}),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)));break;case E.双分裂:this.offsetWires11.length>=4&&(a.push(this.offsetWires11[t]),a.push(this.offsetWires11[t-2]),this.offsetArcWires1A=v(a),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1A.forEach(C=>{this.arcLine1A1.push(Re(this.viewer.scene.globe.ellipsoid,C))}),c.push(this.offsetWires11[t+1]),c.push(this.offsetWires11[t-1]),this.offsetArcWires1A=v(c),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)));break;case E.四分裂:this.offsetWires11.length>=8&&(a.push(this.offsetWires11[t]),a.push(this.offsetWires11[t-4]),this.offsetArcWires1A=v(a),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1A.forEach(C=>{this.arcLine1A1.push(Re(this.viewer.scene.globe.ellipsoid,C))}),c.push(this.offsetWires11[t+1]),c.push(this.offsetWires11[t-3]),this.offsetArcWires1A=v(c),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires11[t+2]),p.push(this.offsetWires11[t-2]),this.offsetArcWires1A=v(p),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires11[t+3]),d.push(this.offsetWires11[t-1]),this.offsetArcWires1A=v(d),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)));break;case E.六分裂:this.offsetWires11.length>=12&&(a.push(this.offsetWires11[t]),a.push(this.offsetWires11[t-6]),this.offsetArcWires1A=v(a),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1A.forEach(C=>{this.arcLine1A1.push(Re(this.viewer.scene.globe.ellipsoid,C))}),c.push(this.offsetWires11[t+1]),c.push(this.offsetWires11[t-5]),this.offsetArcWires1A=v(c),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires11[t+2]),p.push(this.offsetWires11[t-4]),this.offsetArcWires1A=v(p),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires11[t+3]),d.push(this.offsetWires11[t-3]),this.offsetArcWires1A=v(d),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires11[t+4]),h.push(this.offsetWires11[t-2]),this.offsetArcWires1A=v(h),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),m.push(this.offsetWires11[t+5]),m.push(this.offsetWires11[t-1]),this.offsetArcWires1A=v(m),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)));break;case E.八分裂:this.offsetWires11.length>=16&&(a.push(this.offsetWires11[t]),a.push(this.offsetWires11[t-8]),this.offsetArcWires1A=v(a),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1A.forEach(C=>{this.arcLine1A1.push(Re(this.viewer.scene.globe.ellipsoid,C))}),c.push(this.offsetWires11[t+1]),c.push(this.offsetWires11[t-7]),this.offsetArcWires1A=v(c),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires11[t+2]),p.push(this.offsetWires11[t-6]),this.offsetArcWires1A=v(p),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires11[t+3]),d.push(this.offsetWires11[t-5]),this.offsetArcWires1A=v(d),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires11[t+4]),h.push(this.offsetWires11[t-4]),this.offsetArcWires1A=v(h),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),m.push(this.offsetWires11[t+5]),m.push(this.offsetWires11[t-3]),this.offsetArcWires1A=v(m),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),_.push(this.offsetWires11[t+6]),_.push(this.offsetWires11[t-2]),this.offsetArcWires1A=v(_),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A7"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),W.push(this.offsetWires11[t+7]),W.push(this.offsetWires11[t-1]),this.offsetArcWires1A=v(W),this.LineentityCollection2.add(y(this.offsetArcWires1A,"导线1_A8"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)));break}}if(this.offsetWires12.length>0&&i>0){const a=[],c=[],p=[],d=[],h=[],m=[],_=[],W=[];switch(this.LineInfo.Wairnum){case E.单分裂:a.push(this.offsetWires12[t]),a.push(this.offsetWires12[t-1]),this.offsetArcWires1B=v(a),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1B.forEach(C=>{this.arcLine1B1.push(Re(this.viewer.scene.globe.ellipsoid,C))});break;case E.双分裂:a.push(this.offsetWires12[t]),a.push(this.offsetWires12[t-2]),this.offsetArcWires1B=v(a),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1B.forEach(C=>{this.arcLine1B1.push(Re(this.viewer.scene.globe.ellipsoid,C))}),c.push(this.offsetWires12[t+1]),c.push(this.offsetWires12[t-1]),this.offsetArcWires1B=v(c),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case E.四分裂:a.push(this.offsetWires12[t]),a.push(this.offsetWires12[t-4]),this.offsetArcWires1B=v(a),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1B.forEach(C=>{this.arcLine1B1.push(Re(this.viewer.scene.globe.ellipsoid,C))}),c.push(this.offsetWires12[t+1]),c.push(this.offsetWires12[t-3]),this.offsetArcWires1B=v(c),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires12[t+2]),p.push(this.offsetWires12[t-2]),this.offsetArcWires1B=v(p),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires12[t+3]),d.push(this.offsetWires12[t-1]),this.offsetArcWires1B=v(d),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case E.六分裂:a.push(this.offsetWires12[t]),a.push(this.offsetWires12[t-6]),this.offsetArcWires1B=v(a),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1B.forEach(C=>{this.arcLine1B1.push(Re(this.viewer.scene.globe.ellipsoid,C))}),c.push(this.offsetWires12[t+1]),c.push(this.offsetWires12[t-5]),this.offsetArcWires1B=v(c),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires12[t+2]),p.push(this.offsetWires12[t-4]),this.offsetArcWires1B=v(p),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires12[t+3]),d.push(this.offsetWires12[t-3]),this.offsetArcWires1B=v(d),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires12[t+4]),h.push(this.offsetWires12[t-2]),this.offsetArcWires1B=v(h),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),m.push(this.offsetWires12[t+5]),m.push(this.offsetWires12[t-1]),this.offsetArcWires1B=v(m),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case E.八分裂:a.push(this.offsetWires12[t]),a.push(this.offsetWires12[t-8]),this.offsetArcWires1B=v(a),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1B.forEach(C=>{this.arcLine1B1.push(Re(this.viewer.scene.globe.ellipsoid,C))}),c.push(this.offsetWires12[t+1]),c.push(this.offsetWires12[t-7]),this.offsetArcWires1B=v(c),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires12[t+2]),p.push(this.offsetWires12[t-6]),this.offsetArcWires1B=v(p),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires12[t+3]),d.push(this.offsetWires12[t-5]),this.offsetArcWires1B=v(d),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires12[t+4]),h.push(this.offsetWires12[t-4]),this.offsetArcWires1B=v(h),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),m.push(this.offsetWires12[t+5]),m.push(this.offsetWires12[t-3]),this.offsetArcWires1B=v(m),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),_.push(this.offsetWires12[t+6]),_.push(this.offsetWires12[t-2]),this.offsetArcWires1B=v(_),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B7"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),W.push(this.offsetWires12[t+7]),W.push(this.offsetWires12[t-1]),this.offsetArcWires1B=v(W),this.LineentityCollection2.add(y(this.offsetArcWires1B,"导线1_B8"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break}}if(this.offsetWires13.length>0&&i>0){const a=[],c=[],p=[],d=[],h=[],m=[],_=[],W=[];switch(this.LineInfo.Wairnum){case E.单分裂:a.push(this.offsetWires13[t]),a.push(this.offsetWires13[t-1]),this.offsetArcWires1C=v(a),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1C.forEach(C=>{this.arcLine1C1.push(Re(this.viewer.scene.globe.ellipsoid,C))});break;case E.双分裂:a.push(this.offsetWires13[t]),a.push(this.offsetWires13[t-2]),this.offsetArcWires1C=v(a),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),c.push(this.offsetWires13[t+1]),c.push(this.offsetWires13[t-1]),this.offsetArcWires1C=v(c),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1C.forEach(C=>{this.arcLine1C1.push(Re(this.viewer.scene.globe.ellipsoid,C))});break;case E.四分裂:a.push(this.offsetWires13[t]),a.push(this.offsetWires13[t-4]),this.offsetArcWires1C=v(a),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),c.push(this.offsetWires13[t+1]),c.push(this.offsetWires13[t-3]),this.offsetArcWires1C=v(c),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires13[t+2]),p.push(this.offsetWires13[t-2]),this.offsetArcWires1C=v(p),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires13[t+3]),d.push(this.offsetWires13[t-1]),this.offsetArcWires1C=v(d),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1C.forEach(C=>{this.arcLine1C1.push(Re(this.viewer.scene.globe.ellipsoid,C))});break;case E.六分裂:a.push(this.offsetWires13[t]),a.push(this.offsetWires13[t-6]),this.offsetArcWires1C=v(a),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),c.push(this.offsetWires13[t+1]),c.push(this.offsetWires13[t-5]),this.offsetArcWires1C=v(c),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires13[t+2]),p.push(this.offsetWires13[t-4]),this.offsetArcWires1C=v(p),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires13[t+3]),d.push(this.offsetWires13[t-3]),this.offsetArcWires1C=v(d),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires13[t+4]),h.push(this.offsetWires13[t-2]),this.offsetArcWires1C=v(h),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),m.push(this.offsetWires13[t+5]),m.push(this.offsetWires13[t-1]),this.offsetArcWires1C=v(m),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1C.forEach(C=>{this.arcLine1C1.push(Re(this.viewer.scene.globe.ellipsoid,C))});break;case E.八分裂:a.push(this.offsetWires13[t]),a.push(this.offsetWires13[t-8]),this.offsetArcWires1C=v(a),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),c.push(this.offsetWires13[t+1]),c.push(this.offsetWires13[t-7]),this.offsetArcWires1C=v(c),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires13[t+2]),p.push(this.offsetWires13[t-6]),this.offsetArcWires1C=v(p),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires13[t+3]),d.push(this.offsetWires13[t-5]),this.offsetArcWires1C=v(d),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires13[t+4]),h.push(this.offsetWires13[t-4]),this.offsetArcWires1C=v(h),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),m.push(this.offsetWires13[t+5]),m.push(this.offsetWires13[t-3]),this.offsetArcWires1C=v(m),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),_.push(this.offsetWires13[t+6]),_.push(this.offsetWires13[t-2]),this.offsetArcWires1C=v(_),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C7"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),W.push(this.offsetWires13[t+7]),W.push(this.offsetWires13[t-1]),this.offsetArcWires1C=v(W),this.LineentityCollection2.add(y(this.offsetArcWires1C,"导线1_C8"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1C.forEach(C=>{this.arcLine1C1.push(Re(this.viewer.scene.globe.ellipsoid,C))});break}}if(this.offsetWires21.length>0&&i>0){const a=[],c=[],p=[],d=[],h=[],m=[],_=[],W=[];switch(this.LineInfo.Wairnum){case E.单分裂:a.push(this.offsetWires21[t]),a.push(this.offsetWires21[t-1]),this.offsetArcWires2A=v(a),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case E.双分裂:a.push(this.offsetWires21[t]),a.push(this.offsetWires21[t-2]),this.offsetArcWires2A=v(a),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),c.push(this.offsetWires21[t+1]),c.push(this.offsetWires21[t-1]),this.offsetArcWires2A=v(c),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case E.四分裂:a.push(this.offsetWires21[t]),a.push(this.offsetWires21[t-4]),this.offsetArcWires2A=v(a),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),c.push(this.offsetWires21[t+1]),c.push(this.offsetWires21[t-3]),this.offsetArcWires2A=v(c),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires21[t+2]),p.push(this.offsetWires21[t-2]),this.offsetArcWires2A=v(p),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires21[t+3]),d.push(this.offsetWires21[t-1]),this.offsetArcWires2A=v(d),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case E.六分裂:a.push(this.offsetWires21[t]),a.push(this.offsetWires21[t-6]),this.offsetArcWires2A=v(a),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),c.push(this.offsetWires21[t+1]),c.push(this.offsetWires21[t-5]),this.offsetArcWires2A=v(c),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires21[t+2]),p.push(this.offsetWires21[t-4]),this.offsetArcWires2A=v(p),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires21[t+3]),d.push(this.offsetWires21[t-3]),this.offsetArcWires2A=v(d),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires21[t+4]),h.push(this.offsetWires21[t-2]),this.offsetArcWires2A=v(h),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),m.push(this.offsetWires21[t+5]),m.push(this.offsetWires21[t-1]),this.offsetArcWires2A=v(m),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case E.八分裂:a.push(this.offsetWires21[t]),a.push(this.offsetWires21[t-8]),this.offsetArcWires2A=v(a),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),c.push(this.offsetWires21[t+1]),c.push(this.offsetWires21[t-7]),this.offsetArcWires2A=v(c),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires21[t+2]),p.push(this.offsetWires21[t-6]),this.offsetArcWires2A=v(p),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires21[t+3]),d.push(this.offsetWires21[t-5]),this.offsetArcWires2A=v(d),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires21[t+4]),h.push(this.offsetWires21[t-4]),this.offsetArcWires2A=v(h),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),m.push(this.offsetWires21[t+5]),m.push(this.offsetWires21[t-3]),this.offsetArcWires2A=v(m),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),_.push(this.offsetWires21[t+6]),_.push(this.offsetWires21[t-2]),this.offsetArcWires2A=v(_),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A7"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),W.push(this.offsetWires21[t+7]),W.push(this.offsetWires21[t-1]),this.offsetArcWires2A=v(W),this.LineentityCollection2.add(y(this.offsetArcWires2A,"导线2_A8"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break}}if(this.offsetWires22.length>0&&i>0){const a=[],c=[],p=[],d=[],h=[],m=[],_=[],W=[];switch(this.LineInfo.Wairnum){case E.单分裂:a.push(this.offsetWires22[t]),a.push(this.offsetWires22[t-1]),this.offsetArcWires2B=v(a),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case E.双分裂:a.push(this.offsetWires22[t]),a.push(this.offsetWires22[t-2]),this.offsetArcWires2B=v(a),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),c.push(this.offsetWires22[t+1]),c.push(this.offsetWires22[t-1]),this.offsetArcWires2B=v(c),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case E.四分裂:a.push(this.offsetWires22[t]),a.push(this.offsetWires22[t-4]),this.offsetArcWires2B=v(a),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),c.push(this.offsetWires22[t+1]),c.push(this.offsetWires22[t-3]),this.offsetArcWires2B=v(c),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires22[t+2]),p.push(this.offsetWires22[t-2]),this.offsetArcWires2B=v(p),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires22[t+3]),d.push(this.offsetWires22[t-1]),this.offsetArcWires2B=v(d),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case E.六分裂:a.push(this.offsetWires22[t]),a.push(this.offsetWires22[t-6]),this.offsetArcWires2B=v(a),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),c.push(this.offsetWires22[t+1]),c.push(this.offsetWires22[t-5]),this.offsetArcWires2B=v(c),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires22[t+2]),p.push(this.offsetWires22[t-4]),this.offsetArcWires2B=v(p),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires22[t+3]),d.push(this.offsetWires22[t-3]),this.offsetArcWires2B=v(d),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires22[t+4]),h.push(this.offsetWires22[t-2]),this.offsetArcWires2B=v(h),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),m.push(this.offsetWires22[t+5]),m.push(this.offsetWires22[t-1]),this.offsetArcWires2B=v(m),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case E.八分裂:a.push(this.offsetWires22[t]),a.push(this.offsetWires22[t-8]),this.offsetArcWires2B=v(a),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),c.push(this.offsetWires22[t+1]),c.push(this.offsetWires22[t-7]),this.offsetArcWires2B=v(c),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires22[t+2]),p.push(this.offsetWires22[t-6]),this.offsetArcWires2B=v(p),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires22[t+3]),d.push(this.offsetWires22[t-5]),this.offsetArcWires2B=v(d),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires22[t+4]),h.push(this.offsetWires22[t-4]),this.offsetArcWires2B=v(h),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),m.push(this.offsetWires22[t+5]),m.push(this.offsetWires22[t-3]),this.offsetArcWires2B=v(m),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),_.push(this.offsetWires22[t+6]),_.push(this.offsetWires22[t-2]),this.offsetArcWires2B=v(_),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B7"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),W.push(this.offsetWires22[t+7]),W.push(this.offsetWires22[t-1]),this.offsetArcWires2B=v(W),this.LineentityCollection2.add(y(this.offsetArcWires2B,"导线2_B8"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break}}if(this.offsetWires23.length>0&&i>0){const a=[],c=[],p=[],d=[],h=[],m=[],_=[],W=[];switch(this.LineInfo.Wairnum){case E.单分裂:a.push(this.offsetWires23[t]),a.push(this.offsetWires23[t-1]),this.offsetArcWires2C=v(a),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case E.双分裂:a.push(this.offsetWires23[t]),a.push(this.offsetWires23[t-2]),this.offsetArcWires2C=v(a),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),c.push(this.offsetWires23[t+1]),c.push(this.offsetWires23[t-1]),this.offsetArcWires2C=v(c),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case E.四分裂:a.push(this.offsetWires23[t]),a.push(this.offsetWires23[t-4]),this.offsetArcWires2C=v(a),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),c.push(this.offsetWires23[t+1]),c.push(this.offsetWires23[t-3]),this.offsetArcWires2C=v(c),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires23[t+2]),p.push(this.offsetWires23[t-2]),this.offsetArcWires2C=v(p),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires23[t+3]),d.push(this.offsetWires23[t-1]),this.offsetArcWires2C=v(d),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case E.六分裂:a.push(this.offsetWires23[t]),a.push(this.offsetWires23[t-6]),this.offsetArcWires2C=v(a),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),c.push(this.offsetWires23[t+1]),c.push(this.offsetWires23[t-5]),this.offsetArcWires2C=v(c),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires23[t+2]),p.push(this.offsetWires23[t-4]),this.offsetArcWires2C=v(p),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires23[t+3]),d.push(this.offsetWires23[t-3]),this.offsetArcWires2C=v(d),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires23[t+4]),h.push(this.offsetWires23[t-2]),this.offsetArcWires2C=v(h),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),m.push(this.offsetWires23[t+5]),m.push(this.offsetWires23[t-1]),this.offsetArcWires2C=v(m),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case E.八分裂:a.push(this.offsetWires23[t]),a.push(this.offsetWires23[t-8]),this.offsetArcWires2C=v(a),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),c.push(this.offsetWires23[t+1]),c.push(this.offsetWires23[t-7]),this.offsetArcWires2C=v(c),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires23[t+2]),p.push(this.offsetWires23[t-6]),this.offsetArcWires2C=v(p),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),d.push(this.offsetWires23[t+3]),d.push(this.offsetWires23[t-5]),this.offsetArcWires2C=v(d),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),h.push(this.offsetWires23[t+4]),h.push(this.offsetWires23[t-4]),this.offsetArcWires2C=v(h),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),m.push(this.offsetWires23[t+5]),m.push(this.offsetWires23[t-3]),this.offsetArcWires2C=v(m),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),_.push(this.offsetWires23[t+6]),_.push(this.offsetWires23[t-2]),this.offsetArcWires2C=v(_),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C7"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),W.push(this.offsetWires23[t+7]),W.push(this.offsetWires23[t-1]),this.offsetArcWires2C=v(W),this.LineentityCollection2.add(y(this.offsetArcWires2C,"导线2_C8"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break}}if(this.offsetGrouundWires11.length>1){const a=[];a.push(this.offsetGrouundWires11[i]),a.push(this.offsetGrouundWires11[i-1]);const c=[];c.push(this.offsetGrouundWires12[i]),c.push(this.offsetGrouundWires12[i-1]),this.offsetGrouundWires1=v(a,2),this.offsetGrouundWires2=v(c,2),this.LineentityCollection2.add(y(this.offsetGrouundWires1,"地线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireD1Color)),this.LineentityCollection2.add(y(this.offsetGrouundWires2,"地线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireD2Color))}let l=2;if(this.LineInfo.towers[i].type==Ti.耐张塔){switch(this.LineInfo.Wairnum){case E.单分裂:t=t+l,e=e+l;break;case E.双分裂:t=t+l*2,e=e+l*2;break;case E.四分裂:t=t+l*4,e=e+l*4;break;case E.六分裂:t=t+l*6,e=e+l*6;break;case E.八分裂:t=t+l*8,e=e+l*8;break}if(this.ToffsetWires1A1.length>1&&this.ToffsetWires1A2.length>1){const a=[],c=[],p=[],d=[],h=[],m=[],_=[],W=[],C=[],T=[],L=[],w=[],D=[],b=[],B=[],R=[];switch(this.LineInfo.Wairnum){case E.单分裂:this.ToffsetWires1A1.length>=2&&(a.push(this.ToffsetWires1A1[e-2]),a.push(this.ToffsetWires1A1[e-1]),this.ToffsetArcWires1A=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1A2.length>=2&&(C.push(this.ToffsetWires1A2[e-2]),C.push(this.ToffsetWires1A2[e-1]),this.ToffsetArcWires2A=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case E.双分裂:this.ToffsetWires1A1.length>=4&&(a.push(this.ToffsetWires1A1[e-4]),a.push(this.ToffsetWires1A1[e-2]),this.ToffsetArcWires1A=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires1A1[e-3]),c.push(this.ToffsetWires1A1[e-1]),this.ToffsetArcWires1A=v(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1A2.length>=4&&(C.push(this.ToffsetWires1A2[e-4]),C.push(this.ToffsetWires1A2[e-2]),this.ToffsetArcWires2A=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1A2[e-3]),T.push(this.ToffsetWires1A2[e-1]),this.ToffsetArcWires2A=v(T,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case E.四分裂:this.ToffsetWires1A1.length>=8&&(a.push(this.ToffsetWires1A1[e-8]),a.push(this.ToffsetWires1A1[e-4]),this.ToffsetArcWires1A=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires1A1[e-7]),c.push(this.ToffsetWires1A1[e-3]),this.ToffsetArcWires1A=v(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1A1[e-6]),p.push(this.ToffsetWires1A1[e-2]),this.ToffsetArcWires1A=v(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires1A1[e-5]),d.push(this.ToffsetWires1A1[e-1]),this.ToffsetArcWires1A=v(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1A2.length>=8&&(C.push(this.ToffsetWires1A2[e-8]),C.push(this.ToffsetWires1A2[e-4]),this.ToffsetArcWires2A=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1A2[e-7]),T.push(this.ToffsetWires1A2[e-3]),this.ToffsetArcWires2A=v(T,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires1A2[e-6]),L.push(this.ToffsetWires1A2[e-2]),this.ToffsetArcWires2A=v(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),w.push(this.ToffsetWires1A2[e-5]),w.push(this.ToffsetWires1A2[e-1]),this.ToffsetArcWires2A=v(w,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case E.六分裂:this.ToffsetWires1A1.length>=12&&(a.push(this.ToffsetWires1A1[e-12]),a.push(this.ToffsetWires1A1[e-6]),this.ToffsetArcWires1A=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires1A1[e-11]),c.push(this.ToffsetWires1A1[e-5]),this.ToffsetArcWires1A=v(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1A1[e-10]),p.push(this.ToffsetWires1A1[e-4]),this.ToffsetArcWires1A=v(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires1A1[e-9]),d.push(this.ToffsetWires1A1[e-3]),this.ToffsetArcWires1A=v(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires1A1[e-8]),h.push(this.ToffsetWires1A1[e-2]),this.ToffsetArcWires1A=v(h,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires1A1[e-7]),m.push(this.ToffsetWires1A1[e-1]),this.ToffsetArcWires1A=v(m,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1A2.length>=12&&(C.push(this.ToffsetWires1A2[e-12]),C.push(this.ToffsetWires1A2[e-6]),this.ToffsetArcWires2A=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1A2[e-11]),T.push(this.ToffsetWires1A2[e-5]),this.ToffsetArcWires2A=v(T,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires1A2[e-10]),L.push(this.ToffsetWires1A2[e-4]),this.ToffsetArcWires2A=v(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),w.push(this.ToffsetWires1A2[e-9]),w.push(this.ToffsetWires1A2[e-3]),this.ToffsetArcWires2A=v(w,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires1A2[e-8]),D.push(this.ToffsetWires1A2[e-2]),this.ToffsetArcWires2A=v(D,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires1A2[e-7]),b.push(this.ToffsetWires1A2[e-1]),this.ToffsetArcWires2A=v(b,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case E.八分裂:this.ToffsetWires1A1.length>=16&&(a.push(this.ToffsetWires1A1[e-16]),a.push(this.ToffsetWires1A1[e-8]),this.ToffsetArcWires1A=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires1A1[e-15]),c.push(this.ToffsetWires1A1[e-7]),this.ToffsetArcWires1A=v(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1A1[e-14]),p.push(this.ToffsetWires1A1[e-6]),this.ToffsetArcWires1A=v(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires1A1[e-13]),d.push(this.ToffsetWires1A1[e-5]),this.ToffsetArcWires1A=v(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires1A1[e-12]),h.push(this.ToffsetWires1A1[e-4]),this.ToffsetArcWires1A=v(h,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires1A1[e-11]),m.push(this.ToffsetWires1A1[e-3]),this.ToffsetArcWires1A=v(m,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),_.push(this.ToffsetWires1A1[e-10]),_.push(this.ToffsetWires1A1[e-2]),this.ToffsetArcWires1A=v(_,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线7"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),W.push(this.ToffsetWires1A1[e-9]),W.push(this.ToffsetWires1A1[e-1]),this.ToffsetArcWires1A=v(W,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A,"1A1跳线8"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1A2.length>=16&&(C.push(this.ToffsetWires1A2[e-16]),C.push(this.ToffsetWires1A2[e-8]),this.ToffsetArcWires2A=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1A2[e-15]),T.push(this.ToffsetWires1A2[e-7]),this.ToffsetArcWires2A=v(T,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires1A2[e-14]),L.push(this.ToffsetWires1A2[e-6]),this.ToffsetArcWires2A=v(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),w.push(this.ToffsetWires1A2[e-13]),w.push(this.ToffsetWires1A2[e-5]),this.ToffsetArcWires2A=v(w,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires1A2[e-12]),D.push(this.ToffsetWires1A2[e-4]),this.ToffsetArcWires2A=v(D,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires1A2[e-11]),b.push(this.ToffsetWires1A2[e-3]),this.ToffsetArcWires2A=v(b,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires1A2[e-10]),B.push(this.ToffsetWires1A2[e-2]),this.ToffsetArcWires2A=v(B,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线7"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),R.push(this.ToffsetWires1A2[e-9]),R.push(this.ToffsetWires1A2[e-1]),this.ToffsetArcWires2A=v(R,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A,"1A2跳线8"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break}}if(this.ToffsetWires1B1.length>1&&this.ToffsetWires1B2.length>1){const a=[],c=[],p=[],d=[],h=[],m=[],_=[],W=[],C=[],T=[],L=[],w=[],D=[],b=[],B=[],R=[];switch(this.LineInfo.Wairnum){case E.单分裂:this.ToffsetWires1B1.length>=2&&(a.push(this.ToffsetWires1B1[e-2]),a.push(this.ToffsetWires1B1[e-1]),this.ToffsetArcWires1B=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1B2.length>=2&&(C.push(this.ToffsetWires1B2[e-2]),C.push(this.ToffsetWires1B2[e-1]),this.ToffsetArcWires2B=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case E.双分裂:this.ToffsetWires1B1.length>=4&&(a.push(this.ToffsetWires1B1[e-4]),a.push(this.ToffsetWires1B1[e-2]),this.ToffsetArcWires1B=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires1B1[e-3]),c.push(this.ToffsetWires1B1[e-1]),this.ToffsetArcWires1B=v(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1B2.length>=4&&(C.push(this.ToffsetWires1B2[e-4]),C.push(this.ToffsetWires1B2[e-2]),this.ToffsetArcWires2B=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1B2[e-3]),T.push(this.ToffsetWires1B2[e-1]),this.ToffsetArcWires2B=v(T,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case E.四分裂:this.ToffsetWires1B1.length>=8&&(a.push(this.ToffsetWires1B1[e-8]),a.push(this.ToffsetWires1B1[e-4]),this.ToffsetArcWires1B=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires1B1[e-7]),c.push(this.ToffsetWires1B1[e-3]),this.ToffsetArcWires1B=v(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1B1[e-6]),p.push(this.ToffsetWires1B1[e-2]),this.ToffsetArcWires1B=v(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires1B1[e-5]),d.push(this.ToffsetWires1B1[e-1]),this.ToffsetArcWires1B=v(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1B2.length>=8&&(C.push(this.ToffsetWires1B2[e-8]),C.push(this.ToffsetWires1B2[e-4]),this.ToffsetArcWires2B=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1B2[e-7]),T.push(this.ToffsetWires1B2[e-3]),this.ToffsetArcWires2B=v(T,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires1B2[e-6]),L.push(this.ToffsetWires1B2[e-2]),this.ToffsetArcWires2B=v(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),w.push(this.ToffsetWires1B2[e-5]),w.push(this.ToffsetWires1B2[e-1]),this.ToffsetArcWires2B=v(w,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case E.六分裂:this.ToffsetWires1B1.length>=12&&(a.push(this.ToffsetWires1B1[e-12]),a.push(this.ToffsetWires1B1[e-6]),this.ToffsetArcWires1B=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires1B1[e-11]),c.push(this.ToffsetWires1B1[e-5]),this.ToffsetArcWires1B=v(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1B1[e-10]),p.push(this.ToffsetWires1B1[e-4]),this.ToffsetArcWires1B=v(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires1B1[e-9]),d.push(this.ToffsetWires1B1[e-3]),this.ToffsetArcWires1B=v(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires1B1[e-8]),h.push(this.ToffsetWires1B1[e-2]),this.ToffsetArcWires1B=v(h,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires1B1[e-7]),m.push(this.ToffsetWires1B1[e-1]),this.ToffsetArcWires1B=v(m,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1B2.length>=12&&(C.push(this.ToffsetWires1B2[e-12]),C.push(this.ToffsetWires1B2[e-6]),this.ToffsetArcWires2B=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1B2[e-11]),T.push(this.ToffsetWires1B2[e-5]),this.ToffsetArcWires2B=v(T,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires1B2[e-10]),L.push(this.ToffsetWires1B2[e-4]),this.ToffsetArcWires2B=v(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),w.push(this.ToffsetWires1B2[e-9]),w.push(this.ToffsetWires1B2[e-3]),this.ToffsetArcWires2B=v(w,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires1B2[e-8]),D.push(this.ToffsetWires1B2[e-2]),this.ToffsetArcWires2B=v(D,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires1B2[e-7]),b.push(this.ToffsetWires1B2[e-1]),this.ToffsetArcWires2B=v(b,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case E.八分裂:this.ToffsetWires1B1.length>=16&&(a.push(this.ToffsetWires1B1[e-16]),a.push(this.ToffsetWires1B1[e-8]),this.ToffsetArcWires1B=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires1B1[e-15]),c.push(this.ToffsetWires1B1[e-7]),this.ToffsetArcWires1B=v(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1B1[e-14]),p.push(this.ToffsetWires1B1[e-6]),this.ToffsetArcWires1B=v(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires1B1[e-13]),d.push(this.ToffsetWires1B1[e-5]),this.ToffsetArcWires1B=v(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires1B1[e-12]),h.push(this.ToffsetWires1B1[e-4]),this.ToffsetArcWires1B=v(h,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires1B1[e-11]),m.push(this.ToffsetWires1B1[e-3]),this.ToffsetArcWires1B=v(m,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),_.push(this.ToffsetWires1B1[e-10]),_.push(this.ToffsetWires1B1[e-2]),this.ToffsetArcWires1B=v(_,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线7"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),W.push(this.ToffsetWires1B1[e-9]),W.push(this.ToffsetWires1B1[e-1]),this.ToffsetArcWires1B=v(W,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B,"1B1跳线8"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1B2.length>=16&&(C.push(this.ToffsetWires1B2[e-16]),C.push(this.ToffsetWires1B2[e-8]),this.ToffsetArcWires2B=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1B2[e-15]),T.push(this.ToffsetWires1B2[e-7]),this.ToffsetArcWires2B=v(T,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires1B2[e-14]),L.push(this.ToffsetWires1B2[e-6]),this.ToffsetArcWires2B=v(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),w.push(this.ToffsetWires1B2[e-13]),w.push(this.ToffsetWires1B2[e-5]),this.ToffsetArcWires2B=v(w,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires1B2[e-12]),D.push(this.ToffsetWires1B2[e-4]),this.ToffsetArcWires2B=v(D,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires1B2[e-11]),b.push(this.ToffsetWires1B2[e-3]),this.ToffsetArcWires2B=v(b,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires1B2[e-10]),B.push(this.ToffsetWires1B2[e-2]),this.ToffsetArcWires2B=v(B,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线7"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),R.push(this.ToffsetWires1B2[e-9]),R.push(this.ToffsetWires1B2[e-1]),this.ToffsetArcWires2B=v(R,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B,"1B2跳线8"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break}}if(this.ToffsetWires1C1.length>1&&this.ToffsetWires1C2.length>1){const a=[],c=[],p=[],d=[],h=[],m=[],_=[],W=[],C=[],T=[],L=[],w=[],D=[],b=[],B=[],R=[];switch(this.LineInfo.Wairnum){case E.单分裂:this.ToffsetWires1C1.length>=2&&(a.push(this.ToffsetWires1C1[e-2]),a.push(this.ToffsetWires1C1[e-1]),this.ToffsetArcWires1C=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1C2.length>=2&&(C.push(this.ToffsetWires1C2[e-2]),C.push(this.ToffsetWires1C2[e-1]),this.ToffsetArcWires2C=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case E.双分裂:this.ToffsetWires1C1.length>=4&&(a.push(this.ToffsetWires1C1[e-4]),a.push(this.ToffsetWires1C1[e-2]),this.ToffsetArcWires1C=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires1C1[e-3]),c.push(this.ToffsetWires1C1[e-1]),this.ToffsetArcWires1C=v(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1C2.length>=4&&(C.push(this.ToffsetWires1C2[e-4]),C.push(this.ToffsetWires1C2[e-2]),this.ToffsetArcWires2C=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1C2[e-3]),T.push(this.ToffsetWires1C2[e-1]),this.ToffsetArcWires2C=v(T,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case E.四分裂:this.ToffsetWires1C1.length>=8&&(a.push(this.ToffsetWires1C1[e-8]),a.push(this.ToffsetWires1C1[e-4]),this.ToffsetArcWires1C=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires1C1[e-7]),c.push(this.ToffsetWires1C1[e-3]),this.ToffsetArcWires1C=v(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1C1[e-6]),p.push(this.ToffsetWires1C1[e-2]),this.ToffsetArcWires1C=v(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires1C1[e-5]),d.push(this.ToffsetWires1C1[e-1]),this.ToffsetArcWires1C=v(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1C2.length>=8&&(C.push(this.ToffsetWires1C2[e-8]),C.push(this.ToffsetWires1C2[e-4]),this.ToffsetArcWires2C=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1C2[e-7]),T.push(this.ToffsetWires1C2[e-3]),this.ToffsetArcWires2C=v(T,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires1C2[e-6]),L.push(this.ToffsetWires1C2[e-2]),this.ToffsetArcWires2C=v(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),w.push(this.ToffsetWires1C2[e-5]),w.push(this.ToffsetWires1C2[e-1]),this.ToffsetArcWires2C=v(w,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case E.六分裂:this.ToffsetWires1C1.length>=12&&(a.push(this.ToffsetWires1C1[e-12]),a.push(this.ToffsetWires1C1[e-6]),this.ToffsetArcWires1C=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires1C1[e-11]),c.push(this.ToffsetWires1C1[e-5]),this.ToffsetArcWires1C=v(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1C1[e-10]),p.push(this.ToffsetWires1C1[e-4]),this.ToffsetArcWires1C=v(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires1C1[e-9]),d.push(this.ToffsetWires1C1[e-3]),this.ToffsetArcWires1C=v(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires1C1[e-8]),h.push(this.ToffsetWires1C1[e-2]),this.ToffsetArcWires1C=v(h,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires1C1[e-7]),m.push(this.ToffsetWires1C1[e-1]),this.ToffsetArcWires1C=v(m,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1C2.length>=12&&(C.push(this.ToffsetWires1C2[e-12]),C.push(this.ToffsetWires1C2[e-6]),this.ToffsetArcWires2C=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1C2[e-11]),T.push(this.ToffsetWires1C2[e-5]),this.ToffsetArcWires2C=v(T,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires1C2[e-10]),L.push(this.ToffsetWires1C2[e-4]),this.ToffsetArcWires2C=v(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),w.push(this.ToffsetWires1C2[e-9]),w.push(this.ToffsetWires1C2[e-3]),this.ToffsetArcWires2C=v(w,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires1C2[e-8]),D.push(this.ToffsetWires1C2[e-2]),this.ToffsetArcWires2C=v(D,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires1C2[e-7]),b.push(this.ToffsetWires1C2[e-1]),this.ToffsetArcWires2C=v(b,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case E.八分裂:this.ToffsetWires1C1.length>=16&&(a.push(this.ToffsetWires1C1[e-16]),a.push(this.ToffsetWires1C1[e-8]),this.ToffsetArcWires1C=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires1C1[e-15]),c.push(this.ToffsetWires1C1[e-7]),this.ToffsetArcWires1C=v(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1C1[e-14]),p.push(this.ToffsetWires1C1[e-6]),this.ToffsetArcWires1C=v(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires1C1[e-13]),d.push(this.ToffsetWires1C1[e-5]),this.ToffsetArcWires1C=v(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires1C1[e-12]),h.push(this.ToffsetWires1C1[e-4]),this.ToffsetArcWires1C=v(h,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires1C1[e-11]),m.push(this.ToffsetWires1C1[e-3]),this.ToffsetArcWires1C=v(m,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),_.push(this.ToffsetWires1C1[e-10]),_.push(this.ToffsetWires1C1[e-2]),this.ToffsetArcWires1C=v(_,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线7"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),W.push(this.ToffsetWires1C1[e-9]),W.push(this.ToffsetWires1C1[e-1]),this.ToffsetArcWires1C=v(W,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C,"1C1跳线8"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1C2.length>=16&&(C.push(this.ToffsetWires1C2[e-16]),C.push(this.ToffsetWires1C2[e-8]),this.ToffsetArcWires2C=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1C2[e-15]),T.push(this.ToffsetWires1C2[e-7]),this.ToffsetArcWires2C=v(T,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires1C2[e-14]),L.push(this.ToffsetWires1C2[e-6]),this.ToffsetArcWires2C=v(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),w.push(this.ToffsetWires1C2[e-13]),w.push(this.ToffsetWires1C2[e-5]),this.ToffsetArcWires2C=v(w,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires1C2[e-12]),D.push(this.ToffsetWires1C2[e-4]),this.ToffsetArcWires2C=v(D,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires1C2[e-11]),b.push(this.ToffsetWires1C2[e-3]),this.ToffsetArcWires2C=v(b,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires1C2[e-10]),B.push(this.ToffsetWires1C2[e-2]),this.ToffsetArcWires2C=v(B,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线7"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),R.push(this.ToffsetWires1C2[e-9]),R.push(this.ToffsetWires1C2[e-1]),this.ToffsetArcWires2C=v(R,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C,"1C2跳线8"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break}}if(this.ToffsetWires2A1.length>1&&this.ToffsetWires2A2.length>1){const a=[],c=[],p=[],d=[],h=[],m=[],_=[],W=[],C=[],T=[],L=[],w=[],D=[],b=[],B=[],R=[];switch(this.LineInfo.Wairnum){case E.单分裂:this.ToffsetWires2A1.length>=2&&(a.push(this.ToffsetWires2A1[e-2]),a.push(this.ToffsetWires2A1[e-1]),this.ToffsetArcWires1A2=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2A2.length>=2&&(C.push(this.ToffsetWires2A2[e-2]),C.push(this.ToffsetWires2A2[e-1]),this.ToffsetArcWires2A2=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case E.双分裂:this.ToffsetWires2A1.length>=4&&(a.push(this.ToffsetWires2A1[e-4]),a.push(this.ToffsetWires2A1[e-2]),this.ToffsetArcWires1A2=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires2A1[e-3]),c.push(this.ToffsetWires2A1[e-1]),this.ToffsetArcWires1A2=v(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2A2.length>=4&&(C.push(this.ToffsetWires2A2[e-4]),C.push(this.ToffsetWires2A2[e-2]),this.ToffsetArcWires2A2=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2A2[e-3]),T.push(this.ToffsetWires2A2[e-1]),this.ToffsetArcWires2A2=v(T,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case E.四分裂:this.ToffsetWires2A1.length>=8&&(a.push(this.ToffsetWires2A1[e-8]),a.push(this.ToffsetWires2A1[e-4]),this.ToffsetArcWires1A2=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires2A1[e-7]),c.push(this.ToffsetWires2A1[e-3]),this.ToffsetArcWires1A2=v(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2A1[e-6]),p.push(this.ToffsetWires2A1[e-2]),this.ToffsetArcWires1A2=v(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires2A1[e-5]),d.push(this.ToffsetWires2A1[e-1]),this.ToffsetArcWires1A2=v(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2A2.length>=8&&(C.push(this.ToffsetWires2A2[e-8]),C.push(this.ToffsetWires2A2[e-4]),this.ToffsetArcWires2A2=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2A2[e-7]),T.push(this.ToffsetWires2A2[e-3]),this.ToffsetArcWires2A2=v(T,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires2A2[e-6]),L.push(this.ToffsetWires2A2[e-2]),this.ToffsetArcWires2A2=v(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),w.push(this.ToffsetWires2A2[e-5]),w.push(this.ToffsetWires2A2[e-1]),this.ToffsetArcWires2A2=v(w,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case E.六分裂:this.ToffsetWires2A1.length>=12&&(a.push(this.ToffsetWires2A1[e-12]),a.push(this.ToffsetWires2A1[e-6]),this.ToffsetArcWires1A2=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires2A1[e-11]),c.push(this.ToffsetWires2A1[e-5]),this.ToffsetArcWires1A2=v(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2A1[e-10]),p.push(this.ToffsetWires2A1[e-4]),this.ToffsetArcWires1A2=v(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires2A1[e-9]),d.push(this.ToffsetWires2A1[e-3]),this.ToffsetArcWires1A2=v(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires2A1[e-8]),h.push(this.ToffsetWires2A1[e-2]),this.ToffsetArcWires1A2=v(h,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires2A1[e-7]),m.push(this.ToffsetWires2A1[e-1]),this.ToffsetArcWires1A2=v(m,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2A2.length>=12&&(C.push(this.ToffsetWires2A2[e-12]),C.push(this.ToffsetWires2A2[e-6]),this.ToffsetArcWires2A2=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2A2[e-11]),T.push(this.ToffsetWires2A2[e-5]),this.ToffsetArcWires2A2=v(T,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires2A2[e-10]),L.push(this.ToffsetWires2A2[e-4]),this.ToffsetArcWires2A2=v(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),w.push(this.ToffsetWires2A2[e-9]),w.push(this.ToffsetWires2A2[e-3]),this.ToffsetArcWires2A2=v(w,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires2A2[e-8]),D.push(this.ToffsetWires2A2[e-2]),this.ToffsetArcWires2A2=v(D,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires2A2[e-7]),b.push(this.ToffsetWires2A2[e-1]),this.ToffsetArcWires2A2=v(b,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case E.八分裂:this.ToffsetWires2A1.length>=16&&(a.push(this.ToffsetWires2A1[e-16]),a.push(this.ToffsetWires2A1[e-8]),this.ToffsetArcWires1A2=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires2A1[e-15]),c.push(this.ToffsetWires2A1[e-7]),this.ToffsetArcWires1A2=v(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2A1[e-14]),p.push(this.ToffsetWires2A1[e-6]),this.ToffsetArcWires1A2=v(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires2A1[e-13]),d.push(this.ToffsetWires2A1[e-5]),this.ToffsetArcWires1A2=v(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires2A1[e-12]),h.push(this.ToffsetWires2A1[e-4]),this.ToffsetArcWires1A2=v(h,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires2A1[e-11]),m.push(this.ToffsetWires2A1[e-3]),this.ToffsetArcWires1A2=v(m,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),_.push(this.ToffsetWires2A1[e-10]),_.push(this.ToffsetWires2A1[e-2]),this.ToffsetArcWires1A2=v(_,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线7"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),W.push(this.ToffsetWires2A1[e-9]),W.push(this.ToffsetWires2A1[e-1]),this.ToffsetArcWires1A2=v(W,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1A2,"2A1跳线8"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2A2.length>=16&&(C.push(this.ToffsetWires2A2[e-16]),C.push(this.ToffsetWires2A2[e-8]),this.ToffsetArcWires2A2=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2A2[e-15]),T.push(this.ToffsetWires2A2[e-7]),this.ToffsetArcWires2A2=v(T,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires2A2[e-14]),L.push(this.ToffsetWires2A2[e-6]),this.ToffsetArcWires2A2=v(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),w.push(this.ToffsetWires2A2[e-13]),w.push(this.ToffsetWires2A2[e-5]),this.ToffsetArcWires2A2=v(w,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires2A2[e-12]),D.push(this.ToffsetWires2A2[e-4]),this.ToffsetArcWires2A2=v(D,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires2A2[e-11]),b.push(this.ToffsetWires2A2[e-3]),this.ToffsetArcWires2A2=v(b,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires2A2[e-10]),B.push(this.ToffsetWires2A2[e-2]),this.ToffsetArcWires2A2=v(B,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线7"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),R.push(this.ToffsetWires2A2[e-9]),R.push(this.ToffsetWires2A2[e-1]),this.ToffsetArcWires2A2=v(R,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2A2,"2A2跳线8"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break}}if(this.ToffsetWires2B1.length>1&&this.ToffsetWires2B2.length>1){const a=[],c=[],p=[],d=[],h=[],m=[],_=[],W=[],C=[],T=[],L=[],w=[],D=[],b=[],B=[],R=[];switch(this.LineInfo.Wairnum){case E.单分裂:this.ToffsetWires2B1.length>=2&&(a.push(this.ToffsetWires2B1[e-2]),a.push(this.ToffsetWires2B1[e-1]),this.ToffsetArcWires1B2=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2B2.length>=2&&(C.push(this.ToffsetWires2B2[e-2]),C.push(this.ToffsetWires2B2[e-1]),this.ToffsetArcWires2B2=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case E.双分裂:this.ToffsetWires2B1.length>=4&&(a.push(this.ToffsetWires2B1[e-4]),a.push(this.ToffsetWires2B1[e-2]),this.ToffsetArcWires1B2=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires2B1[e-3]),c.push(this.ToffsetWires2B1[e-1]),this.ToffsetArcWires1B2=v(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2B2.length>=4&&(C.push(this.ToffsetWires2B2[e-4]),C.push(this.ToffsetWires2B2[e-2]),this.ToffsetArcWires2B2=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2B2[e-3]),T.push(this.ToffsetWires2B2[e-1]),this.ToffsetArcWires2B2=v(T,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case E.四分裂:this.ToffsetWires2B1.length>=8&&(a.push(this.ToffsetWires2B1[e-8]),a.push(this.ToffsetWires2B1[e-4]),this.ToffsetArcWires1B2=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires2B1[e-7]),c.push(this.ToffsetWires2B1[e-3]),this.ToffsetArcWires1B2=v(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2B1[e-6]),p.push(this.ToffsetWires2B1[e-2]),this.ToffsetArcWires1B2=v(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires2B1[e-5]),d.push(this.ToffsetWires2B1[e-1]),this.ToffsetArcWires1B2=v(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2B2.length>=8&&(C.push(this.ToffsetWires2B2[e-8]),C.push(this.ToffsetWires2B2[e-4]),this.ToffsetArcWires2B2=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2B2[e-7]),T.push(this.ToffsetWires2B2[e-3]),this.ToffsetArcWires2B2=v(T,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires2B2[e-6]),L.push(this.ToffsetWires2B2[e-2]),this.ToffsetArcWires2B2=v(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),w.push(this.ToffsetWires2B2[e-5]),w.push(this.ToffsetWires2B2[e-1]),this.ToffsetArcWires2B2=v(w,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case E.六分裂:this.ToffsetWires2B1.length>=12&&(a.push(this.ToffsetWires2B1[e-12]),a.push(this.ToffsetWires2B1[e-6]),this.ToffsetArcWires1B2=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires2B1[e-11]),c.push(this.ToffsetWires2B1[e-5]),this.ToffsetArcWires1B2=v(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2B1[e-10]),p.push(this.ToffsetWires2B1[e-4]),this.ToffsetArcWires1B2=v(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires2B1[e-9]),d.push(this.ToffsetWires2B1[e-3]),this.ToffsetArcWires1B2=v(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires2B1[e-8]),h.push(this.ToffsetWires2B1[e-2]),this.ToffsetArcWires1B2=v(h,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires2B1[e-7]),m.push(this.ToffsetWires2B1[e-1]),this.ToffsetArcWires1B2=v(m,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2B2.length>=12&&(C.push(this.ToffsetWires2B2[e-12]),C.push(this.ToffsetWires2B2[e-6]),this.ToffsetArcWires2B2=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2B2[e-11]),T.push(this.ToffsetWires2B2[e-5]),this.ToffsetArcWires2B2=v(T,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires2B2[e-10]),L.push(this.ToffsetWires2B2[e-4]),this.ToffsetArcWires2B2=v(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),w.push(this.ToffsetWires2B2[e-9]),w.push(this.ToffsetWires2B2[e-3]),this.ToffsetArcWires2B2=v(w,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires2B2[e-8]),D.push(this.ToffsetWires2B2[e-2]),this.ToffsetArcWires2B2=v(D,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires2B2[e-7]),b.push(this.ToffsetWires2B2[e-1]),this.ToffsetArcWires2B2=v(b,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case E.八分裂:this.ToffsetWires2B1.length>=16&&(a.push(this.ToffsetWires2B1[e-16]),a.push(this.ToffsetWires2B1[e-8]),this.ToffsetArcWires1B2=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires2B1[e-15]),c.push(this.ToffsetWires2B1[e-7]),this.ToffsetArcWires1B2=v(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2B1[e-14]),p.push(this.ToffsetWires2B1[e-6]),this.ToffsetArcWires1B2=v(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires2B1[e-13]),d.push(this.ToffsetWires2B1[e-5]),this.ToffsetArcWires1B2=v(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires2B1[e-12]),h.push(this.ToffsetWires2B1[e-4]),this.ToffsetArcWires1B2=v(h,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires2B1[e-11]),m.push(this.ToffsetWires2B1[e-3]),this.ToffsetArcWires1B2=v(m,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),_.push(this.ToffsetWires2B1[e-10]),_.push(this.ToffsetWires2B1[e-2]),this.ToffsetArcWires1B2=v(_,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线7"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),W.push(this.ToffsetWires2B1[e-9]),W.push(this.ToffsetWires2B1[e-1]),this.ToffsetArcWires1B2=v(W,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1B2,"2B1跳线8"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2B2.length>=16&&(C.push(this.ToffsetWires2B2[e-16]),C.push(this.ToffsetWires2B2[e-8]),this.ToffsetArcWires2B2=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2B2[e-15]),T.push(this.ToffsetWires2B2[e-7]),this.ToffsetArcWires2B2=v(T,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires2B2[e-14]),L.push(this.ToffsetWires2B2[e-6]),this.ToffsetArcWires2B2=v(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),w.push(this.ToffsetWires2B2[e-13]),w.push(this.ToffsetWires2B2[e-5]),this.ToffsetArcWires2B2=v(w,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires2B2[e-12]),D.push(this.ToffsetWires2B2[e-4]),this.ToffsetArcWires2B2=v(D,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires2B2[e-11]),b.push(this.ToffsetWires2B2[e-3]),this.ToffsetArcWires2B2=v(b,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires2B2[e-10]),B.push(this.ToffsetWires2B2[e-2]),this.ToffsetArcWires2B2=v(B,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线7"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),R.push(this.ToffsetWires2B2[e-9]),R.push(this.ToffsetWires2B2[e-1]),this.ToffsetArcWires2B2=v(R,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2B2,"2B2跳线8"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break}}if(this.ToffsetWires2C1.length>1&&this.ToffsetWires2C2.length>1){const a=[],c=[],p=[],d=[],h=[],m=[],_=[],W=[],C=[],T=[],L=[],w=[],D=[],b=[],B=[],R=[];switch(this.LineInfo.Wairnum){case E.单分裂:this.ToffsetWires2C1.length>=2&&(a.push(this.ToffsetWires2C1[e-2]),a.push(this.ToffsetWires2C1[e-1]),this.ToffsetArcWires1C2=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2C2.length>=2&&(C.push(this.ToffsetWires2C2[e-2]),C.push(this.ToffsetWires2C2[e-1]),this.ToffsetArcWires2C2=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case E.双分裂:this.ToffsetWires2C1.length>=4&&(a.push(this.ToffsetWires2C1[e-4]),a.push(this.ToffsetWires2C1[e-2]),this.ToffsetArcWires1C2=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires2C1[e-3]),c.push(this.ToffsetWires2C1[e-1]),this.ToffsetArcWires1C2=v(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2C2.length>=4&&(C.push(this.ToffsetWires2C2[e-4]),C.push(this.ToffsetWires2C2[e-2]),this.ToffsetArcWires2C2=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2C2[e-3]),T.push(this.ToffsetWires2C2[e-1]),this.ToffsetArcWires2C2=v(T,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case E.四分裂:this.ToffsetWires2C1.length>=8&&(a.push(this.ToffsetWires2C1[e-8]),a.push(this.ToffsetWires2C1[e-4]),this.ToffsetArcWires1C2=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires2C1[e-7]),c.push(this.ToffsetWires2C1[e-3]),this.ToffsetArcWires1C2=v(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2C1[e-6]),p.push(this.ToffsetWires2C1[e-2]),this.ToffsetArcWires1C2=v(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires2C1[e-5]),d.push(this.ToffsetWires2C1[e-1]),this.ToffsetArcWires1C2=v(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2C2.length>=8&&(C.push(this.ToffsetWires2C2[e-8]),C.push(this.ToffsetWires2C2[e-4]),this.ToffsetArcWires2C2=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2C2[e-7]),T.push(this.ToffsetWires2C2[e-3]),this.ToffsetArcWires2C2=v(T,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires2C2[e-6]),L.push(this.ToffsetWires2C2[e-2]),this.ToffsetArcWires2C2=v(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),w.push(this.ToffsetWires2C2[e-5]),w.push(this.ToffsetWires2C2[e-1]),this.ToffsetArcWires2C2=v(w,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case E.六分裂:this.ToffsetWires2C1.length>=12&&(a.push(this.ToffsetWires2C1[e-12]),a.push(this.ToffsetWires2C1[e-6]),this.ToffsetArcWires1C2=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires2C1[e-11]),c.push(this.ToffsetWires2C1[e-5]),this.ToffsetArcWires1C2=v(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2C1[e-10]),p.push(this.ToffsetWires2C1[e-4]),this.ToffsetArcWires1C2=v(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires2C1[e-9]),d.push(this.ToffsetWires2C1[e-3]),this.ToffsetArcWires1C2=v(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires2C1[e-8]),h.push(this.ToffsetWires2C1[e-2]),this.ToffsetArcWires1C2=v(h,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires2C1[e-7]),m.push(this.ToffsetWires2C1[e-1]),this.ToffsetArcWires1C2=v(m,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2C2.length>=12&&(C.push(this.ToffsetWires2C2[e-12]),C.push(this.ToffsetWires2C2[e-6]),this.ToffsetArcWires2C2=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2C2[e-11]),T.push(this.ToffsetWires2C2[e-5]),this.ToffsetArcWires2C2=v(T,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires2C2[e-10]),L.push(this.ToffsetWires2C2[e-4]),this.ToffsetArcWires2C2=v(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),w.push(this.ToffsetWires2C2[e-9]),w.push(this.ToffsetWires2C2[e-3]),this.ToffsetArcWires2C2=v(w,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires2C2[e-8]),D.push(this.ToffsetWires2C2[e-2]),this.ToffsetArcWires2C2=v(D,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires2C2[e-7]),b.push(this.ToffsetWires2C2[e-1]),this.ToffsetArcWires2C2=v(b,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case E.八分裂:this.ToffsetWires2C1.length>=16&&(a.push(this.ToffsetWires2C1[e-16]),a.push(this.ToffsetWires2C1[e-8]),this.ToffsetArcWires1C2=v(a,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),c.push(this.ToffsetWires2C1[e-15]),c.push(this.ToffsetWires2C1[e-7]),this.ToffsetArcWires1C2=v(c,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2C1[e-14]),p.push(this.ToffsetWires2C1[e-6]),this.ToffsetArcWires1C2=v(p,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),d.push(this.ToffsetWires2C1[e-13]),d.push(this.ToffsetWires2C1[e-5]),this.ToffsetArcWires1C2=v(d,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),h.push(this.ToffsetWires2C1[e-12]),h.push(this.ToffsetWires2C1[e-4]),this.ToffsetArcWires1C2=v(h,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires2C1[e-11]),m.push(this.ToffsetWires2C1[e-3]),this.ToffsetArcWires1C2=v(m,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),_.push(this.ToffsetWires2C1[e-10]),_.push(this.ToffsetWires2C1[e-2]),this.ToffsetArcWires1C2=v(_,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线7"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),W.push(this.ToffsetWires2C1[e-9]),W.push(this.ToffsetWires2C1[e-1]),this.ToffsetArcWires1C2=v(W,15),this.LineentityCollection2.add(y(this.ToffsetArcWires1C2,"2C1跳线8"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2C2.length>=16&&(C.push(this.ToffsetWires2C2[e-16]),C.push(this.ToffsetWires2C2[e-8]),this.ToffsetArcWires2C2=v(C,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线1"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2C2[e-15]),T.push(this.ToffsetWires2C2[e-7]),this.ToffsetArcWires2C2=v(T,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线2"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),L.push(this.ToffsetWires2C2[e-14]),L.push(this.ToffsetWires2C2[e-6]),this.ToffsetArcWires2C2=v(L,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线3"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),w.push(this.ToffsetWires2C2[e-13]),w.push(this.ToffsetWires2C2[e-5]),this.ToffsetArcWires2C2=v(w,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线4"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),D.push(this.ToffsetWires2C2[e-12]),D.push(this.ToffsetWires2C2[e-4]),this.ToffsetArcWires2C2=v(D,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线5"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires2C2[e-11]),b.push(this.ToffsetWires2C2[e-3]),this.ToffsetArcWires2C2=v(b,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线6"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires2C2[e-10]),B.push(this.ToffsetWires2C2[e-2]),this.ToffsetArcWires2C2=v(B,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线7"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),R.push(this.ToffsetWires2C2[e-9]),R.push(this.ToffsetWires2C2[e-1]),this.ToffsetArcWires2C2=v(R,15),this.LineentityCollection2.add(y(this.ToffsetArcWires2C2,"2C2跳线8"+(i-1)+"-"+i,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break}}}else switch(this.LineInfo.Wairnum){case E.单分裂:t=t+1;break;case E.双分裂:t=t+2;break;case E.四分裂:t=t+4;break;case E.六分裂:t=t+6;break;case E.八分裂:t=t+8;break}})}getWireDataForChannelCalculation(){return{arcLine1A1:this.arcLine1A1,arcLine1B1:this.arcLine1B1,arcLine1C1:this.arcLine1C1}}getWireDataForChannelCalculationByTowerRange(t,e){if(t<0||e>=this.LineInfo.towers.length||t>e)return console.warn(`无效的杆塔索引范围: ${t} - ${e}`),{arcLine1A1:[],arcLine1B1:[],arcLine1C1:[]};const r=[],i=[],n=[],o=this.LineInfo.towers,f={minLon:Math.min(...o.slice(t,e+1).map(l=>l.Longitude)),maxLon:Math.max(...o.slice(t,e+1).map(l=>l.Longitude)),minLat:Math.min(...o.slice(t,e+1).map(l=>l.Latitude)),maxLat:Math.max(...o.slice(t,e+1).map(l=>l.Latitude))},u=.005;return f.minLon-=u,f.maxLon+=u,f.minLat-=u,f.maxLat+=u,this.arcLine1A1.forEach(l=>{l[0]>=f.minLon&&l[0]<=f.maxLon&&l[1]>=f.minLat&&l[1]<=f.maxLat&&r.push(l)}),this.arcLine1B1.forEach(l=>{l[0]>=f.minLon&&l[0]<=f.maxLon&&l[1]>=f.minLat&&l[1]<=f.maxLat&&i.push(l)}),this.arcLine1C1.forEach(l=>{l[0]>=f.minLon&&l[0]<=f.maxLon&&l[1]>=f.minLat&&l[1]<=f.maxLat&&n.push(l)}),{arcLine1A1:r,arcLine1B1:i,arcLine1C1:n}}parseWireEntityName(t){const e=t.match(/^导线(\d+)_([ABC])\d*(\d+)-(\d+)$/);return e?{circuit:parseInt(e[1]),phase:e[2],startTowerIndex:parseInt(e[3]),endTowerIndex:parseInt(e[4])}:null}getWireSegmentByTowerRange(t,e){const r={arcLine1A1:[],arcLine1B1:[],arcLine1C1:[]};return this.LineentityCollection2.values.forEach(i=>{if(i.name&&i.polyline&&i.polyline.positions){const n=this.parseWireEntityName(i.name);if(n&&n.circuit===1&&n.startTowerIndex===t&&n.endTowerIndex===e){const o=i.polyline.positions.getValue(g.JulianDate.now());if(o&&o.length>0){const f=[];for(let u=0;u<o.length;u++){const l=g.Cartographic.fromCartesian(o[u]);f.push([g.Math.toDegrees(l.longitude),g.Math.toDegrees(l.latitude),l.height])}switch(n.phase){case"A":r.arcLine1A1=f;break;case"B":r.arcLine1B1=f;break;case"C":r.arcLine1C1=f;break}}}}}),r}getAllWireSegments(){const t=[],e=[],r=[],i=[],n=[],o=[],f=new Map;return this.LineInfo&&this.LineInfo.towers&&this.LineInfo.towers.forEach((u,l)=>{f.set(u.id,l),u.name&&f.set(u.name,l)}),this.LineentityCollection2.values.forEach(u=>{if(u.name&&u.polyline&&u.polyline.positions){const l=this.parseWireEntityName(u.name);if(l){const a=u.polyline.positions.getValue(g.JulianDate.now());if(a&&a.length>0){const c=[];for(let h=0;h<a.length;h++){const m=g.Cartographic.fromCartesian(a[h]);c.push([g.Math.toDegrees(m.longitude),g.Math.toDegrees(m.latitude),m.height])}const p=l.startTowerIndex,d=f.get(p)??p;if(l.circuit===1)switch(l.phase){case"A":t[d]=c;break;case"B":e[d]=c;break;case"C":r[d]=c;break}else if(l.circuit===2)switch(l.phase){case"A":i[d]=c;break;case"B":n[d]=c;break;case"C":o[d]=c;break}}}}}),console.log(`从LineentityCollection2提取导线数据完成: 回路1-A相${t.length}段, B相${e.length}段, C相${r.length}段; 回路2-A相${i.length}段, B相${n.length}段, C相${o.length}段`),{wireSegments1A1:t,wireSegments1B1:e,wireSegments1C1:r,wireSegments2A1:i,wireSegments2B1:n,wireSegments2C1:o}}getOffsetTowers(){return this.offsetTowers}getLineInfo(){return this.LineInfo}getViewer(){return this.viewer}flyToTower(t){if(t<0||t>=this.offsetTowers.length){console.warn(`Invalid tower index: ${t}. Valid range: 0-${this.offsetTowers.length-1}`);return}const e=this.offsetTowers[t];console.log(e),this.viewer.camera.flyTo({destination:e,duration:2,orientation:{heading:g.Math.toRadians(0),pitch:g.Math.toRadians(-60),roll:g.Math.toRadians(0)}})}loadLineTower(){this.initializeLineData(),this.isDynamicLoadingEnabled?(this.loadAllWiresOnly(),this.setupCameraMoveListener(),this.updateVisibleTowers()):this.loadAllTowersAtOnce()}loadAllWiresOnly(){const t=new g.EntityCollection,e=this.entityCollection2;this.entityCollection2=t,this.loadAllTowersAtOnce();const r=[];t.values.forEach(i=>{var n;i.name&&(i.name.includes("导线")||i.name.includes("daoxian")||(n=i.id)!=null&&n.toString().includes("daoxian"))&&r.push(i)}),this.entityCollection2=e,r.forEach(i=>{this.entityCollection2.add(i)}),t.removeAll()}setLineVisible(t){this.Keym=="OW_JPS_EEngin_001"&&(this.entityCollection2.show=t,this.LineentityCollection2.show=t)}getArcLine1A1(){return this.arcLine1A1}getArcLine1B1(){return this.arcLine1B1}getArcLine1C1(){return this.arcLine1C1}}const Yn=class Yn{constructor(t,e,r){I(this,"viewer");I(this,"LineInfo");I(this,"Keym","");I(this,"offsetTrees",[]);I(this,"dataSourcetree");I(this,"entityCollectiontree");I(this,"isDynamicLoadingEnabled",!0);I(this,"loadedTreeIndices",new Set);I(this,"isTreeModelRemoved",!1);I(this,"modelCache",new Map);this.Keym=r,this.viewer=t,this.LineInfo=e,this.dataSourcetree=new g.CustomDataSource(this.LineInfo.LineID+"tree"),this.entityCollectiontree=this.dataSourcetree.entities}createModelCacheKey(t,e,r,i){return`${t}_${e}_${r}_${i}`}getCachedModelConfig(t,e,r,i){const n=Math.max(0,r),o=Math.min(i,5e4),f=this.createModelCacheKey(t,e,n,o);if(!this.modelCache.has(f)){const u={uri:t,scale:e,distanceDisplayCondition:[n,o]};this.modelCache.set(f,u)}return this.modelCache.get(f)}setDynamicLoadingEnabled(t){this.isDynamicLoadingEnabled=t}getDynamicLoadingEnabled(){return this.isDynamicLoadingEnabled}getVisibleTreeIndices(){var n;if(!this.viewer.camera||this.offsetTrees.length===0)return[];const t=this.viewer.camera.position,e=((n=this.viewer.camera.positionCartographic)==null?void 0:n.height)||1e3;let r=Math.max(5e3,e*2);console.log(`相机高度: ${e}, 加载距离: ${r}`),e>5e4&&(r=1e5);const i=[];for(let o=0;o<this.offsetTrees.length;o++){const f=this.offsetTrees[o];g.Cartesian3.distance(t,f)<=r&&i.push(o)}if(i.length===0&&this.offsetTrees.length>0){const o=Math.min(20,this.offsetTrees.length);for(let f=0;f<o;f++)i.push(f)}return i}updateVisibleTrees(){if(this.isTreeModelRemoved)return;const t=this.getVisibleTreeIndices(),e=[];this.loadedTreeIndices.forEach(r=>{t.includes(r)||e.push(r)}),e.forEach(r=>{const i="tree-"+this.LineInfo.corridor_features[r].id;this.entityCollectiontree.removeById(i),this.loadedTreeIndices.delete(r)}),t.forEach(r=>{if(!this.loadedTreeIndices.has(r))if(r>=0&&r<this.offsetTrees.length&&r<this.LineInfo.corridor_features.length){const i=this.offsetTrees[r],n=this.LineInfo.corridor_features[r];i&&n?(this.loadTreeAtIndex(r,i),this.loadedTreeIndices.add(r)):console.warn(`跳过无效的动态加载树木数据,索引: ${r}`)}else console.warn(`动态加载树木索引超出范围: ${r}`)})}loadTree(){this.Keym=="OW_JPS_EEngin_001"&&(this.LineInfo.corridor_features.forEach(t=>{this.offsetTrees.push(g.Cartesian3.fromDegrees(t.lon,t.lat,t.alt))}),this.entityCollectiontree.show=!0,this.isDynamicLoadingEnabled?this.updateVisibleTrees():this.loadAllTreesAtOnce())}loadAllTreesAtOnce(){this.LineInfo.corridor_features.length!==this.offsetTrees.length&&console.warn(`树木数据长度 (${this.LineInfo.corridor_features.length}) 与位置数据长度 (${this.offsetTrees.length}) 不匹配`);const t=Math.min(this.LineInfo.corridor_features.length,this.offsetTrees.length);for(let e=0;e<t;e++){const r=this.LineInfo.corridor_features[e],i=this.offsetTrees[e];r&&i?this.loadTreeAtIndex(e,i):console.warn(`跳过无效的树木数据,索引: ${e}`)}}loadTreeAtIndex(t,e){const r=this.LineInfo.corridor_features[t];if(!r.modelurl||r.modelurl.trim()===""){console.warn(`Tree ${t} has invalid model URL: ${r.modelurl}. Skipping...`);return}let i=1;r.modelScale>0&&r.modelH>0?(i=r.modelH/r.modelScale,i<=0&&(i=1)):r.modelH>0&&(i=r.modelH);const n=this.getCachedModelConfig(r.modelurl,i,0,2e4);this.entityCollectiontree.add(Un("tree-"+r.id,e,"tree-"+r.id,n.uri,new g.HeadingPitchRoll(0,0,0),n.scale,n.distanceDisplayCondition))}flyToTree(t){if(t<0||t>=this.LineInfo.corridor_features.length){console.warn(`Invalid tree index: ${t}. Valid range: 0-${this.LineInfo.corridor_features.length-1}`);return}const e=this.LineInfo.corridor_features[t],r=g.Cartesian3.fromDegrees(e.lon,e.lat,e.alt+(e.modelH||0));this.viewer.camera.flyTo({destination:r,duration:2,orientation:{heading:g.Math.toRadians(0),pitch:g.Math.toRadians(-60),roll:g.Math.toRadians(0)}})}removeTreeModels(){this.isTreeModelRemoved=!0,this.entityCollectiontree.removeAll(),this.loadedTreeIndices.clear()}restoreTreeModels(){this.isTreeModelRemoved=!1,this.isDynamicLoadingEnabled?this.updateVisibleTrees():this.loadAllTreesAtOnce()}addTreeData(t){this.LineInfo.corridor_features.push(t)}getTreeCoordinates(){return this.LineInfo.corridor_features.map(t=>[t.lon,t.lat,Number(t.alt||0)+Number(t.treeH||0)])}getOffsetTrees(){return this.offsetTrees}getLineInfo(){return this.LineInfo}getViewer(){return this.viewer}getTerrainDataSources(){return[this.dataSourcetree]}static getTreeEntityPrefix(){return Yn.TREE_ENTITY_PREFIX}setTreeVisible(t){this.Keym=="OW_JPS_EEngin_001"&&(this.entityCollectiontree.show=t)}};I(Yn,"TREE_ENTITY_PREFIX","tree-");let Do=Yn;class Yu{constructor(t){I(this,"viewer");I(this,"dataSourceplotting");I(this,"entityCollectionplotting");I(this,"terrainVerificationCache",new Map);I(this,"terrainVerificationResultCache",new Map);I(this,"maxVisibleResults",200);I(this,"terrainVerificationBatchIndex",0);I(this,"terrainVerificationTotalBatches",0);I(this,"terrainVerificationIsRunning",!1);I(this,"terrainVerificationBatchSize",100);I(this,"cameraMoveHandler",null);I(this,"isDynamicTerrainVerificationEnabled",!1);I(this,"wireClickHandler",null);I(this,"distanceRuleConfig",new Eo);I(this,"wireToWireDistanceRuleConfig",new Po);this.viewer=t,this.dataSourceplotting=new g.CustomDataSource("plotting"),this.entityCollectionplotting=this.dataSourceplotting.entities}ensurePlottingDataSourceAdded(){this.viewer.dataSources.contains(this.dataSourceplotting)||this.viewer.dataSources.add(this.dataSourceplotting),this.entityCollectionplotting.show=!0}calcResultByType(t,e,r,i,n,o=this.distanceRuleConfig,f=me.树木){if(this.entityCollectionplotting.values.length>=this.maxVisibleResults)return;const u=`${t[0].toFixed(6)}_${t[1].toFixed(6)}_${t[2].toFixed(2)}`;if(this.terrainVerificationCache.has(u)){const l=this.terrainVerificationCache.get(u);Rr(t,l,this.entityCollectionplotting,o,n,f);return}else{const l=Vn(t,e,r,i);this.terrainVerificationCache.set(u,l),Rr(t,l,this.entityCollectionplotting,o||this.distanceRuleConfig,n,f)}}performTerrainVerification(t,e,r,i,n=null,o,f=[],u=me.树木){const l=`${t[0].toFixed(6)}_${t[1].toFixed(6)}_${t[2].toFixed(2)}`,a=Vn(t,e,r,i);return this.terrainVerificationCache.set(l,a),Rr(t,a,this.entityCollectionplotting,n||this.distanceRuleConfig,f,u),Xn(t,a,o??"unknown")}setMaxVisibleTerrainResults(t=200){this.maxVisibleResults=Math.max(10,t)}setDistanceRuleConfig(t){this.distanceRuleConfig=t}getDistanceRuleConfig(){return{...this.distanceRuleConfig}}setDistanceRulesByType(t,e){this.distanceRuleConfig.typeRules.set(t,e)}getDistanceRulesByType(t){return this.distanceRuleConfig.typeRules.get(t)}getDistanceRulesByTypeOrDefault(t){return this.distanceRuleConfig.typeRules.get(t)||new of}hasDistanceRulesForType(t){return this.distanceRuleConfig.typeRules.has(t)}getConfiguredDistanceRuleTypes(){return Array.from(this.distanceRuleConfig.typeRules.keys())}clearDistanceRuleConfig(){this.distanceRuleConfig.typeRules.clear()}getDistanceRuleConfigCount(){return this.distanceRuleConfig.typeRules.size}getHorizontalDistanceLevels(t){var e;return(e=this.distanceRuleConfig.typeRules.get(t))==null?void 0:e.horizontalLevels}getVerticalDistanceLevels(t){var e;return(e=this.distanceRuleConfig.typeRules.get(t))==null?void 0:e.verticalLevels}getStraightLineDistanceLevels(t){var e;return(e=this.distanceRuleConfig.typeRules.get(t))==null?void 0:e.straightLineLevels}getClearanceDistanceLevels(t){var e;return(e=this.distanceRuleConfig.typeRules.get(t))==null?void 0:e.clearanceLevels}createDefaultDistanceRuleConfig(){const t={horizontalLevels:[{name:"critical",minDistance:0,maxDistance:160,color:"#ff0000"},{name:"danger",minDistance:160,maxDistance:170,color:"#ff0000"},{name:"warning",minDistance:170,maxDistance:180,color:"#ffa500"},{name:"safe",minDistance:180,maxDistance:1/0,color:"#00ff00"}],verticalLevels:[{name:"critical",minDistance:0,maxDistance:160,color:"#ff0000"},{name:"danger",minDistance:160,maxDistance:170,color:"#ff0000"},{name:"warning",minDistance:170,maxDistance:180,color:"#ffa500"},{name:"safe",minDistance:180,maxDistance:1/0,color:"#00ff00"}],straightLineLevels:[{name:"critical",minDistance:0,maxDistance:160,color:"#ff0000"},{name:"danger",minDistance:160,maxDistance:170,color:"#ff0000"},{name:"warning",minDistance:170,maxDistance:180,color:"#ffa500"},{name:"safe",minDistance:180,maxDistance:1/0,color:"#00ff00"}],clearanceLevels:[{name:"critical",minDistance:0,maxDistance:10,color:"#ff0000"},{name:"danger",minDistance:10,maxDistance:15,color:"#ff6600"},{name:"warning",minDistance:15,maxDistance:20,color:"#ffa500"},{name:"safe",minDistance:20,maxDistance:1/0,color:"#00ff00"}]};this.setDistanceRulesByType(me.树木,{...t}),this.setDistanceRulesByType(me.房屋,{...t}),this.setDistanceRulesByType(me.高速公路,{...t}),this.setDistanceRulesByType(me.电力线,{...t})}drawCorridorPolygon(t,e="corridor-polygon"){if(!t||t.length<3)return;this.ensurePlottingDataSourceAdded();const r=t.map(n=>g.Cartesian3.fromDegrees(n[0],n[1])),i=this.entityCollectionplotting.add({name:e,polygon:{hierarchy:new g.PolygonHierarchy(r),material:g.Color.GREEN.withAlpha(.3),outline:!0,outlineColor:g.Color.GREEN,outlineWidth:2,heightReference:g.HeightReference.CLAMP_TO_GROUND,perPositionHeight:!1}});this.terrainVerificationResultCache.has("corridor-polygon")||this.terrainVerificationResultCache.set("corridor-polygon",[]),this.terrainVerificationResultCache.get("corridor-polygon").push(i)}drawCorridorDistanceMarkers(t,e,r="corridor-markers",i=!0){!t||t.length<2||(this.ensurePlottingDataSourceAdded(),this.addPerpendicularWidthMarkers(t,e,r),i&&this.addParallelIntervalMarkers(t,e,10,r))}addPerpendicularWidthMarkers(t,e,r){const i=t[0],n=t.length>1?t[1]:t[t.length-1],o=g.Cartesian3.fromDegrees(i[0],i[1]),f=g.Cartesian3.fromDegrees(n[0],n[1]),u=g.Cartesian3.subtract(f,o,new g.Cartesian3);g.Cartesian3.normalize(u,u);const l=g.Cartesian3.clone(o);g.Cartesian3.normalize(l,l);const a=g.Cartesian3.cross(l,u,new g.Cartesian3);g.Cartesian3.normalize(a,a);const c=e,p=g.Cartesian3.add(o,g.Cartesian3.multiplyByScalar(a,c,new g.Cartesian3),new g.Cartesian3),d=g.Cartesian3.add(o,g.Cartesian3.multiplyByScalar(a,-c,new g.Cartesian3),new g.Cartesian3),h=g.Cartographic.fromCartesian(p),m=g.Cartographic.fromCartesian(d),_=g.Math.toDegrees(h.longitude),W=g.Math.toDegrees(h.latitude),C=g.Math.toDegrees(m.longitude),T=g.Math.toDegrees(m.latitude),L=this.entityCollectionplotting.add({name:`${r}-left-width-marker`,polyline:{positions:[g.Cartesian3.fromDegrees(i[0],i[1]),g.Cartesian3.fromDegrees(_,W)],width:3,material:new g.PolylineDashMaterialProperty({color:g.Color.RED,dashLength:12}),clampToGround:!0}}),w=this.entityCollectionplotting.add({name:`${r}-right-width-marker`,polyline:{positions:[g.Cartesian3.fromDegrees(i[0],i[1]),g.Cartesian3.fromDegrees(C,T)],width:3,material:new g.PolylineDashMaterialProperty({color:g.Color.RED,dashLength:12}),clampToGround:!0}});this.terrainVerificationResultCache.has("corridor-markers")||this.terrainVerificationResultCache.set("corridor-markers",[]),this.terrainVerificationResultCache.get("corridor-markers").push(L),this.terrainVerificationResultCache.get("corridor-markers").push(w)}addParallelIntervalMarkers(t,e,r,i){if(t.length<2||e<=0||r<=0)return;let n=r,o=1;for(;n<=e;){let f;n<=50?f=g.Color.RED.withAlpha(.7):n<=100?f=g.Color.ORANGE.withAlpha(.7):f=g.Color.GREEN.withAlpha(.7);const u=this.createOffsetLine(t,n,!0);if(u.length>0){const l=this.entityCollectionplotting.add({name:`${i}-parallel-left-${o}`,polyline:{positions:u,width:3,material:new g.PolylineDashMaterialProperty({color:f,dashLength:12}),clampToGround:!0}});this.terrainVerificationResultCache.has("corridor-markers")||this.terrainVerificationResultCache.set("corridor-markers",[]),this.terrainVerificationResultCache.get("corridor-markers").push(l)}n+=r,o++}for(n=r,o=1;n<=e;){let f;n<=50?f=g.Color.RED.withAlpha(.7):n<=100?f=g.Color.ORANGE.withAlpha(.7):f=g.Color.GREEN.withAlpha(.7);const u=this.createOffsetLine(t,n,!1);if(u.length>0){const l=this.entityCollectionplotting.add({name:`${i}-parallel-right-${o}`,polyline:{positions:u,width:3,material:new g.PolylineDashMaterialProperty({color:f,dashLength:12}),clampToGround:!0}});this.terrainVerificationResultCache.get("corridor-markers").push(l)}n+=r,o++}}createOffsetLine(t,e,r){if(t.length<2)return[];const i=he(t),n=e/1e3;try{const o=r?-n:n,f=Ff(i,o,{units:"kilometers"});if(f.geometry.type==="LineString")return f.geometry.coordinates.map(u=>g.Cartesian3.fromDegrees(u[0],u[1]))}catch(o){console.warn("Failed to create offset line:",o)}return[]}clearCorridorDistanceMarkers(){try{if(this.terrainVerificationResultCache&&this.terrainVerificationResultCache.has("corridor-markers")){const t=this.terrainVerificationResultCache.get("corridor-markers");if(t&&this.entityCollectionplotting)for(let e=t.length-1;e>=0;e--){const r=t[e];try{r&&this.entityCollectionplotting.remove(r)}catch{}}this.terrainVerificationResultCache.delete("corridor-markers")}}catch(t){console.warn("Error clearing corridor distance markers:",t)}}clearCorridorPolygon(){try{if(this.terrainVerificationResultCache){const t=this.terrainVerificationResultCache.get("corridor-polygon");if(t&&this.entityCollectionplotting)for(let e=t.length-1;e>=0;e--){const r=t[e];try{r&&this.entityCollectionplotting.remove(r)}catch{}}this.terrainVerificationResultCache.delete("corridor-polygon")}}catch(t){console.warn("Error clearing corridor polygon:",t)}}getClickDistanceRuleConfig(){return{...this.distanceRuleConfig}}clearTreeDistanceResultsExceptCorridor(){const t=[];this.entityCollectionplotting&&this.entityCollectionplotting.values.forEach(e=>{(!e.name||!e.name.startsWith("corridor-"))&&t.push(e)});for(let e=t.length-1;e>=0;e--){const r=t[e];try{this.entityCollectionplotting.remove(r)}catch{}}this.terrainVerificationCache.clear(),this.terrainVerificationResultCache.forEach((e,r)=>{r.startsWith("corridor-")||this.terrainVerificationResultCache.delete(r)})}clearTreeDistanceResults(){try{if(this.entityCollectionplotting)try{this.entityCollectionplotting.removeAll()}catch(t){console.warn("Failed to removeAll entities:",t)}}catch(t){console.warn("Error clearing tree distance results:",t)}try{this.terrainVerificationCache.clear()}catch(t){console.warn("Failed to clear terrain verification cache:",t)}try{this.terrainVerificationResultCache.clear()}catch(t){console.warn("Failed to clear terrain verification result cache:",t)}}LineChannelTerrainVerification(t,e,r,i,n,o=100,f=[],u){if(this.terrainVerificationIsRunning){console.log("地物校验已在运行中,跳过重复调用");return}this.ensurePlottingDataSourceAdded(),this.clearTreeDistanceResults(),this.terrainVerificationBatchSize=o,this.terrainVerificationBatchIndex=0,this.terrainVerificationTotalBatches=Math.ceil(t.length/o),this.terrainVerificationIsRunning=!0,console.log(`开始地物校验:共${t.length}棵树,分${this.terrainVerificationTotalBatches}批处理`),this.processTerrainVerificationBatch(t,e,r,i,n,f,u)}processTerrainVerificationBatch(t,e,r,i,n,o=[],f,u=[]){if(!this.terrainVerificationIsRunning||this.terrainVerificationBatchIndex>=this.terrainVerificationTotalBatches){this.terrainVerificationIsRunning=!1,console.log("地物校验完成"),f&&f(u);return}const l=this.terrainVerificationBatchIndex*this.terrainVerificationBatchSize,a=Math.min(l+this.terrainVerificationBatchSize,t.length);console.log(`处理第${this.terrainVerificationBatchIndex+1}/${this.terrainVerificationTotalBatches}批:${l}-${a}`);const c=[];for(let p=l;p<a;p++){const d=t[p];if(d){const h=[d.lon,d.lat,Number(d.alt||0)+Number(d.treeH||0)],m=this.performTerrainVerification(h,r,i,n,null,d.id,o);m&&c.push(m)}}u.push(...c),this.terrainVerificationBatchIndex++,setTimeout(()=>{this.processTerrainVerificationBatch(t,e,r,i,n,o,f,u)},0)}stopLineChannelTerrainVerification(){this.terrainVerificationIsRunning=!1,console.log("地物校验已停止")}enableVisibleAreaTerrainVerification(t,e,r,i,n){this.isDynamicTerrainVerificationEnabled=!0,this.setupCameraMoveListenerForTerrainVerification(t,e,r,i,n)}disableVisibleAreaTerrainVerification(){this.isDynamicTerrainVerificationEnabled=!1,this.cameraMoveHandler&&(this.cameraMoveHandler(),this.cameraMoveHandler=null)}setupCameraMoveListenerForTerrainVerification(t,e,r,i,n){this.cameraMoveHandler&&this.cameraMoveHandler(),this.cameraMoveHandler=this.viewer.camera.moveEnd.addEventListener(()=>{this.updateVisibleAreaTerrainVerification(t,e,r,i,n)})}updateVisibleAreaTerrainVerification(t,e,r,i,n){if(!this.isDynamicTerrainVerificationEnabled)return;this.getVisibleTreeIndices(e).forEach(f=>{const u=t[f];if(u){const l=[u.lon,u.lat,Number(u.alt||0)+Number(u.treeH||0)];this.performTerrainVerification(l,r,i,n)}})}getVisibleTreeIndices(t){var o;if(!this.viewer.camera||t.length===0)return[];const e=this.viewer.camera.position,r=((o=this.viewer.camera.positionCartographic)==null?void 0:o.height)||1e3;let i=Math.max(5e3,r*2);r>5e4&&(i=1e5);const n=[];for(let f=0;f<t.length;f++){const u=t[f];g.Cartesian3.distance(e,u)<=i&&n.push(f)}return n}loadTreeListen(t,e,r,i,n,o=[]){this.cameraMoveHandler&&this.removeTreeListen();const f=(l,a)=>{const c=l.scene.pick(a);if(g.defined(c)){let p=c.id;if(p===void 0&&c.primitive&&(p=c.primitive.id),p instanceof g.Entity)return p}};this.ensurePlottingDataSourceAdded(),new g.ScreenSpaceEventHandler(this.viewer.canvas).setInputAction(l=>{const a=f(this.viewer,l.position);if(a&&a.id){const c=String(a.id);if(c.startsWith("tree-")){const p=c.substring(5),d=t.find(h=>h&&h.id&&String(h.id)===p);if(d){const h=[d.lon,d.lat,Number(d.alt||0)+Number(d.treeH||0)],m=Vn(h,e,r,i),_=Xn(h,m,d.id);n&&_&&n(_),Rr(h,m,this.entityCollectionplotting,this.getClickDistanceRuleConfig(),o,me.树木)}}}},g.ScreenSpaceEventType.LEFT_CLICK)}removeTreeListen(){if(this.cameraMoveHandler){try{this.cameraMoveHandler()}catch{}this.cameraMoveHandler=null}if(this.dataSourceplotting&&this.entityCollectionplotting)try{this.entityCollectionplotting.removeAll(),this.entityCollectionplotting.show=!1}catch(t){console.warn("Error clearing tree listen entities:",t)}}loadWireListen(t,e,r,i,n,o){this.wireClickHandler&&this.removeWireListen();const f=(u,l)=>{const a=u.scene.pick(l);if(g.defined(a)){let c=a.id;if(c===void 0&&a.primitive&&(c=a.primitive.id),c instanceof g.Entity)return c}};this.ensurePlottingDataSourceAdded(),this.wireClickHandler=new g.ScreenSpaceEventHandler(this.viewer.canvas),this.wireClickHandler.setInputAction(async u=>{const l=f(this.viewer,u.position);if(l&&l.id){const a=String(l.id),c=l.name||"";if(a.includes("daoxian")||c.includes("导线")||c.includes("daoxian")){n&&l&&n(l);const d=this.viewer.scene.pickPosition(u.position);if(g.defined(d)){let h=null;if(l&&l.polyline&&l.polyline.positions){const m=l.polyline.positions.getValue(this.viewer.clock.currentTime);m&&Array.isArray(m)&&(h=m.map(_=>{const W=g.Cartographic.fromCartesian(_);return[g.Math.toDegrees(W.longitude),g.Math.toDegrees(W.latitude),W.height]}))}if((!h||h.length===0)&&(c.match(/(\d+)-(\d+)$/)&&(c.includes("A")||c.includes("_A")?h=e:c.includes("B")||c.includes("_B")?h=r:(c.includes("C")||c.includes("_C"))&&(h=i)),(!h||h.length===0)&&(h=[...e,...r,...i])),h&&h.length>1){const m=(o==null?void 0:o.measurementType)||[],_=m.includes(ue.净空距离),W=m.includes(ue.垂直距离)||m.includes(ue.水平距离)||m.includes(ue.安全距离)||m.includes(ue.直线距离),C=this.interpolateWire(h,1),T=[];if(_){const L=await this.calculateAndDrawWireToGroundDistanceByType(C,[ue.净空距离]).catch(w=>(console.error("Error in wire to ground distance calculation:",w),null));L&&T.push(L)}if(W){const L=(o==null?void 0:o.width)||10,w=(o==null?void 0:o.show)!==!1,D=this.drawWireCorridor(C,L);w&&this.entityCollectionplotting.add(D);const b=t.filter(B=>this.lonLatInStaticPolygonOpts(B.lon,B.lat,D));this.terrainVerificationCache.clear(),b.forEach(B=>{const R=this.calcResultSingleWire(B,C,m,this.getClickDistanceRuleConfig());R&&T.push(R)})}o!=null&&o.onMeasurementResult&&T.length>0&&o.onMeasurementResult(T)}}}}},g.ScreenSpaceEventType.LEFT_CLICK)}removeWireListen(){this.wireClickHandler&&(this.wireClickHandler.destroy(),this.wireClickHandler=null),this.clearWireCorridors()}getGroundElevation(t,e){return 0}calculateWireToGroundDistance(t){let e=1/0,r=[],i=[];for(const n of t){const[o,f,u]=n,l=this.getGroundElevation(o,f),a=Math.abs(u-l);a<e&&(e=a,r=n,i=[o,f,l])}return{distance:e,wirePoint:r,groundPoint:i}}async calculateAndDrawWireToGroundDistanceByType(t,e){if(!t||t.length===0)return null;try{const r=t.map(c=>new g.Cartographic(g.Math.toRadians(c[0]),g.Math.toRadians(c[1]))),i=this.viewer.terrainProvider;let n=[];if(i&&g.defined(i))try{n=(await g.sampleTerrainMostDetailed(i,r)).map(p=>p.height||0)}catch(c){console.warn("Terrain sampling failed, using default ground height:",c),n=new Array(t.length).fill(0)}else n=new Array(t.length).fill(0);let o=1/0,f=0;for(let c=0;c<t.length;c++){const p=t[c][2],d=n[c],h=p-d;h>0&&h<o&&(o=h,f=c)}if(o===1/0){o=1/0;for(let c=0;c<t.length;c++){const p=t[c][2],d=n[c],h=Math.abs(p-d);h<o&&(o=h,f=c)}}const u=t[f],l=[u[0],u[1],n[f]];return this.drawWireToGroundDistanceByType(u,l,o,e),{treeId:`ground-${Date.now()}`,treeCoordinates:l,conductorCoordinates:u,horizontalDistance:0,verticalDistance:parseFloat(o.toFixed(1)),straightLineDistance:parseFloat(o.toFixed(1)),clearanceDistance:parseFloat(o.toFixed(1)),timestamp:Date.now()}}catch(r){console.warn("Failed to calculate wire to ground distance:",r);const i=this.calculateWireToGroundDistance(t);return this.drawWireToGroundDistanceByType(i.wirePoint,i.groundPoint,i.distance,e),{treeId:`ground-${Date.now()}`,treeCoordinates:i.groundPoint,conductorCoordinates:i.wirePoint,horizontalDistance:0,verticalDistance:parseFloat(i.distance.toFixed(1)),straightLineDistance:parseFloat(i.distance.toFixed(1)),clearanceDistance:parseFloat(i.distance.toFixed(1)),timestamp:Date.now()}}}async calculateAndDrawWireToGroundDistanceBySegments(t,e,r,i){console.log("Calculating wire to ground distance by segments..."),console.log("A相导线数据点数:",(t==null?void 0:t.length)||0),console.log("B相导线数据点数:",(e==null?void 0:e.length)||0),console.log("C相导线数据点数:",(r==null?void 0:r.length)||0);const n=[];if(t&&t.length>=2&&n.push({name:"A",data:t}),e&&e.length>=2&&n.push({name:"B",data:e}),r&&r.length>=2&&n.push({name:"C",data:r}),console.log("有效相数:",n.length),n.length===0){console.warn("No valid wire data found for ground distance calculation");return}for(const o of n){const f=o.data;console.log(`处理${o.name}相导线,数据点数:`,f.length);const u=this.interpolateWire(f,1);console.log(`${o.name}相插值后点数:`,u.length);try{const l=u.map(_=>new g.Cartographic(g.Math.toRadians(_[0]),g.Math.toRadians(_[1]))),a=this.viewer.terrainProvider;let c=[];if(a&&g.defined(a))try{c=(await g.sampleTerrainMostDetailed(a,l)).map(W=>W.height||0)}catch(_){console.warn(`Terrain sampling failed for phase ${o.name}, using default ground height:`,_),c=new Array(u.length).fill(0)}else c=new Array(u.length).fill(0);let p=1/0,d=0;for(let _=0;_<u.length;_++){const W=u[_][2],C=c[_],T=W-C;T>0&&T<p&&(p=T,d=_)}if(p===1/0)for(let _=0;_<u.length;_++){const W=u[_][2],C=c[_],T=Math.abs(W-C);T<p&&(p=T,d=_)}console.log(`${o.name}相最低净空距离:`,p,"在索引:",d);const h=u[d],m=[h[0],h[1],c[d]];this.drawWireToGroundDistanceByType(h,m,p,i)}catch(l){console.warn(`Failed to calculate wire to ground distance for phase ${o.name}:`,l)}}console.log("Wire to ground distance calculation by segments completed.")}getDistanceTypeLabel(t,e){const r=`${e.toFixed(1)}米`;switch(t){case ue.垂直距离:return`对地距离${r}`;case ue.净空距离:return`净空距离${r}`;case ue.安全距离:return`安全距离${r}`;default:return`距离${r}`}}drawWireToGroundDistanceByType(t,e,r,i,n=me.导线){var p,d;const o=[g.Cartesian3.fromDegrees(t[0],t[1],t[2]),g.Cartesian3.fromDegrees(e[0],e[1],e[2])];let f="#eff819",u=g.Color.RED;const l=this.distanceRuleConfig;let a,c=!1;if(i.includes(ue.净空距离)&&(a=(d=(p=l.typeRules.get(n))==null?void 0:p.clearanceLevels)==null?void 0:d.find(h=>r>=h.minDistance&&r<=h.maxDistance)),a?(f=a.color,u=g.Color.fromCssColorString(a.color)):(c=!0,f="#00ff00",u=g.Color.GREEN),a||c){this.entityCollectionplotting.add({polyline:{positions:o,width:2,material:u,clampToGround:!1,shadows:g.ShadowMode.DISABLED}});const h=g.Cartesian3.midpoint(o[0],o[1],new g.Cartesian3);this.entityCollectionplotting.add({position:h,name:"净空距离",label:{text:this.getDistanceTypeLabel(ue.净空距离,r),fillColor:g.Color.fromCssColorString(f),font:"12px sans-serif",pixelOffset:new g.Cartesian2(0,0),scaleByDistance:new g.NearFarScalar(1e3,1.5,2e3,1),disableDepthTestDistance:Number.POSITIVE_INFINITY,outlineColor:g.Color.BLACK,outlineWidth:2,style:g.LabelStyle.FILL_AND_OUTLINE}})}}clearWireCorridors(){if(!this.entityCollectionplotting)return;const t=[];this.entityCollectionplotting.values.forEach(e=>{e.name==="wire-corridor"&&t.push(e)}),t.forEach(e=>{try{this.entityCollectionplotting.remove(e)}catch{}})}interpolateWire(t,e=1){if(t.length<2)return t;const r=[];for(let i=0;i<t.length-1;i++){const n=t[i],o=t[i+1],f=g.Cartesian3.fromDegrees(n[0],n[1],n[2]),u=g.Cartesian3.fromDegrees(o[0],o[1],o[2]),l=g.Cartesian3.distance(f,u);if(l<=e){i===0&&r.push(n),r.push(o);continue}const a=Math.ceil(l/e),c=1/a;i===0&&r.push(n);for(let p=1;p<a;p++){const d=p*c,h=g.Cartesian3.lerp(f,u,d,new g.Cartesian3),m=g.Cartographic.fromCartesian(h),_=g.Math.toDegrees(m.longitude),W=g.Math.toDegrees(m.latitude),C=m.height;r.push([_,W,C])}r.push(o)}return r}lonLatInStaticPolygonOpts(t,e,r){var l;if(!(r!=null&&r.polygon))return!1;const i=r.polygon.hierarchy;if(!(i instanceof g.PolygonHierarchy))return!1;const n=i.positions;if(!n||n.length<3)return!1;const o=g.Cartographic.fromDegrees(t,e),f=new g.Cartesian2(o.longitude,o.latitude),u=n.map(a=>{const c=g.Cartographic.fromCartesian(a);return new g.Cartesian2(c.longitude,c.latitude)});if(!this.pointInRing(f,u))return!1;if((l=i.holes)!=null&&l.length)for(const a of i.holes){const c=a.positions.map(p=>{const d=g.Cartographic.fromCartesian(p);return new g.Cartesian2(d.longitude,d.latitude)});if(this.pointInRing(f,c))return!1}return!0}pointInRing(t,e){let r=!1;const i=t.x,n=t.y;for(let o=0,f=e.length-1;o<e.length;f=o++){const u=e[o].x,l=e[o].y,a=e[f].x,c=e[f].y;l>n!=c>n&&i<(a-u)*(n-l)/(c-l)+u&&(r=!r)}return r}pointInPolygon2D(t,e){let r=!1;const i=t.x,n=t.y;for(let o=0,f=e.length-1;o<e.length;f=o++){const u=e[o].x,l=e[o].y,a=e[f].x,c=e[f].y;l>n!=c>n&&i<(a-u)*(n-l)/(c-l)+u&&(r=!r)}return r}drawWireCorridor(t,e){const r=[],i=[];for(let f=0;f<t.length;f++){const u=t[f],l=g.Cartesian3.fromDegrees(u[0],u[1],u[2]);let a,c;if(f===0){const L=t[f+1];c=g.Cartesian3.fromDegrees(L[0],L[1],L[2]),a=l}else if(f===t.length-1){const L=t[f-1];a=g.Cartesian3.fromDegrees(L[0],L[1],L[2]),c=l}else{const L=t[f-1],w=t[f+1];a=g.Cartesian3.fromDegrees(L[0],L[1],L[2]),c=g.Cartesian3.fromDegrees(w[0],w[1],w[2])}const p=g.Cartesian3.subtract(c,a,new g.Cartesian3);g.Cartesian3.normalize(p,p);const d=g.Cartesian3.clone(l);g.Cartesian3.normalize(d,d);const h=g.Cartesian3.cross(p,d,new g.Cartesian3);g.Cartesian3.normalize(h,h);const m=e/2,_=g.Cartesian3.multiplyByScalar(h,m,new g.Cartesian3),W=g.Cartesian3.multiplyByScalar(h,-m,new g.Cartesian3),C=g.Cartesian3.add(l,_,new g.Cartesian3),T=g.Cartesian3.add(l,W,new g.Cartesian3);r.push(C),i.push(T)}const n=[];return n.push(...r),n.push(...i.reverse()),n.push(r[0]),{id:`wire-corridor-${Date.now()}`,name:"wire-corridor",polygon:{hierarchy:new g.PolygonHierarchy(n),material:g.Color.YELLOW.withAlpha(.3),outline:!0,outlineColor:g.Color.YELLOW,outlineWidth:2}}}calcResult(t,e,r,i,n=this.distanceRuleConfig,o=[],f=me.树木){if(this.entityCollectionplotting.values.length>=this.maxVisibleResults)return;const u=`${t[0].toFixed(6)}_${t[1].toFixed(6)}_${t[2].toFixed(2)}`;if(this.terrainVerificationCache.has(u)){const l=this.terrainVerificationCache.get(u);Rr(t,l,this.entityCollectionplotting,n,o,f);return}else{const l=Vn(t,e,r,i);this.terrainVerificationCache.set(u,l),Rr(t,l,this.entityCollectionplotting,n||this.distanceRuleConfig,o,f)}}calcResultSingleWire(t,e,r,i=this.distanceRuleConfig,n=me.树木){if(this.entityCollectionplotting.values.length>=this.maxVisibleResults)return null;const o=[t.lon,t.lat,Number(t.alt||0)+Number(t.treeH||0)],f=`${o[0].toFixed(6)}_${o[1].toFixed(6)}_${o[2].toFixed(2)}`;if(this.terrainVerificationCache.has(f)){const u=this.terrainVerificationCache.get(f);return Rr(o,u,this.entityCollectionplotting,i,r,n),Xn(o,u,t.id)}else{const u=e;return this.terrainVerificationCache.set(f,u),Rr(o,u,this.entityCollectionplotting,i||this.distanceRuleConfig,r,n),Xn(o,u,t.id)}}LineChannelTerrainVerificationForFilteredTrees(t,e,r,i,n,o=100,f=[],u){if(console.log(`LineChannelTerrainVerificationForFilteredTrees called with ${t.length} trees`),this.terrainVerificationIsRunning){console.log("地物校验已在运行中,跳过重复调用");return}this.ensurePlottingDataSourceAdded(),this.clearTreeDistanceResultsExceptCorridor(),this.terrainVerificationBatchSize=o,this.terrainVerificationBatchIndex=0,this.terrainVerificationTotalBatches=Math.ceil(t.length/o),this.terrainVerificationIsRunning=!0,console.log(`开始对${t.length}棵树进行地物校验`),this.processTerrainVerificationBatch(t,e,r,i,n,f,u)}getChannelCalculationDataSources(){return[this.dataSourceplotting]}setWireToWireDistanceRuleConfig(t){this.wireToWireDistanceRuleConfig=t}getWireToWireDistanceRuleConfig(){const t=new Po;return t.phaseRules=new Map(this.wireToWireDistanceRuleConfig.phaseRules),t}calculateWireToWireDistance(t,e,r=xt.A相,i=xt.B相){const n=new Bu;if(n.timestamp=Date.now(),n.phase1=r,n.phase2=i,t.length<2||e.length<2)return console.warn("导线数据点数不足,无法计算线间距离"),n;const o=this.interpolateWire(t,1),f=this.interpolateWire(e,1);let u=1/0,l=[],a=[];for(const c of o){const p=g.Cartesian3.fromDegrees(c[0],c[1],c[2]);for(const d of f){const h=g.Cartesian3.fromDegrees(d[0],d[1],d[2]),m=g.Cartesian3.distance(p,h);m<u&&(u=m,l=c,a=d)}}if(l.length>0&&a.length>0){n.wire1Coordinates=l,n.wire2Coordinates=a,n.straightLineDistance=parseFloat(u.toFixed(2));const c=this.calculateHorizontalDistance(l,a);n.horizontalDistance=parseFloat(c.toFixed(2));const p=Math.abs(l[2]-a[2]);n.verticalDistance=parseFloat(p.toFixed(2)),this.determineWireToWireStatus(n)}return n}calculateHorizontalDistance(t,e){const r=g.Cartesian3.fromDegrees(t[0],t[1],0),i=g.Cartesian3.fromDegrees(e[0],e[1],0);return g.Cartesian3.distance(r,i)}determineWireToWireStatus(t){const e=this.wireToWireDistanceRuleConfig.getRules(t.phase1,t.phase2);if(!e||e.distanceLevels.length===0){t.status="正常",t.statusColor="#00ff00";return}const r=t.straightLineDistance;for(const i of e.distanceLevels)if(r>=i.minDistance&&r<=i.maxDistance){t.status=i.name,t.statusColor=i.color;return}t.status="正常",t.statusColor="#00ff00"}drawWireToWireDistance(t){this.ensurePlottingDataSourceAdded();const e=["A相","B相","C相","地线1","地线2","全部"],r=e[t.phase1],i=e[t.phase2],n=[g.Cartesian3.fromDegrees(t.wire1Coordinates[0],t.wire1Coordinates[1],t.wire1Coordinates[2]),g.Cartesian3.fromDegrees(t.wire2Coordinates[0],t.wire2Coordinates[1],t.wire2Coordinates[2])];this.entityCollectionplotting.add({name:`线间距离-${r}-${i}-线段`,polyline:{positions:n,width:3,material:g.Color.fromCssColorString(t.statusColor),clampToGround:!1,shadows:g.ShadowMode.DISABLED}});const o=g.Cartesian3.midpoint(n[0],n[1],new g.Cartesian3);this.entityCollectionplotting.add({position:o,name:`线间距离-${r}-${i}`,label:{text:`${r}-${i}: ${t.straightLineDistance.toFixed(2)}m`,fillColor:g.Color.fromCssColorString(t.statusColor),font:"14px sans-serif",pixelOffset:new g.Cartesian2(0,0),scaleByDistance:new g.NearFarScalar(1e3,1.5,2e3,1),disableDepthTestDistance:Number.POSITIVE_INFINITY,outlineColor:g.Color.BLACK,outlineWidth:2,style:g.LabelStyle.FILL_AND_OUTLINE}})}createDefaultWireToWireDistanceRuleConfig(){const t=new Po,e={distanceLevels:[{name:"危险",minDistance:0,maxDistance:3,color:"#ff0000",isAlarm:!0},{name:"警告",minDistance:3,maxDistance:5,color:"#ffa500",isAlarm:!0},{name:"安全",minDistance:5,maxDistance:1/0,color:"#00ff00",isAlarm:!1}],enabled:!0},r=[xt.A相,xt.B相,xt.C相,xt.地线1,xt.地线2];for(let i=0;i<r.length;i++)for(let n=i+1;n<r.length;n++)t.setRules(r[i],r[n],{...e});return t}}function Uu(s,t){let e=0;for(let r of s)r!=null&&(r=+r)>=r&&++e;return e}function qu(s,t){let e,r;if(t===void 0)for(const i of s)i!=null&&(e===void 0?i>=i&&(e=r=i):(e>i&&(e=i),r<i&&(r=i)));else{let i=-1;for(let n of s)(n=t(n,++i,s))!=null&&(e===void 0?n>=n&&(e=r=n):(e>n&&(e=n),r<n&&(r=n)))}return[e,r]}const Hu=Math.sqrt(50),Zu=Math.sqrt(10),Ku=Math.sqrt(2);function zn(s,t,e){const r=(t-s)/Math.max(0,e),i=Math.floor(Math.log10(r)),n=r/Math.pow(10,i),o=n>=Hu?10:n>=Zu?5:n>=Ku?2:1;let f,u,l;return i<0?(l=Math.pow(10,-i)/o,f=Math.round(s*l),u=Math.round(t*l),f/l<s&&++f,u/l>t&&--u,l=-l):(l=Math.pow(10,i)*o,f=Math.round(s/l),u=Math.round(t/l),f*l<s&&++f,u*l>t&&--u),u<f&&.5<=e&&e<2?zn(s,t,e*2):[f,u,l]}function ju(s,t,e){if(t=+t,s=+s,e=+e,!(e>0))return[];if(s===t)return[s];const r=t<s,[i,n,o]=r?zn(t,s,e):zn(s,t,e);if(!(n>=i))return[];const f=n-i+1,u=new Array(f);if(r)if(o<0)for(let l=0;l<f;++l)u[l]=(n-l)/-o;else for(let l=0;l<f;++l)u[l]=(n-l)*o;else if(o<0)for(let l=0;l<f;++l)u[l]=(i+l)/-o;else for(let l=0;l<f;++l)u[l]=(i+l)*o;return u}function Ju(s,t,e){return t=+t,s=+s,e=+e,zn(s,t,e)[2]}function Qu(s,t,e){let r;for(;;){const i=Ju(s,t,e);if(i===r||i===0||!isFinite(i))return[s,t];i>0?(s=Math.floor(s/i)*i,t=Math.ceil(t/i)*i):i<0&&(s=Math.ceil(s*i)/i,t=Math.floor(t*i)/i),r=i}}function $u(s){return Math.max(1,Math.ceil(Math.log(Uu(s))/Math.LN2)+1)}var th=Array.prototype,eh=th.slice;function ih(s,t){return s-t}function rh(s){for(var t=0,e=s.length,r=s[e-1][1]*s[0][0]-s[e-1][0]*s[0][1];++t<e;)r+=s[t-1][1]*s[t][0]-s[t-1][0]*s[t][1];return r}const hf=s=>()=>s;function sh(s,t){for(var e=-1,r=t.length,i;++e<r;)if(i=nh(s,t[e]))return i;return 0}function nh(s,t){for(var e=t[0],r=t[1],i=-1,n=0,o=s.length,f=o-1;n<o;f=n++){var u=s[n],l=u[0],a=u[1],c=s[f],p=c[0],d=c[1];if(oh(u,c,t))return 0;a>r!=d>r&&e<(p-l)*(r-a)/(d-a)+l&&(i=-i)}return i}function oh(s,t,e){var r;return ah(s,t,e)&&fh(s[r=+(s[0]===t[0])],e[r],t[r])}function ah(s,t,e){return(t[0]-s[0])*(e[1]-s[1])===(e[0]-s[0])*(t[1]-s[1])}function fh(s,t,e){return s<=t&&t<=e||e<=t&&t<=s}function uh(){}var mr=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function hh(){var s=1,t=1,e=$u,r=u;function i(l){var a=e(l);if(Array.isArray(a))a=a.slice().sort(ih);else{const c=qu(l,lh);for(a=ju(...Qu(c[0],c[1],a),a);a[a.length-1]>=c[1];)a.pop();for(;a[1]<c[0];)a.shift()}return a.map(c=>n(l,c))}function n(l,a){const c=a==null?NaN:+a;if(isNaN(c))throw new Error(`invalid value: ${a}`);var p=[],d=[];return o(l,c,function(h){r(h,l,c),rh(h)>0?p.push([h]):d.push(h)}),d.forEach(function(h){for(var m=0,_=p.length,W;m<_;++m)if(sh((W=p[m])[0],h)!==-1){W.push(h);return}}),{type:"MultiPolygon",value:a,coordinates:p}}function o(l,a,c){var p=new Array,d=new Array,h,m,_,W,C,T;for(h=m=-1,W=ts(l[0],a),mr[W<<1].forEach(L);++h<s-1;)_=W,W=ts(l[h+1],a),mr[_|W<<1].forEach(L);for(mr[W<<0].forEach(L);++m<t-1;){for(h=-1,W=ts(l[m*s+s],a),C=ts(l[m*s],a),mr[W<<1|C<<2].forEach(L);++h<s-1;)_=W,W=ts(l[m*s+s+h+1],a),T=C,C=ts(l[m*s+h+1],a),mr[_|W<<1|C<<2|T<<3].forEach(L);mr[W|C<<3].forEach(L)}for(h=-1,C=l[m*s]>=a,mr[C<<2].forEach(L);++h<s-1;)T=C,C=ts(l[m*s+h+1],a),mr[C<<2|T<<3].forEach(L);mr[C<<3].forEach(L);function L(w){var D=[w[0][0]+h,w[0][1]+m],b=[w[1][0]+h,w[1][1]+m],B=f(D),R=f(b),x,M;(x=d[B])?(M=p[R])?(delete d[x.end],delete p[M.start],x===M?(x.ring.push(b),c(x.ring)):p[x.start]=d[M.end]={start:x.start,end:M.end,ring:x.ring.concat(M.ring)}):(delete d[x.end],x.ring.push(b),d[x.end=R]=x):(x=p[R])?(M=d[B])?(delete p[x.start],delete d[M.end],x===M?(x.ring.push(b),c(x.ring)):p[M.start]=d[x.end]={start:M.start,end:x.end,ring:M.ring.concat(x.ring)}):(delete p[x.start],x.ring.unshift(D),p[x.start=B]=x):p[B]=d[R]={start:B,end:R,ring:[D,b]}}}function f(l){return l[0]*2+l[1]*(s+1)*4}function u(l,a,c){l.forEach(function(p){var d=p[0],h=p[1],m=d|0,_=h|0,W=bo(a[_*s+m]);d>0&&d<s&&m===d&&(p[0]=lf(d,bo(a[_*s+m-1]),W,c)),h>0&&h<t&&_===h&&(p[1]=lf(h,bo(a[(_-1)*s+m]),W,c))})}return i.contour=n,i.size=function(l){if(!arguments.length)return[s,t];var a=Math.floor(l[0]),c=Math.floor(l[1]);if(!(a>=0&&c>=0))throw new Error("invalid size");return s=a,t=c,i},i.thresholds=function(l){return arguments.length?(e=typeof l=="function"?l:Array.isArray(l)?hf(eh.call(l)):hf(l),i):e},i.smooth=function(l){return arguments.length?(r=l?u:uh,i):r===u},i}function lh(s){return isFinite(s)?s:NaN}function ts(s,t){return s==null?!1:+s>=t}function bo(s){return s==null||isNaN(s=+s)?-1/0:s}function lf(s,t,e,r){const i=r-t,n=e-t,o=isFinite(i)||isFinite(n)?i/n:Math.sign(i)/Math.sign(n);return isNaN(o)?s:s+o-.5}function ch(s){return s.primitive!==void 0}class ph{constructor(t){I(this,"viewer");I(this,"lineInfo",null);I(this,"contourEntities",[]);I(this,"mountainEntities",[]);I(this,"contourConfig",{contourInterval:50,corridorWidthKm:1,interpolationPrecision:50,contourColor:"#00ff00",contourWidth:2,showLabels:!0,labelFontSize:12});I(this,"mountainConfig",{minElev:500,minProm:300,minDistance:500});this.viewer=t}setMountainConfig(t){this.mountainConfig={...this.mountainConfig,...t}}getMountainConfig(){return{...this.mountainConfig}}setContourConfig(t){this.contourConfig={...this.contourConfig,...t}}getContourConfig(){return{...this.contourConfig}}setLineInfo(t){this.lineInfo=t}calculateCorridorBounds(){if(!this.lineInfo||!this.lineInfo.towers||this.lineInfo.towers.length===0)return null;const t=this.lineInfo.towers;let e=1/0,r=-1/0,i=1/0,n=-1/0;t.forEach(u=>{u.Longitude<e&&(e=u.Longitude),u.Longitude>r&&(r=u.Longitude),u.Latitude<i&&(i=u.Latitude),u.Latitude>n&&(n=u.Latitude)});const o=1/111,f=this.contourConfig.corridorWidthKm*o;return e-=f,r+=f,i-=f,n+=f,[e,i,r,n]}async getHeightFromTerrain(t,e){var r;try{const i=[g.Cartographic.fromDegrees(t,e)];return((r=(await g.sampleTerrainMostDetailed(this.viewer.terrainProvider,i))[0])==null?void 0:r.height)??0}catch(i){return console.warn(`获取高度失败 [${t}, ${e}]:`,i),0}}async generateGridPoints(t){const[e,r,i,n]=t,o=1/111,f=this.contourConfig.interpolationPrecision/1e3*o,u=Math.ceil((i-e)/f)+1,l=Math.ceil((n-r)/f)+1,a=u*l;let c=0;const p=new Array(a),d=[];console.log(`[d3-contour] 开始生成网格点: 总点数 ${a}, 经度步数 ${u}, 纬度步数 ${l}`);for(let h=0;h<l;h++){const m=n-h*f;for(let _=0;_<u;_++){const W=e+_*f,C=await this.getHeightFromTerrain(W,m),T=h*u+_;if(p[T]=C,d.push({longitude:W,latitude:m,height:C}),c++,c%100===0){const L=(c/a*100).toFixed(1);console.log(`[d3-contour] 网格点生成进度: ${c}/${a} (${L}%)`)}}}return console.log(`[d3-contour] 网格点生成完成: 共生成 ${d.length} 个点`),{values:p,width:u,height:l,x0:e,y0:n,dx:f,dy:-f,points:d}}generateContours(t){const e=[],{contourInterval:r}=this.contourConfig;if(t.values.length===0||t.width<2||t.height<2)return e;console.log(`[d3-contour] 开始生成等高线,等高距: ${r}m`);const i=t.values.filter(a=>a!=null);if(i.length===0)return e;const n=Math.floor(Math.min(...i)/r)*r,o=Math.ceil(Math.max(...i)/r)*r,f=[];for(let a=n;a<=o;a+=r)f.push(a);const l=hh().size([t.width,t.height]).thresholds(f)(t.values);return console.log(`[d3-contour] d3-contour 生成了 ${l.length} 条等高线`),l.forEach(a=>{const c={height:a.value,points:[]};a.coordinates.forEach(p=>{p.forEach(d=>{d.forEach(h=>{const m=t.x0+h[0]*t.dx,_=t.y0+h[1]*t.dy,W=this.getHeightAtGridPoint(t,h[0],h[1]);c.points.push({longitude:m,latitude:_,height:W})})})}),c.points.length>=2&&e.push(c)}),console.log(`[d3-contour] 转换完成,共 ${e.length} 条有效等高线`),e}getHeightAtGridPoint(t,e,r){const i=Math.floor(e),n=Math.floor(r),o=Math.min(i+1,t.width-1),f=Math.min(n+1,t.height-1),u=n*t.width+i,l=n*t.width+o,a=f*t.width+i,c=f*t.width+o,p=t.values[u]||0,d=t.values[l]||0,h=t.values[a]||0,m=t.values[c]||0,_=e-i,W=r-n,C=p*(1-_)+d*_,T=h*(1-_)+m*_;return C*(1-W)+T*W}drawContours(t){this.clearContours();const{contourColor:e,contourWidth:r,showLabels:i,labelFontSize:n}=this.contourConfig;console.log(`开始绘制等高线: ${t.length} 条, 颜色: ${e}, 宽度: ${r}`),t.forEach((o,f)=>{if(o.points.length<2)return;const u=g.Cartesian3.fromDegreesArray(o.points.flatMap(a=>[a.longitude,a.latitude])),l=new g.GroundPolylinePrimitive({geometryInstances:new g.GeometryInstance({geometry:new g.GroundPolylineGeometry({positions:u,width:r})}),appearance:new g.PolylineMaterialAppearance({material:g.Material.fromType("Color",{color:g.Color.fromCssColorString(e)})})});if(this.viewer.scene.primitives.add(l),this.contourEntities.push({primitive:l}),console.log(`绘制等高线 ${f}: 高度 ${o.height}m, 点数 ${o.points.length}`),i&&o.points.length>0){const a=Math.floor(o.points.length/2),c=o.points[a],p=this.viewer.entities.add({name:`Contour_Label_${f}_${o.height}m`,position:g.Cartesian3.fromDegrees(c.longitude,c.latitude,c.height+10),label:{text:`${o.height}m`,font:`${n}px sans-serif`,fillColor:g.Color.WHITE,outlineColor:g.Color.BLACK,outlineWidth:2,style:g.LabelStyle.FILL_AND_OUTLINE,verticalOrigin:g.VerticalOrigin.CENTER,horizontalOrigin:g.HorizontalOrigin.CENTER,heightReference:g.HeightReference.CLAMP_TO_GROUND}});this.contourEntities.push(p)}})}async getAndDrawContours(t,e){debugger;if(e&&this.setContourConfig(e),t&&this.setLineInfo(t),!this.lineInfo||!this.lineInfo.towers||this.lineInfo.towers.length===0)throw new Error("线路信息为空,请先加载线路数据");const r=this.calculateCorridorBounds();if(!r)throw new Error("无法计算通道边界");console.log(`等高线获取范围: [${r[0].toFixed(6)}, ${r[1].toFixed(6)}, ${r[2].toFixed(6)}, ${r[3].toFixed(6)}]`),console.log(`等高距: ${this.contourConfig.contourInterval}m, 插值精度: ${this.contourConfig.interpolationPrecision}m`);const i=await this.generateGridPoints(r);console.log(`生成网格点数量: ${i.points.length}`);const n=this.generateContours(i);return console.log(`生成等高线数量: ${n.length}`),this.drawContours(n),n}async getContourData(t,e){if(e&&this.setContourConfig(e),t&&this.setLineInfo(t),!this.lineInfo||!this.lineInfo.towers||this.lineInfo.towers.length===0)throw new Error("线路信息为空");const r=this.calculateCorridorBounds();if(!r)throw new Error("无法计算通道边界");const i=await this.generateGridPoints(r);return this.generateContours(i)}async getCorridorGridData(t,e){if(e&&this.setContourConfig(e),t&&this.setLineInfo(t),!this.lineInfo||!this.lineInfo.towers||this.lineInfo.towers.length===0)throw new Error("线路信息为空");const r=this.calculateCorridorBounds();if(!r)throw new Error("无法计算通道边界");return(await this.generateGridPoints(r)).points}clearContours(){this.contourEntities.forEach(t=>{try{ch(t)?this.viewer.scene.primitives.remove(t.primitive):this.viewer.entities.remove(t)}catch(e){console.warn("Error removing contour entity:",e)}}),this.contourEntities=[]}setCorridorWidthKm(t){this.contourConfig.corridorWidthKm=t}setContourInterval(t){this.contourConfig.contourInterval=t}setInterpolationPrecision(t){this.contourConfig.interpolationPrecision=t}getCorridorWidthKm(){return this.contourConfig.corridorWidthKm}getContourInterval(){return this.contourConfig.contourInterval}async generateCrossSection(t,e){if(!this.lineInfo||!this.lineInfo.towers||this.lineInfo.towers.length===0)throw new Error("线路信息为空,请先加载线路数据");const r=this.lineInfo.towers;if(t<0||t>=r.length)throw new Error("无效的塔位索引");const i={width:100,interval:10,interpolationMethod:"linear",mountainThreshold:300,mountainProminence:50,...e},n=r[t];let o=n,f=n;t>0&&(o=r[t-1]),t<r.length-1&&(f=r[t+1]);const u=f.Longitude-o.Longitude,a=-(f.Latitude-o.Latitude),c=u,p=Math.sqrt(a*a+c*c),d={dx:a/p,dy:c/p},h=i.width/2,m=6371e3,_=h/m*(180/Math.PI),W=h/m*(180/Math.PI)/Math.cos(n.Latitude*Math.PI/180),C=n.Longitude-d.dx*W,T=n.Latitude-d.dy*_,L=n.Longitude+d.dx*W,w=n.Latitude+d.dy*_,D=[],b=Math.ceil(i.width/i.interval)+1;for(let x=0;x<b;x++){const M=x/(b-1),q=C+(L-C)*M,Z=T+(w-T)*M,O=(M-.5)*i.width,X=await this.getHeightFromTerrain(q,Z);D.push({distance:O,height:X,lon:q,lat:Z,isCenter:Math.abs(O)<i.interval/2,isMountain:!1})}const B=this.applyInterpolation(D,i.interpolationMethod),R=this.detectMountains(B,i.mountainThreshold,i.mountainProminence);return R.forEach(x=>{B.forEach(M=>{M.distance>=x.startDistance&&M.distance<=x.endDistance&&(M.isMountain=!0)})}),{points:B,mountains:R}}applyInterpolation(t,e){return e==="cubic"?this.cubicSplineInterpolation(t):e==="nearest"?[...t]:[...t]}cubicSplineInterpolation(t){if(t.length<2)return t;const e=[],r=2;for(let i=0;i<t.length-1;i++){const n=t[i],o=t[i+1],f=i>0?t[i-1]:n,u=i<t.length-2?t[i+2]:o;for(let l=0;l<r;l++){const a=l/r,c=a*a,p=c*a,d=2*p-3*c+1,h=p-2*c+a,m=-2*p+3*c,_=p-c,W=d*n.height+h*(o.distance-n.distance)*this.getSlope(f,n,o)+m*o.height+_*(o.distance-n.distance)*this.getSlope(n,o,u),C=n.distance+(o.distance-n.distance)*a;e.push({distance:C,height:W,lon:n.lon,lat:n.lat,isCenter:n.isCenter||o.isCenter,isMountain:!1})}}return e.push({...t[t.length-1]}),e}getSlope(t,e,r){const i=e.distance-t.distance,n=r.distance-e.distance;return i===0?(r.height-e.height)/(n||1):n===0?(e.height-t.height)/i:((e.height-t.height)/i+(r.height-e.height)/n)/2}detectMountains(t,e,r){const i=[];if(t.length<3)return i;for(let n=1;n<t.length-1;n++){const o=t[n],f=t[n-1],u=t[n+1];if(o.height>f.height&&o.height>u.height){let l=n,a=n,c=o.height,p=o.height;for(let m=n-1;m>=0&&o.height-t[m].height>=r;m--)l=m,c=t[m].height;for(let m=n+1;m<t.length&&o.height-t[m].height>=r;m++)a=m,p=t[m].height;const d=(c+p)/2,h=o.height-d;h>=e&&i.push({id:i.length+1,peakDistance:o.distance,peakHeight:o.height,startDistance:t[l].distance,endDistance:t[a].distance,heightDiff:h,path:`[${t[l].distance.toFixed(1)}m, ${o.distance.toFixed(1)}m, ${t[a].distance.toFixed(1)}m]`})}}return i}async generateLongSection(t){if(!this.lineInfo||!this.lineInfo.towers||this.lineInfo.towers.length<2)throw new Error("线路信息为空或杆塔数量不足");const e=this.lineInfo.towers,r={interval:50,interpolationMethod:"linear",...t},i=[];let n=0;i.push({towerName:e[0].name||"塔1",distance:n,height:e[0].Altitude||0,isTower:!0});for(let o=0;o<e.length-1;o++){const f=e[o],u=e[o+1],l=(u.Longitude-f.Longitude)*111e3,a=(u.Latitude-f.Latitude)*111e3,c=Math.sqrt(l*l+a*a),p=Math.floor(c/r.interval);for(let d=1;d<=p;d++){const h=d*r.interval/c,m=n+d*r.interval;if(r.interpolationMethod==="nearest"){const _=h<.5?f.Altitude||0:u.Altitude||0;i.push({towerName:"",distance:m,height:_,isTower:!1})}else{const _=(f.Altitude||0)+((u.Altitude||0)-(f.Altitude||0))*h;i.push({towerName:"",distance:m,height:_,isTower:!1})}}n+=c,i.push({towerName:u.name||`塔${o+2}`,distance:n,height:u.Altitude||0,isTower:!0})}return i}calculateCrossSectionLine(t,e){if(!this.lineInfo||!this.lineInfo.towers||this.lineInfo.towers.length===0)return null;const r=this.lineInfo.towers;if(t<0||t>=r.length)return null;const i=r[t];let n=i,o=i;t>0&&(n=r[t-1]),t<r.length-1&&(o=r[t+1]);const f=o.Longitude-n.Longitude,l=-(o.Latitude-n.Latitude),a=f,c=Math.sqrt(l*l+a*a),p={dx:l/c,dy:a/c},d=e/2,h=6371e3,m=d/h*(180/Math.PI),_=d/h*(180/Math.PI)/Math.cos(i.Latitude*Math.PI/180);return{start:{lon:i.Longitude-p.dx*_,lat:i.Latitude-p.dy*m},end:{lon:i.Longitude+p.dx*_,lat:i.Latitude+p.dy*m}}}async getAndDrawMountains(t,e,r){if(e&&this.setContourConfig(e),r&&this.setMountainConfig(r),t&&this.setLineInfo(t),!this.lineInfo||!this.lineInfo.towers||this.lineInfo.towers.length===0)throw new Error("线路信息为空,请先加载线路数据");const i=this.calculateCorridorBounds();if(!i)throw new Error("无法计算通道边界");console.log(`山峰识别范围: [${i[0].toFixed(6)}, ${i[1].toFixed(6)}, ${i[2].toFixed(6)}, ${i[3].toFixed(6)}]`),console.log(`山峰识别参数: minElev=${this.mountainConfig.minElev}m, minProm=${this.mountainConfig.minProm}m`);const n=await this.generateGridPoints(i);console.log(`生成网格点数量: ${n.points.length}`);const o=this.generateContours(n);console.log(`生成等高线数量: ${o.length}`);const f=this.detectMountainsFromGrid(n,o);return console.log(`识别到山峰数量: ${f.length}, 有效山峰: ${f.filter(u=>u.isValid).length}`),this.drawContours(o),this.drawMountains(f),f}detectMountainsFromGrid(t,e){const r=this.findCandidatePeaks(t,e);console.log(`粗筛候选山峰: ${r.length} 个`);const i=r.map((o,f)=>{const u=this.calculateProminence(o,t,e);return{id:f+1,longitude:o.longitude,latitude:o.latitude,elevation:o.elevation,prominence:u.prominence,saddleElevation:u.saddleElevation,isValid:u.prominence>=this.mountainConfig.minProm}});return this.deduplicateMountains(i)}findCandidatePeaks(t,e){const r=[],{minElev:i}=this.mountainConfig,n=[...e].sort((f,u)=>u.height-f.height),o=new Set;for(const f of n)if(!(f.height<i)&&f.points.length>=3){const u=this.calculatePolygonCenter(f.points),l=Math.floor((u.longitude-t.x0)/t.dx),a=Math.floor((u.latitude-t.y0)/t.dy),c=`${l},${a}`;if(!o.has(c)){o.add(c);const p=this.getHeightAtGridPoint(t,l,a);r.push({longitude:u.longitude,latitude:u.latitude,elevation:p})}}return r}calculatePolygonCenter(t){if(t.length===0)return{longitude:0,latitude:0};let e=0,r=0;return t.forEach(i=>{e+=i.longitude,r+=i.latitude}),{longitude:e/t.length,latitude:r/t.length}}calculateProminence(t,e,r){const i=t.elevation,n=[...r].sort((l,a)=>a.height-l.height);let o=i,f=!1;for(const l of n)if(!(l.height>=i))if(this.isPointInsideContour(t,l))o=l.height,f=!0;else break;return f||(o=Math.min(...e.values.filter(a=>a>0))),{prominence:i-o,saddleElevation:o}}isPointInsideContour(t,e){if(e.points.length<3)return!1;let r=!1;const i=e.points.length;for(let n=0,o=i-1;n<i;o=n++){const f=e.points[n].longitude,u=e.points[n].latitude,l=e.points[o].longitude,a=e.points[o].latitude;u>t.latitude!=a>t.latitude&&t.longitude<(l-f)*(t.latitude-u)/(a-u)+f&&(r=!r)}return r}deduplicateMountains(t){const{minDistance:e}=this.mountainConfig,r=[],i=new Set;for(let n=0;n<t.length;n++){if(i.has(n))continue;const o=t[n],f=[o];i.add(n);for(let u=n+1;u<t.length;u++){if(i.has(u))continue;this.calculateDistance(o,t[u])<e&&(f.push(t[u]),i.add(u))}if(f.length===1)r.push(o);else{const u=f.reduce((l,a)=>a.elevation>l.elevation?a:l);r.push(u)}}return r}calculateDistance(t,e){const i=(e.latitude-t.latitude)*Math.PI/180,n=(e.longitude-t.longitude)*Math.PI/180,o=Math.sin(i/2)*Math.sin(i/2)+Math.cos(t.latitude*Math.PI/180)*Math.cos(e.latitude*Math.PI/180)*Math.sin(n/2)*Math.sin(n/2);return 6371e3*(2*Math.atan2(Math.sqrt(o),Math.sqrt(1-o)))}drawMountains(t){this.clearMountains(),t.forEach((e,r)=>{if(!e.isValid)return;const i=this.viewer.entities.add({name:`Mountain_Peak_${r+1}`,position:g.Cartesian3.fromDegrees(e.longitude,e.latitude,e.elevation+10),point:{pixelSize:10,color:g.Color.RED,outlineColor:g.Color.WHITE,outlineWidth:2,heightReference:g.HeightReference.CLAMP_TO_GROUND},label:{text:`${e.elevation.toFixed(0)}m
5
5
  Prom: ${e.prominence.toFixed(0)}m`,font:"14px sans-serif",fillColor:g.Color.WHITE,outlineColor:g.Color.BLACK,outlineWidth:2,style:g.LabelStyle.FILL_AND_OUTLINE,verticalOrigin:g.VerticalOrigin.BOTTOM,horizontalOrigin:g.HorizontalOrigin.CENTER,heightReference:g.HeightReference.CLAMP_TO_GROUND,pixelOffset:new g.Cartesian2(0,-15)}});this.mountainEntities.push(i),console.log(`绘制山峰 ${r+1}: [${e.longitude.toFixed(6)}, ${e.latitude.toFixed(6)}], 海拔 ${e.elevation.toFixed(0)}m, 突出度 ${e.prominence.toFixed(0)}m`)})}clearMountains(){this.mountainEntities.forEach(t=>{try{this.viewer.entities.remove(t)}catch(e){console.warn("Error removing mountain entity:",e)}}),this.mountainEntities=[]}async getMountainData(t,e,r){if(e&&this.setContourConfig(e),r&&this.setMountainConfig(r),t&&this.setLineInfo(t),!this.lineInfo||!this.lineInfo.towers||this.lineInfo.towers.length===0)throw new Error("线路信息为空");const i=this.calculateCorridorBounds();if(!i)throw new Error("无法计算通道边界");const n=await this.generateGridPoints(i),o=this.generateContours(n);return this.detectMountainsFromGrid(n,o)}detectTerrainFeatures(t,e,r){const i=[],n=[],o=e.windowSize,f=t.length;if(f<o*2+1)return{peaks:i,valleys:n};const u=(c,p)=>p===0?90:Math.atan(Math.abs(c)/Math.abs(p))*180/Math.PI;for(let c=o;c<f-o;c++){const p=t[c];if(p.height<e.minPeakElev)continue;let d=!0,h=p.height;for(let M=c-o;M<=c+o;M++){if(t[M].height>p.height){d=!1;break}t[M].height<h&&(h=t[M].height)}if(!d)continue;const m=p.height-h;if(m<e.minPeakDiff)continue;let _=c,W=c;for(let M=c-1;M>=0&&p.height-t[M].height>=e.minPeakDiff/2;M--)_=M;for(let M=c+1;M<f&&p.height-t[M].height>=e.minPeakDiff/2;M++)W=M;const C=p.height-t[_].height,T=p.height-t[W].height,L=p.distance-t[_].distance,w=t[W].distance-p.distance,D=u(C,L),b=u(T,w),B=e.peakMode==="slope_only"||m>=e.minPeakDiff,R=e.peakMode==="height_diff"||D>=e.minPeakSlope&&b>=e.minPeakSlope,x=e.peakMode==="both"?m>=e.minPeakDiff&&D>=e.minPeakSlope&&b>=e.minPeakSlope:!0;if(e.peakMode==="both"){if(!x)continue}else if(e.peakMode==="height_diff"){if(!B)continue}else if(!R)continue;i.push({id:i.length+1,type:"peak",distance:p.distance,height:p.height,startDistance:t[_].distance,endDistance:t[W].distance,heightDiff:m})}for(let c=o;c<f-o;c++){const p=t[c];let d=!0,h=p.height;for(let M=c-o;M<=c+o;M++){if(t[M].height<p.height){d=!1;break}t[M].height>h&&(h=t[M].height)}if(!d)continue;const m=h-p.height;if(m<e.minValleyDiff)continue;let _=c,W=c;for(let M=c-1;M>=0&&t[M].height-p.height>=e.minValleyDiff/2;M--)_=M;for(let M=c+1;M<f&&t[M].height-p.height>=e.minValleyDiff/2;M++)W=M;const C=t[_].height-p.height,T=t[W].height-p.height,L=p.distance-t[_].distance,w=t[W].distance-p.distance,D=u(C,L),b=u(T,w),B=e.valleyMode==="slope_only"||m>=e.minValleyDiff,R=e.valleyMode==="height_diff"||D>=e.minValleySlope&&b>=e.minValleySlope,x=e.valleyMode==="both"?m>=e.minValleyDiff&&D>=e.minValleySlope&&b>=e.minValleySlope:!0;if(e.valleyMode==="both"){if(!x)continue}else if(e.valleyMode==="height_diff"){if(!B)continue}else if(!R)continue;n.push({id:n.length+1,type:"valley",distance:p.distance,height:p.height,startDistance:t[_].distance,endDistance:t[W].distance,heightDiff:m})}const l=this.mergeCloseFeatures(i,r*2),a=this.mergeCloseFeatures(n,r*2);return l.sort((c,p)=>c.distance-p.distance),a.sort((c,p)=>c.distance-p.distance),l.forEach((c,p)=>c.id=p+1),a.forEach((c,p)=>c.id=p+1),{peaks:l,valleys:a}}mergeCloseFeatures(t,e){if(t.length<=1)return t;const r=[...t].sort((n,o)=>n.distance-o.distance),i=[r[0]];for(let n=1;n<r.length;n++){const o=i[i.length-1],f=r[n];f.distance-o.distance<e?f.type==="peak"?f.height>o.height&&(i[i.length-1]=f):f.height<o.height&&(i[i.length-1]=f):i.push(f)}return i}async generateCrossSectionWithFeatures(t,e,r){const i=await this.generateCrossSection(t,e),n=i.points.map(l=>({distance:l.distance,height:l.height})),{peaks:o,valleys:f}=this.detectTerrainFeatures(n,r,e.interval??10),u=i.points.map(l=>({...l,type:l.isCenter?"center":"normal"}));return o.forEach(l=>{const a=u.find(c=>Math.abs(c.distance-l.distance)<(e.interval??10)/2);a&&(a.type="peak")}),f.forEach(l=>{const a=u.find(c=>Math.abs(c.distance-l.distance)<(e.interval??10)/2);a&&(a.type="valley")}),{points:u,peaks:o,valleys:f}}}class gh{constructor(t,e,r){I(this,"viewer");I(this,"LineInfo");I(this,"lineConstruction");I(this,"terrainConstruction");I(this,"channelCalculation");I(this,"contourConstruction");I(this,"selectedWireEntity",null);I(this,"originalWireColor",null);I(this,"wireCorridorWidth",10);I(this,"showWireCorridor",!0);I(this,"wireMeasurementType",[]);I(this,"isDynamicLoadingEnabled",!0);I(this,"pathEntities",[]);I(this,"selectedWire1Entity",null);I(this,"selectedWire1Data",[]);I(this,"selectedWire1Phase",xt.A相);I(this,"originalWire1Color",null);this.viewer=t,this.LineInfo=e,this.lineConstruction=new zu(t,e,r),this.terrainConstruction=new Do(t,e,r),this.channelCalculation=new Yu(t),this.contourConstruction=new ph(t),this.enableWireMeasurement=this.enableWireMeasurement.bind(this),this.removeWireListen=this.removeWireListen.bind(this)}setAutoCalculateRollX(t){this.lineConstruction.setAutoCalculateRollX(t)}getAutoCalculateRollX(){return this.lineConstruction.getAutoCalculateRollX()}setDynamicLoadingEnabled(t){this.isDynamicLoadingEnabled=t,this.lineConstruction.setDynamicLoadingEnabled(t),this.terrainConstruction.setDynamicLoadingEnabled(t)}setDynamicLoadingEnabled_line(t){this.lineConstruction.setDynamicLoadingEnabled(t)}setDynamicLoadingEnabled_Tree(t){this.terrainConstruction.setDynamicLoadingEnabled(t)}getDynamicLoadingEnabled(){return this.isDynamicLoadingEnabled}initializeLineData(){this.lineConstruction.initializeLineData()}loadLineTower(){this.lineConstruction.loadLineTower()}setLineVisible(t){this.lineConstruction.setLineVisible(t)}setTreeVisible(t){this.terrainConstruction.setTreeVisible(t)}loadLineModel(){this.lineConstruction.getLineDataSources().forEach(e=>{this.viewer.dataSources.contains(e)||this.viewer.dataSources.add(e)})}loadTree(){this.terrainConstruction.loadTree()}loadtreeModel(){this.terrainConstruction.getTerrainDataSources().forEach(t=>{this.viewer.dataSources.contains(t)||this.viewer.dataSources.add(t)})}addTreeData(t){this.terrainConstruction.addTreeData(t)}flyToTower(t){this.lineConstruction.flyToTower(t)}flyToTree(t){this.terrainConstruction.flyToTree(t)}loadTreeListen(t,e=[]){const r=this.terrainConstruction.getLineInfo().corridor_features,i=this.lineConstruction.getWireDataForChannelCalculation();this.channelCalculation.loadTreeListen(r,i.arcLine1A1,i.arcLine1B1,i.arcLine1C1,t,e)}removeTreeListen(){this.channelCalculation.removeTreeListen()}loadWireListen(){const t=this.terrainConstruction.getLineInfo().corridor_features,e=this.lineConstruction.getWireDataForChannelCalculation();this.channelCalculation.loadWireListen(t,e.arcLine1A1,e.arcLine1B1,e.arcLine1C1)}removeWireListen(){if(this.channelCalculation.removeWireListen(),this.selectedWireEntity&&this.originalWireColor){try{this.selectedWireEntity.polyline&&(this.selectedWireEntity.polyline.material=g.Color.fromCssColorString(this.originalWireColor))}catch(t){console.warn("Error restoring wire color:",t)}this.selectedWireEntity=null,this.originalWireColor=null}}clearWireMeasurementResults(){this.channelCalculation.clearTreeDistanceResults()}enableWireMeasurement(t){const e=this.terrainConstruction.getLineInfo().corridor_features,r=this.lineConstruction.getWireDataForChannelCalculation(),i=o=>{if(this.selectedWireEntity&&this.originalWireColor&&this.selectedWireEntity.polyline&&(this.selectedWireEntity.polyline.material=g.Color.fromCssColorString(this.originalWireColor)),o.polyline&&o.polyline.material){const f=o.polyline.material;f instanceof g.Color?this.originalWireColor=f.toCssColorString():this.originalWireColor="#ffffff",o.polyline.material=g.Color.YELLOW,this.selectedWireEntity=o}},n={width:this.wireCorridorWidth,show:this.showWireCorridor,measurementType:this.wireMeasurementType,onMeasurementResult:t};this.channelCalculation.loadWireListen(e,r.arcLine1A1,r.arcLine1B1,r.arcLine1C1,i,n)}setWireCorridorWidth(t){this.wireCorridorWidth=t}setShowWireCorridor(t){this.showWireCorridor=t}setWireMeasurementType(t){this.wireMeasurementType=t}async LineChannelTerrainVerification(t=[],e,r=100){const i=this.terrainConstruction.getLineInfo().corridor_features,n=this.terrainConstruction.getOffsetTrees(),o=this.lineConstruction.getAllWireSegments();let f=[],u=[],l=[];if(o.wireSegments1A1.length>0)o.wireSegments1A1.forEach(a=>{a&&a.length>0&&f.push(...a)}),o.wireSegments1B1.forEach(a=>{a&&a.length>0&&u.push(...a)}),o.wireSegments1C1.forEach(a=>{a&&a.length>0&&l.push(...a)}),console.log(`使用按塔段存储的导线数据: A相=${f.length}点, B相=${u.length}点, C相=${l.length}点`),await this.calculateClearanceBySegments(o);else{const a=this.lineConstruction.getWireDataForChannelCalculation();f=a.arcLine1A1,u=a.arcLine1B1,l=a.arcLine1C1,console.log(`使用整体导线数据: A相=${f.length}点, B相=${u.length}点, C相=${l.length}点`)}this.channelCalculation.LineChannelTerrainVerification(i,n,f,u,l,r,t,e)}async calculateClearanceBySegments(t){var i,n,o;console.log("========== 开始按塔段计算净空距离 ==========");const e=Math.max(t.wireSegments1A1.length,t.wireSegments1B1.length,t.wireSegments1C1.length);console.log(`塔段总数: ${e}`),console.log(`A相塔段数: ${t.wireSegments1A1.length}`),console.log(`B相塔段数: ${t.wireSegments1B1.length}`),console.log(`C相塔段数: ${t.wireSegments1C1.length}`);const r=[];if(t.wireSegments1A1.length>0&&((i=t.wireSegments1A1[0])==null?void 0:i.length)>0?(r.push({key:"A",data:t.wireSegments1A1}),console.log("A相数据有效,加入计算")):console.log("A相数据无效或为空"),t.wireSegments1B1.length>0&&((n=t.wireSegments1B1[0])==null?void 0:n.length)>0?(r.push({key:"B",data:t.wireSegments1B1}),console.log("B相数据有效,加入计算")):console.log("B相数据无效或为空"),t.wireSegments1C1.length>0&&((o=t.wireSegments1C1[0])==null?void 0:o.length)>0?(r.push({key:"C",data:t.wireSegments1C1}),console.log("C相数据有效,加入计算")):console.log("C相数据无效或为空"),console.log(`有效相数: ${r.length} (${r.map(f=>f.key).join(", ")})`),r.length===0){console.log("没有有效相数据,跳过净空距离计算");return}for(let f=0;f<e;f++){console.log(`
6
6
  --- 处理塔段 ${f} ---`);for(const u of r){const l=u.data[f];if(!l){console.log(`${u.key}相 塔段${f} 数据为空,跳过`);continue}if(l.length<2){console.log(`${u.key}相 塔段${f} 点数不足(${l.length}点),跳过`);continue}console.log(`${u.key}相 塔段${f}: ${l.length}个点,开始计算净空距离`);try{await this.channelCalculation.calculateAndDrawWireToGroundDistanceByType(l,[ue.线间距离测量]),console.log(`${u.key}相 塔段${f} 净空距离计算完成`)}catch(a){console.error(`${u.key}相 塔段${f} 净空距离计算失败:`,a)}}}console.log(`
7
- ========== 按塔段净空距离计算完成 ==========`)}LineChannelTerrainVerificationByTowerRange(t,e,r,i=100,n=2e3,o=!1,f=!0,u=[],l=1,a="ABC"){debugger;const c=this.LineInfo.towers;let p=-1,d=-1;for(let Y=0;Y<c.length;Y++)(c[Y].id==t||c[Y].name==t)&&(p=Y),(c[Y].id==e||c[Y].name==e)&&(d=Y);if(p===-1||d===-1){console.warn("未找到指定的杆塔范围,使用全部线路进行校验");return}p>d&&([p,d]=[d,p]);const h=this.lineConstruction.getAllWireSegments();console.log(`获取到的导线数据: 回路1-A相${h.wireSegments1A1.length}段, B相${h.wireSegments1B1.length}段, C相${h.wireSegments1C1.length}段; 回路2-A相${h.wireSegments2A1.length}段, B相${h.wireSegments2B1.length}段, C相${h.wireSegments2C1.length}段`),console.log(`杆塔索引范围: ${p} - ${d}`);let m=h.wireSegments1A1,_=h.wireSegments1B1,W=h.wireSegments1C1,C=[],T=[],L=[];(l===0||l===2)&&(C=h.wireSegments2A1,T=h.wireSegments2B1,L=h.wireSegments2C1);const w=[],D=[],b=[],B=[],R=[],x=[];for(let Y=p;Y<d;Y++)console.log(`检查塔段索引${Y}: 回路1-A相存在=${!!m[Y]}, B相存在=${!!_[Y]}, C相存在=${!!W[Y]}; 回路2-A相存在=${!!C[Y]}, B相存在=${!!T[Y]}, C相存在=${!!L[Y]}`),(l===0||l===1)&&(m[Y]&&w.push(m[Y]),_[Y]&&D.push(_[Y]),W[Y]&&b.push(W[Y])),(l===0||l===2)&&(C[Y]&&B.push(C[Y]),T[Y]&&R.push(T[Y]),L[Y]&&x.push(L[Y]));console.log(`塔段范围 ${p}-${d}: 回路1-A相${w.length}段, B相${D.length}段, C相${b.length}段; 回路2-A相${B.length}段, B相${R.length}段, C相${x.length}段`);const M=[],q=[],Z=[],O=[],X=[],K=[];for(let Y=0;Y<w.length;Y++)M.push(...w[Y]);for(let Y=0;Y<D.length;Y++)q.push(...D[Y]);for(let Y=0;Y<b.length;Y++)Z.push(...b[Y]);for(let Y=0;Y<B.length;Y++)O.push(...B[Y]);for(let Y=0;Y<R.length;Y++)X.push(...R[Y]);for(let Y=0;Y<x.length;Y++)K.push(...x[Y]);a==="A"?(q.splice(0),Z.splice(0),X.splice(0),K.splice(0)):a==="B"?(M.splice(0),Z.splice(0),O.splice(0),K.splice(0)):a==="C"?(M.splice(0),q.splice(0),O.splice(0),X.splice(0)):a==="AB"?(Z.splice(0),K.splice(0)):a==="AC"?(q.splice(0),X.splice(0)):a==="BC"&&(M.splice(0),O.splice(0)),console.log(`导线数据状态(回路${l},相序${a}): 回路1-A相=${M.length}, B相=${q.length}, C相=${Z.length}; 回路2-A相=${O.length}, B相=${X.length}, C相=${K.length}`);const et=this.terrainConstruction.getLineInfo().corridor_features,st=this.terrainConstruction.getOffsetTrees();console.log(`总树木数量: ${et.length}`);const ut=c.slice(p,d+1),ii=Gu(et,ut,n);console.log(`通道内树木数量: ${ii.length}`);const ze=[],Ot=new Map;if(et.forEach((Y,es)=>{Ot.set(Y,es)}),ii.forEach(Y=>{const es=Ot.get(Y);es!==void 0&&ze.push(st[es])}),o){const Y=Xu(ut,n);if(Y.length>0){this.channelCalculation.drawCorridorPolygon(Y,`corridor-${t}-${e}`);const es=ut.map(Ae=>[Ae.Longitude,Ae.Latitude]);this.channelCalculation.drawCorridorDistanceMarkers(es,n,`corridor-${t}-${e}`,f)}}else this.channelCalculation.clearCorridorPolygon(),this.channelCalculation.clearCorridorDistanceMarkers();if(ii.length===0){console.warn("指定杆塔范围的通道内没有找到树木"),r&&r([]);return}const ri=M.length>0||q.length>0||Z.length>0,er=O.length>0||X.length>0||K.length>0;if(!ri&&!er){console.error("过滤后的导线数据为空,无法进行测量"),r&&r([]);return}console.log(`开始对${ii.length}棵树进行测量...`);let Fi=[...M],Ft=[...q],ye=[...Z];(l===0||l===2)&&er&&(Fi.push(...O),Ft.push(...X),ye.push(...K)),this.channelCalculation.LineChannelTerrainVerificationForFilteredTrees(ii,ze,Fi,Ft,ye,i,u,Y=>{if(u.includes(ue.净空距离)){if(l===0||l===1)for(let Ae=0;Ae<w.length;Ae++){const is=p+Ae,sn=is+1,Mo=w[Ae]||[],Bo=D[Ae]||[],Oo=b[Ae]||[];let xi=[...Mo],ki=[...Bo],Vi=[...Oo];a==="A"?(ki=[],Vi=[]):a==="B"?(xi=[],Vi=[]):a==="C"?(xi=[],ki=[]):a==="AB"?Vi=[]:a==="AC"?ki=[]:a==="BC"&&(xi=[]),console.log(`计算塔段 ${is}-${sn} (回路1) 的净空距离: A相=${xi.length}, B相=${ki.length}, C相=${Vi.length}`),this.channelCalculation.calculateAndDrawWireToGroundDistanceBySegments(xi,ki,Vi,u).catch(Fo=>{console.error(`Error calculating wire to ground distance for segment ${is}-${sn} (circuit 1):`,Fo)})}if((l===0||l===2)&&er)for(let Ae=0;Ae<B.length;Ae++){const is=p+Ae,sn=is+1,Mo=B[Ae]||[],Bo=R[Ae]||[],Oo=x[Ae]||[];let xi=[...Mo],ki=[...Bo],Vi=[...Oo];a==="A"?(ki=[],Vi=[]):a==="B"?(xi=[],Vi=[]):a==="C"?(xi=[],ki=[]):a==="AB"?Vi=[]:a==="AC"?ki=[]:a==="BC"&&(xi=[]),console.log(`计算塔段 ${is}-${sn} (回路2) 的净空距离: A相=${xi.length}, B相=${ki.length}, C相=${Vi.length}`),this.channelCalculation.calculateAndDrawWireToGroundDistanceBySegments(xi,ki,Vi,u).catch(Fo=>{console.error(`Error calculating wire to ground distance for segment ${is}-${sn} (circuit 2):`,Fo)})}}r&&r(Y)})}stopLineChannelTerrainVerification(){this.channelCalculation.stopLineChannelTerrainVerification()}enableVisibleAreaTerrainVerification(){const t=this.terrainConstruction.getLineInfo().corridor_features,e=this.terrainConstruction.getOffsetTrees(),r=this.lineConstruction.getWireDataForChannelCalculation();this.channelCalculation.enableVisibleAreaTerrainVerification(t,e,r.arcLine1A1,r.arcLine1B1,r.arcLine1C1)}disableVisibleAreaTerrainVerification(){this.channelCalculation.disableVisibleAreaTerrainVerification()}setMaxVisibleTerrainResults(t=200){this.channelCalculation.setMaxVisibleTerrainResults(t)}setDistanceRuleConfig(t){this.channelCalculation.setDistanceRuleConfig(t)}getDistanceRuleConfig(){return this.channelCalculation.getDistanceRuleConfig()}clearTreeDistanceResults(){this.channelCalculation.clearTreeDistanceResults()}clearCorridorDisplay(){try{this.channelCalculation.clearCorridorPolygon(),this.channelCalculation.clearCorridorDistanceMarkers()}catch(t){console.warn("Error clearing corridor display:",t)}}getLineInfo(){return this.LineInfo}getViewer(){return this.viewer}getContourConfig(){return this.contourConstruction.getContourConfig()}setContourConfig(t){this.contourConstruction.setContourConfig(t)}setContourCorridorWidthKm(t){this.contourConstruction.setCorridorWidthKm(t)}setContourInterval(t){this.contourConstruction.setContourInterval(t)}setContourInterpolationPrecision(t){this.contourConstruction.setInterpolationPrecision(t)}async getAndDrawContours(t){return this.contourConstruction.getAndDrawContours(this.LineInfo,t)}async getContourData(t){return this.contourConstruction.getContourData(this.LineInfo,t)}async getCorridorGridData(t){return this.contourConstruction.getCorridorGridData(this.LineInfo,t)}clearContours(){this.contourConstruction.clearContours()}async getAndDrawMountains(t,e){return this.contourConstruction.getAndDrawMountains(this.LineInfo,t,e)}async getMountainData(t,e){return this.contourConstruction.getMountainData(this.LineInfo,t,e)}clearMountains(){this.contourConstruction.clearMountains()}drawLinePath(t="#ff0000",e=3,r=!1){if(this.clearLinePath(),!this.LineInfo||!this.LineInfo.towers||this.LineInfo.towers.length<2){console.warn("无法绘制路径:杆塔数据不足");return}const i=this.LineInfo.towers,n=i.map(f=>g.Cartesian3.fromDegrees(f.Longitude,f.Latitude,f.Altitude)),o=this.viewer.entities.add({name:"LinePath",polyline:{positions:n,width:e,material:g.Color.fromCssColorString(t),clampToGround:r}});this.pathEntities.push(o),console.log(`线路路径绘制完成: ${i.length} 个杆塔点`)}clearLinePath(){this.pathEntities.forEach(t=>{try{this.viewer.entities.remove(t)}catch(e){console.warn("Error removing path entity:",e)}}),this.pathEntities=[]}async generateCrossSection(t,e){return this.contourConstruction.generateCrossSection(t,e||{})}async generateLongSection(t){return this.contourConstruction.generateLongSection(t||{})}calculateCrossSectionLine(t,e){return this.contourConstruction.calculateCrossSectionLine(t,e)}async generateCrossSectionWithFeatures(t,e,r){return this.contourConstruction.generateCrossSectionWithFeatures(t,e,r)}setLineInfoForContour(t){this.contourConstruction.setLineInfo(t)}setWireToWireDistanceRuleConfig(t){this.channelCalculation.setWireToWireDistanceRuleConfig(t)}getWireToWireDistanceRuleConfig(){return this.channelCalculation.getWireToWireDistanceRuleConfig()}createDefaultWireToWireDistanceRuleConfig(){return this.channelCalculation.createDefaultWireToWireDistanceRuleConfig()}enableWireToWireMeasurement(t){const e=this.lineConstruction.getWireDataForChannelCalculation(),r=(n,o)=>{const f=n.scene.pick(o);if(g.defined(f)){let u=f.id;if(u===void 0&&f.primitive&&(u=f.primitive.id),u instanceof g.Entity)return u}},i=new g.ScreenSpaceEventHandler(this.viewer.canvas);i.setInputAction(n=>{const o=r(this.viewer,n.position);if(o&&o.id){const f=String(o.id),u=o.name||"";if(f.includes("daoxian")||u.includes("导线")||u.includes("daoxian")||f.includes("dixian")||u.includes("地线")||u.includes("ground")){let a=[],c=xt.A相;if(o.polyline&&o.polyline.positions){const p=o.polyline.positions.getValue(this.viewer.clock.currentTime);p&&Array.isArray(p)&&(a=p.map(d=>{const h=g.Cartographic.fromCartesian(d);return[g.Math.toDegrees(h.longitude),g.Math.toDegrees(h.latitude),h.height]}))}if(u.includes("A相")||u.includes("_A相")||u.includes("_A")&&!u.includes("_A相")?c=xt.A相:u.includes("B相")||u.includes("_B相")||u.includes("_B")&&!u.includes("_B相")?c=xt.B相:u.includes("C相")||u.includes("_C相")||u.includes("_C")&&!u.includes("_C相")?c=xt.C相:u.includes("地线1")||u.includes("dixian1")||u.includes("ground1")||u.includes("GD1")?c=xt.地线1:u.includes("地线2")||u.includes("dixian2")||u.includes("ground2")||u.includes("GD2")?c=xt.地线2:(u.includes("地线")||u.includes("dixian")||u.includes("ground")||u.includes("GD"))&&(c=xt.地线1),a.length===0&&(c===xt.A相?a=e.arcLine1A1:c===xt.B相?a=e.arcLine1B1:c===xt.C相&&(a=e.arcLine1C1)),this.selectedWire1Entity&&this.originalWire1Color)try{this.selectedWire1Entity.polyline&&(this.selectedWire1Entity.polyline.material=g.Color.fromCssColorString(this.originalWire1Color))}catch(p){console.warn("Error restoring wire color:",p)}if(this.selectedWire1Entity)if(this.selectedWire1Entity!==o){const p=this.channelCalculation.calculateWireToWireDistance(this.selectedWire1Data,a,this.selectedWire1Phase,c);this.channelCalculation.drawWireToWireDistance(p),t&&t(p),this.selectedWire1Entity=null,this.selectedWire1Data=[],this.selectedWire1Phase=xt.A相,this.originalWire1Color=null,console.log(`导线间距测量完成: ${p.straightLineDistance.toFixed(2)}米`)}else this.selectedWire1Entity=null,this.selectedWire1Data=[],this.selectedWire1Phase=xt.A相,this.originalWire1Color=null,console.log("已取消选择导线");else{if(this.selectedWire1Entity=o,this.selectedWire1Data=a,this.selectedWire1Phase=c,o.polyline&&o.polyline.material){const p=o.polyline.material;p instanceof g.Color?this.originalWire1Color=p.toCssColorString():this.originalWire1Color="#ffffff",o.polyline.material=g.Color.YELLOW}console.log(`已选中第一根导线: ${["A相","B相","C相","地线1","地线2","全部"][c]}`)}}}},g.ScreenSpaceEventType.LEFT_CLICK),window.wireToWireHandler=i}disableWireToWireMeasurement(){if(this.selectedWire1Entity&&this.originalWire1Color)try{this.selectedWire1Entity.polyline&&(this.selectedWire1Entity.polyline.material=g.Color.fromCssColorString(this.originalWire1Color))}catch(e){console.warn("Error restoring wire color:",e)}this.selectedWire1Entity=null,this.selectedWire1Data=[],this.selectedWire1Phase=xt.A相,this.originalWire1Color=null;const t=window.wireToWireHandler;t&&(t.destroy(),window.wireToWireHandler=null)}clearWireToWireMeasurementResults(){if(this.channelCalculation){const t=this.channelCalculation.entityCollectionplotting;if(t){const e=[];t.values.forEach(r=>{r.name&&r.name.startsWith("线间距离")&&e.push(r)}),e.forEach(r=>{try{t.remove(r)}catch(i){console.warn("Error removing wire to wire measurement entity:",i)}})}}}}class dh{constructor(){I(this,"id","");I(this,"name","");I(this,"towerFZinfo","");I(this,"towerDisFile","");I(this,"stressFileContent","");I(this,"streesistrue",0);I(this,"TowerMemberColor","#FFFFFF");I(this,"TowerMembersWidth",2);I(this,"Longitude",0);I(this,"Latitude",0);I(this,"Altitude",0);I(this,"RollX",0);I(this,"RollY",90);I(this,"RollZ",0)}}function mh(s){debugger;const t=s.split(`
7
+ ========== 按塔段净空距离计算完成 ==========`)}LineChannelTerrainVerificationByTowerRange(t,e,r,i=100,n=2e3,o=!1,f=!0,u=[],l=0,a="ABC"){debugger;const c=this.LineInfo.towers;let p=-1,d=-1;for(let Y=0;Y<c.length;Y++)(c[Y].id==t||c[Y].name==t)&&(p=Y),(c[Y].id==e||c[Y].name==e)&&(d=Y);if(p===-1||d===-1){console.warn("未找到指定的杆塔范围,使用全部线路进行校验");return}p>d&&([p,d]=[d,p]);const h=this.lineConstruction.getAllWireSegments();console.log(`获取到的导线数据: 回路1-A相${h.wireSegments1A1.length}段, B相${h.wireSegments1B1.length}段, C相${h.wireSegments1C1.length}段; 回路2-A相${h.wireSegments2A1.length}段, B相${h.wireSegments2B1.length}段, C相${h.wireSegments2C1.length}段`),console.log(`杆塔索引范围: ${p} - ${d}`);let m=h.wireSegments1A1,_=h.wireSegments1B1,W=h.wireSegments1C1,C=[],T=[],L=[];(l===0||l===2)&&(C=h.wireSegments2A1,T=h.wireSegments2B1,L=h.wireSegments2C1);const w=[],D=[],b=[],B=[],R=[],x=[];for(let Y=p;Y<d;Y++)console.log(`检查塔段索引${Y}: 回路1-A相存在=${!!m[Y]}, B相存在=${!!_[Y]}, C相存在=${!!W[Y]}; 回路2-A相存在=${!!C[Y]}, B相存在=${!!T[Y]}, C相存在=${!!L[Y]}`),(l===0||l===1)&&(m[Y]&&w.push(m[Y]),_[Y]&&D.push(_[Y]),W[Y]&&b.push(W[Y])),(l===0||l===2)&&(C[Y]&&B.push(C[Y]),T[Y]&&R.push(T[Y]),L[Y]&&x.push(L[Y]));console.log(`塔段范围 ${p}-${d}: 回路1-A相${w.length}段, B相${D.length}段, C相${b.length}段; 回路2-A相${B.length}段, B相${R.length}段, C相${x.length}段`);const M=[],q=[],Z=[],O=[],X=[],K=[];for(let Y=0;Y<w.length;Y++)M.push(...w[Y]);for(let Y=0;Y<D.length;Y++)q.push(...D[Y]);for(let Y=0;Y<b.length;Y++)Z.push(...b[Y]);for(let Y=0;Y<B.length;Y++)O.push(...B[Y]);for(let Y=0;Y<R.length;Y++)X.push(...R[Y]);for(let Y=0;Y<x.length;Y++)K.push(...x[Y]);a==="A"?(q.splice(0),Z.splice(0),X.splice(0),K.splice(0)):a==="B"?(M.splice(0),Z.splice(0),O.splice(0),K.splice(0)):a==="C"?(M.splice(0),q.splice(0),O.splice(0),X.splice(0)):a==="AB"?(Z.splice(0),K.splice(0)):a==="AC"?(q.splice(0),X.splice(0)):a==="BC"&&(M.splice(0),O.splice(0)),console.log(`导线数据状态(回路${l},相序${a}): 回路1-A相=${M.length}, B相=${q.length}, C相=${Z.length}; 回路2-A相=${O.length}, B相=${X.length}, C相=${K.length}`);const et=this.terrainConstruction.getLineInfo().corridor_features,st=this.terrainConstruction.getOffsetTrees();console.log(`总树木数量: ${et.length}`);const ut=c.slice(p,d+1),ii=Gu(et,ut,n);console.log(`通道内树木数量: ${ii.length}`);const ze=[],Ot=new Map;if(et.forEach((Y,es)=>{Ot.set(Y,es)}),ii.forEach(Y=>{const es=Ot.get(Y);es!==void 0&&ze.push(st[es])}),o){const Y=Xu(ut,n);if(Y.length>0){this.channelCalculation.drawCorridorPolygon(Y,`corridor-${t}-${e}`);const es=ut.map(Ae=>[Ae.Longitude,Ae.Latitude]);this.channelCalculation.drawCorridorDistanceMarkers(es,n,`corridor-${t}-${e}`,f)}}else this.channelCalculation.clearCorridorPolygon(),this.channelCalculation.clearCorridorDistanceMarkers();if(ii.length===0){console.warn("指定杆塔范围的通道内没有找到树木"),r&&r([]);return}const ri=M.length>0||q.length>0||Z.length>0,er=O.length>0||X.length>0||K.length>0;if(!ri&&!er){console.error("过滤后的导线数据为空,无法进行测量"),r&&r([]);return}console.log(`开始对${ii.length}棵树进行测量...`);let Fi=[...M],Ft=[...q],ye=[...Z];(l===0||l===2)&&er&&(Fi.push(...O),Ft.push(...X),ye.push(...K)),this.channelCalculation.LineChannelTerrainVerificationForFilteredTrees(ii,ze,Fi,Ft,ye,i,u,Y=>{if(u.includes(ue.净空距离)){if(l===0||l===1)for(let Ae=0;Ae<w.length;Ae++){const is=p+Ae,sn=is+1,Mo=w[Ae]||[],Bo=D[Ae]||[],Oo=b[Ae]||[];let xi=[...Mo],ki=[...Bo],Vi=[...Oo];a==="A"?(ki=[],Vi=[]):a==="B"?(xi=[],Vi=[]):a==="C"?(xi=[],ki=[]):a==="AB"?Vi=[]:a==="AC"?ki=[]:a==="BC"&&(xi=[]),console.log(`计算塔段 ${is}-${sn} (回路1) 的净空距离: A相=${xi.length}, B相=${ki.length}, C相=${Vi.length}`),this.channelCalculation.calculateAndDrawWireToGroundDistanceBySegments(xi,ki,Vi,u).catch(Fo=>{console.error(`Error calculating wire to ground distance for segment ${is}-${sn} (circuit 1):`,Fo)})}if((l===0||l===2)&&er)for(let Ae=0;Ae<B.length;Ae++){const is=p+Ae,sn=is+1,Mo=B[Ae]||[],Bo=R[Ae]||[],Oo=x[Ae]||[];let xi=[...Mo],ki=[...Bo],Vi=[...Oo];a==="A"?(ki=[],Vi=[]):a==="B"?(xi=[],Vi=[]):a==="C"?(xi=[],ki=[]):a==="AB"?Vi=[]:a==="AC"?ki=[]:a==="BC"&&(xi=[]),console.log(`计算塔段 ${is}-${sn} (回路2) 的净空距离: A相=${xi.length}, B相=${ki.length}, C相=${Vi.length}`),this.channelCalculation.calculateAndDrawWireToGroundDistanceBySegments(xi,ki,Vi,u).catch(Fo=>{console.error(`Error calculating wire to ground distance for segment ${is}-${sn} (circuit 2):`,Fo)})}}r&&r(Y)})}stopLineChannelTerrainVerification(){this.channelCalculation.stopLineChannelTerrainVerification()}enableVisibleAreaTerrainVerification(){const t=this.terrainConstruction.getLineInfo().corridor_features,e=this.terrainConstruction.getOffsetTrees(),r=this.lineConstruction.getWireDataForChannelCalculation();this.channelCalculation.enableVisibleAreaTerrainVerification(t,e,r.arcLine1A1,r.arcLine1B1,r.arcLine1C1)}disableVisibleAreaTerrainVerification(){this.channelCalculation.disableVisibleAreaTerrainVerification()}setMaxVisibleTerrainResults(t=200){this.channelCalculation.setMaxVisibleTerrainResults(t)}setDistanceRuleConfig(t){this.channelCalculation.setDistanceRuleConfig(t)}getDistanceRuleConfig(){return this.channelCalculation.getDistanceRuleConfig()}clearTreeDistanceResults(){this.channelCalculation.clearTreeDistanceResults()}clearCorridorDisplay(){try{this.channelCalculation.clearCorridorPolygon(),this.channelCalculation.clearCorridorDistanceMarkers()}catch(t){console.warn("Error clearing corridor display:",t)}}getLineInfo(){return this.LineInfo}getViewer(){return this.viewer}getContourConfig(){return this.contourConstruction.getContourConfig()}setContourConfig(t){this.contourConstruction.setContourConfig(t)}setContourCorridorWidthKm(t){this.contourConstruction.setCorridorWidthKm(t)}setContourInterval(t){this.contourConstruction.setContourInterval(t)}setContourInterpolationPrecision(t){this.contourConstruction.setInterpolationPrecision(t)}async getAndDrawContours(t){return this.contourConstruction.getAndDrawContours(this.LineInfo,t)}async getContourData(t){return this.contourConstruction.getContourData(this.LineInfo,t)}async getCorridorGridData(t){return this.contourConstruction.getCorridorGridData(this.LineInfo,t)}clearContours(){this.contourConstruction.clearContours()}async getAndDrawMountains(t,e){return this.contourConstruction.getAndDrawMountains(this.LineInfo,t,e)}async getMountainData(t,e){return this.contourConstruction.getMountainData(this.LineInfo,t,e)}clearMountains(){this.contourConstruction.clearMountains()}drawLinePath(t="#ff0000",e=3,r=!1){if(this.clearLinePath(),!this.LineInfo||!this.LineInfo.towers||this.LineInfo.towers.length<2){console.warn("无法绘制路径:杆塔数据不足");return}const i=this.LineInfo.towers,n=i.map(f=>g.Cartesian3.fromDegrees(f.Longitude,f.Latitude,f.Altitude)),o=this.viewer.entities.add({name:"LinePath",polyline:{positions:n,width:e,material:g.Color.fromCssColorString(t),clampToGround:r}});this.pathEntities.push(o),console.log(`线路路径绘制完成: ${i.length} 个杆塔点`)}clearLinePath(){this.pathEntities.forEach(t=>{try{this.viewer.entities.remove(t)}catch(e){console.warn("Error removing path entity:",e)}}),this.pathEntities=[]}async generateCrossSection(t,e){return this.contourConstruction.generateCrossSection(t,e||{})}async generateLongSection(t){return this.contourConstruction.generateLongSection(t||{})}calculateCrossSectionLine(t,e){return this.contourConstruction.calculateCrossSectionLine(t,e)}async generateCrossSectionWithFeatures(t,e,r){return this.contourConstruction.generateCrossSectionWithFeatures(t,e,r)}setLineInfoForContour(t){this.contourConstruction.setLineInfo(t)}setWireToWireDistanceRuleConfig(t){this.channelCalculation.setWireToWireDistanceRuleConfig(t)}getWireToWireDistanceRuleConfig(){return this.channelCalculation.getWireToWireDistanceRuleConfig()}createDefaultWireToWireDistanceRuleConfig(){return this.channelCalculation.createDefaultWireToWireDistanceRuleConfig()}enableWireToWireMeasurement(t){const e=this.lineConstruction.getWireDataForChannelCalculation(),r=(n,o)=>{const f=n.scene.pick(o);if(g.defined(f)){let u=f.id;if(u===void 0&&f.primitive&&(u=f.primitive.id),u instanceof g.Entity)return u}},i=new g.ScreenSpaceEventHandler(this.viewer.canvas);i.setInputAction(n=>{const o=r(this.viewer,n.position);if(o&&o.id){const f=String(o.id),u=o.name||"";if(f.includes("daoxian")||u.includes("导线")||u.includes("daoxian")||f.includes("dixian")||u.includes("地线")||u.includes("ground")){let a=[],c=xt.A相;if(o.polyline&&o.polyline.positions){const p=o.polyline.positions.getValue(this.viewer.clock.currentTime);p&&Array.isArray(p)&&(a=p.map(d=>{const h=g.Cartographic.fromCartesian(d);return[g.Math.toDegrees(h.longitude),g.Math.toDegrees(h.latitude),h.height]}))}if(u.includes("A相")||u.includes("_A相")||u.includes("_A")&&!u.includes("_A相")?c=xt.A相:u.includes("B相")||u.includes("_B相")||u.includes("_B")&&!u.includes("_B相")?c=xt.B相:u.includes("C相")||u.includes("_C相")||u.includes("_C")&&!u.includes("_C相")?c=xt.C相:u.includes("地线1")||u.includes("dixian1")||u.includes("ground1")||u.includes("GD1")?c=xt.地线1:u.includes("地线2")||u.includes("dixian2")||u.includes("ground2")||u.includes("GD2")?c=xt.地线2:(u.includes("地线")||u.includes("dixian")||u.includes("ground")||u.includes("GD"))&&(c=xt.地线1),a.length===0&&(c===xt.A相?a=e.arcLine1A1:c===xt.B相?a=e.arcLine1B1:c===xt.C相&&(a=e.arcLine1C1)),this.selectedWire1Entity&&this.originalWire1Color)try{this.selectedWire1Entity.polyline&&(this.selectedWire1Entity.polyline.material=g.Color.fromCssColorString(this.originalWire1Color))}catch(p){console.warn("Error restoring wire color:",p)}if(this.selectedWire1Entity)if(this.selectedWire1Entity!==o){const p=this.channelCalculation.calculateWireToWireDistance(this.selectedWire1Data,a,this.selectedWire1Phase,c);this.channelCalculation.drawWireToWireDistance(p),t&&t(p),this.selectedWire1Entity=null,this.selectedWire1Data=[],this.selectedWire1Phase=xt.A相,this.originalWire1Color=null,console.log(`导线间距测量完成: ${p.straightLineDistance.toFixed(2)}米`)}else this.selectedWire1Entity=null,this.selectedWire1Data=[],this.selectedWire1Phase=xt.A相,this.originalWire1Color=null,console.log("已取消选择导线");else{if(this.selectedWire1Entity=o,this.selectedWire1Data=a,this.selectedWire1Phase=c,o.polyline&&o.polyline.material){const p=o.polyline.material;p instanceof g.Color?this.originalWire1Color=p.toCssColorString():this.originalWire1Color="#ffffff",o.polyline.material=g.Color.YELLOW}console.log(`已选中第一根导线: ${["A相","B相","C相","地线1","地线2","全部"][c]}`)}}}},g.ScreenSpaceEventType.LEFT_CLICK),window.wireToWireHandler=i}disableWireToWireMeasurement(){if(this.selectedWire1Entity&&this.originalWire1Color)try{this.selectedWire1Entity.polyline&&(this.selectedWire1Entity.polyline.material=g.Color.fromCssColorString(this.originalWire1Color))}catch(e){console.warn("Error restoring wire color:",e)}this.selectedWire1Entity=null,this.selectedWire1Data=[],this.selectedWire1Phase=xt.A相,this.originalWire1Color=null;const t=window.wireToWireHandler;t&&(t.destroy(),window.wireToWireHandler=null)}clearWireToWireMeasurementResults(){if(this.channelCalculation){const t=this.channelCalculation.entityCollectionplotting;if(t){const e=[];t.values.forEach(r=>{r.name&&r.name.startsWith("线间距离")&&e.push(r)}),e.forEach(r=>{try{t.remove(r)}catch(i){console.warn("Error removing wire to wire measurement entity:",i)}})}}}}class dh{constructor(){I(this,"id","");I(this,"name","");I(this,"towerFZinfo","");I(this,"towerDisFile","");I(this,"stressFileContent","");I(this,"streesistrue",0);I(this,"TowerMemberColor","#FFFFFF");I(this,"TowerMembersWidth",2);I(this,"Longitude",0);I(this,"Latitude",0);I(this,"Altitude",0);I(this,"RollX",0);I(this,"RollY",90);I(this,"RollZ",0)}}function mh(s){debugger;const t=s.split(`
8
8
  `),e=[],r=[],i=/^\s*(\d+)\s+([\d.-]+)\s+([\d.-]+)\s+([\d.-]+)\s+(-?\d+)/,n=/^\s*(\d+)\s+(\d+)\s+(\d+)\s*(?:#|$)/;for(const o of t){const f=o.trim();if(!f)continue;const u=f.match(i);if(u){e.push({id:parseInt(u[1]),x:parseFloat(u[2]),y:parseFloat(u[3]),z:parseFloat(u[4]),flag:parseInt(u[5])});continue}const l=f.match(n);l&&r.push({from:parseInt(l[1]),to:parseInt(l[2]),type:parseInt(l[3])})}return{TowerNodes:e,connections:r}}function yh(s){const t=s.split(`
9
9
  `),e=[];for(const r of t){if(!r.trim())continue;const i=r.trim().split(/\s+/).filter(f=>f!==""),n=parseInt(i[0]);if(isNaN(n))continue;const o=[];for(let f=1;f<i.length;f+=3){const u=parseFloat(i[f]),l=parseFloat(i[f+1]),a=parseFloat(i[f+2]);if(!isNaN(u)&&!isNaN(l)&&!isNaN(a)){const c=Math.floor((f-1)/3)+1;o.push({timeStep:c,x:u,y:l,z:a})}}e.push({nodeId:n,displacements:o})}return e}function cf(s){const t={};return s.forEach(e=>{e.displacements.forEach(r=>{t[r.timeStep]||(t[r.timeStep]=[]),t[r.timeStep].push({nodeId:e.nodeId,...r})})}),t}function vh(s){const t=s.split(`
10
10
  `),e=[];for(const i of t){if(!i.trim())continue;const n=i.match(/^\s*(\d+-\s*\d+)\s+((?:\d+\.\d+\s*)+)/);if(n){const o=n[1].replace(/\s+/g,""),f=n[2].trim().split(/\s+/).map(Number);e.push({elementId:o,stressRatios:f})}}const r=[];if(e.length>0){const i=e[0].stressRatios.length;for(let n=0;n<i;n++){const o={timeIndex:n,elements:[]};for(const f of e){let u;const l=f.stressRatios[n];l>1?u=Et.Color.RED:l>.95&&l<=1?u=Et.Color.PINK:l>.85&&l<=.95?u=Et.Color.YELLOW:l>.7&&l<=.85?u=Et.Color.GREEN:u=Et.Color.BLUE,o.elements.push({elementId:f.elementId,stressRatio:l,ylbColor:u})}r.push(o)}}return{byElement:e,byTime:r}}class pf{constructor(t){I(this,"viewer");I(this,"lines",[]);this.viewer=t}addLine(t,e){const r=mf(this.viewer,t,e);return this.lines.push(r),r}removeAll(){this.lines.forEach(t=>this.viewer.entities.remove(t)),this.lines=[]}}var gf={exports:{}};(function(s,t){(function(e,r){r()})(Ds,function(){function e(l,a){return typeof a>"u"?a={autoBom:!1}:typeof a!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),a={autoBom:!a}),a.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(l.type)?new Blob(["\uFEFF",l],{type:l.type}):l}function r(l,a,c){var p=new XMLHttpRequest;p.open("GET",l),p.responseType="blob",p.onload=function(){u(p.response,a,c)},p.onerror=function(){console.error("could not download file")},p.send()}function i(l){var a=new XMLHttpRequest;a.open("HEAD",l,!1);try{a.send()}catch{}return 200<=a.status&&299>=a.status}function n(l){try{l.dispatchEvent(new MouseEvent("click"))}catch{var a=document.createEvent("MouseEvents");a.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),l.dispatchEvent(a)}}var o=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof Ds=="object"&&Ds.global===Ds?Ds:void 0,f=o.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),u=o.saveAs||(typeof window!="object"||window!==o?function(){}:"download"in HTMLAnchorElement.prototype&&!f?function(l,a,c){var p=o.URL||o.webkitURL,d=document.createElement("a");a=a||l.name||"download",d.download=a,d.rel="noopener",typeof l=="string"?(d.href=l,d.origin===location.origin?n(d):i(d.href)?r(l,a,c):n(d,d.target="_blank")):(d.href=p.createObjectURL(l),setTimeout(function(){p.revokeObjectURL(d.href)},4e4),setTimeout(function(){n(d)},0))}:"msSaveOrOpenBlob"in navigator?function(l,a,c){if(a=a||l.name||"download",typeof l!="string")navigator.msSaveOrOpenBlob(e(l,c),a);else if(i(l))r(l,a,c);else{var p=document.createElement("a");p.href=l,p.target="_blank",setTimeout(function(){n(p)})}}:function(l,a,c,p){if(p=p||open("","_blank"),p&&(p.document.title=p.document.body.innerText="downloading..."),typeof l=="string")return r(l,a,c);var d=l.type==="application/octet-stream",h=/constructor/i.test(o.HTMLElement)||o.safari,m=/CriOS\/[\d]+/.test(navigator.userAgent);if((m||d&&h||f)&&typeof FileReader<"u"){var _=new FileReader;_.onloadend=function(){var T=_.result;T=m?T:T.replace(/^data:[^;]*;/,"data:attachment/file;"),p?p.location.href=T:location=T,p=null},_.readAsDataURL(l)}else{var W=o.URL||o.webkitURL,C=W.createObjectURL(l);p?p.location=C:location.href=C,p=null,setTimeout(function(){W.revokeObjectURL(C)},4e4)}});o.saveAs=u.saveAs=u,s.exports=u})})(gf);var Ro=gf.exports;const df=require("shp-write");class _h{constructor(t,e,r){I(this,"towerNodes",[]);I(this,"connections",[]);I(this,"towerFZS");this.towerNodes=t,this.connections=e,this.towerFZS=r}async exportTowerToSHP(){try{const t=await this.generatePointFeatures(),e=await this.generateLineFeatures();await this.generateSHPFiles(t,e),console.log("SHP文件导出成功")}catch(t){console.error("导出SHP文件失败:",t)}}async generatePointFeatures(){const t=[],e=new g.HeadingPitchRoll(g.Math.toRadians(this.towerFZS.RollX),this.towerFZS.RollY,this.towerFZS.RollZ),r=g.Cartesian3.fromDegrees(this.towerFZS.Longitude,this.towerFZS.Latitude,this.towerFZS.Altitude);for(const i of this.towerNodes){const n=new g.Cartesian3(i.x,i.y,i.z),o=this.getPositionByHprAndOffset(r,n,e),f=g.Ellipsoid.WGS84.cartesianToCartographic(o),u=g.Math.toDegrees(f.longitude),l=g.Math.toDegrees(f.latitude),a=f.height,c={type:"Feature",geometry:{type:"Point",coordinates:[u,l]},properties:{id:i.id,node_id:i.id,x:i.x,y:i.y,z:i.z,longitude:u,latitude:l,height:a,elevation:a,type:"tower_node"}};t.push(c)}return t}async generateLineFeatures(){const t=[],e=new g.HeadingPitchRoll(g.Math.toRadians(this.towerFZS.RollX),this.towerFZS.RollY,this.towerFZS.RollZ),r=g.Cartesian3.fromDegrees(this.towerFZS.Longitude,this.towerFZS.Latitude,this.towerFZS.Altitude);for(const i of this.connections){const n=this.towerNodes.find(L=>L.id===i.from),o=this.towerNodes.find(L=>L.id===i.to);if(!n||!o)continue;const f=new g.Cartesian3(n.x,n.y,n.z),u=new g.Cartesian3(o.x,o.y,o.z),l=this.getPositionByHprAndOffset(r,f,e),a=this.getPositionByHprAndOffset(r,u,e),c=g.Ellipsoid.WGS84.cartesianToCartographic(l),p=g.Ellipsoid.WGS84.cartesianToCartographic(a),d=g.Math.toDegrees(c.longitude),h=g.Math.toDegrees(c.latitude),m=c.height,_=g.Math.toDegrees(p.longitude),W=g.Math.toDegrees(p.latitude),C=p.height,T={type:"Feature",geometry:{type:"LineString",coordinates:[[d,h],[_,W]]},properties:{id:`${i.from}-${i.to}`,from_node:i.from,to_node:i.to,from_height:m,to_height:C,avg_height:(m+C)/2,length:this.calculateDistance(l,a),type:"tower_member",width:this.towerFZS.TowerMembersWidth,from_longitude:d,from_latitude:h,to_longitude:_,to_latitude:W}};t.push(T)}return t}async generateSHPFiles(t,e){try{if(t.length>0){const r={type:"FeatureCollection",features:t},i=df.point(r);this.downloadSHPFiles(i,"tower_nodes")}if(e.length>0){const r={type:"FeatureCollection",features:e},i=df.line(r);this.downloadSHPFiles(i,"tower_members")}}catch(r){console.error("生成SHP文件时出错:",r),await this.alternativeExport(t,e)}}downloadSHPFiles(t,e){const r=new Blob([t],{type:"application/zip"});Ro.saveAs(r,`${e}.zip`)}async alternativeExport(t,e){if(console.log("使用备用方案导出为GeoJSON格式"),t.length>0){const r={type:"FeatureCollection",features:t};this.downloadJSON(r,"tower_nodes.geojson")}if(e.length>0){const r={type:"FeatureCollection",features:e};this.downloadJSON(r,"tower_members.geojson")}}downloadJSON(t,e){const r=new Blob([JSON.stringify(t,null,2)],{type:"application/json"});Ro.saveAs(r,e)}calculateDistance(t,e){return g.Cartesian3.distance(t,e)}getPositionByHprAndOffset(t,e,r){const i=g.Transforms.headingPitchRollToFixedFrame(t,r);return g.Matrix4.multiplyByPoint(i,e,new g.Cartesian3)}}class Ch{static async exportToCSV(t,e,r){const i=this.exportNodesToCSV(t,r);this.downloadCSV(i,"tower_nodes.csv");const n=this.exportConnectionsToCSV(e,t,r);this.downloadCSV(n,"tower_connections.csv")}static exportNodesToCSV(t,e){let r=`ID,X,Y,Z,Longitude,Latitude,Height
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ow-eengine-power",
3
- "version": "2.7.4",
3
+ "version": "2.8.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "files": [