@arcgis/core 4.33.0-next.20250324 → 4.33.0-next.20250326

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 (237) hide show
  1. package/arcade/arcadeAsyncRuntime.js +1 -1
  2. package/arcade/arcadeCompiler.js +1 -1
  3. package/arcade/arcadeRuntime.js +1 -1
  4. package/arcade/containerUtils.js +1 -1
  5. package/arcade/functions/date.js +1 -1
  6. package/arcade/functions/feature.js +1 -1
  7. package/arcade/functions/featuresetbase.js +1 -1
  8. package/arcade/functions/featuresetgeom.js +1 -1
  9. package/arcade/functions/featuresetstats.js +1 -1
  10. package/arcade/functions/featuresetstring.js +1 -1
  11. package/arcade/functions/fieldStats.js +1 -1
  12. package/arcade/functions/geomasync.js +1 -1
  13. package/arcade/functions/geometry.js +1 -1
  14. package/arcade/functions/geomsync.js +1 -1
  15. package/arcade/functions/knowledgegraph.js +1 -1
  16. package/arcade/functions/maths.js +1 -1
  17. package/arcade/functions/stats.js +1 -1
  18. package/arcade/functions/string.js +1 -1
  19. package/arcade/geometry/functions.js +1 -1
  20. package/arcade/languageUtils.js +1 -1
  21. package/assets/esri/core/workers/RemoteClient.js +1 -1
  22. package/assets/esri/core/workers/chunks/0059295780fa4a090f30.js +319 -0
  23. package/assets/esri/core/workers/chunks/{8f4bcca8b0525e19374f.js → 042771b4e56355924140.js} +1 -1
  24. package/assets/esri/core/workers/chunks/09c9e4e94f09ba9f4c22.js +1 -0
  25. package/assets/esri/core/workers/chunks/{3bea1400160042dca9f3.js → 0e82365be7d9257e7cb2.js} +1 -1
  26. package/assets/esri/core/workers/chunks/1dd6d68d23ba07587ae4.js +1 -0
  27. package/assets/esri/core/workers/chunks/{fef46b841e8369b30227.js → 2873cb727c59328074db.js} +1 -1
  28. package/assets/esri/core/workers/chunks/3808f10747cecc8a1a9b.js +1 -0
  29. package/assets/esri/core/workers/chunks/{9cfce9414b874878d761.js → 4dc1e7d7ac2a4b0144c4.js} +96 -96
  30. package/assets/esri/core/workers/chunks/{e5e1f8ac53c70427a60b.js → 59e4e780dcdfed555ca5.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{33005043f7084048296d.js → 6ab96eaaad0aaad46db9.js} +1 -1
  32. package/assets/esri/core/workers/chunks/705c1ebb327f680f8519.js +1 -0
  33. package/assets/esri/core/workers/chunks/{bd2dcc55ac3418421ee5.js → 726e3f413824f02fe689.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{4c9160e3d596fe75392d.js → 75ec4d2ae9d427a1434f.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{11f9d7cd95891596b716.js → 77199b4b39ee8b4303de.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{74c01de62ccaed0666e0.js → 81f2f1614ea27f4c2e65.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{d787474e78360c925fd9.js → a59ad50d932da1e28c8f.js} +1 -1
  38. package/assets/esri/core/workers/chunks/afe94e351b4a50d7bc53.js +1 -0
  39. package/assets/esri/core/workers/chunks/{47c04980098dc0c228d7.js → b02ac03503bfff1ff922.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{cbbbaccc0d3683e1c0fe.js → b8a4352f83502449ff95.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{605eddec7aac891ed141.js → ba47e43ef039fe4b8c5c.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{3ee000c92e4d5d21e22d.js → bc3f42401131a12fce9b.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{2cedf4222238c86a98e8.js → c6bcfa99fb222894fa0e.js} +1 -1
  44. package/assets/esri/core/workers/chunks/cb386923200272cf26a9.js +1 -0
  45. package/assets/esri/core/workers/chunks/{a2377969f76640f1d6fe.js → d5d2a4e8e19898d86c6d.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{5f8028928ae8e5d27dda.js → e088edb9ffbaa1ed12eb.js} +1 -1
  47. package/assets/esri/core/workers/chunks/ed831e51c2a03ee95879.js +1 -0
  48. package/assets/esri/core/workers/chunks/{3e9cd82325c473ddbf1f.js → edcc0fefd57323d2cb67.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{065ae931b5891847a06f.js → f28eaf1d3a7f12788bcf.js} +1 -1
  50. package/assets/esri/core/workers/chunks/f9396af9cbfd165e72e2.js +1 -0
  51. package/assets/esri/core/workers/chunks/{f86736a60856ef7fdacb.js → fa3eeb40e2d732c184d8.js} +1 -1
  52. package/chunks/BloomBlur.glsl.js +1 -1
  53. package/chunks/BloomComposition.glsl.js +2 -2
  54. package/chunks/ComponentShader.glsl.js +24 -25
  55. package/chunks/HighlightApply.glsl.js +1 -1
  56. package/chunks/HighlightDownsample.glsl.js +1 -1
  57. package/chunks/HighlightToSingle.glsl.js +1 -1
  58. package/chunks/LineSeries.js +1 -1
  59. package/chunks/ShadowHighlight.glsl.js +1 -1
  60. package/chunks/Theme.js +1 -1
  61. package/chunks/Tick.js +1 -1
  62. package/chunks/WaterSurface.glsl.js +1 -1
  63. package/chunks/aiServices.js +1 -1
  64. package/chunks/array.js +1 -1
  65. package/chunks/chartUtilsAm5.js +1 -1
  66. package/chunks/languageUtils.js +1 -1
  67. package/chunks/nl_NL.js +1 -1
  68. package/chunks/vec32.js +1 -1
  69. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  70. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  71. package/geometry/operators/projectOperator.js +1 -1
  72. package/geometry/operators/shapePreservingProjectOperator.js +1 -1
  73. package/geometry/support/buffer/BufferView.js +1 -1
  74. package/geometry/support/meshUtils/merge.js +1 -1
  75. package/interfaces.d.ts +17 -17
  76. package/layers/buildingSublayers/BuildingComponentSublayer.js +1 -1
  77. package/package.json +1 -1
  78. package/rest/support/DirectionLine.js +1 -1
  79. package/rest/support/DirectionPoint.js +1 -1
  80. package/rest/support/PointBarrier.js +1 -1
  81. package/rest/support/PolygonBarrier.js +1 -1
  82. package/rest/support/PolylineBarrier.js +1 -1
  83. package/rest/support/RasterData.js +1 -1
  84. package/rest/support/RouteInfo.js +1 -1
  85. package/rest/support/Stop.js +1 -1
  86. package/support/revision.js +1 -1
  87. package/views/2d/LabelManager.js +1 -1
  88. package/views/2d/engine/vectorTiles/Placement.js +1 -1
  89. package/views/2d/engine/vectorTiles/SourceLayerData.js +1 -1
  90. package/views/2d/engine/vectorTiles/TileHandler3D.js +1 -1
  91. package/views/2d/engine/vectorTiles/TileManager.js +1 -1
  92. package/views/2d/engine/vectorTiles/VectorTile.js +1 -1
  93. package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
  94. package/views/2d/engine/vectorTiles/VectorTileFeatureIndex.js +1 -1
  95. package/views/2d/engine/vectorTiles/VectorTileRendererHelper3D.js +1 -1
  96. package/views/2d/engine/vectorTiles/buckets/BaseBucket.js +1 -1
  97. package/views/2d/engine/vectorTiles/buckets/SymbolBucket.js +1 -1
  98. package/views/2d/engine/vectorTiles/constants.js +5 -0
  99. package/views/2d/engine/vectorTiles/decluttering/CollisionJob.js +5 -0
  100. package/views/2d/engine/vectorTiles/decluttering/SymbolDeclutterer.js +1 -1
  101. package/views/2d/engine/vectorTiles/decluttering/SymbolFader.js +1 -1
  102. package/views/2d/engine/vectorTiles/decluttering/SymbolRepository.js +1 -1
  103. package/views/2d/engine/vectorTiles/decluttering/core.js +1 -1
  104. package/views/2d/engine/vectorTiles/decluttering/jobsUtil.js +1 -1
  105. package/views/2d/engine/vectorTiles/decluttering/util.js +1 -1
  106. package/views/2d/engine/vectorTiles/style/StyleLayer.js +1 -1
  107. package/views/2d/engine/vectorTiles/style/StyleRepository.js +1 -1
  108. package/views/2d/engine/webgl/AFeatureTile.js +1 -1
  109. package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
  110. package/views/2d/engine/webgl/FeatureTile.js +1 -1
  111. package/views/2d/engine/webgl/collisions/LabelMetric.js +1 -1
  112. package/views/2d/engine/webgl/cpuMapped/Buffer.js +1 -1
  113. package/views/2d/engine/webgl/cpuMapped/MappedMesh.js +1 -1
  114. package/views/2d/engine/webgl/mesh/MeshData.js +1 -1
  115. package/views/2d/engine/webgl/mesh/MultiTileMeshData.js +1 -1
  116. package/views/2d/engine/webgl/mesh/meshDebugUtils.js +1 -1
  117. package/views/2d/engine/webgl/mesh/templates/segmentUtils.js +1 -1
  118. package/views/2d/engine/webgl/shaderGraph/techniques/FeatureInstanceStore.js +1 -1
  119. package/views/2d/engine/webgl/shaderGraph/techniques/GraphicInstanceStore.js +1 -1
  120. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
  121. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelTechnique.js +1 -1
  122. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/AlignedVertexSpec.js +1 -1
  123. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
  124. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
  125. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  126. package/views/2d/layers/MediaLayerView2D.js +1 -1
  127. package/views/2d/layers/RouteLayerView2D.js +1 -1
  128. package/views/2d/layers/TileLayerView2D.js +1 -1
  129. package/views/2d/layers/features/FeatureContainer.js +1 -1
  130. package/views/2d/layers/features/RenderState.js +1 -1
  131. package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
  132. package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
  133. package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
  134. package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
  135. package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
  136. package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
  137. package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
  138. package/views/2d/layers/features/layerAdapters/StreamLayerAdapter.js +1 -1
  139. package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
  140. package/views/2d/layers/features/schema/processor/LabelMatcherSchema.js +1 -1
  141. package/views/2d/layers/features/schema/processor/SimpleProcessorSchema.js +1 -1
  142. package/views/2d/layers/features/schema/processor/SubtypeProcessorSchema.js +1 -1
  143. package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
  144. package/views/2d/layers/features/schema/processor/symbols/SymbolSchema.js +1 -1
  145. package/views/2d/layers/support/vectorTileDebugUtils.js +1 -1
  146. package/views/2d/tiling/FeatureTileSubscriptionManager.js +1 -1
  147. package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
  148. package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
  149. package/views/3d/analysis/Viewshed/ScaleOrientManipulation.js +1 -1
  150. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  151. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  152. package/views/3d/analysis/Viewshed/ViewshedVisualization.js +1 -1
  153. package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
  154. package/views/3d/layers/I3SMeshView3D.js +1 -1
  155. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  156. package/views/3d/layers/graphics/GraphicsDeconflictor.js +1 -1
  157. package/views/3d/layers/graphics/LabelDeconflictor.js +1 -1
  158. package/views/3d/layers/graphics/Labeler.js +1 -1
  159. package/views/3d/layers/graphics/deconflictorDebug.js +1 -1
  160. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  161. package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
  162. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  163. package/views/3d/support/QualitySettings.js +1 -1
  164. package/views/3d/support/buffer/InterleavedLayout.js +1 -1
  165. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  166. package/views/3d/terrain/OverlayRenderer.js +1 -1
  167. package/views/3d/terrain/PatchRenderData.js +1 -1
  168. package/views/3d/terrain/SphericalPatch.js +1 -1
  169. package/views/3d/terrain/TerrainRenderer.js +1 -1
  170. package/views/3d/terrain/TileCompositor.js +1 -1
  171. package/views/3d/webgl-engine/core/shaderLibrary/HighlightCellGridScreenSpacePass.glsl.js +1 -1
  172. package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoubleConfiguration.js +1 -1
  173. package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +4 -4
  174. package/views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js +1 -1
  175. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +9 -9
  176. package/views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js +2 -2
  177. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeNormalTexture.glsl.js +2 -2
  178. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +3 -3
  179. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TileBackground.glsl.js +6 -6
  180. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TileComposite.glsl.js +1 -1
  181. package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +1 -1
  182. package/views/3d/webgl-engine/core/shaderModules/{UintTexture2DBindUniform.js → Texture2DUintBindUniform.js} +1 -1
  183. package/views/3d/webgl-engine/core/shaderModules/{UintTexture2DPassUniform.js → Texture2DUintPassUniform.js} +1 -1
  184. package/views/3d/webgl-engine/effects/bloom/BloomBlur.glsl.js +1 -1
  185. package/views/3d/webgl-engine/effects/bloom/BloomBlurTechnique.js +1 -1
  186. package/views/3d/webgl-engine/effects/bloom/BloomComposition.glsl.js +1 -1
  187. package/views/3d/webgl-engine/effects/bloom/BloomCompositionTechnique.js +1 -1
  188. package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
  189. package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
  190. package/views/3d/webgl-engine/lib/Program.js +1 -1
  191. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  192. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  193. package/views/3d/webgl-engine/lib/WebGLLayer.js +1 -1
  194. package/views/3d/webgl-engine/lib/triangleIntersectionUtils.js +1 -1
  195. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  196. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  197. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  198. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  199. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  200. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  201. package/views/3d/webgl-engine/materials/SlicePlaneMaterial.js +1 -1
  202. package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
  203. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  204. package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
  205. package/views/3d/webgl-engine/shaders/HighlightApply.glsl.js +1 -1
  206. package/views/3d/webgl-engine/shaders/HighlightDownsample.glsl.js +1 -1
  207. package/views/3d/webgl-engine/shaders/HighlightToSingle.glsl.js +1 -1
  208. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  209. package/views/3d/webgl-engine/shaders/ShadowHighlight.glsl.js +1 -1
  210. package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
  211. package/views/VideoView.js +1 -1
  212. package/views/interactive/SegmentLabels.js +1 -1
  213. package/views/interactive/coordinateHelper.js +1 -1
  214. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  215. package/views/interactive/sketch/constraints.js +1 -1
  216. package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
  217. package/views/support/geometry3dUtils.js +1 -1
  218. package/views/webgl/ShaderBuilder.js +1 -1
  219. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  220. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  221. package/assets/esri/core/workers/chunks/0e164b19e4ea3aa73843.js +0 -1
  222. package/assets/esri/core/workers/chunks/1034155c525d2b7baaa1.js +0 -1
  223. package/assets/esri/core/workers/chunks/2b9ce6648823f6962f58.js +0 -1
  224. package/assets/esri/core/workers/chunks/88a7780b1c689afff8bd.js +0 -1
  225. package/assets/esri/core/workers/chunks/ac6b582ca180210e596c.js +0 -1
  226. package/assets/esri/core/workers/chunks/accd0661a6dd297fab6b.js +0 -1
  227. package/assets/esri/core/workers/chunks/b5f44cf03c4e5cc07bc4.js +0 -1
  228. package/assets/esri/core/workers/chunks/bfbb118ae3b4a4ce1c74.js +0 -319
  229. package/assets/esri/core/workers/chunks/fa7ddf3c89cdb8052b26.js +0 -1
  230. package/chunks/BloomDepthAdjust.glsl.js +0 -14
  231. package/views/2d/engine/vectorTiles/decluttering/jobs.js +0 -5
  232. package/views/2d/engine/webgl/collisions/CollisionEngine.js +0 -5
  233. package/views/2d/engine/webgl/collisions/CollisionGrid.js +0 -5
  234. package/views/3d/webgl-engine/core/shaderModules/TextureCubeBindUniform.js +0 -5
  235. package/views/3d/webgl-engine/core/shaderModules/UintTexture2DDrawUniform.js +0 -5
  236. package/views/3d/webgl-engine/effects/bloom/BloomDepthAdjust.glsl.js +0 -5
  237. package/views/3d/webgl-engine/effects/bloom/BloomDepthAdjustTechnique.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../Graphic.js";import r from"../../PopupTemplate.js";import s from"../../core/Clonable.js";import o from"../../core/JSONSupport.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{reader as a}from"../../core/accessorSupport/decorators/reader.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import{writer as l}from"../../core/accessorSupport/decorators/writer.js";import u from"../../geometry/Point.js";import{getPrefixedProperties as d,setPrefixedProperties as n,toKebabImpedanceAttributes as m,fromKebabImpedanceAttributes as c}from"../route/utils.js";import{barrierTypeJsonMap as y,curbApproachJsonMap as b,fullEdgeJsonMap as h,statusJsonMap as j,sideOfEdgeJsonMap as g}from"./networkEnums.js";import{symbolTypes as f}from"../../symbols/support/typeUtils.js";var C;let S=class extends(s.ClonableMixin(o)){static{C=this}constructor(t){super(t),this.addedCost=null,this.barrierType=null,this.costs=null,this.curbApproach=null,this.fullEdge=null,this.geometry=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.sideOfEdge=null,this.sourceId=null,this.sourceOid=null,this.status=null,this.symbol=null,this.type="point-barrier"}readCosts(t,e){return d(e.attributes,"Attr_")}writeCosts(t,e){n(t,e,"Attr_")}static{this.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"AddedCost",alias:"Added Cost",type:"esriFieldTypeDouble"},{name:"BarrierType",alias:"Barrier Type",type:"esriFieldTypeInteger"},{name:"Costs",alias:"Costs",type:"esriFieldTypeString"},{name:"CurbApproach",alias:"Curb Approach",type:"esriFieldTypeInteger"},{name:"FullEdge",alias:"Full Edge",type:"esriFieldTypeInteger"},{name:"Name",alias:"Name",type:"esriFieldTypeString"},{name:"Status",alias:"Status",type:"esriFieldTypeInteger"}]}static fromGraphic(t){return new C({addedCost:t.attributes.AddedCost??null,barrierType:null!=t.attributes.BarrierType?y.fromJSON(t.attributes.BarrierType):null,costs:null!=t.attributes.Costs?m(JSON.parse(t.attributes.Costs)):null,curbApproach:null!=t.attributes.CurbApproach?b.fromJSON(t.attributes.CurbApproach):null,fullEdge:null!=t.attributes.FullEdge?h.fromJSON(t.attributes.FullEdge):null,geometry:t.geometry,name:t.attributes.Name??null,objectId:t.attributes.ObjectID??t.attributes.__OBJECTID,popupTemplate:t.popupTemplate,status:null!=t.attributes.Status?j.fromJSON(t.attributes.Status):null,symbol:t.symbol})}toGraphic(){const t={ObjectID:this.objectId,AddedCost:this.addedCost,BarrierType:null!=this.barrierType?y.toJSON(this.barrierType):null,Costs:null!=this.costs?JSON.stringify(c(this.costs)):null,CurbApproach:null!=this.curbApproach?b.toJSON(this.curbApproach):null,FullEdge:null!=this.fullEdge?h.toJSON(this.fullEdge):null,Name:this.name,Status:null!=this.status?j.toJSON(this.status):null};return new e({geometry:this.geometry,attributes:t,symbol:this.symbol,popupTemplate:this.popupTemplate})}};t([i()],S.prototype,"addedCost",void 0),t([i({type:y.apiValues,json:{name:"attributes.BarrierType",read:{reader:y.read},write:{writer:y.write}}})],S.prototype,"barrierType",void 0),t([i()],S.prototype,"costs",void 0),t([a("costs",["attributes"])],S.prototype,"readCosts",null),t([l("costs")],S.prototype,"writeCosts",null),t([i({type:b.apiValues,json:{read:{source:"attributes.CurbApproach",reader:b.read}}})],S.prototype,"curbApproach",void 0),t([i({type:h.apiValues,json:{name:"attributes.FullEdge",read:{reader:h.read},write:{writer:h.write}}})],S.prototype,"fullEdge",void 0),t([i({type:u,json:{write:!0}})],S.prototype,"geometry",void 0),t([i({json:{name:"attributes.Name"}})],S.prototype,"name",void 0),t([i({json:{name:"attributes.ObjectID"}})],S.prototype,"objectId",void 0),t([i({type:r})],S.prototype,"popupTemplate",void 0),t([i({type:g.apiValues,json:{read:{source:"attributes.SideOfEdge",reader:g.read}}})],S.prototype,"sideOfEdge",void 0),t([i({json:{read:{source:"attributes.SourceID"}}})],S.prototype,"sourceId",void 0),t([i({json:{read:{source:"attributes.SourceOID"}}})],S.prototype,"sourceOid",void 0),t([i({type:j.apiValues,json:{read:{source:"attributes.Status",reader:j.read}}})],S.prototype,"status",void 0),t([i({types:f})],S.prototype,"symbol",void 0),t([i({readOnly:!0,json:{read:!1}})],S.prototype,"type",void 0),S=C=t([p("esri.rest.support.PointBarrier")],S);const T=S;export{T as default};
5
+ import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../Graphic.js";import r from"../../PopupTemplate.js";import s from"../../core/Clonable.js";import o from"../../core/JSONSupport.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{reader as a}from"../../core/accessorSupport/decorators/reader.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import{writer as l}from"../../core/accessorSupport/decorators/writer.js";import u from"../../geometry/Point.js";import{getPrefixedProperties as d,setPrefixedProperties as n,toKebabImpedanceAttributes as m,fromKebabImpedanceAttributes as c}from"../route/utils.js";import{barrierTypeJsonMap as y,curbApproachJsonMap as b,fullEdgeJsonMap as h,statusJsonMap as j,sideOfEdgeJsonMap as g}from"./networkEnums.js";import{symbolTypes as f}from"../../symbols/support/typeUtils.js";var C;let S=class extends(s.ClonableMixin(o)){static{C=this}constructor(t){super(t),this.addedCost=null,this.barrierType=null,this.costs=null,this.curbApproach=null,this.fullEdge=null,this.geometry=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.sideOfEdge=null,this.sourceId=null,this.sourceOid=null,this.status=null,this.symbol=null,this.type="point-barrier"}readCosts(t,e){return d(e.attributes,"Attr_")}writeCosts(t,e){n(t,e,"Attr_")}static{this.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"AddedCost",alias:"Added Cost",type:"esriFieldTypeDouble"},{name:"BarrierType",alias:"Barrier Type",type:"esriFieldTypeInteger"},{name:"Costs",alias:"Costs",type:"esriFieldTypeString"},{name:"CurbApproach",alias:"Curb Approach",type:"esriFieldTypeInteger"},{name:"FullEdge",alias:"Full Edge",type:"esriFieldTypeInteger"},{name:"Name",alias:"Name",type:"esriFieldTypeString"},{name:"Status",alias:"Status",type:"esriFieldTypeInteger"}]}static fromGraphic(t){return new C({addedCost:t.attributes.AddedCost??null,barrierType:null!=t.attributes.BarrierType?y.fromJSON(t.attributes.BarrierType):null,costs:null!=t.attributes.Costs?m(JSON.parse(t.attributes.Costs)):null,curbApproach:null!=t.attributes.CurbApproach?b.fromJSON(t.attributes.CurbApproach):null,fullEdge:null!=t.attributes.FullEdge?h.fromJSON(t.attributes.FullEdge):null,geometry:t.geometry,name:t.attributes.Name??null,objectId:t.attributes.ObjectID??t.attributes.__OBJECTID,popupTemplate:t.popupTemplate,status:null!=t.attributes.Status?j.fromJSON(t.attributes.Status):null,symbol:t.symbol})}toGraphic(){const t={ObjectID:this.objectId,AddedCost:this.addedCost,BarrierType:this.barrierType?y.toJSON(this.barrierType):null,Costs:this.costs?JSON.stringify(c(this.costs)):null,CurbApproach:this.curbApproach?b.toJSON(this.curbApproach):null,FullEdge:this.fullEdge?h.toJSON(this.fullEdge):null,Name:this.name,Status:this.status?j.toJSON(this.status):null};return new e({geometry:this.geometry,attributes:t,symbol:this.symbol,popupTemplate:this.popupTemplate})}};t([i()],S.prototype,"addedCost",void 0),t([i({type:y.apiValues,json:{name:"attributes.BarrierType",read:{reader:y.read},write:{writer:y.write}}})],S.prototype,"barrierType",void 0),t([i()],S.prototype,"costs",void 0),t([a("costs",["attributes"])],S.prototype,"readCosts",null),t([l("costs")],S.prototype,"writeCosts",null),t([i({type:b.apiValues,json:{read:{source:"attributes.CurbApproach",reader:b.read}}})],S.prototype,"curbApproach",void 0),t([i({type:h.apiValues,json:{name:"attributes.FullEdge",read:{reader:h.read},write:{writer:h.write}}})],S.prototype,"fullEdge",void 0),t([i({type:u,json:{write:!0}})],S.prototype,"geometry",void 0),t([i({json:{name:"attributes.Name"}})],S.prototype,"name",void 0),t([i({json:{name:"attributes.ObjectID"}})],S.prototype,"objectId",void 0),t([i({type:r})],S.prototype,"popupTemplate",void 0),t([i({type:g.apiValues,json:{read:{source:"attributes.SideOfEdge",reader:g.read}}})],S.prototype,"sideOfEdge",void 0),t([i({json:{read:{source:"attributes.SourceID"}}})],S.prototype,"sourceId",void 0),t([i({json:{read:{source:"attributes.SourceOID"}}})],S.prototype,"sourceOid",void 0),t([i({type:j.apiValues,json:{read:{source:"attributes.Status",reader:j.read}}})],S.prototype,"status",void 0),t([i({types:f})],S.prototype,"symbol",void 0),t([i({readOnly:!0,json:{read:!1}})],S.prototype,"type",void 0),S=C=t([p("esri.rest.support.PointBarrier")],S);const T=S;export{T as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../Graphic.js";import r from"../../PopupTemplate.js";import o from"../../core/Clonable.js";import s from"../../core/JSONSupport.js";import{property as p}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{reader as i}from"../../core/accessorSupport/decorators/reader.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{writer as l}from"../../core/accessorSupport/decorators/writer.js";import m from"../../geometry/Polygon.js";import{getPrefixedProperties as c,setPrefixedProperties as n,toKebabImpedanceAttributes as u,fromKebabImpedanceAttributes as y}from"../route/utils.js";import{barrierTypeJsonMap as b}from"./networkEnums.js";import{symbolTypes as d}from"../../symbols/support/typeUtils.js";var j;let h=class extends(o.ClonableMixin(s)){static{j=this}constructor(t){super(t),this.barrierType=null,this.costs=null,this.geometry=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.scaleFactor=null,this.symbol=null,this.type="polygon-barrier"}readCosts(t,e){return c(e.attributes,"Attr_")}writeCosts(t,e){n(t,e,"Attr_")}static{this.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"BarrierType",alias:"Barrier Type",type:"esriFieldTypeInteger"},{name:"Costs",alias:"Costs",type:"esriFieldTypeString"},{name:"Name",alias:"Name",type:"esriFieldTypeString"},{name:"ScaleFactor",alias:"Scale Factor",type:"esriFieldTypeDouble"}]}static fromGraphic(t){return new j({barrierType:null!=t.attributes.BarrierType?b.fromJSON(t.attributes.BarrierType):null,costs:null!=t.attributes.Costs?u(JSON.parse(t.attributes.Costs)):null,geometry:t.geometry,name:t.attributes.Name??null,objectId:t.attributes.ObjectID??t.attributes.__OBJECTID,popupTemplate:t.popupTemplate,scaleFactor:t.attributes.ScaleFactor??null,symbol:t.symbol})}toGraphic(){const t={ObjectID:this.objectId,BarrierType:null!=this.barrierType?b.toJSON(this.barrierType):null,Costs:null!=this.costs?JSON.stringify(y(this.costs)):null,Name:this.name??null,ScaleFactor:this.scaleFactor??null};return new e({geometry:this.geometry,attributes:t,symbol:this.symbol,popupTemplate:this.popupTemplate})}};t([p({type:b.apiValues,json:{name:"attributes.BarrierType",read:{reader:b.read},write:{writer:b.write}}})],h.prototype,"barrierType",void 0),t([p()],h.prototype,"costs",void 0),t([i("costs",["attributes"])],h.prototype,"readCosts",null),t([l("costs")],h.prototype,"writeCosts",null),t([p({type:m,json:{write:!0}})],h.prototype,"geometry",void 0),t([p({json:{name:"attributes.Name"}})],h.prototype,"name",void 0),t([p({json:{name:"attributes.ObjectID"}})],h.prototype,"objectId",void 0),t([p({type:r})],h.prototype,"popupTemplate",void 0),t([p()],h.prototype,"scaleFactor",void 0),t([p({types:d})],h.prototype,"symbol",void 0),t([p({readOnly:!0,json:{read:!1}})],h.prototype,"type",void 0),h=j=t([a("esri.rest.support.PolygonBarrier")],h);const T=h;export{T as default};
5
+ import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../Graphic.js";import r from"../../PopupTemplate.js";import o from"../../core/Clonable.js";import s from"../../core/JSONSupport.js";import{property as p}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{reader as i}from"../../core/accessorSupport/decorators/reader.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{writer as l}from"../../core/accessorSupport/decorators/writer.js";import m from"../../geometry/Polygon.js";import{getPrefixedProperties as c,setPrefixedProperties as n,toKebabImpedanceAttributes as u,fromKebabImpedanceAttributes as y}from"../route/utils.js";import{barrierTypeJsonMap as b}from"./networkEnums.js";import{symbolTypes as d}from"../../symbols/support/typeUtils.js";var j;let h=class extends(o.ClonableMixin(s)){static{j=this}constructor(t){super(t),this.barrierType=null,this.costs=null,this.geometry=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.scaleFactor=null,this.symbol=null,this.type="polygon-barrier"}readCosts(t,e){return c(e.attributes,"Attr_")}writeCosts(t,e){n(t,e,"Attr_")}static{this.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"BarrierType",alias:"Barrier Type",type:"esriFieldTypeInteger"},{name:"Costs",alias:"Costs",type:"esriFieldTypeString"},{name:"Name",alias:"Name",type:"esriFieldTypeString"},{name:"ScaleFactor",alias:"Scale Factor",type:"esriFieldTypeDouble"}]}static fromGraphic(t){return new j({barrierType:null!=t.attributes.BarrierType?b.fromJSON(t.attributes.BarrierType):null,costs:null!=t.attributes.Costs?u(JSON.parse(t.attributes.Costs)):null,geometry:t.geometry,name:t.attributes.Name??null,objectId:t.attributes.ObjectID??t.attributes.__OBJECTID,popupTemplate:t.popupTemplate,scaleFactor:t.attributes.ScaleFactor??null,symbol:t.symbol})}toGraphic(){const t={ObjectID:this.objectId,BarrierType:this.barrierType?b.toJSON(this.barrierType):null,Costs:this.costs?JSON.stringify(y(this.costs)):null,Name:this.name??null,ScaleFactor:this.scaleFactor??null};return new e({geometry:this.geometry,attributes:t,symbol:this.symbol,popupTemplate:this.popupTemplate})}};t([p({type:b.apiValues,json:{name:"attributes.BarrierType",read:{reader:b.read},write:{writer:b.write}}})],h.prototype,"barrierType",void 0),t([p()],h.prototype,"costs",void 0),t([i("costs",["attributes"])],h.prototype,"readCosts",null),t([l("costs")],h.prototype,"writeCosts",null),t([p({type:m,json:{write:!0}})],h.prototype,"geometry",void 0),t([p({json:{name:"attributes.Name"}})],h.prototype,"name",void 0),t([p({json:{name:"attributes.ObjectID"}})],h.prototype,"objectId",void 0),t([p({type:r})],h.prototype,"popupTemplate",void 0),t([p()],h.prototype,"scaleFactor",void 0),t([p({types:d})],h.prototype,"symbol",void 0),t([p({readOnly:!0,json:{read:!1}})],h.prototype,"type",void 0),h=j=t([a("esri.rest.support.PolygonBarrier")],h);const T=h;export{T as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../Graphic.js";import r from"../../PopupTemplate.js";import o from"../../core/Clonable.js";import s from"../../core/JSONSupport.js";import{property as p}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{reader as a}from"../../core/accessorSupport/decorators/reader.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import l from"../../geometry/Polyline.js";import{getPrefixedProperties as m,toKebabImpedanceAttributes as c,fromKebabImpedanceAttributes as u}from"../route/utils.js";import{barrierTypeJsonMap as n}from"./networkEnums.js";import{symbolTypes as y}from"../../symbols/support/typeUtils.js";var b;let d=class extends(o.ClonableMixin(s)){static{b=this}constructor(t){super(t),this.barrierType=null,this.costs=null,this.geometry=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.scaleFactor=null,this.symbol=null,this.type="polyline-barrier"}readCosts(t,e){return m(e.attributes,"Attr_")}static{this.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"BarrierType",alias:"Barrier Type",type:"esriFieldTypeInteger"},{name:"Costs",alias:"Costs",type:"esriFieldTypeString"},{name:"Name",alias:"Name",type:"esriFieldTypeString"},{name:"ScaleFactor",alias:"Scale Factor",type:"esriFieldTypeDouble"}]}static fromGraphic(t){return new b({barrierType:null!=t.attributes.BarrierType?n.fromJSON(t.attributes.BarrierType):null,costs:null!=t.attributes.Costs?c(JSON.parse(t.attributes.Costs)):null,geometry:t.geometry,name:t.attributes.Name??null,objectId:t.attributes.ObjectID??t.attributes.__OBJECTID,popupTemplate:t.popupTemplate,scaleFactor:t.attributes.ScaleFactor??null,symbol:t.symbol})}toGraphic(){const t={ObjectID:this.objectId,BarrierType:null!=this.barrierType?n.toJSON(this.barrierType):null,Costs:null!=this.costs?JSON.stringify(u(this.costs)):null,Name:this.name,ScaleFactor:this.scaleFactor};return new e({geometry:this.geometry,attributes:t,symbol:this.symbol,popupTemplate:this.popupTemplate})}};t([p({type:n.apiValues,json:{read:{source:"attributes.BarrierType",reader:n.read}}})],d.prototype,"barrierType",void 0),t([p()],d.prototype,"costs",void 0),t([a("costs",["attributes"])],d.prototype,"readCosts",null),t([p({type:l,json:{write:!0}})],d.prototype,"geometry",void 0),t([p({json:{name:"attributes.Name"}})],d.prototype,"name",void 0),t([p({json:{name:"attributes.ObjectID"}})],d.prototype,"objectId",void 0),t([p({type:r})],d.prototype,"popupTemplate",void 0),t([p()],d.prototype,"scaleFactor",void 0),t([p({types:y})],d.prototype,"symbol",void 0),t([p({readOnly:!0,json:{read:!1}})],d.prototype,"type",void 0),d=b=t([i("esri.rest.support.PolylineBarrier")],d);const j=d;export{j as default};
5
+ import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../Graphic.js";import r from"../../PopupTemplate.js";import o from"../../core/Clonable.js";import s from"../../core/JSONSupport.js";import{property as p}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{reader as a}from"../../core/accessorSupport/decorators/reader.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import l from"../../geometry/Polyline.js";import{getPrefixedProperties as m,toKebabImpedanceAttributes as c,fromKebabImpedanceAttributes as u}from"../route/utils.js";import{barrierTypeJsonMap as y}from"./networkEnums.js";import{symbolTypes as n}from"../../symbols/support/typeUtils.js";var b;let d=class extends(o.ClonableMixin(s)){static{b=this}constructor(t){super(t),this.barrierType=null,this.costs=null,this.geometry=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.scaleFactor=null,this.symbol=null,this.type="polyline-barrier"}readCosts(t,e){return m(e.attributes,"Attr_")}static{this.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"BarrierType",alias:"Barrier Type",type:"esriFieldTypeInteger"},{name:"Costs",alias:"Costs",type:"esriFieldTypeString"},{name:"Name",alias:"Name",type:"esriFieldTypeString"},{name:"ScaleFactor",alias:"Scale Factor",type:"esriFieldTypeDouble"}]}static fromGraphic(t){return new b({barrierType:null!=t.attributes.BarrierType?y.fromJSON(t.attributes.BarrierType):null,costs:null!=t.attributes.Costs?c(JSON.parse(t.attributes.Costs)):null,geometry:t.geometry,name:t.attributes.Name??null,objectId:t.attributes.ObjectID??t.attributes.__OBJECTID,popupTemplate:t.popupTemplate,scaleFactor:t.attributes.ScaleFactor??null,symbol:t.symbol})}toGraphic(){const t={ObjectID:this.objectId,BarrierType:this.barrierType?y.toJSON(this.barrierType):null,Costs:this.costs?JSON.stringify(u(this.costs)):null,Name:this.name,ScaleFactor:this.scaleFactor};return new e({geometry:this.geometry,attributes:t,symbol:this.symbol,popupTemplate:this.popupTemplate})}};t([p({type:y.apiValues,json:{read:{source:"attributes.BarrierType",reader:y.read}}})],d.prototype,"barrierType",void 0),t([p()],d.prototype,"costs",void 0),t([a("costs",["attributes"])],d.prototype,"readCosts",null),t([p({type:l,json:{write:!0}})],d.prototype,"geometry",void 0),t([p({json:{name:"attributes.Name"}})],d.prototype,"name",void 0),t([p({json:{name:"attributes.ObjectID"}})],d.prototype,"objectId",void 0),t([p({type:r})],d.prototype,"popupTemplate",void 0),t([p()],d.prototype,"scaleFactor",void 0),t([p({types:n})],d.prototype,"symbol",void 0),t([p({readOnly:!0,json:{read:!1}})],d.prototype,"type",void 0),d=b=t([i("esri.rest.support.PolylineBarrier")],d);const j=d;export{j as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as r}from"../../chunks/tslib.es6.js";import o from"../../core/JSONSupport.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";let e=class extends o{constructor(r){super(r),this.format=null,this.itemId=null,this.url=null}};r([t()],e.prototype,"format",void 0),r([t({json:{read:{source:"itemID"},write:{target:"itemID"}}})],e.prototype,"itemId",void 0),r([t()],e.prototype,"url",void 0),e=r([s("esri.rest.support.RasterData")],e);const p=e;export{p as default};
5
+ import{_ as r}from"../../chunks/tslib.es6.js";import o from"../../core/JSONSupport.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{reader as e}from"../../core/accessorSupport/decorators/reader.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";let p=class extends o{constructor(r){super(r),this.format=null,this.itemId=null,this.type=null,this.url=null}readType(r){return"ImageService"===r?"image-service":null}};r([t()],p.prototype,"format",void 0),r([t({json:{name:"itemID",write:!0}})],p.prototype,"itemId",void 0),r([t()],p.prototype,"type",void 0),r([e("type")],p.prototype,"readType",null),r([t({json:{write:!0}})],p.prototype,"url",void 0),p=r([s("esri.rest.support.RasterData")],p);const i=p;export{i as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../Graphic.js";import s from"../../PopupTemplate.js";import i from"../../core/Clonable.js";import a from"../../core/JSONSupport.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{reader as r}from"../../core/accessorSupport/decorators/reader.js";import{subclass as l}from"../../core/accessorSupport/decorators/subclass.js";import n from"../../geometry/Polyline.js";import{getTimezoneOffset as u,getPrefixedProperties as p,toKebabImpedanceAttributes as m,fromKebabImpedanceAttributes as T}from"../route/utils.js";import d from"./RouteSettings.js";import{symbolTypes as y}from"../../symbols/support/typeUtils.js";var b;let f=class extends(i.ClonableMixin(a)){static{b=this}constructor(t){super(t),this.analysisSettings=null,this.endTime=null,this.endTimeOffset=null,this.firstStopId=null,this.geometry=null,this.lastStopId=null,this.messages=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.startTime=null,this.startTimeOffset=null,this.stopCount=null,this.symbol=null,this.totalCosts=null,this.totalDistance=null,this.totalDuration=null,this.totalLateDuration=null,this.totalViolations=null,this.totalWait=null,this.totalWaitDuration=null,this.type="route-info",this.version="1.0.0"}readEndTime(t,e){return null!=e.attributes.EndTimeUTC?new Date(e.attributes.EndTimeUTC):null}readEndTimeOffset(t,e){return u(e.attributes.EndTime,e.attributes.EndTimeUTC)}readStartTime(t,e){return null!=e.attributes.StartTimeUTC?new Date(e.attributes.StartTimeUTC):null}readStartTimeOffset(t,e){return u(e.attributes.StartTime,e.attributes.StartTimeUTC)}readTotalCosts(t,e){return p(e.attributes,"Total_")}readTotalViolations(t,e){return p(e.attributes,"TotalViolation_")}readTotalWait(t,e){return p(e.attributes,"TotalWait_")}static{this.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"AnalysisSettings",alias:"Analysis Settings",type:"esriFieldTypeString"},{name:"EndTime",alias:"End Time",type:"esriFieldTypeDate"},{name:"EndUTCOffset",alias:"End Time Offset",type:"esriFieldTypeInteger"},{name:"Messages",alias:"Messages",type:"esriFieldTypeString"},{name:"RouteName",alias:"Route Name",type:"esriFieldTypeString"},{name:"StartTime",alias:"Start Time",type:"esriFieldTypeDate"},{name:"StartUTCOffset",alias:"Start Time Offset",type:"esriFieldTypeInteger"},{name:"TotalCosts",alias:"Total Costs",type:"esriFieldTypeString"},{name:"TotalLateMinutes",alias:"Total Late Minutes",type:"esriFieldTypeDouble"},{name:"TotalMeters",alias:"Total Meters",type:"esriFieldTypeDouble"},{name:"TotalMinutes",alias:"Total Minutes",type:"esriFieldTypeDouble"},{name:"TotalWaitMinutes",alias:"Total Wait Minutes",type:"esriFieldTypeDouble"},{name:"Version",alias:"Version",type:"esriFieldTypeString"}]}static fromGraphic(t){return new b({analysisSettings:null!=t.attributes.AnalysisSettings?d.fromJSON(JSON.parse(t.attributes.AnalysisSettings)):null,endTime:null!=t.attributes.EndTime?new Date(t.attributes.EndTime):null,endTimeOffset:t.attributes.EndUTCOffset??null,geometry:t.geometry,messages:null!=t.attributes.Messages?JSON.parse(t.attributes.Messages):null,name:t.attributes.RouteName,objectId:t.attributes.ObjectID??t.attributes.__OBJECTID,popupTemplate:t.popupTemplate,startTime:null!=t.attributes.StartTime?new Date(t.attributes.StartTime):null,startTimeOffset:t.attributes.StartUTCOffset??null,symbol:t.symbol,totalCosts:null!=t.attributes.TotalCosts?m(JSON.parse(t.attributes.TotalCosts)):null,totalDistance:t.attributes.TotalMeters??null,totalDuration:t.attributes.TotalMinutes??null,totalLateDuration:t.attributes.TotalLateMinutes??null,totalWaitDuration:t.attributes.TotalWaitMinutes??null,version:t.attributes.Version})}toGraphic(){const t={ObjectID:this.objectId,AnalysisSettings:null!=this.analysisSettings?JSON.stringify(this.analysisSettings.toJSON()):null,EndTime:null!=this.endTime?this.endTime.getTime():null,EndUTCOffset:this.endTimeOffset,Messages:null!=this.messages?JSON.stringify(this.messages):null,RouteName:this.name,StartTime:null!=this.startTime?this.startTime.getTime():null,StartUTCOffset:this.startTimeOffset,TotalCosts:null!=this.totalCosts?JSON.stringify(T(this.totalCosts)):null,TotalLateMinutes:this.totalLateDuration,TotalMeters:this.totalDistance,TotalMinutes:this.totalDuration,TotalWaitMinutes:this.totalWaitDuration,Version:this.version};return new e({geometry:this.geometry,attributes:t,symbol:this.symbol,popupTemplate:this.popupTemplate})}};t([o()],f.prototype,"analysisSettings",void 0),t([o({type:Date})],f.prototype,"endTime",void 0),t([r("endTime",["attributes.EndTimeUTC"])],f.prototype,"readEndTime",null),t([o()],f.prototype,"endTimeOffset",void 0),t([r("endTimeOffset",["attributes.EndTime","attributes.EndTimeUTC"])],f.prototype,"readEndTimeOffset",null),t([o({json:{read:{source:"attributes.FirstStopID"}}})],f.prototype,"firstStopId",void 0),t([o({type:n})],f.prototype,"geometry",void 0),t([o({json:{read:{source:"attributes.LastStopID"}}})],f.prototype,"lastStopId",void 0),t([o()],f.prototype,"messages",void 0),t([o({json:{read:{source:"attributes.Name"}}})],f.prototype,"name",void 0),t([o({json:{read:{source:"attributes.ObjectID"}}})],f.prototype,"objectId",void 0),t([o({type:s})],f.prototype,"popupTemplate",void 0),t([o({type:Date})],f.prototype,"startTime",void 0),t([r("startTime",["attributes.StartTimeUTC"])],f.prototype,"readStartTime",null),t([o()],f.prototype,"startTimeOffset",void 0),t([r("startTimeOffset",["attributes.StartTime","attributes.StartTimeUTC"])],f.prototype,"readStartTimeOffset",null),t([o({json:{read:{source:"attributes.StopCount"}}})],f.prototype,"stopCount",void 0),t([o({types:y})],f.prototype,"symbol",void 0),t([o()],f.prototype,"totalCosts",void 0),t([r("totalCosts",["attributes"])],f.prototype,"readTotalCosts",null),t([o()],f.prototype,"totalDistance",void 0),t([o()],f.prototype,"totalDuration",void 0),t([o()],f.prototype,"totalLateDuration",void 0),t([o()],f.prototype,"totalViolations",void 0),t([r("totalViolations",["attributes"])],f.prototype,"readTotalViolations",null),t([o()],f.prototype,"totalWait",void 0),t([r("totalWait",["attributes"])],f.prototype,"readTotalWait",null),t([o()],f.prototype,"totalWaitDuration",void 0),t([o({readOnly:!0,json:{read:!1}})],f.prototype,"type",void 0),t([o()],f.prototype,"version",void 0),f=b=t([l("esri.rest.support.RouteInfo")],f);const S=f;export{S as default};
5
+ import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../Graphic.js";import s from"../../PopupTemplate.js";import i from"../../core/Clonable.js";import a from"../../core/JSONSupport.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{reader as r}from"../../core/accessorSupport/decorators/reader.js";import{subclass as l}from"../../core/accessorSupport/decorators/subclass.js";import n from"../../geometry/Polyline.js";import{getTimezoneOffset as u,getPrefixedProperties as p,toKebabImpedanceAttributes as m,fromKebabImpedanceAttributes as T}from"../route/utils.js";import d from"./RouteSettings.js";import{symbolTypes as y}from"../../symbols/support/typeUtils.js";var b;let f=class extends(i.ClonableMixin(a)){static{b=this}constructor(t){super(t),this.analysisSettings=null,this.endTime=null,this.endTimeOffset=null,this.firstStopId=null,this.geometry=null,this.lastStopId=null,this.messages=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.startTime=null,this.startTimeOffset=null,this.stopCount=null,this.symbol=null,this.totalCosts=null,this.totalDistance=null,this.totalDuration=null,this.totalLateDuration=null,this.totalViolations=null,this.totalWait=null,this.totalWaitDuration=null,this.type="route-info",this.version="1.0.0"}readEndTime(t,e){return null!=e.attributes.EndTimeUTC?new Date(e.attributes.EndTimeUTC):null}readEndTimeOffset(t,e){return u(e.attributes.EndTime,e.attributes.EndTimeUTC)}readStartTime(t,e){return null!=e.attributes.StartTimeUTC?new Date(e.attributes.StartTimeUTC):null}readStartTimeOffset(t,e){return u(e.attributes.StartTime,e.attributes.StartTimeUTC)}readTotalCosts(t,e){return p(e.attributes,"Total_")}readTotalViolations(t,e){return p(e.attributes,"TotalViolation_")}readTotalWait(t,e){return p(e.attributes,"TotalWait_")}static{this.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"AnalysisSettings",alias:"Analysis Settings",type:"esriFieldTypeString"},{name:"EndTime",alias:"End Time",type:"esriFieldTypeDate"},{name:"EndUTCOffset",alias:"End Time Offset",type:"esriFieldTypeInteger"},{name:"Messages",alias:"Messages",type:"esriFieldTypeString"},{name:"RouteName",alias:"Route Name",type:"esriFieldTypeString"},{name:"StartTime",alias:"Start Time",type:"esriFieldTypeDate"},{name:"StartUTCOffset",alias:"Start Time Offset",type:"esriFieldTypeInteger"},{name:"TotalCosts",alias:"Total Costs",type:"esriFieldTypeString"},{name:"TotalLateMinutes",alias:"Total Late Minutes",type:"esriFieldTypeDouble"},{name:"TotalMeters",alias:"Total Meters",type:"esriFieldTypeDouble"},{name:"TotalMinutes",alias:"Total Minutes",type:"esriFieldTypeDouble"},{name:"TotalWaitMinutes",alias:"Total Wait Minutes",type:"esriFieldTypeDouble"},{name:"Version",alias:"Version",type:"esriFieldTypeString"}]}static fromGraphic(t){return new b({analysisSettings:null!=t.attributes.AnalysisSettings?d.fromJSON(JSON.parse(t.attributes.AnalysisSettings)):null,endTime:null!=t.attributes.EndTime?new Date(t.attributes.EndTime):null,endTimeOffset:t.attributes.EndUTCOffset??null,geometry:t.geometry,messages:null!=t.attributes.Messages?JSON.parse(t.attributes.Messages):null,name:t.attributes.RouteName,objectId:t.attributes.ObjectID??t.attributes.__OBJECTID,popupTemplate:t.popupTemplate,startTime:null!=t.attributes.StartTime?new Date(t.attributes.StartTime):null,startTimeOffset:t.attributes.StartUTCOffset??null,symbol:t.symbol,totalCosts:null!=t.attributes.TotalCosts?m(JSON.parse(t.attributes.TotalCosts)):null,totalDistance:t.attributes.TotalMeters??null,totalDuration:t.attributes.TotalMinutes??null,totalLateDuration:t.attributes.TotalLateMinutes??null,totalWaitDuration:t.attributes.TotalWaitMinutes??null,version:t.attributes.Version})}toGraphic(){const t={ObjectID:this.objectId,AnalysisSettings:this.analysisSettings?JSON.stringify(this.analysisSettings.toJSON()):null,EndTime:this.endTime?.getTime()??null,EndUTCOffset:this.endTimeOffset,Messages:this.messages?JSON.stringify(this.messages):null,RouteName:this.name,StartTime:this.startTime?.getTime()??null,StartUTCOffset:this.startTimeOffset,TotalCosts:this.totalCosts?JSON.stringify(T(this.totalCosts)):null,TotalLateMinutes:this.totalLateDuration,TotalMeters:this.totalDistance,TotalMinutes:this.totalDuration,TotalWaitMinutes:this.totalWaitDuration,Version:this.version};return new e({geometry:this.geometry,attributes:t,symbol:this.symbol,popupTemplate:this.popupTemplate})}};t([o()],f.prototype,"analysisSettings",void 0),t([o({type:Date})],f.prototype,"endTime",void 0),t([r("endTime",["attributes.EndTimeUTC"])],f.prototype,"readEndTime",null),t([o()],f.prototype,"endTimeOffset",void 0),t([r("endTimeOffset",["attributes.EndTime","attributes.EndTimeUTC"])],f.prototype,"readEndTimeOffset",null),t([o({json:{read:{source:"attributes.FirstStopID"}}})],f.prototype,"firstStopId",void 0),t([o({type:n})],f.prototype,"geometry",void 0),t([o({json:{read:{source:"attributes.LastStopID"}}})],f.prototype,"lastStopId",void 0),t([o()],f.prototype,"messages",void 0),t([o({json:{read:{source:"attributes.Name"}}})],f.prototype,"name",void 0),t([o({json:{read:{source:"attributes.ObjectID"}}})],f.prototype,"objectId",void 0),t([o({type:s})],f.prototype,"popupTemplate",void 0),t([o({type:Date})],f.prototype,"startTime",void 0),t([r("startTime",["attributes.StartTimeUTC"])],f.prototype,"readStartTime",null),t([o()],f.prototype,"startTimeOffset",void 0),t([r("startTimeOffset",["attributes.StartTime","attributes.StartTimeUTC"])],f.prototype,"readStartTimeOffset",null),t([o({json:{read:{source:"attributes.StopCount"}}})],f.prototype,"stopCount",void 0),t([o({types:y})],f.prototype,"symbol",void 0),t([o()],f.prototype,"totalCosts",void 0),t([r("totalCosts",["attributes"])],f.prototype,"readTotalCosts",null),t([o()],f.prototype,"totalDistance",void 0),t([o()],f.prototype,"totalDuration",void 0),t([o()],f.prototype,"totalLateDuration",void 0),t([o()],f.prototype,"totalViolations",void 0),t([r("totalViolations",["attributes"])],f.prototype,"readTotalViolations",null),t([o()],f.prototype,"totalWait",void 0),t([r("totalWait",["attributes"])],f.prototype,"readTotalWait",null),t([o()],f.prototype,"totalWaitDuration",void 0),t([o({readOnly:!0,json:{read:!1}})],f.prototype,"type",void 0),t([o()],f.prototype,"version",void 0),f=b=t([l("esri.rest.support.RouteInfo")],f);const S=f;export{S as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import i from"../../PopupTemplate.js";import r from"../../core/Clonable.js";import a from"../../core/JSONSupport.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{reader as o}from"../../core/accessorSupport/decorators/reader.js";import{subclass as u}from"../../core/accessorSupport/decorators/subclass.js";import{writer as n}from"../../core/accessorSupport/decorators/writer.js";import l from"../../geometry/Point.js";import{getTimezoneOffset as p,getPrefixedProperties as m,setPrefixedProperties as d,toKebabImpedanceAttributes as c,fromKebabImpedanceAttributes as v}from"../route/utils.js";import{curbApproachJsonMap as y,locationTypeJsonMap as T,statusJsonMap as b,sideOfEdgeJsonMap as h}from"./networkEnums.js";import{symbolTypes as f}from"../../symbols/support/typeUtils.js";var C;let S=class extends(r.ClonableMixin(a)){static{C=this}constructor(e){super(e),this.arriveCurbApproach=null,this.arriveTime=null,this.arriveTimeOffset=null,this.bearing=null,this.bearingTol=null,this.cumulativeCosts=null,this.cumulativeDistance=null,this.cumulativeDuration=null,this.curbApproach=null,this.departCurbApproach=null,this.departTime=null,this.departTimeOffset=null,this.distanceToNetworkInMeters=null,this.geometry=null,this.lateDuration=null,this.locationType=null,this.name=null,this.navLatency=null,this.objectId=null,this.popupTemplate=null,this.posAlong=null,this.routeName=null,this.serviceCosts=null,this.serviceDistance=null,this.serviceDuration=null,this.sequence=null,this.sideOfEdge=null,this.snapX=null,this.snapY=null,this.snapZ=null,this.sourceId=null,this.sourceOid=null,this.status=null,this.symbol=null,this.timeWindowEnd=null,this.timeWindowEndOffset=null,this.timeWindowStart=null,this.timeWindowStartOffset=null,this.type="stop",this.violations=null,this.waitDuration=null,this.wait=null}readArriveTimeOffset(e,t){return p(t.attributes.ArriveTime,t.attributes.ArriveTimeUTC)}readCumulativeCosts(e,t){return m(t.attributes,"Cumul_")}readDepartTimeOffset(e,t){return p(t.attributes.DepartTime,t.attributes.DepartTimeUTC)}readServiceCosts(e,t){return m(t.attributes,"Attr_")}writeServiceCosts(e,t){d(e,t,"Attr_")}writeTimeWindowEnd(e,t){null!=e&&(t.attributes||(t.attributes={}),t.attributes.TimeWindowEnd=e.getTime())}writeTimeWindowStart(e,t){null!=e&&(t.attributes||(t.attributes={}),t.attributes.TimeWindowStart=e.getTime())}readViolations(e,t){return m(t.attributes,"Violation_")}readWait(e,t){return m(t.attributes,"Wait_")}static{this.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"ArrivalCurbApproach",alias:"Arrival Curb Approach",type:"esriFieldTypeInteger"},{name:"ArrivalTime",alias:"Arrival Time",type:"esriFieldTypeDate"},{name:"ArrivalUTCOffset",alias:"Arrival Time",type:"esriFieldTypeInteger"},{name:"CumulativeCosts",alias:"Cumulative Costs",type:"esriFieldTypeString"},{name:"CumulativeMeters",alias:"Cumulative Meters",type:"esriFieldTypeDouble"},{name:"CumulativeMinutes",alias:"Cumulative Minutes",type:"esriFieldTypeDouble"},{name:"CurbApproach",alias:"Curb Approach",type:"esriFieldTypeInteger"},{name:"DepartureCurbApproach",alias:"Departure Curb Approach",type:"esriFieldTypeInteger"},{name:"DepartureTime",alias:"Departure Time",type:"esriFieldTypeDate"},{name:"DepartureUTCOffset",alias:"Departure Time",type:"esriFieldTypeInteger"},{name:"LateMinutes",alias:"Minutes Late",type:"esriFieldTypeDouble"},{name:"LocationType",alias:"Location Type",type:"esriFieldTypeInteger"},{name:"Name",alias:"Name",type:"esriFieldTypeString"},{name:"RouteName",alias:"Route Name",type:"esriFieldTypeString"},{name:"Sequence",alias:"Sequence",type:"esriFieldTypeInteger"},{name:"ServiceCosts",alias:"Service Costs",type:"esriFieldTypeString"},{name:"ServiceMeters",alias:"Service Meters",type:"esriFieldTypeDouble"},{name:"ServiceMinutes",alias:"Service Minutes",type:"esriFieldTypeDouble"},{name:"Status",alias:"Status",type:"esriFieldTypeInteger"},{name:"TimeWindowEnd",alias:"Time Window End",type:"esriFieldTypeDate"},{name:"TimeWindowEndUTCOffset",alias:"Time Window End Offset",type:"esriFieldTypeInteger"},{name:"TimeWindowStart",alias:"Time Window Start",type:"esriFieldTypeDate"},{name:"TimeWindowStartUTCOffset",alias:"Time Window Start Offset",type:"esriFieldTypeInteger"},{name:"WaitMinutes",alias:"Minutes Wait",type:"esriFieldTypeDouble"}]}static fromGraphic(e){return new C({arriveCurbApproach:null!=e.attributes.ArrivalCurbApproach?y.fromJSON(e.attributes.ArrivalCurbApproach):null,arriveTime:null!=e.attributes.ArrivalTime?new Date(e.attributes.ArrivalTime):null,arriveTimeOffset:e.attributes.ArrivalUTCOffset,cumulativeCosts:null!=e.attributes.CumulativeCosts?c(JSON.parse(e.attributes.CumulativeCosts)):null,cumulativeDistance:e.attributes.CumulativeMeters??null,cumulativeDuration:e.attributes.CumulativeMinutes??null,curbApproach:null!=e.attributes.CurbApproach?y.fromJSON(e.attributes.CurbApproach):null,departCurbApproach:null!=e.attributes.DepartureCurbApproach?y.fromJSON(e.attributes.DepartureCurbApproach):null,departTime:null!=e.attributes.DepartureTime?new Date(e.attributes.DepartureTime):null,departTimeOffset:e.attributes.DepartureUTCOffset??null,geometry:e.geometry,lateDuration:e.attributes.LateMinutes??null,locationType:null!=e.attributes.LocationType?T.fromJSON(e.attributes.LocationType):null,name:e.attributes.Name,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,routeName:e.attributes.RouteName,sequence:e.attributes.Sequence??null,serviceCosts:null!=e.attributes.ServiceCosts?c(JSON.parse(e.attributes.ServiceCosts)):null,serviceDistance:e.attributes.ServiceMeters??null,serviceDuration:e.attributes.ServiceMinutes??null,status:null!=e.attributes.Status?b.fromJSON(e.attributes.Status):null,symbol:e.symbol,timeWindowEnd:null!=e.attributes.TimeWindowEnd?new Date(e.attributes.TimeWindowEnd):null,timeWindowEndOffset:e.attributes.TimeWindowEndUTCOffset??null,timeWindowStart:null!=e.attributes.TimeWindowStart?new Date(e.attributes.TimeWindowStart):null,timeWindowStartOffset:e.attributes.TimeWindowStartUTCOffset??null,waitDuration:e.attributes.WaitMinutes??null})}toGraphic(){const e={ObjectID:this.objectId,ArrivalCurbApproach:null!=this.arriveCurbApproach?y.toJSON(this.arriveCurbApproach):null,ArrivalTime:null!=this.arriveTime?this.arriveTime.getTime():null,ArrivalUTCOffset:this.arriveTimeOffset,CumulativeCosts:null!=this.cumulativeCosts?JSON.stringify(v(this.cumulativeCosts)):null,CumulativeMeters:this.cumulativeDistance,CumulativeMinutes:this.cumulativeDuration,CurbApproach:null!=this.curbApproach?y.toJSON(this.curbApproach):null,DepartureCurbApproach:null!=this.departCurbApproach?y.toJSON(this.departCurbApproach):null,DepartureTime:null!=this.departTime?this.departTime.getTime():null,DepartureUTCOffset:this.departTimeOffset,LateMinutes:this.lateDuration,LocationType:null!=this.locationType?T.toJSON(this.locationType):null,Name:this.name,RouteName:this.routeName,Sequence:this.sequence,ServiceCosts:null!=this.serviceCosts?JSON.stringify(v(this.serviceCosts)):null,ServiceMeters:this.serviceDistance,ServiceMinutes:this.serviceDuration,Status:null!=this.status?b.toJSON(this.status):null,TimeWindowEnd:null!=this.timeWindowEnd?this.timeWindowEnd.getTime():null,TimeWindowEndUTCOffset:this.timeWindowEndOffset??this.arriveTimeOffset,TimeWindowStart:null!=this.timeWindowStart?this.timeWindowStart.getTime():null,TimeWindowStartUTCOffset:this.timeWindowStartOffset??this.arriveTimeOffset,WaitMinutes:this.waitDuration};return new t({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};e([s({type:y.apiValues,json:{read:{source:"attributes.ArrivalCurbApproach",reader:y.read}}})],S.prototype,"arriveCurbApproach",void 0),e([s({type:Date,json:{read:{source:"attributes.ArriveTimeUTC"}}})],S.prototype,"arriveTime",void 0),e([s()],S.prototype,"arriveTimeOffset",void 0),e([o("arriveTimeOffset",["attributes.ArriveTime","attributes.ArriveTimeUTC"])],S.prototype,"readArriveTimeOffset",null),e([s({json:{name:"attributes.Bearing",read:!1,write:!0}})],S.prototype,"bearing",void 0),e([s({json:{name:"attributes.BearingTol",read:!1,write:!0}})],S.prototype,"bearingTol",void 0),e([s()],S.prototype,"cumulativeCosts",void 0),e([o("cumulativeCosts",["attributes"])],S.prototype,"readCumulativeCosts",null),e([s()],S.prototype,"cumulativeDistance",void 0),e([s()],S.prototype,"cumulativeDuration",void 0),e([s({type:y.apiValues,json:{name:"attributes.CurbApproach",read:{reader:y.read},write:{writer:y.write}}})],S.prototype,"curbApproach",void 0),e([s({type:y.apiValues,json:{read:{source:"attributes.DepartCurbApproach",reader:y.read}}})],S.prototype,"departCurbApproach",void 0),e([s({type:Date,json:{read:{source:"attributes.DepartTimeUTC"}}})],S.prototype,"departTime",void 0),e([s()],S.prototype,"departTimeOffset",void 0),e([o("departTimeOffset",["attributes.DepartTime","attributes.DepartTimeUTC"])],S.prototype,"readDepartTimeOffset",null),e([s({json:{read:{source:"attributes.DistanceToNetworkInMeters"}}})],S.prototype,"distanceToNetworkInMeters",void 0),e([s({type:l,json:{write:!0}})],S.prototype,"geometry",void 0),e([s()],S.prototype,"lateDuration",void 0),e([s({type:T.apiValues,json:{name:"attributes.LocationType",read:{reader:T.read},write:{writer:T.write}}})],S.prototype,"locationType",void 0),e([s({json:{name:"attributes.Name"}})],S.prototype,"name",void 0),e([s({json:{name:"attributes.NavLatency",read:!1,write:!0}})],S.prototype,"navLatency",void 0),e([s({json:{name:"attributes.ObjectID"}})],S.prototype,"objectId",void 0),e([s({type:i})],S.prototype,"popupTemplate",void 0),e([s({json:{read:{source:"attributes.PosAlong"}}})],S.prototype,"posAlong",void 0),e([s({json:{name:"attributes.RouteName"}})],S.prototype,"routeName",void 0),e([s()],S.prototype,"serviceCosts",void 0),e([o("serviceCosts",["attributes"])],S.prototype,"readServiceCosts",null),e([n("serviceCosts")],S.prototype,"writeServiceCosts",null),e([s()],S.prototype,"serviceDistance",void 0),e([s()],S.prototype,"serviceDuration",void 0),e([s({json:{name:"attributes.Sequence"}})],S.prototype,"sequence",void 0),e([s({type:h.apiValues,json:{read:{source:"attributes.SideOfEdge",reader:h.read}}})],S.prototype,"sideOfEdge",void 0),e([s({json:{read:{source:"attributes.SnapX"}}})],S.prototype,"snapX",void 0),e([s({json:{read:{source:"attributes.SnapY"}}})],S.prototype,"snapY",void 0),e([s({json:{read:{source:"attributes.SnapZ"}}})],S.prototype,"snapZ",void 0),e([s({json:{read:{source:"attributes.SourceID"}}})],S.prototype,"sourceId",void 0),e([s({json:{read:{source:"attributes.SourceOID"}}})],S.prototype,"sourceOid",void 0),e([s({type:b.apiValues,json:{read:{source:"attributes.Status",reader:b.read}}})],S.prototype,"status",void 0),e([s({types:f})],S.prototype,"symbol",void 0),e([s({type:Date,json:{name:"attributes.TimeWindowEnd"}})],S.prototype,"timeWindowEnd",void 0),e([n("timeWindowEnd")],S.prototype,"writeTimeWindowEnd",null),e([s()],S.prototype,"timeWindowEndOffset",void 0),e([s({type:Date,json:{name:"attributes.TimeWindowStart"}})],S.prototype,"timeWindowStart",void 0),e([n("timeWindowStart")],S.prototype,"writeTimeWindowStart",null),e([s()],S.prototype,"timeWindowStartOffset",void 0),e([s({readOnly:!0,json:{read:!1}})],S.prototype,"type",void 0),e([s()],S.prototype,"violations",void 0),e([o("violations",["attributes"])],S.prototype,"readViolations",null),e([s()],S.prototype,"waitDuration",void 0),e([s()],S.prototype,"wait",void 0),e([o("wait",["attributes"])],S.prototype,"readWait",null),S=C=e([u("esri.rest.support.Stop")],S);const w=S;export{w as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import i from"../../PopupTemplate.js";import r from"../../core/Clonable.js";import a from"../../core/JSONSupport.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{reader as o}from"../../core/accessorSupport/decorators/reader.js";import{subclass as u}from"../../core/accessorSupport/decorators/subclass.js";import{writer as p}from"../../core/accessorSupport/decorators/writer.js";import n from"../../geometry/Point.js";import{getTimezoneOffset as l,getPrefixedProperties as m,setPrefixedProperties as d,toKebabImpedanceAttributes as c,fromKebabImpedanceAttributes as y}from"../route/utils.js";import{curbApproachJsonMap as v,locationTypeJsonMap as b,statusJsonMap as T,sideOfEdgeJsonMap as h}from"./networkEnums.js";import{symbolTypes as f}from"../../symbols/support/typeUtils.js";var C;let S=class extends(r.ClonableMixin(a)){static{C=this}constructor(e){super(e),this.arriveCurbApproach=null,this.arriveTime=null,this.arriveTimeOffset=null,this.bearing=null,this.bearingTol=null,this.cumulativeCosts=null,this.cumulativeDistance=null,this.cumulativeDuration=null,this.curbApproach=null,this.departCurbApproach=null,this.departTime=null,this.departTimeOffset=null,this.distanceToNetworkInMeters=null,this.geometry=null,this.lateDuration=null,this.locationType=null,this.name=null,this.navLatency=null,this.objectId=null,this.popupTemplate=null,this.posAlong=null,this.routeName=null,this.serviceCosts=null,this.serviceDistance=null,this.serviceDuration=null,this.sequence=null,this.sideOfEdge=null,this.snapX=null,this.snapY=null,this.snapZ=null,this.sourceId=null,this.sourceOid=null,this.status=null,this.symbol=null,this.timeWindowEnd=null,this.timeWindowEndOffset=null,this.timeWindowStart=null,this.timeWindowStartOffset=null,this.type="stop",this.violations=null,this.waitDuration=null,this.wait=null}readArriveTimeOffset(e,t){return l(t.attributes.ArriveTime,t.attributes.ArriveTimeUTC)}readCumulativeCosts(e,t){return m(t.attributes,"Cumul_")}readDepartTimeOffset(e,t){return l(t.attributes.DepartTime,t.attributes.DepartTimeUTC)}readServiceCosts(e,t){return m(t.attributes,"Attr_")}writeServiceCosts(e,t){d(e,t,"Attr_")}writeTimeWindowEnd(e,t){null!=e&&(t.attributes||(t.attributes={}),t.attributes.TimeWindowEnd=e.getTime())}writeTimeWindowStart(e,t){null!=e&&(t.attributes||(t.attributes={}),t.attributes.TimeWindowStart=e.getTime())}readViolations(e,t){return m(t.attributes,"Violation_")}readWait(e,t){return m(t.attributes,"Wait_")}static{this.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"ArrivalCurbApproach",alias:"Arrival Curb Approach",type:"esriFieldTypeInteger"},{name:"ArrivalTime",alias:"Arrival Time",type:"esriFieldTypeDate"},{name:"ArrivalUTCOffset",alias:"Arrival Time",type:"esriFieldTypeInteger"},{name:"CumulativeCosts",alias:"Cumulative Costs",type:"esriFieldTypeString"},{name:"CumulativeMeters",alias:"Cumulative Meters",type:"esriFieldTypeDouble"},{name:"CumulativeMinutes",alias:"Cumulative Minutes",type:"esriFieldTypeDouble"},{name:"CurbApproach",alias:"Curb Approach",type:"esriFieldTypeInteger"},{name:"DepartureCurbApproach",alias:"Departure Curb Approach",type:"esriFieldTypeInteger"},{name:"DepartureTime",alias:"Departure Time",type:"esriFieldTypeDate"},{name:"DepartureUTCOffset",alias:"Departure Time",type:"esriFieldTypeInteger"},{name:"LateMinutes",alias:"Minutes Late",type:"esriFieldTypeDouble"},{name:"LocationType",alias:"Location Type",type:"esriFieldTypeInteger"},{name:"Name",alias:"Name",type:"esriFieldTypeString"},{name:"RouteName",alias:"Route Name",type:"esriFieldTypeString"},{name:"Sequence",alias:"Sequence",type:"esriFieldTypeInteger"},{name:"ServiceCosts",alias:"Service Costs",type:"esriFieldTypeString"},{name:"ServiceMeters",alias:"Service Meters",type:"esriFieldTypeDouble"},{name:"ServiceMinutes",alias:"Service Minutes",type:"esriFieldTypeDouble"},{name:"Status",alias:"Status",type:"esriFieldTypeInteger"},{name:"TimeWindowEnd",alias:"Time Window End",type:"esriFieldTypeDate"},{name:"TimeWindowEndUTCOffset",alias:"Time Window End Offset",type:"esriFieldTypeInteger"},{name:"TimeWindowStart",alias:"Time Window Start",type:"esriFieldTypeDate"},{name:"TimeWindowStartUTCOffset",alias:"Time Window Start Offset",type:"esriFieldTypeInteger"},{name:"WaitMinutes",alias:"Minutes Wait",type:"esriFieldTypeDouble"}]}static fromGraphic(e){return new C({arriveCurbApproach:null!=e.attributes.ArrivalCurbApproach?v.fromJSON(e.attributes.ArrivalCurbApproach):null,arriveTime:null!=e.attributes.ArrivalTime?new Date(e.attributes.ArrivalTime):null,arriveTimeOffset:e.attributes.ArrivalUTCOffset,cumulativeCosts:null!=e.attributes.CumulativeCosts?c(JSON.parse(e.attributes.CumulativeCosts)):null,cumulativeDistance:e.attributes.CumulativeMeters??null,cumulativeDuration:e.attributes.CumulativeMinutes??null,curbApproach:null!=e.attributes.CurbApproach?v.fromJSON(e.attributes.CurbApproach):null,departCurbApproach:null!=e.attributes.DepartureCurbApproach?v.fromJSON(e.attributes.DepartureCurbApproach):null,departTime:null!=e.attributes.DepartureTime?new Date(e.attributes.DepartureTime):null,departTimeOffset:e.attributes.DepartureUTCOffset??null,geometry:e.geometry,lateDuration:e.attributes.LateMinutes??null,locationType:null!=e.attributes.LocationType?b.fromJSON(e.attributes.LocationType):null,name:e.attributes.Name,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,routeName:e.attributes.RouteName,sequence:e.attributes.Sequence??null,serviceCosts:null!=e.attributes.ServiceCosts?c(JSON.parse(e.attributes.ServiceCosts)):null,serviceDistance:e.attributes.ServiceMeters??null,serviceDuration:e.attributes.ServiceMinutes??null,status:null!=e.attributes.Status?T.fromJSON(e.attributes.Status):null,symbol:e.symbol,timeWindowEnd:null!=e.attributes.TimeWindowEnd?new Date(e.attributes.TimeWindowEnd):null,timeWindowEndOffset:e.attributes.TimeWindowEndUTCOffset??null,timeWindowStart:null!=e.attributes.TimeWindowStart?new Date(e.attributes.TimeWindowStart):null,timeWindowStartOffset:e.attributes.TimeWindowStartUTCOffset??null,waitDuration:e.attributes.WaitMinutes??null})}toGraphic(){const e={ObjectID:this.objectId,ArrivalCurbApproach:this.arriveCurbApproach?v.toJSON(this.arriveCurbApproach):null,ArrivalTime:this.arriveTime?.getTime()??null,ArrivalUTCOffset:this.arriveTimeOffset,CumulativeCosts:this.cumulativeCosts?JSON.stringify(y(this.cumulativeCosts)):null,CumulativeMeters:this.cumulativeDistance,CumulativeMinutes:this.cumulativeDuration,CurbApproach:this.curbApproach?v.toJSON(this.curbApproach):null,DepartureCurbApproach:this.departCurbApproach?v.toJSON(this.departCurbApproach):null,DepartureTime:this.departTime?.getTime()??null,DepartureUTCOffset:this.departTimeOffset,LateMinutes:this.lateDuration,LocationType:this.locationType?b.toJSON(this.locationType):null,Name:this.name,RouteName:this.routeName,Sequence:this.sequence,ServiceCosts:this.serviceCosts?JSON.stringify(y(this.serviceCosts)):null,ServiceMeters:this.serviceDistance,ServiceMinutes:this.serviceDuration,Status:this.status?T.toJSON(this.status):null,TimeWindowEnd:this.timeWindowEnd?.getTime()??null,TimeWindowEndUTCOffset:this.timeWindowEndOffset??this.arriveTimeOffset,TimeWindowStart:this.timeWindowStart?.getTime()??null,TimeWindowStartUTCOffset:this.timeWindowStartOffset??this.arriveTimeOffset,WaitMinutes:this.waitDuration};return new t({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};e([s({type:v.apiValues,json:{read:{source:"attributes.ArrivalCurbApproach",reader:v.read}}})],S.prototype,"arriveCurbApproach",void 0),e([s({type:Date,json:{read:{source:"attributes.ArriveTimeUTC"}}})],S.prototype,"arriveTime",void 0),e([s()],S.prototype,"arriveTimeOffset",void 0),e([o("arriveTimeOffset",["attributes.ArriveTime","attributes.ArriveTimeUTC"])],S.prototype,"readArriveTimeOffset",null),e([s({json:{name:"attributes.Bearing",read:!1,write:!0}})],S.prototype,"bearing",void 0),e([s({json:{name:"attributes.BearingTol",read:!1,write:!0}})],S.prototype,"bearingTol",void 0),e([s()],S.prototype,"cumulativeCosts",void 0),e([o("cumulativeCosts",["attributes"])],S.prototype,"readCumulativeCosts",null),e([s()],S.prototype,"cumulativeDistance",void 0),e([s()],S.prototype,"cumulativeDuration",void 0),e([s({type:v.apiValues,json:{name:"attributes.CurbApproach",read:{reader:v.read},write:{writer:v.write}}})],S.prototype,"curbApproach",void 0),e([s({type:v.apiValues,json:{read:{source:"attributes.DepartCurbApproach",reader:v.read}}})],S.prototype,"departCurbApproach",void 0),e([s({type:Date,json:{read:{source:"attributes.DepartTimeUTC"}}})],S.prototype,"departTime",void 0),e([s()],S.prototype,"departTimeOffset",void 0),e([o("departTimeOffset",["attributes.DepartTime","attributes.DepartTimeUTC"])],S.prototype,"readDepartTimeOffset",null),e([s({json:{read:{source:"attributes.DistanceToNetworkInMeters"}}})],S.prototype,"distanceToNetworkInMeters",void 0),e([s({type:n,json:{write:!0}})],S.prototype,"geometry",void 0),e([s()],S.prototype,"lateDuration",void 0),e([s({type:b.apiValues,json:{name:"attributes.LocationType",read:{reader:b.read},write:{writer:b.write}}})],S.prototype,"locationType",void 0),e([s({json:{name:"attributes.Name"}})],S.prototype,"name",void 0),e([s({json:{name:"attributes.NavLatency",read:!1,write:!0}})],S.prototype,"navLatency",void 0),e([s({json:{name:"attributes.ObjectID"}})],S.prototype,"objectId",void 0),e([s({type:i})],S.prototype,"popupTemplate",void 0),e([s({json:{read:{source:"attributes.PosAlong"}}})],S.prototype,"posAlong",void 0),e([s({json:{name:"attributes.RouteName"}})],S.prototype,"routeName",void 0),e([s()],S.prototype,"serviceCosts",void 0),e([o("serviceCosts",["attributes"])],S.prototype,"readServiceCosts",null),e([p("serviceCosts")],S.prototype,"writeServiceCosts",null),e([s()],S.prototype,"serviceDistance",void 0),e([s()],S.prototype,"serviceDuration",void 0),e([s({json:{name:"attributes.Sequence"}})],S.prototype,"sequence",void 0),e([s({type:h.apiValues,json:{read:{source:"attributes.SideOfEdge",reader:h.read}}})],S.prototype,"sideOfEdge",void 0),e([s({json:{read:{source:"attributes.SnapX"}}})],S.prototype,"snapX",void 0),e([s({json:{read:{source:"attributes.SnapY"}}})],S.prototype,"snapY",void 0),e([s({json:{read:{source:"attributes.SnapZ"}}})],S.prototype,"snapZ",void 0),e([s({json:{read:{source:"attributes.SourceID"}}})],S.prototype,"sourceId",void 0),e([s({json:{read:{source:"attributes.SourceOID"}}})],S.prototype,"sourceOid",void 0),e([s({type:T.apiValues,json:{read:{source:"attributes.Status",reader:T.read}}})],S.prototype,"status",void 0),e([s({types:f})],S.prototype,"symbol",void 0),e([s({type:Date,json:{name:"attributes.TimeWindowEnd"}})],S.prototype,"timeWindowEnd",void 0),e([p("timeWindowEnd")],S.prototype,"writeTimeWindowEnd",null),e([s()],S.prototype,"timeWindowEndOffset",void 0),e([s({type:Date,json:{name:"attributes.TimeWindowStart"}})],S.prototype,"timeWindowStart",void 0),e([p("timeWindowStart")],S.prototype,"writeTimeWindowStart",null),e([s()],S.prototype,"timeWindowStartOffset",void 0),e([s({readOnly:!0,json:{read:!1}})],S.prototype,"type",void 0),e([s()],S.prototype,"violations",void 0),e([o("violations",["attributes"])],S.prototype,"readViolations",null),e([s()],S.prototype,"waitDuration",void 0),e([s()],S.prototype,"wait",void 0),e([o("wait",["attributes"])],S.prototype,"readWait",null),S=C=e([u("esri.rest.support.Stop")],S);const w=S;export{w as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- const a="20250324",e="aefdb1e0a7ca6a8797c71febf06d79f1ce7a8214";export{a as buildDate,e as commitHash};
5
+ const d="20250326",f="f5f629996fdbd6a95f7066d52608632efa73dd25";export{d as buildDate,f as commitHash};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import"../../core/Error.js";import has from"../../core/has.js";import"../../core/Logger.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/RandomLCG.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import{CollisionEngine as i}from"./engine/webgl/collisions/CollisionEngine.js";const r=32;let a=class extends t{constructor(e){super(e),this._lastUpdate=0,this.collisionEngine=new i,this.lastUpdateId=-1,this.updateRequested=!1,this.view=null}get updating(){return has("esri-2d-log-updating")&&console.log(`Updating LabelManager ${this.updateRequested}:\n-> updateRequested: ${this.updateRequested}`),this.updateRequested}update(e){const t=performance.now();t-this._lastUpdate>=r?(this._lastUpdate=t,this.doUpdate(e)):this.requestUpdate()}viewChange(){this.requestUpdate()}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.view?.requestUpdate())}processUpdate(e){this.updateRequested&&(this.updateRequested=!1,this.update(e))}doUpdate(e){const t=this.view;if(t)try{const s=e.state.scale,o=t.featuresTilingScheme.getClosestInfoForScale(s).level;this.collisionEngine.run(t.allLayerViews.items,e,s,o)}catch(s){}}};e([s()],a.prototype,"updateRequested",void 0),e([s()],a.prototype,"updating",null),e([s()],a.prototype,"view",void 0),a=e([o("esri.views.2d.LabelManager")],a);export{a as LabelManager};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import has from"../../core/has.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";import{SymbolFader as o}from"./engine/vectorTiles/decluttering/SymbolFader.js";import{RotationAlignment as a,TranslateAnchor as i}from"./engine/vectorTiles/style/StyleDefinition.js";import{tileSize as l}from"./engine/webgl/definitions.js";const n=7e6;class c{constructor(){this.styles=new Map,this.layerContexts=new Map}get cachedStyles(){return this.styles}setLabelClassStyle(e,t,s){this.layerContexts.set(e,t),this.styles.set(e,s)}}let p=class extends t{constructor(e){super(e),this._faderWorkingSet=[],this._styleRepository=new c,this.lastUpdateId=-1,this.updateRequested=!1,this.view=null;const t=(e,t)=>{e.writeLabelVisibility(),e.requestRender(),e.isReady&&(e.decluttered=!0)};this.symbolFader=new o("feature-tile",this._styleRepository,t,this._faderWorkingSet,l,n)}get updating(){return has("esri-2d-log-updating")&&console.log(`Updating LabelManager ${this.updateRequested}:\n-> updateRequested: ${this.updateRequested}`),this.updateRequested}viewChange(){this.requestUpdate()}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.view?.requestUpdate())}processUpdate(e){this.doUpdate(e)?this.updateRequested=!1:(this.updateRequested=!0,this.view?.requestUpdate())}setLabelSchemaStyles(e,t){let s;switch(e.type){case"label":s=e.classes;break;case"subtype":s=Array.from(Object.values(e.renderers).flatMap((e=>e.classes)));break;case"cluster":s=[...e.cluster.classes,...e.feature.classes];break;case"track":s=[...e.latestObservation.classes,...e.previousObservation.classes,...e.trackLine.classes]}for(const r of s){const e=d(r);this._styleRepository.setLabelClassStyle(r.labelClassId,t,e)}}doUpdate(e){const t=this.view;if(!t)return!1;const s=t.allLayerViews.map((e=>e.labelingCollisionInfos)).filter((e=>!!e)).toArray().flat().filter((e=>!!e?.labelingInfo)).map((e=>e.container));if(s.length>0){this._faderWorkingSet.length=0;for(const t of s)for(const s of t.tiles||[])s.setTransform(e.state),this._faderWorkingSet.push(s);const r=e.state.scale,o=t.featuresTilingScheme.scaleToZoom(r);return this.symbolFader.update(o,e.state)}return!0}};function d(e){const t="esriGeometryPolyline"===e.geometryType?a.MAP:a.VIEWPORT,s="esriGeometryPolyline"===e.geometryType?i.MAP:i.VIEWPORT;return{geometryType:e.geometryType,iconAllowOverlap:!e.deconflictionEnabled,iconIgnorePlacement:!1,textAllowOverlap:!e.deconflictionEnabled,textIgnorePlacement:!1,iconRotationAlignment:t,textRotationAlignment:t,iconTranslateAnchor:s,iconTranslate:[0,0],textTranslateAnchor:s,textTranslate:[0,0]}}e([s()],p.prototype,"updateRequested",void 0),e([s()],p.prototype,"updating",null),e([s()],p.prototype,"view",void 0),p=e([r("esri.views.2d.LabelManager")],p);export{c as LabelClassStyleRepository,p as LabelManager};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{Point as e}from"../../../../geometry/support/TileClipper.js";import{cDegToRad as t,cPi as i,cInfinity as n,radToByte as s,positiveMod as o,c2pi as a}from"./GeometryUtils.js";import{sdfGlyphSize as l,TextShaping as h,sdfGlyphBaseline as r}from"./TextShaping.js";import{declutterTiles as c}from"./decluttering/config.js";import{RotationAlignment as g,SymbolAnchor as m}from"./style/StyleDefinition.js";const x=4096,d=8,p=.5,w=2;class T{constructor(e,t,i=0,n=-1,s=p){this.x=e,this.y=t,this.angle=i,this.segment=n,this.minzoom=s}}class y{constructor(e,t,i,s,o,a=p,l=n){this.anchor=e,this.labelAngle=t,this.glyphAngle=i,this.page=s,this.alternateVerticalGlyph=o,this.minzoom=a,this.maxzoom=l}}class f{constructor(e,t,i,n,s,o,a,l,h,r,c,g){this.tl=e,this.tr=t,this.bl=i,this.br=n,this.mosaicRect=s,this.labelAngle=o,this.minAngle=a,this.maxAngle=l,this.anchor=h,this.minzoom=r,this.maxzoom=c,this.page=g}}class I{constructor(e){this.shapes=e}}class u{getIconPlacement(n,s,o){const a=new e(n.x,n.y),l=o.rotationAlignment===g.MAP,h=o.keepUpright;let r=o.rotate*t;l&&(r+=n.angle);const m=new I([]);return o.allowOverlap&&o.ignorePlacement||!c||(m.iconColliders=[]),this._addIconPlacement(m,a,s,o,r),l&&h&&this._addIconPlacement(m,a,s,o,r+i),m}_addIconPlacement(t,i,s,o,a){const l=s.rasterizationScale,h=s.width/l,r=s.height/l,g=o.offset;let x=g[0],d=g[1];switch(o.anchor){case m.CENTER:x-=h/2,d-=r/2;break;case m.LEFT:d-=r/2;break;case m.RIGHT:x-=h,d-=r/2;break;case m.TOP:x-=h/2;break;case m.BOTTOM:x-=h/2,d-=r;break;case m.TOP_LEFT:break;case m.BOTTOM_LEFT:d-=r;break;case m.TOP_RIGHT:x-=h;break;case m.BOTTOM_RIGHT:x-=h,d-=r}const w=s.rect,T=2/l,y=x-T,I=d-T,u=y+w.width/l,b=I+w.height/l,P=new e(y,I),O=new e(u,b),_=new e(y,b),k=new e(u,I);if(0!==a){const e=Math.cos(a),t=Math.sin(a);P.rotate(e,t),O.rotate(e,t),_.rotate(e,t),k.rotate(e,t)}const M=new f(P,k,_,O,w,a,0,256,i,p,n,0);if(t.shapes.push(M),(!o.allowOverlap||!o.ignorePlacement)&&c){const e=o.size,s=o.padding,l={xTile:i.x,yTile:i.y,dxPixels:x*e-s,dyPixels:d*e-s,hard:!o.optional,partIndex:0,width:h*e+2*s,height:r*e+2*s,angle:a,minLod:p,maxLod:n};t.iconColliders.push(l)}}getTextPlacement(s,o,a,c){const x=new e(s.x,s.y),T=c.rotate*t,u=c.rotationAlignment===g.MAP,b=c.keepUpright,P=c.padding;let O=p;const _=!u?0:s.angle,k=s.segment>=0&&u,M=c.allowOverlap&&c.ignorePlacement?null:[],E=[],G=4,N=!k;let A=Number.POSITIVE_INFINITY,L=Number.NEGATIVE_INFINITY,z=A,F=L;const v=(k||u)&&b,R=c.size/l;let B=!1;for(const e of o)if(e.vertical){B=!0;break}let H,V=0,j=0;if(!k&&B){const e=h.getTextBox(o,c.lineHeight*l);switch(c.anchor){case m.LEFT:V=e.height/2,j=-e.width/2;break;case m.RIGHT:V=-e.height/2,j=e.width/2;break;case m.TOP:V=e.height/2,j=e.width/2;break;case m.BOTTOM:V=-e.height/2,j=-e.width/2;break;case m.TOP_LEFT:V=e.height;break;case m.BOTTOM_LEFT:j=-e.width;break;case m.TOP_RIGHT:j=e.width;break;case m.BOTTOM_RIGHT:V=-e.height}}V+=c.offset[0]*l,j+=c.offset[1]*l;for(const t of o){const o=t.glyphMosaicItem;if(!o||o.rect.isEmpty)continue;const l=o.rect,h=o.metrics,g=o.page;if(M&&N){if(void 0!==H&&H!==t.y){let e,t,i,o;B?(e=-F+V,t=A+j,i=F-z,o=L-A):(e=A+V,t=z+j,i=L-A,o=F-z);const a={xTile:s.x,yTile:s.y,dxPixels:e*R-P,dyPixels:t*R-P,hard:!c.optional,partIndex:1,width:i*R+2*P,height:o*R+2*P,angle:T,minLod:p,maxLod:n};M.push(a),A=Number.POSITIVE_INFINITY,L=Number.NEGATIVE_INFINITY,z=A,F=L}H=t.y}const m=[];if(k){const e=.5*o.metrics.width,i=(t.x+h.left-G+e)*R*d;if(O=this._placeGlyph(s,O,i,a,s.segment,1,t.vertical,g,m),b&&(O=this._placeGlyph(s,O,i,a,s.segment,-1,t.vertical,g,m)),O>=w)break}else m.push(new y(x,_,_,g,!1)),u&&b&&m.push(new y(x,_+i,_+i,g,!1));const I=t.x+h.left,C=t.y-r-h.top,S=I+h.width,Y=C+h.height;let q,U,D,J,K,Q,W,X;if(!k&&B)if(t.vertical){const t=(I+S)/2-h.height/2,i=(C+Y)/2+h.width/2;q=new e(-i-G+V,t-G+j),U=new e(q.x+l.width,q.y+l.height),D=new e(q.x,U.y),J=new e(U.x,q.y)}else q=new e(-C+G+V,I-G+j),U=new e(q.x-l.height,q.y+l.width),D=new e(U.x,q.y),J=new e(q.x,U.y);else q=new e(I-G+V,C-G+j),U=new e(q.x+l.width,q.y+l.height),D=new e(q.x,U.y),J=new e(U.x,q.y);for(const i of m){let n,o,a,r;if(i.alternateVerticalGlyph){if(!K){const t=(C+Y)/2+j;K=new e((I+S)/2+V-h.height/2-G,t+h.width/2+G),Q=new e(K.x+l.height,K.y-l.width),W=new e(Q.x,K.y),X=new e(K.x,Q.y)}n=K,o=W,a=X,r=Q}else n=q,o=D,a=J,r=U;const g=C,m=Y,x=i.glyphAngle+T;if(0!==x){const e=Math.cos(x),t=Math.sin(x);n=n.clone(),o=o?.clone(),a=a?.clone(),r=r?.clone(),n.rotate(e,t),r?.rotate(e,t),o?.rotate(e,t),a?.rotate(e,t)}let d=0,p=256;if(k&&B?t.vertical?i.alternateVerticalGlyph?(d=32,p=96):(d=224,p=32):(d=224,p=96):(d=192,p=64),E.push(new f(n,a,o,r,l,i.labelAngle,d,p,i.anchor,i.minzoom,i.maxzoom,i.page)),M&&(!v||this._legible(i.labelAngle)))if(N)I<A&&(A=I),g<z&&(z=g),S>L&&(L=S),m>F&&(F=m);else if(i.minzoom<w){const e={xTile:s.x,yTile:s.y,dxPixels:(I+V)*R-P,dyPixels:(g+V)*R-P,hard:!c.optional,partIndex:1,width:(S-I)*R+2*P,height:(m-g)*R+2*P,angle:x,minLod:i.minzoom,maxLod:i.maxzoom};M.push(e)}}}if(O>=w)return null;if(M&&N){let e,t,i,o;B?(e=-F+V,t=A+j,i=F-z,o=L-A):(e=A+V,t=z+j,i=L-A,o=F-z);const a={xTile:s.x,yTile:s.y,dxPixels:e*R-P,dyPixels:t*R-P,hard:!c.optional,partIndex:1,width:i*R+2*P,height:o*R+2*P,angle:T,minLod:p,maxLod:n};M.push(a)}const C=new I(E);return M&&M.length>0&&(C.textColliders=M),C}_legible(e){const t=s(e);return t<65||t>=193}_placeGlyph(t,s,l,h,r,c,g,m,x){let d=c;const p=d<0?o(t.angle+i,a):t.angle;let w=0;l<0&&(d*=-1,l*=-1,w=i),d>0&&++r;let T=new e(t.x,t.y),f=h[r],I=n;if(h.length<=r)return I;for(;;){const e=f.x-T.x,t=f.y-T.y,i=Math.sqrt(e*e+t*t),n=Math.max(l/i,s),c=e/i,u=t/i,b=o(Math.atan2(u,c)+w,a);if(x.push(new y(T,p,b,m,!1,n,I)),g&&x.push(new y(T,p,b,m,!0,n,I)),n<=s)return n;T=f.clone();do{if(r+=d,h.length<=r||r<0)return n;f=h[r]}while(T.isEqual(f));let P=f.x-T.x,O=f.y-T.y;const _=Math.sqrt(P*P+O*O);P*=i/_,O*=i/_,T.x-=P,T.y-=O,I=n}}}export{T as Anchor,f as PlacedSymbol,I as Placement,u as PlacementEngine,x as tileCoordSize,d as tilePixelRatio};
5
+ import{Point as e}from"../../../../geometry/support/TileClipper.js";import{tilePixelRatio as t}from"./constants.js";import{cDegToRad as i,cPi as n,cInfinity as s,radToByte as o,positiveMod as a,c2pi as l}from"./GeometryUtils.js";import{sdfGlyphSize as h,TextShaping as r,sdfGlyphBaseline as c}from"./TextShaping.js";import{declutterTiles as g}from"./decluttering/config.js";import{RotationAlignment as m,SymbolAnchor as x}from"./style/StyleDefinition.js";const d=.5,p=2;class w{constructor(e,t,i=0,n=-1,s=d){this.x=e,this.y=t,this.angle=i,this.segment=n,this.minzoom=s}}class T{constructor(e,t,i,n,o,a=d,l=s){this.anchor=e,this.labelAngle=t,this.glyphAngle=i,this.page=n,this.alternateVerticalGlyph=o,this.minzoom=a,this.maxzoom=l}}class y{constructor(e,t,i,n,s,o,a,l,h,r,c,g){this.tl=e,this.tr=t,this.bl=i,this.br=n,this.mosaicRect=s,this.labelAngle=o,this.minAngle=a,this.maxAngle=l,this.anchor=h,this.minzoom=r,this.maxzoom=c,this.page=g}}class f{constructor(e){this.shapes=e}}class I{getIconPlacement(t,s,o){const a=new e(t.x,t.y),l=o.rotationAlignment===m.MAP,h=o.keepUpright;let r=o.rotate*i;l&&(r+=t.angle);const c=new f([]);return o.allowOverlap&&o.ignorePlacement||!g||(c.iconColliders=[]),this._addIconPlacement(c,a,s,o,r),l&&h&&this._addIconPlacement(c,a,s,o,r+n),c}_addIconPlacement(t,i,n,o,a){const l=n.rasterizationScale,h=n.width/l,r=n.height/l,c=o.offset;let m=c[0],p=c[1];switch(o.anchor){case x.CENTER:m-=h/2,p-=r/2;break;case x.LEFT:p-=r/2;break;case x.RIGHT:m-=h,p-=r/2;break;case x.TOP:m-=h/2;break;case x.BOTTOM:m-=h/2,p-=r;break;case x.TOP_LEFT:break;case x.BOTTOM_LEFT:p-=r;break;case x.TOP_RIGHT:m-=h;break;case x.BOTTOM_RIGHT:m-=h,p-=r}const w=n.rect,T=2/l,f=m-T,I=p-T,u=f+w.width/l,b=I+w.height/l,P=new e(f,I),O=new e(u,b),_=new e(f,b),k=new e(u,I);if(0!==a){const e=Math.cos(a),t=Math.sin(a);P.rotate(e,t),O.rotate(e,t),_.rotate(e,t),k.rotate(e,t)}const M=new y(P,k,_,O,w,a,0,256,i,d,s,0);if(t.shapes.push(M),(!o.allowOverlap||!o.ignorePlacement)&&g){const e=o.size,n=o.padding,l={xTile:i.x,yTile:i.y,dxPixels:m*e-n,dyPixels:p*e-n,hard:!o.optional,partIndex:0,width:h*e+2*n,height:r*e+2*n,angle:a,minLod:d,maxLod:s};t.iconColliders.push(l)}}getTextPlacement(o,a,l,g){const w=new e(o.x,o.y),I=g.rotate*i,u=g.rotationAlignment===m.MAP,b=g.keepUpright,P=g.padding;let O=d;const _=!u?0:o.angle,k=o.segment>=0&&u,M=g.allowOverlap&&g.ignorePlacement?null:[],E=[],G=4,N=!k;let A=Number.POSITIVE_INFINITY,L=Number.NEGATIVE_INFINITY,z=A,F=L;const v=(k||u)&&b,R=g.size/h;let B=!1;for(const e of a)if(e.vertical){B=!0;break}let H,V=0,j=0;if(!k&&B){const e=r.getTextBox(a,g.lineHeight*h);switch(g.anchor){case x.LEFT:V=e.height/2,j=-e.width/2;break;case x.RIGHT:V=-e.height/2,j=e.width/2;break;case x.TOP:V=e.height/2,j=e.width/2;break;case x.BOTTOM:V=-e.height/2,j=-e.width/2;break;case x.TOP_LEFT:V=e.height;break;case x.BOTTOM_LEFT:j=-e.width;break;case x.TOP_RIGHT:j=e.width;break;case x.BOTTOM_RIGHT:V=-e.height}}V+=g.offset[0]*h,j+=g.offset[1]*h;for(const i of a){const a=i.glyphMosaicItem;if(!a||a.rect.isEmpty)continue;const h=a.rect,r=a.metrics,m=a.page;if(M&&N){if(void 0!==H&&H!==i.y){let e,t,i,n;B?(e=-F+V,t=A+j,i=F-z,n=L-A):(e=A+V,t=z+j,i=L-A,n=F-z);const a={xTile:o.x,yTile:o.y,dxPixels:e*R-P,dyPixels:t*R-P,hard:!g.optional,partIndex:1,width:i*R+2*P,height:n*R+2*P,angle:I,minLod:d,maxLod:s};M.push(a),A=Number.POSITIVE_INFINITY,L=Number.NEGATIVE_INFINITY,z=A,F=L}H=i.y}const x=[];if(k){const e=.5*a.metrics.width,n=(i.x+r.left-G+e)*R*t;if(O=this._placeGlyph(o,O,n,l,o.segment,1,i.vertical,m,x),b&&(O=this._placeGlyph(o,O,n,l,o.segment,-1,i.vertical,m,x)),O>=p)break}else x.push(new T(w,_,_,m,!1)),u&&b&&x.push(new T(w,_+n,_+n,m,!1));const f=i.x+r.left,C=i.y-c-r.top,S=f+r.width,Y=C+r.height;let q,U,D,J,K,Q,W,X;if(!k&&B)if(i.vertical){const t=(f+S)/2-r.height/2,i=(C+Y)/2+r.width/2;q=new e(-i-G+V,t-G+j),U=new e(q.x+h.width,q.y+h.height),D=new e(q.x,U.y),J=new e(U.x,q.y)}else q=new e(-C+G+V,f-G+j),U=new e(q.x-h.height,q.y+h.width),D=new e(U.x,q.y),J=new e(q.x,U.y);else q=new e(f-G+V,C-G+j),U=new e(q.x+h.width,q.y+h.height),D=new e(q.x,U.y),J=new e(U.x,q.y);for(const t of x){let n,s,a,l;if(t.alternateVerticalGlyph){if(!K){const t=(C+Y)/2+j;K=new e((f+S)/2+V-r.height/2-G,t+r.width/2+G),Q=new e(K.x+h.height,K.y-h.width),W=new e(Q.x,K.y),X=new e(K.x,Q.y)}n=K,s=W,a=X,l=Q}else n=q,s=D,a=J,l=U;const c=C,m=Y,x=t.glyphAngle+I;if(0!==x){const e=Math.cos(x),t=Math.sin(x);n=n.clone(),s=s?.clone(),a=a?.clone(),l=l?.clone(),n.rotate(e,t),l?.rotate(e,t),s?.rotate(e,t),a?.rotate(e,t)}let d=0,w=256;if(k&&B?i.vertical?t.alternateVerticalGlyph?(d=32,w=96):(d=224,w=32):(d=224,w=96):(d=192,w=64),E.push(new y(n,a,s,l,h,t.labelAngle,d,w,t.anchor,t.minzoom,t.maxzoom,t.page)),M&&(!v||this._legible(t.labelAngle)))if(N)f<A&&(A=f),c<z&&(z=c),S>L&&(L=S),m>F&&(F=m);else if(t.minzoom<p){const e={xTile:o.x,yTile:o.y,dxPixels:(f+V)*R-P,dyPixels:(c+V)*R-P,hard:!g.optional,partIndex:1,width:(S-f)*R+2*P,height:(m-c)*R+2*P,angle:x,minLod:t.minzoom,maxLod:t.maxzoom};M.push(e)}}}if(O>=p)return null;if(M&&N){let e,t,i,n;B?(e=-F+V,t=A+j,i=F-z,n=L-A):(e=A+V,t=z+j,i=L-A,n=F-z);const a={xTile:o.x,yTile:o.y,dxPixels:e*R-P,dyPixels:t*R-P,hard:!g.optional,partIndex:1,width:i*R+2*P,height:n*R+2*P,angle:I,minLod:d,maxLod:s};M.push(a)}const C=new f(E);return M&&M.length>0&&(C.textColliders=M),C}_legible(e){const t=o(e);return t<65||t>=193}_placeGlyph(t,i,o,h,r,c,g,m,x){let d=c;const p=d<0?a(t.angle+n,l):t.angle;let w=0;o<0&&(d*=-1,o*=-1,w=n),d>0&&++r;let y=new e(t.x,t.y),f=h[r],I=s;if(h.length<=r)return I;for(;;){const e=f.x-y.x,t=f.y-y.y,n=Math.sqrt(e*e+t*t),s=Math.max(o/n,i),c=e/n,u=t/n,b=a(Math.atan2(u,c)+w,l);if(x.push(new T(y,p,b,m,!1,s,I)),g&&x.push(new T(y,p,b,m,!0,s,I)),s<=i)return s;y=f.clone();do{if(r+=d,h.length<=r||r<0)return s;f=h[r]}while(y.isEqual(f));let P=f.x-y.x,O=f.y-y.y;const _=Math.sqrt(P*P+O*O);P*=n/_,O*=n/_,y.x-=P,y.y-=O,I=s}}}export{w as Anchor,y as PlacedSymbol,f as Placement,I as PlacementEngine};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- class e{constructor(t){this.extent=4096,this.keys=[],this.values=[],this._pbfLayer=t.clone();const s=t.asUnsafe();for(;s.next();)switch(s.tag()){case 1:this.name=s.getString();break;case 3:this.keys.push(s.getString());break;case 4:this.values.push(s.processMessage(e._parseValue));break;case 5:this.extent=s.getUInt32();break;default:s.skip()}}getData(){return this._pbfLayer}static _parseValue(e){for(;e.next();)switch(e.tag()){case 1:return e.getString();case 2:return e.getFloat();case 3:return e.getDouble();case 4:return e.getInt64();case 5:return e.getUInt64();case 6:return e.getSInt64();case 7:return e.getBool();default:e.skip()}return null}}export{e as default};
5
+ import{tileCoordSize as e}from"./constants.js";class t{constructor(s){this.extent=e,this.keys=[],this.values=[],this._pbfLayer=s.clone();const a=s.asUnsafe();for(;a.next();)switch(a.tag()){case 1:this.name=a.getString();break;case 3:this.keys.push(a.getString());break;case 4:this.values.push(a.processMessage(t._parseValue));break;case 5:this.extent=a.getUInt32();break;default:a.skip()}}getData(){return this._pbfLayer}static _parseValue(e){for(;e.next();)switch(e.tag()){case 1:return e.getString();case 2:return e.getFloat();case 3:return e.getDouble();case 4:return e.getInt64();case 5:return e.getUInt64();case 6:return e.getSInt64();case 7:return e.getBool();default:e.skip()}return null}}export{t as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{MinPriority as e}from"../../../../core/MemCache.js";import{throwIfAborted as t}from"../../../../core/promiseUtils.js";import{fromValues as i}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{create as o}from"../../../../geometry/support/aaBoundingRect.js";import{TileHandler as s}from"./TileHandler.js";import{VectorTile as r}from"./VectorTile.js";import n from"../../tiling/TileInfoViewPOT.js";import l from"../../tiling/TileKey.js";class a extends s{constructor(e,t,i,o){super(e,t,i,e.tileInfo.lods.length-1),this._memCache=o,this._ongoingTileRequests=new Map,this._ongoingRequestToController=new Map,this._tileInfoView=new n(e.tileInfo,e.fullExtent)}destroy(){super.destroy(),this._ongoingRequestToController.forEach((e=>e.abort())),this._ongoingRequestToController.clear(),this._ongoingTileRequests.clear()}async getVectorTile(s,n){const a=new l(s[0],s[1],s[2],0);let g=this._memCache.get(a.id);if(g)return g.retain(),g;const h=await this._getVectorTileData(a);if(t(n),!this._layer)return null;if(g=this._memCache.get(a.id),g)return g.retain(),g;const c=this._layer.tileInfo.getTileBounds(o(),a),m=this._tileInfoView.getTileResolution(s[0]);return g=new r(a,m,c[0],c[3],512,512,this._styleRepository,this._memCache),g.setData(h),h&&(g.retain(),this._memCache.put(a.id,g,e)),g.neededForCoverage=!0,g.transforms.tileUnitsToPixels=i(1/8,0,0,0,1/8,0,0,0,1),g}_getVectorTileData(e){const t=e.id;if(this._ongoingTileRequests.has(t))return this._ongoingTileRequests.get(t);const i=new AbortController,o={signal:i.signal},s=this._getParsedVectorTileData(e,o).then((e=>(this._ongoingTileRequests.delete(t),this._ongoingRequestToController.delete(t),e))).catch((()=>(this._ongoingTileRequests.delete(t),this._ongoingRequestToController.delete(t),null)));return this._ongoingTileRequests.set(t,s),this._ongoingRequestToController.set(t,i),s}_getParsedVectorTileData(e,t){return this.fetchTileData(e,t).then((i=>this.parseTileData({key:e,data:i},t)))}}export{a as default};
5
+ import{MinPriority as e}from"../../../../core/MemCache.js";import{throwIfAborted as t}from"../../../../core/promiseUtils.js";import{fromValues as o}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{create as i}from"../../../../geometry/support/aaBoundingRect.js";import{tilePixelSize as s}from"./constants.js";import{TileHandler as r}from"./TileHandler.js";import{VectorTile as n}from"./VectorTile.js";import l from"../../tiling/TileInfoViewPOT.js";import a from"../../tiling/TileKey.js";class g extends r{constructor(e,t,o,i){super(e,t,o,e.tileInfo.lods.length-1),this._memCache=i,this._ongoingTileRequests=new Map,this._ongoingRequestToController=new Map,this._tileInfoView=new l(e.tileInfo,e.fullExtent)}destroy(){super.destroy(),this._ongoingRequestToController.forEach((e=>e.abort())),this._ongoingRequestToController.clear(),this._ongoingTileRequests.clear()}async getVectorTile(r,l){const g=new a(r[0],r[1],r[2],0);let h=this._memCache.get(g.id);if(h)return h.retain(),h;const m=await this._getVectorTileData(g);if(t(l),!this._layer)return null;if(h=this._memCache.get(g.id),h)return h.retain(),h;const c=this._layer.tileInfo.getTileBounds(i(),g),u=this._tileInfoView.getTileResolution(r[0]);return h=new n(g,u,c[0],c[3],s,s,this._styleRepository,this._memCache),h.setData(m),m&&(h.retain(),this._memCache.put(g.id,h,e)),h.neededForCoverage=!0,h.transforms.tileUnitsToPixels=o(1/8,0,0,0,1/8,0,0,0,1),h}_getVectorTileData(e){const t=e.id;if(this._ongoingTileRequests.has(t))return this._ongoingTileRequests.get(t);const o=new AbortController,i={signal:o.signal},s=this._getParsedVectorTileData(e,i).then((e=>(this._ongoingTileRequests.delete(t),this._ongoingRequestToController.delete(t),e))).catch((()=>(this._ongoingTileRequests.delete(t),this._ongoingRequestToController.delete(t),null)));return this._ongoingTileRequests.set(t,s),this._ongoingRequestToController.set(t,o),s}_getParsedVectorTileData(e,t){return this.fetchTileData(e,t).then((o=>this.parseTileData({key:e,data:o},t)))}}export{g as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{LRUCache as e}from"../../../../core/LRUCache.js";import{fromValues as i,create as t,intersects as l}from"../../../../geometry/support/aaBoundingRect.js";import s from"../../tiling/TileCoverage.js";import o from"../../tiling/TileKey.js";const r=512,n=1e-6,a=(e,i)=>e+1/(1<<2*i);class h{constructor(i,t){this._tiles=new Map,this._tileCache=new e(40,(e=>e.dispose())),this._viewSize=[0,0],this._visibleTiles=new Map,this.acquireTile=i.acquireTile,this.releaseTile=i.releaseTile,this.tileInfoView=i.tileInfoView,this._container=t}destroy(){for(const e of this._tiles.values())e.dispose();this._tiles=null,this._tileCache.clear(),this._tileCache=null}update(e){this._updateCacheSize(e);const i=this.tileInfoView,t=i.getTileCoverage(e.state,0,!0,"smallest");if(!t)return!0;const{spans:l,lodInfo:r}=t,{level:n}=r,a=this._tiles,h=new Set,c=new Set;for(const{row:s,colFrom:_,colTo:f}of l)for(let e=_;e<=f;e++){const i=o.getId(n,s,r.normalizeCol(e),r.getWorldForColumn(e)),t=this._getOrAcquireTile(i);h.add(i),t.processed()?this._addToContainer(t):c.add(new o(i))}for(const[s,o]of a)o.isCoverage=h.has(s);for(const s of c)this._findPlaceholdersForMissingTiles(s,h);let d=!1;for(const[s,o]of a)o.neededForCoverage=h.has(s),o.neededForCoverage||o.isHoldingForFade&&i.intersects(t,o.key)&&h.add(s),o.isFading&&(d=!0);for(const s of this._tiles.keys())h.has(s)||this._releaseTile(s);return s.pool.release(t),!d}clear(){this._tiles.clear(),this._tileCache.clear(),this._visibleTiles.clear()}clearCache(){this._tileCache.clear()}getIntersectingTiles(e,s,o,r,n){const a=[0,0],h=[0,0];r.toMap(a,e-o,s+o),r.toMap(h,e+o,s-o);const c=Math.min(a[0],h[0]),d=Math.min(a[1],h[1]),_=Math.max(a[0],h[0]),f=Math.max(a[1],h[1]),T=i(c,d,_,f),u=t(),p=[];for(const i of this._visibleTiles.values())this.tileInfoView.getTileBounds(u,i.key),l(T,u)&&p.push(i);if(null!=n&&n.length>0){const e=new Set(p.map((e=>e.id))),i=n.filter((i=>!e.has(i.tileKey.id))).map((e=>this._visibleTiles.get(e.tileKey.id))).filter((e=>void 0!==e));p.push(...i)}return p}_findPlaceholdersForMissingTiles(e,i){const t=[];for(const s of this._tiles.values())this._addPlaceholderChild(t,s,e,i);const l=t.reduce(a,0);Math.abs(1-l)<n||this._addPlaceholderParent(e.id,i)}_addPlaceholderChild(e,i,t,l){i.key.level<=t.level||!i.hasData()||d(t,i.key)&&(this._addToContainer(i),l.add(i.id),e.push(i.key.level-t.level))}_addPlaceholderParent(e,i){const t=this._tiles;let l=e;for(;;){if(l=c(l),!l||i.has(l))return;const e=t.get(l);if(e?.hasData())return this._addToContainer(e),void i.add(e.id)}}_getOrAcquireTile(e){let i=this._tiles.get(e);return i||(i=this._tileCache.pop(e),i||(i=this.acquireTile(new o(e))),this._tiles.set(e,i),i)}_releaseTile(e){const i=this._tiles.get(e);this.releaseTile(i),this._removeFromContainer(i),this._tiles.delete(e),i.hasData()?this._tileCache.put(e,i,1):i.dispose()}_addToContainer(e){let i;const t=[],l=this._container;if(l.contains(e))return;const s=this._visibleTiles;for(const o of s.values())this._canConnectDirectly(e,o)&&t.push(o),null==i&&this._canConnectDirectly(o,e)&&(i=o);if(null!=i){for(const l of t)i.childrenTiles.delete(l),e.childrenTiles.add(l),l.parentTile=e;i.childrenTiles.add(e),e.parentTile=i}else for(const o of t)e.childrenTiles.add(o),o.parentTile=e;s.set(e.id,e),l.addChild(e)}_removeFromContainer(e){if(this._visibleTiles.delete(e.id),this._container.removeChild(e),null!=e.parentTile){e.parentTile.childrenTiles.delete(e);for(const i of e.childrenTiles)null!=e.parentTile&&e.parentTile.childrenTiles.add(i)}for(const i of e.childrenTiles)i.parentTile=e.parentTile;e.parentTile=null,e.childrenTiles.clear()}_canConnectDirectly(e,i){const t=e.key;let{level:l,row:s,col:o,world:r}=i.key;const n=this._visibleTiles;for(;l>0;){if(l--,s>>=1,o>>=1,t.level===l&&t.row===s&&t.col===o&&t.world===r)return!0;if(n.has(`${l}/${s}/${o}/${r}`))return!1}return!1}_updateCacheSize(e){const i=e.state.size;if(i[0]===this._viewSize[0]&&i[1]===this._viewSize[1])return;const t=Math.ceil(i[0]/r)+1,l=Math.ceil(i[1]/r)+1;this._viewSize[0]=i[0],this._viewSize[1]=i[1],this._tileCache.maxSize=5*t*l}}function c(e){const[i,t,l,s]=e.split("/"),o=parseInt(i,10);return 0===o?null:`${o-1}/${parseInt(t,10)>>1}/${parseInt(l,10)>>1}/${parseInt(s,10)}`}function d(e,i){const t=i.level-e.level;return e.row===i.row>>t&&e.col===i.col>>t&&e.world===i.world}export{h as TileManager};
5
+ import{LRUCache as e}from"../../../../core/LRUCache.js";import{fromValues as i,create as t,intersects as s}from"../../../../geometry/support/aaBoundingRect.js";import{tilePixelSize as l}from"./constants.js";import o from"../../tiling/TileCoverage.js";import r from"../../tiling/TileKey.js";const n=1e-6,a=(e,i)=>e+1/(1<<2*i);class c{constructor(i,t){this._tiles=new Map,this._tileCache=new e(40,(e=>e.dispose())),this._viewSize=[0,0],this._visibleTiles=new Map,this.acquireTile=i.acquireTile,this.releaseTile=i.releaseTile,this.tileInfoView=i.tileInfoView,this._container=t}destroy(){for(const e of this._tiles.values())e.dispose();this._tiles=null,this._tileCache.clear(),this._tileCache=null}update(e){this._updateCacheSize(e);const i=this.tileInfoView,t=i.getTileCoverage(e.state,0,!0,"smallest");if(!t)return!0;const{spans:s,lodInfo:l}=t,{level:n}=l,a=this._tiles,c=new Set,h=new Set;for(const{row:o,colFrom:_,colTo:f}of s)for(let e=_;e<=f;e++){const i=r.getId(n,o,l.normalizeCol(e),l.getWorldForColumn(e)),t=this._getOrAcquireTile(i);c.add(i),t.processed()?this._addToContainer(t):h.add(new r(i))}for(const[o,r]of a)r.isCoverage=c.has(o);for(const o of h)this._findPlaceholdersForMissingTiles(o,c);let d=!1;for(const[o,r]of a)r.neededForCoverage=c.has(o),r.neededForCoverage||r.isHoldingForFade&&i.intersects(t,r.key)&&c.add(o),r.isFading&&(d=!0);for(const o of this._tiles.keys())c.has(o)||this._releaseTile(o);return o.pool.release(t),!d}clear(){this._tiles.clear(),this._tileCache.clear(),this._visibleTiles.clear()}clearCache(){this._tileCache.clear()}getIntersectingTiles(e,l,o,r,n){const a=[0,0],c=[0,0];r.toMap(a,e-o,l+o),r.toMap(c,e+o,l-o);const h=Math.min(a[0],c[0]),d=Math.min(a[1],c[1]),_=Math.max(a[0],c[0]),f=Math.max(a[1],c[1]),T=i(h,d,_,f),u=t(),p=[];for(const i of this._visibleTiles.values())this.tileInfoView.getTileBounds(u,i.key),s(T,u)&&p.push(i);if(null!=n&&n.length>0){const e=new Set(p.map((e=>e.id))),i=n.filter((i=>!e.has(i.tileKey.id))).map((e=>this._visibleTiles.get(e.tileKey.id))).filter((e=>void 0!==e));p.push(...i)}return p}_findPlaceholdersForMissingTiles(e,i){const t=[];for(const l of this._tiles.values())this._addPlaceholderChild(t,l,e,i);const s=t.reduce(a,0);Math.abs(1-s)<n||this._addPlaceholderParent(e.id,i)}_addPlaceholderChild(e,i,t,s){i.key.level<=t.level||!i.hasData()||d(t,i.key)&&(this._addToContainer(i),s.add(i.id),e.push(i.key.level-t.level))}_addPlaceholderParent(e,i){const t=this._tiles;let s=e;for(;;){if(s=h(s),!s||i.has(s))return;const e=t.get(s);if(e?.hasData())return this._addToContainer(e),void i.add(e.id)}}_getOrAcquireTile(e){let i=this._tiles.get(e);return i||(i=this._tileCache.pop(e),i||(i=this.acquireTile(new r(e))),this._tiles.set(e,i),i)}_releaseTile(e){const i=this._tiles.get(e);this.releaseTile(i),this._removeFromContainer(i),this._tiles.delete(e),i.hasData()?this._tileCache.put(e,i,1):i.dispose()}_addToContainer(e){let i;const t=[],s=this._container;if(s.contains(e))return;const l=this._visibleTiles;for(const o of l.values())this._canConnectDirectly(e,o)&&t.push(o),null==i&&this._canConnectDirectly(o,e)&&(i=o);if(null!=i){for(const s of t)i.childrenTiles.delete(s),e.childrenTiles.add(s),s.parentTile=e;i.childrenTiles.add(e),e.parentTile=i}else for(const o of t)e.childrenTiles.add(o),o.parentTile=e;l.set(e.id,e),s.addChild(e)}_removeFromContainer(e){if(this._visibleTiles.delete(e.id),this._container.removeChild(e),null!=e.parentTile){e.parentTile.childrenTiles.delete(e);for(const i of e.childrenTiles)null!=e.parentTile&&e.parentTile.childrenTiles.add(i)}for(const i of e.childrenTiles)i.parentTile=e.parentTile;e.parentTile=null,e.childrenTiles.clear()}_canConnectDirectly(e,i){const t=e.key;let{level:s,row:l,col:o,world:r}=i.key;const n=this._visibleTiles;for(;s>0;){if(s--,l>>=1,o>>=1,t.level===s&&t.row===l&&t.col===o&&t.world===r)return!0;if(n.has(`${s}/${l}/${o}/${r}`))return!1}return!1}_updateCacheSize(e){const i=e.state.size;if(i[0]===this._viewSize[0]&&i[1]===this._viewSize[1])return;const t=Math.ceil(i[0]/l)+1,s=Math.ceil(i[1]/l)+1;this._viewSize[0]=i[0],this._viewSize[1]=i[1],this._tileCache.maxSize=5*t*s}}function h(e){const[i,t,s,l]=e.split("/"),o=parseInt(i,10);return 0===o?null:`${o-1}/${parseInt(t,10)>>1}/${parseInt(s,10)>>1}/${parseInt(l,10)}`}function d(e,i){const t=i.level-e.level;return e.row===i.row>>t&&e.col===i.col>>t&&e.world===i.world}export{c as TileManager};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../core/has.js";import{identity as e,translate as t,rotate as s,scale as r}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{BucketType as i}from"./enums.js";import{CircleRenderBucket as o,SymbolRenderBucket as h,LineRenderBucket as n,FillRenderBucket as l}from"./RenderBucket.js";import{fadeDuration as c}from"./decluttering/config.js";import{TiledDisplayObject as d}from"../webgl/TiledDisplayObject.js";const u=null;class y extends d{constructor(e,t,s,r,a,i,o,h=null){super(e,t,s,r,a,i,4096,4096),this.styleRepository=o,this._memCache=h,this.type="vector-tile",this._referenced=1,this._hasSymbolBuckets=!1,this._usedMemory=256,this.layerData=new Map,this.status="loading",this.allSymbolsFadingOut=!1,this.lastOpacityUpdate=0,this.symbols=new Map,this.isCoverage=!1,this.neededForCoverage=!1,this.decluttered=!1,this.parentTile=null,this.childrenTiles=new Set,this.featureIndex=null,this.triangleCount=0,this._processed=!1,this.id=e.id}get hasSymbolBuckets(){return this._hasSymbolBuckets}get isFading(){return this._hasSymbolBuckets&&performance.now()-this.lastOpacityUpdate<c}get isHoldingForFade(){return this._hasSymbolBuckets&&(!this.allSymbolsFadingOut||performance.now()-this.lastOpacityUpdate<c)}get wasRequested(){return"errored"===this.status||"loaded"===this.status||"reloading"===this.status}setData(e){this.changeDataImpl(e),this.requestRender(),this.ready(),this._processed=!0}deleteLayerData(e){let t=!1;for(const s of e){const e=this.layerData.get(s);e&&(this._usedMemory-=e.usedMemory,e.type===i.SYMBOL&&this.symbols.delete(s)&&(t=!0),e.destroy(),this.layerData.delete(s))}this._memCache?.updateSize(this.key.id,this),t&&(this.featureIndex?.clear(),this.emit("symbols-changed")),this.requestRender()}processed(){return this._processed}hasData(){return this.layerData.size>0}hasFeatures(){const e=this.layerData.values();for(const t of e)if(t.hasData())return!0;return!1}dispose(){"unloaded"!==this.status&&(y._destroyRenderBuckets(this.layerData),this.layerData.clear(),this.featureIndex=null,this._usedMemory=0,this.destroy(),this.status="unloaded")}release(){0==--this._referenced&&(this.dispose(),this.stage=null)}retain(){++this._referenced}get cachedMemory(){return this._usedMemory}get usedMemory(){return this._usedMemory}get usedMemoryPerReference(){return this._usedMemory/(this._referenced||1)}changeDataImpl(e){this.featureIndex?.clear();let t=!1;if(e){const{bucketsWithData:s,emptyBuckets:r}=e,a=this._createRenderBuckets(s);if(r&&r.byteLength>0){const e=new Uint32Array(r);for(const t of e)this._deleteLayerData(t)}for(const[e,o]of a)this._deleteLayerData(e),o.type===i.SYMBOL&&(this.symbols.set(e,o.symbols),t=!0),this._usedMemory+=o.usedMemory,this.layerData.set(e,o);this._memCache?.updateSize(this.key.id,this)}this._hasSymbolBuckets=!1;for(const s of this.layerData.values())s.type===i.SYMBOL&&(this._hasSymbolBuckets=!0);t&&this.emit("symbols-changed")}attachWithContext(e){this.stage={context:e,trashDisplayObject(e){e.processDetach()},untrashDisplayObject:()=>!1}}setTransform(a){super.setTransform(a);const i=this.resolution/(a.resolution*a.pixelRatio),o=this.width/this.rangeX*i,h=this.height/this.rangeY*i,n=[0,0];a.toScreen(n,[this.x,this.y]);const l=this.transforms.tileUnitsToPixels;e(l),t(l,l,n),s(l,l,Math.PI*a.rotation/180),r(l,l,[o,h,1])}_createTransforms(){return{displayViewScreenMat3:a(),tileMat3:a(),tileUnitsToPixels:a()}}static _destroyRenderBuckets(e){if(!e)return;const t=new Set;for(const s of e.values())t.has(s)||(s.destroy(),t.add(s));e.clear()}_createRenderBuckets(e){const t=new Map,s=new Map;for(const r of e){const e=this._deserializeBucket(r,s);for(const s of e.layerUIDs)t.set(s,e)}return t}_deserializeBucket(e,t){let s=t.get(e);if(s)return s;switch(new Uint32Array(e)[0]){case i.FILL:s=new l(e,this.styleRepository);break;case i.LINE:s=new n(e,this.styleRepository);break;case i.SYMBOL:s=new h(e,this.styleRepository,this);break;case i.CIRCLE:s=new o(e,this.styleRepository)}return t.set(e,s),s}_deleteLayerData(e){if(!this.layerData.has(e))return;const t=this.layerData.get(e);this._usedMemory-=t.usedMemory,t.destroy(),this.layerData.delete(e)}}export{y as VectorTile,u as tracer};
5
+ import"../../../../core/has.js";import{identity as e,translate as t,rotate as s,scale as r}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{tileCoordSize as i}from"./constants.js";import{BucketType as o}from"./enums.js";import{CircleRenderBucket as h,SymbolRenderBucket as n,LineRenderBucket as l,FillRenderBucket as c}from"./RenderBucket.js";import{fadeDuration as d}from"./decluttering/config.js";import{TiledDisplayObject as u}from"../webgl/TiledDisplayObject.js";const y=null;class m extends u{constructor(e,t,s,r,a,o,h,n=null){super(e,t,s,r,a,o,i,i),this.styleRepository=h,this._memCache=n,this.type="vector-tile",this._referenced=1,this._hasSymbolBuckets=!1,this._usedMemory=256,this.layerData=new Map,this.status="loading",this.allSymbolsFadingOut=!1,this.lastOpacityUpdate=0,this.symbols=new Map,this.isCoverage=!1,this.neededForCoverage=!1,this.decluttered=!1,this.parentTile=null,this.childrenTiles=new Set,this.featureIndex=null,this.triangleCount=0,this._processed=!1,this.id=e.id}get styleLayerUIDs(){return Array.from(this.layerData.keys())}get hasSymbolBuckets(){return this._hasSymbolBuckets}get isFading(){return this._hasSymbolBuckets&&performance.now()-this.lastOpacityUpdate<d}get isHoldingForFade(){return this._hasSymbolBuckets&&(!this.allSymbolsFadingOut||performance.now()-this.lastOpacityUpdate<d)}get wasRequested(){return"errored"===this.status||"loaded"===this.status||"reloading"===this.status}setData(e){this.changeDataImpl(e),this.requestRender(),this.ready(),this._processed=!0}deleteLayerData(e){let t=!1;for(const s of e){const e=this.layerData.get(s);e&&(this._usedMemory-=e.usedMemory,e.type===o.SYMBOL&&this.symbols.delete(s)&&(t=!0),e.destroy(),this.layerData.delete(s))}this._memCache?.updateSize(this.key.id,this),t&&(this.featureIndex?.clear(),this.emit("symbols-changed")),this.requestRender()}processed(){return this._processed}hasData(){return this.layerData.size>0}hasFeatures(){const e=this.layerData.values();for(const t of e)if(t.hasData())return!0;return!1}dispose(){"unloaded"!==this.status&&(m._destroyRenderBuckets(this.layerData),this.layerData.clear(),this.featureIndex=null,this._usedMemory=0,this.destroy(),this.status="unloaded")}release(){0==--this._referenced&&(this.dispose(),this.stage=null)}retain(){++this._referenced}get cachedMemory(){return this._usedMemory}get usedMemory(){return this._usedMemory}get usedMemoryPerReference(){return this._usedMemory/(this._referenced||1)}changeDataImpl(e){this.featureIndex?.clear();let t=!1;if(e){const{bucketsWithData:s,emptyBuckets:r}=e,a=this._createRenderBuckets(s);if(r&&r.byteLength>0){const e=new Uint32Array(r);for(const t of e)this._deleteLayerData(t)}for(const[e,i]of a)this._deleteLayerData(e),i.type===o.SYMBOL&&(this.symbols.set(e,i.symbols),t=!0),this._usedMemory+=i.usedMemory,this.layerData.set(e,i);this._memCache?.updateSize(this.key.id,this)}this._hasSymbolBuckets=!1;for(const s of this.layerData.values())s.type===o.SYMBOL&&(this._hasSymbolBuckets=!0);t&&this.emit("symbols-changed")}attachWithContext(e){this.stage={context:e,trashDisplayObject(e){e.processDetach()},untrashDisplayObject:()=>!1}}setTransform(a){super.setTransform(a);const i=this.resolution/(a.resolution*a.pixelRatio),o=this.width/this.rangeX*i,h=this.height/this.rangeY*i,n=[0,0];a.toScreen(n,[this.x,this.y]);const l=this.transforms.tileUnitsToPixels;e(l),t(l,l,n),s(l,l,Math.PI*a.rotation/180),r(l,l,[o,h,1])}_createTransforms(){return{displayViewScreenMat3:a(),tileMat3:a(),tileUnitsToPixels:a()}}static _destroyRenderBuckets(e){if(!e)return;const t=new Set;for(const s of e.values())t.has(s)||(s.destroy(),t.add(s));e.clear()}_createRenderBuckets(e){const t=new Map,s=new Map;for(const r of e){const e=this._deserializeBucket(r,s);for(const s of e.layerUIDs)t.set(s,e)}return t}_deserializeBucket(e,t){let s=t.get(e);if(s)return s;switch(new Uint32Array(e)[0]){case o.FILL:s=new c(e,this.styleRepository);break;case o.LINE:s=new l(e,this.styleRepository);break;case o.SYMBOL:s=new n(e,this.styleRepository,this);break;case o.CIRCLE:s=new h(e,this.styleRepository)}return t.set(e,s),s}_deleteLayerData(e){if(!this.layerData.has(e))return;const t=this.layerData.get(e);this._usedMemory-=t.usedMemory,t.destroy(),this.layerData.delete(e)}}export{m as VectorTile,y as tracer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{create as e}from"../../../../geometry/support/aaBoundingRect.js";import t from"../../../../layers/support/TileInfo.js";import{SymbolFader as s}from"./decluttering/SymbolFader.js";import{Visibility as r,StyleLayerType as i}from"./style/StyleDefinition.js";import{WGLDrawPhase as l}from"../webgl/enums.js";import{RenderableTile as o}from"../webgl/RenderableTile.js";import n from"../webgl/TileContainer.js";import a from"../../tiling/TileCoverage.js";import d from"../../tiling/TileKey.js";import{StencilOperation as h,CompareFunction as c,FramebufferBit as u,BlendFactor as y}from"../../../webgl/enums.js";const p=1e-6;function m(e,t){if(e){const s=e.getLayoutProperty("visibility");if(!s||s.getValue()!==r.NONE&&(void 0===e.minzoom||e.minzoom<t+p)&&(void 0===e.maxzoom||e.maxzoom>=t-p))return!0}return!1}class f extends n{constructor(e){super(e),this._backgroundTiles=[],this._computeDisplayInfoView(e)}destroy(){this.removeAllChildren(),this._spriteMosaic?.dispose(),this._spriteMosaic=null,this._glyphMosaic?.dispose(),this._glyphMosaic=null,null!=this._symbolFader&&(this._symbolFader.clear(),this._symbolFader=null),this._styleRepository=null,this._backgroundTiles=[]}get fading(){return this._symbolFader?.fading??!1}get symbolFader(){return this._symbolFader}get symbolRepository(){return this._symbolFader?.symbolRepository}setStyleResources(e,t,r,i){this._spriteMosaic=e,this._glyphMosaic=t,this._styleRepository=r,this.tileInfoView=i,this._computeDisplayInfoView(i),null==this._symbolFader&&(this._symbolFader=new s(this._styleRepository,this.children)),this._symbolFader.styleRepository=r}setSpriteMosaic(e){this._spriteMosaic?.dispose(),this._spriteMosaic=e}deleteStyleLayers(e){null!=this._symbolFader&&this._symbolFader.deleteStyleLayers(e)}createRenderParams(e){return{...super.createRenderParams(e),renderPass:null,styleLayer:null,styleLayerUID:-1,glyphMosaic:this._glyphMosaic,spriteMosaic:this._spriteMosaic,hasClipping:!!this._clippingInfos}}doRender(e){!this.visible||e.drawPhase!==l.MAP&&e.drawPhase!==l.DEBUG||void 0===this._spriteMosaic||super.doRender(e)}addChild(e){return super.addChild(e),null!=this._symbolFader?this._symbolFader.addTile(e):e.decluttered=!0,this.requestRender(),e}removeChild(e){return null!=this._symbolFader&&this._symbolFader.removeTile(e),this.requestRender(),super.removeChild(e)}renderChildren(e){const{drawPhase:t}=e;t!==l.DEBUG?this._doRender(e):super.renderChildren(e)}removeAllChildren(){for(let e=0;e<this.children.length;e++){const t=this.children[e];null!=this._symbolFader&&this._symbolFader.removeTile(t),t.dispose()}super.removeAllChildren()}getStencilTarget(){return this.children.filter((e=>e.neededForCoverage&&e.hasData()))}restartDeclutter(){null!=this._symbolFader&&this._symbolFader.restartDeclutter()}_doRender(e){const{context:t,state:s}=e,r=this._styleRepository;if(!r)return;const i=r.layers,o=this._displayInfo.scaleToZoom(s.scale);r.backgroundBucketIds.length>0&&(e.renderPass="background",this._renderBackgroundLayers(e,r.backgroundBucketIds,o)),super.renderChildren(e),e.drawPhase===l.MAP&&this._fade(o,s);const n=this.children.filter((e=>e.visible&&e.hasData()));if(!n||0===n.length)return t.bindVAO(),t.setStencilTestEnabled(!0),void t.setBlendingEnabled(!0);for(const l of n)l.triangleCount=0;t.setStencilWriteMask(0),t.setColorMask(!0,!0,!0,!0),t.setStencilOp(h.KEEP,h.KEEP,h.REPLACE),t.setStencilTestEnabled(!0),t.setBlendingEnabled(!1),t.setDepthTestEnabled(!0),t.setDepthWriteEnabled(!0),t.setDepthFunction(c.LEQUAL),t.setClearDepth(1),t.clear(u.DEPTH),e.renderPass="opaque";for(let l=i.length-1;l>=0;l--)this._renderStyleLayer(i[l],e,n);t.setDepthWriteEnabled(!1),t.setBlendingEnabled(!0),t.setBlendFunctionSeparate(y.ONE,y.ONE_MINUS_SRC_ALPHA,y.ONE,y.ONE_MINUS_SRC_ALPHA),e.renderPass="translucent";for(let l=0;l<i.length;l++)this._renderStyleLayer(i[l],e,n);t.bindVAO(),t.setStencilTestEnabled(!0),t.setBlendingEnabled(!0);for(const l of n)l.debugInfo.display.triangleCount=l.triangleCount}_fade(e,t){null!=this._symbolFader&&(this._symbolFader.update(e,t)||this.requestRender())}_renderStyleLayer(e,t,s){const{displayLevel:l,painter:o,renderPass:n}=t;if(void 0===e)return;const a=e.getLayoutProperty("visibility");if(a&&a.getValue()===r.NONE)return;let d;switch(e.type){case i.BACKGROUND:return;case i.FILL:if("opaque"!==n&&"translucent"!==t.renderPass)return;d="vtlFill";break;case i.LINE:if("translucent"!==n)return;d="vtlLine";break;case i.CIRCLE:if("translucent"!==n)return;d="vtlCircle";break;case i.SYMBOL:if("translucent"!==n)return;d="vtlSymbol"}if(s=e.type===i.SYMBOL?s.filter((e=>e.decluttered)):s.filter((e=>e.neededForCoverage)),"vtlSymbol"!==d&&(0===s.length||void 0!==e.minzoom&&e.minzoom>=l+p||void 0!==e.maxzoom&&e.maxzoom<l-p))return;const h=e.uid;t.styleLayerUID=h,t.styleLayer=e;for(const r of s)if(r.layerData.has(h)){o.renderObjects(t,s,d);break}}_renderBackgroundLayers(t,s,r){const{context:l,painter:n,state:u}=t,y=this._styleRepository;let p=!1;for(const e of s){if(y.getLayerById(e).type===i.BACKGROUND&&m(y.getLayerById(e),r)){p=!0;break}}if(!p)return;const f=this.tileInfoView,g=f.getTileCoverage(t.state,0,!0,"smallest"),{spans:b,lodInfo:_}=g,{level:C}=_,E=e(),L=[];if(this._renderPasses){const e=this._renderPasses[0];null!=this._clippingInfos&&(e.brushes[0].prepareState(t),e.brushes[0].drawMany(t,this._clippingInfos))}const F=this._backgroundTiles;let R,v=0;for(const{row:i,colFrom:a,colTo:h}of b)for(let t=a;t<=h;t++){if(v<F.length)R=F[v],R.key.set(C,i,_.normalizeCol(t),_.getWorldForColumn(t)),f.getTileBounds(E,R.key,!1),R.x=E[0],R.y=E[3],R.resolution=f.getTileResolution(C);else{const s=new d(C,i,_.normalizeCol(t),_.getWorldForColumn(t)),r=f.getTileBounds(e(),s),l=f.getTileResolution(C);R=new o(s,l,r[0],r[3],512,512,4096,4096),F.push(R)}R.setTransform(u),L.push(R),v++}l.setStencilWriteMask(0),l.setColorMask(!0,!0,!0,!0),l.setStencilOp(h.KEEP,h.KEEP,h.REPLACE),l.setStencilFunction(c.EQUAL,0,255),l.setStencilTestEnabled(!0);for(const e of s){const s=y.getLayerById(e);s.type===i.BACKGROUND&&m(s,r)&&(t.styleLayerUID=s.uid,t.styleLayer=s,n.renderObjects(t,L,"vtlBackground"))}a.pool.release(g)}_computeDisplayInfoView(e){let s=e.tileInfo.lods[0].scale;const r=Math.max(25,e.tileInfo.lods.length),i=[];for(let t=0;t<=r;t++)i.push(s),s/=2;this._displayInfo=t.create({scales:i,size:512,spatialReference:e.spatialReference,numLODs:r})}}export{f as VectorTileContainer};
5
+ import{create as e}from"../../../../geometry/support/aaBoundingRect.js";import t from"../../../../layers/support/TileInfo.js";import{tileCoordSize as s,tilePixelSize as r}from"./constants.js";import{SymbolFader as i}from"./decluttering/SymbolFader.js";import{writeOpacityToBuffers as l}from"./decluttering/util.js";import{Visibility as o,StyleLayerType as n}from"./style/StyleDefinition.js";import{WGLDrawPhase as a}from"../webgl/enums.js";import{RenderableTile as d}from"../webgl/RenderableTile.js";import c from"../webgl/TileContainer.js";import h from"../../tiling/TileCoverage.js";import u from"../../tiling/TileKey.js";import{StencilOperation as y,CompareFunction as p,FramebufferBit as m,BlendFactor as f}from"../../../webgl/enums.js";const g=1e-6;function b(e,t){if(e){const s=e.getLayoutProperty("visibility");if(!s||s.getValue()!==o.NONE&&(void 0===e.minzoom||e.minzoom<t+g)&&(void 0===e.maxzoom||e.maxzoom>=t-g))return!0}return!1}class _ extends c{constructor(e){super(e),this._backgroundTiles=[],this._computeDisplayInfoView(e)}destroy(){this.removeAllChildren(),this._spriteMosaic?.dispose(),this._spriteMosaic=null,this._glyphMosaic?.dispose(),this._glyphMosaic=null,null!=this._symbolFader&&(this._symbolFader.clear(),this._symbolFader=null),this._styleRepository=null,this._backgroundTiles=[]}get fading(){return this._symbolFader?.fading??!1}get symbolFader(){return this._symbolFader}get symbolRepository(){return this._symbolFader?.symbolRepository}setStyleResources(e,t,r,o){if(this._spriteMosaic=e,this._glyphMosaic=t,this._styleRepository=r,this.tileInfoView=o,this._computeDisplayInfoView(o),null==this._symbolFader){const e=(e,t)=>{e.allSymbolsFadingOut=!0,e.lastOpacityUpdate=t,l(e,t,!0),e.decluttered=!0,e.requestRender()};this._symbolFader=new i("vector-tile",this._styleRepository,e,this.children,s)}this._symbolFader.styleRepository=r}setSpriteMosaic(e){this._spriteMosaic?.dispose(),this._spriteMosaic=e}deleteStyleLayers(e){null!=this._symbolFader&&this._symbolFader.deleteStyleLayers(e)}createRenderParams(e){return{...super.createRenderParams(e),renderPass:null,styleLayer:null,styleLayerUID:-1,glyphMosaic:this._glyphMosaic,spriteMosaic:this._spriteMosaic,hasClipping:!!this._clippingInfos}}doRender(e){!this.visible||e.drawPhase!==a.MAP&&e.drawPhase!==a.DEBUG||void 0===this._spriteMosaic||super.doRender(e)}addChild(e){return super.addChild(e),null!=this._symbolFader?this._symbolFader.addTile(e):e.decluttered=!0,this.requestRender(),e}removeChild(e){return null!=this._symbolFader&&this._symbolFader.removeTile(e),this.requestRender(),super.removeChild(e)}renderChildren(e){const{drawPhase:t}=e;t!==a.DEBUG?this._doRender(e):super.renderChildren(e)}removeAllChildren(){for(let e=0;e<this.children.length;e++){const t=this.children[e];null!=this._symbolFader&&this._symbolFader.removeTile(t),t.dispose()}super.removeAllChildren()}getStencilTarget(){return this.children.filter((e=>e.neededForCoverage&&e.hasData()))}restartDeclutter(){null!=this._symbolFader&&this._symbolFader.restartDeclutter()}_doRender(e){const{context:t,state:s}=e,r=this._styleRepository;if(!r)return;const i=r.layers,l=this._displayInfo.scaleToZoom(s.scale);r.backgroundBucketIds.length>0&&(e.renderPass="background",this._renderBackgroundLayers(e,r.backgroundBucketIds,l)),super.renderChildren(e),e.drawPhase===a.MAP&&this._fade(l,s);const o=this.children.filter((e=>e.visible&&e.hasData()));if(!o||0===o.length)return t.bindVAO(),t.setStencilTestEnabled(!0),void t.setBlendingEnabled(!0);for(const n of o)n.triangleCount=0;t.setStencilWriteMask(0),t.setColorMask(!0,!0,!0,!0),t.setStencilOp(y.KEEP,y.KEEP,y.REPLACE),t.setStencilTestEnabled(!0),t.setBlendingEnabled(!1),t.setDepthTestEnabled(!0),t.setDepthWriteEnabled(!0),t.setDepthFunction(p.LEQUAL),t.setClearDepth(1),t.clear(m.DEPTH),e.renderPass="opaque";for(let n=i.length-1;n>=0;n--)this._renderStyleLayer(i[n],e,o);t.setDepthWriteEnabled(!1),t.setBlendingEnabled(!0),t.setBlendFunctionSeparate(f.ONE,f.ONE_MINUS_SRC_ALPHA,f.ONE,f.ONE_MINUS_SRC_ALPHA),e.renderPass="translucent";for(let n=0;n<i.length;n++)this._renderStyleLayer(i[n],e,o);t.bindVAO(),t.setStencilTestEnabled(!0),t.setBlendingEnabled(!0);for(const n of o)n.debugInfo.display.triangleCount=n.triangleCount}_fade(e,t){null!=this._symbolFader&&(this._symbolFader.update(e,t)||this.requestRender())}_renderStyleLayer(e,t,s){const{displayLevel:r,painter:i,renderPass:l}=t;if(void 0===e)return;const a=e.getLayoutProperty("visibility");if(a&&a.getValue()===o.NONE)return;let d;switch(e.type){case n.BACKGROUND:return;case n.FILL:if("opaque"!==l&&"translucent"!==t.renderPass)return;d="vtlFill";break;case n.LINE:if("translucent"!==l)return;d="vtlLine";break;case n.CIRCLE:if("translucent"!==l)return;d="vtlCircle";break;case n.SYMBOL:if("translucent"!==l)return;d="vtlSymbol"}if(s=e.type===n.SYMBOL?s.filter((e=>e.decluttered)):s.filter((e=>e.neededForCoverage)),"vtlSymbol"!==d&&(0===s.length||void 0!==e.minzoom&&e.minzoom>=r+g||void 0!==e.maxzoom&&e.maxzoom<r-g))return;const c=e.uid;t.styleLayerUID=c,t.styleLayer=e;for(const o of s)if(o.layerData.has(c)){i.renderObjects(t,s,d);break}}_renderBackgroundLayers(t,i,l){const{context:o,painter:a,state:c}=t,m=this._styleRepository;let f=!1;for(const e of i){if(m.getLayerById(e).type===n.BACKGROUND&&b(m.getLayerById(e),l)){f=!0;break}}if(!f)return;const g=this.tileInfoView,_=g.getTileCoverage(t.state,0,!0,"smallest"),{spans:C,lodInfo:E}=_,{level:F}=E,L=e(),R=[];if(this._renderPasses){const e=this._renderPasses[0];null!=this._clippingInfos&&(e.brushes[0].prepareState(t),e.brushes[0].drawMany(t,this._clippingInfos))}const v=this._backgroundTiles;let S,I=0;for(const{row:n,colFrom:h,colTo:y}of C)for(let t=h;t<=y;t++){if(I<v.length)S=v[I],S.key.set(F,n,E.normalizeCol(t),E.getWorldForColumn(t)),g.getTileBounds(L,S.key,!1),S.x=L[0],S.y=L[3],S.resolution=g.getTileResolution(F);else{const i=new u(F,n,E.normalizeCol(t),E.getWorldForColumn(t)),l=g.getTileBounds(e(),i),o=g.getTileResolution(F);S=new d(i,o,l[0],l[3],r,r,s,s),v.push(S)}S.setTransform(c),R.push(S),I++}o.setStencilWriteMask(0),o.setColorMask(!0,!0,!0,!0),o.setStencilOp(y.KEEP,y.KEEP,y.REPLACE),o.setStencilFunction(p.EQUAL,0,255),o.setStencilTestEnabled(!0);for(const e of i){const s=m.getLayerById(e);s.type===n.BACKGROUND&&b(s,l)&&(t.styleLayerUID=s.uid,t.styleLayer=s,a.renderObjects(t,R,"vtlBackground"))}h.pool.release(_)}_computeDisplayInfoView(e){let s=e.tileInfo.lods[0].scale;const i=Math.max(25,e.tileInfo.lods.length),l=[];for(let t=0;t<=i;t++)l.push(s),s/=2;this._displayInfo=t.create({scales:l,size:r,spatialReference:e.spatialReference,numLODs:i})}}export{_ as VectorTileContainer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../Graphic.js";import{getOrCreateMapValue as t}from"../../../../core/MapUtils.js";import s from"../../../../core/pbf.js";import{PooledRBush as r}from"../../../../core/libs/rbush/PooledRBush.js";import{BucketType as i}from"./enums.js";import o from"./Feature.js";import{getTileMargins as l}from"./GeometryUtils.js";import a from"./SourceLayerData.js";import{IndexItem as n}from"./style/StyleLayer.js";const y=8,c=512,u=4096,h=(e,t)=>{const s=e.vtlSymbol.sourceTile,r=t.vtlSymbol.sourceTile;return s.level!==r.level?s.level-r.level:s.row!==r.row?s.row-r.row:s.col!==r.col?s.col-r.col:e.styleLayerUID-t.styleLayerUID};class d{constructor(e,t,s,r,i){this.tileKey=e,this._tileLayerData=t,this._styleRepository=s,this._tileHandler=r,this._parentLayer=i,this._index=null,this._tileKeyToPBF=new Map}static create(e,t,s,r,i){return new d(e,t,s,r,i)}clear(){this._index?.clear(),this._tileKeyToPBF.clear()}async queryAttributes(e,t,s,i,o){if(0===this._tileLayerData.size||!this._styleRepository||!this._tileHandler)return[];null===this._index&&(this._index=new r(100,m),await this._indexLayers());const l=[];return this._queryIndex(l,e,t,s,this.tileKey.level,i),o&&o?.length>0&&await this._getSymbolsAttributes(l,o),l}async _indexLayers(){const e=this.tileKey,t=this._styleRepository.layers,s=await this._getTilePayload(e);for(const[r,o]of this._tileLayerData){const l=t[r],a=s.find((e=>e.sourceName===l.source));if(!a)continue;const{protobuff:n,key:y}=a;if(o.type!==i.SYMBOL){const t=1<<e.level-y.level,s=e.row-y.row*t,r=e.col-y.col*t;this._indexLayer(l,n,e.level,t,s,r)}}}_indexLayer(e,t,r,i,y,h){const d=e.sourceLayer,m=e.getFeatureFilter(),f=r,_=r+1,p=l(f),g=new s(new Uint8Array(t),new DataView(t));for(;g.next();)switch(g.tag()){case 3:{const t=g.getMessage(),s=new a(t);if(t.release(),s.name!==d)continue;const l=s.getData(),w=s.extent/i,x=w*h-p,b=w*y-p,I=x+w+2*p,L=b+w+2*p,v=w/c,D=u/w,T=w*h,S=w*y;for(;l.nextTag(2);){const t=l.getMessage(),i=new o(t,s);if(t.release(),m&&!m.filter(i,r))continue;const a=i.values||{},y=a._minzoom,c=a._maxzoom;if(y&&y>=10*_||c&&c<=10*f)continue;const u=e.getFeatureInflatedBounds(i,f,s.extent,v);null==u||u[0]>I||u[1]>L||u[2]<x||u[3]<b||(u[0]=(u[0]-T)*D,u[1]=(u[1]-S)*D,u[2]=(u[2]-T)*D,u[3]=(u[3]-S)*D,this._index.insert(new n(e,i,u,D,T,S)))}break}default:g.skip()}}async _getSymbolsAttributes(e,t){if(!t||0===t.length)return e;const s=[];t.sort(h);let r=t[0].styleLayerUID,i=0;for(let l=0;l<t.length;l++)r!==t[l].styleLayerUID&&(s.push({from:i,to:l,styleLayerUID:r,sourceTileKey:t[l].vtlSymbol.sourceTile}),i=l,r=t[l].styleLayerUID);s.push({from:i,to:t.length,styleLayerUID:r,sourceTileKey:t[t.length-1].vtlSymbol.sourceTile});const o=this._styleRepository.layers;for(const l of s){const s=await this._getTilePayload(l.sourceTileKey),i=o[l.styleLayerUID],a=!!i&&s.find((e=>e.sourceName===i.source));a&&this._addSymbolsAttributes(e,t.slice(l.from,l.to).map((e=>e.vtlSymbol)),r,a)}return e}_addSymbolsAttributes(t,s,r,i){const o=this._styleRepository.layers,l=i.key,a=this.tileKey,n=1<<a.level-l.level,y=a.row-l.row*n,c=a.col-l.col*n;this._getSymbolAttributes(i.protobuff,s,r,n,y,c).forEach((s=>{const{attributes:i,tilePoint:l}=s;t.push({layerId:o[r].id,layerIndex:r,graphic:new e({attributes:i,origin:{type:"vector-tile",layerId:o[r].id,layerIndex:r,layer:this._parentLayer}}),tilePoint:l})}))}_getSymbolAttributes(e,t,r,i,l,n){const y=[],c=this._styleRepository.layers;let h=0;t.sort(((e,t)=>e.featureIndex-t.featureIndex));const d=new s(new Uint8Array(e),new DataView(e));for(;d.next();)switch(d.tag()){case 3:{const e=d.getMessage(),s=new a(e);if(e.release(),s.name!==c[r].sourceLayer)continue;const m=s.getData(),f=s.extent/i,_=u/f,p=f*n,g=f*l;let w=0;for(;m.nextTag(2);){const e=m.getMessage();if(w++===t[h].featureIndex){const t=new o(e,s),r=t.values,i=t.getGeometry(),l=null!=i?[_*(i[0][0].x-p),_*(i[0][0].y-g)]:null;y.push({attributes:r,tilePoint:l}),h++}if(e.release(),h===t.length)return y}break}default:d.skip()}return y}_queryIndex(t,s,r,i,o,l){const a=y*i*(window.devicePixelRatio||1);return this._index?.search({minX:s-a,minY:r-a,maxX:s+a,maxY:r+a},(a=>{const{layer:n,feature:y}=a;n.isIntersectingFeature(s,r,i,y,o,l,a)&&t.push({layerId:n.id,layerIndex:n.uid,tilePoint:null,graphic:new e({attributes:y.values,origin:{type:"vector-tile",layerId:a.layer.id,layerIndex:a.layer.uid,layer:this._parentLayer}})})})),t}async _getTilePayload(e){return t(this._tileKeyToPBF,e.id,(()=>this._tileHandler.fetchTilePBFs(e))).then((e=>e))}}const m=e=>({minX:e.bounds[0],minY:e.bounds[1],maxX:e.bounds[2],maxY:e.bounds[3]});export{d as default};
5
+ import e from"../../../../Graphic.js";import{getOrCreateMapValue as t}from"../../../../core/MapUtils.js";import s from"../../../../core/pbf.js";import{PooledRBush as r}from"../../../../core/libs/rbush/PooledRBush.js";import{tilePixelSize as i,tileCoordSize as o,tilePixelRatio as l}from"./constants.js";import{BucketType as n}from"./enums.js";import a from"./Feature.js";import{getTileMargins as y}from"./GeometryUtils.js";import c from"./SourceLayerData.js";import{IndexItem as u}from"./style/StyleLayer.js";const h=(e,t)=>{const s=e.vtlSymbol.sourceTile,r=t.vtlSymbol.sourceTile;return s.level!==r.level?s.level-r.level:s.row!==r.row?s.row-r.row:s.col!==r.col?s.col-r.col:e.styleLayerUID-t.styleLayerUID};class d{constructor(e,t,s,r,i){this.tileKey=e,this._tileLayerData=t,this._styleRepository=s,this._tileHandler=r,this._parentLayer=i,this._index=null,this._tileKeyToPBF=new Map}static create(e,t,s,r,i){return new d(e,t,s,r,i)}clear(){this._index?.clear(),this._tileKeyToPBF.clear()}async queryAttributes(e,t,s,i,o){if(0===this._tileLayerData.size||!this._styleRepository||!this._tileHandler)return[];null===this._index&&(this._index=new r(100,m),await this._indexLayers());const l=[];return this._queryIndex(l,e,t,s,this.tileKey.level,i),o&&o?.length>0&&await this._getSymbolsAttributes(l,o),l}async _indexLayers(){const e=this.tileKey,t=this._styleRepository.layers,s=await this._getTilePayload(e);for(const[r,i]of this._tileLayerData){const o=t[r],l=s.find((e=>e.sourceName===o.source));if(!l)continue;const{protobuff:a,key:y}=l;if(i.type!==n.SYMBOL){const t=1<<e.level-y.level,s=e.row-y.row*t,r=e.col-y.col*t;this._indexLayer(o,a,e.level,t,s,r)}}}_indexLayer(e,t,r,l,n,h){const d=e.sourceLayer,m=e.getFeatureFilter(),f=r,_=r+1,p=y(f),g=new s(new Uint8Array(t),new DataView(t));for(;g.next();)switch(g.tag()){case 3:{const t=g.getMessage(),s=new c(t);if(t.release(),s.name!==d)continue;const y=s.getData(),w=s.extent/l,x=w*h-p,b=w*n-p,I=x+w+2*p,L=b+w+2*p,v=w/i,D=o/w,T=w*h,S=w*n;for(;y.nextTag(2);){const t=y.getMessage(),i=new a(t,s);if(t.release(),m&&!m.filter(i,r))continue;const o=i.values||{},l=o._minzoom,n=o._maxzoom;if(l&&l>=10*_||n&&n<=10*f)continue;const c=e.getFeatureInflatedBounds(i,f,s.extent,v);null==c||c[0]>I||c[1]>L||c[2]<x||c[3]<b||(c[0]=(c[0]-T)*D,c[1]=(c[1]-S)*D,c[2]=(c[2]-T)*D,c[3]=(c[3]-S)*D,this._index.insert(new u(e,i,c,D,T,S)))}break}default:g.skip()}}async _getSymbolsAttributes(e,t){if(!t||0===t.length)return e;const s=[];t.sort(h);let r=t[0].styleLayerUID,i=0;for(let l=0;l<t.length;l++)r!==t[l].styleLayerUID&&(s.push({from:i,to:l,styleLayerUID:r,sourceTileKey:t[l].vtlSymbol.sourceTile}),i=l,r=t[l].styleLayerUID);s.push({from:i,to:t.length,styleLayerUID:r,sourceTileKey:t[t.length-1].vtlSymbol.sourceTile});const o=this._styleRepository.layers;for(const l of s){const s=await this._getTilePayload(l.sourceTileKey),i=o[l.styleLayerUID],n=!!i&&s.find((e=>e.sourceName===i.source));n&&this._addSymbolsAttributes(e,t.slice(l.from,l.to).map((e=>e.vtlSymbol)),r,n)}return e}_addSymbolsAttributes(t,s,r,i){const o=this._styleRepository.layers,l=i.key,n=this.tileKey,a=1<<n.level-l.level,y=n.row-l.row*a,c=n.col-l.col*a;this._getSymbolAttributes(i.protobuff,s,r,a,y,c).forEach((s=>{const{attributes:i,tilePoint:l}=s;t.push({layerId:o[r].id,layerIndex:r,graphic:new e({attributes:i,origin:{type:"vector-tile",layerId:o[r].id,layerIndex:r,layer:this._parentLayer}}),tilePoint:l})}))}_getSymbolAttributes(e,t,r,i,l,n){const y=[],u=this._styleRepository.layers;let h=0;t.sort(((e,t)=>e.featureIndex-t.featureIndex));const d=new s(new Uint8Array(e),new DataView(e));for(;d.next();)switch(d.tag()){case 3:{const e=d.getMessage(),s=new c(e);if(e.release(),s.name!==u[r].sourceLayer)continue;const m=s.getData(),f=s.extent/i,_=o/f,p=f*n,g=f*l;let w=0;for(;m.nextTag(2);){const e=m.getMessage();if(w++===t[h].featureIndex){const t=new a(e,s),r=t.values,i=t.getGeometry(),o=null!=i?[_*(i[0][0].x-p),_*(i[0][0].y-g)]:null;y.push({attributes:r,tilePoint:o}),h++}if(e.release(),h===t.length)return y}break}default:d.skip()}return y}_queryIndex(t,s,r,i,o,n){const a=l*i*(window.devicePixelRatio||1);return this._index?.search({minX:s-a,minY:r-a,maxX:s+a,maxY:r+a},(l=>{const{layer:a,feature:y}=l;a.isIntersectingFeature(s,r,i,y,o,n,l)&&t.push({layerId:a.id,layerIndex:a.uid,tilePoint:null,graphic:new e({attributes:y.values,origin:{type:"vector-tile",layerId:l.layer.id,layerIndex:l.layer.uid,layer:this._parentLayer}})})})),t}async _getTilePayload(e){return t(this._tileKeyToPBF,e.id,(()=>this._tileHandler.fetchTilePBFs(e))).then((e=>e))}}const m=e=>({minX:e.bounds[0],minY:e.bounds[1],maxX:e.bounds[2],maxY:e.bounds[3]});export{d as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{set as e,identity as t,translate as i,rotate as s,multiply as l}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{toRadian as r}from"../../../../core/libs/gl-matrix-2/math/common.js";import"../../tiling/TileInfoView.js";import a from"../../tiling/TileKey.js";import"../../tiling/TileQueue.js";import"../../tiling/TileStrategy.js";import{declutterSingleTile as o}from"./decluttering/jobsUtil.js";import{StyleLayerType as d}from"./style/StyleDefinition.js";import{RenderableTile as c}from"../webgl/RenderableTile.js";import{TileReshuffleManager as h}from"../webgl/TileReshuffleManager.js";import{CompareFunction as u,StencilOperation as m}from"../../../webgl/enums.js";const p=.125;class g{constructor(){this._renderParams={reshuffleManager:new h,context:null,drawPhase:1,state:new f,stationary:!0,pixelRatio:1,displayLevel:-1,requiredLevel:-1,globalOpacity:1,renderPass:"background",styleLayer:null,styleLayerUID:-1,painter:null,glyphMosaic:null,spriteMosaic:null,profiler:null,renderingOptions:null,requestRender:null,allowDelayedRender:!1,deltaTime:-1,timeline:null,time:0,hasClipping:!1,blendMode:null,dataUploadCounter:0,effects:null,inFadeTransition:!1,requireFBO:!1,highlightGradient:null,stencilSymbols:!0,is3D:!0,backgroundColor:null},this._backgroundTile=new c(new a(0,0,0,0),0,0,0,512,512,4096,4096),this._heading=0,this._declutteredForHeading=new WeakMap}dispose(){this._renderParams=null}renderBackground(e,t,i,s,l,n,r,a,o,d){const c=this._backgroundTile;this._updateRenderParameters(e,t,c,i,l,n,r,a,o,d),this._renderParams.stencilSymbols=!1,i.drawBackground(this._renderParams,c,s)}renderContent(e,t,i,s,l,n,r,a,o,d,c,h){this._declutter(i),s.forAll((({sourceLayerInfo:{data:e}})=>this._declutter(e)));const m=s.length>0;m&&this._stencilSymbols(e,t,i,s,l,n,r,a,o,d,c,h);let p=1;i.stencilRef=m?p:0,e.setStencilFunction(u.EQUAL,i.stencilRef,255),this._render(e,t,i,l,n,r,a,o,d,c,h),s.forAll((({sourceLod:t,offset:i,sourceLayerInfo:{data:s}})=>{s.stencilRef=++p,this._renderSymbols(e,t,s,l,n,r,a,i,d,c,h)}))}_stencilSymbols(e,t,i,s,l,n,r,a,o,d,c,h){let p=1;i.stencilRef=p,e.setDepthTestEnabled(!1),e.setDepthWriteEnabled(!1),e.setStencilTestEnabled(!0),e.setBlendingEnabled(!1),e.setColorMask(!1,!1,!1,!1),e.setStencilOp(m.KEEP,m.KEEP,m.REPLACE),e.setStencilWriteMask(255),e.setStencilFunction(u.ALWAYS,i.stencilRef,255),this._stencilTileSymbols(e,t,i,l,n,r,a,o,d,c,h),s.forAll((({sourceLod:t,offset:i,sourceLayerInfo:{data:s}})=>{s.stencilRef=++p,e.setStencilFunction(u.ALWAYS,s.stencilRef,255),this._stencilTileSymbols(e,t,s,l,n,r,a,i,d,c,h)})),e.setStencilWriteMask(0),e.setBlendingEnabled(!0),e.setDepthTestEnabled(!0),e.setColorMask(!0,!0,!0,!0)}_renderSymbols(e,t,i,s,l,n,r,a,o,c,h){e.setStencilFunction(u.EQUAL,i.stencilRef,255),this._render(e,t,i,s,l,n,r,a,o,c,h,d.SYMBOL)}_render(e,t,i,s,l,n,r,a,o,d,c,h){this._updateRenderParameters(e,t,i,s,n,r,a,o,d,c),this._renderParams.stencilSymbols=!1,s.drawTile(this._renderParams,i,l,h)}_stencilTileSymbols(e,t,i,s,l,n,r,a,o,d,c){this._updateRenderParameters(e,t,i,s,n,r,a,o,d,c),this._renderParams.stencilSymbols=!0,i.triangleCount=0,s.drawSymbols(this._renderParams,i,l)}_updateRenderParameters(n,a,o,d,c,h,u,m,g,f){"type"in o&&"vector-tile"===o.type&&!o.stage&&o.attachWithContext(n);const y=a[0]-c.getLevelShift(a[0]),_=this._renderParams;_.context=n,_.painter=d,_.glyphMosaic=d.glyphMosaic,_.spriteMosaic=d.spriteMosaic,_.pixelRatio=g*f,_.displayLevel=y,_.requiredLevel=y;const b=c.getScale(a[0]),[S,M]=c.getOffset(a,h*b),w=p*h*b/m,R=o.transforms.displayViewScreenMat3;R[0]=w,R[4]=-w,R[6]=-1-S-u[0]*h*2,R[7]=1+M+(1-u[1])*h*2-2;const T=_.state,L=m/f;T.size[0]=L,T.size[1]=L,T.pixelRatio=f,T.rotation=(360-this._heading)%360;const P=2/L;e(T.displayViewMat3,P,0,0,0,-P,0,-1,1,1);const E=t(T.displayMat3),j=r(this._heading);i(E,E,[L/2,L/2]),s(E,E,j),i(E,E,[-L/2,-L/2]),l(E,T.displayViewMat3,E)}updateHeading(e){this._heading=e}_declutter(e){this._declutteredForHeading.get(e)!==this._heading&&(o(e,(360-this._heading)%360),this._declutteredForHeading.set(e,this._heading))}}class f{constructor(){this.size=[0,0],this.pixelRatio=1,this.rotation=0,this.displayMat3=n(),this.displayViewMat3=n(),this.transform=null,this.inverseTransform=null,this.viewMat2d=null,this.viewMat3=null,this.id=0,this.extent=null,this.center=null,this.scale=1,this.resolution=0,this.worldScreenWidth=0,this.spatialReference=null,this.viewpoint=null,this.getScreenTransform=null,this.toMap=null,this.toScreen=null,this.clone=null,this.copy=null,this.toJSON=null}}export{g as VectorTileRendererHelper3D};
5
+ import{set as e,identity as t,translate as i,rotate as s,multiply as l}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{toRadian as r}from"../../../../core/libs/gl-matrix-2/math/common.js";import"../../tiling/TileInfoView.js";import a from"../../tiling/TileKey.js";import"../../tiling/TileQueue.js";import"../../tiling/TileStrategy.js";import{tilePixelSize as o,tileCoordSize as d,tileCoordinateScale as c}from"./constants.js";import{declutterSingleTile as h}from"./decluttering/jobsUtil.js";import{StyleLayerType as u}from"./style/StyleDefinition.js";import{RenderableTile as m}from"../webgl/RenderableTile.js";import{TileReshuffleManager as p}from"../webgl/TileReshuffleManager.js";import{CompareFunction as g,StencilOperation as f}from"../../../webgl/enums.js";class y{constructor(){this._renderParams={reshuffleManager:new p,context:null,drawPhase:1,state:new _,stationary:!0,pixelRatio:1,displayLevel:-1,requiredLevel:-1,globalOpacity:1,renderPass:"background",styleLayer:null,styleLayerUID:-1,painter:null,glyphMosaic:null,spriteMosaic:null,profiler:null,renderingOptions:null,requestRender:null,allowDelayedRender:!1,deltaTime:-1,timeline:null,time:0,hasClipping:!1,blendMode:null,dataUploadCounter:0,effects:null,inFadeTransition:!1,requireFBO:!1,highlightGradient:null,stencilSymbols:!0,is3D:!0,backgroundColor:null},this._backgroundTile=new m(new a(0,0,0,0),0,0,0,o,o,d,d),this._heading=0,this._declutteredForHeading=new WeakMap}dispose(){this._renderParams=null}renderBackground(e,t,i,s,l,n,r,a,o,d){const c=this._backgroundTile;this._updateRenderParameters(e,t,c,i,l,n,r,a,o,d),this._renderParams.stencilSymbols=!1,i.drawBackground(this._renderParams,c,s)}renderContent(e,t,i,s,l,n,r,a,o,d,c,h){this._declutter(i),s.forAll((({sourceLayerInfo:{data:e}})=>this._declutter(e)));const u=s.length>0;u&&this._stencilSymbols(e,t,i,s,l,n,r,a,o,d,c,h);let m=1;i.stencilRef=u?m:0,e.setStencilFunction(g.EQUAL,i.stencilRef,255),this._render(e,t,i,l,n,r,a,o,d,c,h),s.forAll((({sourceLod:t,offset:i,sourceLayerInfo:{data:s}})=>{s.stencilRef=++m,this._renderSymbols(e,t,s,l,n,r,a,i,d,c,h)}))}_stencilSymbols(e,t,i,s,l,n,r,a,o,d,c,h){let u=1;i.stencilRef=u,e.setDepthTestEnabled(!1),e.setDepthWriteEnabled(!1),e.setStencilTestEnabled(!0),e.setBlendingEnabled(!1),e.setColorMask(!1,!1,!1,!1),e.setStencilOp(f.KEEP,f.KEEP,f.REPLACE),e.setStencilWriteMask(255),e.setStencilFunction(g.ALWAYS,i.stencilRef,255),this._stencilTileSymbols(e,t,i,l,n,r,a,o,d,c,h),s.forAll((({sourceLod:t,offset:i,sourceLayerInfo:{data:s}})=>{s.stencilRef=++u,e.setStencilFunction(g.ALWAYS,s.stencilRef,255),this._stencilTileSymbols(e,t,s,l,n,r,a,i,d,c,h)})),e.setStencilWriteMask(0),e.setBlendingEnabled(!0),e.setDepthTestEnabled(!0),e.setColorMask(!0,!0,!0,!0)}_renderSymbols(e,t,i,s,l,n,r,a,o,d,c){e.setStencilFunction(g.EQUAL,i.stencilRef,255),this._render(e,t,i,s,l,n,r,a,o,d,c,u.SYMBOL)}_render(e,t,i,s,l,n,r,a,o,d,c,h){this._updateRenderParameters(e,t,i,s,n,r,a,o,d,c),this._renderParams.stencilSymbols=!1,s.drawTile(this._renderParams,i,l,h)}_stencilTileSymbols(e,t,i,s,l,n,r,a,o,d,c){this._updateRenderParameters(e,t,i,s,n,r,a,o,d,c),this._renderParams.stencilSymbols=!0,i.triangleCount=0,s.drawSymbols(this._renderParams,i,l)}_updateRenderParameters(n,a,o,d,h,u,m,p,g,f){"type"in o&&"vector-tile"===o.type&&!o.stage&&o.attachWithContext(n);const y=a[0]-h.getLevelShift(a[0]),_=this._renderParams;_.context=n,_.painter=d,_.glyphMosaic=d.glyphMosaic,_.spriteMosaic=d.spriteMosaic,_.pixelRatio=g*f,_.displayLevel=y,_.requiredLevel=y;const b=h.getScale(a[0]),[S,M]=h.getOffset(a,u*b),w=c*u*b/p,R=o.transforms.displayViewScreenMat3;R[0]=w,R[4]=-w,R[6]=-1-S-m[0]*u*2,R[7]=1+M+(1-m[1])*u*2-2;const T=_.state,L=p/f;T.size[0]=L,T.size[1]=L,T.pixelRatio=f,T.rotation=(360-this._heading)%360;const P=2/L;e(T.displayViewMat3,P,0,0,0,-P,0,-1,1,1);const j=t(T.displayMat3),E=r(this._heading);i(j,j,[L/2,L/2]),s(j,j,E),i(j,j,[-L/2,-L/2]),l(j,T.displayViewMat3,j)}updateHeading(e){this._heading=e}_declutter(e){this._declutteredForHeading.get(e)!==this._heading&&(h(e,(360-this._heading)%360),this._declutteredForHeading.set(e,this._heading))}}class _{constructor(){this.size=[0,0],this.pixelRatio=1,this.rotation=0,this.displayMat3=n(),this.displayViewMat3=n(),this.transform=null,this.inverseTransform=null,this.viewMat2d=null,this.viewMat3=null,this.id=0,this.extent=null,this.center=null,this.scale=1,this.resolution=0,this.worldScreenWidth=0,this.spatialReference=null,this.viewpoint=null,this.getScreenTransform=null,this.toMap=null,this.toScreen=null,this.clone=null,this.copy=null,this.toJSON=null}}export{y as VectorTileRendererHelper3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- class t{constructor(t,e,s){this.layerExtent=4096,this._features=[],this.layer=t,this.zoom=e,this._spriteInfo=s,this._filter=t.getFeatureFilter()}pushFeature(t){this._filter&&!this._filter.filter(t,this.zoom)||this._features.push(t)}hasFeatures(){return this._features.length>0}getResources(t,e,s){}}export{t as default};
5
+ import{tileCoordSize as t}from"../constants.js";class e{constructor(e,s,r){this.layerExtent=t,this._features=[],this.layer=e,this.zoom=s,this._spriteInfo=r,this._filter=e.getFeatureFilter()}pushFeature(t){this._filter&&!this._filter.filter(t,this.zoom)||this._features.push(t)}hasFeatures(){return this._features.length>0}getResources(t,e,s){}}export{e as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../../core/BidiEngine.js";import{assertIsSome as t}from"../../../../../core/maybe.js";import{numericHash as n}from"../../../../../core/string.js";import{GeometryType as i,Point as s}from"../../../../../geometry/support/TileClipper.js";import{BucketType as a}from"../enums.js";import{cDegToRad as o,log2 as r,interpolate as l}from"../GeometryUtils.js";import{tilePixelRatio as h,Anchor as x,tileCoordSize as c}from"../Placement.js";import{sdfGlyphSize as d,TextShaping as f}from"../TextShaping.js";import g from"./BaseBucket.js";import{TextTransform as y,SymbolPlacement as m,RotationAlignment as u,TextWritingMode as p,SymbolAnchor as _,TextJustification as M}from"../style/StyleDefinition.js";import{IconLayout as P,TextLayout as I}from"../style/StyleLayer.js";const b=10;function A(e,t){return e.iconMosaicItem&&t.iconMosaicItem?e.iconMosaicItem.page===t.iconMosaicItem.page?0:e.iconMosaicItem.page-t.iconMosaicItem.page:e.iconMosaicItem&&!t.iconMosaicItem?1:!e.iconMosaicItem&&t.iconMosaicItem?-1:0}class L extends g{constructor(e,t,n,i,s,o,r,l,h){super(t,n,h.getSpriteItems()),this.type=a.SYMBOL,this._markerMap=new Map,this._glyphMap=new Map,this._glyphBufferDataStorage=new Map,this._isIconSDF=!1,this._sourceTileKey=e,this._iconVertexBuffer=i,this._iconIndexBuffer=s,this._textVertexBuffer=o,this._textIndexBuffer=r,this._placementEngine=l,this._workerTileHandler=h}get markerPageMap(){return this._markerMap}get glyphsPageMap(){return this._glyphMap}get symbolInstances(){return this._symbolInstances}static{this._bidiEngine=new e}getResources(e,t,i){const s=this.layer,a=this.zoom;e&&e.setExtent(this.layerExtent);const o=s.getLayoutProperty("icon-image"),r=s.getLayoutProperty("text-field");let l=s.getLayoutProperty("text-transform"),h=s.getLayoutProperty("text-font");const x=[];let c,d,f,g;o&&!o.isDataDriven&&(c=o.getValue(a)),r&&!r.isDataDriven&&(d=r.getValue(a)),l&&l.isDataDriven||(f=s.getLayoutValue("text-transform",a),l=null),h&&h.isDataDriven||(g=s.getLayoutValue("text-font",a),h=null);for(const m of this._features){const u=m.getGeometry(e);if(!u||0===u.length)continue;let p,_;o&&(p=o.isDataDriven?o.getValue(a,m):this._replaceKeys(c,m.values),p&&t(p));let M=!1;if(r&&(_=r.isDataDriven?r.getValue(a,m):this._replaceKeys(d,m.values),_)){switch(_=_.replaceAll("\\n","\n"),l&&(f=l.getValue(a,m)),f){case y.LOWERCASE:_=_.toLowerCase();break;case y.UPPERCASE:_=_.toUpperCase()}if(L._bidiEngine.hasBidiChar(_)){let e;e="rtl"===L._bidiEngine.checkContextual(_)?"IDNNN":"ICNNN",_=L._bidiEngine.bidiTransform(_,e,"VLYSN"),M=!0}if(_.length>0){h&&(g=h.getValue(a,m));for(const e of g){let t=i[e];t||(t=i[e]=new Set);for(const e of _){const n=e.codePointAt(0);null!=n&&t.add(n)}}}}if(!p&&!_)continue;const P=s.getLayoutValue("symbol-sort-key",a,m),I={feature:m,sprite:p,label:_,rtl:M,geometry:u,hash:(_?n(_):0)^(p?n(p):0),priority:P,textFont:g};x.push(I)}this._symbolFeatures=x}processFeatures(e){e&&e.setExtent(this.layerExtent);const n=this.layer,s=this.zoom,a=n.getLayoutValue("symbol-placement",s),r=a!==m.POINT,l=n.getLayoutValue("symbol-spacing",s)*h,g=n.getLayoutProperty("icon-image"),y=n.getLayoutProperty("text-field"),b=g?new P(n,s,r):null,T=y?new I(n,s,r):null,V=this._workerTileHandler;let w;g&&(w=V.getSpriteItems()),this._iconIndexStart=3*this._iconIndexBuffer.index,this._textIndexStart=3*this._textIndexBuffer.index,this._iconIndexCount=0,this._textIndexCount=0,this._markerMap.clear(),this._glyphMap.clear();const B=[];let C=1;T?.size&&(C=T.size/d);const R=T?T.maxAngle*o:0,D=T?T.size*h:0;for(const o of this._symbolFeatures){let e;b&&w&&o.sprite&&(e=w[o.sprite],e&&e.sdf&&(this._isIconSDF=!0));let n;!!e&&b.update(s,o.feature);let g=0;const y=o.label;if(y){t(T),T.update(s,o.feature);const e=r&&T.rotationAlignment===u.MAP?T.keepUpright:T.writingMode&&T.writingMode.includes(p.VERTICAL);let i=.5;switch(T.anchor){case _.TOP_LEFT:case _.LEFT:case _.BOTTOM_LEFT:i=0;break;case _.TOP_RIGHT:case _.RIGHT:case _.BOTTOM_RIGHT:i=1}let a=.5;switch(T.anchor){case _.TOP_LEFT:case _.TOP:case _.TOP_RIGHT:a=0;break;case _.BOTTOM_LEFT:case _.BOTTOM:case _.BOTTOM_RIGHT:a=1}let l=.5;switch(T.justify){case M.AUTO:l=i;break;case M.LEFT:l=0;break;case M.RIGHT:l=1}const x=T.letterSpacing*d,c=r?0:T.maxWidth*d,m=T.lineHeight*d,P=o.textFont.map((e=>V.getGlyphItems(e)));if(n=new f(P,c,m,x,i,a,l).getShaping(y,o.rtl,e),n&&n.length>0){let e=1e30,t=-1e30;for(const i of n)e=Math.min(e,i.x),t=Math.max(t,i.x);g=(t-e+2*d)*C*h}}for(let t of o.geometry){const s=[];if(a===m.LINE){if(n?.length&&T?.size){const e=T.size*h*(2+Math.min(2,4*Math.abs(T.offset[1])));t=L._smoothVertices(t,e)}L._pushAnchors(s,t,l,g)}else a===m.LINE_CENTER?L._pushCenterAnchor(s,t):o.feature.type===i.Polygon?L._pushCentroid(s,t):s.push(new x(t[0].x,t[0].y));for(const i of s){if(i.x<0||i.x>c||i.y<0||i.y>c)continue;if(r&&g>0&&T?.rotationAlignment===u.MAP&&!L._honorsTextMaxAngle(t,i,g,R,D))continue;const s={shaping:n,line:t,iconMosaicItem:e,anchor:i,symbolFeature:o,textColliders:[],iconColliders:[],textVertexRanges:[],iconVertexRanges:[]};B.push(s),this._processFeature(s,b,T)}}}B.sort(A),this._addPlacedGlyphs(),this._symbolInstances=B}serialize(){let e=14;e+=this.layerUIDs.length,e+=3*this.markerPageMap.size,e+=3*this.glyphsPageMap.size,e+=L._symbolsSerializationLength(this._symbolInstances),e+=this._iconVertexBuffer.array.length,e+=this._iconIndexBuffer.array.length,e+=this._textVertexBuffer.array.length,e+=this._textIndexBuffer.array.length;const t=new Uint32Array(e),n=new Int32Array(t.buffer),i=new Float32Array(t.buffer),[s,a,o]=this._sourceTileKey.split("/");let r=0;t[r++]=this.type,t[r++]=this.layerUIDs.length;for(let l=0;l<this.layerUIDs.length;l++)t[r++]=this.layerUIDs[l];t[r++]=this._isIconSDF?1:0,t[r++]=parseFloat(s),t[r++]=parseFloat(a),t[r++]=parseFloat(o),t[r++]=this.markerPageMap.size;for(const[l,[h,x]]of this.markerPageMap)t[r++]=l,t[r++]=h,t[r++]=x;t[r++]=this.glyphsPageMap.size;for(const[l,[h,x]]of this.glyphsPageMap)t[r++]=l,t[r++]=h,t[r++]=x;t[r++]=this._iconVertexBuffer.index/4,t[r++]=this._textVertexBuffer.index/4,r=L.serializeSymbols(t,n,i,r,this._symbolInstances),t[r++]=this._iconVertexBuffer.array.length;for(let l=0;l<this._iconVertexBuffer.array.length;l++)n[r++]=this._iconVertexBuffer.array[l];t[r++]=this._iconIndexBuffer.array.length;for(let l=0;l<this._iconIndexBuffer.array.length;l++)t[r++]=this._iconIndexBuffer.array[l];t[r++]=this._textVertexBuffer.array.length;for(let l=0;l<this._textVertexBuffer.array.length;l++)n[r++]=this._textVertexBuffer.array[l];t[r++]=this._textIndexBuffer.array.length;for(let l=0;l<this._textIndexBuffer.array.length;l++)t[r++]=this._textIndexBuffer.array[l];return t.buffer}static _symbolsSerializationLength(e){let t=0;t+=1;for(const n of e||[]){t+=5,t+=1;for(const e of n.textColliders)t+=b;for(const e of n.iconColliders)t+=b;t+=1,t+=2*n.textVertexRanges.length,t+=1,t+=2*n.iconVertexRanges.length}return t}static serializeSymbols(e,t,n,i,s){s=s||[],t[i++]=s.length;for(const a of s){t[i++]=a.anchor.x,t[i++]=a.anchor.y,t[i++]=a.symbolFeature.hash,t[i++]=a.symbolFeature.priority,t[i++]=a.symbolFeature.feature.featureIndex,t[i++]=a.textColliders.length+a.iconColliders.length;for(const e of a.textColliders)t[i++]=e.xTile,t[i++]=e.yTile,t[i++]=e.dxPixels,t[i++]=e.dyPixels,t[i++]=e.hard?1:0,t[i++]=e.partIndex,n[i++]=e.minLod,n[i++]=e.maxLod,t[i++]=e.width,t[i++]=e.height;for(const e of a.iconColliders)t[i++]=e.xTile,t[i++]=e.yTile,t[i++]=e.dxPixels,t[i++]=e.dyPixels,t[i++]=e.hard?1:0,t[i++]=e.partIndex,n[i++]=e.minLod,n[i++]=e.maxLod,t[i++]=e.width,t[i++]=e.height;t[i++]=a.textVertexRanges.length;for(const[e,n]of a.textVertexRanges)t[i++]=e,t[i++]=n;t[i++]=a.iconVertexRanges.length;for(const[e,n]of a.iconVertexRanges)t[i++]=e,t[i++]=n}return i}_replaceKeys(e,t){return e.replaceAll(/{([^{}]+)}/g,((e,n)=>n in t?t[n]:""))}_processFeature(e,t,n){const{line:i,iconMosaicItem:s,shaping:a,anchor:o}=e,l=this.zoom,h=this.layer,x=!!s;let c=!0;x&&(c=t?.optional||!s);const d=a&&a.length>0,f=!d||n?.optional;let g,y;if(x&&(g=this._placementEngine.getIconPlacement(o,s,t)),(g||c)&&(d&&(y=this._placementEngine.getTextPlacement(o,a,i,n)),y||f)){if(g&&y||(f||c?f||y?c||g||(y=null):g=null:(g=null,y=null)),y){const t=h.hasDataDrivenText?h.textMaterial.encodeAttributes(e.symbolFeature.feature,l,h):null;if(this._storePlacedGlyphs(e,y.shapes,l,n.rotationAlignment,t),y.textColliders){e.textColliders=y.textColliders;for(const e of y.textColliders){e.minLod=Math.max(l+r(e.minLod),0),e.maxLod=Math.min(l+r(e.maxLod),25);const t=e.angle;if(t){const n=Math.cos(t),i=Math.sin(t),s=e.dxPixels*n-e.dyPixels*i,a=e.dxPixels*i+e.dyPixels*n,o=(e.dxPixels+e.width)*n-e.dyPixels*i,r=(e.dxPixels+e.width)*i+e.dyPixels*n,l=e.dxPixels*n-(e.dyPixels+e.height)*i,h=e.dxPixels*i+(e.dyPixels+e.height)*n,x=(e.dxPixels+e.width)*n-(e.dyPixels+e.height)*i,c=(e.dxPixels+e.width)*i+(e.dyPixels+e.height)*n,d=Math.min(s,o,l,x),f=Math.max(s,o,l,x),g=Math.min(a,r,h,c),y=Math.max(a,r,h,c);e.dxPixels=d,e.dyPixels=g,e.width=f-d,e.height=y-g}}}}if(g){const n=h.hasDataDrivenIcon?h.iconMaterial.encodeAttributes(e.symbolFeature.feature,l,h):null;if(this._addPlacedIcons(e,g.shapes,l,s.page,t.rotationAlignment===u.VIEWPORT,n),g.iconColliders){e.iconColliders=g.iconColliders;for(const e of g.iconColliders){e.minLod=Math.max(l+r(e.minLod),0),e.maxLod=Math.min(l+r(e.maxLod),25);const t=e.angle;if(t){const n=Math.cos(t),i=Math.sin(t),s=e.dxPixels*n-e.dyPixels*i,a=e.dxPixels*i+e.dyPixels*n,o=(e.dxPixels+e.width)*n-e.dyPixels*i,r=(e.dxPixels+e.width)*i+e.dyPixels*n,l=e.dxPixels*n-(e.dyPixels+e.height)*i,h=e.dxPixels*i+(e.dyPixels+e.height)*n,x=(e.dxPixels+e.width)*n-(e.dyPixels+e.height)*i,c=(e.dxPixels+e.width)*i+(e.dyPixels+e.height)*n,d=Math.min(s,o,l,x),f=Math.max(s,o,l,x),g=Math.min(a,r,h,c),y=Math.max(a,r,h,c);e.dxPixels=d,e.dyPixels=g,e.width=f-d,e.height=y-g}}}}}}_addPlacedIcons(e,t,n,i,s,a){const o=Math.max(n-1,0),l=this._iconVertexBuffer,h=this._iconIndexBuffer,x=this._markerMap;for(const c of t){const t=s?0:Math.max(n+r(c.minzoom),o),d=s?25:Math.min(n+r(c.maxzoom),25);if(d<=t)continue;const f=c.tl,g=c.tr,y=c.bl,m=c.br,u=c.mosaicRect,p=c.labelAngle,_=c.minAngle,M=c.maxAngle,P=c.anchor,I=l.index,b=u.x,A=u.y,L=b+u.width,T=A+u.height,V=l.index;l.add(P.x,P.y,f.x,f.y,b,A,p,_,M,t,d,a),l.add(P.x,P.y,g.x,g.y,L,A,p,_,M,t,d,a),l.add(P.x,P.y,y.x,y.y,b,T,p,_,M,t,d,a),l.add(P.x,P.y,m.x,m.y,L,T,p,_,M,t,d,a),e.iconVertexRanges.length>0&&e.iconVertexRanges[0][0]+e.iconVertexRanges[0][1]===V?e.iconVertexRanges[0][1]+=4:e.iconVertexRanges.push([V,4]),h.add(I,I+1,I+2),h.add(I+1,I+2,I+3),x.has(i)?x.get(i)[1]+=6:x.set(i,[this._iconIndexStart+this._iconIndexCount,6]),this._iconIndexCount+=6}}_addPlacedGlyphs(){const e=this._textVertexBuffer,t=this._textIndexBuffer,n=this._glyphMap;for(const[i,s]of this._glyphBufferDataStorage)for(const a of s){const s=e.index,o=a.symbolInstance,r=a.ddAttributes,l=e.index;e.add(a.glyphAnchor[0],a.glyphAnchor[1],a.tl[0],a.tl[1],a.xmin,a.ymin,a.labelAngle,a.minAngle,a.maxAngle,a.minLod,a.maxLod,r),e.add(a.glyphAnchor[0],a.glyphAnchor[1],a.tr[0],a.tr[1],a.xmax,a.ymin,a.labelAngle,a.minAngle,a.maxAngle,a.minLod,a.maxLod,r),e.add(a.glyphAnchor[0],a.glyphAnchor[1],a.bl[0],a.bl[1],a.xmin,a.ymax,a.labelAngle,a.minAngle,a.maxAngle,a.minLod,a.maxLod,r),e.add(a.glyphAnchor[0],a.glyphAnchor[1],a.br[0],a.br[1],a.xmax,a.ymax,a.labelAngle,a.minAngle,a.maxAngle,a.minLod,a.maxLod,r),o.textVertexRanges.length>0&&o.textVertexRanges[0][0]+o.textVertexRanges[0][1]===l?o.textVertexRanges[0][1]+=4:o.textVertexRanges.push([l,4]),t.add(s,s+1,s+2),t.add(s+1,s+2,s+3),n.has(i)?n.get(i)[1]+=6:n.set(i,[this._textIndexStart+this._textIndexCount,6]),this._textIndexCount+=6}this._glyphBufferDataStorage.clear()}_storePlacedGlyphs(e,t,n,i,s){const a=Math.max(n-1,0),o=i===u.VIEWPORT;let l,h,x,c,d,f,g,y,m,p,_;for(const u of t){if(l=o?0:Math.max(n+r(u.minzoom),a),h=o?25:Math.min(n+r(u.maxzoom),25),h<=l)continue;x=u.tl,c=u.tr,d=u.bl,f=u.br,g=u.labelAngle,y=u.minAngle,m=u.maxAngle,p=u.anchor,_=u.mosaicRect,this._glyphBufferDataStorage.has(u.page)||this._glyphBufferDataStorage.set(u.page,[]);this._glyphBufferDataStorage.get(u.page).push({glyphAnchor:[p.x,p.y],tl:[x.x,x.y],tr:[c.x,c.y],bl:[d.x,d.y],br:[f.x,f.y],xmin:_.x,ymin:_.y,xmax:_.x+_.width,ymax:_.y+_.height,labelAngle:g,minAngle:y,maxAngle:m,minLod:l,maxLod:h,placementLod:a,symbolInstance:e,ddAttributes:s})}}static _pushAnchors(e,t,n,i){n+=i;let a=0;const o=t.length-1;for(let l=0;l<o;l++)a+=s.distance(t[l],t[l+1]);let r=i||n;if(r*=.5,a<=r)return;const h=r/a;let c=0,d=-(n=a/Math.max(Math.round(a/n),1))/2;const f=t.length-1;for(let s=0;s<f;s++){const i=t[s],a=t[s+1],o=a.x-i.x,r=a.y-i.y,f=Math.sqrt(o*o+r*r);let g;for(;d+n<c+f;){d+=n;const t=(d-c)/f,y=l(i.x,a.x,t),m=l(i.y,a.y,t);void 0===g&&(g=Math.atan2(r,o)),e.push(new x(y,m,g,s,h))}c+=f}}static _pushCenterAnchor(e,t){let n=0;const i=t.length-1;for(let l=0;l<i;l++)n+=s.distance(t[l],t[l+1]);const a=n/2;let o=0;const r=t.length-1;for(let s=0;s<r;s++){const n=t[s],i=t[s+1],r=i.x-n.x,h=i.y-n.y,c=Math.sqrt(r*r+h*h);if(a<o+c){const t=(a-o)/c,d=l(n.x,i.x,t),f=l(n.y,i.y,t),g=Math.atan2(h,r);return void e.push(new x(d,f,g,s,0))}o+=c}}static _deviation(e,t,n){const i=(t.x-e.x)*(n.x-t.x)+(t.y-e.y)*(n.y-t.y),s=(t.x-e.x)*(n.y-t.y)-(t.y-e.y)*(n.x-t.x);return Math.atan2(s,i)}static _honorsTextMaxAngle(e,t,n,i,a){let o=0;const r=n/2;let l=new s(t.x,t.y),h=t.segment+1;for(;o>-r;){if(--h,h<0)return!1;o-=s.distance(e[h],l),l=e[h]}o+=s.distance(e[h],e[h+1]);const x=[];let c=0;const d=e.length;for(;o<r;){const t=e[h];let n,r=h;do{if(++r,r===d)return!1;n=e[r]}while(n.isEqual(t));let l,f=r;do{if(++f,f===d)return!1;l=e[f]}while(l.isEqual(n));const g=this._deviation(t,n,l);for(x.push({deviation:g,distToAnchor:o}),c+=g;o-x[0].distToAnchor>a;)c-=x.shift().deviation;if(Math.abs(c)>i)return!1;o+=s.distance(n,l),h=r}return!0}static _smoothVertices(e,t){if(t<=0)return e;let n=e.length;if(n<3)return e;const i=[];let a=0,o=0;i.push(0);for(let y=1;y<n;y++){const t=s.distance(e[y],e[y-1]);t>0&&(a+=t,i.push(a),o++,o!==y&&(e[o]=e[y]))}if(n=o+1,n<3)return e;t=Math.min(t,.2*a);const r=e[0].x,l=e[0].y,h=e[n-1].x,x=e[n-1].y,c=s.sub(e[0],e[1]);c.normalize(),e[0].x+=t*c.x,e[0].y+=t*c.y,c.assignSub(e[n-1],e[n-2]),c.normalize(),e[n-1].x+=t*c.x,e[n-1].y+=t*c.y,i[0]-=t,i[n-1]+=t;const d=[];d.push(new s(r,l));const f=1e-6,g=.5*t;for(let y=1;y<n-1;y++){let a=0,o=0,r=0;for(let n=y-1;n>=0;n--){const s=g+i[n+1]-i[y];if(s<0)break;const l=i[n+1]-i[n],h=i[y]-i[n]<g?1:s/l;if(h<f)break;const x=h*h,c=h*s-.5*x*l,d=h*l/t,m=e[n+1],u=e[n].x-m.x,p=e[n].y-m.y;a+=d/c*(m.x*h*s+.5*x*(s*u-l*m.x)-x*h*l*u/3),o+=d/c*(m.y*h*s+.5*x*(s*p-l*m.y)-x*h*l*p/3),r+=d}for(let s=y+1;s<n;s++){const n=g-i[s-1]+i[y];if(n<0)break;const l=i[s]-i[s-1],h=i[s]-i[y]<g?1:n/l;if(h<f)break;const x=h*h,c=h*n-.5*x*l,d=h*l/t,m=e[s-1],u=e[s].x-m.x,p=e[s].y-m.y;a+=d/c*(m.x*h*n+.5*x*(n*u-l*m.x)-x*h*l*u/3),o+=d/c*(m.y*h*n+.5*x*(n*p-l*m.y)-x*h*l*p/3),r+=d}d.push(new s(a/r,o/r))}return d.push(new s(h,x)),e[0].x=r,e[0].y=l,e[n-1].x=h,e[n-1].y=x,d}static _pushCentroid(e,t){const n=0,i=0,s=4096,a=4096,o=t.length-1;let r=0,l=0,h=0,c=t[0].x,d=t[0].y;c>s&&(c=s),c<n&&(c=n),d>a&&(d=a),d<i&&(d=i);for(let x=1;x<o;x++){let e=t[x].x,o=t[x].y,f=t[x+1].x,g=t[x+1].y;e>s&&(e=s),e<n&&(e=n),o>a&&(o=a),o<i&&(o=i),f>s&&(f=s),f<n&&(f=n),g>a&&(g=a),g<i&&(g=i);const y=(e-c)*(g-d)-(f-c)*(o-d);r+=y*(c+e+f),l+=y*(d+o+g),h+=y}r/=3*h,l/=3*h,isNaN(r)||isNaN(l)||e.push(new x(r,l))}}export{L as default};
5
+ import e from"../../../../../core/BidiEngine.js";import{assertIsSome as t}from"../../../../../core/maybe.js";import{numericHash as n}from"../../../../../core/string.js";import{GeometryType as i,Point as s}from"../../../../../geometry/support/TileClipper.js";import{tilePixelRatio as a,tileCoordSize as o}from"../constants.js";import{BucketType as r}from"../enums.js";import{cDegToRad as l,log2 as h,interpolate as x}from"../GeometryUtils.js";import{Anchor as c}from"../Placement.js";import{sdfGlyphSize as d,TextShaping as f}from"../TextShaping.js";import g from"./BaseBucket.js";import{TextTransform as y,SymbolPlacement as m,RotationAlignment as u,TextWritingMode as p,SymbolAnchor as _,TextJustification as M}from"../style/StyleDefinition.js";import{IconLayout as P,TextLayout as I}from"../style/StyleLayer.js";const b=10;function A(e,t){return e.iconMosaicItem&&t.iconMosaicItem?e.iconMosaicItem.page===t.iconMosaicItem.page?0:e.iconMosaicItem.page-t.iconMosaicItem.page:e.iconMosaicItem&&!t.iconMosaicItem?1:!e.iconMosaicItem&&t.iconMosaicItem?-1:0}class L extends g{constructor(e,t,n,i,s,a,o,l,h){super(t,n,h.getSpriteItems()),this.type=r.SYMBOL,this._markerMap=new Map,this._glyphMap=new Map,this._glyphBufferDataStorage=new Map,this._isIconSDF=!1,this._sourceTileKey=e,this._iconVertexBuffer=i,this._iconIndexBuffer=s,this._textVertexBuffer=a,this._textIndexBuffer=o,this._placementEngine=l,this._workerTileHandler=h}get markerPageMap(){return this._markerMap}get glyphsPageMap(){return this._glyphMap}get symbolInstances(){return this._symbolInstances}static{this._bidiEngine=new e}getResources(e,t,i){const s=this.layer,a=this.zoom;e&&e.setExtent(this.layerExtent);const o=s.getLayoutProperty("icon-image"),r=s.getLayoutProperty("text-field");let l=s.getLayoutProperty("text-transform"),h=s.getLayoutProperty("text-font");const x=[];let c,d,f,g;o&&!o.isDataDriven&&(c=o.getValue(a)),r&&!r.isDataDriven&&(d=r.getValue(a)),l&&l.isDataDriven||(f=s.getLayoutValue("text-transform",a),l=null),h&&h.isDataDriven||(g=s.getLayoutValue("text-font",a),h=null);for(const m of this._features){const u=m.getGeometry(e);if(!u||0===u.length)continue;let p,_;o&&(p=o.isDataDriven?o.getValue(a,m):this._replaceKeys(c,m.values),p&&t(p));let M=!1;if(r&&(_=r.isDataDriven?r.getValue(a,m):this._replaceKeys(d,m.values),_)){switch(_=_.replaceAll("\\n","\n"),l&&(f=l.getValue(a,m)),f){case y.LOWERCASE:_=_.toLowerCase();break;case y.UPPERCASE:_=_.toUpperCase()}if(L._bidiEngine.hasBidiChar(_)){let e;e="rtl"===L._bidiEngine.checkContextual(_)?"IDNNN":"ICNNN",_=L._bidiEngine.bidiTransform(_,e,"VLYSN"),M=!0}if(_.length>0){h&&(g=h.getValue(a,m));for(const e of g){let t=i[e];t||(t=i[e]=new Set);for(const e of _){const n=e.codePointAt(0);null!=n&&t.add(n)}}}}if(!p&&!_)continue;const P=s.getLayoutValue("symbol-sort-key",a,m),I={feature:m,sprite:p,label:_,rtl:M,geometry:u,hash:(_?n(_):0)^(p?n(p):0),priority:P,textFont:g};x.push(I)}this._symbolFeatures=x}processFeatures(e){e&&e.setExtent(this.layerExtent);const n=this.layer,s=this.zoom,r=n.getLayoutValue("symbol-placement",s),h=r!==m.POINT,x=n.getLayoutValue("symbol-spacing",s)*a,g=n.getLayoutProperty("icon-image"),y=n.getLayoutProperty("text-field"),b=g?new P(n,s,h):null,T=y?new I(n,s,h):null,V=this._workerTileHandler;let w;g&&(w=V.getSpriteItems()),this._iconIndexStart=3*this._iconIndexBuffer.index,this._textIndexStart=3*this._textIndexBuffer.index,this._iconIndexCount=0,this._textIndexCount=0,this._markerMap.clear(),this._glyphMap.clear();const B=[];let C=1;T?.size&&(C=T.size/d);const R=T?T.maxAngle*l:0,D=T?T.size*a:0;for(const l of this._symbolFeatures){let e;b&&w&&l.sprite&&(e=w[l.sprite],e&&e.sdf&&(this._isIconSDF=!0));let n;!!e&&b.update(s,l.feature);let g=0;const y=l.label;if(y){t(T),T.update(s,l.feature);const e=h&&T.rotationAlignment===u.MAP?T.keepUpright:T.writingMode&&T.writingMode.includes(p.VERTICAL);let i=.5;switch(T.anchor){case _.TOP_LEFT:case _.LEFT:case _.BOTTOM_LEFT:i=0;break;case _.TOP_RIGHT:case _.RIGHT:case _.BOTTOM_RIGHT:i=1}let o=.5;switch(T.anchor){case _.TOP_LEFT:case _.TOP:case _.TOP_RIGHT:o=0;break;case _.BOTTOM_LEFT:case _.BOTTOM:case _.BOTTOM_RIGHT:o=1}let r=.5;switch(T.justify){case M.AUTO:r=i;break;case M.LEFT:r=0;break;case M.RIGHT:r=1}const x=T.letterSpacing*d,c=h?0:T.maxWidth*d,m=T.lineHeight*d,P=l.textFont.map((e=>V.getGlyphItems(e)));if(n=new f(P,c,m,x,i,o,r).getShaping(y,l.rtl,e),n&&n.length>0){let e=1e30,t=-1e30;for(const i of n)e=Math.min(e,i.x),t=Math.max(t,i.x);g=(t-e+2*d)*C*a}}for(let t of l.geometry){const s=[];if(r===m.LINE){if(n?.length&&T?.size){const e=T.size*a*(2+Math.min(2,4*Math.abs(T.offset[1])));t=L._smoothVertices(t,e)}L._pushAnchors(s,t,x,g)}else r===m.LINE_CENTER?L._pushCenterAnchor(s,t):l.feature.type===i.Polygon?L._pushCentroid(s,t):s.push(new c(t[0].x,t[0].y));for(const i of s){if(i.x<0||i.x>o||i.y<0||i.y>o)continue;if(h&&g>0&&T?.rotationAlignment===u.MAP&&!L._honorsTextMaxAngle(t,i,g,R,D))continue;const s={shaping:n,line:t,iconMosaicItem:e,anchor:i,symbolFeature:l,textColliders:[],iconColliders:[],textVertexRanges:[],iconVertexRanges:[]};B.push(s),this._processFeature(s,b,T)}}}B.sort(A),this._addPlacedGlyphs(),this._symbolInstances=B}serialize(){let e=14;e+=this.layerUIDs.length,e+=3*this.markerPageMap.size,e+=3*this.glyphsPageMap.size,e+=L._symbolsSerializationLength(this._symbolInstances),e+=this._iconVertexBuffer.array.length,e+=this._iconIndexBuffer.array.length,e+=this._textVertexBuffer.array.length,e+=this._textIndexBuffer.array.length;const t=new Uint32Array(e),n=new Int32Array(t.buffer),i=new Float32Array(t.buffer),[s,a,o]=this._sourceTileKey.split("/");let r=0;t[r++]=this.type,t[r++]=this.layerUIDs.length;for(let l=0;l<this.layerUIDs.length;l++)t[r++]=this.layerUIDs[l];t[r++]=this._isIconSDF?1:0,t[r++]=parseFloat(s),t[r++]=parseFloat(a),t[r++]=parseFloat(o),t[r++]=this.markerPageMap.size;for(const[l,[h,x]]of this.markerPageMap)t[r++]=l,t[r++]=h,t[r++]=x;t[r++]=this.glyphsPageMap.size;for(const[l,[h,x]]of this.glyphsPageMap)t[r++]=l,t[r++]=h,t[r++]=x;t[r++]=this._iconVertexBuffer.index/4,t[r++]=this._textVertexBuffer.index/4,r=L.serializeSymbols(t,n,i,r,this._symbolInstances),t[r++]=this._iconVertexBuffer.array.length;for(let l=0;l<this._iconVertexBuffer.array.length;l++)n[r++]=this._iconVertexBuffer.array[l];t[r++]=this._iconIndexBuffer.array.length;for(let l=0;l<this._iconIndexBuffer.array.length;l++)t[r++]=this._iconIndexBuffer.array[l];t[r++]=this._textVertexBuffer.array.length;for(let l=0;l<this._textVertexBuffer.array.length;l++)n[r++]=this._textVertexBuffer.array[l];t[r++]=this._textIndexBuffer.array.length;for(let l=0;l<this._textIndexBuffer.array.length;l++)t[r++]=this._textIndexBuffer.array[l];return t.buffer}static _symbolsSerializationLength(e){let t=0;t+=1;for(const n of e||[]){t+=5,t+=1;for(const e of n.textColliders)t+=b;for(const e of n.iconColliders)t+=b;t+=1,t+=2*n.textVertexRanges.length,t+=1,t+=2*n.iconVertexRanges.length}return t}static serializeSymbols(e,t,n,i,s){s=s||[],t[i++]=s.length;for(const a of s){t[i++]=a.anchor.x,t[i++]=a.anchor.y,t[i++]=a.symbolFeature.hash,t[i++]=a.symbolFeature.priority,t[i++]=a.symbolFeature.feature.featureIndex,t[i++]=a.textColliders.length+a.iconColliders.length;for(const e of a.textColliders)t[i++]=e.xTile,t[i++]=e.yTile,t[i++]=e.dxPixels,t[i++]=e.dyPixels,t[i++]=e.hard?1:0,t[i++]=e.partIndex,n[i++]=e.minLod,n[i++]=e.maxLod,t[i++]=e.width,t[i++]=e.height;for(const e of a.iconColliders)t[i++]=e.xTile,t[i++]=e.yTile,t[i++]=e.dxPixels,t[i++]=e.dyPixels,t[i++]=e.hard?1:0,t[i++]=e.partIndex,n[i++]=e.minLod,n[i++]=e.maxLod,t[i++]=e.width,t[i++]=e.height;t[i++]=a.textVertexRanges.length;for(const[e,n]of a.textVertexRanges)t[i++]=e,t[i++]=n;t[i++]=a.iconVertexRanges.length;for(const[e,n]of a.iconVertexRanges)t[i++]=e,t[i++]=n}return i}_replaceKeys(e,t){return e.replaceAll(/{([^{}]+)}/g,((e,n)=>n in t?t[n]:""))}_processFeature(e,t,n){const{line:i,iconMosaicItem:s,shaping:a,anchor:o}=e,r=this.zoom,l=this.layer,x=!!s;let c=!0;x&&(c=t?.optional||!s);const d=a&&a.length>0,f=!d||n?.optional;let g,y;if(x&&(g=this._placementEngine.getIconPlacement(o,s,t)),(g||c)&&(d&&(y=this._placementEngine.getTextPlacement(o,a,i,n)),y||f)){if(g&&y||(f||c?f||y?c||g||(y=null):g=null:(g=null,y=null)),y){const t=l.hasDataDrivenText?l.textMaterial.encodeAttributes(e.symbolFeature.feature,r,l):null;if(this._storePlacedGlyphs(e,y.shapes,r,n.rotationAlignment,t),y.textColliders){e.textColliders=y.textColliders;for(const e of y.textColliders){e.minLod=Math.max(r+h(e.minLod),0),e.maxLod=Math.min(r+h(e.maxLod),25);const t=e.angle;if(t){const n=Math.cos(t),i=Math.sin(t),s=e.dxPixels*n-e.dyPixels*i,a=e.dxPixels*i+e.dyPixels*n,o=(e.dxPixels+e.width)*n-e.dyPixels*i,r=(e.dxPixels+e.width)*i+e.dyPixels*n,l=e.dxPixels*n-(e.dyPixels+e.height)*i,h=e.dxPixels*i+(e.dyPixels+e.height)*n,x=(e.dxPixels+e.width)*n-(e.dyPixels+e.height)*i,c=(e.dxPixels+e.width)*i+(e.dyPixels+e.height)*n,d=Math.min(s,o,l,x),f=Math.max(s,o,l,x),g=Math.min(a,r,h,c),y=Math.max(a,r,h,c);e.dxPixels=d,e.dyPixels=g,e.width=f-d,e.height=y-g}}}}if(g){const n=l.hasDataDrivenIcon?l.iconMaterial.encodeAttributes(e.symbolFeature.feature,r,l):null;if(this._addPlacedIcons(e,g.shapes,r,s.page,t.rotationAlignment===u.VIEWPORT,n),g.iconColliders){e.iconColliders=g.iconColliders;for(const e of g.iconColliders){e.minLod=Math.max(r+h(e.minLod),0),e.maxLod=Math.min(r+h(e.maxLod),25);const t=e.angle;if(t){const n=Math.cos(t),i=Math.sin(t),s=e.dxPixels*n-e.dyPixels*i,a=e.dxPixels*i+e.dyPixels*n,o=(e.dxPixels+e.width)*n-e.dyPixels*i,r=(e.dxPixels+e.width)*i+e.dyPixels*n,l=e.dxPixels*n-(e.dyPixels+e.height)*i,h=e.dxPixels*i+(e.dyPixels+e.height)*n,x=(e.dxPixels+e.width)*n-(e.dyPixels+e.height)*i,c=(e.dxPixels+e.width)*i+(e.dyPixels+e.height)*n,d=Math.min(s,o,l,x),f=Math.max(s,o,l,x),g=Math.min(a,r,h,c),y=Math.max(a,r,h,c);e.dxPixels=d,e.dyPixels=g,e.width=f-d,e.height=y-g}}}}}}_addPlacedIcons(e,t,n,i,s,a){const o=Math.max(n-1,0),r=this._iconVertexBuffer,l=this._iconIndexBuffer,x=this._markerMap;for(const c of t){const t=s?0:Math.max(n+h(c.minzoom),o),d=s?25:Math.min(n+h(c.maxzoom),25);if(d<=t)continue;const f=c.tl,g=c.tr,y=c.bl,m=c.br,u=c.mosaicRect,p=c.labelAngle,_=c.minAngle,M=c.maxAngle,P=c.anchor,I=r.index,b=u.x,A=u.y,L=b+u.width,T=A+u.height,V=r.index;r.add(P.x,P.y,f.x,f.y,b,A,p,_,M,t,d,a),r.add(P.x,P.y,g.x,g.y,L,A,p,_,M,t,d,a),r.add(P.x,P.y,y.x,y.y,b,T,p,_,M,t,d,a),r.add(P.x,P.y,m.x,m.y,L,T,p,_,M,t,d,a),e.iconVertexRanges.length>0&&e.iconVertexRanges[0][0]+e.iconVertexRanges[0][1]===V?e.iconVertexRanges[0][1]+=4:e.iconVertexRanges.push([V,4]),l.add(I,I+1,I+2),l.add(I+1,I+2,I+3),x.has(i)?x.get(i)[1]+=6:x.set(i,[this._iconIndexStart+this._iconIndexCount,6]),this._iconIndexCount+=6}}_addPlacedGlyphs(){const e=this._textVertexBuffer,t=this._textIndexBuffer,n=this._glyphMap;for(const[i,s]of this._glyphBufferDataStorage)for(const a of s){const s=e.index,o=a.symbolInstance,r=a.ddAttributes,l=e.index;e.add(a.glyphAnchor[0],a.glyphAnchor[1],a.tl[0],a.tl[1],a.xmin,a.ymin,a.labelAngle,a.minAngle,a.maxAngle,a.minLod,a.maxLod,r),e.add(a.glyphAnchor[0],a.glyphAnchor[1],a.tr[0],a.tr[1],a.xmax,a.ymin,a.labelAngle,a.minAngle,a.maxAngle,a.minLod,a.maxLod,r),e.add(a.glyphAnchor[0],a.glyphAnchor[1],a.bl[0],a.bl[1],a.xmin,a.ymax,a.labelAngle,a.minAngle,a.maxAngle,a.minLod,a.maxLod,r),e.add(a.glyphAnchor[0],a.glyphAnchor[1],a.br[0],a.br[1],a.xmax,a.ymax,a.labelAngle,a.minAngle,a.maxAngle,a.minLod,a.maxLod,r),o.textVertexRanges.length>0&&o.textVertexRanges[0][0]+o.textVertexRanges[0][1]===l?o.textVertexRanges[0][1]+=4:o.textVertexRanges.push([l,4]),t.add(s,s+1,s+2),t.add(s+1,s+2,s+3),n.has(i)?n.get(i)[1]+=6:n.set(i,[this._textIndexStart+this._textIndexCount,6]),this._textIndexCount+=6}this._glyphBufferDataStorage.clear()}_storePlacedGlyphs(e,t,n,i,s){const a=Math.max(n-1,0),o=i===u.VIEWPORT;let r,l,x,c,d,f,g,y,m,p,_;for(const u of t){if(r=o?0:Math.max(n+h(u.minzoom),a),l=o?25:Math.min(n+h(u.maxzoom),25),l<=r)continue;x=u.tl,c=u.tr,d=u.bl,f=u.br,g=u.labelAngle,y=u.minAngle,m=u.maxAngle,p=u.anchor,_=u.mosaicRect,this._glyphBufferDataStorage.has(u.page)||this._glyphBufferDataStorage.set(u.page,[]);this._glyphBufferDataStorage.get(u.page).push({glyphAnchor:[p.x,p.y],tl:[x.x,x.y],tr:[c.x,c.y],bl:[d.x,d.y],br:[f.x,f.y],xmin:_.x,ymin:_.y,xmax:_.x+_.width,ymax:_.y+_.height,labelAngle:g,minAngle:y,maxAngle:m,minLod:r,maxLod:l,placementLod:a,symbolInstance:e,ddAttributes:s})}}static _pushAnchors(e,t,n,i){n+=i;let a=0;const o=t.length-1;for(let x=0;x<o;x++)a+=s.distance(t[x],t[x+1]);let r=i||n;if(r*=.5,a<=r)return;const l=r/a;let h=0,d=-(n=a/Math.max(Math.round(a/n),1))/2;const f=t.length-1;for(let s=0;s<f;s++){const i=t[s],a=t[s+1],o=a.x-i.x,r=a.y-i.y,f=Math.sqrt(o*o+r*r);let g;for(;d+n<h+f;){d+=n;const t=(d-h)/f,y=x(i.x,a.x,t),m=x(i.y,a.y,t);void 0===g&&(g=Math.atan2(r,o)),e.push(new c(y,m,g,s,l))}h+=f}}static _pushCenterAnchor(e,t){let n=0;const i=t.length-1;for(let l=0;l<i;l++)n+=s.distance(t[l],t[l+1]);const a=n/2;let o=0;const r=t.length-1;for(let s=0;s<r;s++){const n=t[s],i=t[s+1],r=i.x-n.x,l=i.y-n.y,h=Math.sqrt(r*r+l*l);if(a<o+h){const t=(a-o)/h,d=x(n.x,i.x,t),f=x(n.y,i.y,t),g=Math.atan2(l,r);return void e.push(new c(d,f,g,s,0))}o+=h}}static _deviation(e,t,n){const i=(t.x-e.x)*(n.x-t.x)+(t.y-e.y)*(n.y-t.y),s=(t.x-e.x)*(n.y-t.y)-(t.y-e.y)*(n.x-t.x);return Math.atan2(s,i)}static _honorsTextMaxAngle(e,t,n,i,a){let o=0;const r=n/2;let l=new s(t.x,t.y),h=t.segment+1;for(;o>-r;){if(--h,h<0)return!1;o-=s.distance(e[h],l),l=e[h]}o+=s.distance(e[h],e[h+1]);const x=[];let c=0;const d=e.length;for(;o<r;){const t=e[h];let n,r=h;do{if(++r,r===d)return!1;n=e[r]}while(n.isEqual(t));let l,f=r;do{if(++f,f===d)return!1;l=e[f]}while(l.isEqual(n));const g=this._deviation(t,n,l);for(x.push({deviation:g,distToAnchor:o}),c+=g;o-x[0].distToAnchor>a;)c-=x.shift().deviation;if(Math.abs(c)>i)return!1;o+=s.distance(n,l),h=r}return!0}static _smoothVertices(e,t){if(t<=0)return e;let n=e.length;if(n<3)return e;const i=[];let a=0,o=0;i.push(0);for(let y=1;y<n;y++){const t=s.distance(e[y],e[y-1]);t>0&&(a+=t,i.push(a),o++,o!==y&&(e[o]=e[y]))}if(n=o+1,n<3)return e;t=Math.min(t,.2*a);const r=e[0].x,l=e[0].y,h=e[n-1].x,x=e[n-1].y,c=s.sub(e[0],e[1]);c.normalize(),e[0].x+=t*c.x,e[0].y+=t*c.y,c.assignSub(e[n-1],e[n-2]),c.normalize(),e[n-1].x+=t*c.x,e[n-1].y+=t*c.y,i[0]-=t,i[n-1]+=t;const d=[];d.push(new s(r,l));const f=1e-6,g=.5*t;for(let y=1;y<n-1;y++){let a=0,o=0,r=0;for(let n=y-1;n>=0;n--){const s=g+i[n+1]-i[y];if(s<0)break;const l=i[n+1]-i[n],h=i[y]-i[n]<g?1:s/l;if(h<f)break;const x=h*h,c=h*s-.5*x*l,d=h*l/t,m=e[n+1],u=e[n].x-m.x,p=e[n].y-m.y;a+=d/c*(m.x*h*s+.5*x*(s*u-l*m.x)-x*h*l*u/3),o+=d/c*(m.y*h*s+.5*x*(s*p-l*m.y)-x*h*l*p/3),r+=d}for(let s=y+1;s<n;s++){const n=g-i[s-1]+i[y];if(n<0)break;const l=i[s]-i[s-1],h=i[s]-i[y]<g?1:n/l;if(h<f)break;const x=h*h,c=h*n-.5*x*l,d=h*l/t,m=e[s-1],u=e[s].x-m.x,p=e[s].y-m.y;a+=d/c*(m.x*h*n+.5*x*(n*u-l*m.x)-x*h*l*u/3),o+=d/c*(m.y*h*n+.5*x*(n*p-l*m.y)-x*h*l*p/3),r+=d}d.push(new s(a/r,o/r))}return d.push(new s(h,x)),e[0].x=r,e[0].y=l,e[n-1].x=h,e[n-1].y=x,d}static _pushCentroid(e,t){const n=0,i=0,s=o,a=o,r=t.length-1;let l=0,h=0,x=0,d=t[0].x,f=t[0].y;d>s&&(d=s),d<n&&(d=n),f>a&&(f=a),f<i&&(f=i);for(let o=1;o<r;o++){let e=t[o].x,r=t[o].y,c=t[o+1].x,g=t[o+1].y;e>s&&(e=s),e<n&&(e=n),r>a&&(r=a),r<i&&(r=i),c>s&&(c=s),c<n&&(c=n),g>a&&(g=a),g<i&&(g=i);const y=(e-d)*(g-f)-(c-d)*(r-f);l+=y*(d+e+c),h+=y*(f+r+g),x+=y}l/=3*x,h/=3*x,isNaN(l)||isNaN(h)||e.push(new c(l,h))}}export{L as default};