@arcgis/core 4.33.0-next.20250422 → 4.33.0-next.20250423

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.
Files changed (152) hide show
  1. package/arcade/geometry/constructors.js +1 -1
  2. package/assets/components/assets/icon/mosaicMethodBlend16.json +1 -0
  3. package/assets/components/assets/icon/mosaicMethodBlend24.json +1 -0
  4. package/assets/components/assets/icon/mosaicMethodBlend32.json +1 -0
  5. package/assets/components/assets/icon/mosaicMethodByAttribute16.json +1 -0
  6. package/assets/components/assets/icon/mosaicMethodByAttribute24.json +1 -0
  7. package/assets/components/assets/icon/mosaicMethodByAttribute32.json +1 -0
  8. package/assets/components/assets/icon/mosaicMethodClosestToCenter16.json +1 -0
  9. package/assets/components/assets/icon/mosaicMethodClosestToCenter24.json +1 -0
  10. package/assets/components/assets/icon/mosaicMethodClosestToCenter32.json +1 -0
  11. package/assets/components/assets/icon/mosaicMethodClosestToNadir16.json +1 -0
  12. package/assets/components/assets/icon/mosaicMethodClosestToNadir24.json +1 -0
  13. package/assets/components/assets/icon/mosaicMethodClosestToNadir32.json +1 -0
  14. package/assets/components/assets/icon/mosaicMethodFirst16.json +1 -0
  15. package/assets/components/assets/icon/mosaicMethodFirst24.json +1 -0
  16. package/assets/components/assets/icon/mosaicMethodFirst32.json +1 -0
  17. package/assets/components/assets/icon/mosaicMethodLast16.json +1 -0
  18. package/assets/components/assets/icon/mosaicMethodLast24.json +1 -0
  19. package/assets/components/assets/icon/mosaicMethodLast32.json +1 -0
  20. package/assets/components/assets/icon/mosaicMethodLockRaster16.json +1 -0
  21. package/assets/components/assets/icon/mosaicMethodLockRaster24.json +1 -0
  22. package/assets/components/assets/icon/mosaicMethodLockRaster32.json +1 -0
  23. package/assets/components/assets/icon/mosaicMethodMaximum16.json +1 -0
  24. package/assets/components/assets/icon/mosaicMethodMaximum24.json +1 -0
  25. package/assets/components/assets/icon/mosaicMethodMaximum32.json +1 -0
  26. package/assets/components/assets/icon/mosaicMethodMean16.json +1 -0
  27. package/assets/components/assets/icon/mosaicMethodMean24.json +1 -0
  28. package/assets/components/assets/icon/mosaicMethodMean32.json +1 -0
  29. package/assets/components/assets/icon/mosaicMethodMinimum16.json +1 -0
  30. package/assets/components/assets/icon/mosaicMethodMinimum24.json +1 -0
  31. package/assets/components/assets/icon/mosaicMethodMinimum32.json +1 -0
  32. package/assets/components/assets/icon/mosaicMethodNone16.json +1 -0
  33. package/assets/components/assets/icon/mosaicMethodNone24.json +1 -0
  34. package/assets/components/assets/icon/mosaicMethodNone32.json +1 -0
  35. package/assets/components/assets/icon/mosaicMethodNorthWest16.json +1 -0
  36. package/assets/components/assets/icon/mosaicMethodNorthWest24.json +1 -0
  37. package/assets/components/assets/icon/mosaicMethodNorthWest32.json +1 -0
  38. package/assets/components/assets/icon/mosaicMethodSeamline16.json +1 -0
  39. package/assets/components/assets/icon/mosaicMethodSeamline24.json +1 -0
  40. package/assets/components/assets/icon/mosaicMethodSeamline32.json +1 -0
  41. package/assets/components/assets/icon/mosaicMethodSum16.json +1 -0
  42. package/assets/components/assets/icon/mosaicMethodSum24.json +1 -0
  43. package/assets/components/assets/icon/mosaicMethodSum32.json +1 -0
  44. package/assets/esri/core/workers/RemoteClient.js +1 -1
  45. package/assets/esri/core/workers/chunks/{b2f9f0767dadf185120c.js → 00612d6e05b1c8647668.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{f54546c155fba2fd3a7e.js → 05d7d8ff3e4cbad32580.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{b1e275607d9754079f60.js → 079434fe765c53d304f2.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{0eed612e82a279ac8d1e.js → 11b55e7e76e50fe11bbe.js} +1 -1
  49. package/assets/esri/core/workers/chunks/235efd948ae470a6f238.js +1 -0
  50. package/assets/esri/core/workers/chunks/{0c6f2808c57ff820bfdd.js → 30551c1d3e4fa7be86c1.js} +2 -2
  51. package/assets/esri/core/workers/chunks/{0c6f2808c57ff820bfdd.js.LICENSE.txt → 30551c1d3e4fa7be86c1.js.LICENSE.txt} +1 -1
  52. package/assets/esri/core/workers/chunks/{78242f2bf742b33d99fa.js → 3795793643f4db64af0e.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{38f9ede26098eb03ca2d.js → 3cf001abca8ad933bccf.js} +2 -2
  54. package/assets/esri/core/workers/chunks/{38f9ede26098eb03ca2d.js.LICENSE.txt → 3cf001abca8ad933bccf.js.LICENSE.txt} +1 -1
  55. package/assets/esri/core/workers/chunks/{dbaa4b8d37aab40d7bd1.js → 543eb46b55cacd6e1dbc.js} +2 -2
  56. package/assets/esri/core/workers/chunks/{dbaa4b8d37aab40d7bd1.js.LICENSE.txt → 543eb46b55cacd6e1dbc.js.LICENSE.txt} +1 -1
  57. package/assets/esri/core/workers/chunks/{93f792f5b94f3745b57d.js → 577f24923fa4d08360e4.js} +2 -2
  58. package/assets/esri/core/workers/chunks/{93f792f5b94f3745b57d.js.LICENSE.txt → 577f24923fa4d08360e4.js.LICENSE.txt} +1 -1
  59. package/assets/esri/core/workers/chunks/{f46c4a69ef2f763e905b.js → 5d63dfa5a60c88e03b28.js} +1 -1
  60. package/assets/esri/core/workers/chunks/7bfa18dd8771d4932533.js +1 -0
  61. package/assets/esri/core/workers/chunks/{96cddbbeef61a4f33f29.js → 7c42281188b874ffcdad.js} +1 -1
  62. package/assets/esri/core/workers/chunks/8dd26b12c625d20196ed.js +319 -0
  63. package/assets/esri/core/workers/chunks/{736a11e64e5f03e3936b.js → 9408a72968cbd985dd24.js} +53 -53
  64. package/assets/esri/core/workers/chunks/{c2f38c66fae2cdb57445.js → 96e5d192c8d23c1e324f.js} +1 -1
  65. package/assets/esri/core/workers/chunks/{796cf1c2ca9955595836.js → 9b2ab27159500315fbc1.js} +1 -1
  66. package/assets/esri/core/workers/chunks/a79511b926a2830bb160.js +1 -0
  67. package/assets/esri/core/workers/chunks/{814d72abbfdd4552e4ec.js → ac9c6779771ec855da79.js} +2 -2
  68. package/assets/esri/core/workers/chunks/{814d72abbfdd4552e4ec.js.LICENSE.txt → ac9c6779771ec855da79.js.LICENSE.txt} +1 -1
  69. package/assets/esri/core/workers/chunks/{ef6e805c49e1afdf966b.js → c054198c6438cb57f188.js} +1 -1
  70. package/assets/esri/core/workers/chunks/c5d786166a5609b85276.js.LICENSE.txt +1 -1
  71. package/assets/esri/core/workers/chunks/{601fc99426f0213b0769.js → cbec01223d51cdb9ee79.js} +1 -1
  72. package/assets/esri/core/workers/chunks/{90c893959145827961ac.js → cd9343c78a7c3acdbbcd.js} +1 -1
  73. package/assets/esri/core/workers/chunks/{5db336767959507c07e5.js → d8dc922f7466300b668f.js} +2 -2
  74. package/assets/esri/core/workers/chunks/{5db336767959507c07e5.js.LICENSE.txt → d8dc922f7466300b668f.js.LICENSE.txt} +1 -1
  75. package/assets/esri/core/workers/chunks/e524462c63834fae7e01.js +2 -0
  76. package/assets/esri/core/workers/chunks/{02176f84d6d57f1bc1c8.js.LICENSE.txt → e524462c63834fae7e01.js.LICENSE.txt} +1 -1
  77. package/assets/esri/core/workers/chunks/{e7e987558cf017c62458.js → ebfa4a0334401f5e004a.js} +1 -1
  78. package/assets/esri/core/workers/chunks/{60d3b329e69f3cddb7f4.js → fa8a3c75f9b41d31559b.js} +1 -1
  79. package/assets/esri/libs/vxl/vxlLayer.wasm +0 -0
  80. package/assets/esri/themes/dark/main.css +1 -1
  81. package/assets/esri/themes/light/main.css +1 -1
  82. package/assets/esri/themes/light/view.css +1 -1
  83. package/chunks/Bufferer-CicaNej1.js +1 -1
  84. package/chunks/Envelope.js +1 -1
  85. package/chunks/GeodeticDistanceCalculator-CcF1gMZX.js +1 -1
  86. package/chunks/Geometry.js +1 -1
  87. package/chunks/OperatorGeodesicBuffer.js +1 -1
  88. package/chunks/OperatorGeodeticArea.js +1 -1
  89. package/chunks/OperatorGeodeticDensifyByLength.js +1 -1
  90. package/chunks/OperatorGeodeticLength.js +1 -1
  91. package/chunks/OperatorMultiPartToSinglePart.js +1 -1
  92. package/chunks/OperatorProximityGeodesic.js +1 -1
  93. package/chunks/OperatorShapePreservingLength.js +1 -1
  94. package/chunks/OperatorShapePreservingProject.js +1 -1
  95. package/chunks/OperatorSimplifyOGC.js +5 -0
  96. package/chunks/Point2D.js +1 -1
  97. package/chunks/ProjectionTransformation.js +1 -1
  98. package/chunks/QuadraticBezier.js +1 -1
  99. package/chunks/languageUtils.js +1 -1
  100. package/chunks/relateOperator.js +1 -1
  101. package/chunks/vxlLayer.js +1 -1
  102. package/geometry/operators/extendOperator.js +1 -1
  103. package/geometry/operators/gx/operatorAlphaShape.js +1 -1
  104. package/geometry/operators/gx/operatorAutoComplete.js +1 -1
  105. package/geometry/operators/gx/operatorLabelPoint.js +1 -1
  106. package/geometry/operators/gx/operatorLinesToPolygons.js +1 -1
  107. package/geometry/operators/gx/operatorLocateBetween.js +1 -1
  108. package/geometry/operators/gx/operatorMinimumBoundingCircle.js +1 -1
  109. package/geometry/operators/gx/operatorSimplifyOGC.js +5 -0
  110. package/geometry/operators/gx/operatorSymmetricDifference.js +1 -1
  111. package/geometry/operators/reshapeOperator.js +1 -1
  112. package/geometry/operators/simplifyOGCOperator.d.ts +6 -0
  113. package/geometry/operators/simplifyOGCOperator.js +5 -0
  114. package/geometry/operators/support/jsonConverter.js +1 -1
  115. package/interfaces.d.ts +98 -2
  116. package/package.json +2 -2
  117. package/support/revision.js +1 -1
  118. package/versionManagement/utils.js +1 -1
  119. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  120. package/views/3d/layers/LineOfSightLayerView3D.js +1 -1
  121. package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +1 -1
  122. package/views/3d/layers/graphics/pipeline/PipelineCommand.js +1 -1
  123. package/views/3d/layers/graphics/pipeline/Tile3DManager.js +1 -1
  124. package/views/3d/layers/graphics/pipeline/TileActionSynchronizer.js +5 -0
  125. package/views/3d/terrain/OverlayRenderTargets.js +1 -1
  126. package/views/3d/webgl/ManagedFBO.js +1 -1
  127. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  128. package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
  129. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
  130. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
  131. package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
  132. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  133. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  134. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  135. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  136. package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
  137. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  138. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  139. package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
  140. package/views/interactive/Tooltip.js +1 -1
  141. package/views/interactive/tooltip/content/TooltipContent.js +1 -1
  142. package/views/layers/LineOfSightLayerView.d.ts +4 -0
  143. package/views/layers/LineOfSightLayerView.js +5 -0
  144. package/views/webgl/FramebufferObject.js +1 -1
  145. package/views/webgl/formats.js +5 -0
  146. package/views/webgl/textureUtils.js +1 -1
  147. package/assets/esri/core/workers/chunks/02176f84d6d57f1bc1c8.js +0 -2
  148. package/assets/esri/core/workers/chunks/82353e59ac6d909dcf41.js +0 -1
  149. package/assets/esri/core/workers/chunks/873327fc41edd3830afa.js +0 -319
  150. package/assets/esri/core/workers/chunks/daa54c8a317c27881763.js +0 -1
  151. package/assets/esri/core/workers/chunks/e15c612caadf7bac4ab9.js +0 -1
  152. package/views/3d/webgl/formats.js +0 -5
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3169,5552,6061,8125],{43628:(e,t,n)=>{n.r(t),n.d(t,{accelerateGeometry:()=>r.a,execute:()=>r.e,isValidDE9IM:()=>r.i,supportsCurves:()=>r.s});var r=n(65416);n(78125)},65416:(e,t,n)=>{n.d(t,{a:()=>o,e:()=>i,i:()=>u,r:()=>l,s:()=>c});var r=n(12189),a=n(78125);const s=new class{supportsCurves(){return!0}getOperatorType(){return 1}execute(e,t,n,a,s){return(0,r.ad)(e,t,n,a,s)}isValidDE9IM(e){return 0===(0,r.ae)(e)}accelerateGeometry(e,t,n){return(0,r.af)(e,t,n)}canAccelerateGeometry(e){return(0,r.ag)(e)}};function o(e){const t=(0,a.getSpatialReference)(e);return s.accelerateGeometry((0,a.fromGeometry)(e),(0,a.fromSpatialReference)(t),1)}function i(e,t,n){return s.execute((0,a.fromGeometry)(e),(0,a.fromGeometry)(t),(0,a.fromSpatialReference)(e.spatialReference),n,null)}function u(e){return s.isValidDE9IM(e)}const c=s.supportsCurves(),l=Object.freeze(Object.defineProperty({__proto__:null,accelerateGeometry:o,execute:i,isValidDE9IM:u,supportsCurves:c},Symbol.toStringTag,{value:"Module"}))},76061:(e,t,n)=>{n.d(t,{G:()=>r,S:()=>a});class r{*[Symbol.iterator](){let e=this.next();for(;e;)yield e,e=this.next()}}class a extends r{constructor(e){super(),this.m_iGeom=-1,this.m_aGeoms=e?e.slice():[]}next(){if(this.m_iGeom<this.m_aGeoms.length-1){const e=this.m_aGeoms[++this.m_iGeom];return this.m_aGeoms[this.m_iGeom]=null,e}return null}tock(){return!1}getGeometryID(){return this.m_iGeom}getRank(){return 1}}},78125:(e,t,n)=>{n.r(t),n.d(t,{fromExtent:()=>C,fromGeometry:()=>x,fromMultipoint:()=>M,fromPoint:()=>V,fromPolygon:()=>d,fromPolyline:()=>v,fromSpatialReference:()=>w,getSpatialReference:()=>G,toExtent:()=>R,toGeometry:()=>P,toMultipoint:()=>Z,toPoint:()=>E,toPolygon:()=>_,toPolyline:()=>S});var r=n(83661),a=(n(79187),n(55537)),s=n(95213),o=n(35368),i=n(12189),u=n(5443),c=n(48526),l=n(86738),m=n(39829),f=n(82799),h=(n(90293),n(83299));const p="_gxVersion",y=2,g=1;function G(e){return Array.isArray(e)?e[0].spatialReference:e.spatialReference}function x(e){switch(e.type){case"point":return V(e);case"multipoint":return M(e);case"polyline":return v(e);case"polygon":return d(e);case"extent":return C(e);default:throw new Error(`Unsupported geometry type: ${e.type}`)}}function C(e){if(!e.getCacheValue(p)){const t=new s.E;t.setCoords(e.xmin,e.ymin,e.xmax,e.ymax),e.hasM&&t.setInterval(y,0,e.mmin,e.mmax),e.hasZ&&t.setInterval(g,0,e.zmin,e.zmax),e.setCacheValue(p,t)}return e.getCacheValue(p)}function M(e){if(!e.getCacheValue(p)){const t=new o.M,n=new s.P,r=e.points,a=e.hasM,i=e.hasZ,u=i?3:2;for(let e=0,s=r.length;e<s;e++){const s=r[e];n.setXYCoords(s[0],s[1]),i&&n.setZ(s[2]??0),a&&n.setM(s[u]??NaN),t.add(n)}e.setCacheValue(p,t)}return e.getCacheValue(p)}function V(e){if(!e.getCacheValue(p)){const t=new s.P;t.setXYCoords(e.x,e.y),e.hasM&&t.setM(e.m),e.hasZ&&t.setZ(e.z),e.setCacheValue(p,t)}return e.getCacheValue(p)}function d(e){if(!e.getCacheValue(p)){const{curveRings:t,hasM:n,hasZ:r,rings:a}=e,s=(0,h.fromGeometryToGXGeometry)({curveRings:t,hasM:n,hasZ:r,rings:a});e.setCacheValue(p,s)}return e.getCacheValue(p)}function v(e){if(!e.getCacheValue(p)){const{curvePaths:t,hasM:n,hasZ:r,paths:a}=e,s=(0,h.fromGeometryToGXGeometry)({curvePaths:t,hasM:n,hasZ:r,paths:a});e.setCacheValue(p,s)}return e.getCacheValue(p)}function w(e){if(e.wkid)return(0,i.c)(e.wkid);const t=e.wkt2||e.wkt;return t?(0,i.b)(t):null}function P(e,t){if(e)switch(e.getGeometryType()){case a.G.enumPoint:return E(e,t);case a.G.enumEnvelope:return R(e,t);case a.G.enumMultiPoint:return Z(e,t);case a.G.enumPolyline:return S(e,t);case a.G.enumPolygon:return _(e,t)}return null}function R(e,t){if(e.isEmpty())return null;const n=new u.A({xmin:e.getXMin(),ymin:e.getYMin(),xmax:e.getXMax(),ymax:e.getYMax(),spatialReference:t}),r=e.getDescription();if(r.hasM()){const t=e.queryInterval(y,0);n.mmin=t.vmin,n.mmax=t.vmax}if(r.hasZ()){const t=e.queryInterval(g,0);n.zmin=t.vmin,n.zmax=t.vmax}return n.setCacheValue(p,e),n}function Z(e,t){if(e.isEmpty())return null;const n=e.getDescription(),r=n.hasM(),a=n.hasZ(),o=[],i=new s.P;for(let t=0,n=e.getPointCount();t<n;t++){e.getPointByVal(t,i);const n=[i.getX(),i.getY()];a&&n.push(i.getZ()),r&&n.push(i.getM()),o.push(n)}const u=new c.A({hasM:r,hasZ:a,points:o,spatialReference:t});return u.setCacheValue(p,e),u}function E(e,t){if(e instanceof r.P)return new l.A({x:e.x,y:e.y,spatialReference:t});if(e.isEmpty())return null;const n=new l.A({x:e.getX(),y:e.getY(),spatialReference:t}),a=e.getDescription();return a.hasM()&&(n.m=e.getM()),a.hasZ()&&(n.z=e.getZ()),n.setCacheValue(p,e),n}function _(e,t){if(e.isEmpty())return null;const n=m.A.fromJSON({spatialReference:t,...(0,h.toGeometry)(e,null)});return n.setCacheValue(p,e),n}function S(e,t){if(e.isEmpty())return null;const n=f.A.fromJSON({spatialReference:t,...(0,h.toGeometry)(e,null)});return n.setCacheValue(p,e),n}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3169,5552,6061,8125],{43628:(e,t,n)=>{n.r(t),n.d(t,{accelerateGeometry:()=>r.a,execute:()=>r.e,isValidDE9IM:()=>r.i,supportsCurves:()=>r.s});var r=n(65416);n(78125)},65416:(e,t,n)=>{n.d(t,{a:()=>o,e:()=>i,i:()=>u,r:()=>l,s:()=>c});var r=n(12189),a=n(78125);const s=new class{supportsCurves(){return!0}getOperatorType(){return 1}execute(e,t,n,a,s){return(0,r.af)(e,t,n,a,s)}isValidDE9IM(e){return 0===(0,r.ag)(e)}accelerateGeometry(e,t,n){return(0,r.ah)(e,t,n)}canAccelerateGeometry(e){return(0,r.ai)(e)}};function o(e){const t=(0,a.getSpatialReference)(e);return s.accelerateGeometry((0,a.fromGeometry)(e),(0,a.fromSpatialReference)(t),1)}function i(e,t,n){return s.execute((0,a.fromGeometry)(e),(0,a.fromGeometry)(t),(0,a.fromSpatialReference)(e.spatialReference),n,null)}function u(e){return s.isValidDE9IM(e)}const c=s.supportsCurves(),l=Object.freeze(Object.defineProperty({__proto__:null,accelerateGeometry:o,execute:i,isValidDE9IM:u,supportsCurves:c},Symbol.toStringTag,{value:"Module"}))},76061:(e,t,n)=>{n.d(t,{G:()=>r,S:()=>a});class r{*[Symbol.iterator](){let e=this.next();for(;e;)yield e,e=this.next()}}class a extends r{constructor(e){super(),this.m_iGeom=-1,this.m_aGeoms=e?e.slice():[]}next(){if(this.m_iGeom<this.m_aGeoms.length-1){const e=this.m_aGeoms[++this.m_iGeom];return this.m_aGeoms[this.m_iGeom]=null,e}return null}tock(){return!1}getGeometryID(){return this.m_iGeom}getRank(){return 1}}},78125:(e,t,n)=>{n.r(t),n.d(t,{fromExtent:()=>C,fromGeometry:()=>x,fromMultipoint:()=>M,fromPoint:()=>V,fromPolygon:()=>d,fromPolyline:()=>v,fromSpatialReference:()=>w,getSpatialReference:()=>G,toExtent:()=>R,toGeometry:()=>P,toMultipoint:()=>Z,toPoint:()=>E,toPolygon:()=>_,toPolyline:()=>S});var r=n(83661),a=(n(79187),n(55537)),s=n(95213),o=n(35368),i=n(12189),u=n(5443),c=n(48526),l=n(86738),m=n(39829),f=n(82799),h=(n(90293),n(83299));const p="_gxVersion",y=2,g=1;function G(e){return Array.isArray(e)?e[0].spatialReference:e.spatialReference}function x(e){switch(e.type){case"point":return V(e);case"multipoint":return M(e);case"polyline":return v(e);case"polygon":return d(e);case"extent":return C(e);default:throw new Error(`Unsupported geometry type: ${e.type}`)}}function C(e){if(!e.getCacheValue(p)){const t=new s.E;t.setCoords(e.xmin,e.ymin,e.xmax,e.ymax),e.hasM&&t.setInterval(y,0,e.mmin,e.mmax),e.hasZ&&t.setInterval(g,0,e.zmin,e.zmax),e.setCacheValue(p,t)}return e.getCacheValue(p)}function M(e){if(!e.getCacheValue(p)){const t=new o.M,n=new s.P,r=e.points,a=e.hasM,i=e.hasZ,u=i?3:2;for(let e=0,s=r.length;e<s;e++){const s=r[e];n.setXYCoords(s[0],s[1]),i&&n.setZ(s[2]??0),a&&n.setM(s[u]??NaN),t.add(n)}e.setCacheValue(p,t)}return e.getCacheValue(p)}function V(e){if(!e.getCacheValue(p)){const t=new s.P;t.setXYCoords(e.x,e.y),e.hasM&&t.setM(e.m),e.hasZ&&t.setZ(e.z),e.setCacheValue(p,t)}return e.getCacheValue(p)}function d(e){if(!e.getCacheValue(p)){const{curveRings:t,hasM:n,hasZ:r,rings:a}=e,s=(0,h.fromGeometryToGXGeometry)({curveRings:t,hasM:n,hasZ:r,rings:a});e.setCacheValue(p,s)}return e.getCacheValue(p)}function v(e){if(!e.getCacheValue(p)){const{curvePaths:t,hasM:n,hasZ:r,paths:a}=e,s=(0,h.fromGeometryToGXGeometry)({curvePaths:t,hasM:n,hasZ:r,paths:a});e.setCacheValue(p,s)}return e.getCacheValue(p)}function w(e){if(e.wkid)return(0,i.c)(e.wkid);const t=e.wkt2||e.wkt;return t?(0,i.b)(t):null}function P(e,t){if(e)switch(e.getGeometryType()){case a.G.enumPoint:return E(e,t);case a.G.enumEnvelope:return R(e,t);case a.G.enumMultiPoint:return Z(e,t);case a.G.enumPolyline:return S(e,t);case a.G.enumPolygon:return _(e,t)}return null}function R(e,t){if(e.isEmpty())return null;const n=new u.A({xmin:e.getXMin(),ymin:e.getYMin(),xmax:e.getXMax(),ymax:e.getYMax(),spatialReference:t}),r=e.getDescription();if(r.hasM()){const t=e.queryInterval(y,0);n.mmin=t.vmin,n.mmax=t.vmax}if(r.hasZ()){const t=e.queryInterval(g,0);n.zmin=t.vmin,n.zmax=t.vmax}return n.setCacheValue(p,e),n}function Z(e,t){if(e.isEmpty())return null;const n=e.getDescription(),r=n.hasM(),a=n.hasZ(),o=[],i=new s.P;for(let t=0,n=e.getPointCount();t<n;t++){e.getPointByVal(t,i);const n=[i.getX(),i.getY()];a&&n.push(i.getZ()),r&&n.push(i.getM()),o.push(n)}const u=new c.A({hasM:r,hasZ:a,points:o,spatialReference:t});return u.setCacheValue(p,e),u}function E(e,t){if(e instanceof r.P)return new l.A({x:e.x,y:e.y,spatialReference:t});if(e.isEmpty())return null;const n=new l.A({x:e.getX(),y:e.getY(),spatialReference:t}),a=e.getDescription();return a.hasM()&&(n.m=e.getM()),a.hasZ()&&(n.z=e.getZ()),n.setCacheValue(p,e),n}function _(e,t){if(e.isEmpty())return null;const n=m.A.fromJSON({spatialReference:t,...(0,h.toGeometry)(e,null)});return n.setCacheValue(p,e),n}function S(e,t){if(e.isEmpty())return null;const n=f.A.fromJSON({spatialReference:t,...(0,h.toGeometry)(e,null)});return n.setCacheValue(p,e),n}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3661],{55537:(t,s,e)=>{function i(t,s){try{if(!t)throw new Error(s)}catch(t){throw t}}e.d(s,{A:()=>f,B:()=>k,C:()=>G,D:()=>Z,G:()=>m,a:()=>w,b:()=>A,c:()=>z,d:()=>R,e:()=>_,f:()=>d,g:()=>i,h:()=>x,i:()=>p,j:()=>g,k:()=>E,l:()=>B,m:()=>D,n:()=>q,o:()=>N,p:()=>b,q:()=>v,r:()=>T,s:()=>C,t:()=>M,u:()=>P,v:()=>y,w:()=>F,x:()=>I,y:()=>S,z:()=>L});class n extends Error{constructor(t,s){super(s),this.m_AdditionalMessage=s,this.m_ErrorType=t,this.name="GeometryError"}what(){return function(t){switch(t){case 1:return"Unknown error";case 2:return"Corrupted geometry";case 3:return"Empty geometry";case 4:return"Math singularity";case 5:return"Buffer is too small";case 6:return"Invalid shape type";case 7:return"Projection out of supported range";case 8:return"Non simple geometry";case 9:return"Cannot calculate geodesic";case 10:return"Notation conversion";case 11:return"Missing grid file";case 12:return"Invalid call";case 13:return"Internal error";case 14:return"Not implemented";case 15:return"IO error";case 16:return"Invalid 3D";case 17:return"An ambiguous geography edge with antipodal points";case 18:return"Geocentric coordinates require ellipsoidal height";case 19:return"Geography cannot be projected into a gnomonic plane or a result of an operation cannot fit into a gnomonic plane";case 20:return"Geometry is too large to be exported in to a given format";case 22:return"Operation is canceled by the user";case 21:return"The operation, such as projection or geodetic computation, cannot be performed without pe-wasm loaded";default:return"unknown error"}}(this.m_ErrorType)}additionalMessage(){return this.m_AdditionalMessage?this.m_AdditionalMessage:""}code(){return this.m_ErrorType}}class r extends n{constructor(t){super(2,t),this.name="CorruptedGeometryError"}}class u extends n{constructor(t){super(3,t),this.name="EmptyGeometryError"}}class h extends n{constructor(t){super(4,t),this.name="MathSingularityError"}}class o extends n{constructor(t){super(21,t),this.name="ProjectionEngineNotLoadedError"}}class a extends n{constructor(t){super(8,t),this.name="NonSimpleGeometryError"}}var m,c;(c=m||(m={}))[c.enumUnknown=0]="enumUnknown",c[c.enumPoint=513]="enumPoint",c[c.enumLine=5122]="enumLine",c[c.enumBezier=5123]="enumBezier",c[c.enumEllipticArc=5124]="enumEllipticArc",c[c.enumEnvelope=3077]="enumEnvelope",c[c.enumMultiPoint=8710]="enumMultiPoint",c[c.enumPolyline=25607]="enumPolyline",c[c.enumPolygon=27656]="enumPolygon",c[c.enumMultipatch=40969]="enumMultipatch",c[c.enumGeometryCollection=3594]="enumGeometryCollection",c[c.enumRationalBezier2=5134]="enumRationalBezier2",c[c.enumBezier2=5135]="enumBezier2",c[c.enumRationalBezier23d=5392]="enumRationalBezier23d",c[c.enumGreatArc3d=5393]="enumGreatArc3d";const l=[0,0,1,1,1,2,0,1,2,3,-1,-1,-1,-1,1,1];function f(t){return l[15&t]}function _(t){return!!(512&t)}function v(t){return!!(1024&t)}function b(t){return!!(2048&t)}function d(t){return!!(4096&t)}function p(t){return!!(8192&t)}function x(t){return!!(16384&t)}function N(t){return!!(32768&t)}function y(t){const s=t.getGeometryType();return p(s)?t.getPointCount():t.isEmpty()?0:s===m.enumEnvelope?4:s===m.enumPoint?1:d(s)?2:void z("missing type")}function g(t){const s=t.getGeometryType();if(x(s))return t.hasNonLinearSegments();if(s===m.enumGeometryCollection){const s=t;for(let t=0,e=s.getGeometryCount();t<e;t++)if(g(s.getGeometry(t)))return!0;return!1}return!!d(s)&&s!==m.enumLine}function T(t){throw new o(t)}function E(t){throw new r(t)}function M(t){throw new Error(t)}function w(t){throw new h(t)}function I(){M("Geometry type is not supported for 3D operations.")}function D(t){throw new n(12,t)}function P(t){throw new u(t)}function A(t){throw new n(14,t)}function q(t){throw new Error(t)}function z(t){throw new n(13,t)}function C(t){throw new Error(t)}function Z(t){throw new a(t)}function B(t){t&&g(t)&&A("Operation does not support curves.")}function R(t){t&&N(t.getGeometryType())&&A("Unsupported geometry type.")}function G(t){t===m.enumGeometryCollection&&M("Geometry_collection instances are not supported in this operation")}function k(t){G(t.getGeometryType())}function S(t){M(`bad wkid: ${t}`)}function L(t){let s="bad wkt: ";s+=t,s+="...",M(s)}function F(t,s){t||M(s)}},83661:(t,s,e)=>{e.d(s,{$:()=>y,A:()=>fs,B:()=>at,C:()=>vt,D:()=>ps,E:()=>a,F:()=>c,G:()=>p,H:()=>d,I:()=>jt,J:()=>Ns,K:()=>n,L:()=>Mt,M:()=>qs,N:()=>xs,O:()=>Pt,P:()=>ks,Q:()=>Z,R:()=>B,S:()=>At,T:()=>ot,U:()=>_t,V:()=>D,W:()=>P,X:()=>bt,Y:()=>Yt,Z:()=>R,_:()=>N,a:()=>mt,a0:()=>A,a1:()=>q,a2:()=>z,a3:()=>Vt,a4:()=>zt,a5:()=>Es,a6:()=>Ds,a7:()=>ws,a8:()=>Ms,a9:()=>it,aA:()=>Bs,aB:()=>Gs,aC:()=>M,aD:()=>hs,aE:()=>Wt,aF:()=>Lt,aG:()=>as,aH:()=>os,aa:()=>nt,ab:()=>Bt,ac:()=>gt,ad:()=>x,ae:()=>Cs,af:()=>zs,ag:()=>S,ah:()=>Ts,ai:()=>et,aj:()=>V,ak:()=>L,al:()=>Ps,am:()=>dt,an:()=>ds,ao:()=>Jt,ap:()=>ct,aq:()=>us,ar:()=>ms,as:()=>wt,at:()=>ls,au:()=>Et,av:()=>I,aw:()=>rs,ax:()=>gs,ay:()=>xt,az:()=>Rs,b:()=>lt,c:()=>ys,d:()=>Dt,e:()=>F,f:()=>w,g:()=>bs,h:()=>Nt,i:()=>Xt,j:()=>Ht,k:()=>Ct,l:()=>Zt,m:()=>Tt,n:()=>qt,o:()=>st,p:()=>It,q:()=>C,r:()=>$t,s:()=>k,t:()=>O,u:()=>pt,v:()=>ft,w:()=>yt,x:()=>G,y:()=>g,z:()=>E});var i=e(55537);class n{constructor(t){this.sum=t,this.compensation=0}assign(t){return this.compensation=t.compensation,this.sum=t.sum,this}reset(){this.sum=this.compensation=0}resetToStart(t){this.sum=t,this.compensation=0}normalize(){const t=[Number.NaN];this.sum=tt(this.sum,this.compensation,t),this.compensation=t[0]}add(t){const s=this.sum+t;let e;if(Math.abs(this.sum)>=Math.abs(t)){const i=this.sum-s+t;e=this.compensation+i}else{const i=t-s+this.sum;e=this.compensation+i}this.sum=s,this.compensation=e}sub(t){this.add(-t)}addProduct(t,s){const e=[0],i=W(t,s,e);this.add(i),this.add(e[0])}mul(t){const s=new n(0);s.addProduct(this.sum,t),s.addProduct(this.compensation,t),this.assign(s)}getResult(){return this.sum+this.compensation}pe(t){return this.add(t),this}me(t){return this.add(-t),this}}const r=[5,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1],u=[-1,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3];function h(t){let s=0;return 65535n&t||(s+=16,t>>=16n),255n&t||(s+=8,t>>=8n),15n&t||(s+=4,t>>=4n),s+r[Number(BigInt.asUintN(4,t))]}function o(t){let s=0;return 4294967295n&t||(s=32,t>>=32n),s+h(BigInt.asUintN(32,t))}class a{constructor(t,s){if(this.m_EnvelopeType=1,void 0!==t){if(t instanceof a)return this.vmin=t.vmin,void(this.vmax=t.vmax);this.vmin=t,this.vmax=s,this.normalize()}else this.setEmpty()}static construct(t,s){return new a(t,s)}static constructEmpty(){return new a}setCoords(t,s){this.vmin=t,this.vmax=s,this.normalize()}setCoordsFromEnvelope(t){this.vmin=t.vmin,this.vmax=t.vmax}setEmpty(){this.vmin=Number.NaN,this.vmax=Number.NaN}getCenter(){return.5*(this.vmin+this.vmax)}equalsRange(t,s){return Vt(this.vmin,t)&&Vt(this.vmax,s)}equals(t,s){return!(!this.isEmpty()||!t.isEmpty())||(void 0!==s?Math.abs(this.vmin-t.vmin)<=s&&Math.abs(this.vmax-t.vmax)<=s:this.vmin===t.vmin&&this.vmax===t.vmax)}width(){return this.vmax-this.vmin}isEmpty(){return Number.isNaN(this.vmin)||Number.isNaN(this.vmax)}isZero(){return this.vmin===this.vmax}setInfinite(){this.vmin=Number.NEGATIVE_INFINITY,this.vmax=Number.POSITIVE_INFINITY}move(t){this.isEmpty()||(this.vmin+=t,this.vmax+=t)}contains(t){return t.vmin>=this.vmin&&t.vmax<=this.vmax}containsCoordinate(t){return t>=this.vmin&&t<=this.vmax}containsRightExclusive(t){return t>=this.vmin&&t<this.vmax}containsExclusiveCoordinate(t){return t>this.vmin&&t<this.vmax}containsExclusive(t){return t.vmin>this.vmin&&t.vmax<this.vmax}isIntersecting(t){return this.vmin<=t.vmin?this.vmax>=t.vmin:t.vmax>=this.vmin}mergeCoordinate(t){if(this.isEmpty())return this.vmin=t,void(this.vmax=t);this.mergeNeCoordinate(t)}merge(t){if(t.isEmpty())return;const s=t.vmin,e=t.vmax;this.mergeCoordinate(s),this.mergeCoordinate(e)}mergeNe(t){const s=t.vmin,e=t.vmax;this.mergeNeCoordinate(s),this.mergeNeCoordinate(e)}mergeNeCoordinate(t){t<this.vmin?this.vmin=t:t>this.vmax&&(this.vmax=t)}intersect(t){this.isEmpty()||t.isEmpty()?this.setEmpty():(this.vmin<t.vmin&&(this.vmin=t.vmin),this.vmax>t.vmax&&(this.vmax=t.vmax),this.vmin>this.vmax&&this.setEmpty())}inflate(t){this.isEmpty()||(this.vmin-=t,this.vmax+=t,this.vmax<this.vmin&&this.setEmpty())}normalize(){this.vmin<=this.vmax||(this.vmin>this.vmax?this.vmax=lt(this.vmin,this.vmin=this.vmax):this.setEmpty())}isValid(){return this.isEmpty()||this.vmin<=this.vmax}snapClip(t){return ys(t,this.vmin,this.vmax)}calculateToleranceFromEnvelope(){return this.isEmpty()?bs():(Math.abs(this.vmin)+Math.abs(this.vmax)+1)*bs()}static unit(){return m}normalizeNoNAN(){this.vmin>this.vmax&&(this.vmax=lt(this.vmin,this.vmin=this.vmax))}setCoordsNoNAN(t,s){this.vmin=t,this.vmax=s,this.normalizeNoNAN()}clone(){return new a(this.vmin,this.vmax)}}const m=new a(0,1);class c{static getNAN(){return new c(Number.NaN)}constructor(t,s){this.m_value=t??0,this.m_eps=s??0}[Symbol.toPrimitive](t){return this}clone(){return new c(this.m_value,this.m_eps)}assign(t){return this.m_value=t.m_value,this.m_eps=t.m_eps,this}scaleError(t){this.m_eps*=t}setError(t){this.m_eps=t}set(t,s){return this.m_value=t,this.m_eps=s??0,this}setWithEps(t,s){return void 0===s&&(s=1),this.m_value=t,this.m_eps=c.ulp(t)*s,this}setE(t){return this.m_value=t.m_value,this.m_eps=t.m_eps,this}precise(){return new c(this.m_value)}value(){return this.m_value}toDouble(){return this.m_value}eps(){return this.m_eps}resetError(){return this.m_eps=0,this}absThis(){return this.m_value=Math.abs(this.m_value),this}add(t){return this.clone().addThis(t)}addE(t){return this.clone().addThisE(t)}addThisE(t){const s=this.m_value+t.m_value,e=this.m_eps+t.m_eps+c.ulp(s);return this.m_value=s,this.m_eps=e,this}addThis(t){const s=this.m_value+t,e=this.m_eps+c.ulp(s);return this.m_value=s,this.m_eps=e,this}subE(t){return this.clone().subThisE(t)}sub(t){return this.clone().subThis(t)}subThisE(t){const s=this.m_value-t.m_value,e=this.m_eps+t.m_eps+c.ulp(s);return this.m_value=s,this.m_eps=e,this}subThis(t){const s=this.m_value-t,e=this.m_eps+c.ulp(s);return this.m_value=s,this.m_eps=e,this}setAddE(t,s){return this.m_value=t.m_value+s.m_value,this.m_eps=t.m_eps+s.m_eps+c.ulp(this.m_value),this}setAdd(t,s){return this.m_value=t+s,this.m_eps=c.ulp(this.m_value),this}setAddEN(t,s){return this.m_value=t.m_value+s,this.m_eps=t.m_eps+c.ulp(this.m_value),this}setAddNE(t,s){return this.m_value=t+s.m_value,this.m_eps=s.m_eps+c.ulp(this.m_value),this}setSubE(t,s){return this.m_value=t.m_value-s.m_value,this.m_eps=t.m_eps+s.m_eps+c.ulp(this.m_value),this}setSub(t,s){return this.m_value=t-s,this.m_eps=c.ulp(this.m_value),this}setSubEN(t,s){return this.m_value=t.m_value-s,this.m_eps=t.m_eps+c.ulp(this.m_value),this}setSubNE(t,s){return this.m_value=t-s.m_value,this.m_eps=s.m_eps+c.ulp(this.m_value),this}mulThisE(t){const s=this.m_value*t.m_value;return this.m_eps=this.m_eps*Math.abs(t.m_value)+t.m_eps*Math.abs(this.m_value)+this.m_eps*t.m_eps+c.ulp(s),this.m_value=s,this}mulThis(t){const s=this.m_value*t;return this.m_eps=this.m_eps*Math.abs(t)+c.ulp(s),this.m_value=s,this}mul(t){return this.clone().mulThis(t)}mulE(t){return this.clone().mulThisE(t)}setMulE(t,s){const e=t.m_value*s.m_value;return this.m_eps=t.m_eps*Math.abs(s.m_value)+s.m_eps*Math.abs(t.m_value)+t.m_eps*s.m_eps+c.ulp(e),this.m_value=e,this}setMul(t,s){return this.m_value=t*s,this.m_eps=c.ulp(this.m_value),this}setMulEN(t,s){return this.setE(t),this.mulThis(s)}setMulNE(t,s){return this.setE(s),this.mulThis(t)}mulThisByPower2(t){return this.m_value*=t,this.m_eps*=Math.abs(t),this}static st_mulByPower2(t,s){return new c(t.m_value,t.m_eps).mulThisByPower2(s)}divE(t){return this.clone().divThisE(t)}divThisE(t){const s=Math.abs(t.m_value),e=this.m_value/t.m_value;let i=(this.m_eps+Math.abs(e)*t.m_eps)/s;if(t.m_eps>.01*s){const e=t.m_eps/s;i*=1+(1+e)*e}return this.m_value=e,this.m_eps=i+c.ulp(e),this}divThis(t){const s=Math.abs(t);return this.m_value/=t,this.m_eps=this.m_eps/s+c.ulp(this.m_value),this}setDivE(t,s){return this.setE(t),this.divThisE(s)}setDiv(t,s){return this.m_value=t/s,this.m_eps=c.ulp(this.m_value),this}setDivEN(t,s){return this.setE(t),this.divThis(s)}setDivNE(t,s){return this.set(t),this.divThisE(s)}divThisByPower2(t){return this.m_value/=t,this.m_eps/=Math.abs(t),this}invThis(){return this.setE(p.clone().divThisE(this)),this}sqrt(){return this.clone().sqrtThis()}sqrtThis(){let t,s;return this.m_value>=0?(t=Math.sqrt(this.m_value),s=this.m_value>10*this.m_eps?.5*this.m_eps/t:this.m_value>this.m_eps?t-Math.sqrt(this.m_value-this.m_eps):Math.max(t,Math.sqrt(this.m_value+this.m_eps)-t),s+=c.ulp(t)):this.m_value<-this.m_eps?(t=Number.NaN,s=Number.NaN):(t=0,s=Math.sqrt(this.m_eps)),this.m_value=t,this.m_eps=s,this}sqr(){return this.clone().sqrThis()}sqrThis(){const t=this.m_value*this.m_value;return this.m_eps=2*this.m_eps*Math.abs(this.m_value)+this.m_eps*this.m_eps+c.ulp(t),this.m_value=t,this}setSin(t){const s=Math.sin(t.m_value),e=Math.cos(t.m_value);this.m_value=s;const i=Math.abs(s),n=Math.abs(t.value());return this.m_eps=(Math.abs(e)+.5*i*t.m_eps)*t.m_eps+c.ulp(i+n),this}static ulp(t){let s=Ft(t);const e=((0x7ff0000000000000n&s)>>52n)-1075n;return e>-1023n?(s=e+0x3ffn<<52n,function(t){return kt[0]=t,Gt[0]}(s)):0===t?0:Number.MIN_VALUE}setCos(t){const s=Math.sin(t.m_value),e=Math.cos(t.m_value);this.m_value=e;const i=Math.abs(e),n=Math.abs(t.value());return this.m_eps=(Math.abs(s)+.5*i*t.m_eps)*t.m_eps+c.ulp(i+n),this}static st_cosAndSin(t,s,e){const i=Math.sin(t.m_value),n=Math.cos(t.m_value);e.m_value=i,s.m_value=n;const r=Math.abs(i),u=Math.abs(n),h=Math.abs(t.value());e.m_eps=(Math.abs(n)+.5*r*t.m_eps)*t.m_eps+c.ulp(r+h),s.m_eps=(Math.abs(i)+.5*u*t.m_eps)*t.m_eps+c.ulp(u+h)}negate(){return this.clone().negateThis()}negateThis(){return this.m_value=-this.m_value,this}setAbs(){return this.m_value=Math.abs(this.m_value),this}isInInterval(t){return a.construct(this.m_value-this.m_eps,this.m_value+this.m_eps).isIntersecting(t)}eq(t){return Math.abs(this.m_value-t.m_value)<=this.m_eps+t.m_eps}ne(t){return!this.eq(t)}gt(t){return this.m_value-t.m_value>this.m_eps+t.m_eps}lt(t){return t.m_value-this.m_value>this.m_eps+t.m_eps}ge(t){return!this.lt(t)}le(t){return!this.gt(t)}tolEQ(t,s){return Math.abs(this.m_value-t.m_value)<=s||this.eq(t)}tolNE(t,s){return!this.tolEQ(t,s)}tolGT(t,s){return this.m_value-t.m_value>s&&this.gt(t)}tolLT(t,s){return t.m_value-this.m_value>s&&this.lt(t)}tolGE(t,s){return!this.tolLT(t,s)}tolLE(t,s){return!this.tolGT(t,s)}isZero(){return Math.abs(this.m_value)<=this.m_eps}isFuzzyZero(){return this.isZero()&&0!==this.m_eps}tolIsZero(t){return Math.abs(this.m_value)<=Math.max(this.m_eps,t)}setPi(){this.setE(b)}setEuler(){this.set(2.718281828459045,v())}static size(){return 1}}function l(t,s){const e=Ot(t),i=Ot(s),n=53-o(e),r=53-o(i);return(n>=0?n:0)+(r>=0?r:0)<=52}function f(t,s){const e=t+s;return e-t===s&&e-s===t}function _(t,s){const e=t-s;return t-e===s&&s+e===t}function v(){return xs()}c.dimensions=1;const b=new c(Math.PI,.5*v()),d=new c(0,0),p=new c(1,0),x=new c(4,0);function N(t,s,e){return t.addE(s.subE(t).mulE(e))}function y(t,s,e){return s.subE(s.subE(t).mulE(p.subE(e)))}function g(t){let s;if(0===t)s=1;else if(Math.abs(t)>.01)s=function(t){return Math.atanh(t)}(t)/t;else{let e;const i=-36.841361487904734;s=0;const n=t*t;for(let t=2*Math.trunc(i/Math.log(n)+2.5)-1;t>1;t-=2)e=1/t,s=(s+e)*n;s+=1}return s}function T(t){const s=Math.PI*Math.PI/6;let e;if(1===t)e=s;else if(t>1)e=s;else if(0===t)e=t;else if(t<0){const s=1+(t=Math.abs(t)),i=Math.log(s);e=i*i/-2-T(t/s)}else if(t>.5){const i=1-t,n=Math.log(t)*Math.log(i);e=s-T(i)-n}else{e=0;const s=1+Math.trunc(-16*Math.log(10)/Math.log(t)+1.5);let i=s;for(let n=s;n>0;n--,i-=1)e*=t,e+=1/(i*i);e*=t}return e}function E(t,s){const e=s*t;if(Math.abs(s)<.1){let s=0;for(let t=60;t>=1;t--)s*=e,s+=1/t/t;return s*=t,s}return T(e)/s}function M(t,s){return t<s?qt(t,s):qt(s,t)}function w(t,s){const e=Math.abs(t);return s>=0?e:-e}function I(t){return Math.round(t)}function D(t,s,e,i,n){n[0]=s[0]+(e[0]-s[0])*i,n[1]=s[1]+(e[1]-s[1])*i,3===t&&(n[2]=s[2]+(e[2]-s[2])*i)}function P(t,s,e,i,n){n[0]=e[0]-(e[0]-s[0])*(1-i),n[1]=e[1]-(e[1]-s[1])*(1-i),3===t&&(n[2]=e[2]-(e[2]-s[2])*(1-i))}function A(t,s,e,i,n){i<=.5?D(t,s,e,i,n):P(t,s,e,i,n)}function q(t,s,e,i,n){n[0]=s[0].addE(e[0].subE(s[0]).mulE(i)),n[1]=s[1].addE(e[1].subE(s[1]).mulE(i))}function z(t,s,e,i,n){n[0]=e[0].subE(e[0].subE(s[0]).mulE(p.subE(i))),n[1]=e[1].subE(e[1].subE(s[1]).mulE(p.subE(i)))}function C(t,s,e){let i;return i=e<=.5?t+(s-t)*e:s-(s-t)*(1-e),i}function Z(t,s,e){return t+(s-t)*e}function B(t,s,e){return s-(s-t)*(1-e)}function R(t,s,e,i){e<=.5?(i.x=t.x+(s.x-t.x)*e,i.y=t.y+(s.y-t.y)*e):(i.x=s.x-(s.x-t.x)*(1-e),i.y=s.y-(s.y-t.y)*(1-e))}function G(t,s,e,i){e<=.5?(i.x=t.x+(s.x-t.x)*e,i.y=t.y+(s.y-t.y)*e,i.z=t.z+(s.z-t.z)*e):(i.x=s.x-(s.x-t.x)*(1-e),i.y=s.y-(s.y-t.y)*(1-e),i.z=s.z-(s.z-t.z)*(1-e))}function k(t){return t*t}function S(t){return t*t*t}function L(t){return 1/Math.sqrt(t)}function F(t){return t<0?-1:t>0?1:0}function O(t,s,e,i){const n=[0],r=[0],u=[0];return tt(W(t,e,n),W(s,i,r),u)+(n[0]+r[0]+u[0])}const Q=[0],U=[0];function V(t,s,e){return function(t,s,e,i){const n=tt(t,s,J),r=tt(n,e,K);return tt(r,J[0]+K[0],i)}(W(t,s,Q),e,Q[0],U)}const j=[0],Y=[0],$=[0],H=[0];function W(t,s,e){const i=t*s;return X(t,j,Y),X(s,$,H),e[0]=Y[0]*H[0]-(i-j[0]*$[0]-Y[0]*$[0]-j[0]*H[0]),i}function X(t,s,e){const i=134217729*t;s[0]=i-(i-t),e[0]=t-s[0]}const J=[0],K=[0];function tt(t,s,e){const i=t+s;return Math.abs(t)>Math.abs(s)?e[0]=t-i+s:e[0]=s-i+t,i}function st(t,s){return t%s}function et(t){const s=1-t;if(0===s)return 1;let e;if(s<=.01){const t=s,i=Math.log(t);e=1+t*(.4431471805599453-.25*i+t*(.05680519270997949-.09375*i+t*(.02183137044373718-.05859375*i+t*(.011544521417308362-.042724609375*i+t*(.00714200031339596-.0336456298828125*i+t*(.004854743337164948-.027757644653320312*i+t*(.003514687963781376-.023627042770385742*i)))))))}else{if(t<.016){const s=t,e=.25,i=.046875,n=.01953125,r=.01068115234375,u=.0067291259765625,h=.004626274108886719,o=.0033752918243408203,a=.0025710230693221092;return ws()*(1-s*(e+s*(i+s*(n+s*(r+s*(u+s*(h+s*(o+s*a))))))))}e=rt(0,s,1)-t*ut(0,s,1)/3}return ys(e,1,ws())}function it(t,s,e=Number.NaN){if((0,i.g)(s>=0&&s<=1),0===s)return t;let n=1,r=t;if(r<0&&(r=-r,n=-1),1===s){const t=Math.round(r/Es()),s=r-t*Es();return n*(2*t+Math.sin(s))}const u=ws(),h=Math.floor(r/u);1&h?r=(h+1)*u-r:r-=h*u;const o=Math.sin(r),a=Number.isNaN(e)?et(s):e;let m;if(1===o)m=a+Math.sqrt(1-s)*(r-u);else{const t=r*r;if(.01424*Math.pow(t,4)<=2*xs())m=r*(1+t*s*(-1/6+t*((4-3*s)/120-(16+(45*s-60)*s)/5040*t)));else if(s<=.01){const t=Math.sin(2*r),e=Math.sin(4*r),i=Math.sin(6*r),n=Math.sin(8*r),u=Math.sin(10*r);m=r+s*((2*-r+t)/8+s*((-3*r+2*t-.25*e)/64+s*((-20*r+15*t-3*e+i/3)/1024+s*(5*(-140*r+112*t-28*e+16/3*i-.5*n)/65536+7*s*((-63*r+52.5*t-15*e+3.75*i-.625*n+.05*u)/65536+s*(-693*r+594*t-185.625*e+1.375*i-12.375*n+1.8*u-.125*Math.sin(12*r))/1048576)))))}else{const t=o*o,e=Math.cos(r),i=e*e,n=ht(o,e,s);m=o*(rt(i,n,1)-s*t*ut(i,n,1)/3)}}return 1&h?m=a*(h+1)-m:m+=a*h,n*m}function nt(t,s,e=Number.NaN){if(0===t)return 0;let i=1,n=t;t<0&&(n=-n,i=-1);const r=Number.isNaN(e)?et(s):e,u=Math.floor(n/r);1&u?n=(u+1)*r-n:n-=u*r;let h=n<=0?0:n>=r?ws():function(t,s,e){if(0===s)return t;if(1===s)return Math.asin(t);let i=0,n=!0;if(t<.2){const e=t*t,r=t*(1+e*s*(1/6+e*((13*s-4)/120+(16-284*s+493*s*s)/5040*e))),u=Math.abs(s*(4944*s-64-31224*s*s+37369*s*s*s)/362880*Math.pow(t,9));if(u<Math.abs(r)*xs())return r;i=r,n=u>.1*r}if(n){const n=1-s,r=1-t/e,u=Math.sqrt(r*r+n*n),h=Math.atan2(n,t+xs());i=ws()+Math.sqrt(u)*(h-ws())}let r=0;for(let n=0;n<7;n++){r=it(i,s,e);const u=ht(Math.sin(i),Math.cos(i),s);if(i-=(r-t)/Math.sqrt(u),n>0&&Math.abs(r-t)<=4*xs()*t)break}return i}(n,s,r);return 1&u?h=ws()*(u+1)-h:h+=ws()*u,i*h}function rt(t,s,e){(0,i.g)((0!==t?1:0)+(0!==s?1:0)+1>1);let n=t,r=s,u=e;for(;;){const t=Math.sqrt(n*r)+Math.sqrt(r*u)+Math.sqrt(u*n);n=.25*(n+t),r=.25*(r+t),u=.25*(u+t);const s=(n+r+u)/3,e=(s-n)/s,i=(s-r)/s,h=(s-u)/s;if(Math.abs(e)<=.0024&&Math.abs(i)<=.0024&&Math.abs(h)<=.0024){const t=e*i-h*h,n=e*i*h;return(1+(1/24*t-.1-3/44*n-5*t*t/208+t*n/16)*t+(1/14+3*n/104)*n)/Math.sqrt(s)}}}function ut(t,s,e){(0,i.g)(0!==t||0!==s);let r=t,u=s,h=e;const o=new n(0);let a=1;for(;;){const t=.2*(r+u+3*h),s=(t-r)/t,e=(t-u)/t,i=(t-h)/t;if(Math.abs(s)<=.0015&&Math.abs(e)<=.0015&&Math.abs(i)<=.0015){const n=s*e,r=i*i,u=n-r,h=n-6*r,m=h+u+u,c=3/26,l=h*(9/22*.25*h-.21428571428571427-1.5*c*i*m),f=i*(1/6*m+i*(-.4090909090909091*u+i*c*n));return 3*o.getResult()+a*(1+l+f)/(t*Math.sqrt(t))}const n=Math.sqrt(r),m=Math.sqrt(u),c=Math.sqrt(h),l=n*(m+c)+m*c;o.add(a/(c*(h+l))),a*=.25,r=.25*(r+l),u=.25*(u+l),h=.25*(h+l)}}function ht(t,s,e){return t<.999?1-e*k(t):1-e+e*k(s)}function ot(t,s,e,n,r){return 0===t?0===n?s:1===n?e:r:1===t?0===n?s:1===n?e:C(s,e,n):(2===t&&(0,i.b)("angular interpolation"),void(0,i.b)(""))}function at(t,s,e,n,r,u,h,o){if(0===t)for(let t=0;t<u;++t)n[t+r]=0===h?s[t]:1===h?e[t]:o;else if(1===t)if(0===h)mt(n,s,r,0,u);else if(1===h)mt(n,e,r,0,u);else for(let t=0;t<u;++t)n[t+r]=C(s[t],e[t],h);else if(2===t)if(0===h)mt(n,s,r,0,u);else if(1===h)mt(n,e,r,0,u);else{let t=0;for(let i=0,o=r;i<u;++i,++o)n[o]=C(s[i],e[i],h),t+=n[o]*n[o];if(t>0){t=Math.sqrt(t);for(let s=r;s<r+u;++s)n[s]/=t}else{for(let t=r;t<r+u;++t)n[t]=0;n[r]=1}}else(0,i.b)("")}function mt(t,s,e,i,n){if(0===n)return;let r=0,u=e,h=i;for(;r++<n;)t[u++]=s[h++]}function ct(t,s,e){let i=0;for(let n=0;!i&&n<e;++n)i=t[n]-s[n];return i}function lt(t,s){return t}function ft(t){t.sort(((t,s)=>t<s?-1:t>s?1:0))}function _t(t,s){const e=t.slice(0,s);ft(e),mt(t,e,0,0,s)}function vt(t,s,e,i){const n=t.slice(s,s+e);n.sort(i),mt(t,n,s,0,e)}function bt(t,s){return t<s?-1:t>s?1:0}function dt(t,s,e,i){return t<e?-1:t>e?1:s<i?-1:s>i?1:0}function pt(t,s){if(t.length<2)return t.length;let e=0;for(let i=1;i<t.length;++i)s(t[i],t[e])||(e++,t[i]=lt(t[e],t[e]=t[i]));return 1+e}function xt(t,s){t[s]=t.at(-1),t.pop()}function Nt(t,s=!1){return{[Symbol.dispose](){this.bForget||t()},bForget:s}}function yt(t,s,e){t.length=s,t.fill(e)}function gt(t,s,e){t.length=e;for(let i=0;i<e;++i)t[i]=new s}function Tt(t,s){const e=new Array(s);for(let i=0;i<s;++i)e[i]=new t;return e}function Et(t,s,e){for(let i=0;i<e;++i)t[i].assign(s[i]);return e}function Mt(t,s){const e=t.slice(0,s);for(let t=0;t<s;++t)e[t]=e[t].clone();return e}function wt(t){return Array.from({length:t},(()=>null))}function It(t,s){return Array.from({length:s},(()=>t()))}function Dt(t,s){const e=new Array(t);return e.fill(s),e}function Pt(t,s){return s in t&&1===Object.getOwnPropertyNames(t).length}class At{constructor(...t){this.m_elts=t}get length(){return this.m_elts.length}at(t){return this.m_elts[t]}[Symbol.dispose](){for(const t of this.m_elts)t[Symbol.dispose]()}}function qt(t,s){return{first:t,second:s}}const zt=Math.PI,Ct=2*Math.PI,Zt=.5*Math.PI;class Bt{constructor(t,s){this.m_cr=t,this.m_cc=s,this.m_v=Dt(t*s,0)}get(t,s){return this.m_v[t*this.m_cc+s]}set(t,s,e){this.m_v[t*this.m_cc+s]=e}inc(t,s){return++this.m_v[t*this.m_cc+s]}}const Rt=new ArrayBuffer(8),Gt=new Float64Array(Rt),kt=new BigUint64Array(Rt),St=0x0fffffffffffffn;function Lt(){return Number.EPSILON*vs}function Ft(t){return Gt[0]=t,kt[0]}function Ot(t){return Ft(t)&St}function Qt(t){return Number((9218868437227405312n&Ft(t))>>52n)}function Ut(t){if(0n===t)return-1n;if(1n===t||-1n===t)return 0n;t<0n&&(t=-t);let s=0n,e=512n,i=1n<<s+e;for(;t>=i;)s+=e,e<<=1n,i<<=e;let n=s;e>>=1n;let r=n+e;for(;e>0n;)t<1n<<r||(n=r),e>>=1n,r=n+e;return n}function Vt(t,s){return t===s||Number.isNaN(t)&&Number.isNaN(s)}function jt(t,s,e){return t===s||Math.abs(t-s)<=e||Number.isNaN(t)&&Number.isNaN(s)}function Yt(t,s){return t<s?-1:t>s?1:0}function $t(t,s){if(t<s)return-1;if(t>s)return 1;if(t===s)return 0;{const e=Number.isNaN(t),i=Number.isNaN(s);return e<i?-1:e>i?1:0}}function Ht(){return 2147483647}function Wt(){return 32767}function Xt(){return 2147483647}function Jt(){return-2147483648}const Kt=2147483647,ts=BigInt(Kt),ss=2166136261,es=16777619,is=14695981039346656037n,ns=1099511628211n;function rs(t){let s=ss;for(let e=0,i=t.length;e<i;++e)s=(s^t.charCodeAt(e))*es;return s&Kt}function us(t,s){return s+2654435769+(t<<6)+(t>>2)&Kt}function hs(t,s){return us(t,cs(s))}function os(t){return us(3735928559,t)}function as(t,s){return us(t,os(s))}function ms(t){return function(t){let s=ss,e=t;return s=(s^255&e)*es,e>>=8,s=(s^255&e)*es,e>>=8,s=(s^255&e)*es,e>>=8,s=(s^255&e)*es,s&Kt}(t)}function cs(t){return Number(function(t){let s=is,e=t;return s=(s^0xffn&e)*ns,e>>=8n,s=(s^0xffn&e)*ns,e>>=8n,s=(s^0xffn&e)*ns,e>>=8n,s=(s^0xffn&e)*ns,e>>=8n,s=(s^0xffn&e)*ns,e>>=8n,s=(s^0xffn&e)*ns,e>>=8n,s=(s^0xffn&e)*ns,s&ts}(t))}function ls(t){return cs(Ft(function(t){return Ps(t)}(t)))}function fs(t){return function(t){return 1103515245*t+12345&2147483647}(t)}const _s=100,vs=100;function bs(){return Number.EPSILON*_s}function ds(){return.38196601125010515}function ps(){return 1.4142135623730951}function xs(){return Number.EPSILON}function Ns(t,s,e){return t===s||t===e}function ys(t,s,e){return t>=s?t<=e?t:e:s}function gs(t,s,e){const i=t[0];if(i>=s){if(i<=e)return!1;t[0]=e}else t[0]=s;return!0}function Ts(t,s){return t>=s?s:t<-s?-s:t}function Es(){return zt}function Ms(){return Ct}function ws(){return Zt}const Is=3*ws();function Ds(){return Is}function Ps(t){return t+0}function As(t){return{v:t}}class qs{constructor(){this.m_rn=As(0n),this.m_rd=As(1n),this.m_bNaN=!1,this.m_bNormalized=!1,this.m_power=0,this.m_sign=0}static constructAssign(t,s){const e=t.clone();return void 0!==s&&e.limitPrecisionThis(s),e}static constructDouble(t){return(new qs).setDouble(t)}static constructInt64(t){return(new qs).setInt64(t)}static constructRational(t,s){return(new qs).setRational(t,s)}static constructInt32(t){return this.constructInt64(BigInt(Math.trunc(t)))}[Symbol.toPrimitive](t){return this}compare(t){return this.lt(t)?-1:this.gt(t)?1:0}assignCopy(t){return this.setThis(t)}abs(){return this.clone().absThis()}absThis(){return this.isNAN()||(this.m_sign*=this.m_sign),this}clone(){return(new qs).setThis(this)}setThis(t){return this.m_bNaN=t.m_bNaN,this.m_bNormalized=t.m_bNormalized,this.m_rn.v=t.m_rn.v,this.m_rd.v=t.m_rd.v,this.m_power=t.m_power,this.m_sign=t.m_sign,this}setZero(){return this.m_rn.v=0n,this.m_rd.v=1n,this.m_bNaN=!1,this.m_power=0,this.m_bNormalized=!0,this.m_sign=0,this}setDouble(t){if(this.setZero(),0===t)return this;if(Number.isInteger(t)&&Math.abs(t)<2147483647)return this.setInt32(t);const s=Ft(t),e=(s&qs.s_em)>>52n,n=!!(s&qs.s_sm),r=s&qs.s_fm;if(e===qs.s_emax)return r?(this.m_rn.v=this.m_rd.v=0n,this.m_bNaN=!0,this):(this.m_rn.v=n?-1n:1n,this.m_rd.v=0n,this);0n===e&&(0,i.b)("denormalized numbers not yet implemented");const u=e-1023n,h=u>=0n?u:0n,o=u<0n?-u:0n;return this.m_rn.v=(1n<<52n|r)<<h,this.m_rd.v=1n<<52n+o,this.m_sign=n?-1:1,this.m_bNormalized=!1,this.normalizeThis()}setInt64(t){return 0n===t?this.setZero():(this.m_bNaN=!1,this.m_sign=t>0n?1:-1,this.m_rn.v=t>0n?t:-t,this.m_rd.v=1n,this.m_power=0,this.m_bNormalized=!1,this.normalizeThis())}setRational(t,s){return 0n===t?0n===s?this.setNAN():this.setZero():0n===s?t>0n?this.setPositiveInf():this.setNegativeInf():(this.m_sign=(t>0n?1:-1)*(s>0n?1:-1),this.m_rn.v=t>0n?t:-t,this.m_rd.v=s>0n?s:-s,this.m_power=0,this.m_bNormalized=!1,this.normalizeThis())}setInt32(t){return this.setInt64(BigInt(Math.trunc(t)))}getDouble(){return this.convertToDouble()}toDouble(){return this.convertToDouble()}value(){return this.convertToDouble()}isNAN(){return this.m_bNaN}isPositiveInf(){return!this.isNAN()&&0n===this.m_rd.v&&1===this.m_sign}isNegativeInf(){return!this.isNAN()&&0n===this.m_rd.v&&-1===this.m_sign}isFinite(){return!this.isNAN()&&0n!==this.m_rd.v}setNAN(){return this.m_bNaN=!0,this.m_rn.v=0n,this.m_rd.v=0n,this.m_power=0,this.m_bNormalized=!0,this}setPositiveInf(){return this.m_rn.v=1n,this.m_rd.v=0n,this.m_bNaN=!1,this.m_bNormalized=!0,this.m_sign=1,this.m_power=0,this}setNegativeInf(){return this.m_rn.v=1n,this.m_rd.v=0n,this.m_bNaN=!1,this.m_bNormalized=!0,this.m_sign=-1,this.m_power=0,this}subThis(t){if(t.isNAN()&&this.setNAN(),this.isPositiveInf()&&t.isPositiveInf())this.setNAN();else{if(this.isPositiveInf()&&t.isNegativeInf())return this.setPositiveInf(),this;if(this.isNegativeInf()&&t.isNegativeInf())this.setNAN();else if(this.isNegativeInf()&&t.isPositiveInf())return this.setNegativeInf(),this}return this.isNAN()?this:this.opPlusMinus(t,!1)}thisSubAbs(t){return(0,i.g)(0),this}mulThis(t){return t.isNAN()&&this.setNAN(),this.isNAN()?this:(this.m_sign*=t.m_sign,0===this.m_sign?this.setZero():(this.m_rn.v*=t.m_rn.v,this.m_rd.v*=t.m_rd.v,this.m_power+=t.m_power,this.m_bNormalized=!1,this.normalizeThis(),this))}mulDoubleThis(t){return this.mulThis(qs.constructDouble(t))}thisMulInt64(t){return(0,i.g)(0),this}thisMulInt32(t){return(0,i.g)(0),this}divThis(t){return this.mulThis(t.clone().invertThis())}divDoubleThis(t){return this.divThis(qs.constructDouble(t))}addDoubleThis(t){return this.addThis(qs.constructDouble(t))}subDoubleThis(t){return this.subThis(qs.constructDouble(t))}mul(t){return this.clone().mulThis(t)}mulBigIntThis(t){return this.mulThis(qs.constructInt64(t))}mulDouble(t){return this.clone().mulThis(qs.constructDouble(t))}div(t){return this.clone().divThis(t)}divDouble(t){return this.clone().divDoubleThis(t)}add(t){return this.clone().addThis(t)}fmSubThis(t,s){return this.subThis(t.clone().mulThis(s))}fmAddThis(t,s){return this.addThis(t.clone().mulThis(s))}addThis(t){if(t.isNAN()&&this.setNAN(),this.isPositiveInf()&&t.isPositiveInf())return this.setPositiveInf(),this;if(this.isPositiveInf()&&t.isNegativeInf())this.setNAN();else{if(this.isNegativeInf()&&t.isNegativeInf())return this.setNegativeInf(),this;this.isNegativeInf()&&t.isPositiveInf()&&this.setNAN()}return this.isNAN()?this:this.opPlusMinus(t,!0)}addDouble(t){return this.clone().addThis(qs.constructDouble(t))}sub(t){return this.clone().subThis(t)}subDouble(t){return this.clone().subThis(qs.constructDouble(t))}isZero(){return 0===this.m_sign}equals(t){return this.clone().subThis(t).isZero()}lt(t){return!this.isNAN()&&!t.isNAN()&&!(this.isPositiveInf()&&t.isPositiveInf()||this.isNegativeInf()&&t.isNegativeInf())&&!this.isPositiveInf()&&(!!t.isPositiveInf()||this.clone().sub(t).LZ())}absLessAbs(t){return this.abs().lt(t.abs())}gt(t){return this.clone().sub(t).GZ()}lte(t){return this.sub(t).LEZ()}gte(t){return this.sub(t).GEZ()}normalizeThis(){if(this.m_bNormalized)return this;if(0n===this.m_rn.v)return this.setZero();let t=0,s=0xffffffffn;for(;0n===(this.m_rn.v&s)&&s<=this.m_rn.v;)s<<=32n,t+=32;s&=this.m_rn.v,s>>=BigInt(t),t+=h(BigInt.asUintN(32,s))-1;let e=0;for(s=0xffffffffn;0n===(this.m_rd.v&s)&&s<=this.m_rd.v;)s<<=32n,e+=32;return s&=this.m_rd.v,s>>=BigInt(e),e+=h(BigInt.asUintN(32,s))-1,this.m_rn.v>>=BigInt(t),this.m_rd.v>>=BigInt(e),this.m_power+=t-e,this.m_rn.v>1n&&this.m_rd.v>1n&&(this.m_rn.v%this.m_rd.v===0n?(this.m_rn.v/=this.m_rd.v,this.m_rd.v=1n):this.m_rd.v%this.m_rn.v===0n&&(this.m_rd.v/=this.m_rn.v,this.m_rn.v=1n)),this.m_bNormalized=!0,this}negateThis(){return this.isNAN()||(this.m_sign*=-1),this}negate(){return this.clone().negateThis()}invertThis(){return this.isNAN()?this:this.isPositiveInf()||this.isNegativeInf()?(this.setZero(),this):0n===this.m_rn.v?(this.setPositiveInf(),this):(this.m_rd=lt(this.m_rn,this.m_rn=this.m_rd),this.m_power=-this.m_power,this)}limitPrecisionThis(t){if(0===t)return this;if(this.isZero())return this.setZero();if(!this.isFinite())return this;this.normalizeThis();let s=Number(Ut(this.m_rn.v));if(s>t){const e=s-t;this.m_rn.v>>=BigInt(s-t),this.m_power+=e}if(s=Number(Ut(this.m_rd.v)),s>t){const e=s-t;this.m_rd.v>>=BigInt(s-t),this.m_power-=e}return this}hiBitIndex(){return Math.max(Number(Ut(this.m_rn.v)),Number(Ut(this.m_rd.v)))}ldexp(t){return this.clone().ldexpThis(t)}ldexpThis(t){return t&&(this.m_bNormalized=!1,this.m_power+=t,this.normalizeThis()),this}LZ(){return!this.isNAN()&&-1===this.m_sign}GZ(){return!this.isNAN()&&1===this.m_sign}LEZ(){return!this.isNAN()&&this.m_sign<=0}GEZ(){return!this.isNAN()&&this.m_sign>=0}toString(){return this.toDouble().toString()}sqr(){return this.clone().sqrThis()}sqrThis(){return this.mulThis(this.clone())}static sqrt(t,s){if(t.m_sign<0n&&(0,i.n)("MP_value: sqrt(-1)"),t.isZero())return t.clone();let e=52,n=2220446049250313e-31;for(;e<s;)2*e<=s?(n*=n,e*=2):(n*=2220446049250313e-31,e+=52);e+=52;const r=Ut(t.m_rn.v),u=Ut(t.m_rd.v);let h,o=t.m_power+Number(r-u);const a=new qs;Math.abs(o)>200?(1&Math.abs(o)&&(o+=1),h=qs.constructAssign(t,53).ldexpThis(-o).value(),a.setThis(t).ldexpThis(-o),(0,i.g)(Number.isFinite(h))):(a.setThis(t),h=a.value(),(0,i.g)(Number.isFinite(h)),o=0),h=Math.sqrt(h);const m=qs.constructDouble(h),c=qs.constructDouble(n);c.mulThis(m).ldexpThis(1);const l=n*h*2,f=m.clone(),_=new qs;let v;for(let t=0;t<10;++t){f.mulThis(m),_.setThis(a).subThis(f).absThis();let t=_.value();if(v=1,t<.9)for(;t>l;)t*=t,++v;else v=4;if(_.lte(c))break;for(let t=0;t<v;t++)f.setThis(m).divThis(a).invertThis().addThis(m).ldexpThis(-1).limitPrecisionThis(e),m.setThis(f)}return m.ldexpThis(o/2)}static cubicRoot(t,s){if(t.isZero())return t.clone();let e=52,i=2220446049250313e-31;for(;e<s;)2*e<=s?(i*=i,e*=2):(i*=2220446049250313e-31,e+=52);e+=52;const n=Math.pow(Math.abs(t.value()),1/3),r=qs.constructDouble(n),u=r.clone();u.sqrThis().mulDoubleThis(3).mulDoubleThis(i),u.limitPrecisionThis(32),t.LZ()&&r.negateThis();for(let s=0;s<10;++s){const s=r.clone();s.sqrThis().mulThis(r);const i=s.clone();if(i.subThis(t),i.absThis().limitPrecisionThis(32),i.lte(u))break;i.setThis(t),i.ldexpThis(1),i.addThis(s);const n=s.clone();n.ldexpThis(1),n.addThis(t),i.divThis(n),r.mulThis(i),r.limitPrecisionThis(e)}return r}isInTheRangeOfDouble(){return(0,i.g)(0),!1}sign(){return this.m_sign}cosAndSin(t,s){(0,i.g)(0)}static nan(){return(0,i.g)(0),new qs}convertToDouble(){if(this.m_bNaN)return Number.NaN;if(this.isZero())return 0;if(0n===this.m_rd.v)return 1===this.m_sign?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;const t=-1===this.m_sign,s=this.m_rn.v<<(this.m_power>=0?BigInt(this.m_power):0n);let e=this.m_rd.v<<(this.m_power<0?BigInt(-this.m_power):0n);const i=s/e;let n=Number(i);if(BigInt(n)!==i)return t?-n:n;let r=s-i*e;if(r){let t=Ut(e)-1023n;t>0n&&(e>>=t,r<<=52n,r>>=t);let s=Number(r);Number.isFinite(s)||(r>>=52n,s=Number(r),t=0n),t>0n&&(s/=Math.pow(2,52)),n+=s/Number(e)}return t?-n:n}signVal(){return 1===this.m_sign?1n:-1===this.m_sign?-1n:0n}opPlusMinus(t,s){const e=Math.min(this.m_power,t.m_power);let i,n;this.m_power>e?(i=BigInt(this.m_power-e),n=0n):(i=0n,n=BigInt(t.m_power-e));const r=this.signVal()*this.m_rn.v*t.m_rd.v<<i,u=t.signVal()*t.m_rn.v*this.m_rd.v<<n;return this.m_rn.v=s?r+u:r-u,this.m_rd.v*=t.m_rd.v,this.m_power=e,this.m_sign=1,this.m_rn.v<0n&&(this.m_sign=-1,this.m_rn.v=-this.m_rn.v),this.m_bNormalized=!1,this.normalizeThis(),this}}qs.s_sm=0x8000000000000000n,qs.s_em=0x7ff0000000000000n,qs.s_fm=0x000fffffffffffffn,qs.s_emax=0x7ffn;const zs=qs.constructInt32(1),Cs=qs.constructInt32(0);function Zs(t,s){let e=Qt(t);const i=Qt(s);return e===i?(e-=53-function(t,s){return function(t){let s=0;return 0xffffffff00000000n&t&&(s=32,t>>=32n),s+function(t){let s=0;return 4294901760n&t&&(s+=16,t>>=16n),65280n&t&&(s+=8,t>>=8n),240n&t&&(s+=4,t>>=4n),s+u[Number(BigInt.asUintN(4,t))]+1}(t)}(t^s)}(Ot(t),Ot(s)),e):e>i?e:i}function Bs(t,s){for(let e=0,i=0,n=t.length;e<n;e+=2,i++)s[i].x=t[e],s[i].y=t[e+1]}function Rs(t){const s=new Float64Array(2*t.length);for(let e=0,i=t.length;e<i;++e){const i=e<<1;s[i]=t[e].x,s[i+1]=t[e].y}return s}function Gs(t){const s=Tt(ks,t.length);for(let e=0,i=t.length;e<i;++e)s[e].setCoords(t[e][0],t[e][1]);return s}class ks{static construct(t,s){return new ks(t,s)}constructor(t,s){void 0!==t?(this.x=t,this.y=s):this.x=this.y=Number.NaN}clone(){return new ks(this.x,this.y)}assign(t){this.setCoordsPoint2D(t)}setCoords(t,s){return this.x=t,this.y=s,this}setCoordsPoint2D(t){this.x=t.x,this.y=t.y}isEqualPoint2D(t,s){return void 0!==s?Math.abs(this.x-t.x)<=s&&Math.abs(this.y-t.y)<=s:this.x===t.x&&this.y===t.y}isEqual(t,s,e){return void 0!==e?Math.abs(this.x-t)<=e&&Math.abs(this.y-s)<=e:this.x===t&&this.y===s}equalsPoint2D(t,s){return this.isEqualPoint2D(t,s)}setSub(t,s){this.x=t.x-s.x,this.y=t.y-s.y}addThis(t){return this.x+=t.x,this.y+=t.y,this}setAdd(t,s){return this.x=t.x+s.x,this.y=t.y+s.y,this}absoluteOther(t){}absolute(){return(0,i.g)(0),this}setNegate(){this.x=-this.x,this.y=-this.y}setNegateOther(t){this.x=-t.x,this.y=-t.y}interpolateThis(t,s){}interpolate(t,s,e){(0,i.g)(0)}scaleAddThis(t,s){this.x=this.x*t+s.x,this.y=this.y*t+s.y}setScaleAdd(t,s,e){this.x=s.x*t+e.x,this.y=s.y*t+e.y}scaleOther(t,s){(0,i.g)(0)}scale(t){this.x*=t,this.y*=t}compare(t){return this.y<t.y?-1:this.y>t.y?1:this.x<t.x?-1:this.x>t.x?1:0}compareX(t){return this.x<t.x?-1:this.x>t.x?1:this.y<t.y?-1:this.y>t.y?1:0}normalizeOther(t){(0,i.g)(0)}normalize(){const t=this.length();return t?(this.x/=t,this.y/=t):(this.x=1,this.y=0),this}getUnitVector(){return this.clone().normalize()}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}sqrLength(){return this.x*this.x+this.y*this.y}static averageFast(t,s){return(0,i.g)(0),{}}static average(t,s){const e=new ks;if(0===s)return e.setNAN(),e;if(1===s)return e.assign(t[0]),e;const i=new n(t[0].x),r=new n(t[0].y);for(let e=1;e<s;e++)i.add(t[e].x),r.add(t[e].y),255&e||(i.normalize(),r.normalize());return e.x=i.getResult()/s,e.y=r.getResult()/s,e}static calculateLength(t,s){const e=new n(0);for(let i=1;i<s;i++)e.add(ks.distance(t[i],t[i-1]));return e.getResult()}offset(t,s){const e=ks.distance(t,s),i=ks.construct(this.x,this.y);if(0===e)return ks.distance(i,t);const n=s.clone();return n.subThis(t),i.subThis(t),i.crossProduct(n)/e}side(t,s){return t.equals(s)?this.equals(t)?0:1:ks.orientationRobust(s,t,this)}static sqrDistance(t,s){const e=t.x-s.x,i=t.y-s.y;return e*e+i*i}static sqrDistanceCoords(t,s,e,i){const n=e-t,r=i-s;return n*n+r*r}static distance(t,s){return Math.sqrt(ks.sqrDistance(t,s))}dotProduct(t){return this.x*t.x+this.y*t.y}dotProductAbs(t){return Math.abs(this.x*t.x)+Math.abs(this.y*t.y)}crossProduct(t){return this.x*t.y-this.y*t.x}crossProductAbs(t){return(0,i.g)(0),0}rotateDirect(t,s){const e=this.x*t-this.y*s,i=this.x*s+this.y*t;this.x=e,this.y=i}rotateReverse(t,s){const e=this.x*t+this.y*s,i=-this.x*s+this.y*t;this.x=e,this.y=i}leftPerpendicularThis(){const t=this.x;this.x=-this.y,this.y=t}leftPerpendicularOther(t){const s=t.x;this.x=-t.y,this.y=s}rightPerpendicularThis(){const t=this.x;this.x=this.y,this.y=-t}rightPerpendicularOther(t){const s=t.x;this.x=t.y,this.y=-s}equals(t){return this.x===t.x&&this.y===t.y}notequals(t){return this.x!==t.x||this.y!==t.y}not(){return!this.x&&!this.y}gt(t){return this.y>t.y||this.y===t.y&&this.x>t.x}gte(t){return!this.lt(t)}lt(t){return this.y<t.y||this.y===t.y&&this.x<t.x}lte(t){return!this.gt(t)}subThis(t){return this.x-=t.x,this.y-=t.y,this}divThis(t){return this.x/=t,this.y/=t,this}add(t){return new ks(this.x+t.x,this.y+t.y)}sub(t){return new ks(this.x-t.x,this.y-t.y)}negateThis(){return this.x=-this.x,this.y=-this.y,this}negate(){return new ks(-this.x,-this.y)}mul(t){return new ks(this.x*t,this.y*t)}mulThis(t){return this.x*=t,this.y*=t,this}divide(t){return new ks(this.x/t,this.y/t)}setNAN(){this.x=this.y=Number.NaN}isNAN(){return Number.isNaN(this.x)||Number.isNaN(this.y)}static getNAN(){return new ks(Number.NaN,Number.NaN)}isFinite(){return Number.isFinite(this.x)&&Number.isFinite(this.y)}isZero(){return 0===this.x&&0===this.y}norm(t){switch(t){case 0:{const t=Math.abs(this.x),s=Math.abs(this.y),e=t-s;return e>=0?t:e<=0?s:Number.NaN}case 1:return Math.abs(this.x)+Math.abs(this.y);case 2:return Math.sqrt(this.x*this.x+this.y*this.y);default:(0,i.t)("norm")}}getQuarter(){return ks.getQuarterCoords(this.x,this.y)}static getQuarterCoords(t,s){return t>0?s>=0?1:4:s>0?2:0===t?4:3}static compareVectors(t,s){const e=t.getQuarter(),i=s.getQuarter();return i===e?ks.orientationRobustImpl(ks.construct(0,0),s,t,!0):e<i?-1:1}static compareVectorsOrigin(t,s,e){const i=s.sub(t),n=e.sub(t),r=i.getQuarter(),u=n.getQuarter();return u===r?ks.orientationRobustImpl(t,e,s,!0):r<u?-1:1}static orientationRobust(t,s,e){return ks.orientationRobustImpl(t,s,e,!1)}static orientationRobustEx(t,s,e,i){if(t.equals(s)||e.equals(i))return 0;const n=s.x-t.x,r=s.y-t.y,u=i.x-e.x,h=i.y-e.y;{const t=ks.getQuarterCoords(n,r)-1,s=ks.getQuarterCoords(u,h)-1,e=ks.d[t][s];if(0!==e)return e}const o=n*h,a=r*u,m=4*xs()*(Math.abs(o)+Math.abs(a)),c=o-a;return Math.abs(c)>=m?c<0?-1:c>0?1:0:ks.orientationRobustExMp(t,s,e,i)}static orientationRobustExMp(t,s,e,i){const n=qs.constructDouble(s.x),r=qs.constructDouble(i.x);n.subThis(qs.constructDouble(t.x)),r.subThis(qs.constructDouble(e.x));const u=qs.constructDouble(s.y),h=qs.constructDouble(i.y);return u.subThis(qs.constructDouble(t.y)),h.subThis(qs.constructDouble(e.y)),n.mulThis(h),u.mulThis(r),n.subThis(u),n.LZ()?-1:n.GZ()?1:0}static orientationNonRobust(t,s,e){const i=s.sub(t).crossProduct(e.sub(t));return i<0?-1:i>0?1:0}static orientationRobustImpl(t,s,e,i){if(s.isEqualPoint2D(t)||e.isEqualPoint2D(t)||s.isEqualPoint2D(e))return 0;const n=s.x-t.x,r=s.y-t.y,u=e.x-t.x,h=e.y-t.y;if(!i){const t=ks.getQuarterCoords(n,r)-1,s=ks.getQuarterCoords(u,h)-1,e=ks.d[t][s];if(0!==e)return e}const o=(Math.abs(n)+Math.abs(r)+Math.abs(u)+Math.abs(h))*(Math.abs(s.x)+Math.abs(s.y)+Math.abs(e.x)+Math.abs(e.y))*8*v(),a=n*h-r*u;if(Math.abs(a)>o)return a<0?-1:1;if(_(s.x,t.x)&&_(e.y,t.y)&&_(s.y,t.y)&&_(e.x,t.x)&&l(n,h)&&l(r,u)){const t=n*h,s=r*u;if(_(t,s)){const e=t-s;return e<0?-1:e>0?1:0}}return ks.orientationRobustMp(t,s,e)}static orientationRobustMp(t,s,e){const i=qs.constructDouble(s.x),n=qs.constructDouble(e.x);{const s=qs.constructDouble(t.x);i.subThis(s),n.subThis(s)}const r=qs.constructDouble(e.y),u=qs.constructDouble(s.y);{const s=qs.constructDouble(t.y);r.subThis(s),u.subThis(s)}return i.mulThis(r),u.mulThis(n),i.subThis(u),i.LZ()?-1:i.GZ()?1:0}static inCircleRobust(t,s,e,i){const n=new c,r=new c;n.set(t.x),n.subThis(i.x),r.set(t.y),r.subThis(i.y);const u=new c,h=new c;u.set(s.x),u.subThis(i.x),h.set(s.y),h.subThis(i.y);const o=new c,a=new c;o.set(e.x),o.subThis(i.x),a.set(e.y),a.subThis(i.y);const m=n.mulE(h).subE(r.mulE(u)),l=u.mulE(a).subE(h.mulE(o)),f=n.mulE(a).subE(r.mulE(o)),_=n.mulE(n).addE(r.mulE(r)),v=u.mulE(u).addE(h.mulE(h)),b=o.mulE(o).addE(a.mulE(a)),d=_.mulE(l).subE(v.mulE(f)).addE(b.mulE(m));if(!d.isFuzzyZero()){const t=d.value();return t<0?-1:t>0?1:0}return ks.inCircleRobustMp(t,s,e,i)}static inCircleRobustMp(t,s,e,i){do{if(!_(t.x,i.x)||!_(t.y,i.y))break;if(!_(s.x,i.x)||!_(s.y,i.y))break;if(!_(e.x,i.x)||!_(e.y,i.y))break;const n=t.x-i.x,r=t.y-i.y,u=s.x-i.x,h=s.y-i.y,o=e.x-i.x,a=e.y-i.y;if(!l(n,h)||!l(r,u))break;if(!l(u,a)||!l(h,o))break;if(!l(n,a)||!l(r,o))break;if(!l(n,n)||!l(r,r))break;if(!l(u,u)||!l(h,h))break;if(!l(o,o)||!l(a,a))break;const m=n*h,c=r*u,v=u*a,b=h*o,d=n*a,p=r*o,x=n*n,N=r*r,y=u*u,g=h*h,T=o*o,E=a*a;if(!_(m,c))break;if(!_(v,b))break;if(!_(d,p))break;if(!f(x,N))break;if(!f(y,g))break;if(!f(T,E))break;const M=m-c,w=v-b,I=d-p,D=x+N,P=y+g,A=T+E;if(!l(D,w))break;if(!l(P,I))break;if(!l(A,M))break;const q=D*w,z=P*I,C=A*M;if(!_(q,z))break;const Z=q-z;if(!f(Z,C))break;const B=Z+C;return B<0?-1:B>0?1:0}while(0);const n=qs.constructDouble(i.x),r=qs.constructDouble(i.y),u=qs.constructDouble(t.x),h=qs.constructDouble(t.y);u.subThis(n),h.subThis(r);const o=qs.constructDouble(s.x),a=qs.constructDouble(s.y);o.subThis(n),a.subThis(r);const m=qs.constructDouble(e.x),c=qs.constructDouble(e.y);m.subThis(n),c.subThis(r);const v=u.mul(a).sub(h.mul(o)),b=o.mul(c).sub(a.mul(m)),d=u.mul(c).sub(h.mul(m)),p=u.mul(u).add(h.mul(h)),x=o.mul(o).add(a.mul(a)),N=m.mul(m).add(c.mul(c)),y=p.mul(b).sub(x.mul(d)).add(N.mul(v));return y.LZ()?-1:y.GZ()?1:0}static inCircleRobustMp3Point(t,s,e){const i=qs.constructDouble(t.x),n=qs.constructDouble(t.y),r=qs.constructDouble(s.x),u=qs.constructDouble(s.y),h=qs.constructDouble(e.x),o=qs.constructDouble(e.y),a=h.mul(h).add(o.mul(o)).sub(h.mul(i).add(o.mul(n)).add(h.mul(r)).add(o.mul(u))).add(i.mul(r).add(n.mul(u)));return a.LZ()?-1:a.GZ()?1:0}static inCircleRobust3Point(t,s,e){const i=new c(t.x),n=new c(t.y),r=new c(s.x),u=new c(s.y),h=new c(e.x),o=new c(e.y),a=h.mulE(h).addE(o.mulE(o)).subE(h.mulE(i).addE(o.mulE(n)).addE(h.mulE(r)).addE(o.mulE(u))).addE(i.mulE(r).addE(n.mulE(u)));if(!a.isFuzzyZero()){const t=a.value();return t<0?-1:t>0?1:0}return ks.inCircleRobustMp3Point(t,s,e)}static calculateCircleCenterFromThreePoints(t,s,e){if(t.equals(e)||t.equals(s)||e.equals(s))return ks.getNAN();const i=function(t,s,e){const i=new c(s.x);i.subThis(t.x);const n=new c(s.y);n.subThis(t.y);const r=new c(e.x);r.subThis(t.x);const u=new c(e.y);u.subThis(t.y);const h=i.clone();h.mulThisE(u);let o=n.clone();if(o.mulThisE(r),h.subThisE(o),0===h.value())return ks.getNAN();h.mulThis(2);const a=i.clone();a.mulThisE(i);const m=n.clone();m.mulThisE(n);const l=a.clone();l.addThisE(m);const f=r.clone();f.mulThisE(r);const _=u.clone();_.mulThisE(u);const v=f.clone();v.addThisE(_);const b=n.clone();b.mulThisE(v),o=u.clone(),o.mulThisE(l),b.subThisE(o),b.divThisE(h);const d=i.clone();d.mulThisE(v),o=r.clone(),o.mulThisE(l),d.subThisE(o),d.divThisE(h);const p=ks.construct(t.x-b.value(),t.y+d.value()),x=t.sub(p).length(),N=s.sub(p).length(),y=e.sub(p).length(),g=1e-15*(x+Math.abs(t.x)+Math.abs(s.x)+Math.abs(e.x)+Math.abs(t.y)+Math.abs(s.y)+Math.abs(e.y));return Math.abs(x-N)<=g&&Math.abs(x-y)<=g&&b.eps()<g&&d.eps()<g?p:ks.getNAN()}(t,s,e);return i.isNAN()?function(t,s,e){const i=qs.constructDouble(s.x);i.subDoubleThis(t.x);const n=qs.constructDouble(s.y);n.subDoubleThis(t.y);const r=qs.constructDouble(e.x);r.subDoubleThis(t.x);const u=qs.constructDouble(e.y);u.subDoubleThis(t.y);const h=i.clone();h.mulThis(u);let o=n.clone();if(o.mulThis(r),h.subThis(o),h.isZero())return ks.getNAN();h.mulDoubleThis(2);const a=i.clone();a.mulThis(i);const m=n.clone();m.mulThis(n);const c=a.clone();c.addThis(m);const l=r.clone();l.mulThis(r);const f=u.clone();f.mulThis(u);const _=l.clone();_.addThis(f);const v=n.clone();v.mulThis(_),o=u.clone(),o.mulThis(c),v.subThis(o),v.divThis(h);const b=i.clone();return b.mulThis(_),o=r.clone(),o.mulThis(c),b.subThis(o),b.divThis(h),ks.construct(t.x-v.value(),t.y+b.value())}(t,s,e):i}static calculateAngle(t,s){return Math.atan2(t.crossProduct(s),t.dotProduct(s))}static isBisectorRobust(t,s,e){return(0,i.g)(0),!1}static size(){return 2}get 0(){return this.x}get 1(){return this.y}set 0(t){this.x=t}set 1(t){this.y=t}static compareZorder(t,s){const e=ks.c_compare_zorder_xx[t.x<0?1:0]|ks.c_compare_zorder_yy[t.y<0?1:0],i=ks.c_compare_zorder_xx[s.x<0?1:0]|ks.c_compare_zorder_yy[s.y<0?1:0];if(e===i){let e=0,i=0;for(let n=0;n<2;++n){const r=Zs(t[n],s[n]);r>e&&(e=r,i=n)}return t[i]<s[i]}return e<i}static lerp(t,s,e){const i=new ks;return R(t,s,e,i),i}static getClosestCoordinate(t,s,e,i=!1){const n=ks.getNAN();n.setSub(s,t);const r=n.sqrLength();if(0===r)return.5;if(s.isEqualPoint2D(e))return 1;const u=ks.getNAN();u.setSub(e,t);let h=u.dotProduct(n)/r;return i||(h<0?h=0:h>1&&(h=1)),h}static intersectLinesAtOnePoint(t,s,e,i){if(t.equals(s)||e.equals(i))return ks.getNAN();const n=s.x-t.x,r=e.x-i.x,u=s.y-t.y,h=e.y-i.y,o=n*h-r*u;if(!o)return ks.getNAN();const a=o;if(0===a)return ks.getNAN();let m=(e.x-t.x)*h-(e.y-t.y)*r;m/=a;const c=new ks;return R(t,s,m,c),c.isFinite()?c:ks.getNAN()}toString(){return`[${this.x},${this.y}]`}}ks.dimensions=2,ks.d=[[0,1,0,-1],[-1,0,1,0],[0,-1,0,1],[1,0,-1,0]],ks.c_compare_zorder_xx=[2,0],ks.c_compare_zorder_yy=[1,0]}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3661],{55537:(t,s,e)=>{function i(t,s){try{if(!t)throw new Error(s)}catch(t){throw t}}e.d(s,{A:()=>f,B:()=>k,C:()=>G,D:()=>Z,G:()=>m,a:()=>w,b:()=>A,c:()=>z,d:()=>R,e:()=>_,f:()=>d,g:()=>i,h:()=>x,i:()=>p,j:()=>N,k:()=>b,l:()=>v,m:()=>g,n:()=>E,o:()=>B,p:()=>D,q:()=>q,r:()=>T,s:()=>C,t:()=>M,u:()=>P,v:()=>y,w:()=>F,x:()=>I,y:()=>S,z:()=>L});class n extends Error{constructor(t,s){super(s),this.m_AdditionalMessage=s,this.m_ErrorType=t,this.name="GeometryError"}what(){return function(t){switch(t){case 1:return"Unknown error";case 2:return"Corrupted geometry";case 3:return"Empty geometry";case 4:return"Math singularity";case 5:return"Buffer is too small";case 6:return"Invalid shape type";case 7:return"Projection out of supported range";case 8:return"Non simple geometry";case 9:return"Cannot calculate geodesic";case 10:return"Notation conversion";case 11:return"Missing grid file";case 12:return"Invalid call";case 13:return"Internal error";case 14:return"Not implemented";case 15:return"IO error";case 16:return"Invalid 3D";case 17:return"An ambiguous geography edge with antipodal points";case 18:return"Geocentric coordinates require ellipsoidal height";case 19:return"Geography cannot be projected into a gnomonic plane or a result of an operation cannot fit into a gnomonic plane";case 20:return"Geometry is too large to be exported in to a given format";case 22:return"Operation is canceled by the user";case 21:return"The operation, such as projection or geodetic computation, cannot be performed without pe-wasm loaded";default:return"unknown error"}}(this.m_ErrorType)}additionalMessage(){return this.m_AdditionalMessage?this.m_AdditionalMessage:""}code(){return this.m_ErrorType}}class r extends n{constructor(t){super(2,t),this.name="CorruptedGeometryError"}}class u extends n{constructor(t){super(3,t),this.name="EmptyGeometryError"}}class h extends n{constructor(t){super(4,t),this.name="MathSingularityError"}}class o extends n{constructor(t){super(21,t),this.name="ProjectionEngineNotLoadedError"}}class a extends n{constructor(t){super(8,t),this.name="NonSimpleGeometryError"}}var m,c;(c=m||(m={}))[c.enumUnknown=0]="enumUnknown",c[c.enumPoint=513]="enumPoint",c[c.enumLine=5122]="enumLine",c[c.enumBezier=5123]="enumBezier",c[c.enumEllipticArc=5124]="enumEllipticArc",c[c.enumEnvelope=3077]="enumEnvelope",c[c.enumMultiPoint=8710]="enumMultiPoint",c[c.enumPolyline=25607]="enumPolyline",c[c.enumPolygon=27656]="enumPolygon",c[c.enumMultipatch=40969]="enumMultipatch",c[c.enumGeometryCollection=3594]="enumGeometryCollection",c[c.enumRationalBezier2=5134]="enumRationalBezier2",c[c.enumBezier2=5135]="enumBezier2",c[c.enumRationalBezier23d=5392]="enumRationalBezier23d",c[c.enumGreatArc3d=5393]="enumGreatArc3d";const l=[0,0,1,1,1,2,0,1,2,3,-1,-1,-1,-1,1,1];function f(t){return l[15&t]}function _(t){return!!(512&t)}function v(t){return!!(1024&t)}function b(t){return!!(2048&t)}function d(t){return!!(4096&t)}function p(t){return!!(8192&t)}function x(t){return!!(16384&t)}function N(t){return!!(32768&t)}function y(t){const s=t.getGeometryType();return p(s)?t.getPointCount():t.isEmpty()?0:s===m.enumEnvelope?4:s===m.enumPoint?1:d(s)?2:void z("missing type")}function g(t){const s=t.getGeometryType();if(x(s))return t.hasNonLinearSegments();if(s===m.enumGeometryCollection){const s=t;for(let t=0,e=s.getGeometryCount();t<e;t++)if(g(s.getGeometry(t)))return!0;return!1}return!!d(s)&&s!==m.enumLine}function T(t){throw new o(t)}function E(t){throw new r(t)}function M(t){throw new Error(t)}function w(t){throw new h(t)}function I(){M("Geometry type is not supported for 3D operations.")}function D(t){throw new n(12,t)}function P(t){throw new u(t)}function A(t){throw new n(14,t)}function q(t){throw new Error(t)}function z(t){throw new n(13,t)}function C(t){throw new Error(t)}function Z(t){throw new a(t)}function B(t){t&&g(t)&&A("Operation does not support curves.")}function R(t){t&&N(t.getGeometryType())&&A("Unsupported geometry type.")}function G(t){t===m.enumGeometryCollection&&M("Geometry_collection instances are not supported in this operation")}function k(t){G(t.getGeometryType())}function S(t){M(`bad wkid: ${t}`)}function L(t){let s="bad wkt: ";s+=t,s+="...",M(s)}function F(t,s){t||M(s)}},83661:(t,s,e)=>{e.d(s,{$:()=>y,A:()=>fs,B:()=>at,C:()=>vt,D:()=>ps,E:()=>a,F:()=>c,G:()=>p,H:()=>d,I:()=>jt,J:()=>Ns,K:()=>n,L:()=>Mt,M:()=>qs,N:()=>xs,O:()=>Pt,P:()=>ks,Q:()=>Z,R:()=>B,S:()=>At,T:()=>ot,U:()=>_t,V:()=>D,W:()=>P,X:()=>bt,Y:()=>Yt,Z:()=>R,_:()=>N,a:()=>mt,a0:()=>A,a1:()=>q,a2:()=>z,a3:()=>Vt,a4:()=>zt,a5:()=>Es,a6:()=>Ds,a7:()=>ws,a8:()=>Ms,a9:()=>it,aA:()=>Bs,aB:()=>Gs,aC:()=>M,aD:()=>hs,aE:()=>Wt,aF:()=>Lt,aG:()=>as,aH:()=>os,aa:()=>nt,ab:()=>Bt,ac:()=>gt,ad:()=>x,ae:()=>Cs,af:()=>zs,ag:()=>S,ah:()=>Ts,ai:()=>et,aj:()=>V,ak:()=>L,al:()=>Ps,am:()=>dt,an:()=>ds,ao:()=>Jt,ap:()=>ct,aq:()=>us,ar:()=>ms,as:()=>wt,at:()=>ls,au:()=>Et,av:()=>I,aw:()=>rs,ax:()=>gs,ay:()=>xt,az:()=>Rs,b:()=>lt,c:()=>ys,d:()=>Dt,e:()=>F,f:()=>w,g:()=>bs,h:()=>Nt,i:()=>Xt,j:()=>Ht,k:()=>Ct,l:()=>Zt,m:()=>Tt,n:()=>qt,o:()=>st,p:()=>It,q:()=>C,r:()=>$t,s:()=>k,t:()=>O,u:()=>pt,v:()=>ft,w:()=>yt,x:()=>G,y:()=>g,z:()=>E});var i=e(55537);class n{constructor(t){this.sum=t,this.compensation=0}assign(t){return this.compensation=t.compensation,this.sum=t.sum,this}reset(){this.sum=this.compensation=0}resetToStart(t){this.sum=t,this.compensation=0}normalize(){const t=[Number.NaN];this.sum=tt(this.sum,this.compensation,t),this.compensation=t[0]}add(t){const s=this.sum+t;let e;if(Math.abs(this.sum)>=Math.abs(t)){const i=this.sum-s+t;e=this.compensation+i}else{const i=t-s+this.sum;e=this.compensation+i}this.sum=s,this.compensation=e}sub(t){this.add(-t)}addProduct(t,s){const e=[0],i=W(t,s,e);this.add(i),this.add(e[0])}mul(t){const s=new n(0);s.addProduct(this.sum,t),s.addProduct(this.compensation,t),this.assign(s)}getResult(){return this.sum+this.compensation}pe(t){return this.add(t),this}me(t){return this.add(-t),this}}const r=[5,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1],u=[-1,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3];function h(t){let s=0;return 65535n&t||(s+=16,t>>=16n),255n&t||(s+=8,t>>=8n),15n&t||(s+=4,t>>=4n),s+r[Number(BigInt.asUintN(4,t))]}function o(t){let s=0;return 4294967295n&t||(s=32,t>>=32n),s+h(BigInt.asUintN(32,t))}class a{constructor(t,s){if(this.m_EnvelopeType=1,void 0!==t){if(t instanceof a)return this.vmin=t.vmin,void(this.vmax=t.vmax);this.vmin=t,this.vmax=s,this.normalize()}else this.setEmpty()}static construct(t,s){return new a(t,s)}static constructEmpty(){return new a}setCoords(t,s){this.vmin=t,this.vmax=s,this.normalize()}setCoordsFromEnvelope(t){this.vmin=t.vmin,this.vmax=t.vmax}setEmpty(){this.vmin=Number.NaN,this.vmax=Number.NaN}getCenter(){return.5*(this.vmin+this.vmax)}equalsRange(t,s){return Vt(this.vmin,t)&&Vt(this.vmax,s)}equals(t,s){return!(!this.isEmpty()||!t.isEmpty())||(void 0!==s?Math.abs(this.vmin-t.vmin)<=s&&Math.abs(this.vmax-t.vmax)<=s:this.vmin===t.vmin&&this.vmax===t.vmax)}width(){return this.vmax-this.vmin}isEmpty(){return Number.isNaN(this.vmin)||Number.isNaN(this.vmax)}isZero(){return this.vmin===this.vmax}setInfinite(){this.vmin=Number.NEGATIVE_INFINITY,this.vmax=Number.POSITIVE_INFINITY}move(t){this.isEmpty()||(this.vmin+=t,this.vmax+=t)}contains(t){return t.vmin>=this.vmin&&t.vmax<=this.vmax}containsCoordinate(t){return t>=this.vmin&&t<=this.vmax}containsRightExclusive(t){return t>=this.vmin&&t<this.vmax}containsExclusiveCoordinate(t){return t>this.vmin&&t<this.vmax}containsExclusive(t){return t.vmin>this.vmin&&t.vmax<this.vmax}isIntersecting(t){return this.vmin<=t.vmin?this.vmax>=t.vmin:t.vmax>=this.vmin}mergeCoordinate(t){if(this.isEmpty())return this.vmin=t,void(this.vmax=t);this.mergeNeCoordinate(t)}merge(t){if(t.isEmpty())return;const s=t.vmin,e=t.vmax;this.mergeCoordinate(s),this.mergeCoordinate(e)}mergeNe(t){const s=t.vmin,e=t.vmax;this.mergeNeCoordinate(s),this.mergeNeCoordinate(e)}mergeNeCoordinate(t){t<this.vmin?this.vmin=t:t>this.vmax&&(this.vmax=t)}intersect(t){this.isEmpty()||t.isEmpty()?this.setEmpty():(this.vmin<t.vmin&&(this.vmin=t.vmin),this.vmax>t.vmax&&(this.vmax=t.vmax),this.vmin>this.vmax&&this.setEmpty())}inflate(t){this.isEmpty()||(this.vmin-=t,this.vmax+=t,this.vmax<this.vmin&&this.setEmpty())}normalize(){this.vmin<=this.vmax||(this.vmin>this.vmax?this.vmax=lt(this.vmin,this.vmin=this.vmax):this.setEmpty())}isValid(){return this.isEmpty()||this.vmin<=this.vmax}snapClip(t){return ys(t,this.vmin,this.vmax)}calculateToleranceFromEnvelope(){return this.isEmpty()?bs():(Math.abs(this.vmin)+Math.abs(this.vmax)+1)*bs()}static unit(){return m}normalizeNoNAN(){this.vmin>this.vmax&&(this.vmax=lt(this.vmin,this.vmin=this.vmax))}setCoordsNoNAN(t,s){this.vmin=t,this.vmax=s,this.normalizeNoNAN()}clone(){return new a(this.vmin,this.vmax)}}const m=new a(0,1);class c{static getNAN(){return new c(Number.NaN)}constructor(t,s){this.m_value=t??0,this.m_eps=s??0}[Symbol.toPrimitive](t){return this}clone(){return new c(this.m_value,this.m_eps)}assign(t){return this.m_value=t.m_value,this.m_eps=t.m_eps,this}scaleError(t){this.m_eps*=t}setError(t){this.m_eps=t}set(t,s){return this.m_value=t,this.m_eps=s??0,this}setWithEps(t,s){return void 0===s&&(s=1),this.m_value=t,this.m_eps=c.ulp(t)*s,this}setE(t){return this.m_value=t.m_value,this.m_eps=t.m_eps,this}precise(){return new c(this.m_value)}value(){return this.m_value}toDouble(){return this.m_value}eps(){return this.m_eps}resetError(){return this.m_eps=0,this}absThis(){return this.m_value=Math.abs(this.m_value),this}add(t){return this.clone().addThis(t)}addE(t){return this.clone().addThisE(t)}addThisE(t){const s=this.m_value+t.m_value,e=this.m_eps+t.m_eps+c.ulp(s);return this.m_value=s,this.m_eps=e,this}addThis(t){const s=this.m_value+t,e=this.m_eps+c.ulp(s);return this.m_value=s,this.m_eps=e,this}subE(t){return this.clone().subThisE(t)}sub(t){return this.clone().subThis(t)}subThisE(t){const s=this.m_value-t.m_value,e=this.m_eps+t.m_eps+c.ulp(s);return this.m_value=s,this.m_eps=e,this}subThis(t){const s=this.m_value-t,e=this.m_eps+c.ulp(s);return this.m_value=s,this.m_eps=e,this}setAddE(t,s){return this.m_value=t.m_value+s.m_value,this.m_eps=t.m_eps+s.m_eps+c.ulp(this.m_value),this}setAdd(t,s){return this.m_value=t+s,this.m_eps=c.ulp(this.m_value),this}setAddEN(t,s){return this.m_value=t.m_value+s,this.m_eps=t.m_eps+c.ulp(this.m_value),this}setAddNE(t,s){return this.m_value=t+s.m_value,this.m_eps=s.m_eps+c.ulp(this.m_value),this}setSubE(t,s){return this.m_value=t.m_value-s.m_value,this.m_eps=t.m_eps+s.m_eps+c.ulp(this.m_value),this}setSub(t,s){return this.m_value=t-s,this.m_eps=c.ulp(this.m_value),this}setSubEN(t,s){return this.m_value=t.m_value-s,this.m_eps=t.m_eps+c.ulp(this.m_value),this}setSubNE(t,s){return this.m_value=t-s.m_value,this.m_eps=s.m_eps+c.ulp(this.m_value),this}mulThisE(t){const s=this.m_value*t.m_value;return this.m_eps=this.m_eps*Math.abs(t.m_value)+t.m_eps*Math.abs(this.m_value)+this.m_eps*t.m_eps+c.ulp(s),this.m_value=s,this}mulThis(t){const s=this.m_value*t;return this.m_eps=this.m_eps*Math.abs(t)+c.ulp(s),this.m_value=s,this}mul(t){return this.clone().mulThis(t)}mulE(t){return this.clone().mulThisE(t)}setMulE(t,s){const e=t.m_value*s.m_value;return this.m_eps=t.m_eps*Math.abs(s.m_value)+s.m_eps*Math.abs(t.m_value)+t.m_eps*s.m_eps+c.ulp(e),this.m_value=e,this}setMul(t,s){return this.m_value=t*s,this.m_eps=c.ulp(this.m_value),this}setMulEN(t,s){return this.setE(t),this.mulThis(s)}setMulNE(t,s){return this.setE(s),this.mulThis(t)}mulThisByPower2(t){return this.m_value*=t,this.m_eps*=Math.abs(t),this}static st_mulByPower2(t,s){return new c(t.m_value,t.m_eps).mulThisByPower2(s)}divE(t){return this.clone().divThisE(t)}divThisE(t){const s=Math.abs(t.m_value),e=this.m_value/t.m_value;let i=(this.m_eps+Math.abs(e)*t.m_eps)/s;if(t.m_eps>.01*s){const e=t.m_eps/s;i*=1+(1+e)*e}return this.m_value=e,this.m_eps=i+c.ulp(e),this}divThis(t){const s=Math.abs(t);return this.m_value/=t,this.m_eps=this.m_eps/s+c.ulp(this.m_value),this}setDivE(t,s){return this.setE(t),this.divThisE(s)}setDiv(t,s){return this.m_value=t/s,this.m_eps=c.ulp(this.m_value),this}setDivEN(t,s){return this.setE(t),this.divThis(s)}setDivNE(t,s){return this.set(t),this.divThisE(s)}divThisByPower2(t){return this.m_value/=t,this.m_eps/=Math.abs(t),this}invThis(){return this.setE(p.clone().divThisE(this)),this}sqrt(){return this.clone().sqrtThis()}sqrtThis(){let t,s;return this.m_value>=0?(t=Math.sqrt(this.m_value),s=this.m_value>10*this.m_eps?.5*this.m_eps/t:this.m_value>this.m_eps?t-Math.sqrt(this.m_value-this.m_eps):Math.max(t,Math.sqrt(this.m_value+this.m_eps)-t),s+=c.ulp(t)):this.m_value<-this.m_eps?(t=Number.NaN,s=Number.NaN):(t=0,s=Math.sqrt(this.m_eps)),this.m_value=t,this.m_eps=s,this}sqr(){return this.clone().sqrThis()}sqrThis(){const t=this.m_value*this.m_value;return this.m_eps=2*this.m_eps*Math.abs(this.m_value)+this.m_eps*this.m_eps+c.ulp(t),this.m_value=t,this}setSin(t){const s=Math.sin(t.m_value),e=Math.cos(t.m_value);this.m_value=s;const i=Math.abs(s),n=Math.abs(t.value());return this.m_eps=(Math.abs(e)+.5*i*t.m_eps)*t.m_eps+c.ulp(i+n),this}static ulp(t){let s=Ft(t);const e=((0x7ff0000000000000n&s)>>52n)-1075n;return e>-1023n?(s=e+0x3ffn<<52n,function(t){return kt[0]=t,Gt[0]}(s)):0===t?0:Number.MIN_VALUE}setCos(t){const s=Math.sin(t.m_value),e=Math.cos(t.m_value);this.m_value=e;const i=Math.abs(e),n=Math.abs(t.value());return this.m_eps=(Math.abs(s)+.5*i*t.m_eps)*t.m_eps+c.ulp(i+n),this}static st_cosAndSin(t,s,e){const i=Math.sin(t.m_value),n=Math.cos(t.m_value);e.m_value=i,s.m_value=n;const r=Math.abs(i),u=Math.abs(n),h=Math.abs(t.value());e.m_eps=(Math.abs(n)+.5*r*t.m_eps)*t.m_eps+c.ulp(r+h),s.m_eps=(Math.abs(i)+.5*u*t.m_eps)*t.m_eps+c.ulp(u+h)}negate(){return this.clone().negateThis()}negateThis(){return this.m_value=-this.m_value,this}setAbs(){return this.m_value=Math.abs(this.m_value),this}isInInterval(t){return a.construct(this.m_value-this.m_eps,this.m_value+this.m_eps).isIntersecting(t)}eq(t){return Math.abs(this.m_value-t.m_value)<=this.m_eps+t.m_eps}ne(t){return!this.eq(t)}gt(t){return this.m_value-t.m_value>this.m_eps+t.m_eps}lt(t){return t.m_value-this.m_value>this.m_eps+t.m_eps}ge(t){return!this.lt(t)}le(t){return!this.gt(t)}tolEQ(t,s){return Math.abs(this.m_value-t.m_value)<=s||this.eq(t)}tolNE(t,s){return!this.tolEQ(t,s)}tolGT(t,s){return this.m_value-t.m_value>s&&this.gt(t)}tolLT(t,s){return t.m_value-this.m_value>s&&this.lt(t)}tolGE(t,s){return!this.tolLT(t,s)}tolLE(t,s){return!this.tolGT(t,s)}isZero(){return Math.abs(this.m_value)<=this.m_eps}isFuzzyZero(){return this.isZero()&&0!==this.m_eps}tolIsZero(t){return Math.abs(this.m_value)<=Math.max(this.m_eps,t)}setPi(){this.setE(b)}setEuler(){this.set(2.718281828459045,v())}static size(){return 1}}function l(t,s){const e=Ot(t),i=Ot(s),n=53-o(e),r=53-o(i);return(n>=0?n:0)+(r>=0?r:0)<=52}function f(t,s){const e=t+s;return e-t===s&&e-s===t}function _(t,s){const e=t-s;return t-e===s&&s+e===t}function v(){return xs()}c.dimensions=1;const b=new c(Math.PI,.5*v()),d=new c(0,0),p=new c(1,0),x=new c(4,0);function N(t,s,e){return t.addE(s.subE(t).mulE(e))}function y(t,s,e){return s.subE(s.subE(t).mulE(p.subE(e)))}function g(t){let s;if(0===t)s=1;else if(Math.abs(t)>.01)s=function(t){return Math.atanh(t)}(t)/t;else{let e;const i=-36.841361487904734;s=0;const n=t*t;for(let t=2*Math.trunc(i/Math.log(n)+2.5)-1;t>1;t-=2)e=1/t,s=(s+e)*n;s+=1}return s}function T(t){const s=Math.PI*Math.PI/6;let e;if(1===t)e=s;else if(t>1)e=s;else if(0===t)e=t;else if(t<0){const s=1+(t=Math.abs(t)),i=Math.log(s);e=i*i/-2-T(t/s)}else if(t>.5){const i=1-t,n=Math.log(t)*Math.log(i);e=s-T(i)-n}else{e=0;const s=1+Math.trunc(-16*Math.log(10)/Math.log(t)+1.5);let i=s;for(let n=s;n>0;n--,i-=1)e*=t,e+=1/(i*i);e*=t}return e}function E(t,s){const e=s*t;if(Math.abs(s)<.1){let s=0;for(let t=60;t>=1;t--)s*=e,s+=1/t/t;return s*=t,s}return T(e)/s}function M(t,s){return t<s?qt(t,s):qt(s,t)}function w(t,s){const e=Math.abs(t);return s>=0?e:-e}function I(t){return Math.round(t)}function D(t,s,e,i,n){n[0]=s[0]+(e[0]-s[0])*i,n[1]=s[1]+(e[1]-s[1])*i,3===t&&(n[2]=s[2]+(e[2]-s[2])*i)}function P(t,s,e,i,n){n[0]=e[0]-(e[0]-s[0])*(1-i),n[1]=e[1]-(e[1]-s[1])*(1-i),3===t&&(n[2]=e[2]-(e[2]-s[2])*(1-i))}function A(t,s,e,i,n){i<=.5?D(t,s,e,i,n):P(t,s,e,i,n)}function q(t,s,e,i,n){n[0]=s[0].addE(e[0].subE(s[0]).mulE(i)),n[1]=s[1].addE(e[1].subE(s[1]).mulE(i))}function z(t,s,e,i,n){n[0]=e[0].subE(e[0].subE(s[0]).mulE(p.subE(i))),n[1]=e[1].subE(e[1].subE(s[1]).mulE(p.subE(i)))}function C(t,s,e){let i;return i=e<=.5?t+(s-t)*e:s-(s-t)*(1-e),i}function Z(t,s,e){return t+(s-t)*e}function B(t,s,e){return s-(s-t)*(1-e)}function R(t,s,e,i){e<=.5?(i.x=t.x+(s.x-t.x)*e,i.y=t.y+(s.y-t.y)*e):(i.x=s.x-(s.x-t.x)*(1-e),i.y=s.y-(s.y-t.y)*(1-e))}function G(t,s,e,i){e<=.5?(i.x=t.x+(s.x-t.x)*e,i.y=t.y+(s.y-t.y)*e,i.z=t.z+(s.z-t.z)*e):(i.x=s.x-(s.x-t.x)*(1-e),i.y=s.y-(s.y-t.y)*(1-e),i.z=s.z-(s.z-t.z)*(1-e))}function k(t){return t*t}function S(t){return t*t*t}function L(t){return 1/Math.sqrt(t)}function F(t){return t<0?-1:t>0?1:0}function O(t,s,e,i){const n=[0],r=[0],u=[0];return tt(W(t,e,n),W(s,i,r),u)+(n[0]+r[0]+u[0])}const Q=[0],U=[0];function V(t,s,e){return function(t,s,e,i){const n=tt(t,s,J),r=tt(n,e,K);return tt(r,J[0]+K[0],i)}(W(t,s,Q),e,Q[0],U)}const j=[0],Y=[0],$=[0],H=[0];function W(t,s,e){const i=t*s;return X(t,j,Y),X(s,$,H),e[0]=Y[0]*H[0]-(i-j[0]*$[0]-Y[0]*$[0]-j[0]*H[0]),i}function X(t,s,e){const i=134217729*t;s[0]=i-(i-t),e[0]=t-s[0]}const J=[0],K=[0];function tt(t,s,e){const i=t+s;return Math.abs(t)>Math.abs(s)?e[0]=t-i+s:e[0]=s-i+t,i}function st(t,s){return t%s}function et(t){const s=1-t;if(0===s)return 1;let e;if(s<=.01){const t=s,i=Math.log(t);e=1+t*(.4431471805599453-.25*i+t*(.05680519270997949-.09375*i+t*(.02183137044373718-.05859375*i+t*(.011544521417308362-.042724609375*i+t*(.00714200031339596-.0336456298828125*i+t*(.004854743337164948-.027757644653320312*i+t*(.003514687963781376-.023627042770385742*i)))))))}else{if(t<.016){const s=t,e=.25,i=.046875,n=.01953125,r=.01068115234375,u=.0067291259765625,h=.004626274108886719,o=.0033752918243408203,a=.0025710230693221092;return ws()*(1-s*(e+s*(i+s*(n+s*(r+s*(u+s*(h+s*(o+s*a))))))))}e=rt(0,s,1)-t*ut(0,s,1)/3}return ys(e,1,ws())}function it(t,s,e=Number.NaN){if((0,i.g)(s>=0&&s<=1),0===s)return t;let n=1,r=t;if(r<0&&(r=-r,n=-1),1===s){const t=Math.round(r/Es()),s=r-t*Es();return n*(2*t+Math.sin(s))}const u=ws(),h=Math.floor(r/u);1&h?r=(h+1)*u-r:r-=h*u;const o=Math.sin(r),a=Number.isNaN(e)?et(s):e;let m;if(1===o)m=a+Math.sqrt(1-s)*(r-u);else{const t=r*r;if(.01424*Math.pow(t,4)<=2*xs())m=r*(1+t*s*(-1/6+t*((4-3*s)/120-(16+(45*s-60)*s)/5040*t)));else if(s<=.01){const t=Math.sin(2*r),e=Math.sin(4*r),i=Math.sin(6*r),n=Math.sin(8*r),u=Math.sin(10*r);m=r+s*((2*-r+t)/8+s*((-3*r+2*t-.25*e)/64+s*((-20*r+15*t-3*e+i/3)/1024+s*(5*(-140*r+112*t-28*e+16/3*i-.5*n)/65536+7*s*((-63*r+52.5*t-15*e+3.75*i-.625*n+.05*u)/65536+s*(-693*r+594*t-185.625*e+1.375*i-12.375*n+1.8*u-.125*Math.sin(12*r))/1048576)))))}else{const t=o*o,e=Math.cos(r),i=e*e,n=ht(o,e,s);m=o*(rt(i,n,1)-s*t*ut(i,n,1)/3)}}return 1&h?m=a*(h+1)-m:m+=a*h,n*m}function nt(t,s,e=Number.NaN){if(0===t)return 0;let i=1,n=t;t<0&&(n=-n,i=-1);const r=Number.isNaN(e)?et(s):e,u=Math.floor(n/r);1&u?n=(u+1)*r-n:n-=u*r;let h=n<=0?0:n>=r?ws():function(t,s,e){if(0===s)return t;if(1===s)return Math.asin(t);let i=0,n=!0;if(t<.2){const e=t*t,r=t*(1+e*s*(1/6+e*((13*s-4)/120+(16-284*s+493*s*s)/5040*e))),u=Math.abs(s*(4944*s-64-31224*s*s+37369*s*s*s)/362880*Math.pow(t,9));if(u<Math.abs(r)*xs())return r;i=r,n=u>.1*r}if(n){const n=1-s,r=1-t/e,u=Math.sqrt(r*r+n*n),h=Math.atan2(n,t+xs());i=ws()+Math.sqrt(u)*(h-ws())}let r=0;for(let n=0;n<7;n++){r=it(i,s,e);const u=ht(Math.sin(i),Math.cos(i),s);if(i-=(r-t)/Math.sqrt(u),n>0&&Math.abs(r-t)<=4*xs()*t)break}return i}(n,s,r);return 1&u?h=ws()*(u+1)-h:h+=ws()*u,i*h}function rt(t,s,e){(0,i.g)((0!==t?1:0)+(0!==s?1:0)+1>1);let n=t,r=s,u=e;for(;;){const t=Math.sqrt(n*r)+Math.sqrt(r*u)+Math.sqrt(u*n);n=.25*(n+t),r=.25*(r+t),u=.25*(u+t);const s=(n+r+u)/3,e=(s-n)/s,i=(s-r)/s,h=(s-u)/s;if(Math.abs(e)<=.0024&&Math.abs(i)<=.0024&&Math.abs(h)<=.0024){const t=e*i-h*h,n=e*i*h;return(1+(1/24*t-.1-3/44*n-5*t*t/208+t*n/16)*t+(1/14+3*n/104)*n)/Math.sqrt(s)}}}function ut(t,s,e){(0,i.g)(0!==t||0!==s);let r=t,u=s,h=e;const o=new n(0);let a=1;for(;;){const t=.2*(r+u+3*h),s=(t-r)/t,e=(t-u)/t,i=(t-h)/t;if(Math.abs(s)<=.0015&&Math.abs(e)<=.0015&&Math.abs(i)<=.0015){const n=s*e,r=i*i,u=n-r,h=n-6*r,m=h+u+u,c=3/26,l=h*(9/22*.25*h-.21428571428571427-1.5*c*i*m),f=i*(1/6*m+i*(-.4090909090909091*u+i*c*n));return 3*o.getResult()+a*(1+l+f)/(t*Math.sqrt(t))}const n=Math.sqrt(r),m=Math.sqrt(u),c=Math.sqrt(h),l=n*(m+c)+m*c;o.add(a/(c*(h+l))),a*=.25,r=.25*(r+l),u=.25*(u+l),h=.25*(h+l)}}function ht(t,s,e){return t<.999?1-e*k(t):1-e+e*k(s)}function ot(t,s,e,n,r){return 0===t?0===n?s:1===n?e:r:1===t?0===n?s:1===n?e:C(s,e,n):(2===t&&(0,i.b)("angular interpolation"),void(0,i.b)(""))}function at(t,s,e,n,r,u,h,o){if(0===t)for(let t=0;t<u;++t)n[t+r]=0===h?s[t]:1===h?e[t]:o;else if(1===t)if(0===h)mt(n,s,r,0,u);else if(1===h)mt(n,e,r,0,u);else for(let t=0;t<u;++t)n[t+r]=C(s[t],e[t],h);else if(2===t)if(0===h)mt(n,s,r,0,u);else if(1===h)mt(n,e,r,0,u);else{let t=0;for(let i=0,o=r;i<u;++i,++o)n[o]=C(s[i],e[i],h),t+=n[o]*n[o];if(t>0){t=Math.sqrt(t);for(let s=r;s<r+u;++s)n[s]/=t}else{for(let t=r;t<r+u;++t)n[t]=0;n[r]=1}}else(0,i.b)("")}function mt(t,s,e,i,n){if(0===n)return;let r=0,u=e,h=i;for(;r++<n;)t[u++]=s[h++]}function ct(t,s,e){let i=0;for(let n=0;!i&&n<e;++n)i=t[n]-s[n];return i}function lt(t,s){return t}function ft(t){t.sort(((t,s)=>t<s?-1:t>s?1:0))}function _t(t,s){const e=t.slice(0,s);ft(e),mt(t,e,0,0,s)}function vt(t,s,e,i){const n=t.slice(s,s+e);n.sort(i),mt(t,n,s,0,e)}function bt(t,s){return t<s?-1:t>s?1:0}function dt(t,s,e,i){return t<e?-1:t>e?1:s<i?-1:s>i?1:0}function pt(t,s){if(t.length<2)return t.length;let e=0;for(let i=1;i<t.length;++i)s(t[i],t[e])||(e++,t[i]=lt(t[e],t[e]=t[i]));return 1+e}function xt(t,s){t[s]=t.at(-1),t.pop()}function Nt(t,s=!1){return{[Symbol.dispose](){this.bForget||t()},bForget:s}}function yt(t,s,e){t.length=s,t.fill(e)}function gt(t,s,e){t.length=e;for(let i=0;i<e;++i)t[i]=new s}function Tt(t,s){const e=new Array(s);for(let i=0;i<s;++i)e[i]=new t;return e}function Et(t,s,e){for(let i=0;i<e;++i)t[i].assign(s[i]);return e}function Mt(t,s){const e=t.slice(0,s);for(let t=0;t<s;++t)e[t]=e[t].clone();return e}function wt(t){return Array.from({length:t},(()=>null))}function It(t,s){return Array.from({length:s},(()=>t()))}function Dt(t,s){const e=new Array(t);return e.fill(s),e}function Pt(t,s){return s in t&&1===Object.getOwnPropertyNames(t).length}class At{constructor(...t){this.m_elts=t}get length(){return this.m_elts.length}at(t){return this.m_elts[t]}[Symbol.dispose](){for(const t of this.m_elts)t[Symbol.dispose]()}}function qt(t,s){return{first:t,second:s}}const zt=Math.PI,Ct=2*Math.PI,Zt=.5*Math.PI;class Bt{constructor(t,s){this.m_cr=t,this.m_cc=s,this.m_v=Dt(t*s,0)}get(t,s){return this.m_v[t*this.m_cc+s]}set(t,s,e){this.m_v[t*this.m_cc+s]=e}inc(t,s){return++this.m_v[t*this.m_cc+s]}}const Rt=new ArrayBuffer(8),Gt=new Float64Array(Rt),kt=new BigUint64Array(Rt),St=0x0fffffffffffffn;function Lt(){return Number.EPSILON*vs}function Ft(t){return Gt[0]=t,kt[0]}function Ot(t){return Ft(t)&St}function Qt(t){return Number((9218868437227405312n&Ft(t))>>52n)}function Ut(t){if(0n===t)return-1n;if(1n===t||-1n===t)return 0n;t<0n&&(t=-t);let s=0n,e=512n,i=1n<<s+e;for(;t>=i;)s+=e,e<<=1n,i<<=e;let n=s;e>>=1n;let r=n+e;for(;e>0n;)t<1n<<r||(n=r),e>>=1n,r=n+e;return n}function Vt(t,s){return t===s||Number.isNaN(t)&&Number.isNaN(s)}function jt(t,s,e){return t===s||Math.abs(t-s)<=e||Number.isNaN(t)&&Number.isNaN(s)}function Yt(t,s){return t<s?-1:t>s?1:0}function $t(t,s){if(t<s)return-1;if(t>s)return 1;if(t===s)return 0;{const e=Number.isNaN(t),i=Number.isNaN(s);return e<i?-1:e>i?1:0}}function Ht(){return 2147483647}function Wt(){return 32767}function Xt(){return 2147483647}function Jt(){return-2147483648}const Kt=2147483647,ts=BigInt(Kt),ss=2166136261,es=16777619,is=14695981039346656037n,ns=1099511628211n;function rs(t){let s=ss;for(let e=0,i=t.length;e<i;++e)s=(s^t.charCodeAt(e))*es;return s&Kt}function us(t,s){return s+2654435769+(t<<6)+(t>>2)&Kt}function hs(t,s){return us(t,cs(s))}function os(t){return us(3735928559,t)}function as(t,s){return us(t,os(s))}function ms(t){return function(t){let s=ss,e=t;return s=(s^255&e)*es,e>>=8,s=(s^255&e)*es,e>>=8,s=(s^255&e)*es,e>>=8,s=(s^255&e)*es,s&Kt}(t)}function cs(t){return Number(function(t){let s=is,e=t;return s=(s^0xffn&e)*ns,e>>=8n,s=(s^0xffn&e)*ns,e>>=8n,s=(s^0xffn&e)*ns,e>>=8n,s=(s^0xffn&e)*ns,e>>=8n,s=(s^0xffn&e)*ns,e>>=8n,s=(s^0xffn&e)*ns,e>>=8n,s=(s^0xffn&e)*ns,s&ts}(t))}function ls(t){return cs(Ft(function(t){return Ps(t)}(t)))}function fs(t){return function(t){return 1103515245*t+12345&2147483647}(t)}const _s=100,vs=100;function bs(){return Number.EPSILON*_s}function ds(){return.38196601125010515}function ps(){return 1.4142135623730951}function xs(){return Number.EPSILON}function Ns(t,s,e){return t===s||t===e}function ys(t,s,e){return t>=s?t<=e?t:e:s}function gs(t,s,e){const i=t[0];if(i>=s){if(i<=e)return!1;t[0]=e}else t[0]=s;return!0}function Ts(t,s){return t>=s?s:t<-s?-s:t}function Es(){return zt}function Ms(){return Ct}function ws(){return Zt}const Is=3*ws();function Ds(){return Is}function Ps(t){return t+0}function As(t){return{v:t}}class qs{constructor(){this.m_rn=As(0n),this.m_rd=As(1n),this.m_bNaN=!1,this.m_bNormalized=!1,this.m_power=0,this.m_sign=0}static constructAssign(t,s){const e=t.clone();return void 0!==s&&e.limitPrecisionThis(s),e}static constructDouble(t){return(new qs).setDouble(t)}static constructInt64(t){return(new qs).setInt64(t)}static constructRational(t,s){return(new qs).setRational(t,s)}static constructInt32(t){return this.constructInt64(BigInt(Math.trunc(t)))}[Symbol.toPrimitive](t){return this}compare(t){return this.lt(t)?-1:this.gt(t)?1:0}assignCopy(t){return this.setThis(t)}abs(){return this.clone().absThis()}absThis(){return this.isNAN()||(this.m_sign*=this.m_sign),this}clone(){return(new qs).setThis(this)}setThis(t){return this.m_bNaN=t.m_bNaN,this.m_bNormalized=t.m_bNormalized,this.m_rn.v=t.m_rn.v,this.m_rd.v=t.m_rd.v,this.m_power=t.m_power,this.m_sign=t.m_sign,this}setZero(){return this.m_rn.v=0n,this.m_rd.v=1n,this.m_bNaN=!1,this.m_power=0,this.m_bNormalized=!0,this.m_sign=0,this}setDouble(t){if(this.setZero(),0===t)return this;if(Number.isInteger(t)&&Math.abs(t)<2147483647)return this.setInt32(t);const s=Ft(t),e=(s&qs.s_em)>>52n,n=!!(s&qs.s_sm),r=s&qs.s_fm;if(e===qs.s_emax)return r?(this.m_rn.v=this.m_rd.v=0n,this.m_bNaN=!0,this):(this.m_rn.v=n?-1n:1n,this.m_rd.v=0n,this);0n===e&&(0,i.b)("denormalized numbers not yet implemented");const u=e-1023n,h=u>=0n?u:0n,o=u<0n?-u:0n;return this.m_rn.v=(1n<<52n|r)<<h,this.m_rd.v=1n<<52n+o,this.m_sign=n?-1:1,this.m_bNormalized=!1,this.normalizeThis()}setInt64(t){return 0n===t?this.setZero():(this.m_bNaN=!1,this.m_sign=t>0n?1:-1,this.m_rn.v=t>0n?t:-t,this.m_rd.v=1n,this.m_power=0,this.m_bNormalized=!1,this.normalizeThis())}setRational(t,s){return 0n===t?0n===s?this.setNAN():this.setZero():0n===s?t>0n?this.setPositiveInf():this.setNegativeInf():(this.m_sign=(t>0n?1:-1)*(s>0n?1:-1),this.m_rn.v=t>0n?t:-t,this.m_rd.v=s>0n?s:-s,this.m_power=0,this.m_bNormalized=!1,this.normalizeThis())}setInt32(t){return this.setInt64(BigInt(Math.trunc(t)))}getDouble(){return this.convertToDouble()}toDouble(){return this.convertToDouble()}value(){return this.convertToDouble()}isNAN(){return this.m_bNaN}isPositiveInf(){return!this.isNAN()&&0n===this.m_rd.v&&1===this.m_sign}isNegativeInf(){return!this.isNAN()&&0n===this.m_rd.v&&-1===this.m_sign}isFinite(){return!this.isNAN()&&0n!==this.m_rd.v}setNAN(){return this.m_bNaN=!0,this.m_rn.v=0n,this.m_rd.v=0n,this.m_power=0,this.m_bNormalized=!0,this}setPositiveInf(){return this.m_rn.v=1n,this.m_rd.v=0n,this.m_bNaN=!1,this.m_bNormalized=!0,this.m_sign=1,this.m_power=0,this}setNegativeInf(){return this.m_rn.v=1n,this.m_rd.v=0n,this.m_bNaN=!1,this.m_bNormalized=!0,this.m_sign=-1,this.m_power=0,this}subThis(t){if(t.isNAN()&&this.setNAN(),this.isPositiveInf()&&t.isPositiveInf())this.setNAN();else{if(this.isPositiveInf()&&t.isNegativeInf())return this.setPositiveInf(),this;if(this.isNegativeInf()&&t.isNegativeInf())this.setNAN();else if(this.isNegativeInf()&&t.isPositiveInf())return this.setNegativeInf(),this}return this.isNAN()?this:this.opPlusMinus(t,!1)}thisSubAbs(t){return(0,i.g)(0),this}mulThis(t){return t.isNAN()&&this.setNAN(),this.isNAN()?this:(this.m_sign*=t.m_sign,0===this.m_sign?this.setZero():(this.m_rn.v*=t.m_rn.v,this.m_rd.v*=t.m_rd.v,this.m_power+=t.m_power,this.m_bNormalized=!1,this.normalizeThis(),this))}mulDoubleThis(t){return this.mulThis(qs.constructDouble(t))}thisMulInt64(t){return(0,i.g)(0),this}thisMulInt32(t){return(0,i.g)(0),this}divThis(t){return this.mulThis(t.clone().invertThis())}divDoubleThis(t){return this.divThis(qs.constructDouble(t))}addDoubleThis(t){return this.addThis(qs.constructDouble(t))}subDoubleThis(t){return this.subThis(qs.constructDouble(t))}mul(t){return this.clone().mulThis(t)}mulBigIntThis(t){return this.mulThis(qs.constructInt64(t))}mulDouble(t){return this.clone().mulThis(qs.constructDouble(t))}div(t){return this.clone().divThis(t)}divDouble(t){return this.clone().divDoubleThis(t)}add(t){return this.clone().addThis(t)}fmSubThis(t,s){return this.subThis(t.clone().mulThis(s))}fmAddThis(t,s){return this.addThis(t.clone().mulThis(s))}addThis(t){if(t.isNAN()&&this.setNAN(),this.isPositiveInf()&&t.isPositiveInf())return this.setPositiveInf(),this;if(this.isPositiveInf()&&t.isNegativeInf())this.setNAN();else{if(this.isNegativeInf()&&t.isNegativeInf())return this.setNegativeInf(),this;this.isNegativeInf()&&t.isPositiveInf()&&this.setNAN()}return this.isNAN()?this:this.opPlusMinus(t,!0)}addDouble(t){return this.clone().addThis(qs.constructDouble(t))}sub(t){return this.clone().subThis(t)}subDouble(t){return this.clone().subThis(qs.constructDouble(t))}isZero(){return 0===this.m_sign}equals(t){return this.clone().subThis(t).isZero()}lt(t){return!this.isNAN()&&!t.isNAN()&&!(this.isPositiveInf()&&t.isPositiveInf()||this.isNegativeInf()&&t.isNegativeInf())&&!this.isPositiveInf()&&(!!t.isPositiveInf()||this.clone().sub(t).LZ())}absLessAbs(t){return this.abs().lt(t.abs())}gt(t){return this.clone().sub(t).GZ()}lte(t){return this.sub(t).LEZ()}gte(t){return this.sub(t).GEZ()}normalizeThis(){if(this.m_bNormalized)return this;if(0n===this.m_rn.v)return this.setZero();let t=0,s=0xffffffffn;for(;0n===(this.m_rn.v&s)&&s<=this.m_rn.v;)s<<=32n,t+=32;s&=this.m_rn.v,s>>=BigInt(t),t+=h(BigInt.asUintN(32,s))-1;let e=0;for(s=0xffffffffn;0n===(this.m_rd.v&s)&&s<=this.m_rd.v;)s<<=32n,e+=32;return s&=this.m_rd.v,s>>=BigInt(e),e+=h(BigInt.asUintN(32,s))-1,this.m_rn.v>>=BigInt(t),this.m_rd.v>>=BigInt(e),this.m_power+=t-e,this.m_rn.v>1n&&this.m_rd.v>1n&&(this.m_rn.v%this.m_rd.v===0n?(this.m_rn.v/=this.m_rd.v,this.m_rd.v=1n):this.m_rd.v%this.m_rn.v===0n&&(this.m_rd.v/=this.m_rn.v,this.m_rn.v=1n)),this.m_bNormalized=!0,this}negateThis(){return this.isNAN()||(this.m_sign*=-1),this}negate(){return this.clone().negateThis()}invertThis(){return this.isNAN()?this:this.isPositiveInf()||this.isNegativeInf()?(this.setZero(),this):0n===this.m_rn.v?(this.setPositiveInf(),this):(this.m_rd=lt(this.m_rn,this.m_rn=this.m_rd),this.m_power=-this.m_power,this)}limitPrecisionThis(t){if(0===t)return this;if(this.isZero())return this.setZero();if(!this.isFinite())return this;this.normalizeThis();let s=Number(Ut(this.m_rn.v));if(s>t){const e=s-t;this.m_rn.v>>=BigInt(s-t),this.m_power+=e}if(s=Number(Ut(this.m_rd.v)),s>t){const e=s-t;this.m_rd.v>>=BigInt(s-t),this.m_power-=e}return this}hiBitIndex(){return Math.max(Number(Ut(this.m_rn.v)),Number(Ut(this.m_rd.v)))}ldexp(t){return this.clone().ldexpThis(t)}ldexpThis(t){return t&&(this.m_bNormalized=!1,this.m_power+=t,this.normalizeThis()),this}LZ(){return!this.isNAN()&&-1===this.m_sign}GZ(){return!this.isNAN()&&1===this.m_sign}LEZ(){return!this.isNAN()&&this.m_sign<=0}GEZ(){return!this.isNAN()&&this.m_sign>=0}toString(){return this.toDouble().toString()}sqr(){return this.clone().sqrThis()}sqrThis(){return this.mulThis(this.clone())}static sqrt(t,s){if(t.m_sign<0n&&(0,i.q)("MP_value: sqrt(-1)"),t.isZero())return t.clone();let e=52,n=2220446049250313e-31;for(;e<s;)2*e<=s?(n*=n,e*=2):(n*=2220446049250313e-31,e+=52);e+=52;const r=Ut(t.m_rn.v),u=Ut(t.m_rd.v);let h,o=t.m_power+Number(r-u);const a=new qs;Math.abs(o)>200?(1&Math.abs(o)&&(o+=1),h=qs.constructAssign(t,53).ldexpThis(-o).value(),a.setThis(t).ldexpThis(-o),(0,i.g)(Number.isFinite(h))):(a.setThis(t),h=a.value(),(0,i.g)(Number.isFinite(h)),o=0),h=Math.sqrt(h);const m=qs.constructDouble(h),c=qs.constructDouble(n);c.mulThis(m).ldexpThis(1);const l=n*h*2,f=m.clone(),_=new qs;let v;for(let t=0;t<10;++t){f.mulThis(m),_.setThis(a).subThis(f).absThis();let t=_.value();if(v=1,t<.9)for(;t>l;)t*=t,++v;else v=4;if(_.lte(c))break;for(let t=0;t<v;t++)f.setThis(m).divThis(a).invertThis().addThis(m).ldexpThis(-1).limitPrecisionThis(e),m.setThis(f)}return m.ldexpThis(o/2)}static cubicRoot(t,s){if(t.isZero())return t.clone();let e=52,i=2220446049250313e-31;for(;e<s;)2*e<=s?(i*=i,e*=2):(i*=2220446049250313e-31,e+=52);e+=52;const n=Math.pow(Math.abs(t.value()),1/3),r=qs.constructDouble(n),u=r.clone();u.sqrThis().mulDoubleThis(3).mulDoubleThis(i),u.limitPrecisionThis(32),t.LZ()&&r.negateThis();for(let s=0;s<10;++s){const s=r.clone();s.sqrThis().mulThis(r);const i=s.clone();if(i.subThis(t),i.absThis().limitPrecisionThis(32),i.lte(u))break;i.setThis(t),i.ldexpThis(1),i.addThis(s);const n=s.clone();n.ldexpThis(1),n.addThis(t),i.divThis(n),r.mulThis(i),r.limitPrecisionThis(e)}return r}isInTheRangeOfDouble(){return(0,i.g)(0),!1}sign(){return this.m_sign}cosAndSin(t,s){(0,i.g)(0)}static nan(){return(0,i.g)(0),new qs}convertToDouble(){if(this.m_bNaN)return Number.NaN;if(this.isZero())return 0;if(0n===this.m_rd.v)return 1===this.m_sign?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;const t=-1===this.m_sign,s=this.m_rn.v<<(this.m_power>=0?BigInt(this.m_power):0n);let e=this.m_rd.v<<(this.m_power<0?BigInt(-this.m_power):0n);const i=s/e;let n=Number(i);if(BigInt(n)!==i)return t?-n:n;let r=s-i*e;if(r){let t=Ut(e)-1023n;t>0n&&(e>>=t,r<<=52n,r>>=t);let s=Number(r);Number.isFinite(s)||(r>>=52n,s=Number(r),t=0n),t>0n&&(s/=Math.pow(2,52)),n+=s/Number(e)}return t?-n:n}signVal(){return 1===this.m_sign?1n:-1===this.m_sign?-1n:0n}opPlusMinus(t,s){const e=Math.min(this.m_power,t.m_power);let i,n;this.m_power>e?(i=BigInt(this.m_power-e),n=0n):(i=0n,n=BigInt(t.m_power-e));const r=this.signVal()*this.m_rn.v*t.m_rd.v<<i,u=t.signVal()*t.m_rn.v*this.m_rd.v<<n;return this.m_rn.v=s?r+u:r-u,this.m_rd.v*=t.m_rd.v,this.m_power=e,this.m_sign=1,this.m_rn.v<0n&&(this.m_sign=-1,this.m_rn.v=-this.m_rn.v),this.m_bNormalized=!1,this.normalizeThis(),this}}qs.s_sm=0x8000000000000000n,qs.s_em=0x7ff0000000000000n,qs.s_fm=0x000fffffffffffffn,qs.s_emax=0x7ffn;const zs=qs.constructInt32(1),Cs=qs.constructInt32(0);function Zs(t,s){let e=Qt(t);const i=Qt(s);return e===i?(e-=53-function(t,s){return function(t){let s=0;return 0xffffffff00000000n&t&&(s=32,t>>=32n),s+function(t){let s=0;return 4294901760n&t&&(s+=16,t>>=16n),65280n&t&&(s+=8,t>>=8n),240n&t&&(s+=4,t>>=4n),s+u[Number(BigInt.asUintN(4,t))]+1}(t)}(t^s)}(Ot(t),Ot(s)),e):e>i?e:i}function Bs(t,s){for(let e=0,i=0,n=t.length;e<n;e+=2,i++)s[i].x=t[e],s[i].y=t[e+1]}function Rs(t){const s=new Float64Array(2*t.length);for(let e=0,i=t.length;e<i;++e){const i=e<<1;s[i]=t[e].x,s[i+1]=t[e].y}return s}function Gs(t){const s=Tt(ks,t.length);for(let e=0,i=t.length;e<i;++e)s[e].setCoords(t[e][0],t[e][1]);return s}class ks{static construct(t,s){return new ks(t,s)}constructor(t,s){void 0!==t?(this.x=t,this.y=s):this.x=this.y=Number.NaN}clone(){return new ks(this.x,this.y)}assign(t){this.setCoordsPoint2D(t)}setCoords(t,s){return this.x=t,this.y=s,this}setCoordsPoint2D(t){this.x=t.x,this.y=t.y}isEqualPoint2D(t,s){return void 0!==s?Math.abs(this.x-t.x)<=s&&Math.abs(this.y-t.y)<=s:this.x===t.x&&this.y===t.y}isEqual(t,s,e){return void 0!==e?Math.abs(this.x-t)<=e&&Math.abs(this.y-s)<=e:this.x===t&&this.y===s}equalsPoint2D(t,s){return this.isEqualPoint2D(t,s)}setSub(t,s){this.x=t.x-s.x,this.y=t.y-s.y}addThis(t){return this.x+=t.x,this.y+=t.y,this}setAdd(t,s){return this.x=t.x+s.x,this.y=t.y+s.y,this}absoluteOther(t){}absolute(){return(0,i.g)(0),this}setNegate(){this.x=-this.x,this.y=-this.y}setNegateOther(t){this.x=-t.x,this.y=-t.y}interpolateThis(t,s){}interpolate(t,s,e){(0,i.g)(0)}scaleAddThis(t,s){this.x=this.x*t+s.x,this.y=this.y*t+s.y}setScaleAdd(t,s,e){this.x=s.x*t+e.x,this.y=s.y*t+e.y}scaleOther(t,s){(0,i.g)(0)}scale(t){this.x*=t,this.y*=t}compare(t){return this.y<t.y?-1:this.y>t.y?1:this.x<t.x?-1:this.x>t.x?1:0}compareX(t){return this.x<t.x?-1:this.x>t.x?1:this.y<t.y?-1:this.y>t.y?1:0}normalizeOther(t){(0,i.g)(0)}normalize(){const t=this.length();return t?(this.x/=t,this.y/=t):(this.x=1,this.y=0),this}getUnitVector(){return this.clone().normalize()}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}sqrLength(){return this.x*this.x+this.y*this.y}static averageFast(t,s){return(0,i.g)(0),{}}static average(t,s){const e=new ks;if(0===s)return e.setNAN(),e;if(1===s)return e.assign(t[0]),e;const i=new n(t[0].x),r=new n(t[0].y);for(let e=1;e<s;e++)i.add(t[e].x),r.add(t[e].y),255&e||(i.normalize(),r.normalize());return e.x=i.getResult()/s,e.y=r.getResult()/s,e}static calculateLength(t,s){const e=new n(0);for(let i=1;i<s;i++)e.add(ks.distance(t[i],t[i-1]));return e.getResult()}offset(t,s){const e=ks.distance(t,s),i=ks.construct(this.x,this.y);if(0===e)return ks.distance(i,t);const n=s.clone();return n.subThis(t),i.subThis(t),i.crossProduct(n)/e}side(t,s){return t.equals(s)?this.equals(t)?0:1:ks.orientationRobust(s,t,this)}static sqrDistance(t,s){const e=t.x-s.x,i=t.y-s.y;return e*e+i*i}static sqrDistanceCoords(t,s,e,i){const n=e-t,r=i-s;return n*n+r*r}static distance(t,s){return Math.sqrt(ks.sqrDistance(t,s))}dotProduct(t){return this.x*t.x+this.y*t.y}dotProductAbs(t){return Math.abs(this.x*t.x)+Math.abs(this.y*t.y)}crossProduct(t){return this.x*t.y-this.y*t.x}crossProductAbs(t){return(0,i.g)(0),0}rotateDirect(t,s){const e=this.x*t-this.y*s,i=this.x*s+this.y*t;this.x=e,this.y=i}rotateReverse(t,s){const e=this.x*t+this.y*s,i=-this.x*s+this.y*t;this.x=e,this.y=i}leftPerpendicularThis(){const t=this.x;this.x=-this.y,this.y=t}leftPerpendicularOther(t){const s=t.x;this.x=-t.y,this.y=s}rightPerpendicularThis(){const t=this.x;this.x=this.y,this.y=-t}rightPerpendicularOther(t){const s=t.x;this.x=t.y,this.y=-s}equals(t){return this.x===t.x&&this.y===t.y}notequals(t){return this.x!==t.x||this.y!==t.y}not(){return!this.x&&!this.y}gt(t){return this.y>t.y||this.y===t.y&&this.x>t.x}gte(t){return!this.lt(t)}lt(t){return this.y<t.y||this.y===t.y&&this.x<t.x}lte(t){return!this.gt(t)}subThis(t){return this.x-=t.x,this.y-=t.y,this}divThis(t){return this.x/=t,this.y/=t,this}add(t){return new ks(this.x+t.x,this.y+t.y)}sub(t){return new ks(this.x-t.x,this.y-t.y)}negateThis(){return this.x=-this.x,this.y=-this.y,this}negate(){return new ks(-this.x,-this.y)}mul(t){return new ks(this.x*t,this.y*t)}mulThis(t){return this.x*=t,this.y*=t,this}divide(t){return new ks(this.x/t,this.y/t)}setNAN(){this.x=this.y=Number.NaN}isNAN(){return Number.isNaN(this.x)||Number.isNaN(this.y)}static getNAN(){return new ks(Number.NaN,Number.NaN)}isFinite(){return Number.isFinite(this.x)&&Number.isFinite(this.y)}isZero(){return 0===this.x&&0===this.y}norm(t){switch(t){case 0:{const t=Math.abs(this.x),s=Math.abs(this.y),e=t-s;return e>=0?t:e<=0?s:Number.NaN}case 1:return Math.abs(this.x)+Math.abs(this.y);case 2:return Math.sqrt(this.x*this.x+this.y*this.y);default:(0,i.t)("norm")}}getQuarter(){return ks.getQuarterCoords(this.x,this.y)}static getQuarterCoords(t,s){return t>0?s>=0?1:4:s>0?2:0===t?4:3}static compareVectors(t,s){const e=t.getQuarter(),i=s.getQuarter();return i===e?ks.orientationRobustImpl(ks.construct(0,0),s,t,!0):e<i?-1:1}static compareVectorsOrigin(t,s,e){const i=s.sub(t),n=e.sub(t),r=i.getQuarter(),u=n.getQuarter();return u===r?ks.orientationRobustImpl(t,e,s,!0):r<u?-1:1}static orientationRobust(t,s,e){return ks.orientationRobustImpl(t,s,e,!1)}static orientationRobustEx(t,s,e,i){if(t.equals(s)||e.equals(i))return 0;const n=s.x-t.x,r=s.y-t.y,u=i.x-e.x,h=i.y-e.y;{const t=ks.getQuarterCoords(n,r)-1,s=ks.getQuarterCoords(u,h)-1,e=ks.d[t][s];if(0!==e)return e}const o=n*h,a=r*u,m=4*xs()*(Math.abs(o)+Math.abs(a)),c=o-a;return Math.abs(c)>=m?c<0?-1:c>0?1:0:ks.orientationRobustExMp(t,s,e,i)}static orientationRobustExMp(t,s,e,i){const n=qs.constructDouble(s.x),r=qs.constructDouble(i.x);n.subThis(qs.constructDouble(t.x)),r.subThis(qs.constructDouble(e.x));const u=qs.constructDouble(s.y),h=qs.constructDouble(i.y);return u.subThis(qs.constructDouble(t.y)),h.subThis(qs.constructDouble(e.y)),n.mulThis(h),u.mulThis(r),n.subThis(u),n.LZ()?-1:n.GZ()?1:0}static orientationNonRobust(t,s,e){const i=s.sub(t).crossProduct(e.sub(t));return i<0?-1:i>0?1:0}static orientationRobustImpl(t,s,e,i){if(s.isEqualPoint2D(t)||e.isEqualPoint2D(t)||s.isEqualPoint2D(e))return 0;const n=s.x-t.x,r=s.y-t.y,u=e.x-t.x,h=e.y-t.y;if(!i){const t=ks.getQuarterCoords(n,r)-1,s=ks.getQuarterCoords(u,h)-1,e=ks.d[t][s];if(0!==e)return e}const o=(Math.abs(n)+Math.abs(r)+Math.abs(u)+Math.abs(h))*(Math.abs(s.x)+Math.abs(s.y)+Math.abs(e.x)+Math.abs(e.y))*8*v(),a=n*h-r*u;if(Math.abs(a)>o)return a<0?-1:1;if(_(s.x,t.x)&&_(e.y,t.y)&&_(s.y,t.y)&&_(e.x,t.x)&&l(n,h)&&l(r,u)){const t=n*h,s=r*u;if(_(t,s)){const e=t-s;return e<0?-1:e>0?1:0}}return ks.orientationRobustMp(t,s,e)}static orientationRobustMp(t,s,e){const i=qs.constructDouble(s.x),n=qs.constructDouble(e.x);{const s=qs.constructDouble(t.x);i.subThis(s),n.subThis(s)}const r=qs.constructDouble(e.y),u=qs.constructDouble(s.y);{const s=qs.constructDouble(t.y);r.subThis(s),u.subThis(s)}return i.mulThis(r),u.mulThis(n),i.subThis(u),i.LZ()?-1:i.GZ()?1:0}static inCircleRobust(t,s,e,i){const n=new c,r=new c;n.set(t.x),n.subThis(i.x),r.set(t.y),r.subThis(i.y);const u=new c,h=new c;u.set(s.x),u.subThis(i.x),h.set(s.y),h.subThis(i.y);const o=new c,a=new c;o.set(e.x),o.subThis(i.x),a.set(e.y),a.subThis(i.y);const m=n.mulE(h).subE(r.mulE(u)),l=u.mulE(a).subE(h.mulE(o)),f=n.mulE(a).subE(r.mulE(o)),_=n.mulE(n).addE(r.mulE(r)),v=u.mulE(u).addE(h.mulE(h)),b=o.mulE(o).addE(a.mulE(a)),d=_.mulE(l).subE(v.mulE(f)).addE(b.mulE(m));if(!d.isFuzzyZero()){const t=d.value();return t<0?-1:t>0?1:0}return ks.inCircleRobustMp(t,s,e,i)}static inCircleRobustMp(t,s,e,i){do{if(!_(t.x,i.x)||!_(t.y,i.y))break;if(!_(s.x,i.x)||!_(s.y,i.y))break;if(!_(e.x,i.x)||!_(e.y,i.y))break;const n=t.x-i.x,r=t.y-i.y,u=s.x-i.x,h=s.y-i.y,o=e.x-i.x,a=e.y-i.y;if(!l(n,h)||!l(r,u))break;if(!l(u,a)||!l(h,o))break;if(!l(n,a)||!l(r,o))break;if(!l(n,n)||!l(r,r))break;if(!l(u,u)||!l(h,h))break;if(!l(o,o)||!l(a,a))break;const m=n*h,c=r*u,v=u*a,b=h*o,d=n*a,p=r*o,x=n*n,N=r*r,y=u*u,g=h*h,T=o*o,E=a*a;if(!_(m,c))break;if(!_(v,b))break;if(!_(d,p))break;if(!f(x,N))break;if(!f(y,g))break;if(!f(T,E))break;const M=m-c,w=v-b,I=d-p,D=x+N,P=y+g,A=T+E;if(!l(D,w))break;if(!l(P,I))break;if(!l(A,M))break;const q=D*w,z=P*I,C=A*M;if(!_(q,z))break;const Z=q-z;if(!f(Z,C))break;const B=Z+C;return B<0?-1:B>0?1:0}while(0);const n=qs.constructDouble(i.x),r=qs.constructDouble(i.y),u=qs.constructDouble(t.x),h=qs.constructDouble(t.y);u.subThis(n),h.subThis(r);const o=qs.constructDouble(s.x),a=qs.constructDouble(s.y);o.subThis(n),a.subThis(r);const m=qs.constructDouble(e.x),c=qs.constructDouble(e.y);m.subThis(n),c.subThis(r);const v=u.mul(a).sub(h.mul(o)),b=o.mul(c).sub(a.mul(m)),d=u.mul(c).sub(h.mul(m)),p=u.mul(u).add(h.mul(h)),x=o.mul(o).add(a.mul(a)),N=m.mul(m).add(c.mul(c)),y=p.mul(b).sub(x.mul(d)).add(N.mul(v));return y.LZ()?-1:y.GZ()?1:0}static inCircleRobustMp3Point(t,s,e){const i=qs.constructDouble(t.x),n=qs.constructDouble(t.y),r=qs.constructDouble(s.x),u=qs.constructDouble(s.y),h=qs.constructDouble(e.x),o=qs.constructDouble(e.y),a=h.mul(h).add(o.mul(o)).sub(h.mul(i).add(o.mul(n)).add(h.mul(r)).add(o.mul(u))).add(i.mul(r).add(n.mul(u)));return a.LZ()?-1:a.GZ()?1:0}static inCircleRobust3Point(t,s,e){const i=new c(t.x),n=new c(t.y),r=new c(s.x),u=new c(s.y),h=new c(e.x),o=new c(e.y),a=h.mulE(h).addE(o.mulE(o)).subE(h.mulE(i).addE(o.mulE(n)).addE(h.mulE(r)).addE(o.mulE(u))).addE(i.mulE(r).addE(n.mulE(u)));if(!a.isFuzzyZero()){const t=a.value();return t<0?-1:t>0?1:0}return ks.inCircleRobustMp3Point(t,s,e)}static calculateCircleCenterFromThreePoints(t,s,e){if(t.equals(e)||t.equals(s)||e.equals(s))return ks.getNAN();const i=function(t,s,e){const i=new c(s.x);i.subThis(t.x);const n=new c(s.y);n.subThis(t.y);const r=new c(e.x);r.subThis(t.x);const u=new c(e.y);u.subThis(t.y);const h=i.clone();h.mulThisE(u);let o=n.clone();if(o.mulThisE(r),h.subThisE(o),0===h.value())return ks.getNAN();h.mulThis(2);const a=i.clone();a.mulThisE(i);const m=n.clone();m.mulThisE(n);const l=a.clone();l.addThisE(m);const f=r.clone();f.mulThisE(r);const _=u.clone();_.mulThisE(u);const v=f.clone();v.addThisE(_);const b=n.clone();b.mulThisE(v),o=u.clone(),o.mulThisE(l),b.subThisE(o),b.divThisE(h);const d=i.clone();d.mulThisE(v),o=r.clone(),o.mulThisE(l),d.subThisE(o),d.divThisE(h);const p=ks.construct(t.x-b.value(),t.y+d.value()),x=t.sub(p).length(),N=s.sub(p).length(),y=e.sub(p).length(),g=1e-15*(x+Math.abs(t.x)+Math.abs(s.x)+Math.abs(e.x)+Math.abs(t.y)+Math.abs(s.y)+Math.abs(e.y));return Math.abs(x-N)<=g&&Math.abs(x-y)<=g&&b.eps()<g&&d.eps()<g?p:ks.getNAN()}(t,s,e);return i.isNAN()?function(t,s,e){const i=qs.constructDouble(s.x);i.subDoubleThis(t.x);const n=qs.constructDouble(s.y);n.subDoubleThis(t.y);const r=qs.constructDouble(e.x);r.subDoubleThis(t.x);const u=qs.constructDouble(e.y);u.subDoubleThis(t.y);const h=i.clone();h.mulThis(u);let o=n.clone();if(o.mulThis(r),h.subThis(o),h.isZero())return ks.getNAN();h.mulDoubleThis(2);const a=i.clone();a.mulThis(i);const m=n.clone();m.mulThis(n);const c=a.clone();c.addThis(m);const l=r.clone();l.mulThis(r);const f=u.clone();f.mulThis(u);const _=l.clone();_.addThis(f);const v=n.clone();v.mulThis(_),o=u.clone(),o.mulThis(c),v.subThis(o),v.divThis(h);const b=i.clone();return b.mulThis(_),o=r.clone(),o.mulThis(c),b.subThis(o),b.divThis(h),ks.construct(t.x-v.value(),t.y+b.value())}(t,s,e):i}static calculateAngle(t,s){return Math.atan2(t.crossProduct(s),t.dotProduct(s))}static isBisectorRobust(t,s,e){return(0,i.g)(0),!1}static size(){return 2}get 0(){return this.x}get 1(){return this.y}set 0(t){this.x=t}set 1(t){this.y=t}static compareZorder(t,s){const e=ks.c_compare_zorder_xx[t.x<0?1:0]|ks.c_compare_zorder_yy[t.y<0?1:0],i=ks.c_compare_zorder_xx[s.x<0?1:0]|ks.c_compare_zorder_yy[s.y<0?1:0];if(e===i){let e=0,i=0;for(let n=0;n<2;++n){const r=Zs(t[n],s[n]);r>e&&(e=r,i=n)}return t[i]<s[i]}return e<i}static lerp(t,s,e){const i=new ks;return R(t,s,e,i),i}static getClosestCoordinate(t,s,e,i=!1){const n=ks.getNAN();n.setSub(s,t);const r=n.sqrLength();if(0===r)return.5;if(s.isEqualPoint2D(e))return 1;const u=ks.getNAN();u.setSub(e,t);let h=u.dotProduct(n)/r;return i||(h<0?h=0:h>1&&(h=1)),h}static intersectLinesAtOnePoint(t,s,e,i){if(t.equals(s)||e.equals(i))return ks.getNAN();const n=s.x-t.x,r=e.x-i.x,u=s.y-t.y,h=e.y-i.y,o=n*h-r*u;if(!o)return ks.getNAN();const a=o;if(0===a)return ks.getNAN();let m=(e.x-t.x)*h-(e.y-t.y)*r;m/=a;const c=new ks;return R(t,s,m,c),c.isFinite()?c:ks.getNAN()}toString(){return`[${this.x},${this.y}]`}}ks.dimensions=2,ks.d=[[0,1,0,-1],[-1,0,1,0],[0,-1,0,1],[1,0,-1,0]],ks.c_compare_zorder_xx=[2,0],ks.c_compare_zorder_yy=[1,0]}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[6160],{46160:(e,t,n)=>{n.r(t),n.d(t,{execute:()=>c,executeMany:()=>u});var r=n(4576),o=n(83047),i=n(96718),a=n(83299);function c(e,t,n={}){const{unit:r}=n,c=(0,a.getSpatialReference)(e);r&&c&&(t=(0,o.UW)(t,r,c));const u=(0,a.fromGeometry)(e),m=u.getSpatialReference();return(0,a.toGeometry)((0,i.g7)(u.getGeometry(),m,t),m)}function u(e,t,n={}){let{maxDeviation:c=NaN,maxVerticesInFullCircle:u=96,union:m=!1,unit:l}=n;const s=(0,a.getSpatialReference)(e);l&&s&&(t=t.map((e=>(0,o.UW)(e,l,s))),c&&(c=(0,o.UW)(c,l,s)));const[f,p]=(0,a.fromGeometries)(e);return(0,i.yv)(f,p,t,c,u,m).map((e=>(0,a.toGeometry)(e,p))).filter(r.Ru)}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[6160],{46160:(e,t,n)=>{n.r(t),n.d(t,{execute:()=>c,executeMany:()=>u});var r=n(4576),o=n(83047),i=n(91364),a=n(83299);function c(e,t,n={}){const{unit:r}=n,c=(0,a.getSpatialReference)(e);r&&c&&(t=(0,o.UW)(t,r,c));const u=(0,a.fromGeometry)(e),m=u.getSpatialReference();return(0,a.toGeometry)((0,i.g7)(u.getGeometry(),m,t),m)}function u(e,t,n={}){let{maxDeviation:c=NaN,maxVerticesInFullCircle:u=96,union:m=!1,unit:l}=n;const s=(0,a.getSpatialReference)(e);l&&s&&(t=t.map((e=>(0,o.UW)(e,l,s))),c&&(c=(0,o.UW)(c,l,s)));const[f,p]=(0,a.fromGeometries)(e);return(0,i.yv)(f,p,t,c,u,m).map((e=>(0,a.toGeometry)(e,p))).filter(r.Ru)}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7444],{1364:(e,t,s)=>{s.d(t,{c:()=>i});var n=s(55537);function i(e,t){const s=e.getGeometryType();return s===n.G.enumPoint?e:(0,n.h)(s)?function(e){if(function(e){for(let t=0,s=e.getPathCount();t<s;t++){const s=e.getPathSize(t);if(0===s)return!1;if(1===s){if(0===e.getSegmentCountPath(t))return!1;if(e.getSegmentType(e.getPathStart(t))===n.G.enumLine)return!1;if(!e.isClosedPath(t))return!1}}return!0}(e))return e;const t=e.createInstance();for(let s=0,i=e.getPathCount();s<i;s++){const i=e.getPathSize(s);if(0!==i){if(1===i){if(0===e.getSegmentCountPath(s))continue;if(e.getSegmentType(e.getPathStart(s))===n.G.enumLine)continue;if(!e.isClosedPath(s))continue}t.addPath(e,s,!0)}}return t}(e):s===n.G.enumMultiPoint||s===n.G.enumEnvelope?e:s===n.G.enumMultipatch?((0,n.b)("not implemented for multipatch"),e):e}},37444:(e,t,s)=>{s.r(t),s.d(t,{OperatorGeodesicBuffer:()=>G});var n=s(76061),i=s(55537),r=s(79187),o=s(12189),m=s(90237),a=s(35368),h=s(95213),c=s(11878),u=s(83661),l=s(31139),_=s(1364),f=s(5247);class d{constructor(e){this.m_sr=null,this.m_gcs=null,this.m_transform=null,this.m_a=0,this.m_eSquared=0,this.m_rpu=0,this.m_radTolerance=0,this.m_q90=0,this.m_gcs90=0,this.m_gcs180=0,this.m_gcs360=0,this.m_gcs60=0,this.m_ellipticToGeodesicMaxRatio=0,this.m_curveType=0,this.m_bShapePreserving=!1,this.m_distance=0,this.m_absDistance=0,this.m_convergenceOffset=0,this.m_cornerStep=0,this.m_segmentStep=0,this.m_progressTracker=e}bufferPolygon(e){const t=new a.a,s=new I(this,e,t);return this.processGnomonicBufferPiecesCursor(!0,s)}bufferPolyline(e){const t=new I(this,e,null);return this.processGnomonicBufferPiecesCursor(!0,t)}bufferMultiPoint(e){const t=new E(this,e);return this.processGnomonicBufferPiecesCursor(!1,t)}bufferPoint(e){const t=e.getXY();t.scale(this.m_rpu);let s=new a.a;if(this.bufferPoint2D(t,!1,s)){const e=(0,h.b)(null,s,!0);s=(0,o.y)(s,e,!0,!0,-1,this.m_progressTracker,0,!1)}return s=(new o.v).foldInto360RangeGeodetic(s,this.m_gcs,2),s}processGnomonicBufferPiecesCursor(e,t){const s=t;let n=s.getGnomonic();const i=(0,o.z)((0,o.A)());let m=new o.L,a=(new o.h).executeMany(m,i,this.m_progressTracker,2);const l=(0,u.d)(6,!1),_=(0,u.m)(r.Envelope2D,6);this.initializeGrid(l,_);const f=[null,null,null,null,null,null],d=[null,null,null,null,null,null],g=[null,null,null,null,null,null];let P,p,b;for(;null!==(P=s.next());){if(p=s.getGnomonic(),p!==n){if(null!==n){let t=a.next();if(m=null,a=null,null!=t){const s=(0,h.b)(i,t,!0),r=(0,h.d)(s);t=n.unproject(t,r,this.m_progressTracker),this.putInGridCursors(e,t,i,!0,l,_,f,d,g)}}null!==p&&(m=new o.L,a=(new o.h).executeMany(m,i,this.m_progressTracker,2)),n=p}if(s.isRunningInGnomonic()){if(p.project(P),s.needsSimplify()){const e=(0,h.b)(null,P,!0);P=(0,o.y)(P,e,!0,!0,-1,this.m_progressTracker,0,!1)}m.tick(S(P)),a.tock()}else this.putInGridCursors(e,P,i,!0,l,_,f,d,g)}let x=!1;for(let e=0;e<6;e++)if(null!=g[e]){x=!0;break}if(x){let t=!1;const r=[null,null,null,null,null,null];if(e){const n=s.m_densified;if(s.m_densified=null,null!==n){const s=new c.T;s.scale(1/this.m_rpu,1/this.m_rpu),n.applyTransformation(s),this.m_distance>0?this.putInGridCursors(e,n,i,!1,l,_,f,d,g):(this.processInGrid(e,n,!1,l,_,f,r),t=!0)}}const u=new o.L,P=(new o.h).executeMany(u,this.m_gcs,this.m_progressTracker,2);if(null!==a){let t=a.next();m=null,a=null;const s=(0,h.b)(i,t,!0),r=(0,h.d)(s);t=n.unproject(t,r,this.m_progressTracker),this.putInGridCursors(e,t,i,!0,l,_,f,d,g)}for(let e=0;e<6;e++)if(null!=g[e]){let s=g[e].next();g[e]=null,d[e]=null,t&&null!==r[e]&&(s=(new o.e).execute(r[e],s,i,this.m_progressTracker));const n=(0,h.b)(i,s,!0),m=(0,h.d)(n);s=f[e].unproject(s,m,this.m_progressTracker),s=(new o.g).execute(s,this.m_gcs,!0,this.m_progressTracker),u.tick(S(s)),P.tock()}b=P.next()}else{let t,r=!1;if(e){let e=s.m_densified;if(s.m_densified=null,null!==e){const s=new c.T;s.scale(1/this.m_rpu,1/this.m_rpu),e.applyTransformation(s),p.project(e);const n=(0,h.b)(null,e,!0);e=(0,o.y)(e,n,!1,!0,-1,this.m_progressTracker,0,!1),this.m_distance>0?(m.tick(S(e)),a.tock()):(t=e,r=!0)}}let u=a.next();m=null,a=null,r&&(u=(new o.e).execute(t,u,i,this.m_progressTracker));const l=(0,h.b)(i,u,!0),_=(0,h.d)(l);b=n.unproject(u,_,this.m_progressTracker),b=(new o.g).execute(b,this.m_gcs,!0,this.m_progressTracker)}return b=(new o.v).foldInto360RangeGeodetic(b,this.m_gcs,2),b}putInGridCursors(e,t,s,n,i,r,m,a,h){const c=[null,null,null,null,null,null];this.processInGrid(e,t,n,i,r,m,c);for(let e=0;e<6;e++)null!==c[e]&&(null===a[e]&&(a[e]=new o.L,h[e]=(new o.h).executeMany(a[e],s,this.m_progressTracker,2)),a[e].tick(S(c[e])),h[e].tock())}processInGrid(e,t,s,n,i,r,m){const a=.01,c=this.insertGeodeticPointsAlongGrid(t,i,a);for(let e=0;e<6;e++){if(n[e])continue;const _=i[e].clone();_.inflateCoords(a,a);const f=(0,h.e)(t,_),d=(0,h.a)(null,f,!1).total();let g=(0,l.c)(c,_,d,Number.NaN,this.m_progressTracker);if(null!==g&&!g.isEmpty()){if(g===c&&(g=g.clone()),null===r[e]){const t=new u.P;e<3?t.setCoords(0,1):t.setCoords(0,-1);const s=new u.P;s.setAdd(i[e].getCenter(),t),r[e]=v(this.m_gcs,s)}r[e].project(g);const t=(0,h.b)(null,g,!0);g=(0,o.y)(g,t,s,!0,-1,this.m_progressTracker,0,!1),m[e]=g}}}insertGeodeticPointsAlongGrid(e,t,s){const n=r.Envelope2D.construct(t[3].xmin,t[3].ymin,t[2].xmax,t[2].ymax),i=(0,o.B)(this.m_gcs,n,e,!0,this.m_progressTracker),m=new a.E,h=m.addGeometry(i);return(0,o.D)(m,h,this.m_gcs,0,2,!0,t[0].xmax+s),(0,o.D)(m,h,this.m_gcs,0,2,!0,t[1].xmax+s),(0,o.D)(m,h,this.m_gcs,0,2,!1,t[1].ymin+s),0!==s&&((0,o.D)(m,h,this.m_gcs,0,2,!0,t[0].xmax-s),(0,o.D)(m,h,this.m_gcs,0,2,!0,t[1].xmax-s),(0,o.D)(m,h,this.m_gcs,0,2,!1,t[1].ymin-s)),m.getGeometry(h)}initializeGrid(e,t){for(let t=0;t<6;t++)e[t]=!1;t[0].setCoords({xmin:-this.m_gcs180,ymin:0,xmax:-this.m_gcs60,ymax:this.m_gcs90}),t[1].setCoords({xmin:-this.m_gcs60,ymin:0,xmax:this.m_gcs60,ymax:this.m_gcs90}),t[2].setCoords({xmin:this.m_gcs60,ymin:0,xmax:this.m_gcs180,ymax:this.m_gcs90}),t[3].setCoords({xmin:-this.m_gcs180,ymin:-this.m_gcs90,xmax:-this.m_gcs60,ymax:0}),t[4].setCoords({xmin:-this.m_gcs60,ymin:-this.m_gcs90,xmax:this.m_gcs60,ymax:0}),t[5].setCoords({xmin:this.m_gcs60,ymin:-this.m_gcs90,xmax:this.m_gcs180,ymax:0})}checkAndPrepSegmentForCrossingAzimuthsOrPoleWrap(e,t,s,n,i,r){const m=e[0],a=e.at(-1),h=m.y<a.y?m.y:a.y,c=m.y>a.y?m.y:a.y,l=o.t.q(this.m_a,this.m_eSquared,h),_=o.t.q(this.m_a,this.m_eSquared,c);if(this.m_q90-(l+t+this.m_absDistance)>.001&&this.m_q90+(_-t-this.m_absDistance)>.001)return!1;const f=s-u.l,d=n+u.l,g=f-Math.PI,x=f+Math.PI,y=d+Math.PI,w=[Number.NaN],C=[Number.NaN],v=[Number.NaN],S=[Number.NaN];let D=!1;if(b(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,m,f,g,a,d,w,C),b(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,a,y,d,m,g,v,S),(d<w[0]&&w[0]<y||d<C[0]&&C[0]<y)&&(D=!0),D||(g<v[0]&&v[0]<f||g<S[0]&&S[0]<f)&&(D=!0),!D&&i)return!1;const I=[];for(let t=e.length-1;t>=0;t--)I.push(e[t]);r.setEmpty(),r.addPathPoint2D(null,0,!0);let E=0;E=P(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,this.m_curveType,e,f,d,i,E,r),E=p(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,a,d,y,this.m_cornerStep,i,E,r,w[0],C[0]),E=P(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,this.m_curveType,I,y,x,i,E,r),E=p(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,m,g,f,this.m_cornerStep,i,E,r,v[0],S[0]);let G=!1;return i||(G=this.checkAndPrepForPole(r)),D||G}bufferPoint2D(e,t,s){s.setEmpty(),s.addPathPoint2D(null,0,!0),p(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,e,-this.m_cornerStep,2*Math.PI,this.m_cornerStep,t,0,s);let n=!1;return t||(n=this.checkAndPrepForPole(s)),n}checkAndPrepForPole(e){const t=this.checkAndPrepForPoleTouch(e),s=this.checkAndPrepForPoleWrap(e);return t||s}checkAndPrepForPoleTouch(e){const t=new r.Envelope2D;return e.queryEnvelope(t),!(!(0,o.P)(t.ymax,this.m_gcs90)&&!(0,o.P)(t.ymin,-this.m_gcs90)||(this.prepPoleTouch(e),0))}checkAndPrepForPoleWrap(e){const t=e.getXY(0),s=e.getXY(e.getPointCount()-1);return Math.abs(t.x-s.x)>this.m_gcs180?(this.prepSinglePoleWrap(e),!0):this.checkAndPrepForDoublePoleWrap(e)}checkAndPrepForDoublePoleWrap(e){return e.calculateArea2D()<0&&(this.prepDoublePoleWrap(e),!0)}prepPoleTouch(e){const t=new a.a;t.insertPath2D(-1,null,0,0,!0);const s=e.getPathStart(0),n=e.getPathEnd(0),i=n-s;let r=-1;for(r=s;r<n;r++){const t=e.getXY(r),s=(0,o.P)(t.y,this.m_gcs90),n=(0,o.P)(t.y,-this.m_gcs90);if(!s&&!n)break}let m=r,h=!1,c=Number.NaN;do{const n=e.getXY(m),r=(0,o.P)(n.y,this.m_gcs90),a=(0,o.P)(n.y,-this.m_gcs90),l=s+(m+1-s)%i;if(r||a){let s=u.P.construct(c,n.y);t.insertPoint2D(0,-1,s);const i=e.getXY(l),r=(0,o.P)(i.y,this.m_gcs90),m=(0,o.P)(i.y,-this.m_gcs90);r||m||(s=u.P.construct(i.x,n.y),h?t.setXY(t.getPointCount()-1,s):t.insertPoint2D(0,-1,s)),h=!0}else t.insertPoint2D(0,-1,n),c=n.x,h=!1;m=l}while(m!==r);e.setEmpty(),e.add(t,!1)}prepSinglePoleWrap(e){const t=new a.a,s=new a.a,n=new c.T,i=e.getXY(e.getPathStart(0)),m=e.getXY(e.getPathEnd(0)-1),_=this.m_gcs360,f=this.m_gcs180,d=new r.Envelope2D;d.setCoords({xmin:-this.m_gcs180,ymin:-this.m_gcs90,xmax:this.m_gcs180,ymax:this.m_gcs90});const g=new r.Envelope2D;e.queryEnvelope(g);const P=Math.ceil(g.width()/_);let p,b;i.x>m.x?(p=-_,b=this.m_gcs90):(p=_,b=-this.m_gcs90),n.setShiftCoords(p,0),t.addPath(e,0,!0),s.add(t,!1);const x=new h.P;for(let e=0;e<P;e++)s.applyTransformation(n),s.getPointByVal(0,x),t.lineToPoint(x),t.addSegmentsFromPath(s,0,0,s.getSegmentCount()-1,!1);const y=t.getXY(0),w=t.getXY(t.getPointCount()-1);y.y=b,w.y=b,t.lineTo(w);const C=new u.P;for(C.setCoordsPoint2D(w),C.x-=.5*p;Math.abs(C.x-y.x)>f;)t.lineTo(C),C.x-=.5*p;t.lineTo(y);const v=d.getCenterX(),S=new r.Envelope2D;t.queryEnvelope(S);let D=0;const I=S.getCenter().x;I-v>f?D=-Math.ceil((I-v-f)/_):v-I>f&&(D=Math.ceil((v-I-f)/_)),0!==D&&(n.setShiftCoords(D*_,0),t.applyTransformation(n));const E=new a.E,G=E.addGeometry(t);(0,o.D)(E,G,this.m_gcs,0,2,!0,d.xmin),(0,o.D)(E,G,this.m_gcs,0,2,!0,d.xmax);const k=E.getGeometry(G),T=(0,h.e)(k,d);T.inflateCoords(0,1);const M=(0,h.a)(null,T,!0).total(),N=(0,l.c)(k,d,M,Number.NaN,this.m_progressTracker);e.setEmpty(),e.add(N,!1)}prepDoublePoleWrap(e){const t=this.m_gcs360,s=this.m_gcs180,n=new r.Envelope2D;n.setCoords({xmin:-this.m_gcs180,ymin:-this.m_gcs90,xmax:this.m_gcs180,ymax:this.m_gcs90});const i=n.getCenter().x,m=new r.Envelope2D;e.queryPathEnvelope(0,m);let _,f=0,d=m.getCenter().x;if(d-i>s?f=-Math.ceil((d-i-s)/t):i-d>s&&(f=Math.ceil((i-d-s)/t)),0!==f){const s=new c.T;s.setShiftCoords(f*t,0),e.getImpl().applyTransformationToPath(s,0),e.queryPathEnvelope(0,m),d=m.getCenter().x}const g=new r.Envelope2D;n.containsExclusiveEnvelope(m)?(_=!1,g.setCoords({env2D:n})):(_=!0,g.setCoords({env2D:n}),g.xmin-=t,g.xmax+=t);let P=e.createInstance();P.addPathPoint2D(null,0,!0);const p=new u.P;if(p.setCoords(g.xmin,g.ymin),P.insertPoint2D(0,-1,p),p.setCoords(g.xmin,g.ymax),P.insertPoint2D(0,-1,p),p.setCoords(.5*(g.xmin+g.xmax),g.ymax),P.insertPoint2D(0,-1,p),p.setCoords(g.xmax,g.ymax),P.insertPoint2D(0,-1,p),p.setCoords(g.xmax,g.ymin),P.insertPoint2D(0,-1,p),p.setCoords(.5*(g.xmin+g.xmax),g.ymin),P.insertPoint2D(0,-1,p),_){P.addPath(e,0,!0);const s=new c.T;d<i?s.setShiftCoords(t,0):s.setShiftCoords(-t,0),e.getImpl().applyTransformationToPath(s,0),P.addPath(e,0,!0);const r=new a.E,m=r.addGeometry(P);(0,o.D)(r,m,this.m_gcs,0,2,!0,n.xmin),(0,o.D)(r,m,this.m_gcs,0,2,!0,n.xmax),P=r.getGeometry(m);const u=(0,h.e)(P,n);u.inflateCoords(0,1);const _=(0,h.a)(null,u,!0).total();P=(0,l.c)(P,n,_,Number.NaN,this.m_progressTracker)}else P.addPath(e,0,!0);e.setEmpty(),e.add(P,!1)}setMinCornerStep(){const e={stack:[],error:void 0,hasError:!1};try{let t=Math.min(Math.PI*this.m_a-this.m_absDistance,this.m_absDistance);t=Math.min(t,.125*this.m_a*Math.PI);const s=new u.P;s.setCoords(0,10*this.m_rpu);const n=0;let i=45*this.m_rpu;const r=(0,m.b)(e,new u.S(new o.E,new o.E),!1),a=(0,m.b)(e,new u.S(new o.E,new o.E),!1),h=(0,m.b)(e,new u.S(new o.E,new o.E),!1),c=(0,m.b)(e,new u.S(new o.E,new o.E),!1),l=new u.P,_=new u.P,f=new u.P,d=new u.P;for(o.F.geodesicCoordinate(this.m_a,this.m_eSquared,s.x,s.y,t,n,r.at(0),r.at(1)),l.setCoords(r.at(0).val,r.at(1).val),o.F.geodesicCoordinate(this.m_a,this.m_eSquared,s.x,s.y,t,i,a.at(0),a.at(1)),_.setCoords(a.at(0).val,a.at(1).val);;){const e={stack:[],error:void 0,hasError:!1};try{const r=.5*(n+i);o.F.geodesicCoordinate(this.m_a,this.m_eSquared,s.x,s.y,t,r,h.at(0),h.at(1)),f.setCoords(h.at(0).val,h.at(1).val);const u=(0,m.b)(e,new o.E,!1),g=(0,m.b)(e,new o.E,!1);o.F.geodeticDistance(this.m_a,this.m_eSquared,l.x,l.y,_.x,_.y,u,g,null,2),o.F.geodeticCoordinate(this.m_a,this.m_eSquared,l.x,l.y,.5*u.val,g.val,c.at(0),c.at(1),2),d.setCoords(c.at(0).val,c.at(1).val);const P=(0,m.b)(e,new o.E,!1);if(o.F.geodeticDistance(this.m_a,this.m_eSquared,f.x,f.y,d.x,d.y,P,null,null,2),P.val<=this.m_convergenceOffset)break;i*=.9,o.F.geodesicCoordinate(this.m_a,this.m_eSquared,s.x,s.y,t,i,a.at(0),a.at(1)),_.setCoords(a.at(0).val,a.at(1).val)}catch(t){e.error=t,e.hasError=!0}finally{(0,m.c)(e)}}const g=i-n,P=2*Math.PI/Math.ceil(2*Math.PI/g);this.m_cornerStep=P}catch(t){e.error=t,e.hasError=!0}finally{(0,m.c)(e)}}setMinSegmentStep(){const e={stack:[],error:void 0,hasError:!1};try{let t=Math.min(Math.PI*this.m_a-this.m_absDistance,this.m_absDistance);t=Math.min(t,.125*this.m_a*Math.PI);const s=new u.P,n=new u.P;s.setCoords(0,10*this.m_rpu),n.setCoords(10*this.m_rpu,10*this.m_rpu);const i=(0,m.b)(e,new o.E,!1),r=(0,m.b)(e,new o.E,!1),a=(0,m.b)(e,new o.E,!1);o.F.geodeticDistance(this.m_a,this.m_eSquared,s.x,s.y,n.x,n.y,a,i,r,this.m_curveType);const h=(0,m.b)(e,new u.S(new o.E,new o.E),!1),c=(0,m.b)(e,new u.S(new o.E,new o.E),!1),l=new u.P,_=(0,m.b)(e,new o.E,!1),f=(0,m.b)(e,new u.S(new o.E,new o.E),!1),d=(0,m.b)(e,new u.S(new o.E,new o.E),!1),g=(0,m.b)(e,new u.S(new o.E,new o.E),!1),P=(0,m.b)(e,new u.S(new o.E,new o.E),!1),p=new u.P,b=new u.P,x=new u.P,y=new u.P,w=0;let C=1;const v=i.val,S=r.val,D=v-.5*Math.PI,I=S+.5*Math.PI,E=a.val;for(o.F.geodesicCoordinate(this.m_a,this.m_eSquared,s.x,s.y,t,D,f.at(0),f.at(1)),p.setCoords(f.at(0).val,f.at(1).val),o.F.geodesicCoordinate(this.m_a,this.m_eSquared,n.x,n.y,t,I,d.at(0),d.at(1)),b.setCoords(d.at(0).val,d.at(1).val);;){const e={stack:[],error:void 0,hasError:!1};try{const i=.5*(w+C);o.F.geodeticCoordinate(this.m_a,this.m_eSquared,s.x,s.y,i*E,v,h.at(0),h.at(1),this.m_curveType),l.setCoords(h.at(0).val,h.at(1).val),o.F.geodeticDistance(this.m_a,this.m_eSquared,s.x,s.y,l.x,l.y,null,null,_,this.m_curveType);const r=_.val+.5*Math.PI;o.F.geodesicCoordinate(this.m_a,this.m_eSquared,l.x,l.y,t,r,g.at(0),g.at(1)),x.setCoords(g.at(0).val,g.at(1).val);const a=(0,m.b)(e,new o.E,!1),u=(0,m.b)(e,new o.E,!1);o.F.geodeticDistance(this.m_a,this.m_eSquared,p.x,p.y,b.x,b.y,a,u,null,2),o.F.geodeticCoordinate(this.m_a,this.m_eSquared,p.x,p.y,.5*a.val,u.val,P.at(0),P.at(1),2),y.setCoords(P.at(0).val,P.at(1).val);const f=(0,m.b)(e,new o.E,!1);if(o.F.geodeticDistance(this.m_a,this.m_eSquared,x.x,x.y,y.x,y.y,f,null,null,2),f.val<=this.m_convergenceOffset)break;{const e={stack:[],error:void 0,hasError:!1};try{C*=.9,o.F.geodeticCoordinate(this.m_a,this.m_eSquared,s.x,s.y,C*E,v,c.at(0),c.at(1),this.m_curveType),n.setCoords(c.at(0).val,c.at(1).val);const i=(0,m.b)(e,new o.E,!1);o.F.geodeticDistance(this.m_a,this.m_eSquared,s.x,s.y,n.x,n.y,null,null,i,this.m_curveType);const r=i.val+.5*Math.PI;o.F.geodesicCoordinate(this.m_a,this.m_eSquared,n.x,n.y,t,r,d.at(0),d.at(1)),b.setCoords(d.at(0).val,d.at(1).val)}catch(t){e.error=t,e.hasError=!0}finally{(0,m.c)(e)}}}catch(t){e.error=t,e.hasError=!0}finally{(0,m.c)(e)}}let G=C*E;G>1e5&&(G=1e5),this.m_segmentStep=G}catch(t){e.error=t,e.hasError=!0}finally{(0,m.c)(e)}}setConvergenceOffset(){let e;e=this.m_absDistance>5e4?100:this.m_absDistance>1e4?10:1,this.m_absDistance/e<500&&(e=this.m_absDistance/500),e<.01&&(e=.01),this.m_convergenceOffset=e}}function g(e,t,s,n,m,c,l){if(e.isEmpty())return new a.a({vd:e.getDescription()});let _=e;if((0,i.j)(_)){const e=10*t.getTolerance(0);_=(new f.O).execute(_,0,e,0,l,12e3)}const g=new d(l);g.m_sr=t,g.m_gcs=t.getGCS(),g.m_transform=(0,o.p)(t,g.m_gcs,null);const P=(0,o.G)();g.m_gcs.querySpheroidData(P);const p=new r.Envelope2D;_.queryEnvelope(p),g.m_a=P.majorSemiAxis,g.m_eSquared=P.e2,g.m_rpu=g.m_gcs.getUnit().getUnitToBaseFactor(),g.m_gcs90=.5*Math.PI/g.m_rpu,g.m_gcs180=Math.PI/g.m_rpu,g.m_gcs360=2*Math.PI/g.m_rpu,g.m_gcs60=g.m_gcs360/6,g.m_q90=o.t.q90(g.m_a,g.m_eSquared),g.m_ellipticToGeodesicMaxRatio=.5*g.m_a*Math.PI/g.m_q90;const b=g.m_gcs.getTolerance(0);g.m_radTolerance=b*g.m_rpu,4===s?(g.m_curveType=2,g.m_bShapePreserving=!0):(g.m_curveType=s,g.m_bShapePreserving=!1),g.m_distance=n,g.m_absDistance=Math.abs(n),Number.isNaN(m)||m<=0?g.setConvergenceOffset():g.m_convergenceOffset=Math.max(m,.001),g.m_convergenceOffset/=c;let x,y=_.getGeometryType();if((0,i.f)(y)){const e=new a.P({vd:_.getDescription()});e.addSegment(_,!0),x=e,y=i.G.enumPolyline}else if(y===i.G.enumEnvelope){const e=_,t=new r.Envelope2D;e.queryEnvelope(t);const s=(0,h.d)((0,h.a)(g.m_sr,p,!0));if(t.minDimension()<=s)if(0===t.maxDimension()){const t=new h.P({vd:_.getDescription()});e.getCenter(t),x=t,y=i.G.enumPoint}else{const t=new a.P({vd:_.getDescription()});t.addEnvelope(e,!1),x=t,y=i.G.enumPolyline}else{const t=new a.a({vd:_.getDescription()});t.addEnvelope(e,!1),x=t,y=i.G.enumPolygon}}else x=_;if(g.setMinCornerStep(),(0,i.e)(y)||g.setMinSegmentStep(),g.m_absDistance<=.5*g.m_convergenceOffset)return y!==i.G.enumPolygon?new a.a({vd:x.getDescription()}):g.m_bShapePreserving?x:(0,o.u)(x,g.m_sr,g.m_curveType,g.m_segmentStep,-1,l);if(g.m_distance<0&&y!==i.G.enumPolygon)return new a.a({vd:x.getDescription()});if(g.m_bShapePreserving&&(0,i.h)(y)){const e=(0,o.u)(x,t,4,Number.NaN,g.m_convergenceOffset,l);x=(new o.v).execute(e,g.m_transform,l)}else x=(new o.v).execute(x,g.m_transform,l);if(x=(0,o.w)(x,g.m_gcs),x.isEmpty())return new a.a({vd:x.getDescription()});!g.m_bShapePreserving&&(0,i.h)(y)&&(x=(0,o.x)(g.m_rpu,x)),x=function(e,t){const s=e.getGeometryType();let n;if(n=(0,i.h)(s)?e.getPathCount():s===i.G.enumMultiPoint?e.getPointCount():1,1===n)return e;const o=[],m=[];for(let a=0;a<n;a++){o.push(a);const n=new u.P;if((0,i.h)(s)){const t=new r.Envelope2D;e.queryPathEnvelope(a,t),n.assign(t.getCenter())}else n.assign(e.getXY(a));const h=t.toGeohash(n);m.push(h)}o.sort(((e,t)=>m[e]<m[t]?-1:m[e]>m[t]?1:0));const a=e.createInstance();for(let t=0;t<n;t++){const n=o[t];(0,i.h)(s)?a.addPath(e,n,!0):a.addPoints(e,n,n+1)}return a}(x,g.m_gcs);let w=new a.a;switch(y){case i.G.enumPolygon:w=g.bufferPolygon(x);break;case i.G.enumPolyline:w=g.bufferPolyline(x);break;case i.G.enumMultiPoint:w=g.bufferMultiPoint(x);break;case i.G.enumPoint:w=g.bufferPoint(x);break;default:(0,i.k)("")}const C=(new o.v).execute(w,g.m_transform.getInverse(),l);return C.mergeVertexDescription(x.getDescription()),C}function P(e,t,s,n,i,r,a,h,c,l,_){const f={stack:[],error:void 0,hasError:!1};try{const d=new u.P;d.setNAN(),c||_.getPointCount()>0&&(d.setCoordsPoint2D(_.getXY(_.getPointCount()-1)),d.scale(s));const g=(0,m.b)(f,new o.E,!1),P=(0,m.b)(f,new u.S(new o.E,new o.E),!1),p=new u.P,b=new u.P,y=r.at(-1),w=1/s;for(let s=0;s<r.length;s++){const m=r[s];let u;0===s?u=a:s===r.length-1?u=h:(o.F.geodeticDistance(e,t,y.x,y.y,m.x,m.y,null,null,g,i),u=g.val-.5*Math.PI),o.F.geodesicCoordinate(e,t,m.x,m.y,n,u,P.at(0),P.at(1)),c?b.setCoords(P.at(0).val,P.at(1).val):(p.setCoords(P.at(0).val,P.at(1).val),l=x(m.x,p.x,d.x,l),b.setCoords(l+p.x,p.y),d.setCoordsPoint2D(b)),b.scale(w),_.insertPoint2D(0,-1,b)}return l}catch(e){f.error=e,f.hasError=!0}finally{(0,m.c)(f)}}function p(e,t,s,n,i,r,a,h,c,l,_,f=Number.NaN,d=Number.NaN){const g={stack:[],error:void 0,hasError:!1};try{if(a-r<h)return l;const P=(0,m.b)(g,new u.S(new o.E,new o.E),!1),p=new u.P,b=new u.P,y=new u.P;b.setNAN(),c||_.getPointCount()>0&&(b.setCoordsPoint2D(_.getXY(_.getPointCount()-1)),b.scale(s));let w=Math.ceil(r/h),C=w++*h;C===r&&(C=w++*h);let v=r;const S=1/s;for(;C<a+h&&(v<f&&f<C?(C=f,w--):v<d&&d<C&&(C=d,w--),!(C>=a));)o.F.geodesicCoordinate(e,t,i.x,i.y,n,C,P.at(0),P.at(1)),c?y.setCoords(P.at(0).val,P.at(1).val):(p.setCoords(P.at(0).val,P.at(1).val),l=x(i.x,p.x,b.x,l),y.setCoords(l+p.x,p.y),b.setCoordsPoint2D(y)),y.scale(S),_.insertPoint2D(0,-1,y),v=C,C=w++*h;return l}catch(e){g.error=e,g.hasError=!0}finally{(0,m.c)(g)}}function b(e,t,s,n,i,r,a,h,c,l,_){const f={stack:[],error:void 0,hasError:!1};try{const s=new u.P,d=new u.P,g=(0,m.b)(f,new u.S(new o.E,new o.E),!1);o.F.geodesicCoordinate(e,t,i.x,i.y,n,r,g.at(0),g.at(1)),s.setCoords(g.at(0).val,g.at(1).val),o.F.geodesicCoordinate(e,t,i.x,i.y,n,a,g.at(0),g.at(1)),d.setCoords(g.at(0).val,g.at(1).val);const P=(0,m.b)(f,new o.E,!1);for(o.F.geodeticDistance(e,t,h.x,h.y,s.x,s.y,null,P,null,0),l[0]=P.val,o.F.geodeticDistance(e,t,h.x,h.y,d.x,d.y,null,P,null,0),_[0]=P.val;l[0]<=_[0];)l[0]+=u.k;for(;l[0]>_[0];)l[0]-=u.k;for(;l[0]>=c;)l[0]-=u.k,_[0]-=u.k;for(;l[0]<c;)l[0]+=u.k,_[0]+=u.k}catch(e){f.error=e,f.hasError=!0}finally{(0,m.c)(f)}}function x(e,t,s,n){if(Number.isNaN(s)){for(;n+t-e>Math.PI;)n-=u.k;for(;e-(n+t)>Math.PI;)n+=u.k;return n}return n+t-s>Math.PI?n-=u.k:s-(n+t)>Math.PI&&(n+=u.k),n}function y(e,t,s,n,i,r){const a={stack:[],error:void 0,hasError:!1};try{if(n>=r)return!1;const h=s[0],c=s.at(-1),u=(0,m.b)(a,new o.E,!1),l=(0,m.b)(a,new o.E,!1),_=(0,m.b)(a,new o.E,!1);o.F.greatEllipticDistance(e,t,i.x,i.y,h.x,h.y,u,null,null),o.F.greatEllipticDistance(e,t,i.x,i.y,c.x,c.y,l,null,null),o.F.greatEllipticDistance(e,t,h.x,h.y,c.x,c.y,_,null,null);let f=Math.min(u.val,l.val)+_.val,d=f+n;if(d<r)return!0;const g=(0,m.b)(a,new o.E,!1);f=Math.max(u.val,l.val);for(let n=1;n<s.length-1;n++){const r=s[n];o.F.greatEllipticDistance(e,t,i.x,i.y,r.x,r.y,g,null,null),g.val>f&&(f=g.val)}return d=f+n,d<r}catch(e){a.error=e,a.hasError=!0}finally{(0,m.c)(a)}}function w(e,t,s,n,i,r,m,a){let h;if(n.length%2==0){const e=n.length>>1,t=n[e],s=n[e-1];h=u.P.lerp(t,s,.5)}else h=n[n.length-1>>1].clone();const c=h.clone(),l=(0,o.I)(e,t,c,75/180*Math.PI);return!!y(e,t,n,i,c,l)&&(null!==r&&(r.setCoordsPoint2D(h),r.scale(1/s)),null!==m&&m.setCoordsPoint2D(c),null!==a&&(a[0]=l),!0)}function C(e,t,s,n,i,r){const a={stack:[],error:void 0,hasError:!1};try{if(n>=r)return!1;const h=(0,m.b)(a,new o.E,!1);return o.F.greatEllipticDistance(e,t,i.x,i.y,s.x,s.y,h,null,null),h.val+n<r}catch(e){a.error=e,a.hasError=!0}finally{(0,m.c)(a)}}function v(e,t){return new o.H(e,t)}function S(e){return(0,h.f)(e,0)||(0,h.s)(e,0),e}class D{constructor(e){this.m_bRunningInGnomonic=!1,this.m_bNeedsSimplify=!1,this.m_gnomonic=null,this.m_gnomonicCenterRad=new u.P,this.m_minGnomonicRadius=Number.NaN,this.m_progressTracker=e}isRunningInGnomonic(){return this.m_bRunningInGnomonic}needsSimplify(){return this.m_bNeedsSimplify}getGnomonic(){return this.m_gnomonic}}class I extends D{constructor(e,t,s){super(e.m_progressTracker),this.m_segIter=null,this.m_bNextSegmentCannotJoin=!1,this.m_currentDensifiedDelta=[0],this.m_currentBufferedDelta=0,this.m_lastAzimuth=0,this.m_startAzimuth=[0],this.m_endAzimuth=[0],this.m_numWinds=0,this.m_debugCounter=0,this.m_bufferHelper=new a.a,this.m_densifiedPoints=[],this.m_bufferer=e,this.m_multiPath=t,this.m_densified=s,this.m_bNeedsSimplify=!0;const n=new r.Envelope2D;this.m_multiPath.queryEnvelope(n);const i=n.getCenter(),m=i.clone();m.scale(this.m_bufferer.m_rpu),this.m_gnomonic=v(this.m_bufferer.m_gcs,i),this.m_gnomonicCenterRad=m.clone(),this.m_minGnomonicRadius=(0,o.I)(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,m,75/180*Math.PI)}next(){let e;if(this.m_bNextSegmentCannotJoin)return this.m_bNextSegmentCannotJoin=!1,this.m_segIter.nextSegment(),e=this.m_bufferHelper.clone(),e;if(null===this.m_segIter){if(this.m_segIter=this.m_multiPath.getImpl().querySegmentIterator(),!this.m_segIter.nextPath())return null;null!==this.m_densified&&this.m_densified.addPathPoint2D(null,0,!0)}if(!this.m_segIter.hasNextSegment()){if(!this.m_segIter.nextPath())return null;null!=this.m_densified&&this.m_densified.addPathPoint2D(null,0,!0)}let t=null;this.m_currentBufferedDelta=0,this.m_currentDensifiedDelta=[0],this.m_numWinds=0,this.m_lastAzimuth=Number.NaN,this.m_bNextSegmentCannotJoin=!1,this.m_densifiedPoints.length=0;let s=0;const n=new u.P,i=new u.P;for(;this.m_segIter.hasNextSegment()&&this.m_numWinds<16;){const e=this.m_segIter.nextSegment();if(n.setCoordsPoint2D(e.getStartXY()),i.setCoordsPoint2D(e.getEndXY()),n.scale(this.m_bufferer.m_rpu),i.scale(this.m_bufferer.m_rpu),(0,o.J)(n,i))n.x=i.x;else if((0,o.K)(n,i))i.x=n.x;else{let e=-1,t=-1;const s=this.m_segIter.getPathIndex(),r=this.m_multiPath.getPathStart(s),m=this.m_multiPath.getPathEnd(s);if(e=this.m_segIter.getStartPointIndex()-1,t=this.m_segIter.getEndPointIndex()+1,e<r&&(e=this.m_multiPath.isClosedPath(s)?m-1:-1),t>m-1&&(t=this.m_multiPath.isClosedPath(s)?r:-1),-1!==e){const t=this.m_multiPath.getXY(e);t.scale(this.m_bufferer.m_rpu),(0,o.K)(t,n)&&(n.x=t.x)}if(-1!==t){const e=this.m_multiPath.getXY(t);e.scale(this.m_bufferer.m_rpu),(0,o.J)(i,e)&&(i.x=e.x)}}this.m_densifiedPoints.length=0;const r=(0,o.M)(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_curveType,n,i,this.m_bufferer.m_segmentStep,Number.NaN,this.m_bufferer.m_radTolerance,this.m_startAzimuth,this.m_endAzimuth,this.m_densifiedPoints,this.m_currentDensifiedDelta);if(0===s)this.m_bRunningInGnomonic=this.isSegmentBufferInCurrentGnomonic(this.m_densifiedPoints),this.m_bRunningInGnomonic||(this.m_bRunningInGnomonic=this.tryUpdateGnomonic(this.m_densifiedPoints));else if(this.m_bRunningInGnomonic){if(!this.isSegmentBufferInCurrentGnomonic(this.m_densifiedPoints)){this.m_segIter.previousSegment(),this.m_segIter.previousSegment(),this.m_segIter.nextSegment();break}}else if(w(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_rpu,this.m_densifiedPoints,this.m_bufferer.m_absDistance*this.m_bufferer.m_ellipticToGeodesicMaxRatio,null,null,null)){this.m_segIter.previousSegment(),this.m_segIter.previousSegment(),this.m_segIter.nextSegment();break}if(0===r||(0,o.N)(n,i)?(this.m_bufferHelper.setEmpty(),this.m_bufferer.bufferPoint2D(n,this.m_bRunningInGnomonic,this.m_bufferHelper),this.m_bNextSegmentCannotJoin=!0):(this.m_bufferHelper.setEmpty(),this.m_bNextSegmentCannotJoin=this.checkAndPrepSegmentForCrossingAzimuthsOrPoleWrap(r,this.m_bufferHelper)),this.m_bNextSegmentCannotJoin){this.m_segIter.previousSegment(),this.m_segIter.hasPreviousSegment()?(this.m_segIter.previousSegment(),this.m_segIter.nextSegment()):this.m_segIter.resetToFirstSegment(),null!=this.m_densified&&this.m_densified.insertPointsFromPoints(this.m_densified.getPathCount()-1,-1,this.m_densifiedPoints,0,this.m_densifiedPoints.length-1,!0);break}null!=this.m_densified&&this.m_densified.insertPointsFromPoints(this.m_densified.getPathCount()-1,-1,this.m_densifiedPoints,0,this.m_densifiedPoints.length-1,!0),null===t&&(t=new a.a,t.addPathPoint2D(null,0,!0)),this.addJoinAndBufferLeftSide(t),s++}if(this.m_currentDensifiedDelta=[0],s>0){const e=this.m_segIter.getStartPointIndex(),r=this.m_segIter.getPathIndex();for(;s>0;){if(this.m_segIter.previousSegment(),n.setCoordsPoint2D(this.m_multiPath.getXY(this.m_segIter.getStartPointIndex())),i.setCoordsPoint2D(this.m_multiPath.getXY(this.m_segIter.getEndPointIndex())),n.scale(this.m_bufferer.m_rpu),i.scale(this.m_bufferer.m_rpu),this.m_bRunningInGnomonic)if((0,o.J)(n,i))n.x=i.x;else if((0,o.K)(n,i))i.x=n.x;else{let e=-1,t=-1;const s=this.m_segIter.getPathIndex(),r=this.m_multiPath.getPathStart(s),m=this.m_multiPath.getPathEnd(s);if(e=this.m_segIter.getStartPointIndex()-1,t=this.m_segIter.getEndPointIndex()+1,e<r&&(e=this.m_multiPath.isClosedPath(s)?m-1:-1),t>m-1&&(t=this.m_multiPath.isClosedPath(s)?r:-1),-1!==e){const t=this.m_multiPath.getXY(e);t.scale(this.m_bufferer.m_rpu),(0,o.K)(t,n)&&(n.x=t.x)}if(-1!==t){const e=this.m_multiPath.getXY(t);e.scale(this.m_bufferer.m_rpu),(0,o.J)(i,e)&&(i.x=e.x)}}this.m_densifiedPoints.length=0,(0,o.M)(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_curveType,i,n,this.m_bufferer.m_segmentStep,Number.NaN,this.m_bufferer.m_radTolerance,this.m_startAzimuth,this.m_endAzimuth,this.m_densifiedPoints,this.m_currentDensifiedDelta),this.addJoinAndBufferLeftSide(t),s--}return n.setCoordsPoint2D(this.m_multiPath.getXY(this.m_segIter.getStartPointIndex())),n.scale(this.m_bufferer.m_rpu),this.m_currentBufferedDelta=p(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_rpu,this.m_bufferer.m_absDistance,n,this.m_lastAzimuth+.5*Math.PI,this.m_lastAzimuth+1.5*Math.PI,this.m_bufferer.m_cornerStep,this.m_bRunningInGnomonic,this.m_currentBufferedDelta,t),this.m_segIter.resetToVertex(e,r),this.m_segIter.nextSegment(),t}return this.m_bNextSegmentCannotJoin=!1,this.m_segIter.nextSegment(),e=this.m_bufferHelper.clone(),e}isSegmentBufferInCurrentGnomonic(e){return null!==this.m_gnomonic&&y(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,e,this.m_bufferer.m_absDistance*this.m_bufferer.m_ellipticToGeodesicMaxRatio,this.m_gnomonicCenterRad,this.m_minGnomonicRadius)}tryUpdateGnomonic(e){const t=new u.P,s=new u.P,n=[0];return w(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_rpu,e,this.m_bufferer.m_absDistance*this.m_bufferer.m_ellipticToGeodesicMaxRatio,t,s,n)?(this.m_gnomonicCenterRad.setCoordsPoint2D(s),this.m_minGnomonicRadius=n[0],this.m_gnomonic=v(this.m_bufferer.m_gcs,t),!0):(this.m_gnomonic=null,!1)}checkAndPrepSegmentForCrossingAzimuthsOrPoleWrap(e,t){return this.m_bufferer.checkAndPrepSegmentForCrossingAzimuthsOrPoleWrap(this.m_densifiedPoints,e,this.m_startAzimuth[0],this.m_endAzimuth[0],this.m_bRunningInGnomonic,t)}addJoinAndBufferLeftSide(e){const t=this.m_densifiedPoints[0];let s=Number.NaN,n=this.m_startAzimuth[0]-u.l;const i=this.m_endAzimuth[0]+u.l;let r=!1;if(!Number.isNaN(this.m_lastAzimuth)){this.m_lastAzimuth>=this.m_startAzimuth[0]?(s=this.m_lastAzimuth+u.l,n=s+Math.PI-(this.m_lastAzimuth-this.m_startAzimuth[0])):(s=this.m_lastAzimuth+u.l,n=s+Math.PI-(u.k-(this.m_startAzimuth[0]-this.m_lastAzimuth))),r=!(this.m_lastAzimuth>=this.m_startAzimuth[0]&&this.m_lastAzimuth-this.m_startAzimuth[0]<=Math.PI||this.m_lastAzimuth<this.m_startAzimuth[0]&&this.m_startAzimuth[0]-this.m_lastAzimuth>=Math.PI);let i=!1;if(Math.abs(n-s)<=.5*this.m_bufferer.m_cornerStep&&(r||(i=!0)),i){if(e.removePointFromPath(0,e.getPointCount()-1),!this.m_bRunningInGnomonic){const t=new u.P;t.setCoordsPoint2D(e.getXY(e.getPointCount()-1)),t.scale(this.m_bufferer.m_rpu),t.x-this.m_currentBufferedDelta<-Math.PI?this.m_currentBufferedDelta-=u.k:t.x-this.m_currentBufferedDelta>Math.PI&&(this.m_currentBufferedDelta+=u.k)}n=.5*(n+s)}else if(r){const s=new u.P;s.setCoordsPoint2D(t),s.scale(1/this.m_bufferer.m_rpu),e.insertPoint2D(0,-1,s)}else p(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_rpu,this.m_bufferer.m_absDistance,this.m_densifiedPoints[0],s,n,this.m_bufferer.m_cornerStep,this.m_bRunningInGnomonic,this.m_currentBufferedDelta,e)}this.m_startAzimuth[0]!==this.m_lastAzimuth&&this.m_numWinds++,P(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_rpu,this.m_bufferer.m_absDistance,this.m_bufferer.m_curveType,this.m_densifiedPoints,n,i,this.m_bRunningInGnomonic,this.m_currentBufferedDelta,e),this.m_lastAzimuth=this.m_endAzimuth[0]}}class E extends D{constructor(e,t){super(e.m_progressTracker),this.m_pointIndex=-1,this.m_bufferer=e,this.m_multiPoint=t,this.m_bNeedsSimplify=!1;const s=new r.Envelope2D;this.m_multiPoint.queryEnvelope(s);const n=s.getCenter(),i=n.clone();i.scale(this.m_bufferer.m_rpu),this.m_gnomonic=v(this.m_bufferer.m_gcs,n),this.m_gnomonicCenterRad=i.clone(),this.m_minGnomonicRadius=(0,o.I)(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,i,75/180*Math.PI)}next(){if(this.m_bNeedsSimplify=!1,++this.m_pointIndex===this.m_multiPoint.getPointCount())return null;const e=this.m_multiPoint.getXY(this.m_pointIndex);e.scale(this.m_bufferer.m_rpu),this.m_bRunningInGnomonic=this.isPointBufferInCurrentGnomonic(e),this.m_bRunningInGnomonic||(this.m_bRunningInGnomonic=this.tryUpdateGnomonic(e));const t=new a.a,s=this.m_bufferer.bufferPoint2D(e,this.m_bRunningInGnomonic,t);return this.m_bNeedsSimplify=s,t}isPointBufferInCurrentGnomonic(e){return null!==this.m_gnomonic&&C(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,e,this.m_bufferer.m_absDistance*this.m_bufferer.m_ellipticToGeodesicMaxRatio,this.m_gnomonicCenterRad,this.m_minGnomonicRadius)}tryUpdateGnomonic(e){const t=new u.P,s=new u.P,n=[0];return function(e,t,s,n,i,r,m,a){const h=(0,o.I)(e,t,n,75/180*Math.PI);return!!C(e,t,n,i,n,h)&&(null!==r&&(r.setCoordsPoint2D(n),r.scale(1/s)),null!==m&&m.setCoordsPoint2D(n),null!==a&&(a[0]=h),!0)}(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_rpu,e,this.m_bufferer.m_absDistance*this.m_bufferer.m_ellipticToGeodesicMaxRatio,t,s,n)?(this.m_gnomonicCenterRad.setCoordsPoint2D(s),this.m_minGnomonicRadius=n[0],this.m_gnomonic=v(this.m_bufferer.m_gcs,t),!0):(this.m_gnomonic=null,!1)}}class G{getOperatorType(){return 10110}supportsCurves(){return!0}accelerateGeometry(e,t,s){return!1}canAccelerateGeometry(e){return!1}executeMany(e,t,s,n,i,r,m,a){if(m){const m=new k(e,t,s,n,i,!1,r,a);return(new o.h).executeMany(m,t,a)}return new k(e,t,s,n,i,!1,r,a)}execute(e,t,s,r,o,m,a){const h=new n.S([e]),c=[r],u=this.executeMany(h,t,s,c,o,!1,m,a).next();return u||(0,i.c)("geodesic buffer null output"),u}}class k extends n.G{constructor(e,t,s,n,o,m,a,h){super(),this.m_currentUnionEnvelope2D=new r.Envelope2D,this.m_index=-1,this.m_dindex=-1,this.m_progressTracker=h,m&&(0,i.b)(""),t||(0,i.t)(""),0===t.getCoordinateSystemType()&&(0,i.t)(""),this.m_inputGeoms=e,this.m_spatialReference=t,this.m_curveType=s,this.m_distances=n,this.m_convergenceOffset=o,this.m_bOutlineOnly=m,this.m_bUnion=a}next(){let e;for(;e=this.m_inputGeoms.next();)return(0,i.d)(e),this.m_index=this.m_inputGeoms.getGeometryID(),this.m_dindex+1<this.m_distances.length&&this.m_dindex++,this.geodesicBuffer(e,this.m_distances[this.m_dindex]);return null}getGeometryID(){return this.m_index}tock(){return!0}getRank(){return 1}geodesicBuffer(e,t){return function(e,t,s,n,r,o){n<Number.MAX_VALUE&&n>-Number.MAX_VALUE||(0,i.t)("Geodesic_bufferer.buffer - bad distance"),(0,i.d)(e);const m=(0,_.c)(e),a=m.getGeometryType();if((0,i.i)(a)){const e=m.getPointCount(),h=8e6;if(Math.abs(n)>h&&(e>50||a!==i.G.enumMultiPoint&&4===s&&e>2)){let e=m;const i=n>0?1:-1,a=7e6;let c=n,u=1;do{u++,c=(Math.abs(c)-a)*i}while(Math.abs(c)>h);c=n;for(let n=0;n<u-1;n++)e=g(e,t,s,a*i,r,u,o),c=(Math.abs(c)-a)*i;return e=g(e,t,s,c,r,u,o),e}}return g(m,t,s,n,r,1,o)}(e,this.m_spatialReference,this.m_curveType,t,this.m_convergenceOffset,this.m_progressTracker)}}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7444],{1364:(e,t,s)=>{s.d(t,{c:()=>i});var n=s(55537);function i(e,t){const s=e.getGeometryType();return s===n.G.enumPoint?e:(0,n.h)(s)?function(e){if(function(e){for(let t=0,s=e.getPathCount();t<s;t++){const s=e.getPathSize(t);if(0===s)return!1;if(1===s){if(0===e.getSegmentCountPath(t))return!1;if(e.getSegmentType(e.getPathStart(t))===n.G.enumLine)return!1;if(!e.isClosedPath(t))return!1}}return!0}(e))return e;const t=e.createInstance();for(let s=0,i=e.getPathCount();s<i;s++){const i=e.getPathSize(s);if(0!==i){if(1===i){if(0===e.getSegmentCountPath(s))continue;if(e.getSegmentType(e.getPathStart(s))===n.G.enumLine)continue;if(!e.isClosedPath(s))continue}t.addPath(e,s,!0)}}return t}(e):s===n.G.enumMultiPoint||s===n.G.enumEnvelope?e:s===n.G.enumMultipatch?((0,n.b)("not implemented for multipatch"),e):e}},37444:(e,t,s)=>{s.r(t),s.d(t,{OperatorGeodesicBuffer:()=>M});var n=s(76061),i=s(55537),r=s(79187),o=s(12189),m=s(90237),a=s(35368),h=s(95213),c=s(11878),u=s(83661),l=s(31139),_=s(1364),f=s(5247);class d{constructor(e){this.m_sr=null,this.m_gcs=null,this.m_transform=null,this.m_a=0,this.m_eSquared=0,this.m_rpu=0,this.m_radTolerance=0,this.m_q90=0,this.m_gcs90=0,this.m_gcs180=0,this.m_gcs360=0,this.m_gcs60=0,this.m_ellipticToGeodesicMaxRatio=0,this.m_curveType=0,this.m_bShapePreserving=!1,this.m_distance=0,this.m_absDistance=0,this.m_convergenceOffset=0,this.m_cornerStep=0,this.m_segmentStep=0,this.m_progressTracker=e}bufferPolygon(e){const t=new a.a,s=new D(this,e,t);return this.processGnomonicBufferPiecesCursor(!0,s)}bufferPolyline(e){const t=new D(this,e,null);return this.processGnomonicBufferPiecesCursor(!0,t)}bufferMultiPoint(e){const t=new I(this,e);return this.processGnomonicBufferPiecesCursor(!1,t)}bufferPoint(e){const t=e.getXY();t.scale(this.m_rpu);let s=new a.a;if(this.bufferPoint2D(t,!1,s)){const e=(0,h.b)(null,s,!0);s=(0,o.p)(s,e,!0,!0,-1,this.m_progressTracker,0,!1)}return s=(new o.y).foldInto360RangeGeodetic(s,this.m_gcs,2),s}processGnomonicBufferPiecesCursor(e,t){const s=t;let n=s.getGnomonic();const i=(0,o.B)((0,o.D)());let m=new o.L,a=(new o.h).executeMany(m,i,this.m_progressTracker,2);const l=(0,u.d)(6,!1),_=(0,u.m)(r.Envelope2D,6);this.initializeGrid(l,_);const f=[null,null,null,null,null,null],d=[null,null,null,null,null,null],g=[null,null,null,null,null,null];let P,p,b;for(;null!==(P=s.next());){if(p=s.getGnomonic(),p!==n){if(null!==n){let t=a.next();if(m=null,a=null,null!=t){const s=(0,h.b)(i,t,!0),r=(0,h.d)(s);t=n.unproject(t,r,this.m_progressTracker),this.putInGridCursors(e,t,i,!0,l,_,f,d,g)}}null!==p&&(m=new o.L,a=(new o.h).executeMany(m,i,this.m_progressTracker,2)),n=p}if(s.isRunningInGnomonic()){if(p.project(P),s.needsSimplify()){const e=(0,h.b)(null,P,!0);P=(0,o.p)(P,e,!0,!0,-1,this.m_progressTracker,0,!1)}m.tick(v(P)),a.tock()}else this.putInGridCursors(e,P,i,!0,l,_,f,d,g)}let x=!1;for(let e=0;e<6;e++)if(null!=g[e]){x=!0;break}if(x){let t=!1;const r=[null,null,null,null,null,null];if(e){const n=s.m_densified;if(s.m_densified=null,null!==n){const s=new c.T;s.scale(1/this.m_rpu,1/this.m_rpu),n.applyTransformation(s),this.m_distance>0?this.putInGridCursors(e,n,i,!1,l,_,f,d,g):(this.processInGrid(e,n,!1,l,_,f,r),t=!0)}}const u=new o.L,P=(new o.h).executeMany(u,this.m_gcs,this.m_progressTracker,2);if(null!==a){let t=a.next();m=null,a=null;const s=(0,h.b)(i,t,!0),r=(0,h.d)(s);t=n.unproject(t,r,this.m_progressTracker),this.putInGridCursors(e,t,i,!0,l,_,f,d,g)}for(let e=0;e<6;e++)if(null!=g[e]){let s=g[e].next();g[e]=null,d[e]=null,t&&null!==r[e]&&(s=(new o.e).execute(r[e],s,i,this.m_progressTracker));const n=(0,h.b)(i,s,!0),m=(0,h.d)(n);s=f[e].unproject(s,m,this.m_progressTracker),s=(new o.g).execute(s,this.m_gcs,!0,this.m_progressTracker),u.tick(v(s)),P.tock()}b=P.next()}else{let t,r=!1;if(e){let e=s.m_densified;if(s.m_densified=null,null!==e){const s=new c.T;s.scale(1/this.m_rpu,1/this.m_rpu),e.applyTransformation(s),p.project(e);const n=(0,h.b)(null,e,!0);e=(0,o.p)(e,n,!1,!0,-1,this.m_progressTracker,0,!1),this.m_distance>0?(m.tick(v(e)),a.tock()):(t=e,r=!0)}}let u=a.next();m=null,a=null,r&&(u=(new o.e).execute(t,u,i,this.m_progressTracker));const l=(0,h.b)(i,u,!0),_=(0,h.d)(l);b=n.unproject(u,_,this.m_progressTracker),b=(new o.g).execute(b,this.m_gcs,!0,this.m_progressTracker)}return b=(new o.y).foldInto360RangeGeodetic(b,this.m_gcs,2),b}putInGridCursors(e,t,s,n,i,r,m,a,h){const c=[null,null,null,null,null,null];this.processInGrid(e,t,n,i,r,m,c);for(let e=0;e<6;e++)null!==c[e]&&(null===a[e]&&(a[e]=new o.L,h[e]=(new o.h).executeMany(a[e],s,this.m_progressTracker,2)),a[e].tick(v(c[e])),h[e].tock())}processInGrid(e,t,s,n,i,r,m){const a=.01,c=this.insertGeodeticPointsAlongGrid(t,i,a);for(let e=0;e<6;e++){if(n[e])continue;const _=i[e].clone();_.inflateCoords(a,a);const f=(0,h.e)(t,_),d=(0,h.a)(null,f,!1).total();let g=(0,l.c)(c,_,d,Number.NaN,this.m_progressTracker);if(null!==g&&!g.isEmpty()){if(g===c&&(g=g.clone()),null===r[e]){const t=new u.P;e<3?t.setCoords(0,1):t.setCoords(0,-1);const s=new u.P;s.setAdd(i[e].getCenter(),t),r[e]=S(this.m_gcs,s)}r[e].project(g);const t=(0,h.b)(null,g,!0);g=(0,o.p)(g,t,s,!0,-1,this.m_progressTracker,0,!1),m[e]=g}}}insertGeodeticPointsAlongGrid(e,t,s){const n=r.Envelope2D.construct(t[3].xmin,t[3].ymin,t[2].xmax,t[2].ymax),i=(0,o.E)(this.m_gcs,n,e,!0,this.m_progressTracker),m=new a.E,h=m.addGeometry(i);return(0,o.F)(m,h,this.m_gcs,0,2,!0,t[0].xmax+s),(0,o.F)(m,h,this.m_gcs,0,2,!0,t[1].xmax+s),(0,o.F)(m,h,this.m_gcs,0,2,!1,t[1].ymin+s),0!==s&&((0,o.F)(m,h,this.m_gcs,0,2,!0,t[0].xmax-s),(0,o.F)(m,h,this.m_gcs,0,2,!0,t[1].xmax-s),(0,o.F)(m,h,this.m_gcs,0,2,!1,t[1].ymin-s)),m.getGeometry(h)}initializeGrid(e,t){for(let t=0;t<6;t++)e[t]=!1;t[0].setCoords({xmin:-this.m_gcs180,ymin:0,xmax:-this.m_gcs60,ymax:this.m_gcs90}),t[1].setCoords({xmin:-this.m_gcs60,ymin:0,xmax:this.m_gcs60,ymax:this.m_gcs90}),t[2].setCoords({xmin:this.m_gcs60,ymin:0,xmax:this.m_gcs180,ymax:this.m_gcs90}),t[3].setCoords({xmin:-this.m_gcs180,ymin:-this.m_gcs90,xmax:-this.m_gcs60,ymax:0}),t[4].setCoords({xmin:-this.m_gcs60,ymin:-this.m_gcs90,xmax:this.m_gcs60,ymax:0}),t[5].setCoords({xmin:this.m_gcs60,ymin:-this.m_gcs90,xmax:this.m_gcs180,ymax:0})}checkAndPrepSegmentForCrossingAzimuthsOrPoleWrap(e,t,s,n,i,r){const m=e[0],a=e.at(-1),h=m.y<a.y?m.y:a.y,c=m.y>a.y?m.y:a.y,l=o.w.q(this.m_a,this.m_eSquared,h),_=o.w.q(this.m_a,this.m_eSquared,c);if(this.m_q90-(l+t+this.m_absDistance)>.001&&this.m_q90+(_-t-this.m_absDistance)>.001)return!1;const f=s-u.l,d=n+u.l,g=f-Math.PI,x=f+Math.PI,y=d+Math.PI,w=[Number.NaN],C=[Number.NaN],S=[Number.NaN],v=[Number.NaN];let G=!1;if(b(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,m,f,g,a,d,w,C),b(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,a,y,d,m,g,S,v),(d<w[0]&&w[0]<y||d<C[0]&&C[0]<y)&&(G=!0),G||(g<S[0]&&S[0]<f||g<v[0]&&v[0]<f)&&(G=!0),!G&&i)return!1;const D=[];for(let t=e.length-1;t>=0;t--)D.push(e[t]);r.setEmpty(),r.addPathPoint2D(null,0,!0);let I=0;I=P(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,this.m_curveType,e,f,d,i,I,r),I=p(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,a,d,y,this.m_cornerStep,i,I,r,w[0],C[0]),I=P(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,this.m_curveType,D,y,x,i,I,r),I=p(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,m,g,f,this.m_cornerStep,i,I,r,S[0],v[0]);let M=!1;return i||(M=this.checkAndPrepForPole(r)),G||M}bufferPoint2D(e,t,s){s.setEmpty(),s.addPathPoint2D(null,0,!0),p(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,e,-this.m_cornerStep,2*Math.PI,this.m_cornerStep,t,0,s);let n=!1;return t||(n=this.checkAndPrepForPole(s)),n}checkAndPrepForPole(e){const t=this.checkAndPrepForPoleTouch(e),s=this.checkAndPrepForPoleWrap(e);return t||s}checkAndPrepForPoleTouch(e){const t=new r.Envelope2D;return e.queryEnvelope(t),!(!(0,o.P)(t.ymax,this.m_gcs90)&&!(0,o.P)(t.ymin,-this.m_gcs90)||(this.prepPoleTouch(e),0))}checkAndPrepForPoleWrap(e){const t=e.getXY(0),s=e.getXY(e.getPointCount()-1);return Math.abs(t.x-s.x)>this.m_gcs180?(this.prepSinglePoleWrap(e),!0):this.checkAndPrepForDoublePoleWrap(e)}checkAndPrepForDoublePoleWrap(e){return e.calculateArea2D()<0&&(this.prepDoublePoleWrap(e),!0)}prepPoleTouch(e){const t=new a.a;t.insertPath2D(-1,null,0,0,!0);const s=e.getPathStart(0),n=e.getPathEnd(0),i=n-s;let r=-1;for(r=s;r<n;r++){const t=e.getXY(r),s=(0,o.P)(t.y,this.m_gcs90),n=(0,o.P)(t.y,-this.m_gcs90);if(!s&&!n)break}let m=r,h=!1,c=Number.NaN;do{const n=e.getXY(m),r=(0,o.P)(n.y,this.m_gcs90),a=(0,o.P)(n.y,-this.m_gcs90),l=s+(m+1-s)%i;if(r||a){let s=u.P.construct(c,n.y);t.insertPoint2D(0,-1,s);const i=e.getXY(l),r=(0,o.P)(i.y,this.m_gcs90),m=(0,o.P)(i.y,-this.m_gcs90);r||m||(s=u.P.construct(i.x,n.y),h?t.setXY(t.getPointCount()-1,s):t.insertPoint2D(0,-1,s)),h=!0}else t.insertPoint2D(0,-1,n),c=n.x,h=!1;m=l}while(m!==r);e.setEmpty(),e.add(t,!1)}prepSinglePoleWrap(e){const t=new a.a,s=new a.a,n=new c.T,i=e.getXY(e.getPathStart(0)),m=e.getXY(e.getPathEnd(0)-1),_=this.m_gcs360,f=this.m_gcs180,d=new r.Envelope2D;d.setCoords({xmin:-this.m_gcs180,ymin:-this.m_gcs90,xmax:this.m_gcs180,ymax:this.m_gcs90});const g=new r.Envelope2D;e.queryEnvelope(g);const P=Math.ceil(g.width()/_);let p,b;i.x>m.x?(p=-_,b=this.m_gcs90):(p=_,b=-this.m_gcs90),n.setShiftCoords(p,0),t.addPath(e,0,!0),s.add(t,!1);const x=new h.P;for(let e=0;e<P;e++)s.applyTransformation(n),s.getPointByVal(0,x),t.lineToPoint(x),t.addSegmentsFromPath(s,0,0,s.getSegmentCount()-1,!1);const y=t.getXY(0),w=t.getXY(t.getPointCount()-1);y.y=b,w.y=b,t.lineTo(w);const C=new u.P;for(C.setCoordsPoint2D(w),C.x-=.5*p;Math.abs(C.x-y.x)>f;)t.lineTo(C),C.x-=.5*p;t.lineTo(y);const S=d.getCenterX(),v=new r.Envelope2D;t.queryEnvelope(v);let G=0;const D=v.getCenter().x;D-S>f?G=-Math.ceil((D-S-f)/_):S-D>f&&(G=Math.ceil((S-D-f)/_)),0!==G&&(n.setShiftCoords(G*_,0),t.applyTransformation(n));const I=new a.E,M=I.addGeometry(t);(0,o.F)(I,M,this.m_gcs,0,2,!0,d.xmin),(0,o.F)(I,M,this.m_gcs,0,2,!0,d.xmax);const k=I.getGeometry(M),T=(0,h.e)(k,d);T.inflateCoords(0,1);const N=(0,h.a)(null,T,!0).total(),E=(0,l.c)(k,d,N,Number.NaN,this.m_progressTracker);e.setEmpty(),e.add(E,!1)}prepDoublePoleWrap(e){const t=this.m_gcs360,s=this.m_gcs180,n=new r.Envelope2D;n.setCoords({xmin:-this.m_gcs180,ymin:-this.m_gcs90,xmax:this.m_gcs180,ymax:this.m_gcs90});const i=n.getCenter().x,m=new r.Envelope2D;e.queryPathEnvelope(0,m);let _,f=0,d=m.getCenter().x;if(d-i>s?f=-Math.ceil((d-i-s)/t):i-d>s&&(f=Math.ceil((i-d-s)/t)),0!==f){const s=new c.T;s.setShiftCoords(f*t,0),e.getImpl().applyTransformationToPath(s,0),e.queryPathEnvelope(0,m),d=m.getCenter().x}const g=new r.Envelope2D;n.containsExclusiveEnvelope(m)?(_=!1,g.setCoords({env2D:n})):(_=!0,g.setCoords({env2D:n}),g.xmin-=t,g.xmax+=t);let P=e.createInstance();P.addPathPoint2D(null,0,!0);const p=new u.P;if(p.setCoords(g.xmin,g.ymin),P.insertPoint2D(0,-1,p),p.setCoords(g.xmin,g.ymax),P.insertPoint2D(0,-1,p),p.setCoords(.5*(g.xmin+g.xmax),g.ymax),P.insertPoint2D(0,-1,p),p.setCoords(g.xmax,g.ymax),P.insertPoint2D(0,-1,p),p.setCoords(g.xmax,g.ymin),P.insertPoint2D(0,-1,p),p.setCoords(.5*(g.xmin+g.xmax),g.ymin),P.insertPoint2D(0,-1,p),_){P.addPath(e,0,!0);const s=new c.T;d<i?s.setShiftCoords(t,0):s.setShiftCoords(-t,0),e.getImpl().applyTransformationToPath(s,0),P.addPath(e,0,!0);const r=new a.E,m=r.addGeometry(P);(0,o.F)(r,m,this.m_gcs,0,2,!0,n.xmin),(0,o.F)(r,m,this.m_gcs,0,2,!0,n.xmax),P=r.getGeometry(m);const u=(0,h.e)(P,n);u.inflateCoords(0,1);const _=(0,h.a)(null,u,!0).total();P=(0,l.c)(P,n,_,Number.NaN,this.m_progressTracker)}else P.addPath(e,0,!0);e.setEmpty(),e.add(P,!1)}setMinCornerStep(){const e={stack:[],error:void 0,hasError:!1};try{let t=Math.min(Math.PI*this.m_a-this.m_absDistance,this.m_absDistance);t=Math.min(t,.125*this.m_a*Math.PI);const s=new u.P;s.setCoords(0,10*this.m_rpu);const n=0;let i=45*this.m_rpu;const r=(0,m.b)(e,new u.S(new o.G,new o.G),!1),a=(0,m.b)(e,new u.S(new o.G,new o.G),!1),h=(0,m.b)(e,new u.S(new o.G,new o.G),!1),c=(0,m.b)(e,new u.S(new o.G,new o.G),!1),l=new u.P,_=new u.P,f=new u.P,d=new u.P;for(o.H.geodesicCoordinate(this.m_a,this.m_eSquared,s.x,s.y,t,n,r.at(0),r.at(1)),l.setCoords(r.at(0).val,r.at(1).val),o.H.geodesicCoordinate(this.m_a,this.m_eSquared,s.x,s.y,t,i,a.at(0),a.at(1)),_.setCoords(a.at(0).val,a.at(1).val);;){const e={stack:[],error:void 0,hasError:!1};try{const r=.5*(n+i);o.H.geodesicCoordinate(this.m_a,this.m_eSquared,s.x,s.y,t,r,h.at(0),h.at(1)),f.setCoords(h.at(0).val,h.at(1).val);const u=(0,m.b)(e,new o.G,!1),g=(0,m.b)(e,new o.G,!1);o.H.geodeticDistance(this.m_a,this.m_eSquared,l.x,l.y,_.x,_.y,u,g,null,2),o.H.geodeticCoordinate(this.m_a,this.m_eSquared,l.x,l.y,.5*u.val,g.val,c.at(0),c.at(1),2),d.setCoords(c.at(0).val,c.at(1).val);const P=(0,m.b)(e,new o.G,!1);if(o.H.geodeticDistance(this.m_a,this.m_eSquared,f.x,f.y,d.x,d.y,P,null,null,2),P.val<=this.m_convergenceOffset)break;i*=.9,o.H.geodesicCoordinate(this.m_a,this.m_eSquared,s.x,s.y,t,i,a.at(0),a.at(1)),_.setCoords(a.at(0).val,a.at(1).val)}catch(t){e.error=t,e.hasError=!0}finally{(0,m.c)(e)}}const g=i-n,P=2*Math.PI/Math.ceil(2*Math.PI/g);this.m_cornerStep=P}catch(t){e.error=t,e.hasError=!0}finally{(0,m.c)(e)}}setMinSegmentStep(){const e={stack:[],error:void 0,hasError:!1};try{let t=Math.min(Math.PI*this.m_a-this.m_absDistance,this.m_absDistance);t=Math.min(t,.125*this.m_a*Math.PI);const s=new u.P,n=new u.P;s.setCoords(0,10*this.m_rpu),n.setCoords(10*this.m_rpu,10*this.m_rpu);const i=(0,m.b)(e,new o.G,!1),r=(0,m.b)(e,new o.G,!1),a=(0,m.b)(e,new o.G,!1);o.H.geodeticDistance(this.m_a,this.m_eSquared,s.x,s.y,n.x,n.y,a,i,r,this.m_curveType);const h=(0,m.b)(e,new u.S(new o.G,new o.G),!1),c=(0,m.b)(e,new u.S(new o.G,new o.G),!1),l=new u.P,_=(0,m.b)(e,new o.G,!1),f=(0,m.b)(e,new u.S(new o.G,new o.G),!1),d=(0,m.b)(e,new u.S(new o.G,new o.G),!1),g=(0,m.b)(e,new u.S(new o.G,new o.G),!1),P=(0,m.b)(e,new u.S(new o.G,new o.G),!1),p=new u.P,b=new u.P,x=new u.P,y=new u.P,w=0;let C=1;const S=i.val,v=r.val,G=S-.5*Math.PI,D=v+.5*Math.PI,I=a.val;for(o.H.geodesicCoordinate(this.m_a,this.m_eSquared,s.x,s.y,t,G,f.at(0),f.at(1)),p.setCoords(f.at(0).val,f.at(1).val),o.H.geodesicCoordinate(this.m_a,this.m_eSquared,n.x,n.y,t,D,d.at(0),d.at(1)),b.setCoords(d.at(0).val,d.at(1).val);;){const e={stack:[],error:void 0,hasError:!1};try{const i=.5*(w+C);o.H.geodeticCoordinate(this.m_a,this.m_eSquared,s.x,s.y,i*I,S,h.at(0),h.at(1),this.m_curveType),l.setCoords(h.at(0).val,h.at(1).val),o.H.geodeticDistance(this.m_a,this.m_eSquared,s.x,s.y,l.x,l.y,null,null,_,this.m_curveType);const r=_.val+.5*Math.PI;o.H.geodesicCoordinate(this.m_a,this.m_eSquared,l.x,l.y,t,r,g.at(0),g.at(1)),x.setCoords(g.at(0).val,g.at(1).val);const a=(0,m.b)(e,new o.G,!1),u=(0,m.b)(e,new o.G,!1);o.H.geodeticDistance(this.m_a,this.m_eSquared,p.x,p.y,b.x,b.y,a,u,null,2),o.H.geodeticCoordinate(this.m_a,this.m_eSquared,p.x,p.y,.5*a.val,u.val,P.at(0),P.at(1),2),y.setCoords(P.at(0).val,P.at(1).val);const f=(0,m.b)(e,new o.G,!1);if(o.H.geodeticDistance(this.m_a,this.m_eSquared,x.x,x.y,y.x,y.y,f,null,null,2),f.val<=this.m_convergenceOffset)break;{const e={stack:[],error:void 0,hasError:!1};try{C*=.9,o.H.geodeticCoordinate(this.m_a,this.m_eSquared,s.x,s.y,C*I,S,c.at(0),c.at(1),this.m_curveType),n.setCoords(c.at(0).val,c.at(1).val);const i=(0,m.b)(e,new o.G,!1);o.H.geodeticDistance(this.m_a,this.m_eSquared,s.x,s.y,n.x,n.y,null,null,i,this.m_curveType);const r=i.val+.5*Math.PI;o.H.geodesicCoordinate(this.m_a,this.m_eSquared,n.x,n.y,t,r,d.at(0),d.at(1)),b.setCoords(d.at(0).val,d.at(1).val)}catch(t){e.error=t,e.hasError=!0}finally{(0,m.c)(e)}}}catch(t){e.error=t,e.hasError=!0}finally{(0,m.c)(e)}}let M=C*I;M>1e5&&(M=1e5),this.m_segmentStep=M}catch(t){e.error=t,e.hasError=!0}finally{(0,m.c)(e)}}setConvergenceOffset(){let e;e=this.m_absDistance>5e4?100:this.m_absDistance>1e4?10:1,this.m_absDistance/e<500&&(e=this.m_absDistance/500),e<.01&&(e=.01),this.m_convergenceOffset=e}}function g(e,t,s,n,m,c,l){if(e.isEmpty())return new a.a({vd:e.getDescription()});let _=e;if((0,i.m)(_)){const e=10*t.getTolerance(0);_=(new f.O).execute(_,0,e,0,l,12e3)}const g=new d(l);g.m_sr=t,g.m_gcs=t.getGCS(),g.m_transform=(0,o.v)(t,g.m_gcs,null);const P=(0,o.I)();g.m_gcs.querySpheroidData(P);const p=new r.Envelope2D;_.queryEnvelope(p),g.m_a=P.majorSemiAxis,g.m_eSquared=P.e2,g.m_rpu=g.m_gcs.getUnit().getUnitToBaseFactor(),g.m_gcs90=.5*Math.PI/g.m_rpu,g.m_gcs180=Math.PI/g.m_rpu,g.m_gcs360=2*Math.PI/g.m_rpu,g.m_gcs60=g.m_gcs360/6,g.m_q90=o.w.q90(g.m_a,g.m_eSquared),g.m_ellipticToGeodesicMaxRatio=.5*g.m_a*Math.PI/g.m_q90;const b=g.m_gcs.getTolerance(0);g.m_radTolerance=b*g.m_rpu,4===s?(g.m_curveType=2,g.m_bShapePreserving=!0):(g.m_curveType=s,g.m_bShapePreserving=!1),g.m_distance=n,g.m_absDistance=Math.abs(n),Number.isNaN(m)||m<=0?g.setConvergenceOffset():g.m_convergenceOffset=Math.max(m,.001),g.m_convergenceOffset/=c;let x,y=_.getGeometryType();if((0,i.f)(y)){const e=new a.P({vd:_.getDescription()});e.addSegment(_,!0),x=e,y=i.G.enumPolyline}else if(y===i.G.enumEnvelope){const e=_,t=new r.Envelope2D;e.queryEnvelope(t);const s=(0,h.d)((0,h.a)(g.m_sr,p,!0));if(t.minDimension()<=s)if(0===t.maxDimension()){const t=new h.P({vd:_.getDescription()});e.getCenter(t),x=t,y=i.G.enumPoint}else{const t=new a.P({vd:_.getDescription()});t.addEnvelope(e,!1),x=t,y=i.G.enumPolyline}else{const t=new a.a({vd:_.getDescription()});t.addEnvelope(e,!1),x=t,y=i.G.enumPolygon}}else x=_;if(g.setMinCornerStep(),(0,i.e)(y)||g.setMinSegmentStep(),g.m_absDistance<=.5*g.m_convergenceOffset)return y!==i.G.enumPolygon?new a.a({vd:x.getDescription()}):g.m_bShapePreserving?x:(0,o.x)(x,g.m_sr,g.m_curveType,g.m_segmentStep,-1,l);if(g.m_distance<0&&y!==i.G.enumPolygon)return new a.a({vd:x.getDescription()});if(g.m_bShapePreserving&&(0,i.h)(y)){const e=(0,o.x)(x,t,4,Number.NaN,g.m_convergenceOffset,l);x=(new o.y).execute(e,g.m_transform,l)}else x=(new o.y).execute(x,g.m_transform,l);if(x=(0,o.z)(x,g.m_gcs),x.isEmpty())return new a.a({vd:x.getDescription()});!g.m_bShapePreserving&&(0,i.h)(y)&&(x=(0,o.A)(g.m_rpu,x)),x=function(e,t){const s=e.getGeometryType();let n;if(n=(0,i.h)(s)?e.getPathCount():s===i.G.enumMultiPoint?e.getPointCount():1,1===n)return e;const o=[],m=[];for(let a=0;a<n;a++){o.push(a);const n=new u.P;if((0,i.h)(s)){const t=new r.Envelope2D;e.queryPathEnvelope(a,t),n.assign(t.getCenter())}else n.assign(e.getXY(a));const h=t.toGeohash(n);m.push(h)}o.sort(((e,t)=>m[e]<m[t]?-1:m[e]>m[t]?1:0));const a=e.createInstance();for(let t=0;t<n;t++){const n=o[t];(0,i.h)(s)?a.addPath(e,n,!0):a.addPoints(e,n,n+1)}return a}(x,g.m_gcs);let w=new a.a;switch(y){case i.G.enumPolygon:w=g.bufferPolygon(x);break;case i.G.enumPolyline:w=g.bufferPolyline(x);break;case i.G.enumMultiPoint:w=g.bufferMultiPoint(x);break;case i.G.enumPoint:w=g.bufferPoint(x);break;default:(0,i.n)("")}const C=(new o.y).execute(w,g.m_transform.getInverse(),l);return C.mergeVertexDescription(x.getDescription()),C}function P(e,t,s,n,i,r,a,h,c,l,_){const f={stack:[],error:void 0,hasError:!1};try{const d=new u.P;d.setNAN(),c||_.getPointCount()>0&&(d.setCoordsPoint2D(_.getXY(_.getPointCount()-1)),d.scale(s));const g=(0,m.b)(f,new o.G,!1),P=(0,m.b)(f,new u.S(new o.G,new o.G),!1),p=new u.P,b=new u.P,y=r.at(-1),w=1/s;for(let s=0;s<r.length;s++){const m=r[s];let u;0===s?u=a:s===r.length-1?u=h:(o.H.geodeticDistance(e,t,y.x,y.y,m.x,m.y,null,null,g,i),u=g.val-.5*Math.PI),o.H.geodesicCoordinate(e,t,m.x,m.y,n,u,P.at(0),P.at(1)),c?b.setCoords(P.at(0).val,P.at(1).val):(p.setCoords(P.at(0).val,P.at(1).val),l=x(m.x,p.x,d.x,l),b.setCoords(l+p.x,p.y),d.setCoordsPoint2D(b)),b.scale(w),_.insertPoint2D(0,-1,b)}return l}catch(e){f.error=e,f.hasError=!0}finally{(0,m.c)(f)}}function p(e,t,s,n,i,r,a,h,c,l,_,f=Number.NaN,d=Number.NaN){const g={stack:[],error:void 0,hasError:!1};try{if(a-r<h)return l;const P=(0,m.b)(g,new u.S(new o.G,new o.G),!1),p=new u.P,b=new u.P,y=new u.P;b.setNAN(),c||_.getPointCount()>0&&(b.setCoordsPoint2D(_.getXY(_.getPointCount()-1)),b.scale(s));let w=Math.ceil(r/h),C=w++*h;C===r&&(C=w++*h);let S=r;const v=1/s;for(;C<a+h&&(S<f&&f<C?(C=f,w--):S<d&&d<C&&(C=d,w--),!(C>=a));)o.H.geodesicCoordinate(e,t,i.x,i.y,n,C,P.at(0),P.at(1)),c?y.setCoords(P.at(0).val,P.at(1).val):(p.setCoords(P.at(0).val,P.at(1).val),l=x(i.x,p.x,b.x,l),y.setCoords(l+p.x,p.y),b.setCoordsPoint2D(y)),y.scale(v),_.insertPoint2D(0,-1,y),S=C,C=w++*h;return l}catch(e){g.error=e,g.hasError=!0}finally{(0,m.c)(g)}}function b(e,t,s,n,i,r,a,h,c,l,_){const f={stack:[],error:void 0,hasError:!1};try{const s=new u.P,d=new u.P,g=(0,m.b)(f,new u.S(new o.G,new o.G),!1);o.H.geodesicCoordinate(e,t,i.x,i.y,n,r,g.at(0),g.at(1)),s.setCoords(g.at(0).val,g.at(1).val),o.H.geodesicCoordinate(e,t,i.x,i.y,n,a,g.at(0),g.at(1)),d.setCoords(g.at(0).val,g.at(1).val);const P=(0,m.b)(f,new o.G,!1);for(o.H.geodeticDistance(e,t,h.x,h.y,s.x,s.y,null,P,null,0),l[0]=P.val,o.H.geodeticDistance(e,t,h.x,h.y,d.x,d.y,null,P,null,0),_[0]=P.val;l[0]<=_[0];)l[0]+=u.k;for(;l[0]>_[0];)l[0]-=u.k;for(;l[0]>=c;)l[0]-=u.k,_[0]-=u.k;for(;l[0]<c;)l[0]+=u.k,_[0]+=u.k}catch(e){f.error=e,f.hasError=!0}finally{(0,m.c)(f)}}function x(e,t,s,n){if(Number.isNaN(s)){for(;n+t-e>Math.PI;)n-=u.k;for(;e-(n+t)>Math.PI;)n+=u.k;return n}return n+t-s>Math.PI?n-=u.k:s-(n+t)>Math.PI&&(n+=u.k),n}function y(e,t,s,n,i,r){const a={stack:[],error:void 0,hasError:!1};try{if(n>=r)return!1;const h=s[0],c=s.at(-1),u=(0,m.b)(a,new o.G,!1),l=(0,m.b)(a,new o.G,!1),_=(0,m.b)(a,new o.G,!1);o.H.greatEllipticDistance(e,t,i.x,i.y,h.x,h.y,u,null,null),o.H.greatEllipticDistance(e,t,i.x,i.y,c.x,c.y,l,null,null),o.H.greatEllipticDistance(e,t,h.x,h.y,c.x,c.y,_,null,null);let f=Math.min(u.val,l.val)+_.val,d=f+n;if(d<r)return!0;const g=(0,m.b)(a,new o.G,!1);f=Math.max(u.val,l.val);for(let n=1;n<s.length-1;n++){const r=s[n];o.H.greatEllipticDistance(e,t,i.x,i.y,r.x,r.y,g,null,null),g.val>f&&(f=g.val)}return d=f+n,d<r}catch(e){a.error=e,a.hasError=!0}finally{(0,m.c)(a)}}function w(e,t,s,n,i,r,m,a){let h;if(n.length%2==0){const e=n.length>>1,t=n[e],s=n[e-1];h=u.P.lerp(t,s,.5)}else h=n[n.length-1>>1].clone();const c=h.clone(),l=(0,o.K)(e,t,c,75/180*Math.PI);return!!y(e,t,n,i,c,l)&&(null!==r&&(r.setCoordsPoint2D(h),r.scale(1/s)),null!==m&&m.setCoordsPoint2D(c),null!==a&&(a[0]=l),!0)}function C(e,t,s,n,i,r){const a={stack:[],error:void 0,hasError:!1};try{if(n>=r)return!1;const h=(0,m.b)(a,new o.G,!1);return o.H.greatEllipticDistance(e,t,i.x,i.y,s.x,s.y,h,null,null),h.val+n<r}catch(e){a.error=e,a.hasError=!0}finally{(0,m.c)(a)}}function S(e,t){return new o.J(e,t)}function v(e){return(0,h.f)(e,0)||(0,h.s)(e,0),e}class G{constructor(e){this.m_bRunningInGnomonic=!1,this.m_bNeedsSimplify=!1,this.m_gnomonic=null,this.m_gnomonicCenterRad=new u.P,this.m_minGnomonicRadius=Number.NaN,this.m_progressTracker=e}isRunningInGnomonic(){return this.m_bRunningInGnomonic}needsSimplify(){return this.m_bNeedsSimplify}getGnomonic(){return this.m_gnomonic}}class D extends G{constructor(e,t,s){super(e.m_progressTracker),this.m_segIter=null,this.m_bNextSegmentCannotJoin=!1,this.m_currentDensifiedDelta=[0],this.m_currentBufferedDelta=0,this.m_lastAzimuth=0,this.m_startAzimuth=[0],this.m_endAzimuth=[0],this.m_numWinds=0,this.m_debugCounter=0,this.m_bufferHelper=new a.a,this.m_densifiedPoints=[],this.m_bufferer=e,this.m_multiPath=t,this.m_densified=s,this.m_bNeedsSimplify=!0;const n=new r.Envelope2D;this.m_multiPath.queryEnvelope(n);const i=n.getCenter(),m=i.clone();m.scale(this.m_bufferer.m_rpu),this.m_gnomonic=S(this.m_bufferer.m_gcs,i),this.m_gnomonicCenterRad=m.clone(),this.m_minGnomonicRadius=(0,o.K)(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,m,75/180*Math.PI)}next(){let e;if(this.m_bNextSegmentCannotJoin)return this.m_bNextSegmentCannotJoin=!1,this.m_segIter.nextSegment(),e=this.m_bufferHelper.clone(),e;if(null===this.m_segIter){if(this.m_segIter=this.m_multiPath.getImpl().querySegmentIterator(),!this.m_segIter.nextPath())return null;null!==this.m_densified&&this.m_densified.addPathPoint2D(null,0,!0)}if(!this.m_segIter.hasNextSegment()){if(!this.m_segIter.nextPath())return null;null!=this.m_densified&&this.m_densified.addPathPoint2D(null,0,!0)}let t=null;this.m_currentBufferedDelta=0,this.m_currentDensifiedDelta=[0],this.m_numWinds=0,this.m_lastAzimuth=Number.NaN,this.m_bNextSegmentCannotJoin=!1,this.m_densifiedPoints.length=0;let s=0;const n=new u.P,i=new u.P;for(;this.m_segIter.hasNextSegment()&&this.m_numWinds<16;){const e=this.m_segIter.nextSegment();if(n.setCoordsPoint2D(e.getStartXY()),i.setCoordsPoint2D(e.getEndXY()),n.scale(this.m_bufferer.m_rpu),i.scale(this.m_bufferer.m_rpu),(0,o.M)(n,i))n.x=i.x;else if((0,o.N)(n,i))i.x=n.x;else{let e=-1,t=-1;const s=this.m_segIter.getPathIndex(),r=this.m_multiPath.getPathStart(s),m=this.m_multiPath.getPathEnd(s);if(e=this.m_segIter.getStartPointIndex()-1,t=this.m_segIter.getEndPointIndex()+1,e<r&&(e=this.m_multiPath.isClosedPath(s)?m-1:-1),t>m-1&&(t=this.m_multiPath.isClosedPath(s)?r:-1),-1!==e){const t=this.m_multiPath.getXY(e);t.scale(this.m_bufferer.m_rpu),(0,o.N)(t,n)&&(n.x=t.x)}if(-1!==t){const e=this.m_multiPath.getXY(t);e.scale(this.m_bufferer.m_rpu),(0,o.M)(i,e)&&(i.x=e.x)}}this.m_densifiedPoints.length=0;const r=(0,o.Q)(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_curveType,n,i,this.m_bufferer.m_segmentStep,Number.NaN,this.m_bufferer.m_radTolerance,this.m_startAzimuth,this.m_endAzimuth,this.m_densifiedPoints,this.m_currentDensifiedDelta);if(0===s)this.m_bRunningInGnomonic=this.isSegmentBufferInCurrentGnomonic(this.m_densifiedPoints),this.m_bRunningInGnomonic||(this.m_bRunningInGnomonic=this.tryUpdateGnomonic(this.m_densifiedPoints));else if(this.m_bRunningInGnomonic){if(!this.isSegmentBufferInCurrentGnomonic(this.m_densifiedPoints)){this.m_segIter.previousSegment(),this.m_segIter.previousSegment(),this.m_segIter.nextSegment();break}}else if(w(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_rpu,this.m_densifiedPoints,this.m_bufferer.m_absDistance*this.m_bufferer.m_ellipticToGeodesicMaxRatio,null,null,null)){this.m_segIter.previousSegment(),this.m_segIter.previousSegment(),this.m_segIter.nextSegment();break}if(0===r||(0,o.R)(n,i)?(this.m_bufferHelper.setEmpty(),this.m_bufferer.bufferPoint2D(n,this.m_bRunningInGnomonic,this.m_bufferHelper),this.m_bNextSegmentCannotJoin=!0):(this.m_bufferHelper.setEmpty(),this.m_bNextSegmentCannotJoin=this.checkAndPrepSegmentForCrossingAzimuthsOrPoleWrap(r,this.m_bufferHelper)),this.m_bNextSegmentCannotJoin){this.m_segIter.previousSegment(),this.m_segIter.hasPreviousSegment()?(this.m_segIter.previousSegment(),this.m_segIter.nextSegment()):this.m_segIter.resetToFirstSegment(),null!=this.m_densified&&this.m_densified.insertPointsFromPoints(this.m_densified.getPathCount()-1,-1,this.m_densifiedPoints,0,this.m_densifiedPoints.length-1,!0);break}null!=this.m_densified&&this.m_densified.insertPointsFromPoints(this.m_densified.getPathCount()-1,-1,this.m_densifiedPoints,0,this.m_densifiedPoints.length-1,!0),null===t&&(t=new a.a,t.addPathPoint2D(null,0,!0)),this.addJoinAndBufferLeftSide(t),s++}if(this.m_currentDensifiedDelta=[0],s>0){const e=this.m_segIter.getStartPointIndex(),r=this.m_segIter.getPathIndex();for(;s>0;){if(this.m_segIter.previousSegment(),n.setCoordsPoint2D(this.m_multiPath.getXY(this.m_segIter.getStartPointIndex())),i.setCoordsPoint2D(this.m_multiPath.getXY(this.m_segIter.getEndPointIndex())),n.scale(this.m_bufferer.m_rpu),i.scale(this.m_bufferer.m_rpu),this.m_bRunningInGnomonic)if((0,o.M)(n,i))n.x=i.x;else if((0,o.N)(n,i))i.x=n.x;else{let e=-1,t=-1;const s=this.m_segIter.getPathIndex(),r=this.m_multiPath.getPathStart(s),m=this.m_multiPath.getPathEnd(s);if(e=this.m_segIter.getStartPointIndex()-1,t=this.m_segIter.getEndPointIndex()+1,e<r&&(e=this.m_multiPath.isClosedPath(s)?m-1:-1),t>m-1&&(t=this.m_multiPath.isClosedPath(s)?r:-1),-1!==e){const t=this.m_multiPath.getXY(e);t.scale(this.m_bufferer.m_rpu),(0,o.N)(t,n)&&(n.x=t.x)}if(-1!==t){const e=this.m_multiPath.getXY(t);e.scale(this.m_bufferer.m_rpu),(0,o.M)(i,e)&&(i.x=e.x)}}this.m_densifiedPoints.length=0,(0,o.Q)(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_curveType,i,n,this.m_bufferer.m_segmentStep,Number.NaN,this.m_bufferer.m_radTolerance,this.m_startAzimuth,this.m_endAzimuth,this.m_densifiedPoints,this.m_currentDensifiedDelta),this.addJoinAndBufferLeftSide(t),s--}return n.setCoordsPoint2D(this.m_multiPath.getXY(this.m_segIter.getStartPointIndex())),n.scale(this.m_bufferer.m_rpu),this.m_currentBufferedDelta=p(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_rpu,this.m_bufferer.m_absDistance,n,this.m_lastAzimuth+.5*Math.PI,this.m_lastAzimuth+1.5*Math.PI,this.m_bufferer.m_cornerStep,this.m_bRunningInGnomonic,this.m_currentBufferedDelta,t),this.m_segIter.resetToVertex(e,r),this.m_segIter.nextSegment(),t}return this.m_bNextSegmentCannotJoin=!1,this.m_segIter.nextSegment(),e=this.m_bufferHelper.clone(),e}isSegmentBufferInCurrentGnomonic(e){return null!==this.m_gnomonic&&y(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,e,this.m_bufferer.m_absDistance*this.m_bufferer.m_ellipticToGeodesicMaxRatio,this.m_gnomonicCenterRad,this.m_minGnomonicRadius)}tryUpdateGnomonic(e){const t=new u.P,s=new u.P,n=[0];return w(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_rpu,e,this.m_bufferer.m_absDistance*this.m_bufferer.m_ellipticToGeodesicMaxRatio,t,s,n)?(this.m_gnomonicCenterRad.setCoordsPoint2D(s),this.m_minGnomonicRadius=n[0],this.m_gnomonic=S(this.m_bufferer.m_gcs,t),!0):(this.m_gnomonic=null,!1)}checkAndPrepSegmentForCrossingAzimuthsOrPoleWrap(e,t){return this.m_bufferer.checkAndPrepSegmentForCrossingAzimuthsOrPoleWrap(this.m_densifiedPoints,e,this.m_startAzimuth[0],this.m_endAzimuth[0],this.m_bRunningInGnomonic,t)}addJoinAndBufferLeftSide(e){const t=this.m_densifiedPoints[0];let s=Number.NaN,n=this.m_startAzimuth[0]-u.l;const i=this.m_endAzimuth[0]+u.l;let r=!1;if(!Number.isNaN(this.m_lastAzimuth)){this.m_lastAzimuth>=this.m_startAzimuth[0]?(s=this.m_lastAzimuth+u.l,n=s+Math.PI-(this.m_lastAzimuth-this.m_startAzimuth[0])):(s=this.m_lastAzimuth+u.l,n=s+Math.PI-(u.k-(this.m_startAzimuth[0]-this.m_lastAzimuth))),r=!(this.m_lastAzimuth>=this.m_startAzimuth[0]&&this.m_lastAzimuth-this.m_startAzimuth[0]<=Math.PI||this.m_lastAzimuth<this.m_startAzimuth[0]&&this.m_startAzimuth[0]-this.m_lastAzimuth>=Math.PI);let i=!1;if(Math.abs(n-s)<=.5*this.m_bufferer.m_cornerStep&&(r||(i=!0)),i){if(e.removePointFromPath(0,e.getPointCount()-1),!this.m_bRunningInGnomonic){const t=new u.P;t.setCoordsPoint2D(e.getXY(e.getPointCount()-1)),t.scale(this.m_bufferer.m_rpu),t.x-this.m_currentBufferedDelta<-Math.PI?this.m_currentBufferedDelta-=u.k:t.x-this.m_currentBufferedDelta>Math.PI&&(this.m_currentBufferedDelta+=u.k)}n=.5*(n+s)}else if(r){const s=new u.P;s.setCoordsPoint2D(t),s.scale(1/this.m_bufferer.m_rpu),e.insertPoint2D(0,-1,s)}else p(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_rpu,this.m_bufferer.m_absDistance,this.m_densifiedPoints[0],s,n,this.m_bufferer.m_cornerStep,this.m_bRunningInGnomonic,this.m_currentBufferedDelta,e)}this.m_startAzimuth[0]!==this.m_lastAzimuth&&this.m_numWinds++,P(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_rpu,this.m_bufferer.m_absDistance,this.m_bufferer.m_curveType,this.m_densifiedPoints,n,i,this.m_bRunningInGnomonic,this.m_currentBufferedDelta,e),this.m_lastAzimuth=this.m_endAzimuth[0]}}class I extends G{constructor(e,t){super(e.m_progressTracker),this.m_pointIndex=-1,this.m_bufferer=e,this.m_multiPoint=t,this.m_bNeedsSimplify=!1;const s=new r.Envelope2D;this.m_multiPoint.queryEnvelope(s);const n=s.getCenter(),i=n.clone();i.scale(this.m_bufferer.m_rpu),this.m_gnomonic=S(this.m_bufferer.m_gcs,n),this.m_gnomonicCenterRad=i.clone(),this.m_minGnomonicRadius=(0,o.K)(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,i,75/180*Math.PI)}next(){if(this.m_bNeedsSimplify=!1,++this.m_pointIndex===this.m_multiPoint.getPointCount())return null;const e=this.m_multiPoint.getXY(this.m_pointIndex);e.scale(this.m_bufferer.m_rpu),this.m_bRunningInGnomonic=this.isPointBufferInCurrentGnomonic(e),this.m_bRunningInGnomonic||(this.m_bRunningInGnomonic=this.tryUpdateGnomonic(e));const t=new a.a,s=this.m_bufferer.bufferPoint2D(e,this.m_bRunningInGnomonic,t);return this.m_bNeedsSimplify=s,t}isPointBufferInCurrentGnomonic(e){return null!==this.m_gnomonic&&C(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,e,this.m_bufferer.m_absDistance*this.m_bufferer.m_ellipticToGeodesicMaxRatio,this.m_gnomonicCenterRad,this.m_minGnomonicRadius)}tryUpdateGnomonic(e){const t=new u.P,s=new u.P,n=[0];return function(e,t,s,n,i,r,m,a){const h=(0,o.K)(e,t,n,75/180*Math.PI);return!!C(e,t,n,i,n,h)&&(null!==r&&(r.setCoordsPoint2D(n),r.scale(1/s)),null!==m&&m.setCoordsPoint2D(n),null!==a&&(a[0]=h),!0)}(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_rpu,e,this.m_bufferer.m_absDistance*this.m_bufferer.m_ellipticToGeodesicMaxRatio,t,s,n)?(this.m_gnomonicCenterRad.setCoordsPoint2D(s),this.m_minGnomonicRadius=n[0],this.m_gnomonic=S(this.m_bufferer.m_gcs,t),!0):(this.m_gnomonic=null,!1)}}class M{getOperatorType(){return 10110}supportsCurves(){return!0}accelerateGeometry(e,t,s){return!1}canAccelerateGeometry(e){return!1}executeMany(e,t,s,n,i,r,m,a){if(m){const m=new k(e,t,s,n,i,!1,r,a);return(new o.h).executeMany(m,t,a)}return new k(e,t,s,n,i,!1,r,a)}execute(e,t,s,r,o,m,a){const h=new n.S([e]),c=[r],u=this.executeMany(h,t,s,c,o,!1,m,a).next();return u||(0,i.c)("geodesic buffer null output"),u}}class k extends n.G{constructor(e,t,s,n,o,m,a,h){super(),this.m_currentUnionEnvelope2D=new r.Envelope2D,this.m_index=-1,this.m_dindex=-1,this.m_progressTracker=h,m&&(0,i.b)(""),t||(0,i.t)(""),0===t.getCoordinateSystemType()&&(0,i.t)(""),this.m_inputGeoms=e,this.m_spatialReference=t,this.m_curveType=s,this.m_distances=n,this.m_convergenceOffset=o,this.m_bOutlineOnly=m,this.m_bUnion=a}next(){let e;for(;e=this.m_inputGeoms.next();)return(0,i.d)(e),this.m_index=this.m_inputGeoms.getGeometryID(),this.m_dindex+1<this.m_distances.length&&this.m_dindex++,this.geodesicBuffer(e,this.m_distances[this.m_dindex]);return null}getGeometryID(){return this.m_index}tock(){return!0}getRank(){return 1}geodesicBuffer(e,t){return function(e,t,s,n,r,o){n<Number.MAX_VALUE&&n>-Number.MAX_VALUE||(0,i.t)("Geodesic_bufferer.buffer - bad distance"),(0,i.d)(e);const m=(0,_.c)(e),a=m.getGeometryType();if((0,i.i)(a)){const e=m.getPointCount(),h=8e6;if(Math.abs(n)>h&&(e>50||a!==i.G.enumMultiPoint&&4===s&&e>2)){let e=m;const i=n>0?1:-1,a=7e6;let c=n,u=1;do{u++,c=(Math.abs(c)-a)*i}while(Math.abs(c)>h);c=n;for(let n=0;n<u-1;n++)e=g(e,t,s,a*i,r,u,o),c=(Math.abs(c)-a)*i;return e=g(e,t,s,c,r,u,o),e}}return g(m,t,s,n,r,1,o)}(e,this.m_spatialReference,this.m_curveType,t,this.m_convergenceOffset,this.m_progressTracker)}}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1364,6061],{1364:(e,t,s)=>{s.d(t,{c:()=>i});var n=s(55537);function i(e,t){const s=e.getGeometryType();return s===n.G.enumPoint?e:(0,n.h)(s)?function(e){if(function(e){for(let t=0,s=e.getPathCount();t<s;t++){const s=e.getPathSize(t);if(0===s)return!1;if(1===s){if(0===e.getSegmentCountPath(t))return!1;if(e.getSegmentType(e.getPathStart(t))===n.G.enumLine)return!1;if(!e.isClosedPath(t))return!1}}return!0}(e))return e;const t=e.createInstance();for(let s=0,i=e.getPathCount();s<i;s++){const i=e.getPathSize(s);if(0!==i){if(1===i){if(0===e.getSegmentCountPath(s))continue;if(e.getSegmentType(e.getPathStart(s))===n.G.enumLine)continue;if(!e.isClosedPath(s))continue}t.addPath(e,s,!0)}}return t}(e):s===n.G.enumMultiPoint||s===n.G.enumEnvelope?e:s===n.G.enumMultipatch?((0,n.b)("not implemented for multipatch"),e):e}},64523:(e,t,s)=>{s.d(t,{O:()=>l});var n=s(90237),i=s(76061),r=s(55537),m=s(35368),o=s(95213),h=s(83661),a=s(5247);class l{getOperatorType(){return 10204}supportsCurves(){return!0}accelerateGeometry(e,t,s){return!1}canAccelerateGeometry(e){return!1}executeMany(e,t,s,n){return new c(e,t,s,n)}execute(e,t,s,n){return e||(0,r.t)("null param is not allowed."),new c(null,t,s,n).generalize(e)}}class c extends i.G{constructor(e,t,s,n){super(),this.m_pline=null,this.m_point=new o.P,this.m_stack=[],this.m_resultstack=[],this.m_callCount=0,this.m_progressTracker=n,this.m_geoms=e,this.m_maxDeviation=t,this.m_bRemoveDegenerateParts=s}tock(){return!0}getRank(){return 1}next(){const e=this.m_geoms.next();return null===e?null:((0,r.d)(e),this.generalize(e))}getGeometryID(){return this.m_geoms.getGeometryID()}generalize(e){const t=e.getGeometryType();if((0,r.e)(t))return e;if(t===r.G.enumEnvelope){const t=new m.a({vd:e.getDescription()});return t.addEnvelope(e,!1),this.generalize(t)}if((0,r.f)(t)){const t=new m.P({vd:e.getDescription()});return t.addSegment(e,!0),this.generalize(t)}if((0,r.h)(t)||(0,r.b)(""),e.isEmpty()||this.m_maxDeviation<=0)return e;const s=(new a.O).execute(e,0,.05*this.m_maxDeviation,0,this.m_progressTracker);e.hasNonLinearSegments()&&(this.m_maxDeviation*=.95);const i=s,o=e.createInstance();o.getGeometryType()===r.G.enumPolygon&&o.setFillRule(e.getFillRule()),this.m_xy=i.getAttributeStreamRef(0);{const e={stack:[],error:void 0,hasError:!1};try{const t=new m.L;this.m_pline=t,(0,n.b)(e,(0,h.h)((()=>{this.m_pline=null}),!1),!1);for(let e=0,t=i.getPathCount();e<t;e++)this.generalizePath(i.getImpl(),e,o.getImpl())}catch(t){e.error=t,e.hasError=!0}finally{(0,n.c)(e)}}return this.m_resultstack.length=0,this.m_stack.length=0,o}generalizePath(e,t,s){if(e.getPathSize(t)<2)return;this.m_resultstack.length=0,this.m_stack.length=0;const n=e.getPathStart(t),i=e.getPathEnd(t)-1,r=e.isClosedPath(t),m=e.isClosedPathInXYPlane(t);let o=0,a=-1;this.m_stack.push(r?n:i),this.m_stack.push(n);let l=!1,c=!1;for(!this.m_bRemoveDegenerateParts&&m&&(l=!0,c=!0);this.m_stack.length>1;){const t=this.m_stack.at(-1);this.m_stack.pop();const s=this.m_stack.at(-1);let n=e.getXY(t);this.m_pline.setStartXY(n),n=e.getXY(s),this.m_pline.setEndXY(n);const r=[Number.NaN];let m=this.findGreatestDistance(t,s,i,r);m>=0&&(l?l=!1:(c&&r[0]>o&&(o=r[0],a=m),r[0]<=this.m_maxDeviation&&(m=-1))),m>=0?(this.m_stack.push(m),this.m_stack.push(t)):this.m_resultstack.push(t)}r||this.m_resultstack.push(this.m_stack[0]);const u=this.m_resultstack.length;if(u===e.getPathSize(t)&&u===this.m_stack.length)s.addPath(e,t,!0);else if(this.m_resultstack.length>0){if(this.m_bRemoveDegenerateParts&&this.m_resultstack.length<=2){if(r||1===this.m_resultstack.length)return;if(h.P.distance(e.getXY(this.m_resultstack[0]),e.getXY(this.m_resultstack[1]))<=this.m_maxDeviation)return}if(c&&a>=0&&o<=this.m_maxDeviation){const e=this.m_resultstack.at(-1)>a;this.m_resultstack.push(a),e&&(this.m_resultstack[this.m_resultstack.length-2]=(0,h.b)(this.m_resultstack[this.m_resultstack.length-1],this.m_resultstack[this.m_resultstack.length-1]=this.m_resultstack[this.m_resultstack.length-2]))}for(let t=0,n=this.m_resultstack.length;t<n;t++)e.getPointByVal(this.m_resultstack[t],this.m_point),0===t?s.startPathPoint(this.m_point):s.lineToPoint(this.m_point);if(r){for(let e=this.m_resultstack.length;e<3;e++)s.lineToPoint(this.m_point);s.closePathWithLine()}}}findGreatestDistance(e,t,s,n){let i=t-1;t<=e&&(i=s);let r=-1,m=0;const o=new h.P;for(let t=e+1;t<=i;t++){this.m_xy.queryPoint2D(2*t,o);const e=o.x,s=o.y,n=this.m_pline.getClosestCoordinate(o,!1);o.assign(this.m_pline.getCoord2D(n)),o.x-=e,o.y-=s;const i=o.length();i>m&&(r=t,m=i),this.m_callCount++}return n[0]=m,r}}},76061:(e,t,s)=>{s.d(t,{G:()=>n,S:()=>i});class n{*[Symbol.iterator](){let e=this.next();for(;e;)yield e,e=this.next()}}class i extends n{constructor(e){super(),this.m_iGeom=-1,this.m_aGeoms=e?e.slice():[]}next(){if(this.m_iGeom<this.m_aGeoms.length-1){const e=this.m_aGeoms[++this.m_iGeom];return this.m_aGeoms[this.m_iGeom]=null,e}return null}tock(){return!1}getGeometryID(){return this.m_iGeom}getRank(){return 1}}},91364:(e,t,s)=>{s.d(t,{g7:()=>M,yv:()=>G,fz:()=>R});var n=s(76061),i=s(55537),r=s(12189),m=s(79187),o=s(90237),h=s(95213),a=s(83661),l=s(35368),c=s(11878),u=s(1364);class _{getOperatorType(){return 10104}accelerateGeometry(e,t,s){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}isSimple(e,t,s,n,i){return 5===(0,r.n)(e,t,s,n,i)}executeMany(e,t,s,n){return new f(e,t,s,n)}execute(e,t,s,r){const m=new n.S([e]),o=this.executeMany(m,t,s,r).next();return o||(0,i.c)("null output"),o}}class f extends n.G{constructor(e,t,s,n){super(),e||(0,i.t)(""),this.m_progressTracker=n,this.m_bForceSimplify=s,this.m_index=-1,this.m_inputGeometryCursor=e,this.m_spatialReference=t}next(){const e=this.m_inputGeometryCursor.next();return e?((0,i.d)(e),this.m_index=this.m_inputGeometryCursor.getGeometryID(),this.simplify(e)):null}getGeometryID(){return this.m_index}tock(){return!1}getRank(){return 1}simplify(e){return e||(0,i.t)(""),(0,r.o)(e,this.m_spatialReference,this.m_bForceSimplify,this.m_progressTracker)}}var g,d,p=s(64523);function P(e,t,s,n,i,r){return{m_from:e.clone(),m_to:t.clone(),m_center:s.clone(),m_next:i,m_type:n}}function y(e,t,s,n,i){return{m_from:e.clone(),m_to:t.clone(),m_next:s,m_type:4,m_center:new a.P}}(d=g||(g={}))[d.enumDummy=256]="enumDummy",d[d.enumLine=1]="enumLine",d[d.enumArc=2]="enumArc",d[d.enumMiter=8]="enumMiter",d[d.enumBevel=16]="enumBevel",d[d.enumJoinMask=26]="enumJoinMask",d[d.enumConnectionMask=27]="enumConnectionMask";class b extends n.G{constructor(e,t,s,n,i,r,m,o,h,a){super(),this.m_index=0,this.m_bufferedPolygon=null,this.m_x=0,this.m_y=0,this.m_progressTracker=a,this.m_parent=e,this.m_mp=t,this.m_distance=s,this.m_spatialReference=n,this.m_densifyDist=o,this.m_maxVertexInCompleteCircle=h,this.m_joins=i,this.m_caps=r,this.m_miterLimit=m}next(){const e=new h.P;for(;;){if(this.m_index===this.m_mp.getPointCount())return null;if(1===this.m_caps)return this.m_index=this.m_mp.getPointCount(),new l.a({vd:this.m_mp.getDescription()});if(this.m_mp.getPointByVal(this.m_index,e),this.m_index++,!e.isEmpty())break}let t,s=!1;if(null===this.m_bufferedPolygon&&(this.m_x=e.getX(),this.m_y=e.getY(),this.m_bufferedPolygon=this.m_parent.buffer(e,this.m_distance,this.m_spatialReference,this.m_joins,this.m_caps,this.m_miterLimit,this.m_densifyDist,this.m_maxVertexInCompleteCircle),s=!0),t=this.m_index<this.m_mp.getPointCount()?this.m_bufferedPolygon.clone():this.m_bufferedPolygon,!s){const s=new c.T,n=e.getX()-this.m_x,i=e.getY()-this.m_y;s.setShiftCoords(n,i),t.applyTransformation(s)}return(0,h.s)(t,0),t}getGeometryID(){return 0}getRank(){return 1}tock(){return!0}}class x extends n.G{constructor(e){super(),this.m_currentPathIndex=0,this.m_polyline=e}next(){if(!this.m_polyline)return null;const e=this.m_polyline.getImpl(),t=e.getPathCount();if(this.m_currentPathIndex<t){const t=this.m_currentPathIndex;if(this.m_currentPathIndex++,!e.isClosedPathInXYPlane(t)){let s=e.getXY(e.getPathEnd(t)-1);for(;this.m_currentPathIndex<e.getPathCount();){const t=e.getXY(e.getPathStart(this.m_currentPathIndex));if(e.isClosedPathInXYPlane(this.m_currentPathIndex))break;if(!t.equals(s))break;s=e.getXY(e.getPathEnd(this.m_currentPathIndex)-1),this.m_currentPathIndex++}}if(0===t&&this.m_currentPathIndex===this.m_polyline.getPathCount()){const e=this.m_polyline;return this.m_polyline=null,e}const s=new l.P({vd:this.m_polyline.getDescription()});s.addPath(this.m_polyline,t,!0);for(let n=t+1;n<this.m_currentPathIndex;n++)s.addSegmentsFromPath(this.m_polyline,n,0,e.getSegmentCountPath(n),!1);return this.m_currentPathIndex===this.m_polyline.getPathCount()&&(this.m_polyline=null),s}return null}getGeometryID(){return 0}getRank(){return 1}tock(){return!0}}class C extends n.G{constructor(e,t,s){super(),this.m_geometry=null,this.m_index=0,this.m_bufferer=e,this.m_geoms=t,this.m_index=0,this.m_bFilter=s}next(){if(null===this.m_geometry&&(this.m_index=0,this.m_geometry=this.m_geoms.next(),!this.m_geometry))return null;const e=this.m_geometry.getImpl();if(this.m_index<e.getPathCount()){const e=this.m_index;return this.m_index++,this.m_bufferer.bufferPolylinePath(this.m_geometry,e,this.m_bFilter)}return this.m_geometry=null,this.next()}getGeometryID(){return 0}getRank(){return 1}tock(){return!0}}class D extends n.G{constructor(e){super(),this.m_index=0,this.m_bufferer=e}next(){const e=this.m_bufferer.m_geometry;if(this.m_index<e.getPathCount()){const t=this.m_index,s=e.calculateRingArea2D(this.m_index);for((0,i.g)(s>0),this.m_index++;this.m_index<e.getPathCount()&&!(e.calculateRingArea2D(this.m_index)>0);)this.m_index++;let n;return n=0===t&&this.m_index===e.getPathCount()?this.m_bufferer.bufferPolygonImpl(e,0,e.getPathCount()):this.m_bufferer.bufferPolygonImpl(e,t,this.m_index),n}return null}getGeometryID(){return 0}getRank(){return 1}tock(){return!0}}class w{constructor(e){this.m_geometry=null,this.m_bufferCommands=[],this.m_originalGeomType=i.G.enumUnknown,this.m_maxVertexInCompleteCircle=-1,this.m_circleTemplateSize=-1,this.m_oldCircleTemplateSize=0,this.m_spatialReference=null,this.m_tolerance=new h.C(0,0),this.m_smallTolerance=new h.C(0,0),this.m_filterTolerance=0,this.m_densifyDist=-1,this.m_distance=Number.NaN,this.m_absDistance=0,this.m_absDistanceReversed=0,this.m_dA=-1,this.m_miterLimit=4,this.m_joins=0,this.m_caps=0,this.m_bRoundBuffer=!0,this.m_bOutputLoops=!0,this.m_bFilter=!0,this.m_circleTemplate=[],this.m_leftStack=[],this.m_middleStack=[],this.m_helperLine1=new l.L,this.m_helperLine2=new l.L,this.m_helperArray=[],this.m_progressCounter=0,this.m_densificator=l.D.constructDefault(e),this.m_progressTracker=e}buffer(e,t,s,n,r,o,c,_){if(e||(0,i.t)("Geometry.Bufferer.Impl.Buffer"),c<0&&(0,i.t)("Geometry.Bufferer.Impl.Buffer"),(0,i.j)(e.getGeometryType())&&(0,i.b)("Unsupported geometry type."),e.isEmpty())return new l.a({vd:e.getDescription()});if(this.m_joins=n,this.m_caps=r,this.m_bRoundBuffer=!1,this.m_miterLimit=o,this.m_originalGeomType=e.getGeometryType(),(0,i.k)(this.m_originalGeomType)?this.m_bRoundBuffer=0===this.m_joins:(0,i.e)(this.m_originalGeomType)?this.m_bRoundBuffer=0===this.m_caps:(0,i.l)(this.m_originalGeomType)&&(this.m_bRoundBuffer=0===this.m_joins&&0===this.m_caps),this.m_bFilter=this.m_bRoundBuffer,this.m_geometry=(0,u.c)(e),this.m_geometry.isEmpty())return new l.a({vd:e.getDescription()});const f=new m.Envelope2D;this.m_geometry.queryLooseEnvelope(f),t>0&&f.inflateCoords(t,t),this.m_tolerance=(0,h.a)(s,f,!0),this.m_smallTolerance=(0,h.a)(null,f,!0),_<=0&&(_=96),this.m_spatialReference=s,this.m_distance=t,this.m_absDistance=Math.abs(this.m_distance),this.m_absDistanceReversed=0!==this.m_absDistance?1/this.m_absDistance:0,Number.isNaN(c)||0===c?c=1e-5*this.m_absDistance:c>.5*this.m_absDistance&&(c=.5*this.m_absDistance),_<12&&(_=12);const g=Math.abs(t)*(1-Math.cos(Math.PI/_));if(g>c)c=g;else if(0!==t){const e=Math.PI/Math.acos(1-c/Math.abs(t));e<_-1&&(_=Math.trunc(e))<12&&(_=12,c=Math.abs(t)*(1-Math.cos(Math.PI/_)))}this.m_densifyDist=c,this.m_maxVertexInCompleteCircle=_,this.m_filterTolerance=this.m_bRoundBuffer?Math.min(this.m_smallTolerance.total(),.25*this.m_densifyDist):0,this.m_circleTemplateSize=this.calcN(),this.m_circleTemplateSize!==this.m_oldCircleTemplateSize&&(this.m_circleTemplate.length=0,this.m_oldCircleTemplateSize=this.m_circleTemplateSize),this.m_densifyDist>0&&(0,i.m)(this.m_geometry)&&(this.m_geometry=this.m_densificator.densifyEx(this.m_geometry,0,this.m_densifyDist,0,0!==this.m_joins,(0,a.i)()));const d=this.bufferImpl();return this.m_geometry=null,d}generateCircleTemplate(){if(this.m_circleTemplate.length)return;const e=this.m_circleTemplateSize,t=Math.trunc((e+3)/4),s=.5*Math.PI/t;this.m_dA=s,this.m_circleTemplate=(0,a.m)(a.P,4*t);const n=Math.cos(s),i=Math.sin(s),r=a.P.construct(0,1);for(let e=0;e<t;e++)this.m_circleTemplate[e+0*t].setCoords(r.y,-r.x),this.m_circleTemplate[e+1*t].setCoords(-r.x,-r.y),this.m_circleTemplate[e+2*t].setCoords(-r.y,r.x),this.m_circleTemplate[e+3*t].setCoords(r.x,r.y),r.rotateReverse(n,i)}bufferImpl(){const e=this.m_geometry.getGeometryType();if((0,i.f)(e)){const e=new l.P({vd:this.m_geometry.getDescription()});return e.addSegment(this.m_geometry,!0),this.m_geometry=e,this.bufferImpl()}if(this.m_distance<=this.m_tolerance.total()){if(!(0,i.k)(e))return new l.a({vd:this.m_geometry.getDescription()});if(this.m_distance<0){const e=new m.Envelope2D;if(this.m_geometry.queryEnvelope(e),e.width()<=2*this.m_absDistance||e.height()<=2*this.m_absDistance)return new l.a({vd:this.m_geometry.getDescription()})}}switch(this.m_geometry.getGeometryType()){case i.G.enumPoint:return this.bufferPoint();case i.G.enumMultiPoint:return this.bufferMultiPoint();case i.G.enumPolyline:return this.bufferPolyline();case i.G.enumPolygon:return this.bufferPolygon();case i.G.enumEnvelope:return this.bufferEnvelope();default:(0,i.c)("")}}bufferPolyline(){if(this.isDegenerateGeometry(this.m_geometry)){const e=new h.P;this.m_geometry.getPointByVal(0,e);const t=new m.Envelope2D;return this.m_geometry.queryEnvelope(t),e.setXY(t.getCenter()),this.bufferDegeneratePath(e,!0)}const e=this.m_geometry,t=this.m_geometry.getDescription();this.m_geometry=null;const s=new x(e);let n,i;n=0===this.m_joins?(new p.O).executeMany(s,.25*this.m_densifyDist,!1,this.m_progressTracker):s,i=this.m_bRoundBuffer?(new _).executeMany(n,null,!0,this.m_progressTracker):n;const o=new C(this,i,this.m_bFilter),a=(new r.h).executeMany(o,this.m_spatialReference,this.m_progressTracker,2),c=(new r.g).executeMany(a,this.m_spatialReference,!1,this.m_progressTracker).next();return null!==c?c:new l.a({vd:t})}bufferPolygon(){if(0===this.m_distance)return this.m_geometry;this.generateCircleTemplate();const e=(new r.g).execute(this.m_geometry,null,!1,this.m_progressTracker);if(this.m_distance<0){if(this.m_geometry=e,this.m_geometry.isEmpty())return this.m_geometry;const t=this.m_geometry,s=this.bufferPolygonImpl(t,0,t.getPathCount());return(new r.g).execute(s,this.m_spatialReference,!1,this.m_progressTracker)}{if(this.m_geometry=e,this.isDegenerateGeometry(this.m_geometry)){const e=new h.P;this.m_geometry.getPointByVal(0,e);const t=new m.Envelope2D;return this.m_geometry.queryEnvelope(t),e.setXY(t.getCenter()),this.bufferDegeneratePath(e,!0)}const t=new D(this),s=(new r.h).executeMany(t,this.m_spatialReference,this.m_progressTracker,2),n=(new r.g).executeMany(s,this.m_spatialReference,!1,this.m_progressTracker).next();return null!==n?n:new l.a({vd:this.m_geometry.getDescription()})}}bufferPolygonImpl(e,t,s){const n=e,i=n.getImpl();let r=new l.a({vd:e.getDescription()});for(let o=t;o<s;o++){if(i.getPathSize(o)<1)continue;const t=i.calculateRingArea2D(o),s=new m.Envelope2D;if(i.queryPathEnvelope(o,s),this.m_distance>0)if(t>0)if(this.isDegeneratePath(i,o)){const e=new h.P;i.getPointByVal(i.getPathStart(o),e),e.setXY(s.getCenter()),r.add(this.bufferDegeneratePath(e,!0),!1)}else{const t=new l.P({vd:e.getDescription()}),s=t.getImpl();if((0,l.i)(this.m_geometry,o)){const e=this.bufferConvexPath(n,o);r.add(e,!1)}else{this.bufferClosedPath(this.m_geometry,o,s,this.m_bRoundBuffer,1);const e=this.bufferCleanup(t);r.add(e,!1)}}else{if(s.width()+this.m_tolerance.total()<=2*this.m_absDistance||s.height()+this.m_tolerance.total()<=2*this.m_absDistance)continue;const t=new l.P({vd:e.getDescription()}),n=t.getImpl();if(this.bufferClosedPath(this.m_geometry,o,n,this.m_bRoundBuffer,1),!t.isEmpty()){const e=s,i=Math.max(1,this.m_absDistance),m=e.clone();m.inflateCoords(i,i),n.addEnvelope(m,!1);const o=this.bufferCleanup(t);r.reserve(r.getPointCount()+o.getPointCount()-4),S(o,r,m,!0)}}else if(t>0){if(s.width()+this.m_tolerance.total()<=2*this.m_absDistance||s.height()+this.m_tolerance.total()<=2*this.m_absDistance)continue;const t=new l.P({vd:e.getDescription()}),n=t.getImpl();if(this.bufferClosedPath(this.m_geometry,o,n,this.m_bRoundBuffer,-1),!t.isEmpty()){const e=new m.Envelope2D;n.queryLooseEnvelope(e);const s=Math.max(1,this.m_absDistance),i=e.clone();i.inflateCoords(s,s),n.addEnvelope(i,!1),S(this.bufferCleanup(t),r,i,!0)}}else{const t=new l.P({vd:e.getDescription()}),s=t.getImpl();this.bufferClosedPath(this.m_geometry,o,s,this.m_bRoundBuffer,-1);const n=this.bufferCleanup(t);for(let e=0,t=n.getPathCount();e<t;e++)r.addPath(n,e,!0)}}if(this.m_distance>0)return r.getPathCount()>1?this.bufferCleanup(r):v(r);{const e=new m.Envelope2D;if(r.queryLooseEnvelope(e),r.isEmpty())return v(r);{const t=Math.max(1,this.m_absDistance),s=e.clone();s.inflateCoords(t,t),r.addEnvelope(s,!1);const n=this.bufferCleanup(r);r=new l.a;const i=new l.a({vd:n.getDescription()});return S(n,i,s,!1),v(i)}}}bufferPoint(){return this.bufferPointImpl(this.m_geometry)}bufferPointImpl(e){const t=new l.a({vd:e.getDescription()});return 0===this.m_caps?(this.addCircle(t.getImpl(),e),this.setStrongSimple(t)):2===this.m_caps?(this.addSquare(t.getImpl(),e),this.setStrongSimple(t)):t}bufferDegeneratePath(e,t){const s=new l.a({vd:e.getDescription()});return t&&0===this.m_joins||!t&&0===this.m_caps?(this.addCircle(s.getImpl(),e),this.setStrongSimple(s)):t||2!==this.m_caps?s:(this.addSquare(s.getImpl(),e),this.setStrongSimple(s))}bufferMultiPoint(){const e=new b(this,this.m_geometry,this.m_distance,this.m_spatialReference,this.m_joins,this.m_caps,this.m_miterLimit,this.m_densifyDist,this.m_maxVertexInCompleteCircle,this.m_progressTracker);return(new r.h).executeMany(e,this.m_spatialReference,this.m_progressTracker,2).next()}bufferEnvelope(){let e=new l.a({vd:this.m_geometry.getDescription()});if(this.m_distance<=0){if(0===this.m_distance)e.addEnvelope(this.m_geometry,!1),T(this.m_geometry,this.m_tolerance.total())&&(e=this.setStrongSimple(e));else{const t=new h.E;this.m_geometry.queryEnvelope(t),t.inflateCoords(this.m_distance,this.m_distance),e.addEnvelope(t,!1),T(t,this.m_tolerance.total())&&(e=this.setStrongSimple(e))}return e}if(1===this.m_joins){const t=new h.E({copy:this.m_geometry});return t.inflateCoords(this.m_absDistance,this.m_absDistance),e.addEnvelope(t,!1),e}const t=this.m_geometry.clone();if(0===t.width()||0===t.height()){if(0===t.width()&&0===t.height()){const e=new h.P({vd:this.m_geometry.getDescription()});return t.queryCornerByVal(0,e),this.m_geometry=e,this.bufferImpl()}const e=new l.P({vd:this.m_geometry.getDescription()}),s=new h.P;return t.queryCornerByVal(0,s),e.startPathPoint(s),t.queryCornerByVal(2,s),e.lineToPoint(s),this.m_geometry=e,this.bufferImpl()}return e.addEnvelope(this.m_geometry,!1),this.m_geometry=e,this.bufferConvexPath(e,0)}bufferConvexPath(e,t){this.generateCircleTemplate();const s=e.hasAttribute(10),n=new l.a({vd:e.getDescription()}),r=n.getImpl();n.reserve((this.m_circleTemplate.length/10+4)*e.getPathSize(t));const m=new a.P,o=new a.P,h=new a.P,c=new a.P(0,0),u=new a.P,_=new a.P,f=e.getImpl(),d=e.getPathSize(t),p=e.getPathStart(t);for(let n=0,a=e.getPathSize(t);n<a;n++){const e=f.getXY(p+n),t=f.getXY(p+(n+1)%d),a=f.getXY(p+(n+2)%d);u.setSub(t,e),0===u.length()&&(0,i.c)("");const l=s&&!!(1&f.getAttributeAsInt(10,(n+1)%d,0));u.normalize();const P=u.clone();u.leftPerpendicularThis(),u.scale(this.m_absDistance),m.setAdd(u,e),o.setAdd(u,t),0===n?r.startPath(m):r.lineTo(m),r.lineTo(o),_.setSub(a,t),0===_.length()&&(0,i.c)(""),_.normalize();const y=_.clone();_.leftPerpendicularThis(),_.scale(this.m_absDistance),h.setAdd(_,t);let b=g.enumArc;const x=l?0:this.m_joins;if(2===x)b=g.enumBevel;else if(1===x){const e=-P.crossProduct(y);c.setSub(P,y),c.scale(this.m_absDistance/e),c.length()<this.m_miterLimit*this.m_absDistance?(c.addThis(t),b=g.enumMiter):b=g.enumBevel}else c.assign(t);this.addJoin(b,r,c,o,h,!1,!1)}return v(n)}bufferPolylinePath(e,t,s){this.generateCircleTemplate();const n=e,i=n.getImpl();if(i.getPathSize(t)<1)return null;let r;if(r=this.m_bRoundBuffer?i.isClosedPathInXYPlane(t):i.isClosedPath(t),this.isDegeneratePath(i,t)&&this.m_distance>0){const e=new h.P;i.getPointByVal(i.getPathStart(t),e);const s=new m.Envelope2D;return i.queryPathEnvelope(t,s),e.setXY(s.getCenter()),this.bufferDegeneratePath(e,r)}const o=new l.P({vd:e.getDescription()});o.reserve((Math.trunc(this.m_circleTemplate.length/10)+4)*i.getPathSize(t));const a=o.getImpl();return r?2!==this.bufferClosedPath(n,t,a,s,1)&&this.bufferClosedPath(n,t,a,s,-1):this.bufferOpenPath(n,t,a,s),this.bufferCleanup(o)}progress_(){}bufferCleanup(e,t=!1){const s=t?this.m_tolerance:this.m_smallTolerance;return(0,r.p)(e,s,!0,!t,-1,this.m_progressTracker,0,!1)}calcN(){if(0===this.m_densifyDist)return this.m_maxVertexInCompleteCircle;const e=1-this.m_densifyDist*Math.abs(this.m_absDistanceReversed);let t=4;return t=e<-1?4:2*Math.PI/Math.acos(e)+.5,t<4?t=4:t>this.m_maxVertexInCompleteCircle&&(t=this.m_maxVertexInCompleteCircle),Math.trunc(t)}addJoin(e,t,s,n,i,r,m){if(this.generateCircleTemplate(),r&&(t.startPath(n),r=!1),e===g.enumBevel)return void(m&&t.lineTo(i));if(e===g.enumMiter){const e=s.clone();return t.lineTo(e),void(m&&t.lineTo(i))}const o=new a.P;o.setSub(n,s),o.scale(this.m_absDistanceReversed);const h=new a.P;h.setSub(i,s),h.scale(this.m_absDistanceReversed);let l=Math.atan2(o.y,o.x)/this.m_dA;l<0&&(l=this.m_circleTemplate.length+l),l=this.m_circleTemplate.length-l;let c=Math.atan2(h.y,h.x)/this.m_dA;c<0&&(c=this.m_circleTemplate.length+c),c=this.m_circleTemplate.length-c,c<l&&(c+=this.m_circleTemplate.length);let u=Math.trunc(c),_=Math.ceil(l),f=this.m_circleTemplate[_%this.m_circleTemplate.length].clone();f.scaleAddThis(this.m_absDistance,s);const d=10*this.m_tolerance.total();f.sub(n).length()<d&&(_+=1),f=this.m_circleTemplate[u%this.m_circleTemplate.length].clone(),f.scaleAddThis(this.m_absDistance,s),f.sub(i).length()<d&&(u-=1);let p=u-_;p++;for(let e=0,n=_%this.m_circleTemplate.length;e<p;e++,n=(n+1)%this.m_circleTemplate.length)f=this.m_circleTemplate[n].clone(),f.scaleAddThis(this.m_absDistance,s),t.lineTo(f),this.progress_();m&&t.lineTo(i)}bufferClosedPath(e,t,s,n,i){const r=new l.E,m=r.addPathFromMultiPath(e,t,!0);return this.bufferClosedPathImpl(r,m,s,n,i)}bufferClosedPathImpl(e,t,s,n,r){const m=e.getFirstVertex(e.getFirstPath(t)),u=new h.P;if(e.queryPoint(m,u),e.filterClosePoints(this.m_filterTolerance,!1,!1,!1,-1),e.getPointCount(t)<2)return r<0?0:(this.m_bRoundBuffer&&this.addCircle(s,u),2);(0,i.g)(e.getFirstPath(t)!==l.n),(0,i.g)(e.getFirstVertex(e.getFirstPath(t))!==l.n);const _=e.getXY(e.getFirstVertex(e.getFirstPath(t))),f=new c.T;if(f.setShift(_.negate()),e.applyTransformation(f),n){const n=function(e,t,s,n,i,r,m){return function(e,t,s,n,i,r,m){const h={stack:[],error:void 0,hasError:!1};try{const n=e.getFirstPath(t),c=e.createUserIndex();(0,o.b)(h,(0,a.h)((()=>{e.removeUserIndex(c)}),!1),!1),function(e,t,s,n){let i=-1;const r=new a.P,m=new a.P,o=new a.P;for(let s=0,h=e.getPathSize(n),a=e.getFirstVertex(n);s<h;++s){-1===i&&(e.queryXY(a,m),i=e.getPrevVertex(a),-1!==i&&(e.queryXY(i,r),o.setSub(m,r),o.normalize()));const s=e.getNextVertex(a);if(-1===s)break;const n=e.getXY(s),h=n.sub(m);h.normalize(),-1!==i&&h.dotProduct(o)<-.99&&Math.abs(h.crossProduct(o))<1e-7&&e.setUserIndex(a,t,1),i=a,a=s,r.assign(m),m.assign(n),o.assign(h)}}(e,c,0,n);for(let t=0;t<100;++t){if(0===e.getPathSize(n))return 1;let t=e.getFirstVertex(n),r=e.getPathSize(n);if(r<3)return 1;e.isClosedPath(n)||(r-=1);const o=64;let h=0,a=!1;for(let n=0;n<r&&t!==l.n;n++){let l=0,u=t;for(let h=1,a=Math.min(o,r-n);h<a;h++)if(u=e.getNextVertexEx(u,s),h>1){const n=k(e,c,t,u,s,i,m,o);if(-1===n)break;l+=n,r-=n}if(h+=l,a=l>0,a){const n=e.getPrevVertexEx(t,s);if(-1!==n){t=n,r++;continue}}t=e.getNextVertexEx(t,s)}if(0===h)break}return e.filterClosePoints(r,!1,!1,!1,-1),1}catch(e){h.error=e,h.hasError=!0}finally{(0,o.c)(h)}}(e,t,s,0,i,r,m)}(e,t,r,0,this.m_absDistance,this.m_filterTolerance,this.m_densifyDist);if((0,i.g)(1===n),e.getPointCount(t)<2)return r<0?0:(this.addCircle(s,u),2)}const d=0!==this.m_joins&&e.getVertexDescription().hasAttribute(10);this.m_bufferCommands.length=0;const p=e.getFirstPath(t);let b=e.getFirstVertex(p),x=1===r?e.getPrevVertex(b):e.getNextVertex(b),C=1===r?e.getNextVertex(b):e.getPrevVertex(b),D=!0;const w=new a.P,v=new a.P,T=new a.P,S=new a.P,I=new a.P,E=new a.P,M=new a.P,G=new a.P,R=this.m_absDistance,V=e.getPathSize(p),A=new a.P(0,0);for(let t=0;t<V;t++){v.assign(e.getXY(C)),D&&(w.assign(e.getXY(b)),T.assign(e.getXY(x)),E.setSub(w,T),E.normalize(),G.leftPerpendicularOther(E),G.scale(R),S.setAdd(G,w));const t=d&&!!(1&e.getAttributeAsDbl(10,b,0));I.setSub(v,w),I.normalize(),M.leftPerpendicularOther(I),M.scale(R);const s=new a.P;s.setAdd(w,M);const n=E.crossProduct(I),i=E.dotProduct(I);if(n<0||i<0&&n<Math.abs(i)*Number.EPSILON*8){let e=!1;const i=t?0:this.m_joins;if(1===i){const t=-n;A.setSub(E,I),A.scale(this.m_absDistance/t),A.length()<this.m_miterLimit*this.m_absDistance&&(A.addThis(w),e=!0),this.m_bufferCommands.push(P(S,s,A,e?g.enumMiter:g.enumBevel,this.m_bufferCommands.length+1))}else this.m_bufferCommands.push(P(S,s,w,0===i?g.enumArc:g.enumBevel,this.m_bufferCommands.length+1))}else S.equals(s)||(this.m_bufferCommands.push(y(S,w,this.m_bufferCommands.length+1)),this.m_bufferCommands.push(y(w,s,this.m_bufferCommands.length+1)));const m=new a.P;m.setAdd(v,M),this.m_bufferCommands.push(P(s,m,w,g.enumLine,this.m_bufferCommands.length+1)),S.setCoordsPoint2D(m),G.setCoordsPoint2D(M),T.setCoordsPoint2D(w),w.setCoordsPoint2D(v),E.setCoordsPoint2D(I),x=b,b=C,D=!1,C=1===r?e.getNextVertex(b):e.getPrevVertex(b)}return this.m_bufferCommands.at(-1).m_next=0,this.processBufferCommands(s),f.setShift(_),s.applyTransformationToPath(f,s.getPathCount()-1),1}bufferOpenPath(e,t,s,n){if(this.m_bRoundBuffer){const i=new l.P({vd:e.getDescription()});return i.addPath(e,t,!1),i.addSegmentsFromPath(e,t,0,e.getSegmentCountPath(t),!1),this.bufferClosedPath(i,0,s,n,1)}let r=0;const m=new l.P({vd:e.getDescription()}),o=new a.P(0,0);{const n=new l.E,i=n.addPathFromMultiPath(e,t,!1),a=n.getFirstVertex(n.getFirstPath(i)),c=new h.P;if(n.queryPoint(a,c),o.assign(c.getXY()),n.filterClosePoints(0,!1,!1,!1,-1),n.getPointCount(i)<2)return this.m_bRoundBuffer&&this.addCircle(s,c),2;const u=n.getGeometry(n.getFirstGeometry());m.addPath(u,0,!1),r=m.getPointCount()-1,m.addSegmentsFromPath(u,0,0,u.getSegmentCountPath(0)-1,!1)}const u=new l.E,_=u.addPathFromMultiPath(m,0,!0);(0,i.g)(u.getFirstPath(_)!==l.n),(0,i.g)(u.getFirstVertex(u.getFirstPath(_))!==l.n);const f=new c.T;f.setShift(o.negate()),u.applyTransformation(f),this.m_bufferCommands.length=0;const d=u.getFirstPath(_),p=0!==this.m_joins&&u.getVertexDescription().hasAttribute(10);let b=u.getFirstVertex(d),x=u.getPrevVertex(b),C=u.getNextVertex(b),D=!0;const w=new a.P,v=new a.P,T=new a.P,k=new a.P,S=new a.P,I=new a.P,E=new a.P,M=new a.P,G=this.m_absDistance,R=u.getPathSize(d),V=new a.P(0,0);for(let e=0;e<R;e++){let t=!1;0!==e&&e!==r||(t=!0),v.assign(u.getXY(C)),D&&(w.assign(u.getXY(b)),T.assign(u.getXY(x)),I.setSub(w,T),I.normalize(),M.leftPerpendicularOther(I),M.scale(G),k.setAdd(M,w));const s=p&&!!(1&u.getAttributeAsDbl(10,b,0));S.setSub(v,w),S.normalize(),E.leftPerpendicularOther(S),E.scale(G);const n=new a.P;n.setAdd(w,E);const i=I.crossProduct(S),m=I.dotProduct(S);if(i<0||m<0&&i<Math.abs(m)*Number.EPSILON*8)if(t)if(0===this.m_caps)this.m_bufferCommands.push(P(k,n,w,g.enumArc,this.m_bufferCommands.length+1));else if(1===this.m_caps)this.m_bufferCommands.push(P(k,n,w,g.enumLine,this.m_bufferCommands.length+1));else{const e=S.mul(this.m_absDistance).negate(),t=e.clone();e.addThis(k),t.addThis(n),this.m_bufferCommands.push(P(k,e,w,g.enumLine,this.m_bufferCommands.length+1)),this.m_bufferCommands.push(P(e,t,w,g.enumLine,this.m_bufferCommands.length+1)),this.m_bufferCommands.push(P(t,n,w,g.enumLine,this.m_bufferCommands.length+1))}else{let e=!1;const t=s?0:this.m_joins;if(1===t){const t=-i;V.setSub(I,S),V.scale(this.m_absDistance/t),V.length()<this.m_miterLimit*this.m_absDistance&&(V.addThis(w),e=!0),this.m_bufferCommands.push(P(k,n,V,e?g.enumMiter:g.enumBevel,this.m_bufferCommands.length+1))}else this.m_bufferCommands.push(P(k,n,w,0===t?g.enumArc:g.enumBevel,this.m_bufferCommands.length+1))}else k.equals(n)||(this.m_bufferCommands.push(y(k,w,this.m_bufferCommands.length+1)),this.m_bufferCommands.push(y(w,n,this.m_bufferCommands.length+1)));const o=new a.P;o.setAdd(v,E),this.m_bufferCommands.push(P(n,o,w,g.enumLine,this.m_bufferCommands.length+1)),k.setCoordsPoint2D(o),M.setCoordsPoint2D(E),T.setCoordsPoint2D(w),w.setCoordsPoint2D(v),I.setCoordsPoint2D(S),x=b,b=C,D=!1,C=u.getNextVertex(b)}return this.m_bufferCommands.at(-1).m_next=0,this.processBufferCommands(s),f.setShift(o),s.applyTransformationToPath(f,s.getPathCount()-1),1}processBufferCommands(e){const t=this.cleanupBufferCommands();let s=!0,n=t+1;for(let i=t;n!==t;i=n){const t=this.m_bufferCommands[i];n=-1!==t.m_next?t.m_next:(i+1)%this.m_bufferCommands.length,t.m_type&&(s&&(e.startPath(t.m_from),s=!1),t.m_type&g.enumJoinMask?this.addJoin(t.m_type,e,t.m_center,t.m_from,t.m_to,!1,!0):e.lineTo(t.m_to))}}cleanupBufferCommands(){this.m_helperArray=(0,a.m)(a.P,9);let e=0;for(let t=0,s=this.m_bufferCommands.length;t<s;){const s=this.m_bufferCommands[t];if(s.m_type&g.enumConnectionMask){e=t;break}t=s.m_next}let t=e+1;for(let s=e;t!==e;s=t){const e=this.m_bufferCommands[s];t=e.m_next;let n=1,i=null;for(;t!==s&&(i=this.m_bufferCommands[t],!(i.m_type&g.enumConnectionMask));)t=i.m_next,n++;1!==n&&(e.m_type&i.m_type)===g.enumLine&&(this.m_helperLine1.setStartXY(e.m_from),this.m_helperLine1.setEndXY(e.m_to),this.m_helperLine2.setStartXY(i.m_from),this.m_helperLine2.setEndXY(i.m_to),1===this.m_helperLine1.intersect(this.m_helperLine2,this.m_helperArray,null,null,this.m_smallTolerance.total())&&(e.m_to.assign(this.m_helperArray[0]),i.m_from.assign(this.m_helperArray[0]),e.m_next=t))}return e}isDegeneratePath(e,t){if(1===e.getPathSize(t))return!0;if(0===this.m_joins&&0===this.m_caps){const s=new m.Envelope2D;if(e.queryPathEnvelope(t,s),Math.max(s.width(),s.height())<.5*this.m_densifyDist)return!0}return!1}isDegenerateGeometry(e){if(0===this.m_joins&&0===this.m_caps){const t=new m.Envelope2D;if(e.queryEnvelope(t),Math.max(t.width(),t.height())<.5*this.m_densifyDist)return!0}return!1}addCircle(e,t){const s=t.getXY();if(0!==this.m_circleTemplate.length){let t=this.m_circleTemplate[0].clone();t.scaleAddThis(this.m_absDistance,s),e.startPath(t);for(let n=1,i=this.m_circleTemplate.length;n<i;n++)t=this.m_circleTemplate[n].clone(),t.scaleAddThis(this.m_absDistance,s),e.lineTo(t);return}const n=this.m_circleTemplateSize,i=Math.trunc((n+3)/4),r=.5*Math.PI/i;e.reserve(4*i);const m=Math.cos(r),o=Math.sin(r);for(let t=3;t>=0;t--){const n=a.P.construct(0,this.m_absDistance);switch(t){case 0:for(let t=0;t<i;t++)e.lineToCoords(n.x+s.x,n.y+s.y),n.rotateReverse(m,o);break;case 1:for(let t=0;t<i;t++)e.lineToCoords(-n.y+s.x,n.x+s.y),n.rotateReverse(m,o);break;case 2:for(let t=0;t<i;t++)e.lineToCoords(-n.x+s.x,-n.y+s.y),n.rotateReverse(m,o);break;default:e.startPathCoords(n.y+s.x,-n.x+s.y);for(let t=1;t<i;t++)n.rotateReverse(m,o),e.lineToCoords(n.y+s.x,-n.x+s.y)}this.progress_()}}addSquare(e,t){const s=new h.E({vd:t.getDescription()});s.setCoords(t.getX(),t.getY(),t.getX(),t.getY()),s.inflateCoords(this.m_absDistance,this.m_absDistance),e.addEnvelope(s,!1)}setStrongSimple(e){return e.getImpl().setIsSimple(4,this.m_tolerance.total()),e.getImpl().updateOGCFlagsProtected(),e}}function v(e){return(0,h.s)(e,0),e}function T(e,t){return!!e.isEmpty()||Math.min(e.width(),e.height())>t}function k(e,t,s,n,r,m,o,h){const l=e.getXY(s),c=e.getXY(n);if(l.equals(c))return-1;const u=.25*o,_=.25*o,f=new a.P;f.setSub(c,l);const g=f.length(),d=g*g*.25,p=m*m-d;if(p<=d)return-1;const P=Math.sqrt(p);f.normalize();const y=f.clone();y.rightPerpendicularThis();const b=d/P,x=b<=_,C=a.P.lerp(c,l,.5),D=y.clone(),w=b-u;D.scaleAddThis(Math.max(0,w),C),y.negate().scaleAddThis(P,C);const v=3.61*(0,a.s)(m-_),T=D.sub(l),k=D.sub(c);let S=!1,I=0;const E=(0,a.d)(64,0);(0,i.g)(h===E.length);{for(let i=e.getPrevVertexEx(n,r);i!==s;){if(1===e.getUserIndex(i,t))return-1;if(!e.getXY(i).equals(c))break;{const t=e.getPrevVertexEx(i,r);e.removeVertex(i,!1),i=t}}const m=new a.P,o=l.clone();E[I++]=1;for(let i=e.getNextVertexEx(s,r);i!==n;){if(1===e.getUserIndex(i,t))return-1;const s=e.getXY(i);if(s.equals(o)){const t=e.getNextVertexEx(i,r);e.removeVertex(i,!1),i=t;continue}E[I++]=0;const n=new a.P;if(n.setSub(s,l),n.dotProduct(y)<0)return 0;(a.P.sqrDistance(s,l)>v||a.P.sqrDistance(s,c)>v)&&(S=!0);let h=0;if(s.sub(l).crossProduct(T)>=0&&(h=1),s.sub(c).crossProduct(k)<=0&&(h|=2),0===h)return 0;E[I-1]=h,m.assign(o),o.assign(s),i=e.getNextVertexEx(i,r)}if(1===I)return 0;(0,i.g)(I<E.length),E[I++]=2}let M=!0;for(let e=1,t=0;e<I;e++)if(E[e]!==E[e-1]&&(t++,M=t<3&&(1===t&&3===E[e]||2===t&&2===E[e]),!M))return 0;if(I>2&&M&&(3===I||!S)){let t=0,i=e.getNextVertexEx(s,r);for(x||(e.setXY(i,D),i=e.getNextVertexEx(i,r));i!==n;){const s=e.getNextVertexEx(i,r);e.removeVertex(i,!1),i=s,++t}return t}if((0,i.g)(3!==I),S&&I>3)return 0;const G=l.clone();let R=s;const V=l.clone();let A=1,X=-1,Y=R,B=0;for(I=1;Y!==n;){Y=e.getNextVertexEx(Y,r);const t=E[I++];if(0===t){if(Y===n)break;continue}const s=e.getXY(Y);if(-1!==X){if(X&A&t&3){e.removeVertex(R,!0),B++,R=Y,V.setCoordsPoint2D(s),A=t;continue}if(3===A&&0!==X&&0!==t){if(V.setCoordsPoint2D(D),x||V.equals(G)){e.removeVertex(R,!0),B++,R=Y,V.setCoordsPoint2D(s),A=t;continue}e.setXY(R,V)}}X=A,G.setCoordsPoint2D(V),R=Y,A=t,V.setCoordsPoint2D(s)}return B}function S(e,t,s,n){for(let i=0,r=e.getPathCount();i<r;i++){const r=e.getXY(e.getPathStart(i));r.x!==s.xmin&&r.x!==s.xmax&&t.addPath(e,i,n)}}class I extends n.G{constructor(e,t,s,n,i,r,o){super(),this.m_currentUnionEnvelope2D=new m.Envelope2D,this.m_index=-1,this.m_dindex=-1,this.m_progressTracker=o,this.m_bufferer=new w(o),this.m_inputGeoms=e,this.m_spatialReference=t,this.m_distances=s,this.m_maxDeviation=n,this.m_maxVerticesInFullCircle=i}tock(){return!0}getRank(){return 1}next(){{let e;for(;e=this.m_inputGeoms.next();)return(0,i.d)(e),this.m_index=this.m_inputGeoms.getGeometryID(),this.m_dindex+1<this.m_distances.length&&this.m_dindex++,this.buffer(e,this.m_distances[this.m_dindex]);return null}}getGeometryID(){return this.m_index}buffer(e,t){return this.m_bufferer.buffer(e,t,this.m_spatialReference,0,0,4,this.m_maxDeviation,this.m_maxVerticesInFullCircle)}}const E=new class{getOperatorType(){return 10004}supportsCurves(){return!0}accelerateGeometry(e,t,s){return!1}canAccelerateGeometry(e){return!1}executeMany(e,t,s,n,i){return this.executeManyEx(e,t,s,Number.NaN,96,n,i)}execute(e,t,s,r){Number.isFinite(s)||(0,i.t)("Invalid distance for buffer operation");const m=new n.S([e]),o=[s],h=this.executeMany(m,t,o,!1,r).next();return h||(0,i.c)("null buffer output"),h}executeManyEx(e,t,s,n,m,o,h){if(void 0!==s.find((e=>!Number.isFinite(e)))&&(0,i.t)("Invalid distance for buffer operation"),o){const i=new I(e,t,s,n,m,!1,h);return(new r.h).executeMany(i,t,h,2)}return new I(e,t,s,n,m,!1,h)}};function M(e,t,s){return E.execute(e,t,s,null)}function G(e,t,s,i,r,m){const o=E.executeManyEx(new n.S(e),t,s,i,r,m,null);return Array.from(o)}function R(){return E.supportsCurves()}}}]);