@arcgis/core 4.33.0-next.20250202 → 4.33.0-next.20250204

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 (263) hide show
  1. package/WebScene.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/{d3a8aabdbfb59dd433e3.js → 01c3507d78398baaf61b.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{c74441fbe0f63633796f.js → 04306c2760c1f5b19966.js} +1 -1
  5. package/assets/esri/core/workers/chunks/1a2e1a414e651e988435.js +2 -0
  6. package/assets/esri/core/workers/chunks/{bf9bc52a3c559108c19a.js.LICENSE.txt → 1a2e1a414e651e988435.js.LICENSE.txt} +1 -1
  7. package/assets/esri/core/workers/chunks/308ec51ff4a66f7fcb0d.js.LICENSE.txt +1 -1
  8. package/assets/esri/core/workers/chunks/354531dc2f0dea2ad96f.js +2 -0
  9. package/assets/esri/core/workers/chunks/{6e8905f20101c1f4509d.js.LICENSE.txt → 354531dc2f0dea2ad96f.js.LICENSE.txt} +1 -1
  10. package/assets/esri/core/workers/chunks/{448ee44c7f594e5b2551.js → 3ce826ebf0692363309d.js} +1 -1
  11. package/assets/esri/core/workers/chunks/44abd2cd17aae3299ede.js +1 -0
  12. package/assets/esri/core/workers/chunks/{e9f0402fa3ac5a249807.js → 5196c43dbce48d1b81ae.js} +1 -1
  13. package/assets/esri/core/workers/chunks/568bcf809fcfd4d9c713.js +1 -0
  14. package/assets/esri/core/workers/chunks/{3ec51b75d1a86dad6cb1.js → 60cd8f4bba3e682ba57e.js} +1 -1
  15. package/assets/esri/core/workers/chunks/61243217aed5de012e93.js +1 -0
  16. package/assets/esri/core/workers/chunks/69d307758262e5d7a32e.js +1 -0
  17. package/assets/esri/core/workers/chunks/{e444ec05a8a1dfbd21a8.js → 6dee40b94f94ee7bc4e4.js} +1 -1
  18. package/assets/esri/core/workers/chunks/72cf9192292e5c85c6df.js.LICENSE.txt +1 -1
  19. package/assets/esri/core/workers/chunks/77764ca90bdd13ee2167.js +2 -0
  20. package/assets/esri/core/workers/chunks/{25c8cc30faade043c8dc.js.LICENSE.txt → 77764ca90bdd13ee2167.js.LICENSE.txt} +1 -1
  21. package/assets/esri/core/workers/chunks/{f8367c21fa91435c7c53.js → 7a3e4cb5f64dac2cfe0e.js} +1 -1
  22. package/assets/esri/core/workers/chunks/7b11bf5799ecb3640b48.js +314 -0
  23. package/assets/esri/core/workers/chunks/{ba3c18d1efde46461231.js → 8438fba57e82e4cc7c11.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{0ef5b0f8aa8a09acd6e0.js → 8e90c5fee4ad7c7275dc.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{f2fae056a81f12b56b04.js → 8edae4ca2b18a219a43e.js} +1 -1
  26. package/assets/esri/core/workers/chunks/918bdba41fa470cf77fd.js +1 -0
  27. package/assets/esri/core/workers/chunks/a2409d4921c02614169a.js +1 -0
  28. package/assets/esri/core/workers/chunks/{7810579a5a780933cdc9.js → ad3e692681b50bd1acc2.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{adfa126cea32298c28e9.js → b1269b51cef3e11c85e3.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{692b3d03346f030aa649.js → b1f5344e57ee679a7e81.js} +44 -44
  31. package/assets/esri/core/workers/chunks/b21b152fa15896577242.js.LICENSE.txt +1 -1
  32. package/assets/esri/core/workers/chunks/b8a519d5d24b2e728ff8.js +2 -0
  33. package/assets/esri/core/workers/chunks/{7d3a441d2eb18d709ef9.js.LICENSE.txt → b8a519d5d24b2e728ff8.js.LICENSE.txt} +1 -1
  34. package/assets/esri/core/workers/chunks/b9ce0049e27a3e1ed9f9.js +1 -0
  35. package/assets/esri/core/workers/chunks/{79afe4674a0557eb26e4.js → bf26f58210755875748c.js} +1 -1
  36. package/assets/esri/core/workers/chunks/c032bcd25e2e7a57ad43.js +1 -0
  37. package/assets/esri/core/workers/chunks/{6e25742ceedea7fb1b97.js → c3f03ccabca691186aad.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{5adeb979f178944b9ce5.js → c4c2b94e5cee7b824093.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{3e872e5e528dca7bee0c.js → cc75bbfd779f409943a3.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{4c5279fedf982a174706.js → d175953337fa655dc6b0.js} +1 -1
  41. package/assets/esri/core/workers/chunks/d35efcbe439500bf18bc.js +1 -0
  42. package/assets/esri/core/workers/chunks/{bc50585615f07d5ec1a9.js → e4f82b5b50996b1ae48e.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{2345344be4b0e487d3a6.js → f198f4ba7d3d52882d98.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{881ddbdeb40336208e90.js → f29715459ecd46180829.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{d1678945cf6a58f76863.js → f48ef415b90edc7ccadd.js} +1 -1
  46. package/assets/esri/themes/base/_core.scss +0 -2
  47. package/assets/esri/themes/base/widgets/_Directions.scss +129 -425
  48. package/assets/esri/themes/base/widgets/_Editor.scss +31 -0
  49. package/assets/esri/themes/dark/main.css +1 -1
  50. package/assets/esri/themes/light/main.css +1 -1
  51. package/assets/esri/themes/light/view.css +1 -1
  52. package/assets/esri/widgets/Directions/t9n/Directions_ar.json +1 -1
  53. package/assets/esri/widgets/Directions/t9n/Directions_bg.json +1 -1
  54. package/assets/esri/widgets/Directions/t9n/Directions_bs.json +1 -1
  55. package/assets/esri/widgets/Directions/t9n/Directions_ca.json +1 -1
  56. package/assets/esri/widgets/Directions/t9n/Directions_cs.json +1 -1
  57. package/assets/esri/widgets/Directions/t9n/Directions_da.json +1 -1
  58. package/assets/esri/widgets/Directions/t9n/Directions_de.json +1 -1
  59. package/assets/esri/widgets/Directions/t9n/Directions_el.json +1 -1
  60. package/assets/esri/widgets/Directions/t9n/Directions_es.json +1 -1
  61. package/assets/esri/widgets/Directions/t9n/Directions_et.json +1 -1
  62. package/assets/esri/widgets/Directions/t9n/Directions_fi.json +1 -1
  63. package/assets/esri/widgets/Directions/t9n/Directions_fr.json +1 -1
  64. package/assets/esri/widgets/Directions/t9n/Directions_he.json +1 -1
  65. package/assets/esri/widgets/Directions/t9n/Directions_hr.json +1 -1
  66. package/assets/esri/widgets/Directions/t9n/Directions_hu.json +1 -1
  67. package/assets/esri/widgets/Directions/t9n/Directions_id.json +1 -1
  68. package/assets/esri/widgets/Directions/t9n/Directions_it.json +1 -1
  69. package/assets/esri/widgets/Directions/t9n/Directions_ja.json +1 -1
  70. package/assets/esri/widgets/Directions/t9n/Directions_ko.json +1 -1
  71. package/assets/esri/widgets/Directions/t9n/Directions_lt.json +1 -1
  72. package/assets/esri/widgets/Directions/t9n/Directions_lv.json +1 -1
  73. package/assets/esri/widgets/Directions/t9n/Directions_nl.json +1 -1
  74. package/assets/esri/widgets/Directions/t9n/Directions_no.json +1 -1
  75. package/assets/esri/widgets/Directions/t9n/Directions_pl.json +1 -1
  76. package/assets/esri/widgets/Directions/t9n/Directions_pt-BR.json +1 -1
  77. package/assets/esri/widgets/Directions/t9n/Directions_pt-PT.json +1 -1
  78. package/assets/esri/widgets/Directions/t9n/Directions_ro.json +1 -1
  79. package/assets/esri/widgets/Directions/t9n/Directions_ru.json +1 -1
  80. package/assets/esri/widgets/Directions/t9n/Directions_sk.json +1 -1
  81. package/assets/esri/widgets/Directions/t9n/Directions_sl.json +1 -1
  82. package/assets/esri/widgets/Directions/t9n/Directions_sr.json +1 -1
  83. package/assets/esri/widgets/Directions/t9n/Directions_sv.json +1 -1
  84. package/assets/esri/widgets/Directions/t9n/Directions_th.json +1 -1
  85. package/assets/esri/widgets/Directions/t9n/Directions_tr.json +1 -1
  86. package/assets/esri/widgets/Directions/t9n/Directions_uk.json +1 -1
  87. package/assets/esri/widgets/Directions/t9n/Directions_vi.json +1 -1
  88. package/assets/esri/widgets/Directions/t9n/Directions_zh-CN.json +1 -1
  89. package/assets/esri/widgets/Directions/t9n/Directions_zh-HK.json +1 -1
  90. package/assets/esri/widgets/Directions/t9n/Directions_zh-TW.json +1 -1
  91. package/chunks/ComponentShader.glsl.js +30 -30
  92. package/chunks/DefaultMaterial.glsl.js +19 -19
  93. package/chunks/HUDMaterial.glsl.js +34 -34
  94. package/chunks/MeasurementArrow.glsl.js +6 -6
  95. package/chunks/NativeLine.glsl.js +4 -4
  96. package/chunks/QuadraticBezier.js +1 -1
  97. package/chunks/RealisticTree.glsl.js +14 -14
  98. package/chunks/RibbonLine.glsl.js +32 -32
  99. package/chunks/Terrain.glsl.js +31 -31
  100. package/chunks/WaterSurface.glsl.js +15 -15
  101. package/copyright.txt +0 -29
  102. package/core/Collection.js +1 -1
  103. package/core/has.js +1 -1
  104. package/geometry/support/centroid.js +1 -1
  105. package/interfaces.d.ts +139 -13
  106. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  107. package/layers/mixins/ArcGISImageService.js +1 -1
  108. package/layers/mixins/ImageryTileMixin.js +1 -1
  109. package/layers/support/labelUtils.js +1 -1
  110. package/layers/support/rasterDatasets/WCSRaster.js +1 -1
  111. package/layers/support/rasterDatasets/multidimensionalUtils.js +1 -1
  112. package/package.json +4 -5
  113. package/popup/content/AttachmentsContent.js +1 -1
  114. package/popup/support/AttachmentsOrderByInfo.d.ts +4 -0
  115. package/popup/support/AttachmentsOrderByInfo.js +5 -0
  116. package/portal/schemas/definitions.js +1 -1
  117. package/rest/imageService/fetchRasterInfo.js +1 -1
  118. package/support/revision.js +1 -1
  119. package/support/timeUtils.d.ts +0 -1
  120. package/support/timeUtils.js +1 -1
  121. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  122. package/symbols/cim/animationUtils.js +1 -1
  123. package/symbols/cim/defaultCIMValues.js +1 -1
  124. package/views/2d/engine/webgl/animations/utils.js +1 -1
  125. package/views/2d/engine/webgl/mesh/factories/FeatureMeshFactory.js +1 -1
  126. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedShader.js +1 -1
  127. package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeTechnique.js +1 -1
  128. package/views/2d/engine/webgl/shaderGraph/techniques/line/gradientStrokeConstants.js +1 -1
  129. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/GradientStrokeShader.js +1 -1
  130. package/views/2d/engine/webgl/util/LabelMatcher.js +1 -1
  131. package/views/2d/engine/webgl/util/createMatcher.js +1 -1
  132. package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
  133. package/views/3d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles3D.js +1 -1
  134. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  135. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  136. package/views/3d/layers/graphics/Graphics3DGraphicsPipeline.js +1 -1
  137. package/views/3d/layers/i3s/I3SClientMaterialUtil.js +1 -1
  138. package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
  139. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  140. package/views/3d/layers/support/FeatureTileFetcher3DContext.js +1 -1
  141. package/views/3d/layers/support/FeatureTileTree3D.js +1 -1
  142. package/views/3d/layers/support/FeatureVisibilityFilter.js +1 -1
  143. package/views/3d/terrain/PatchRenderData.js +1 -1
  144. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  145. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
  146. package/views/3d/webgl-engine/core/shaderLibrary/util/DiscardOrAdjustAlpha.glsl.js +3 -3
  147. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
  148. package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
  149. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  150. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  151. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  152. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  153. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  154. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  155. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  156. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  157. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  158. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  159. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  160. package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
  161. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  162. package/views/3d/webgl-engine/shaders/HUDMaterial.glsl.js +1 -1
  163. package/views/3d/webgl-engine/shaders/MeasurementArrow.glsl.js +1 -1
  164. package/views/3d/webgl-engine/shaders/NativeLine.glsl.js +1 -1
  165. package/views/3d/webgl-engine/shaders/OutputColorHighlightOID.glsl.js +8 -8
  166. package/views/3d/webgl-engine/shaders/RealisticTree.glsl.js +1 -1
  167. package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
  168. package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
  169. package/views/3d/webgl-engine/shaders/WaterSurface.glsl.js +1 -1
  170. package/views/layers/FeatureLayerView.js +1 -1
  171. package/views/layers/ImageryTileLayerView.d.ts +4 -0
  172. package/views/layers/ImageryTileLayerView.js +1 -1
  173. package/webscene/spec-certification/index.js +1 -1
  174. package/widgets/BasemapLayerList.js +1 -1
  175. package/widgets/Directions/DirectionsSearchTool.js +5 -0
  176. package/widgets/Directions/DirectionsViewModel.js +1 -1
  177. package/widgets/Directions/DirectionsVisibleElements.js +5 -0
  178. package/widgets/Directions.js +1 -1
  179. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  180. package/widgets/Editor/CreateFeaturesWorkflowData.js +1 -1
  181. package/widgets/Editor/EditorViewModel.js +1 -1
  182. package/widgets/Editor/Edits.js +1 -1
  183. package/widgets/Editor/UpdateWorkflow.js +1 -1
  184. package/widgets/Editor/VisibleElements.js +1 -1
  185. package/widgets/Editor/components/CreateFeaturesPanelContent.js +1 -1
  186. package/widgets/Editor/components/PanelToolbar.js +1 -1
  187. package/widgets/Editor/components/PendingFeatureList.js +5 -0
  188. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  189. package/widgets/Editor/css.js +1 -1
  190. package/widgets/Editor/workflowUtils.js +1 -1
  191. package/widgets/Editor.js +1 -1
  192. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  193. package/widgets/FeatureForm/FieldInput.js +1 -1
  194. package/widgets/FeatureForm.js +1 -1
  195. package/widgets/LayerList.js +1 -1
  196. package/widgets/Legend/LegendViewModel.js +1 -1
  197. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  198. package/widgets/Legend.js +1 -1
  199. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  200. package/widgets/Search.js +1 -1
  201. package/widgets/Sketch/SketchViewModel.js +1 -1
  202. package/widgets/Sketch/VisibleElements.js +1 -1
  203. package/widgets/Sketch.js +1 -1
  204. package/widgets/support/ItemList.js +1 -1
  205. package/assets/esri/core/workers/chunks/06d72622590dbd38c5de.js +0 -1
  206. package/assets/esri/core/workers/chunks/0a19e1aec6a5502e391a.js +0 -1
  207. package/assets/esri/core/workers/chunks/12964a4b16113cdc9c93.js +0 -1
  208. package/assets/esri/core/workers/chunks/25c8cc30faade043c8dc.js +0 -2
  209. package/assets/esri/core/workers/chunks/326a3f50e585e492b673.js +0 -1
  210. package/assets/esri/core/workers/chunks/34d464dacee52739c98c.js +0 -1
  211. package/assets/esri/core/workers/chunks/4cab082b8432ddc05345.js +0 -1
  212. package/assets/esri/core/workers/chunks/6e8905f20101c1f4509d.js +0 -2
  213. package/assets/esri/core/workers/chunks/6f796f2836f949ab7359.js +0 -1
  214. package/assets/esri/core/workers/chunks/7d3a441d2eb18d709ef9.js +0 -2
  215. package/assets/esri/core/workers/chunks/bf9bc52a3c559108c19a.js +0 -2
  216. package/assets/esri/core/workers/chunks/dd46ec81cebe1a0a7b9c.js +0 -1
  217. package/assets/esri/core/workers/chunks/fb1a89f753057f889971.js +0 -314
  218. package/assets/esri/core/workers/chunks/ffa2b9d70830aed03a8f.js +0 -1
  219. package/assets/esri/themes/base/widgets/_SaveLayer.scss +0 -40
  220. package/assets/esri/widgets/support/t9n/SaveLayer.json +0 -1
  221. package/assets/esri/widgets/support/t9n/SaveLayer_ar.json +0 -1
  222. package/assets/esri/widgets/support/t9n/SaveLayer_bg.json +0 -1
  223. package/assets/esri/widgets/support/t9n/SaveLayer_bs.json +0 -1
  224. package/assets/esri/widgets/support/t9n/SaveLayer_ca.json +0 -1
  225. package/assets/esri/widgets/support/t9n/SaveLayer_cs.json +0 -1
  226. package/assets/esri/widgets/support/t9n/SaveLayer_da.json +0 -1
  227. package/assets/esri/widgets/support/t9n/SaveLayer_de.json +0 -1
  228. package/assets/esri/widgets/support/t9n/SaveLayer_el.json +0 -1
  229. package/assets/esri/widgets/support/t9n/SaveLayer_en.json +0 -1
  230. package/assets/esri/widgets/support/t9n/SaveLayer_es.json +0 -1
  231. package/assets/esri/widgets/support/t9n/SaveLayer_et.json +0 -1
  232. package/assets/esri/widgets/support/t9n/SaveLayer_fi.json +0 -1
  233. package/assets/esri/widgets/support/t9n/SaveLayer_fr.json +0 -1
  234. package/assets/esri/widgets/support/t9n/SaveLayer_he.json +0 -1
  235. package/assets/esri/widgets/support/t9n/SaveLayer_hr.json +0 -1
  236. package/assets/esri/widgets/support/t9n/SaveLayer_hu.json +0 -1
  237. package/assets/esri/widgets/support/t9n/SaveLayer_id.json +0 -1
  238. package/assets/esri/widgets/support/t9n/SaveLayer_it.json +0 -1
  239. package/assets/esri/widgets/support/t9n/SaveLayer_ja.json +0 -1
  240. package/assets/esri/widgets/support/t9n/SaveLayer_ko.json +0 -1
  241. package/assets/esri/widgets/support/t9n/SaveLayer_lt.json +0 -1
  242. package/assets/esri/widgets/support/t9n/SaveLayer_lv.json +0 -1
  243. package/assets/esri/widgets/support/t9n/SaveLayer_nl.json +0 -1
  244. package/assets/esri/widgets/support/t9n/SaveLayer_no.json +0 -1
  245. package/assets/esri/widgets/support/t9n/SaveLayer_pl.json +0 -1
  246. package/assets/esri/widgets/support/t9n/SaveLayer_pt-BR.json +0 -1
  247. package/assets/esri/widgets/support/t9n/SaveLayer_pt-PT.json +0 -1
  248. package/assets/esri/widgets/support/t9n/SaveLayer_ro.json +0 -1
  249. package/assets/esri/widgets/support/t9n/SaveLayer_ru.json +0 -1
  250. package/assets/esri/widgets/support/t9n/SaveLayer_sk.json +0 -1
  251. package/assets/esri/widgets/support/t9n/SaveLayer_sl.json +0 -1
  252. package/assets/esri/widgets/support/t9n/SaveLayer_sr.json +0 -1
  253. package/assets/esri/widgets/support/t9n/SaveLayer_sv.json +0 -1
  254. package/assets/esri/widgets/support/t9n/SaveLayer_th.json +0 -1
  255. package/assets/esri/widgets/support/t9n/SaveLayer_tr.json +0 -1
  256. package/assets/esri/widgets/support/t9n/SaveLayer_uk.json +0 -1
  257. package/assets/esri/widgets/support/t9n/SaveLayer_vi.json +0 -1
  258. package/assets/esri/widgets/support/t9n/SaveLayer_zh-CN.json +0 -1
  259. package/assets/esri/widgets/support/t9n/SaveLayer_zh-HK.json +0 -1
  260. package/assets/esri/widgets/support/t9n/SaveLayer_zh-TW.json +0 -1
  261. package/widgets/Directions/components/SaveLayer.js +0 -5
  262. package/widgets/Directions/css.js +0 -5
  263. /package/{views/3d/webgl-engine/core/shaderLibrary/util → webscene/support}/AlphaCutoff.js +0 -0
@@ -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"../../request.js";import t from"../../geometry/Extent.js";import a from"../../geometry/Point.js";import l from"../../geometry/SpatialReference.js";import i from"../../layers/support/RasterInfo.js";import n from"../../layers/support/RasterStorageInfo.js";import{parseUrl as s,encode as r,asValidOptions as o}from"../utils.js";import u from"../support/FeatureSet.js";async function m(m,f,p){const c=s(m),{rasterFunction:d,sourceJSON:h}=f||{},g=d?JSON.stringify(d.rasterFunctionDefinition||d):null,y=r({...c.query,renderingRule:g,f:"json"}),x=o(y,p);m=c.path;const b=h||await e(m,x).then((e=>e.data)),v=b.hasRasterAttributeTable?e(`${m}/rasterAttributeTable`,x):null,S=b.hasColormap?e(`${m}/colormap`,x):null,V=b.hasHistograms?e(`${m}/histograms`,x):null,D=b.currentVersion>=10.3?e(`${m}/keyProperties`,x):null,I=b.hasMultidimensions?e(`${m}/multidimensionalInfo`,x):null,T=await Promise.allSettled([v,S,V,D,I]);let R=null;if(b.minValues&&b.minValues.length===b.bandCount){R=[];for(let e=0;e<b.minValues.length;e++)R.push({min:b.minValues[e],max:b.maxValues[e],avg:b.meanValues[e],stddev:b.stdvValues[e]})}const j=t.fromJSON(b.extent),w=Math.ceil(j.width/b.pixelSizeX-.1),M=Math.ceil(j.height/b.pixelSizeY-.1),N=l.fromJSON(b.spatialReference||b.extent.spatialReference),J="fulfilled"===T[0].status?T[0].value?.data:null,O=J?.features?.length?u.fromJSON(J):null,k="fulfilled"===T[1].status?T[1].value?.data.colormap:null,C=k?.length?k:null,P="fulfilled"===T[2].status?T[2].value?.data.histograms:null,z=P?.[0]?.counts?.length?P:null,F="fulfilled"===T[3].status?T[3].value?.data??{}:{},$="fulfilled"===T[4].status?T[4].value?.data.multidimensionalInfo:null,H=$?.variables?.length?$:null;H&&H.variables.forEach((e=>{e.statistics?.length&&e.statistics.forEach((e=>{e.avg=e.mean,e.stddev=e.standardDeviation}))}));const{defaultVariable:L,serviceDataType:A}=b;L&&L!==F.DefaultVariable&&(F.DefaultVariable=L),A?.includes("esriImageServiceDataTypeVector")&&!A.includes(F.DataType)&&(F.DataType=A.replace("esriImageServiceDataType",""));let E=b.noDataValue;b.noDataValues?.length&&b.noDataValues.some((e=>e!==E))&&(E=b.noDataValues);const q=b.transposeInfo?new n({blockWidth:256,blockHeight:256,pyramidBlockWidth:256,pyramidBlockHeight:256,pyramidScalingFactor:2,compression:"lerc",origin:new a({x:b.extent.xmin,y:b.extent.ymax,spatialReference:N}),firstPyramidLevel:1,maximumPyramidLevel:Math.max(0,Math.round(Math.log(Math.max(w,M))/Math.LN2-8)),transposeInfo:b.transposeInfo}):void 0;return new i({width:w,height:M,bandCount:b.bandCount,extent:t.fromJSON(b.extent),spatialReference:N,pixelSize:new a({x:b.pixelSizeX,y:b.pixelSizeY,spatialReference:N}),pixelType:b.pixelType.toLowerCase(),statistics:R,attributeTable:O,colormap:C,histograms:z,keyProperties:F,noDataValue:E,multidimensionalInfo:H,storageInfo:q})}function f(e,t,a){return m(e,{sourceJSON:t},a)}function p(e,t,a){return m(e,{rasterFunction:t},a)}function c(e,t){e.attributeTable||(t.hasRasterAttributeTable=!1),e.histograms||(t.hasHistograms=!1),e.colormap||(t.hasColormap=!1),e.multidimensionalInfo||(t.hasMultidimensions=!1)}export{f as fetchServiceRasterInfo,p as generateRasterInfo,c as patchServiceInfo};
5
+ import e from"../../request.js";import t from"../../geometry/Extent.js";import a from"../../geometry/Point.js";import i from"../../geometry/SpatialReference.js";import l from"../../layers/support/RasterInfo.js";import n from"../../layers/support/RasterStorageInfo.js";import{parseUrl as s,encode as r,asValidOptions as o}from"../utils.js";import u from"../support/FeatureSet.js";async function m(m,f,p){const c=s(m),{rasterFunction:d,sourceJSON:h}=f||{},g=d?JSON.stringify(d.rasterFunctionDefinition||d):null,y=r({...c.query,renderingRule:g,f:"json"}),x=o(y,p);m=c.path;const S=h||await e(m,x).then((e=>e.data)),b=S.hasRasterAttributeTable?e(`${m}/rasterAttributeTable`,x):null,v=S.hasColormap?e(`${m}/colormap`,x):null,V=S.hasHistograms?e(`${m}/histograms`,x):null,D=S.currentVersion>=10.3?e(`${m}/keyProperties`,x):null,I=S.hasMultidimensions?e(`${m}/multidimensionalInfo`,x):null,T=await Promise.allSettled([b,v,V,D,I]);let R=null;if(S.minValues&&S.minValues.length===S.bandCount){R=[];for(let e=0;e<S.minValues.length;e++)R.push({min:S.minValues[e],max:S.maxValues[e],avg:S.meanValues[e],stddev:S.stdvValues[e]})}const j=t.fromJSON(S.extent),w=Math.ceil(j.width/S.pixelSizeX-.1),M=Math.ceil(j.height/S.pixelSizeY-.1),N=i.fromJSON(S.spatialReference||S.extent.spatialReference),O="fulfilled"===T[0].status?T[0].value?.data:null,J=O?.features?.length?u.fromJSON(O):null,k="fulfilled"===T[1].status?T[1].value?.data.colormap:null,C=k?.length?k:null,P="fulfilled"===T[2].status?T[2].value?.data.histograms:null,z=P?.[0]?.counts?.length?P:null,F="fulfilled"===T[3].status?T[3].value?.data??{}:{},$="fulfilled"===T[4].status?T[4].value?.data.multidimensionalInfo:null,E=$?.variables?.length?$:null;E&&E.variables.forEach((e=>{e.statistics?.length&&e.statistics.forEach((e=>{e.avg=e.mean,e.stddev=e.standardDeviation})),e.dimensions?.forEach((e=>{"StdTime"!==e.name||e.recurring||e.unit||(e.unit="ISO8601")}))}));const{defaultVariable:H,serviceDataType:L}=S;H&&H!==F.DefaultVariable&&(F.DefaultVariable=H),L?.includes("esriImageServiceDataTypeVector")&&!L.includes(F.DataType)&&(F.DataType=L.replace("esriImageServiceDataType",""));let A=S.noDataValue;S.noDataValues?.length&&S.noDataValues.some((e=>e!==A))&&(A=S.noDataValues);const q=S.transposeInfo?new n({blockWidth:256,blockHeight:256,pyramidBlockWidth:256,pyramidBlockHeight:256,pyramidScalingFactor:2,compression:"lerc",origin:new a({x:S.extent.xmin,y:S.extent.ymax,spatialReference:N}),firstPyramidLevel:1,maximumPyramidLevel:Math.max(0,Math.round(Math.log(Math.max(w,M))/Math.LN2-8)),transposeInfo:S.transposeInfo}):void 0;return new l({width:w,height:M,bandCount:S.bandCount,extent:t.fromJSON(S.extent),spatialReference:N,pixelSize:new a({x:S.pixelSizeX,y:S.pixelSizeY,spatialReference:N}),pixelType:S.pixelType.toLowerCase(),statistics:R,attributeTable:J,colormap:C,histograms:z,keyProperties:F,noDataValue:A,multidimensionalInfo:E,storageInfo:q})}function f(e,t,a){return m(e,{sourceJSON:t},a)}function p(e,t,a){return m(e,{rasterFunction:t},a)}function c(e,t){e.attributeTable||(t.hasRasterAttributeTable=!1),e.histograms||(t.hasHistograms=!1),e.colormap||(t.hasColormap=!1),e.multidimensionalInfo||(t.hasMultidimensions=!1)}export{f as fetchServiceRasterInfo,p as generateRasterInfo,c as patchServiceInfo};
@@ -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 b="20250202",d="3b3ed27f0dacd0b2a69be1e5b3b9e12dd428cc25";export{b as buildDate,d as commitHash};
5
+ const e="20250204",c="7ebd4ebe2f79c502abd3510e3c54c23edc7a4f7f";export{e as buildDate,c as commitHash};
@@ -2,4 +2,3 @@ import "../interfaces";
2
2
 
3
3
  export const getTimeExtentFromLayers: __esri.timeUtils["getTimeExtentFromLayers"];
4
4
  export const getTimeSliderSettingsFromWebDocument: __esri.timeUtils["getTimeSliderSettingsFromWebDocument"];
5
- export const getTimeSliderSettingsFromWebMap: __esri.timeUtils["getTimeSliderSettingsFromWebMap"];
@@ -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{isSome as t}from"../core/arrayUtils.js";import{deprecatedFunction as e}from"../core/deprecate.js";import{clone as n}from"../core/lang.js";import i from"../core/Logger.js";import{offsetDate as r}from"../core/timeUtils.js";import s from"../time/TimeExtent.js";import{isWebMap as l}from"../webmap/utils.js";import{isWebScene as o}from"../webscene/utils.js";function m(t){return void 0!==t.timeInfo}async function u(t,e){return t.widgets?.timeSlider?.fullTimeExtent??f(t.allLayers,e)}function a(t){const e=t.numThumbs??2,n=t.currentTimeExtent;if(n){const{start:t,end:i}=n;return null!=t&&null!=i&&t.getTime()===i.getTime()?"instant":2===e?"time-window":null==t||0===t.getTime()?"cumulative-from-start":"cumulative-from-end"}return 2===e?"time-window":"cumulative-from-start"}function c(t){const{numStops:e,stopInterval:i,stops:r}=t;return r?{dates:n(r)}:i?{interval:i.clone()}:{count:e??5}}async function f(e,n){if(0===e.length)return s.allTime;await Promise.all(e.map((t=>t.load({signal:n}))));const i=e.filter(m),r=e.filter((t=>!m(t)&&null!=t.visibilityTimeExtent));if(0===i.length&&0===r.length)return s.allTime;const l=[],o=[];for(const t of i)"feature"!==t?.type&&"map-image"!==t?.type||!t.timeInfo?.hasLiveData?o.push(t):l.push(t);const u=t=>null==t||t.isAllTime,a=[...o.map((t=>{const e=t.timeInfo?.fullTimeExtent,{visibilityTimeExtent:n}=t;return e?.intersection(n)??n})),...r.map((t=>t.visibilityTimeExtent))];if(a.some(u))return s.allTime;const c=l.map((async t=>{const e=(await t.fetchRecomputedExtents({signal:n}))?.timeExtent??t.timeInfo?.fullTimeExtent,{visibilityTimeExtent:i}=t;return e?.intersection(i)??i})),f=(await Promise.allSettled(c)).map((t=>"fulfilled"===t.status?t.value:null));if(f.some(u))return s.allTime;const p=[...f,...a].filter(t);if(0===p.length)return s.allTime;return p.reduce(((t,e)=>t.union(e)))}function p(t,e){const n=t.currentTimeExtent;if(!n)return null;const{start:i,end:r}=n,l=i??r??null;switch(e){case"time-window":return new s({start:i,end:r});case"cumulative-from-start":return new s({start:null,end:l});case"cumulative-from-end":return new s({start:l,end:null});case"instant":return new s({start:l,end:l})}}async function d(t,n){return e(i.getLogger("esri.support.timeUtils.getTimeSliderSettingsFromWebMap"),"`timeUtils.getTimeSliderSettingsFromWebMap` is deprecated in favor of 'timeUtils.getTimeSliderSettingsFromWebDocument'",{replacement:"timeUtils.getTimeSliderSettingsFromWebDocument",version:"4.30",see:"https://developers.arcgis.com/javascript/latest/api-reference/esri-support-timeUtils.html#getTimeSliderSettingsFromWebDocument",warnOnce:!0}),null!=t&&l(t)?await g(t,n):null}async function g(t,e){if(!l(t)&&!o(t))return null;await t.load({signal:e});const n=t?.widgets?.timeSlider;if(!n)return null;const i=await u(t,e),r=n.loop,s=a(n);return{fullTimeExtent:i,loop:r,mode:s,playRate:n.stopDelay??2e3,stops:c(n),timeExtent:p(n,s)}}function T(t){if(!t)return t;const{start:e,end:n}=t;return new s({start:null!=e?r(e,-e.getTimezoneOffset(),"minutes"):e,end:null!=n?r(n,-n.getTimezoneOffset(),"minutes"):n})}function w(t){if(!t)return t;const{start:e,end:n}=t;return new s({start:null!=e?r(e,e.getTimezoneOffset(),"minutes"):e,end:null!=n?r(n,n.getTimezoneOffset(),"minutes"):n})}export{f as getTimeExtentFromLayers,g as getTimeSliderSettingsFromWebDocument,d as getTimeSliderSettingsFromWebMap,w as toLocalTimeExtent,T as toUTCTimeExtent};
5
+ import{isSome as t}from"../core/arrayUtils.js";import{clone as e}from"../core/lang.js";import{offsetDate as n}from"../core/timeUtils.js";import i from"../time/TimeExtent.js";import{isWebMap as r}from"../webmap/utils.js";import{isWebScene as l}from"../webscene/utils.js";function s(t){return void 0!==t.timeInfo}async function u(t,e){return t.widgets?.timeSlider?.fullTimeExtent??a(t.allLayers,e)}function o(t){const e=t.numThumbs??2,n=t.currentTimeExtent;if(n){const{start:t,end:i}=n;return null!=t&&null!=i&&t.getTime()===i.getTime()?"instant":2===e?"time-window":null==t||0===t.getTime()?"cumulative-from-start":"cumulative-from-end"}return 2===e?"time-window":"cumulative-from-start"}function m(t){const{numStops:n,stopInterval:i,stops:r}=t;return r?{dates:e(r)}:i?{interval:i.clone()}:{count:n??5}}async function a(e,n){if(0===e.length)return i.allTime;await Promise.all(e.map((t=>t.load({signal:n}))));const r=e.filter(s),l=e.filter((t=>!s(t)&&null!=t.visibilityTimeExtent));if(0===r.length&&0===l.length)return i.allTime;const u=[],o=[];for(const t of r)"feature"!==t?.type&&"map-image"!==t?.type||!t.timeInfo?.hasLiveData?o.push(t):u.push(t);const m=t=>null==t||t.isAllTime,a=[...o.map((t=>{const e=t.timeInfo?.fullTimeExtent,{visibilityTimeExtent:n}=t;return e?.intersection(n)??n})),...l.map((t=>t.visibilityTimeExtent))];if(a.some(m))return i.allTime;const f=u.map((async t=>{const e=(await t.fetchRecomputedExtents({signal:n}))?.timeExtent??t.timeInfo?.fullTimeExtent,{visibilityTimeExtent:i}=t;return e?.intersection(i)??i})),c=(await Promise.allSettled(f)).map((t=>"fulfilled"===t.status?t.value:null));if(c.some(m))return i.allTime;const d=[...c,...a].filter(t);if(0===d.length)return i.allTime;return d.reduce(((t,e)=>t.union(e)))}function f(t,e){const n=t.currentTimeExtent;if(!n)return null;const{start:r,end:l}=n,s=r??l??null;switch(e){case"time-window":return new i({start:r,end:l});case"cumulative-from-start":return new i({start:null,end:s});case"cumulative-from-end":return new i({start:s,end:null});case"instant":return new i({start:s,end:s})}}async function c(t,e){if(!r(t)&&!l(t))return null;await t.load({signal:e});const n=t?.widgets?.timeSlider;if(!n)return null;const i=await u(t,e),s=n.loop,a=o(n);return{fullTimeExtent:i,loop:s,mode:a,playRate:n.stopDelay??2e3,stops:m(n),timeExtent:f(n,a)}}function d(t){if(!t)return t;const{start:e,end:r}=t;return new i({start:null!=e?n(e,-e.getTimezoneOffset(),"minutes"):e,end:null!=r?n(r,-r.getTimezoneOffset(),"minutes"):r})}function p(t){if(!t)return t;const{start:e,end:r}=t;return new i({start:null!=e?n(e,e.getTimezoneOffset(),"minutes"):e,end:null!=r?n(r,r.getTimezoneOffset(),"minutes"):r})}export{a as getTimeExtentFromLayers,c as getTimeSliderSettingsFromWebDocument,p as toLocalTimeExtent,d as toUTCTimeExtent};
@@ -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{defaultFontFamily as t}from"../../core/fontUtils.js";import has from"../../core/has.js";import{clone as e}from"../../core/lang.js";import r from"../../core/Logger.js";import{deg2rad as i}from"../../core/mathUtils.js";import s from"../../core/ObjectPool.js";import{px2pt as o,pt2px as n}from"../../core/screenUtils.js";import{GeometryCursor as a}from"../../geometry/GeometryCursor.js";import{fromValues as l,create as h,empty as c,expandPointInPlace as m,center as f,width as u,height as d,diagonal as g}from"../../geometry/support/aaBoundingRect.js";import{getBoundsXY as p}from"../../geometry/support/boundsUtils.js";import{polygonCentroid as _}from"../../geometry/support/centroid.js";import{isPoint as y,isPolygon as P,isPolyline as S,isExtent as w,isMultipoint as x}from"../../geometry/support/jsonUtils.js";import{SimpleEffectCursor as M}from"./CIMEffects.js";import b from"./CIMImageColorSubstitutionHelper.js";import{getEffectOperator as k,getPlacementOperator as C}from"./CIMOperators.js";import{Placement as v}from"./CIMPlacements.js";import{defaultCIMValues as I}from"./defaultCIMValues.js";import{LineCapStyle as T,LineJoinStyle as R}from"./enums.js";import{getFirstFrame as z}from"./imageUtils.js";import{rotate as L}from"./mathUtils.js";import{addColorStops as F}from"./rasterizingUtils.js";import U from"./Rect.js";import A from"./TextRasterizer.js";import{getNumericValue as j,isCIMFill as G,getSize as D,isSVGImage as H,getRelativeGradientSize as B,fromCIMFontDecoration as E,fromCIMFontStyle as X,fromCIMHorizontalAlignment as J,fromCIMVerticalAlignment as N,getFillColor as O,getStrokeColor as q,getStrokeWidth as V,getFontStyle as W,getFontWeight as Y}from"./utils.js";import{destroyHiddenSvg as $,createHiddenSvg as K,createSvgElement as Q}from"../../views/2d/engine/svgUtils.js";import{glyphSize as Z,magicLabelLineHeight as tt,hittestToleranceSmallSymbol as et,hittestSmallSymbolThreshold as rt}from"../../views/2d/engine/webgl/definitions.js";import{shapeGlyphs as it}from"../../views/2d/engine/webgl/mesh/templates/shapingUtils.js";import{roundPtToWholePixel as st,getLineWidth as ot}from"../../views/2d/layers/graphics/graphicsUtils.js";const nt=Math.PI/180,at=.5,lt=()=>r.getLogger("esri.symbols.cim.CIMSymbolDrawHelper");class ht{constructor(t){this._t=t}static createIdentity(){return new ht([1,0,0,0,1,0])}clone(){const t=this._t;return new ht(t.slice())}transform(t){const e=this._t;return[e[0]*t[0]+e[1]*t[1]+e[2],e[3]*t[0]+e[4]*t[1]+e[5]]}static createScale(t,e){return new ht([t,0,0,0,e,0])}scale(t,e){const r=this._t;return r[0]*=t,r[1]*=t,r[2]*=t,r[3]*=e,r[4]*=e,r[5]*=e,this}scaleRatio(){return Math.sqrt(this._t[0]*this._t[0]+this._t[1]*this._t[1])}static createTranslate(t,e){return new ht([0,0,t,0,0,e])}translate(t,e){const r=this._t;return r[2]+=t,r[5]+=e,this}static createRotate(t){const e=Math.cos(t),r=Math.sin(t);return new ht([e,-r,0,r,e,0])}rotate(t){return ht.multiply(this,ht.createRotate(t),this)}angle(){const t=this._t[0],e=this._t[3],r=Math.sqrt(t*t+e*e);return[t/r,e/r]}static multiply(t,e,r){const i=t._t,s=e._t,o=i[0]*s[0]+i[3]*s[1],n=i[1]*s[0]+i[4]*s[1],a=i[2]*s[0]+i[5]*s[1]+s[2],l=i[0]*s[3]+i[3]*s[4],h=i[1]*s[3]+i[4]*s[4],c=i[2]*s[3]+i[5]*s[4]+s[5],m=r._t;return m[0]=o,m[1]=n,m[2]=a,m[3]=l,m[4]=h,m[5]=c,r}invert(){const t=this._t;let e=t[0]*t[4]-t[1]*t[3];if(0===e)return new ht([0,0,0,0,0,0]);e=1/e;const r=(t[1]*t[5]-t[2]*t[4])*e,i=(t[2]*t[3]-t[0]*t[5])*e,s=t[4]*e,o=-t[1]*e,n=-t[3]*e,a=t[0]*e;return new ht([s,o,r,n,a,i])}}class ct{constructor(t,e){this._resourceManager=t,this._transfos=[],this._sizeTransfos=[],this._geomUnitsPerPoint=1,this._placementPool=new s(v,void 0,void 0,100),this._earlyReturn=!1,this._mapRotation=0,this._transfos.push(e||ht.createIdentity()),this._sizeTransfos.push(e?e.scaleRatio():1)}setTransform(t,e){this._transfos=[t||ht.createIdentity()],this._sizeTransfos=[e||(t?t.scaleRatio():1)]}setGeomUnitsPerPoint(t){this._geomUnitsPerPoint=t}transformPt(t){return this._transfos[this._transfos.length-1].transform(t)}transformSize(t){return t*this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformPt(t){return this._transfos[this._transfos.length-1].invert().transform(t)}reverseTransformSize(t){return t/this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformScalar(t){return t/this._transfos[this._transfos.length-1].scaleRatio()}getTransformAngle(){return this._transfos[this._transfos.length-1].angle()}geomUnitsPerPoint(){return this.isEmbedded()?1:this._geomUnitsPerPoint}prevGeomUnitsPerPoint(){return this._transfos.length>2?1:this._geomUnitsPerPoint}isEmbedded(){return this._transfos.length>1}back(){return this._transfos[this._transfos.length-1]}push(t,e){const r=e?t.scaleRatio():1;ht.multiply(t,this.back(),t),this._transfos.push(t),this._sizeTransfos.push(this._sizeTransfos[this._sizeTransfos.length-1]*r)}pop(){this._transfos.splice(-1,1),this._sizeTransfos.splice(-1,1)}drawSymbol(t,e,r){if(t)switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this.drawMultiLayerSymbol(t,e);break;case"CIMTextSymbol":this.drawTextSymbol(t,e,r)}}drawMultiLayerSymbol(t,e){if(!t||!e)return;const r=t.symbolLayers;if(!r)return;const i=t.effects;if(i&&i.length>0){const t=this.executeEffects(i,e);if(t){let e=t.next();for(;e;)this.drawSymbolLayers(r,e.asJSON()),e=t.next()}}else this.drawSymbolLayers(r,e)}executeEffects(t,e){const r=this._resourceManager.geometryEngine;let i=new M(a.fromJSONCIM(e));for(const s of t){const t=k(s);t&&(i=t.execute(i,s,this.geomUnitsPerPoint(),null,r))}return i}drawSymbolLayers(t,e){let r=t.length;for(;r--;){const i=t[r];if(!i||!1===i.enable)continue;const s=i.effects;if(s&&s.length>0){const t=this.executeEffects(s,e);if(t){let e=null;for(;(e=t.next())&&(this.drawSymbolLayer(i,e.asJSON()),!this._earlyReturn););}}else this.drawSymbolLayer(i,e);if(this._earlyReturn)return}}drawSymbolLayer(t,e){switch(t.type){case"CIMSolidFill":this.drawSolidFill(e,t.color,t.path);break;case"CIMHatchFill":this.drawHatchFill(e,t);break;case"CIMPictureFill":this.drawPictureFill(e,t);break;case"CIMGradientFill":this.drawGradientFill(e,t);break;case"CIMSolidStroke":this.drawSolidStroke(e,t.color,t.width,t.capStyle,t.joinStyle,t.miterLimit,t.path);break;case"CIMPictureStroke":this.drawPictureStroke(e,t);break;case"CIMGradientStroke":this.drawGradientStroke(e,t);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":this.drawMarkerLayer(t,e)}}drawHatchFill(t,e){const r=dt(e,t,this.geomUnitsPerPoint());r&&(this.pushClipPath(t),this.drawMultiLayerSymbol(e.lineSymbol,r),this.popClipPath())}drawPictureFill(t,e){}drawGradientFill(t,e){}drawPictureStroke(t,e){}drawGradientStroke(t,e){}drawMarkerLayer(t,e){const r=t.markerPlacement;if(r){const i=C(r);if(i){const s="CIMMarkerPlacementInsidePolygon"===r.type||"CIMMarkerPlacementPolygonCenter"===r.type&&r.clipAtBoundary;s&&this.pushClipPath(e);const o=i.execute(a.fromJSONCIM(e),r,this.geomUnitsPerPoint(),null,this._resourceManager.geometryEngine);if(o){let e=null;for(;(e=o.next())&&(this.drawMarker(t,e),!this._earlyReturn););}s&&this.popClipPath()}}else{const r=this._placementPool.acquire();if(y(e))r.tx=e.x,r.ty=e.y,this.drawMarker(t,r);else if(P(e)){const i=_(e);i&&([r.tx,r.ty]=i,this.drawMarker(t,r))}else for(const i of e.points)if(r.tx=i[0],r.ty=i[1],this.drawMarker(t,r),this._earlyReturn)break;this._placementPool.release(r)}}drawMarker(t,e){switch(t.type){case"CIMCharacterMarker":case"CIMPictureMarker":this.drawPictureMarker(t,e);break;case"CIMVectorMarker":this.drawVectorMarker(t,e)}}drawPictureMarker(t,e){if(!t)return;const r=this._resourceManager.getResource(t.url),i=j(t.size,I.CIMPictureMarker.size);if(null==r||i<=0)return;const s=r.width,o=r.height;if(!s||!o)return;const n=s/o,a=j(t.scaleX,1),l=ht.createIdentity(),h=t.anchorPoint;if(h){let e=h.x,r=h.y;"Absolute"!==t.anchorPointUnits&&(e*=i*n*a,r*=i),l.translate(-e,-r)}let c=j(t.rotation);t.rotateClockwise&&(c=-c),this._mapRotation&&(c+=this._mapRotation),c&&l.rotate(c*nt);let m=j(t.offsetX),f=j(t.offsetY);if(m||f){if(this._mapRotation){const t=nt*this._mapRotation,e=Math.cos(t),r=Math.sin(t),i=m*r+f*e;m=m*e-f*r,f=i}l.translate(m,f)}const u=this.geomUnitsPerPoint();1!==u&&l.scale(u,u);const d=e.getAngle();d&&l.rotate(d),l.translate(e.tx,e.ty),this.push(l,!1),this.drawImage(t,i),this.pop()}drawVectorMarker(t,e){if(!t)return;const r=t.markerGraphics;if(!r)return;const i=j(t.size,I.CIMVectorMarker.size),s=t.frame,o=s?s.ymax-s.ymin:0,n=i&&o?i/o:1,a=ht.createIdentity();s&&a.translate(.5*-(s.xmax+s.xmin),.5*-(s.ymax+s.ymin));const l=t.anchorPoint;if(l){let e=l.x,r=l.y;"Absolute"!==t.anchorPointUnits?s&&(e*=s.xmax-s.xmin,r*=s.ymax-s.ymin):(e/=n,r/=n),a.translate(-e,-r)}1!==n&&a.scale(n,n);let h=j(t.rotation);t.rotateClockwise&&(h=-h),this._mapRotation&&(h+=this._mapRotation),h&&a.rotate(h*nt);let c=j(t.offsetX),m=j(t.offsetY);if(c||m){if(this._mapRotation){const t=nt*this._mapRotation,e=Math.cos(t),r=Math.sin(t),i=c*r+m*e;c=c*e-m*r,m=i}a.translate(c,m)}const f=this.geomUnitsPerPoint();1!==f&&a.scale(f,f);const u=e.getAngle();u&&a.rotate(u),a.translate(e.tx,e.ty),this.push(a,t.scaleSymbolsProportionally);for(const d of r){d?.symbol&&d.geometry||lt().error("Invalid marker graphic",d);let t=d.textString;if("number"==typeof t&&(t=t.toString()),this.drawSymbol(d.symbol,d.geometry,t),this._earlyReturn)break}this.pop()}drawTextSymbol(t,e,r){if(!t)return;if(!y(e))return;if(j(t.height,I.CIMTextSymbol.height)<=0)return;const i=ht.createIdentity();let s=j(t.angle);s=-s,s&&i.rotate(s*nt);const o=j(t.offsetX),n=j(t.offsetY);(o||n)&&i.translate(o,n);const a=this.geomUnitsPerPoint();1!==a&&i.scale(a,a),i.translate(e.x,e.y),this.push(i,!1),this.drawText(t,r),this.pop()}}class mt extends ct{constructor(t,e){super(t,e),this.reset()}reset(){this._xmin=this._ymin=1/0,this._xmax=this._ymax=-1/0,this._clipCount=0}envelope(){return new U(this._xmin,this._ymin,this._xmax-this._xmin,this._ymax-this._ymin)}bounds(){return l(this._xmin,this._ymin,this._xmax,this._ymax)}drawSolidFill(t){if(t&&!(this._clipCount>0))if(P(t))this._processPath(t.rings,0);else if(S(t))this._processPath(t.paths,0);else if(w(t)){const e=yt(t);e&&this._processPath(e.rings,0)}else console.error("drawSolidFill Unexpected geometry type!")}drawSolidStroke(t,e,r){if(!t||this._clipCount>0||null==r||r<=0)return;const i=Math.max(.5*this.transformSize(j(r,I.CIMSolidStroke.width)),.5*at);if(P(t))this._processPath(t.rings,i);else if(S(t))this._processPath(t.paths,i);else if(w(t)){const e=yt(t);e&&this._processPath(e.rings,i)}else console.error("drawSolidStroke unexpected geometry type!")}drawMarkerLayer(t,e){P(e)&&t.markerPlacement&&("CIMMarkerPlacementInsidePolygon"===t.markerPlacement.type||"CIMMarkerPlacementPolygonCenter"===t.markerPlacement.type&&t.markerPlacement.clipAtBoundary)?this._processPath(e.rings,0):super.drawMarkerLayer(t,e)}drawHatchFill(t,e){this.drawSolidFill(t)}drawPictureFill(t,e){this.drawSolidFill(t)}drawGradientFill(t,e){this.drawSolidFill(t)}drawPictureStroke(t,e){this.drawSolidStroke(t,null,e.width)}drawGradientStroke(t,e){this.drawSolidStroke(t,null,e.width)}pushClipPath(t){this.drawSolidFill(t),this._clipCount++}popClipPath(){this._clipCount--}drawImage(t,e){const{url:r}=t,i=j(t.scaleX,1);let s=i*e,o=e;const n=this._resourceManager.getResource(r);if(null!=n){const t=n.height/n.width;s=i*(e?t>1?e:e/t:n.width),o=e?t>1?e*t:e:n.height}this._merge(this.transformPt([-s/2,-o/2]),0),this._merge(this.transformPt([-s/2,o/2]),0),this._merge(this.transformPt([s/2,-o/2]),0),this._merge(this.transformPt([s/2,o/2]),0)}drawText(t,e){if(!e||0===e.length)return;this._textRasterizer||(this._textRasterizer=new A);const r=St(t);let[i,s]=this._textRasterizer.computeTextSize(e,r);i=o(i),s=o(s);const n=this.transformSize(1)*this.reverseTransformScalar(1);i*=n,s*=n;let a=0;switch(t.horizontalAlignment){case"Left":a=i/2;break;case"Right":a=-i/2}let l=0;switch(t.verticalAlignment){case"Bottom":l=s/2;break;case"Top":l=-s/2;break;case"Baseline":l=s/6}this._merge(this.transformPt([-i/2+a,-s/2+l]),0),this._merge(this.transformPt([-i/2+a,s/2+l]),0),this._merge(this.transformPt([i/2+a,-s/2+l]),0),this._merge(this.transformPt([i/2+a,s/2+l]),0)}_processPath(t,e){if(t)for(const r of t){const t=r?r.length:0;if(t>1){this._merge(this.transformPt(r[0]),e);for(let i=1;i<t;i++)this._merge(this.transformPt(r[i]),e)}}}_merge(t,e){t[0]-e<this._xmin&&(this._xmin=t[0]-e),t[0]+e>this._xmax&&(this._xmax=t[0]+e),t[1]-e<this._ymin&&(this._ymin=t[1]-e),t[1]+e>this._ymax&&(this._ymax=t[1]+e)}}class ft extends ct{constructor(){super(...arguments),this._searchPoint=[0,0],this._searchDistPoint=0,this._textInfo=null,this._svg=null,this._path=null,this._canvas=null}destroy(){this._svg=$(this._svg),this._path=null,this._canvas=null}hitTest(t,e,r,i,s,a){const l=a*n(1);this.setTransform(),this.setGeomUnitsPerPoint(l),this._searchPoint=[(t[0]+t[2])/2,(t[1]+t[3])/2],this._searchDistPoint=(t[2]-t[0])/2/l,this._textInfo=i;const h=e&&("CIMPointSymbol"===e.type&&"Map"!==e.angleAlignment||"CIMTextSymbol"===e.type);if(this._mapRotation=h?s:0,!has("esri-mobile")){const t=o(et*window.devicePixelRatio),r=o(rt);!(("CIMLineSymbol"===e?.type||"CIMPolygonSymbol"===e?.type)&&e.symbolLayers?.some(G))&&"CIMMeshSymbol"!==e?.type&&(D(e)??0)<r&&(this._searchDistPoint=t)}return this._earlyReturn=!1,this.drawSymbol(e,r),this._earlyReturn}executeEffects(t,e){return"CIMGeometricEffectDashes"===t.at(-1)?.type&&(t=t.slice(0,-1)),super.executeEffects(t,e)}drawSolidFill(t,e,r){null!=r?this._hittestSvgPath(t,r,!0):this._hitTestFill(t)}drawHatchFill(t,e){this._hitTestFill(t)}drawPictureFill(t,e){this._hitTestFill(t)}drawGradientFill(t,e){this._hitTestFill(t)}drawSolidStroke(t,e,r,i,s,o,n){null!=n?this._hittestSvgPath(t,n,!1,r):this._hitTestStroke(t,r)}drawPictureStroke(t,e){this._hitTestStroke(t,e.width)}drawGradientStroke(t,e){this._hitTestStroke(t,e.width)}drawMarkerLayer(t,e){t.markerPlacement&&("CIMMarkerPlacementInsidePolygon"===t.markerPlacement.type||"CIMMarkerPlacementPolygonCenter"===t.markerPlacement.type&&t.markerPlacement.clipAtBoundary)?this._hitTestFill(e):super.drawMarkerLayer(t,e)}pushClipPath(t){}popClipPath(){}drawImage(t,e){const{url:r}=t,i=j(t.scaleX,1),s=this._resourceManager.getResource(r);if(null==s||0===s.height||0===e)return;const o=e*this.geomUnitsPerPoint(),n=o*i*(s.width/s.height),a=this.reverseTransformPt(this._searchPoint),l=this._searchDistPoint;Math.abs(a[0])<n/2+l&&Math.abs(a[1])<o/2+l&&(this._earlyReturn=!0)}drawText(t,e){const r=this._textInfo;if(!r)return;const i=r.get(t);if(!i)return;if(!i.glyphMosaicItems.glyphs.length)return;const s=st(j(t.height,I.CIMTextSymbol.height)),{lineGapType:o,lineGap:n}=t,a=o?Pt(o,j(n),s):0,l="CIMBackgroundCallout"===t.callout?.type,h=it(i.glyphMosaicItems,{scale:s/Z,angle:0,xOffset:0,yOffset:0,horizontalAlignment:t.horizontalAlignment,verticalAlignment:t.verticalAlignment,maxLineWidth:ot(t.lineWidth),lineHeight:tt*Math.max(.25,Math.min(a||1,4)),decoration:t.font.decoration||"none",useCIMAngleBehavior:!0,hasBackground:l}),c=this.reverseTransformPt(this._searchPoint),m=c[0],f=c[1];for(const u of h.glyphs)if(m>u.xTopLeft&&m<u.xBottomRight&&f>-u.yBottomRight&&f<-u.yTopLeft){this._earlyReturn=!0;break}}_hitTestFill(t){let e=null;if(w(t)){const r=t;e=[[[r.xmin,r.ymin],[r.xmin,r.ymax],[r.xmax,r.ymax],[r.xmax,r.ymin],[r.xmin,r.ymin]]]}else if(P(t))e=t.rings;else{if(!S(t))return;e=t.paths}const r=this.reverseTransformPt(this._searchPoint);if(gt(r,e)&&(this._earlyReturn=!0),!this._earlyReturn){pt(r,e,this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint())&&(this._earlyReturn=!0)}}_getSvgPath(){return null!=this._svg&&null!=this._path||(this._svg??=K(),this._path??=Q("path"),this._svg.appendChild(this._path)),this._path}_getCanvasContext(t,e){return this._canvas??=document.createElement("canvas"),this._canvas.width=t,this._canvas.height=e,this._canvas.getContext("2d",{willReadFrequently:!0})}_hittestSvgPath(t,e,r,i=0){const s=this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint(),o=this.reverseTransformPt(this._searchPoint),n=h();p(n,t);const a={x:n[0],y:n[1],width:n[2]-n[0],height:n[3]-n[1]},l=this._getSvgPath();l.setAttribute("d",e);const c=l.getBBox();let m=Math.max(c.width/a.width,c.height/a.height),f=1;const u=2*s*m;u<1&&(f=2/u,m*=f,c.x*=f,c.y*=f,c.width*=f,c.height*=f);const d=1+i*m/2,g=this._getCanvasContext(c.width+2*d,c.height+2*d);g.setTransform(f,0,0,f,-c.x+d,-c.y+d);const _=new Path2D(e);r?g.fill(_):(g.lineWidth=i*(m/f),g.stroke(_));const y=(a.width*m-c.width)/2,P=(a.height*m-c.height)/2,S=Math.floor((o[0]-a.x-s)*m-y+d),w=Math.floor((a.height-(o[1]-a.y)-s)*m+P+d),x=Math.ceil(2*s*m),M=Math.ceil(2*s*m),b=g.getImageData(S,w,x,M).data;for(let h=3;h<b.length;h+=4)if(b[h]>127.5)return void(this._earlyReturn=!0)}_hitTestStroke(t,e){let r=null;if(w(t)){const e=t;r=[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]}else if(P(t))r=t.rings;else{if(!S(t))return;r=t.paths}pt(this.reverseTransformPt(this._searchPoint),r,j(e,I.CIMSolidStroke.width)*this.geomUnitsPerPoint()/2+this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint())&&(this._earlyReturn=!0)}}class ut extends ct{constructor(t,e,r,i){super(e,r),this._applyAdditionalRenderProps=i,this._colorSubstitutionHelper=new b,this._ctx=t}drawSolidFill(t,e){if(!t)return;if(P(t))this._buildPath(t.rings,!0);else if(S(t))this._buildPath(t.paths,!0);else if(w(t))this._buildPath(yt(t).rings,!0);else{if(!x(t))return;console.log("CanvasDrawHelper.drawSolidFill - No implementation!")}const r=this._ctx;r.fillStyle="string"==typeof e?e:"rgba("+Math.round(e[0])+","+Math.round(e[1])+","+Math.round(e[2])+","+(e[3]??255)/255+")",r.fill("evenodd")}drawSolidStroke(t,e,r,i,s,o){if(!t||!e||0===r)return;if(P(t))this._buildPath(t.rings,!0);else if(S(t))this._buildPath(t.paths,!1);else{if(!w(t))return void console.log("CanvasDrawHelper.drawSolidStroke isn't implemented!");this._buildPath(yt(t).rings,!0)}const n=this._ctx;n.strokeStyle="string"==typeof e?e:"rgba("+Math.round(e[0])+","+Math.round(e[1])+","+Math.round(e[2])+","+(e[3]??255)/255+")",n.lineWidth=Math.max(this.transformSize(r),at),this._setCapStyle(i),this._setJoinStyle(s),n.miterLimit=o,n.stroke()}pushClipPath(t){if(this._ctx.save(),P(t))this._buildPath(t.rings,!0);else if(S(t))this._buildPath(t.paths,!0);else{if(!w(t))return;this._buildPath(yt(t).rings,!0)}this._ctx.clip("evenodd")}popClipPath(){this._ctx.restore()}drawImage(t,e){const{colorSubstitutions:r,url:i,tintColor:s}=t,o=j(t.scaleX,1),n=this._resourceManager.getResource(i);if(null==n)return;let a=e*(n.width/n.height),l=e;e||(a=n.width,l=n.height);const h=H(i)||"src"in n&&H(n.src);let c="getFrame"in n?z(n):n;r&&(c=this._colorSubstitutionHelper.applyColorSubstitution(c,r)),this._applyAdditionalRenderProps&&!h&&s&&(c=this._colorSubstitutionHelper.tintImageData(c,s));const m=this.transformPt([0,0]),[f,u]=this.getTransformAngle(),d=this.transformSize(1),g=this._ctx;g.save(),g.setTransform({m11:o*d*f,m12:o*d*u,m21:-d*u,m22:d*f,m41:m[0],m42:m[1]}),g.drawImage(c,-a/2,-l/2,a,l),g.restore()}drawText(t,e){if(!e||0===e.length)return;this._textRasterizer||(this._textRasterizer=new A);const r=St(t,this.transformSize(o(1))),i=this._textRasterizer.rasterizeText(e,r);if(!i)return;const{size:s,anchorX:n,anchorY:a,canvas:l}=i,h=s[0]*(n+.5),c=s[1]*(a-.5),m=this._ctx,f=this.transformPt([0,0]),[u,d]=this.getTransformAngle(),g=1;m.save(),m.setTransform({m11:g*u,m12:g*d,m21:-1*d,m22:g*u,m41:f[0]-g*h,m42:f[1]+g*c}),m.drawImage(l,0,0),m.restore()}drawPictureFill(t,e){if(!t)return;let{colorSubstitutions:r,height:i,offsetX:s,offsetY:o,rotation:n,scaleX:a,tintColor:l,url:h}=e;const c=this._resourceManager.getResource(h);if(null==c)return;if(P(t))this._buildPath(t.rings,!0);else if(S(t))this._buildPath(t.paths,!0);else if(w(t))this._buildPath(yt(t).rings,!0);else{if(!x(t))return;console.log("CanvasDrawHelper.drawPictureFill - No implementation!")}const m=this._ctx,f=H(h)||"src"in c&&H(c.src);let u,d="getFrame"in c?z(c):c;if(r&&(d=this._colorSubstitutionHelper.applyColorSubstitution(d,r)),this._applyAdditionalRenderProps){f||l&&(d=this._colorSubstitutionHelper.tintImageData(d,l)),u=m.createPattern(d,"repeat");const t=this.transformSize(1);n||(n=0),s?s*=t:s=0,o?o*=t:o=0,i&&(i*=t);const e=i?i/c.height:1,r=a&&i?a*i/c.width:1;if(0!==n||1!==e||1!==r||0!==s||0!==o){const t=new DOMMatrix;t.rotateSelf(0,0,-n).translateSelf(s,o).scaleSelf(r,e,1),u.setTransform(t)}}else u=m.createPattern(d,"repeat");m.save(),m.fillStyle=u,m.fill("evenodd"),m.restore()}drawPictureStroke(t,r){if(!t)return;let{colorSubstitutions:i,capStyle:s,joinStyle:o,miterLimit:a,tintColor:l,url:h,width:c}=r;const m=this._resourceManager.getResource(h);if(null==m)return;let f;if(P(t))f=t.rings;else if(S(t))f=t.paths;else{if(!w(t))return x(t)?void console.log("CanvasDrawHelper.drawPictureStroke - No implementation!"):void 0;f=yt(t).rings}c||(c=m.width);const u=H(h)||"src"in m&&H(m.src);let d="getFrame"in m?z(m):m;i&&(d=this._colorSubstitutionHelper.applyColorSubstitution(d,i)),this._applyAdditionalRenderProps&&(u||l&&(d=this._colorSubstitutionHelper.tintImageData(d,l)));const g=Math.max(this.transformSize(n(c)),.5),p=g/d.width,_=this._ctx,y=_.createPattern(d,"repeat-y");let M,b;_.save(),this._setCapStyle(s),this._setJoinStyle(o),void 0!==a&&(_.miterLimit=a),_.lineWidth=g;for(let n of f)if(n=e(n),xt(n),n&&!(n.length<=1)){M=this.transformPt(n[0]);for(let t=1;t<n.length;t++){b=this.transformPt(n[t]);const e=_t(M,b),r=new DOMMatrix;r.translateSelf(0,M[1]-g/2).scaleSelf(p,p,1).rotateSelf(0,0,90-e),y.setTransform(r),_.strokeStyle=y,_.beginPath(),_.moveTo(M[0],M[1]),_.lineTo(b[0],b[1]),_.stroke(),M=b}}_.restore()}drawGradientFill(t,e){if(!t)return;let r;if(P(t))r=t.rings;else if(S(t))r=t.paths;else{if(!w(t))return void lt().error("Unable to draw gradient fill");r=yt(t).rings}this._buildPath(r,!0);const{angle:s,gradientMethod:o,gradientSize:a,gradientSizeUnits:l}=e,h=I.CIMGradientFill,p=e.gradientType??h.gradientType,_=-i(s??0),y=c();for(const i of r){const t=i?i.length:0;if(t>1)for(let e=0;e<t;e++){let t=this.transformPt(i[e]);"Linear"!==o&&"Rectangular"!==o||(t=L(t,-_)),m(y,t)}}const[x,M,b,k]=y,C=this._ctx;switch(C.save(),o){case"Buffered":lt().error(`Gradient method "${o}" currently unsupported.`);break;case"Linear":{const t=(M+k)/2,r="Absolute"===l?this.transformSize(n(a)):B(a,h.gradientSize)*(b-x),[i,s]="Discrete"===p?[b,b-r]:[x+r,x],o=L([i,t],_),c=L([s,t],_),m=C.createLinearGradient(o[0],o[1],c[0],c[1]);F(m,e),C.fillStyle=m,C.fill("evenodd");break}case"Circular":{const t=f(y),r=g(y)/2,i="Absolute"===l?this.transformSize(n(a)):B(a,h.gradientSize)*r,[s,o]="Discrete"===p?[r,r-i]:[i,0],c=C.createRadialGradient(t[0],t[1],s,t[0],t[1],o);F(c,e),C.fillStyle=c,C.fill("evenodd");break}case"Rectangular":{const r=f(y),i=r[0],s=r[1],o=L(r,_),c=(r,i,s,n,a,l,h,c)=>{C.save(),this.pushClipPath(t);const m=L([a,l],_),f=L([h,c],_);C.beginPath(),C.moveTo(o[0],o[1]),C.lineTo(m[0],m[1]),C.lineTo(f[0],f[1]),C.lineTo(o[0],o[1]),C.clip();const u=L([r,i],_),d=L([s,n],_),g=C.createLinearGradient(u[0],u[1],d[0],d[1]);F(g,e),C.fillStyle=g,C.fill("evenodd"),C.restore()};let m="Absolute"===l?this.transformSize(n(a)):B(a,h.gradientSize)*(u(y)/2),[g,P]="Discrete"===p?[b,b-m]:[i+m,i];c(g,s,P,s,b,M,b,k),[g,P]="Discrete"===p?[x,x+m]:[i-m,i],c(g,s,P,s,x,k,x,M),m="Absolute"===l?this.transformSize(n(a)):B(a,h.gradientSize)*(d(y)/2);let[S,w]="Discrete"===p?[k,k-m]:[s+m,s];c(i,S,i,w,b,k,x,k),[S,w]="Discrete"===p?[M,M+m]:[s-m,s],c(i,S,i,w,x,M,b,M);break}}C.restore()}drawGradientStroke(t,r){const{capStyle:i,gradientMethod:s,gradientSize:o,gradientSizeUnits:a,joinStyle:l,miterLimit:h,width:c}=r;if(!t||0===c)return;let m;if(P(t))m=t.rings;else if(S(t))m=t.paths;else{if(!w(t))return void lt().error("Unable to draw gradient stroke");m=yt(t).rings}const f=r.gradientType??I.CIMGradientStroke.gradientType,u=Math.max(this.transformSize(n(c)),.5),d=this._ctx;let g,p;d.save(),this._setCapStyle(i),this._setJoinStyle(l),void 0!==h&&(d.miterLimit=h),d.lineWidth=u;for(let _ of m){if(_=e(_),xt(_),!_||_.length<=1)continue;let t=0;g=this.transformPt(_[0]);for(let e=1;e<_.length;e++){p=this.transformPt(_[e]);const r=p[0]-g[0],i=p[1]-g[1];t+=Math.sqrt(r*r+i*i),g=p}const i="Absolute"===a?this.transformSize(n(o)):B(o,I.CIMGradientStroke.gradientSize)*("AcrossLine"===s?u:t);let l=0;g=this.transformPt(_[0]);for(let e=1;e<_.length;e++){p=this.transformPt(_[e]);const o=p[0]-g[0],n=p[1]-g[1],a=Math.sqrt(o*o+n*n);let h,c,m,y;switch(s){case"AcrossLine":{const[t,e]=L([o/a,n/a],-Math.PI/2),r=u/2,s="Discrete"===f?r:i-r;h=(g[0]+p[0])/2+t*s,c=(g[1]+p[1])/2+e*s,m=h-t*i,y=c-e*i;break}case"AlongLine":{const e=o/a,r=n/a;"Discrete"===f?(h=g[0]-e*l,c=g[1]-r*l,m=h+e*i,y=c+r*i):(m=g[0]+e*(t-l),y=g[1]+r*(t-l),h=m-e*i,c=y-r*i);break}default:return lt().error("Unrecognized gradient method:",s),void d.restore()}const P=d.createLinearGradient(h,c,m,y);F(P,r),d.strokeStyle=P,d.beginPath(),d.moveTo(g[0],g[1]),d.lineTo(p[0],p[1]),d.stroke(),l+=a,g=p}}d.restore()}_buildPath(t,e){const r=this._ctx;if(r.beginPath(),t)for(const i of t){const t=i?i.length:0;if(t>1){let s=this.transformPt(i[0]);r.moveTo(s[0],s[1]);for(let e=1;e<t;e++)s=this.transformPt(i[e]),r.lineTo(s[0],s[1]);e&&r.closePath()}}}_setCapStyle(t){switch(t){case T.Butt:this._ctx.lineCap="butt";break;case T.Round:this._ctx.lineCap="round";break;case T.Square:this._ctx.lineCap="square"}}_setJoinStyle(t){switch(t){case R.Bevel:this._ctx.lineJoin="bevel";break;case R.Round:this._ctx.lineJoin="round";break;case R.Miter:this._ctx.lineJoin="miter"}}}function dt(t,e,r){let i=j(t.separation,I.CIMHatchFill.separation)*r,s=j(t.rotation);if(0===i)return null;i<0&&(i=-i);let o=0;const n=.5*i;for(;o>n;)o-=i;for(;o<-n;)o+=i;const a=h();p(a,e),a[0]-=n,a[1]-=n,a[2]+=n,a[3]+=n;const l=[[a[0],a[1]],[a[0],a[3]],[a[2],a[3]],[a[2],a[1]]];for(;s>180;)s-=180;for(;s<0;)s+=180;const c=Math.cos(s*nt),m=Math.sin(s*nt),f=-i*m,u=i*c;let d,g,_,y;o=j(t.offsetX)*r*m-j(t.offsetY)*r*c,d=_=Number.MAX_VALUE,g=y=-Number.MAX_VALUE;for(const h of l){const t=h[0],e=h[1],r=c*t+m*e,i=-m*t+c*e;d=Math.min(d,r),_=Math.min(_,i),g=Math.max(g,r),y=Math.max(y,i)}_=Math.floor(_/i)*i;let P=c*d-m*_-f*o/i,S=m*d+c*_-u*o/i,w=c*g-m*_-f*o/i,x=m*g+c*_-u*o/i;const M=1+Math.round((y-_)/i),b=[];for(let h=0;h<M;h++)P+=f,S+=u,w+=f,x+=u,b.push([[P,S],[w,x]]);return{paths:b}}function gt(t,e){let r=0;for(const i of e){const e=i.length;for(let s=1;s<e;s++){const e=i[s-1],o=i[s];if(e[1]>t[1]==o[1]>t[1])continue;(o[0]-e[0])*(t[1]-e[1])-(o[1]-e[1])*(t[0]-e[0])>0?r++:r--}}return 0!==r}function pt(t,e,r){for(const i of e){const e=i.length;for(let s=1;s<e;s++){const e=i[s-1],o=i[s];let n=(o[0]-e[0])*(o[0]-e[0])+(o[1]-e[1])*(o[1]-e[1]);if(0===n)continue;n=Math.sqrt(n);const a=((o[0]-e[0])*(t[1]-e[1])-(o[1]-e[1])*(t[0]-e[0]))/n;if(Math.abs(a)<r){const i=((o[0]-e[0])*(t[0]-e[0])+(o[1]-e[1])*(t[1]-e[1]))/n;if(i>-r&&i<n+r)return!0}}}return!1}function _t(t,e){const r=e[0]-t[0],i=e[1]-t[1];return 180/Math.PI*Math.atan2(i,r)}const yt=t=>t?{spatialReference:t.spatialReference,rings:[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]}:null,Pt=(t,e,r)=>{switch(t){case"ExtraLeading":return 1+e/r;case"Multiple":return e;case"Exact":return e/r}};function St(e,r=1){const i=E(e),s=X(e.fontStyleName),o=e.fontFamilyName??t,{weight:n,style:a}=s,l=r*(e.height||5),h=J(e.horizontalAlignment),c=N(e.verticalAlignment),m=O(e),f=O(e.haloSymbol),u=null!=f?r*(e.haloSize??0):0,d=q(e.symbol),g=r*(V(e.symbol)||0),p="CIMBackgroundCallout"===e.callout?.type?e.callout.backgroundSymbol:null,_=O(p),y=V(p),P=q(p);return{color:m,size:l,horizontalAlignment:h,verticalAlignment:c,font:{family:o,style:W(a),weight:Y(n),decoration:i},outline:{size:g||0,color:d},halo:{size:u||0,color:f,style:a},backgroundColor:_,borderLine:null!=y&&null!=P?{size:y,color:P}:null,pixelRatio:1,premultiplyColors:!0}}const wt=1e-4;function xt(t){let e,r,i,s,o,n=t[0],a=1;for(;a<t.length;)e=t[a][0]-n[0],r=t[a][1]-n[1],s=0!==e?r/e:Math.PI/2,void 0!==i&&Math.abs(s-i)<=wt?(t.splice(a-1,1),n=o):(o=n,n=t[a],a++),i=s}export{ct as CIMSymbolDrawHelper,ut as CanvasDrawHelper,mt as EnvDrawHelper,ft as HittestDrawHelper,ht as Transformation,nt as cDegToRad,Pt as lineGapType2LineHeight};
5
+ import{defaultFontFamily as t}from"../../core/fontUtils.js";import has from"../../core/has.js";import{clone as e}from"../../core/lang.js";import r from"../../core/Logger.js";import{deg2rad as i}from"../../core/mathUtils.js";import s from"../../core/ObjectPool.js";import{px2pt as o,pt2px as n}from"../../core/screenUtils.js";import{GeometryCursor as a}from"../../geometry/GeometryCursor.js";import{fromValues as l,create as h,empty as c,expandPointInPlace as m,center as f,width as u,height as d,diagonal as g}from"../../geometry/support/aaBoundingRect.js";import{getBoundsXY as p}from"../../geometry/support/boundsUtils.js";import{polygonCentroid as _}from"../../geometry/support/centroid.js";import{isPoint as y,isPolygon as P,isPolyline as S,isExtent as w,isMultipoint as x}from"../../geometry/support/jsonUtils.js";import{SimpleEffectCursor as M}from"./CIMEffects.js";import b from"./CIMImageColorSubstitutionHelper.js";import{getEffectOperator as k,getPlacementOperator as C}from"./CIMOperators.js";import{Placement as v}from"./CIMPlacements.js";import{defaultCIMValues as I}from"./defaultCIMValues.js";import{LineCapStyle as T,LineJoinStyle as R}from"./enums.js";import{getFirstFrame as z}from"./imageUtils.js";import{rotate as L}from"./mathUtils.js";import{addColorStops as F}from"./rasterizingUtils.js";import U from"./Rect.js";import A from"./TextRasterizer.js";import{getNumericValue as j,isCIMFill as G,getSize as D,isSVGImage as H,getRelativeGradientSize as B,fromCIMFontDecoration as E,fromCIMFontStyle as X,fromCIMHorizontalAlignment as J,fromCIMVerticalAlignment as N,getFillColor as O,getStrokeColor as q,getStrokeWidth as V,getFontStyle as W,getFontWeight as Y}from"./utils.js";import{destroyHiddenSvg as $,createHiddenSvg as K,createSvgElement as Q}from"../../views/2d/engine/svgUtils.js";import{glyphSize as Z,magicLabelLineHeight as tt,hittestToleranceSmallSymbol as et,hittestSmallSymbolThreshold as rt}from"../../views/2d/engine/webgl/definitions.js";import{shapeGlyphs as it}from"../../views/2d/engine/webgl/mesh/templates/shapingUtils.js";import{roundPtToWholePixel as st,getLineWidth as ot}from"../../views/2d/layers/graphics/graphicsUtils.js";const nt=Math.PI/180,at=.5,lt=()=>r.getLogger("esri.symbols.cim.CIMSymbolDrawHelper");class ht{constructor(t){this._t=t}static createIdentity(){return new ht([1,0,0,0,1,0])}clone(){const t=this._t;return new ht(t.slice())}transform(t){const e=this._t;return[e[0]*t[0]+e[1]*t[1]+e[2],e[3]*t[0]+e[4]*t[1]+e[5]]}static createScale(t,e){return new ht([t,0,0,0,e,0])}scale(t,e){const r=this._t;return r[0]*=t,r[1]*=t,r[2]*=t,r[3]*=e,r[4]*=e,r[5]*=e,this}scaleRatio(){return Math.sqrt(this._t[0]*this._t[0]+this._t[1]*this._t[1])}static createTranslate(t,e){return new ht([0,0,t,0,0,e])}translate(t,e){const r=this._t;return r[2]+=t,r[5]+=e,this}static createRotate(t){const e=Math.cos(t),r=Math.sin(t);return new ht([e,-r,0,r,e,0])}rotate(t){return ht.multiply(this,ht.createRotate(t),this)}angle(){const t=this._t[0],e=this._t[3],r=Math.sqrt(t*t+e*e);return[t/r,e/r]}static multiply(t,e,r){const i=t._t,s=e._t,o=i[0]*s[0]+i[3]*s[1],n=i[1]*s[0]+i[4]*s[1],a=i[2]*s[0]+i[5]*s[1]+s[2],l=i[0]*s[3]+i[3]*s[4],h=i[1]*s[3]+i[4]*s[4],c=i[2]*s[3]+i[5]*s[4]+s[5],m=r._t;return m[0]=o,m[1]=n,m[2]=a,m[3]=l,m[4]=h,m[5]=c,r}invert(){const t=this._t;let e=t[0]*t[4]-t[1]*t[3];if(0===e)return new ht([0,0,0,0,0,0]);e=1/e;const r=(t[1]*t[5]-t[2]*t[4])*e,i=(t[2]*t[3]-t[0]*t[5])*e,s=t[4]*e,o=-t[1]*e,n=-t[3]*e,a=t[0]*e;return new ht([s,o,r,n,a,i])}}class ct{constructor(t,e){this._resourceManager=t,this._transfos=[],this._sizeTransfos=[],this._geomUnitsPerPoint=1,this._placementPool=new s(v,void 0,void 0,100),this._earlyReturn=!1,this._mapRotation=0,this._transfos.push(e||ht.createIdentity()),this._sizeTransfos.push(e?e.scaleRatio():1)}setTransform(t,e){this._transfos=[t||ht.createIdentity()],this._sizeTransfos=[e||(t?t.scaleRatio():1)]}setGeomUnitsPerPoint(t){this._geomUnitsPerPoint=t}transformPt(t){return this._transfos[this._transfos.length-1].transform(t)}transformSize(t){return t*this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformPt(t){return this._transfos[this._transfos.length-1].invert().transform(t)}reverseTransformSize(t){return t/this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformScalar(t){return t/this._transfos[this._transfos.length-1].scaleRatio()}getTransformAngle(){return this._transfos[this._transfos.length-1].angle()}geomUnitsPerPoint(){return this.isEmbedded()?1:this._geomUnitsPerPoint}prevGeomUnitsPerPoint(){return this._transfos.length>2?1:this._geomUnitsPerPoint}isEmbedded(){return this._transfos.length>1}back(){return this._transfos[this._transfos.length-1]}push(t,e){const r=e?t.scaleRatio():1;ht.multiply(t,this.back(),t),this._transfos.push(t),this._sizeTransfos.push(this._sizeTransfos[this._sizeTransfos.length-1]*r)}pop(){this._transfos.splice(-1,1),this._sizeTransfos.splice(-1,1)}drawSymbol(t,e,r){if(t)switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this.drawMultiLayerSymbol(t,e);break;case"CIMTextSymbol":this.drawTextSymbol(t,e,r)}}drawMultiLayerSymbol(t,e){if(!t||!e)return;const r=t.symbolLayers;if(!r)return;const i=t.effects;if(i&&i.length>0){const t=this.executeEffects(i,e);if(t){let e=t.next();for(;e;)this.drawSymbolLayers(r,e.asJSON()),e=t.next()}}else this.drawSymbolLayers(r,e)}executeEffects(t,e){const r=this._resourceManager.geometryEngine;let i=new M(a.fromJSONCIM(e));for(const s of t){const t=k(s);t&&(i=t.execute(i,s,this.geomUnitsPerPoint(),null,r))}return i}drawSymbolLayers(t,e){let r=t.length;for(;r--;){const i=t[r];if(!i||!1===i.enable)continue;const s=i.effects;if(s&&s.length>0){const t=this.executeEffects(s,e);if(t){let e=null;for(;(e=t.next())&&(this.drawSymbolLayer(i,e.asJSON()),!this._earlyReturn););}}else this.drawSymbolLayer(i,e);if(this._earlyReturn)return}}drawSymbolLayer(t,e){switch(t.type){case"CIMSolidFill":this.drawSolidFill(e,t.color,t.path);break;case"CIMHatchFill":this.drawHatchFill(e,t);break;case"CIMPictureFill":this.drawPictureFill(e,t);break;case"CIMGradientFill":this.drawGradientFill(e,t);break;case"CIMSolidStroke":this.drawSolidStroke(e,t.color,t.width,t.capStyle,t.joinStyle,t.miterLimit,t.path);break;case"CIMPictureStroke":this.drawPictureStroke(e,t);break;case"CIMGradientStroke":this.drawGradientStroke(e,t);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":this.drawMarkerLayer(t,e)}}drawHatchFill(t,e){const r=dt(e,t,this.geomUnitsPerPoint());r&&(this.pushClipPath(t),this.drawMultiLayerSymbol(e.lineSymbol,r),this.popClipPath())}drawPictureFill(t,e){}drawGradientFill(t,e){}drawPictureStroke(t,e){}drawGradientStroke(t,e){}drawMarkerLayer(t,e){const r=t.markerPlacement;if(r){const i=C(r);if(i){const s="CIMMarkerPlacementInsidePolygon"===r.type||"CIMMarkerPlacementPolygonCenter"===r.type&&r.clipAtBoundary;s&&this.pushClipPath(e);const o=i.execute(a.fromJSONCIM(e),r,this.geomUnitsPerPoint(),null,this._resourceManager.geometryEngine);if(o){let e=null;for(;(e=o.next())&&(this.drawMarker(t,e),!this._earlyReturn););}s&&this.popClipPath()}}else{const r=this._placementPool.acquire();if(y(e))r.tx=e.x,r.ty=e.y,this.drawMarker(t,r);else if(P(e)){const i=_(e);i&&([r.tx,r.ty]=i,this.drawMarker(t,r))}else if(S(e)){for(const i of e.paths)for(const e of i)if(r.tx=e[0],r.ty=e[1],this.drawMarker(t,r),this._earlyReturn)break}else for(const i of e.points)if(r.tx=i[0],r.ty=i[1],this.drawMarker(t,r),this._earlyReturn)break;this._placementPool.release(r)}}drawMarker(t,e){switch(t.type){case"CIMCharacterMarker":case"CIMPictureMarker":this.drawPictureMarker(t,e);break;case"CIMVectorMarker":this.drawVectorMarker(t,e)}}drawPictureMarker(t,e){if(!t)return;const r=this._resourceManager.getResource(t.url),i=j(t.size,I.CIMPictureMarker.size);if(null==r||i<=0)return;const s=r.width,o=r.height;if(!s||!o)return;const n=s/o,a=j(t.scaleX,1),l=ht.createIdentity(),h=t.anchorPoint;if(h){let e=h.x,r=h.y;"Absolute"!==t.anchorPointUnits&&(e*=i*n*a,r*=i),l.translate(-e,-r)}let c=j(t.rotation);t.rotateClockwise&&(c=-c),this._mapRotation&&(c+=this._mapRotation),c&&l.rotate(c*nt);let m=j(t.offsetX),f=j(t.offsetY);if(m||f){if(this._mapRotation){const t=nt*this._mapRotation,e=Math.cos(t),r=Math.sin(t),i=m*r+f*e;m=m*e-f*r,f=i}l.translate(m,f)}const u=this.geomUnitsPerPoint();1!==u&&l.scale(u,u);const d=e.getAngle();d&&l.rotate(d),l.translate(e.tx,e.ty),this.push(l,!1),this.drawImage(t,i),this.pop()}drawVectorMarker(t,e){if(!t)return;const r=t.markerGraphics;if(!r)return;const i=j(t.size,I.CIMVectorMarker.size),s=t.frame,o=s?s.ymax-s.ymin:0,n=i&&o?i/o:1,a=ht.createIdentity();s&&a.translate(.5*-(s.xmax+s.xmin),.5*-(s.ymax+s.ymin));const l=t.anchorPoint;if(l){let e=l.x,r=l.y;"Absolute"!==t.anchorPointUnits?s&&(e*=s.xmax-s.xmin,r*=s.ymax-s.ymin):(e/=n,r/=n),a.translate(-e,-r)}1!==n&&a.scale(n,n);let h=j(t.rotation);t.rotateClockwise&&(h=-h),this._mapRotation&&(h+=this._mapRotation),h&&a.rotate(h*nt);let c=j(t.offsetX),m=j(t.offsetY);if(c||m){if(this._mapRotation){const t=nt*this._mapRotation,e=Math.cos(t),r=Math.sin(t),i=c*r+m*e;c=c*e-m*r,m=i}a.translate(c,m)}const f=this.geomUnitsPerPoint();1!==f&&a.scale(f,f);const u=e.getAngle();u&&a.rotate(u),a.translate(e.tx,e.ty),this.push(a,t.scaleSymbolsProportionally);for(const d of r){d?.symbol&&d.geometry||lt().error("Invalid marker graphic",d);let t=d.textString;if("number"==typeof t&&(t=t.toString()),this.drawSymbol(d.symbol,d.geometry,t),this._earlyReturn)break}this.pop()}drawTextSymbol(t,e,r){if(!t)return;if(!y(e))return;if(j(t.height,I.CIMTextSymbol.height)<=0)return;const i=ht.createIdentity();let s=j(t.angle);s=-s,s&&i.rotate(s*nt);const o=j(t.offsetX),n=j(t.offsetY);(o||n)&&i.translate(o,n);const a=this.geomUnitsPerPoint();1!==a&&i.scale(a,a),i.translate(e.x,e.y),this.push(i,!1),this.drawText(t,r),this.pop()}}class mt extends ct{constructor(t,e){super(t,e),this.reset()}reset(){this._xmin=this._ymin=1/0,this._xmax=this._ymax=-1/0,this._clipCount=0}envelope(){return new U(this._xmin,this._ymin,this._xmax-this._xmin,this._ymax-this._ymin)}bounds(){return l(this._xmin,this._ymin,this._xmax,this._ymax)}drawSolidFill(t){if(t&&!(this._clipCount>0))if(P(t))this._processPath(t.rings,0);else if(S(t))this._processPath(t.paths,0);else if(w(t)){const e=yt(t);e&&this._processPath(e.rings,0)}else console.error("drawSolidFill Unexpected geometry type!")}drawSolidStroke(t,e,r){if(!t||this._clipCount>0||null==r||r<=0)return;const i=Math.max(.5*this.transformSize(j(r,I.CIMSolidStroke.width)),.5*at);if(P(t))this._processPath(t.rings,i);else if(S(t))this._processPath(t.paths,i);else if(w(t)){const e=yt(t);e&&this._processPath(e.rings,i)}else console.error("drawSolidStroke unexpected geometry type!")}drawMarkerLayer(t,e){P(e)&&t.markerPlacement&&("CIMMarkerPlacementInsidePolygon"===t.markerPlacement.type||"CIMMarkerPlacementPolygonCenter"===t.markerPlacement.type&&t.markerPlacement.clipAtBoundary)?this._processPath(e.rings,0):super.drawMarkerLayer(t,e)}drawHatchFill(t,e){this.drawSolidFill(t)}drawPictureFill(t,e){this.drawSolidFill(t)}drawGradientFill(t,e){this.drawSolidFill(t)}drawPictureStroke(t,e){this.drawSolidStroke(t,null,e.width)}drawGradientStroke(t,e){this.drawSolidStroke(t,null,e.width)}pushClipPath(t){this.drawSolidFill(t),this._clipCount++}popClipPath(){this._clipCount--}drawImage(t,e){const{url:r}=t,i=j(t.scaleX,1);let s=i*e,o=e;const n=this._resourceManager.getResource(r);if(null!=n){const t=n.height/n.width;s=i*(e?t>1?e:e/t:n.width),o=e?t>1?e*t:e:n.height}this._merge(this.transformPt([-s/2,-o/2]),0),this._merge(this.transformPt([-s/2,o/2]),0),this._merge(this.transformPt([s/2,-o/2]),0),this._merge(this.transformPt([s/2,o/2]),0)}drawText(t,e){if(!e||0===e.length)return;this._textRasterizer||(this._textRasterizer=new A);const r=St(t);let[i,s]=this._textRasterizer.computeTextSize(e,r);i=o(i),s=o(s);const n=this.transformSize(1)*this.reverseTransformScalar(1);i*=n,s*=n;let a=0;switch(t.horizontalAlignment){case"Left":a=i/2;break;case"Right":a=-i/2}let l=0;switch(t.verticalAlignment){case"Bottom":l=s/2;break;case"Top":l=-s/2;break;case"Baseline":l=s/6}this._merge(this.transformPt([-i/2+a,-s/2+l]),0),this._merge(this.transformPt([-i/2+a,s/2+l]),0),this._merge(this.transformPt([i/2+a,-s/2+l]),0),this._merge(this.transformPt([i/2+a,s/2+l]),0)}_processPath(t,e){if(t)for(const r of t){const t=r?r.length:0;if(t>1){this._merge(this.transformPt(r[0]),e);for(let i=1;i<t;i++)this._merge(this.transformPt(r[i]),e)}}}_merge(t,e){t[0]-e<this._xmin&&(this._xmin=t[0]-e),t[0]+e>this._xmax&&(this._xmax=t[0]+e),t[1]-e<this._ymin&&(this._ymin=t[1]-e),t[1]+e>this._ymax&&(this._ymax=t[1]+e)}}class ft extends ct{constructor(){super(...arguments),this._searchPoint=[0,0],this._searchDistPoint=0,this._textInfo=null,this._svg=null,this._path=null,this._canvas=null}destroy(){this._svg=$(this._svg),this._path=null,this._canvas=null}hitTest(t,e,r,i,s,a){const l=a*n(1);this.setTransform(),this.setGeomUnitsPerPoint(l),this._searchPoint=[(t[0]+t[2])/2,(t[1]+t[3])/2],this._searchDistPoint=(t[2]-t[0])/2/l,this._textInfo=i;const h=e&&("CIMPointSymbol"===e.type&&"Map"!==e.angleAlignment||"CIMTextSymbol"===e.type);if(this._mapRotation=h?s:0,!has("esri-mobile")){const t=o(et*window.devicePixelRatio),r=o(rt);!(("CIMLineSymbol"===e?.type||"CIMPolygonSymbol"===e?.type)&&e.symbolLayers?.some(G))&&"CIMMeshSymbol"!==e?.type&&(D(e)??0)<r&&(this._searchDistPoint=t)}return this._earlyReturn=!1,this.drawSymbol(e,r),this._earlyReturn}executeEffects(t,e){return"CIMGeometricEffectDashes"===t.at(-1)?.type&&(t=t.slice(0,-1)),super.executeEffects(t,e)}drawSolidFill(t,e,r){null!=r?this._hittestSvgPath(t,r,!0):this._hitTestFill(t)}drawHatchFill(t,e){this._hitTestFill(t)}drawPictureFill(t,e){this._hitTestFill(t)}drawGradientFill(t,e){this._hitTestFill(t)}drawSolidStroke(t,e,r,i,s,o,n){null!=n?this._hittestSvgPath(t,n,!1,r):this._hitTestStroke(t,r)}drawPictureStroke(t,e){this._hitTestStroke(t,e.width)}drawGradientStroke(t,e){this._hitTestStroke(t,e.width)}drawMarkerLayer(t,e){t.markerPlacement&&("CIMMarkerPlacementInsidePolygon"===t.markerPlacement.type||"CIMMarkerPlacementPolygonCenter"===t.markerPlacement.type&&t.markerPlacement.clipAtBoundary)?this._hitTestFill(e):super.drawMarkerLayer(t,e)}pushClipPath(t){}popClipPath(){}drawImage(t,e){const{url:r}=t,i=j(t.scaleX,1),s=this._resourceManager.getResource(r);if(null==s||0===s.height||0===e)return;const o=e*this.geomUnitsPerPoint(),n=o*i*(s.width/s.height),a=this.reverseTransformPt(this._searchPoint),l=this._searchDistPoint;Math.abs(a[0])<n/2+l&&Math.abs(a[1])<o/2+l&&(this._earlyReturn=!0)}drawText(t,e){const r=this._textInfo;if(!r)return;const i=r.get(t);if(!i)return;if(!i.glyphMosaicItems.glyphs.length)return;const s=st(j(t.height,I.CIMTextSymbol.height)),{lineGapType:o,lineGap:n}=t,a=o?Pt(o,j(n),s):0,l="CIMBackgroundCallout"===t.callout?.type,h=it(i.glyphMosaicItems,{scale:s/Z,angle:0,xOffset:0,yOffset:0,horizontalAlignment:t.horizontalAlignment,verticalAlignment:t.verticalAlignment,maxLineWidth:ot(t.lineWidth),lineHeight:tt*Math.max(.25,Math.min(a||1,4)),decoration:t.font.decoration||"none",useCIMAngleBehavior:!0,hasBackground:l}),c=this.reverseTransformPt(this._searchPoint),m=c[0],f=c[1];for(const u of h.glyphs)if(m>u.xTopLeft&&m<u.xBottomRight&&f>-u.yBottomRight&&f<-u.yTopLeft){this._earlyReturn=!0;break}}_hitTestFill(t){let e=null;if(w(t)){const r=t;e=[[[r.xmin,r.ymin],[r.xmin,r.ymax],[r.xmax,r.ymax],[r.xmax,r.ymin],[r.xmin,r.ymin]]]}else if(P(t))e=t.rings;else{if(!S(t))return;e=t.paths}const r=this.reverseTransformPt(this._searchPoint);if(gt(r,e)&&(this._earlyReturn=!0),!this._earlyReturn){pt(r,e,this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint())&&(this._earlyReturn=!0)}}_getSvgPath(){return null!=this._svg&&null!=this._path||(this._svg??=K(),this._path??=Q("path"),this._svg.appendChild(this._path)),this._path}_getCanvasContext(t,e){return this._canvas??=document.createElement("canvas"),this._canvas.width=t,this._canvas.height=e,this._canvas.getContext("2d",{willReadFrequently:!0})}_hittestSvgPath(t,e,r,i=0){const s=this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint(),o=this.reverseTransformPt(this._searchPoint),n=h();p(n,t);const a={x:n[0],y:n[1],width:n[2]-n[0],height:n[3]-n[1]},l=this._getSvgPath();l.setAttribute("d",e);const c=l.getBBox();let m=Math.max(c.width/a.width,c.height/a.height),f=1;const u=2*s*m;u<1&&(f=2/u,m*=f,c.x*=f,c.y*=f,c.width*=f,c.height*=f);const d=1+i*m/2,g=this._getCanvasContext(c.width+2*d,c.height+2*d);g.setTransform(f,0,0,f,-c.x+d,-c.y+d);const _=new Path2D(e);r?g.fill(_):(g.lineWidth=i*(m/f),g.stroke(_));const y=(a.width*m-c.width)/2,P=(a.height*m-c.height)/2,S=Math.floor((o[0]-a.x-s)*m-y+d),w=Math.floor((a.height-(o[1]-a.y)-s)*m+P+d),x=Math.ceil(2*s*m),M=Math.ceil(2*s*m),b=g.getImageData(S,w,x,M).data;for(let h=3;h<b.length;h+=4)if(b[h]>127.5)return void(this._earlyReturn=!0)}_hitTestStroke(t,e){let r=null;if(w(t)){const e=t;r=[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]}else if(P(t))r=t.rings;else{if(!S(t))return;r=t.paths}pt(this.reverseTransformPt(this._searchPoint),r,j(e,I.CIMSolidStroke.width)*this.geomUnitsPerPoint()/2+this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint())&&(this._earlyReturn=!0)}}class ut extends ct{constructor(t,e,r,i){super(e,r),this._applyAdditionalRenderProps=i,this._colorSubstitutionHelper=new b,this._ctx=t}drawSolidFill(t,e){if(!t)return;if(P(t))this._buildPath(t.rings,!0);else if(S(t))this._buildPath(t.paths,!0);else if(w(t))this._buildPath(yt(t).rings,!0);else{if(!x(t))return;console.log("CanvasDrawHelper.drawSolidFill - No implementation!")}const r=this._ctx;r.fillStyle="string"==typeof e?e:"rgba("+Math.round(e[0])+","+Math.round(e[1])+","+Math.round(e[2])+","+(e[3]??255)/255+")",r.fill("evenodd")}drawSolidStroke(t,e,r,i,s,o){if(!t||!e||0===r)return;if(P(t))this._buildPath(t.rings,!0);else if(S(t))this._buildPath(t.paths,!1);else{if(!w(t))return void console.log("CanvasDrawHelper.drawSolidStroke isn't implemented!");this._buildPath(yt(t).rings,!0)}const n=this._ctx;n.strokeStyle="string"==typeof e?e:"rgba("+Math.round(e[0])+","+Math.round(e[1])+","+Math.round(e[2])+","+(e[3]??255)/255+")",n.lineWidth=Math.max(this.transformSize(r),at),this._setCapStyle(i),this._setJoinStyle(s),n.miterLimit=o,n.stroke()}pushClipPath(t){if(this._ctx.save(),P(t))this._buildPath(t.rings,!0);else if(S(t))this._buildPath(t.paths,!0);else{if(!w(t))return;this._buildPath(yt(t).rings,!0)}this._ctx.clip("evenodd")}popClipPath(){this._ctx.restore()}drawImage(t,e){const{colorSubstitutions:r,url:i,tintColor:s}=t,o=j(t.scaleX,1),n=this._resourceManager.getResource(i);if(null==n)return;let a=e*(n.width/n.height),l=e;e||(a=n.width,l=n.height);const h=H(i)||"src"in n&&H(n.src);let c="getFrame"in n?z(n):n;r&&(c=this._colorSubstitutionHelper.applyColorSubstitution(c,r)),this._applyAdditionalRenderProps&&!h&&s&&(c=this._colorSubstitutionHelper.tintImageData(c,s));const m=this.transformPt([0,0]),[f,u]=this.getTransformAngle(),d=this.transformSize(1),g=this._ctx;g.save(),g.setTransform({m11:o*d*f,m12:o*d*u,m21:-d*u,m22:d*f,m41:m[0],m42:m[1]}),g.drawImage(c,-a/2,-l/2,a,l),g.restore()}drawText(t,e){if(!e||0===e.length)return;this._textRasterizer||(this._textRasterizer=new A);const r=St(t,this.transformSize(o(1))),i=this._textRasterizer.rasterizeText(e,r);if(!i)return;const{size:s,anchorX:n,anchorY:a,canvas:l}=i,h=s[0]*(n+.5),c=s[1]*(a-.5),m=this._ctx,f=this.transformPt([0,0]),[u,d]=this.getTransformAngle(),g=1;m.save(),m.setTransform({m11:g*u,m12:g*d,m21:-1*d,m22:g*u,m41:f[0]-g*h,m42:f[1]+g*c}),m.drawImage(l,0,0),m.restore()}drawPictureFill(t,e){if(!t)return;let{colorSubstitutions:r,height:i,offsetX:s,offsetY:o,rotation:n,scaleX:a,tintColor:l,url:h}=e;const c=this._resourceManager.getResource(h);if(null==c)return;if(P(t))this._buildPath(t.rings,!0);else if(S(t))this._buildPath(t.paths,!0);else if(w(t))this._buildPath(yt(t).rings,!0);else{if(!x(t))return;console.log("CanvasDrawHelper.drawPictureFill - No implementation!")}const m=this._ctx,f=H(h)||"src"in c&&H(c.src);let u,d="getFrame"in c?z(c):c;if(r&&(d=this._colorSubstitutionHelper.applyColorSubstitution(d,r)),this._applyAdditionalRenderProps){f||l&&(d=this._colorSubstitutionHelper.tintImageData(d,l)),u=m.createPattern(d,"repeat");const t=this.transformSize(1);n||(n=0),s?s*=t:s=0,o?o*=t:o=0,i&&(i*=t);const e=i?i/c.height:1,r=a&&i?a*i/c.width:1;if(0!==n||1!==e||1!==r||0!==s||0!==o){const t=new DOMMatrix;t.rotateSelf(0,0,-n).translateSelf(s,o).scaleSelf(r,e,1),u.setTransform(t)}}else u=m.createPattern(d,"repeat");m.save(),m.fillStyle=u,m.fill("evenodd"),m.restore()}drawPictureStroke(t,r){if(!t)return;let{colorSubstitutions:i,capStyle:s,joinStyle:o,miterLimit:a,tintColor:l,url:h,width:c}=r;const m=this._resourceManager.getResource(h);if(null==m)return;let f;if(P(t))f=t.rings;else if(S(t))f=t.paths;else{if(!w(t))return x(t)?void console.log("CanvasDrawHelper.drawPictureStroke - No implementation!"):void 0;f=yt(t).rings}c||(c=m.width);const u=H(h)||"src"in m&&H(m.src);let d="getFrame"in m?z(m):m;i&&(d=this._colorSubstitutionHelper.applyColorSubstitution(d,i)),this._applyAdditionalRenderProps&&(u||l&&(d=this._colorSubstitutionHelper.tintImageData(d,l)));const g=Math.max(this.transformSize(n(c)),.5),p=g/d.width,_=this._ctx,y=_.createPattern(d,"repeat-y");let M,b;_.save(),this._setCapStyle(s),this._setJoinStyle(o),void 0!==a&&(_.miterLimit=a),_.lineWidth=g;for(let n of f)if(n=e(n),xt(n),n&&!(n.length<=1)){M=this.transformPt(n[0]);for(let t=1;t<n.length;t++){b=this.transformPt(n[t]);const e=_t(M,b),r=new DOMMatrix;r.translateSelf(0,M[1]-g/2).scaleSelf(p,p,1).rotateSelf(0,0,90-e),y.setTransform(r),_.strokeStyle=y,_.beginPath(),_.moveTo(M[0],M[1]),_.lineTo(b[0],b[1]),_.stroke(),M=b}}_.restore()}drawGradientFill(t,e){if(!t)return;let r;if(P(t))r=t.rings;else if(S(t))r=t.paths;else{if(!w(t))return void lt().error("Unable to draw gradient fill");r=yt(t).rings}this._buildPath(r,!0);const{angle:s,gradientMethod:o,gradientSize:a,gradientSizeUnits:l}=e,h=I.CIMGradientFill,p=e.gradientType??h.gradientType,_=-i(s??0),y=c();for(const i of r){const t=i?i.length:0;if(t>1)for(let e=0;e<t;e++){let t=this.transformPt(i[e]);"Linear"!==o&&"Rectangular"!==o||(t=L(t,-_)),m(y,t)}}const[x,M,b,k]=y,C=this._ctx;switch(C.save(),o){case"Buffered":lt().error(`Gradient method "${o}" currently unsupported.`);break;case"Linear":{const t=(M+k)/2,r="Absolute"===l?this.transformSize(n(a)):B(a,h.gradientSize)*(b-x),[i,s]="Discrete"===p?[b,b-r]:[x+r,x],o=L([i,t],_),c=L([s,t],_),m=C.createLinearGradient(o[0],o[1],c[0],c[1]);F(m,e),C.fillStyle=m,C.fill("evenodd");break}case"Circular":{const t=f(y),r=g(y)/2,i="Absolute"===l?this.transformSize(n(a)):B(a,h.gradientSize)*r,[s,o]="Discrete"===p?[r,r-i]:[i,0],c=C.createRadialGradient(t[0],t[1],s,t[0],t[1],o);F(c,e),C.fillStyle=c,C.fill("evenodd");break}case"Rectangular":{const r=f(y),i=r[0],s=r[1],o=L(r,_),c=(r,i,s,n,a,l,h,c)=>{C.save(),this.pushClipPath(t);const m=L([a,l],_),f=L([h,c],_);C.beginPath(),C.moveTo(o[0],o[1]),C.lineTo(m[0],m[1]),C.lineTo(f[0],f[1]),C.lineTo(o[0],o[1]),C.clip();const u=L([r,i],_),d=L([s,n],_),g=C.createLinearGradient(u[0],u[1],d[0],d[1]);F(g,e),C.fillStyle=g,C.fill("evenodd"),C.restore()};let m="Absolute"===l?this.transformSize(n(a)):B(a,h.gradientSize)*(u(y)/2),[g,P]="Discrete"===p?[b,b-m]:[i+m,i];c(g,s,P,s,b,M,b,k),[g,P]="Discrete"===p?[x,x+m]:[i-m,i],c(g,s,P,s,x,k,x,M),m="Absolute"===l?this.transformSize(n(a)):B(a,h.gradientSize)*(d(y)/2);let[S,w]="Discrete"===p?[k,k-m]:[s+m,s];c(i,S,i,w,b,k,x,k),[S,w]="Discrete"===p?[M,M+m]:[s-m,s],c(i,S,i,w,x,M,b,M);break}}C.restore()}drawGradientStroke(t,r){const{capStyle:i,gradientMethod:s,gradientSize:o,gradientSizeUnits:a,joinStyle:l,miterLimit:h,width:c}=r;if(!t||0===c)return;let m;if(P(t))m=t.rings;else if(S(t))m=t.paths;else{if(!w(t))return void lt().error("Unable to draw gradient stroke");m=yt(t).rings}const f=r.gradientType??I.CIMGradientStroke.gradientType,u=Math.max(this.transformSize(n(c)),.5),d=this._ctx;let g,p;d.save(),this._setCapStyle(i),this._setJoinStyle(l),void 0!==h&&(d.miterLimit=h),d.lineWidth=u;for(let _ of m){if(_=e(_),xt(_),!_||_.length<=1)continue;let t=0;g=this.transformPt(_[0]);for(let e=1;e<_.length;e++){p=this.transformPt(_[e]);const r=p[0]-g[0],i=p[1]-g[1];t+=Math.sqrt(r*r+i*i),g=p}const i="Absolute"===a?this.transformSize(n(o)):B(o,I.CIMGradientStroke.gradientSize)*("AcrossLine"===s?u:t);let l=0;g=this.transformPt(_[0]);for(let e=1;e<_.length;e++){p=this.transformPt(_[e]);const o=p[0]-g[0],n=p[1]-g[1],a=Math.sqrt(o*o+n*n);let h,c,m,y;switch(s){case"AcrossLine":{const[t,e]=L([o/a,n/a],-Math.PI/2),r=u/2,s="Discrete"===f?r:i-r;h=(g[0]+p[0])/2+t*s,c=(g[1]+p[1])/2+e*s,m=h-t*i,y=c-e*i;break}case"AlongLine":{const e=o/a,r=n/a;"Discrete"===f?(h=g[0]-e*l,c=g[1]-r*l,m=h+e*i,y=c+r*i):(m=g[0]+e*(t-l),y=g[1]+r*(t-l),h=m-e*i,c=y-r*i);break}default:return lt().error("Unrecognized gradient method:",s),void d.restore()}const P=d.createLinearGradient(h,c,m,y);F(P,r),d.strokeStyle=P,d.beginPath(),d.moveTo(g[0],g[1]),d.lineTo(p[0],p[1]),d.stroke(),l+=a,g=p}}d.restore()}_buildPath(t,e){const r=this._ctx;if(r.beginPath(),t)for(const i of t){const t=i?i.length:0;if(t>1){let s=this.transformPt(i[0]);r.moveTo(s[0],s[1]);for(let e=1;e<t;e++)s=this.transformPt(i[e]),r.lineTo(s[0],s[1]);e&&r.closePath()}}}_setCapStyle(t){switch(t){case T.Butt:this._ctx.lineCap="butt";break;case T.Round:this._ctx.lineCap="round";break;case T.Square:this._ctx.lineCap="square"}}_setJoinStyle(t){switch(t){case R.Bevel:this._ctx.lineJoin="bevel";break;case R.Round:this._ctx.lineJoin="round";break;case R.Miter:this._ctx.lineJoin="miter"}}}function dt(t,e,r){let i=j(t.separation,I.CIMHatchFill.separation)*r,s=j(t.rotation);if(0===i)return null;i<0&&(i=-i);let o=0;const n=.5*i;for(;o>n;)o-=i;for(;o<-n;)o+=i;const a=h();p(a,e),a[0]-=n,a[1]-=n,a[2]+=n,a[3]+=n;const l=[[a[0],a[1]],[a[0],a[3]],[a[2],a[3]],[a[2],a[1]]];for(;s>180;)s-=180;for(;s<0;)s+=180;const c=Math.cos(s*nt),m=Math.sin(s*nt),f=-i*m,u=i*c;let d,g,_,y;o=j(t.offsetX)*r*m-j(t.offsetY)*r*c,d=_=Number.MAX_VALUE,g=y=-Number.MAX_VALUE;for(const h of l){const t=h[0],e=h[1],r=c*t+m*e,i=-m*t+c*e;d=Math.min(d,r),_=Math.min(_,i),g=Math.max(g,r),y=Math.max(y,i)}_=Math.floor(_/i)*i;let P=c*d-m*_-f*o/i,S=m*d+c*_-u*o/i,w=c*g-m*_-f*o/i,x=m*g+c*_-u*o/i;const M=1+Math.round((y-_)/i),b=[];for(let h=0;h<M;h++)P+=f,S+=u,w+=f,x+=u,b.push([[P,S],[w,x]]);return{paths:b}}function gt(t,e){let r=0;for(const i of e){const e=i.length;for(let s=1;s<e;s++){const e=i[s-1],o=i[s];if(e[1]>t[1]==o[1]>t[1])continue;(o[0]-e[0])*(t[1]-e[1])-(o[1]-e[1])*(t[0]-e[0])>0?r++:r--}}return 0!==r}function pt(t,e,r){for(const i of e){const e=i.length;for(let s=1;s<e;s++){const e=i[s-1],o=i[s];let n=(o[0]-e[0])*(o[0]-e[0])+(o[1]-e[1])*(o[1]-e[1]);if(0===n)continue;n=Math.sqrt(n);const a=((o[0]-e[0])*(t[1]-e[1])-(o[1]-e[1])*(t[0]-e[0]))/n;if(Math.abs(a)<r){const i=((o[0]-e[0])*(t[0]-e[0])+(o[1]-e[1])*(t[1]-e[1]))/n;if(i>-r&&i<n+r)return!0}}}return!1}function _t(t,e){const r=e[0]-t[0],i=e[1]-t[1];return 180/Math.PI*Math.atan2(i,r)}const yt=t=>t?{spatialReference:t.spatialReference,rings:[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]}:null,Pt=(t,e,r)=>{switch(t){case"ExtraLeading":return 1+e/r;case"Multiple":return e;case"Exact":return e/r}};function St(e,r=1){const i=E(e),s=X(e.fontStyleName),o=e.fontFamilyName??t,{weight:n,style:a}=s,l=r*(e.height||5),h=J(e.horizontalAlignment),c=N(e.verticalAlignment),m=O(e),f=O(e.haloSymbol),u=null!=f?r*(e.haloSize??0):0,d=q(e.symbol),g=r*(V(e.symbol)||0),p="CIMBackgroundCallout"===e.callout?.type?e.callout.backgroundSymbol:null,_=O(p),y=V(p),P=q(p);return{color:m,size:l,horizontalAlignment:h,verticalAlignment:c,font:{family:o,style:W(a),weight:Y(n),decoration:i},outline:{size:g||0,color:d},halo:{size:u||0,color:f,style:a},backgroundColor:_,borderLine:null!=y&&null!=P?{size:y,color:P}:null,pixelRatio:1,premultiplyColors:!0}}const wt=1e-4;function xt(t){let e,r,i,s,o,n=t[0],a=1;for(;a<t.length;)e=t[a][0]-n[0],r=t[a][1]-n[1],s=0!==e?r/e:Math.PI/2,void 0!==i&&Math.abs(s-i)<=wt?(t.splice(a-1,1),n=o):(o=n,n=t[a],a++),i=s}export{ct as CIMSymbolDrawHelper,ut as CanvasDrawHelper,mt as EnvDrawHelper,ft as HittestDrawHelper,ht as Transformation,nt as cDegToRad,Pt as lineGapType2LineHeight};
@@ -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 t from"../../core/Logger.js";import{animationDebugFlags as r}from"./animationDebugFlags.js";import{defaultCIMValues as e}from"./defaultCIMValues.js";import{AnimatedSymbolRepeatType as n,AnimatedSymbolEasingType as o}from"./enums.js";import{getExtent as i}from"./SDFHelper.js";import{getProcessParam as a,getValue as s,getSize as m}from"./utils.js";import{TimeOrigin as l}from"../../views/2d/engine/webgl/animations/instructions.js";function c(t,r,e){return{transform:b(t,r,e.transform),fromColor:P(t,r,e.fromColor),toColor:g(t,r,e.toColor),colorMix:I(t,r,e.colorMix),toOpacity:T(t,r,e.toOpacity),opacityMix:h(t,r,e.opacityMix),hasAnimations:e.hasAnimations||!!r.animations&&r.animations.length>0}}function f(t){return!r.forceStaticPath&&(r.forceAnimatedPath||t.hasAnimations)}function p(r,e,n){if("CIMCharacterMarker"===e.type)return t.getLogger("animationUtils").error("#handleMarker()","CIM character markers do not support animations"),n;const o=a(r,e,"OffsetX"),i=a(r,e,"OffsetY");if("CIMPictureMarker"===e.type)return{...n,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!0,translation:D([o,i]),rotation:D(0),scale:D(a(r,e,"Size")),parent:n.transform}};const s=e.frame,m=s.ymax-s.ymin;return{...n,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!1,translation:D([o,i]),rotation:D(0),scale:D({type:"Process",op:"Divide",left:a(r,e,"Size"),right:m}),parent:n.transform}}}function u(t,r){let e=0,n=0;const o="Absolute"!==t.anchorPointUnits;return t.anchorPoint&&(e=-t.anchorPoint.x,n=-t.anchorPoint.y),{...r,transform:{type:"AnimatedTransform",relativeTranslation:o,absoluteScale:!1,translation:D([e,n]),rotation:D(0),scale:D(1),parent:r.transform}}}function y(t,r){return"Absolute"===t.anchorPointUnits?r:u(t,r)}function C(t,r){return"Absolute"!==t.anchorPointUnits?r:u(t,r)}function M(t,r,e){return{...t,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!1,translation:D([r,e]),rotation:D(0),scale:D(1),parent:t.transform}}}function S(t,r){const e=r?.5*-(r.xmin+r.xmax):0,n=r?.5*-(r.ymin+r.ymax):0;let o=0,a=0;if("x"in t&&"y"in t)o=t.x+e,a=t.y+n;else{const r=i(t);if(r){o=(r[0]+r[2])/2+e,a=(r[1]+r[3])/2+n}}return[o,a]}function A(t,r){switch(r.type){case"CIMPictureMarker":case"CIMVectorMarker":return a(t,r,"Rotation")}return 0}function d(t,r){switch(r.type){case"CIMPointSymbol":case"CIMVectorMarker":return[1,1,1,1];case"CIMSolidStroke":case"CIMSolidFill":return a(t,r,"Color");case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":return a(t,r,"TintColor")}return[1,1,1,1]}function b(t,r,e){return{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!1,translation:O(t,r),rotation:v(t,r),scale:x(t,r),parent:e}}function P(t,r,e){return{type:"AnimatedColor",color:D(d(t,r)),opacity:D(1),parent:e}}function g(t,r,e){const{animations:n}=r;let o=d(t,r);const i=n?.filter((t=>"CIMSymbolAnimationColor"===t.type))[0];return i&&(o=a(t,i,"ToColor")),{type:"AnimatedColor",color:D(o),opacity:D(1),parent:e}}function I(t,r,e){const{animations:n}=r,o=n?.filter((t=>"CIMSymbolAnimationColor"===t.type))[0];return o?{type:"AnimatedColor",color:D([1,1,1,1]),opacity:{from:0,to:1,timing:k(t,o?.animatedSymbolProperties)},parent:[1,1,1,1]}:e}function T(t,r,e){const{animations:n}=r;let o=D(1);const i=n?.filter((t=>"CIMSymbolAnimationTransparency"===t.type))[0];if(i){o=D({type:"Process",op:"Transparency",value:a(t,i,"ToTransparency")})}return{type:"AnimatedColor",color:D([1,1,1,1]),opacity:o,parent:e}}function h(t,r,e){const{animations:n}=r,o=n?.filter((t=>"CIMSymbolAnimationTransparency"===t.type))[0];return o?{type:"AnimatedColor",color:D([1,1,1,1]),opacity:{from:0,to:1,timing:k(t,o?.animatedSymbolProperties)},parent:[1,1,1,1]}:e}function k(t,r){if(!r)return{duration:1,startTimeOffset:0,repeatDelay:0,timeOriginSelector:l.Local,repeatType:n.Loop,easing:o.Linear,playAnimation:1,reverseAnimation:0};const i=a(t,r,"Duration");let m;if(a(t,r,"RandomizeStartTime")){m={type:"Process",op:"Random",min:0,max:i,seed:a(t,r,"RandomizeStartSeed")}}else m=a(t,r,"StartTimeOffset");const c=a(t,r,"RepeatDelay"),f=a(t,r,"PlayAnimation"),p=a(t,r,"ReverseAnimation"),u=s(r.repeatType,e.CIMAnimatedSymbolProperties.repeattype);return{duration:i,startTimeOffset:m,repeatDelay:c,timeOriginSelector:u===n.None?l.Local:l.Global,repeatType:u,easing:s(r.easing,e.CIMAnimatedSymbolProperties.easing),playAnimation:f,reverseAnimation:p}}function x(t,r){const{animations:e}=r;if("CIMPictureMarker"!==r.type&&"CIMVectorMarker"!==r.type&&"CIMPointSymbol"!==r.type)return D(1);let n;n="CIMPictureMarker"===r.type||"CIMVectorMarker"===r.type?a(t,r,"Size"):m(r)||10;const o=e?.filter((t=>"CIMSymbolAnimationScale"===t.type))[0];if(!o){const r=e?.filter((t=>"CIMSymbolAnimationSize"===t.type))[0];if(!r)return D(1);return{from:1,to:{type:"Process",op:"Divide",left:a(t,r,"ToSize"),right:n},timing:k(t,r.animatedSymbolProperties)}}return{from:1,to:a(t,o,"ScaleFactor"),timing:k(t,o.animatedSymbolProperties)}}function O(t,r){const{animations:e}=r,n=e?.filter((t=>"CIMSymbolAnimationOffset"===t.type))[0];if(!n)return D([0,0]);return{from:[0,0],to:[a(t,n,"OffsetX"),a(t,n,"OffsetY")],timing:k(t,n.animatedSymbolProperties)}}function v(t,r){const{animations:e}=r,n=A(t,r),o=e?.filter((t=>"CIMSymbolAnimationRotation"===t.type))[0];if(!o)return D(n);return{from:n,to:a(t,o,"ToRotation"),timing:k(t,o.animatedSymbolProperties)}}function D(t){return{from:t,to:t,timing:{duration:1,startTimeOffset:0,repeatDelay:0,timeOriginSelector:l.Local,repeatType:n.Loop,easing:o.Linear,playAnimation:1,reverseAnimation:0}}}function L(t){if(null==t)return!1;if("object"!=typeof t)return!1;if(t.animations&&Array.isArray(t.animations)&&t.animations.length>0)return!0;for(const r in t)if(L(t[r]))return!0;return!1}export{L as checkForAnimations,c as getAnimationParams,S as getFrameTranslation,D as getStaticParam,C as handleAbsoluteAnchor,u as handleAnchor,p as handleMarker,y as handleRelativeAnchor,f as shouldUseAnimatedPath,M as translate};
5
+ import t from"../../core/Logger.js";import{animationDebugFlags as e}from"./animationDebugFlags.js";import{defaultCIMValues as r}from"./defaultCIMValues.js";import{AnimatedSymbolRepeatType as n,AnimatedSymbolEasingType as o}from"./enums.js";import{getExtent as i}from"./SDFHelper.js";import{getProcessParam as a,getValue as s,getSize as m}from"./utils.js";import{TimeOrigin as l}from"../../views/2d/engine/webgl/animations/instructions.js";function c(t,e,r){return{transform:P(t,e,r.transform),fromColor:b(t,e,r.fromColor),toColor:g(t,e,r.toColor),colorMix:I(t,e,r.colorMix),toOpacity:T(t,e,r.toOpacity),opacityMix:h(t,e,r.opacityMix),hasAnimations:r.hasAnimations||!!e.animations&&e.animations.length>0}}function f(t){return!e.forceStaticPath&&(e.forceAnimatedPath||t.hasAnimations)}function p(e,r,n){if("CIMCharacterMarker"===r.type)return t.getLogger("animationUtils").error("#handleMarker()","CIM character markers do not support animations"),n;const o=a(e,r,"OffsetX"),i=a(e,r,"OffsetY");if("CIMPictureMarker"===r.type)return{...n,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!0,translation:D([o,i]),rotation:D(0),scale:D(a(e,r,"Size")),parent:n.transform}};const s=r.frame,m=s.ymax-s.ymin;return{...n,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!1,translation:D([o,i]),rotation:D(0),scale:D({type:"Process",op:"Divide",left:a(e,r,"Size"),right:m}),parent:n.transform}}}function u(t,e){let r=0,n=0;const o="Absolute"!==t.anchorPointUnits;return t.anchorPoint&&(r=-t.anchorPoint.x,n=-t.anchorPoint.y),{...e,transform:{type:"AnimatedTransform",relativeTranslation:o,absoluteScale:!1,translation:D([r,n]),rotation:D(0),scale:D(1),parent:e.transform}}}function y(t,e){return"Absolute"===t.anchorPointUnits?e:u(t,e)}function C(t,e){return"Absolute"!==t.anchorPointUnits?e:u(t,e)}function M(t,e,r){return{...t,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!1,translation:D([e,r]),rotation:D(0),scale:D(1),parent:t.transform}}}function S(t,e){const r=e?.5*-(e.xmin+e.xmax):0,n=e?.5*-(e.ymin+e.ymax):0;let o=0,a=0;if("x"in t&&"y"in t)o=t.x+r,a=t.y+n;else{const e=i(t);if(e){o=(e[0]+e[2])/2+r,a=(e[1]+e[3])/2+n}}return[o,a]}function d(t,e){switch(e.type){case"CIMPictureMarker":case"CIMVectorMarker":return a(t,e,"Rotation")}return 0}function A(t,e){switch(e.type){case"CIMPointSymbol":case"CIMVectorMarker":return[1,1,1,1];case"CIMSolidStroke":case"CIMSolidFill":return a(t,e,"Color");case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":return a(t,e,"TintColor")}return[1,1,1,1]}function P(t,e,r){return{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!1,translation:O(t,e),rotation:v(t,e),scale:x(t,e),parent:r}}function b(t,e,r){return{type:"AnimatedColor",color:D(A(t,e)),opacity:D(1),parent:r}}function g(t,e,r){const{animations:n}=e;let o=A(t,e);const i=n?.filter((t=>"CIMSymbolAnimationColor"===t.type))[0];return i&&(o=a(t,i,"ToColor")),{type:"AnimatedColor",color:D(o),opacity:D(1),parent:r}}function I(t,e,r){const{animations:n}=e,o=n?.filter((t=>"CIMSymbolAnimationColor"===t.type))[0];return o?{type:"AnimatedColor",color:D([1,1,1,1]),opacity:{from:0,to:1,timing:k(t,o?.animatedSymbolProperties)},parent:[1,1,1,1]}:r}function T(t,e,r){const{animations:n}=e;let o=D(1);const i=n?.filter((t=>"CIMSymbolAnimationTransparency"===t.type))[0];if(i){o=D({type:"Process",op:"Transparency",value:a(t,i,"ToTransparency")})}return{type:"AnimatedColor",color:D([1,1,1,1]),opacity:o,parent:r}}function h(t,e,r){const{animations:n}=e,o=n?.filter((t=>"CIMSymbolAnimationTransparency"===t.type))[0];return o?{type:"AnimatedColor",color:D([1,1,1,1]),opacity:{from:0,to:1,timing:k(t,o?.animatedSymbolProperties)},parent:[1,1,1,1]}:r}function k(t,e){if(!e)return{duration:1,startTimeOffset:0,repeatDelay:0,timeOriginSelector:l.Local,repeatType:n.Loop,easing:o.Linear,playAnimation:1,reverseAnimation:0};const i=a(t,e,"Duration");let m;if(a(t,e,"RandomizeStartTime")){m={type:"Process",op:"Random",min:0,max:i,seed:a(t,e,"RandomizeStartSeed")}}else m=a(t,e,"StartTimeOffset");const c=a(t,e,"RepeatDelay"),f=a(t,e,"PlayAnimation"),p=a(t,e,"ReverseAnimation"),u=s(e.repeatType,r.CIMAnimatedSymbolProperties.repeattype);return{duration:i,startTimeOffset:m,repeatDelay:c,timeOriginSelector:u===n.None?l.Local:l.Global,repeatType:u,easing:s(e.easing,r.CIMAnimatedSymbolProperties.easing),playAnimation:f,reverseAnimation:p}}function x(t,e){const{animations:r}=e;if("CIMPictureMarker"!==e.type&&"CIMVectorMarker"!==e.type&&"CIMPointSymbol"!==e.type)return D(1);let n;n="CIMPictureMarker"===e.type||"CIMVectorMarker"===e.type?a(t,e,"Size"):m(e)||10;const o=r?.filter((t=>"CIMSymbolAnimationScale"===t.type))[0];if(!o){const e=r?.filter((t=>"CIMSymbolAnimationSize"===t.type))[0];if(!e)return D(1);return{from:1,to:{type:"Process",op:"Divide",left:a(t,e,"ToSize"),right:n},timing:k(t,e.animatedSymbolProperties)}}return{from:1,to:a(t,o,"ScaleFactor"),timing:k(t,o.animatedSymbolProperties)}}function O(t,e){const{animations:r}=e,n=r?.filter((t=>"CIMSymbolAnimationOffset"===t.type))[0];if(!n)return D([0,0]);return{from:[0,0],to:[a(t,n,"OffsetX"),a(t,n,"OffsetY")],timing:k(t,n.animatedSymbolProperties)}}function v(t,e){const{animations:r}=e,n=d(t,e),o=r?.filter((t=>"CIMSymbolAnimationRotation"===t.type))[0];if(!o)return D(n);const i=a(t,o,"ToRotation");return{from:n,to:{type:"Process",op:"Cond",condition:a(t,o,"RotateClockwise"),ifTrue:{type:"Process",op:"Add",left:-2*Math.PI,right:i},ifFalse:i},timing:k(t,o.animatedSymbolProperties)}}function D(t){return{from:t,to:t,timing:{duration:1,startTimeOffset:0,repeatDelay:0,timeOriginSelector:l.Local,repeatType:n.Loop,easing:o.Linear,playAnimation:1,reverseAnimation:0}}}function L(t){if(null==t)return!1;if("object"!=typeof t)return!1;if(t.animations&&Array.isArray(t.animations)&&t.animations.length>0)return!0;for(const e in t)if(L(t[e]))return!0;return!1}export{L as checkForAnimations,c as getAnimationParams,S as getFrameTranslation,D as getStaticParam,C as handleAbsoluteAnchor,u as handleAnchor,p as handleMarker,y as handleRelativeAnchor,f as shouldUseAnimatedPath,M as translate};
@@ -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{SymbolUnits as e,AnimatedSymbolRepeatType as t,AnimatedSymbolEasingType as o}from"./enums.js";const i={color:[128,128,128,1],outlinecolor:[0,0,0,1],backgroundcolor:[128,128,128,1],borderlinecolor:[0,0,0,1],tintcolor:[255,255,255,1]},n={CIMVectorMarker:{scalesymbolsproportionally:!1,respectframe:!0,anchorpointunits:"Relative",offsetx:0,offsety:0,rotateclockwise:!1,rotation:0,size:10,enable:!0,colorlocked:!1},CIMPictureMarker:{scalex:1,texturefilter:"Draft",anchorpointunits:"Relative",offsetx:0,offsety:0,rotateclockwise:!1,rotation:0,size:10,enable:!0,colorlocked:!1},CIMTextSymbol:{angle:0,anglex:0,angley:0,halosize:1,height:10,horizontalalignment:"Left",kerning:!0,letterspacing:0,letterwidth:100,ligatures:!0,linegap:0,offsetx:0,offsety:0,strikethrough:!1,textcase:"Normal",textstring:"",underline:!1,verticalalignment:"Bottom",enable:!0,colorlocked:!1},CIMSolidStroke:{capstyle:"Round",joinstyle:"Round",miterlimit:4,width:4,enable:!0,colorlocked:!1},CIMPictureStroke:{texturefilter:"Draft",capstyle:"Round",joinstyle:"Round",miterlimit:4,width:4,enable:!0,colorlocked:!1},CIMGradientStroke:{capstyle:"Round",joinstyle:"Round",miterlimit:4,width:4,enable:!0,colorlocked:!1,gradientMethod:"AcrossLine",gradientSize:75,gradientSizeUnits:e.Relative,gradientType:"Discrete",interval:5},CIMSolidFill:{enable:!0,colorlocked:!1},CIMPictureFill:{offsetx:0,offsety:0,rotation:0,scalex:1,height:10,texturefilter:"Draft",enable:!0,colorlocked:!1},CIMHatchFill:{offsetx:0,offsety:0,rotation:0,separation:4,enable:!0,colorlocked:!1},CIMGradientFill:{enable:!0,angle:90,gradientMethod:"Linear",gradientSize:75,gradientSizeUnits:e.Relative,gradientType:"Discrete",interval:5},CIMGeometricEffectAddControlPoints:{angletolerance:120},CIMGeometricEffectArrow:{arrowtype:"OpenEnded",width:5},CIMGeometricEffectBuffer:{size:1},CIMGeometricEffectCut:{begincut:1,endcut:1,middlecut:0,invert:!1},CIMGeometricEffectDashes:{customendingoffset:0,linedashending:"NoConstraint",offsetalongline:0},CIMGeometricEffectDonut:{method:"Mitered",option:"Accurate",width:2},CIMGeometricEffectJog:{angle:225,length:20,position:50},CIMGeometricEffectControlMeasureLine:{rule:"FullGeometry"},CIMGeometricEffectMove:{offsetx:1,offsety:-1},CIMGeometricEffectOffset:{method:"Square",offset:1,option:"Fast"},CIMGeometricEffectRotate:{angle:15},CIMGeometricEffectScale:{xscalefactor:1.15,yscalefactor:1.15},CIMGeometricEffectWave:{amplitude:2,period:3,seed:1,waveform:"Sinus"},CIMMarkerPlacementAlongLine:{customendingoffset:0,endings:"WithHalfGap",offsetalongline:0,placeperpart:!0,angletoline:!0,offset:0},CIMMarkerPlacementAtExtremities:{extremityplacement:"Both",offsetalongline:0,angletoline:!0,offset:0},CIMMarkerPlacementAtRatioPositions:{beginposition:0,endposition:0,flipfirst:!0,angletoline:!0,offset:0},CIMMarkerPlacementInsidePolygon:{gridangle:0,gridtype:"Fixed",offsetx:0,offsety:0,randomness:100,seed:0,shiftoddrows:!1,stepx:16,stepy:16,clipping:"ClipAtBoundary"},CIMMarkerPlacementOnLine:{relativeto:"LineMiddle",startpointoffset:0,angletoline:!0,offset:0},CIMMarkerPlacementOnVertices:{placeperpart:!0,placeoncontrolpoints:!0,placeonendpoints:!0,placeonregularvertices:!0,angletoline:!0,offset:0},CIMMarkerPlacementPolygonCenter:{method:"OnPolygon",offsetx:0,offsety:0,clipatboundary:!1},CIMAnimatedSymbolProperties:{playanimation:!1,reverseanimation:!1,randomizestarttime:!1,randomizestartseed:0,starttimeoffset:0,duration:3,endingduration:3,useendingduration:!1,repeattype:t.Loop,repeatdelay:0,easing:o.Linear},CIMSymbolAnimationSize:{tosize:10},CIMSymbolAnimationScale:{scalefactor:1},CIMSymbolAnimationColor:{tocolor:[255,255,255,1]},CIMSymbolAnimationTransparency:{totransparency:0},CIMSymbolAnimationRotation:{torotation:0},CIMSymbolAnimationOffset:{offsetx:0,offsety:0}};export{i as defaultCIMColor,n as defaultCIMValues};
5
+ import{SymbolUnits as e,AnimatedSymbolRepeatType as t,AnimatedSymbolEasingType as o}from"./enums.js";const i={color:[128,128,128,1],outlinecolor:[0,0,0,1],backgroundcolor:[128,128,128,1],borderlinecolor:[0,0,0,1],tintcolor:[255,255,255,1]},n={CIMVectorMarker:{scalesymbolsproportionally:!1,respectframe:!0,anchorpointunits:"Relative",offsetx:0,offsety:0,rotateclockwise:!1,rotation:0,size:10,enable:!0,colorlocked:!1},CIMPictureMarker:{scalex:1,texturefilter:"Draft",anchorpointunits:"Relative",offsetx:0,offsety:0,rotateclockwise:!1,rotation:0,size:10,enable:!0,colorlocked:!1},CIMTextSymbol:{angle:0,anglex:0,angley:0,halosize:1,height:10,horizontalalignment:"Left",kerning:!0,letterspacing:0,letterwidth:100,ligatures:!0,linegap:0,offsetx:0,offsety:0,strikethrough:!1,textcase:"Normal",textstring:"",underline:!1,verticalalignment:"Bottom",enable:!0,colorlocked:!1},CIMSolidStroke:{capstyle:"Round",joinstyle:"Round",miterlimit:4,width:4,enable:!0,colorlocked:!1},CIMPictureStroke:{texturefilter:"Draft",capstyle:"Round",joinstyle:"Round",miterlimit:4,width:4,enable:!0,colorlocked:!1},CIMGradientStroke:{capstyle:"Round",joinstyle:"Round",miterlimit:4,width:4,enable:!0,colorlocked:!1,gradientMethod:"AcrossLine",gradientSize:75,gradientSizeUnits:e.Relative,gradientType:"Discrete",interval:5},CIMSolidFill:{enable:!0,colorlocked:!1},CIMPictureFill:{offsetx:0,offsety:0,rotation:0,scalex:1,height:10,texturefilter:"Draft",enable:!0,colorlocked:!1},CIMHatchFill:{offsetx:0,offsety:0,rotation:0,separation:4,enable:!0,colorlocked:!1},CIMGradientFill:{enable:!0,angle:90,gradientMethod:"Linear",gradientSize:75,gradientSizeUnits:e.Relative,gradientType:"Discrete",interval:5},CIMGeometricEffectAddControlPoints:{angletolerance:120},CIMGeometricEffectArrow:{arrowtype:"OpenEnded",width:5},CIMGeometricEffectBuffer:{size:1},CIMGeometricEffectCut:{begincut:1,endcut:1,middlecut:0,invert:!1},CIMGeometricEffectDashes:{customendingoffset:0,linedashending:"NoConstraint",offsetalongline:0},CIMGeometricEffectDonut:{method:"Mitered",option:"Accurate",width:2},CIMGeometricEffectJog:{angle:225,length:20,position:50},CIMGeometricEffectControlMeasureLine:{rule:"FullGeometry"},CIMGeometricEffectMove:{offsetx:1,offsety:-1},CIMGeometricEffectOffset:{method:"Square",offset:1,option:"Fast"},CIMGeometricEffectRotate:{angle:15},CIMGeometricEffectScale:{xscalefactor:1.15,yscalefactor:1.15},CIMGeometricEffectWave:{amplitude:2,period:3,seed:1,waveform:"Sinus"},CIMMarkerPlacementAlongLine:{customendingoffset:0,endings:"WithHalfGap",offsetalongline:0,placeperpart:!0,angletoline:!0,offset:0},CIMMarkerPlacementAtExtremities:{extremityplacement:"Both",offsetalongline:0,angletoline:!0,offset:0},CIMMarkerPlacementAtRatioPositions:{beginposition:0,endposition:0,flipfirst:!0,angletoline:!0,offset:0},CIMMarkerPlacementInsidePolygon:{gridangle:0,gridtype:"Fixed",offsetx:0,offsety:0,randomness:100,seed:0,shiftoddrows:!1,stepx:16,stepy:16,clipping:"ClipAtBoundary"},CIMMarkerPlacementOnLine:{relativeto:"LineMiddle",startpointoffset:0,angletoline:!0,offset:0},CIMMarkerPlacementOnVertices:{placeperpart:!0,placeoncontrolpoints:!0,placeonendpoints:!0,placeonregularvertices:!0,angletoline:!0,offset:0},CIMMarkerPlacementPolygonCenter:{method:"OnPolygon",offsetx:0,offsety:0,clipatboundary:!1},CIMAnimatedSymbolProperties:{playanimation:!1,reverseanimation:!1,randomizestarttime:!1,randomizestartseed:0,starttimeoffset:0,duration:3,endingduration:3,useendingduration:!1,repeattype:t.Loop,repeatdelay:0,easing:o.Linear},CIMSymbolAnimationSize:{tosize:10},CIMSymbolAnimationScale:{scalefactor:1},CIMSymbolAnimationColor:{tocolor:[255,255,255,1]},CIMSymbolAnimationTransparency:{totransparency:0},CIMSymbolAnimationRotation:{torotation:0,rotateclockwise:!1},CIMSymbolAnimationOffset:{offsetx:0,offsety:0}};export{i as defaultCIMColor,n as defaultCIMValues};
@@ -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"../../../../../Color.js";import{getStartGroup as o,getRandomValue as t}from"../grouping.js";import{hydrate as r}from"./infos.js";import{instructions as n}from"./instructions.js";function i(e){return a(e.map((e=>c(e))).map((e=>r(e).simplify())))}function s(e){const o=[];return o.push(e.transform),o.push(e.fromColor),o.push(e.toColor),o.push(e.colorMix),o.push(e.toOpacity),o.push(e.opacityMix),o}function a(e){const o=[],t=[];let r=0;for(const i of e){const s=[...i.encode(),...n.ret.encode()];o.push([r+e.length,0,0,0]),t.push(...s),r+=s.length}return[...o,...t]}async function f(e,o){const t=e;let r;if("number"==typeof t||"string"==typeof t||"boolean"==typeof t)r=t;else if(Array.isArray(t))r=await Promise.all(t.map((e=>f(e,o))));else if("object"==typeof t)if("valueExpressionInfo"in t){const{valueExpressionInfo:e}=t,{expression:n}=e;r={...t,computed:await o.createComputedField({expression:n})}}else{r={};for(const e in t)r[e]=await f(t[e],o)}return r}function c(r,n,i){function s(o){if(!("computed"in o))return o;let t=o.computed.readWithDefault(n,i,[255*o.defaultValue[0],255*o.defaultValue[1],255*o.defaultValue[2],o.defaultValue[3]]);if("string"==typeof t){const o=e.fromString(t);o&&(t=[o.r,o.g,o.b,o.a])}return t}const a=r;let f;if("number"==typeof a||"string"==typeof a||"boolean"==typeof a)f=a;else if(Array.isArray(a))f=a.map((e=>c(e,n,i)));else if("object"==typeof a)if("type"in a&&null!=a.type&&"Process"===a.type)switch(a.op){case"ArcadeColor":{const e=c(a.value,n,i);p(Array.isArray(e)&&4===e.length);f=[e[0]/255,e[1]/255,e[2]/255,e[3]]}break;case"Transparency":{const e=c(a.value,n,i);p("number"==typeof e),f=1-e/100}break;case"Divide":{const e=c(a.left,n,i);p("number"==typeof e);const o=c(a.right,n,i);p("number"==typeof o),f=e/o}break;case"Random":{const e=c(a.seed,n,i),r=c(a.min,n,i),s=c(a.max,n,i),l=n.getObjectId(),p=o(l||0);f=r+t(p,e)*(s-r)}}else if("computed"in a)f=s(a);else{f={};for(const e in a)f[e]=c(a[e],n,i)}return f}function*l(e){const o=e;if(Array.isArray(o))for(const t of o)yield*l(t);else if("object"==typeof o)if("type"in o&&null!=o.type&&"Process"===o.type)switch(o.op){case"ArcadeColor":case"Transparency":yield*l(o.value);break;case"Divide":yield*l(o.left),yield*l(o.right);break;case"Random":yield*l(o.seed),yield*l(o.min),yield*l(o.max)}else if("computed"in o)yield o.computed;else for(const t in o)yield*l(o[t])}function p(e){if(!e)throw new Error("Assertion failed.")}export{p as assert,f as compileAnimationParam,s as createParamList,a as encodeParamList,i as fromJSON,l as getAnimationExpressions,c as resolveToAnimationInfo};
5
+ import e from"../../../../../Color.js";import{getStartGroup as o,getRandomValue as t}from"../grouping.js";import{hydrate as i}from"./infos.js";import{instructions as r}from"./instructions.js";function n(e){return a(e.map((e=>f(e))).map((e=>i(e).simplify())))}function s(e){const o=[];return o.push(e.transform),o.push(e.fromColor),o.push(e.toColor),o.push(e.colorMix),o.push(e.toOpacity),o.push(e.opacityMix),o}function a(e){const o=[],t=[];let i=0;for(const n of e){const s=[...n.encode(),...r.ret.encode()];o.push([i+e.length,0,0,0]),t.push(...s),i+=s.length}return[...o,...t]}async function c(e,o){const t=e;let i;if("number"==typeof t||"string"==typeof t||"boolean"==typeof t)i=t;else if(Array.isArray(t))i=await Promise.all(t.map((e=>c(e,o))));else if("object"==typeof t)if("valueExpressionInfo"in t){const{valueExpressionInfo:e}=t,{expression:r}=e;i={...t,computed:await o.createComputedField({expression:r})}}else{i={};for(const e in t)i[e]=await c(t[e],o)}return i}function f(i,r,n){function s(o){if(!("computed"in o))return o;let t=o.computed.readWithDefault(r,n,[255*o.defaultValue[0],255*o.defaultValue[1],255*o.defaultValue[2],o.defaultValue[3]]);if("string"==typeof t){const o=e.fromString(t);o&&(t=[o.r,o.g,o.b,o.a])}return t}const a=i;let c;if("number"==typeof a||"string"==typeof a||"boolean"==typeof a)c=a;else if(Array.isArray(a))c=a.map((e=>f(e,r,n)));else if("object"==typeof a)if("type"in a&&null!=a.type&&"Process"===a.type)switch(a.op){case"ArcadeColor":{const e=f(a.value,r,n);p(Array.isArray(e)&&4===e.length);c=[e[0]/255,e[1]/255,e[2]/255,e[3]]}break;case"Transparency":{const e=f(a.value,r,n);p("number"==typeof e),c=1-e/100}break;case"Divide":case"Add":{const e=f(a.left,r,n);p("number"==typeof e);const o=f(a.right,r,n);switch(p("number"==typeof o),a.op){case"Divide":c=e/o;break;case"Add":c=e+o}}break;case"Random":{const e=f(a.seed,r,n),i=f(a.min,r,n),s=f(a.max,r,n),l=r.getObjectId(),p=o(l||0);c=i+t(p,e)*(s-i)}break;case"Cond":{const e=f(a.condition,r,n),o=f(a.ifTrue,r,n),t=f(a.ifFalse,r,n);c=e?o:t}}else if("computed"in a)c=s(a);else{c={};for(const e in a)c[e]=f(a[e],r,n)}return c}function*l(e){const o=e;if(Array.isArray(o))for(const t of o)yield*l(t);else if("object"==typeof o)if("type"in o&&null!=o.type&&"Process"===o.type)switch(o.op){case"ArcadeColor":case"Transparency":yield*l(o.value);break;case"Divide":case"Add":yield*l(o.left),yield*l(o.right);break;case"Random":yield*l(o.seed),yield*l(o.min),yield*l(o.max);break;case"Cond":yield*l(o.condition),yield*l(o.ifTrue),yield*l(o.ifFalse)}else if("computed"in o)yield o.computed;else for(const t in o)yield*l(o[t])}function p(e){if(!e)throw new Error("Assertion failed.")}export{p as assert,c as compileAnimationParam,s as createParamList,a as encodeParamList,n as fromJSON,l as getAnimationExpressions,f as resolveToAnimationInfo};
@@ -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{AMeshFactory as e}from"./MeshFactory.js";import{createMatcher as t}from"../../util/createMatcher.js";class s extends e{static async create(e,o){const r=await t(e,o.symbology),c=o.labels?await t(e,o.labels):null;return new s(r,c)}constructor(e,t){super(),this._symbology=e,this._labels=t}destroy(){}async enqueueMatcherRequests(e,t){await Promise.all([this._symbology.fetchResources(e,t),this._labels?.fetchResources(e,t)])}enqueueWriterRequests(e,t,s,o){const r=this._symbology.match(t,s,o);if(r){for(const o of r)o.enqueueRequest(e,t,s);if(this._labels){const r=this._labels.match(t,s,o);if(!r)return;for(const o of r)o.enqueueRequest(e,t,s)}}}write(e,t,s,o,r,c){const a=this._symbology.match(s,o,r);if(!a)return;for(const n of a)n.write(e,t,s,o,c);if(e.entityRecordCount()>=1&&this._labels){const n=this._labels.match(s,o,r);if(!n)return;for(const r of n)r.setReferences(a),r.write(e,t,s,o,c)}}getSortKey(e,t){return this._symbology.getSortKey(e,t)}hasArcadeDependency(e){return this._symbology.hasArcadeDependency(e)}}export{s as FeatureMeshFactory};
5
+ import{AMeshFactory as e}from"./MeshFactory.js";import{createMatcher as t}from"../../util/createMatcher.js";class s extends e{static async create(e,o){const r=await t(e,o.symbology),c=o.labels?await t(e,o.labels):null;return new s(r,c)}constructor(e,t){super(),this._symbology=e,this._labels=t}destroy(){}async enqueueMatcherRequests(e,t){await Promise.all([this._symbology.fetchResources(e,t),this._labels?.fetchResources(e,t)])}enqueueWriterRequests(e,t,s,o){const r=this._symbology.match(t,s,o);if(r){for(const o of r)o.enqueueRequest(e,t,s);if(this._labels){const r=this._labels.match(t,s,o);if(!r)return;for(const o of r)o.enqueueRequest(e,t,s)}}}write(e,t,s,o,r,c){const a=this._symbology.match(s,o,r);if(!a)return;for(const n of a)n.write(e,t,s,o,c);if(e.entityRecordCount()>=1&&this._labels){const n=this._labels.match(s,o,r);if(!n)return;for(const r of n)r.setReferences(a),r.write(e,t,s,o,c)}}getSortKey(e,t){return this._symbology.getSortKey(e,t)}hasArcadeDependency(e){return!(!this._symbology.hasArcadeDependency(e)&&!this._labels?.hasArcadeDependency(e))}}export{s as FeatureMeshFactory};
@@ -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 i}from"../../../../../../../chunks/tslib.es6.js";import{animationDebugFlags as t}from"../../../../../../../symbols/cim/animationDebugFlags.js";import{generateVirtualMachineSource as o}from"../../../animations/instructions.js";import{location as e,uniform as r,option as a}from"../../GraphShaderModule.js";import{sin as s,cos as l,Float as n,Mat3 as m,Vec3 as u,lessThanEqual as p,cond as d,ifElse as c,equal as y,texture2D as f,clamp as h,abs as S,Vec2 as b,block as g,Vec4 as V}from"../../graph/glsl.js";import{AnimationUniformInfo as v}from"./AnimationUniformInfo.js";import{FeatureVertexInput as w,FeatureFragmentInput as x,AFeatureShader as j}from"../shaders/AFeatureShader.js";import{softEdgeRatio as z}from"../shaders/constants.js";import{MosaicInfo as T}from"../shaders/MosaicInfo.js";import{rgba2float as _}from"../shaders/utils.js";import{VisualVariableColor as I}from"../shaders/VisualVariableColor.js";import{VisualVariableOpacity as C}from"../shaders/VisualVariableOpacity.js";import{VisualVariableRotation as O}from"../shaders/VisualVariableRotation.js";import{VisualVariableSizeMinMaxValue as M}from"../shaders/VisualVariableSizeMinMaxValue.js";import{VisualVariableSizeScaleStops as P}from"../shaders/VisualVariableSizeScaleStops.js";import{VisualVariableSizeStops as D}from"../shaders/VisualVariableSizeStops.js";import{VisualVariableSizeUnitValue as F}from"../shaders/VisualVariableSizeUnitValue.js";import{getVisualVariableAngle as R}from"../shaders/vvUtils.js";class A extends w{}i([e(3,V)],A.prototype,"animationPointerAndBaseSizeAndReferenceSize",void 0),i([e(4,b)],A.prototype,"zoomRange",void 0);class L extends x{}class U extends j{_getScreenPosition(i){const{pos:t,translation:o,rotation:e,scale:r,offset:a,id:p,vvScale:d}=i,c=R(this,p).multiply(Math.PI/180),y=o.x.multiply(4/3),f=o.y.multiply(-1).multiply(4/3),h=s(e.subtract(c)),S=l(e.subtract(c)),b=new n(0),g=new n(1),{pixelRatio:V}=this.animationInfo,v=new m(g,b,b,b,g,b,y.multiply(V),f.multiply(V),g),w=new m(S,h.multiply(-1),b,h,S,b,0,0,g),x=r.multiply(d).multiply(V).multiply(4/3),j=w.multiply(x),z=this.animationInfo.toScreen.multiply(new u(t,1)),T=v.multiply(z).xy,_=j.multiply(new u(a,0)).xy;return T.add(_)}_clip(i,o){let e=super.clip(i,o);const r=p(this._getLocalTimeOrigin(i),new n(0));return t.forceGlobalTimeOrigin||(e=e.add(d([r,()=>new n(2)],[!0,()=>new n(0)]))),e}_getLocalTimeOrigin(i){return this.storage.getLocalTimeOrigin(i)}_toNdc(i){return this.animationInfo.toNdc.multiply(new u(i,1)).xy}_getEvalParams(i,t){const{globalTime:o,animationTextureSize:e,animationTexture:r}=this.animationInfo;return{globalTime:o,localTimeOrigin:this._getLocalTimeOrigin(i.id),animationTextureSize:e,animationTexture:r,pixelDimensions:t}}_getColor(i,t){return c(y(t.isSDF,new n(1)),this._getSDFColor(i,t),this._getSpriteColor(i,t))}_getSpriteColor(i,t){return f(this.mosaicInfo.texture,i).multiply(t.color)}_getSDFColor(i,t){const o=f(this.mosaicInfo.texture,i),e=new n(.5).subtract(_(o)).multiply(t.distanceToPx).multiply(z),r=h(new n(.5).subtract(e),new n(0),new n(1)),a=t.color.multiply(r),s=t.outlineSize.multiply(.5),l=S(e).subtract(s),m=h(new n(.5).subtract(l),new n(0),new n(1)),u=t.outlineColor.multiply(m);return new n(1).subtract(u.a).multiply(a).add(u)}}function E(i,t,e){const r=i.add(new b(t,0)),a=f(e.animationTexture,r.add(.5).divide(e.animationTextureSize)).xy;return i=i.add(a),g({animationPointer:i,...e},V,null,(i=>{const{out:t}=i;if(!t)throw new Error("out is null");return o({...i,out:t})}))}i([r(T)],U.prototype,"mosaicInfo",void 0),i([r(v)],U.prototype,"animationInfo",void 0),i([a(I)],U.prototype,"visualVariableColor",void 0),i([a(C)],U.prototype,"visualVariableOpacity",void 0),i([a(M)],U.prototype,"visualVariableSizeMinMaxValue",void 0),i([a(P)],U.prototype,"visualVariableSizeScaleStops",void 0),i([a(D)],U.prototype,"visualVariableSizeStops",void 0),i([a(F)],U.prototype,"visualVariableSizeUnitValue",void 0),i([a(O)],U.prototype,"visualVariableRotation",void 0);export{L as AAnimatedFragmentInput,U as AAnimatedShader,A as AAnimatedVertexInput,E as getValue};
5
+ import{_ as i}from"../../../../../../../chunks/tslib.es6.js";import{animationDebugFlags as t}from"../../../../../../../symbols/cim/animationDebugFlags.js";import{generateVirtualMachineSource as o}from"../../../animations/instructions.js";import{location as e,uniform as a,option as r}from"../../GraphShaderModule.js";import{sin as l,cos as s,negate as n,Float as m,Mat3 as u,Vec3 as p,lessThanEqual as d,cond as c,ifElse as y,equal as f,texture2D as h,clamp as S,abs as b,Vec2 as g,block as V,Vec4 as v}from"../../graph/glsl.js";import{AnimationUniformInfo as w}from"./AnimationUniformInfo.js";import{FeatureVertexInput as x,FeatureFragmentInput as j,AFeatureShader as z}from"../shaders/AFeatureShader.js";import{softEdgeRatio as T}from"../shaders/constants.js";import{MosaicInfo as _}from"../shaders/MosaicInfo.js";import{rgba2float as I}from"../shaders/utils.js";import{VisualVariableColor as C}from"../shaders/VisualVariableColor.js";import{VisualVariableOpacity as O}from"../shaders/VisualVariableOpacity.js";import{VisualVariableRotation as M}from"../shaders/VisualVariableRotation.js";import{VisualVariableSizeMinMaxValue as P}from"../shaders/VisualVariableSizeMinMaxValue.js";import{VisualVariableSizeScaleStops as D}from"../shaders/VisualVariableSizeScaleStops.js";import{VisualVariableSizeStops as F}from"../shaders/VisualVariableSizeStops.js";import{VisualVariableSizeUnitValue as R}from"../shaders/VisualVariableSizeUnitValue.js";import{getVisualVariableAngle as A}from"../shaders/vvUtils.js";class L extends x{}i([e(3,v)],L.prototype,"animationPointerAndBaseSizeAndReferenceSize",void 0),i([e(4,g)],L.prototype,"zoomRange",void 0);class U extends j{}class E extends z{_getScreenPosition(i){const{pos:t,translation:o,rotation:e,scale:a,offset:r,id:d,vvScale:c}=i,y=A(this,d).multiply(Math.PI/180),f=o.x.multiply(4/3),h=o.y.multiply(-1).multiply(4/3),S=l(y),b=s(y),g=b.multiply(f).add(n(S).multiply(h)),V=S.multiply(f).add(b.multiply(h)),v=l(e.subtract(y)),w=s(e.subtract(y)),x=new m(0),j=new m(1),{pixelRatio:z}=this.animationInfo,T=new u(j,x,x,x,j,x,g.multiply(z),V.multiply(z),j),_=new u(w,v.multiply(-1),x,v,w,x,0,0,j),I=a.multiply(c).multiply(z).multiply(4/3),C=_.multiply(I),O=this.animationInfo.toScreen.multiply(new p(t,1)),M=T.multiply(O).xy,P=C.multiply(new p(r,0)).xy;return M.add(P)}_clip(i,o){let e=super.clip(i,o);const a=d(this._getLocalTimeOrigin(i),new m(0));return t.forceGlobalTimeOrigin||(e=e.add(c([a,()=>new m(2)],[!0,()=>new m(0)]))),e}_getLocalTimeOrigin(i){return this.storage.getLocalTimeOrigin(i)}_toNdc(i){return this.animationInfo.toNdc.multiply(new p(i,1)).xy}_getEvalParams(i,t){const{globalTime:o,animationTextureSize:e,animationTexture:a}=this.animationInfo;return{globalTime:o,localTimeOrigin:this._getLocalTimeOrigin(i.id),animationTextureSize:e,animationTexture:a,pixelDimensions:t}}_getColor(i,t){return y(f(t.isSDF,new m(1)),this._getSDFColor(i,t),this._getSpriteColor(i,t))}_getSpriteColor(i,t){return h(this.mosaicInfo.texture,i).multiply(t.color)}_getSDFColor(i,t){const o=h(this.mosaicInfo.texture,i),e=new m(.5).subtract(I(o)).multiply(t.distanceToPx).multiply(T),a=S(new m(.5).subtract(e),new m(0),new m(1)),r=t.color.multiply(a),l=t.outlineSize.multiply(.5),s=b(e).subtract(l),n=S(new m(.5).subtract(s),new m(0),new m(1)),u=t.outlineColor.multiply(n);return new m(1).subtract(u.a).multiply(r).add(u)}}function G(i,t,e){const a=i.add(new g(t,0)),r=h(e.animationTexture,a.add(.5).divide(e.animationTextureSize)).xy;return i=i.add(r),V({animationPointer:i,...e},v,null,(i=>{const{out:t}=i;if(!t)throw new Error("out is null");return o({...i,out:t})}))}i([a(_)],E.prototype,"mosaicInfo",void 0),i([a(w)],E.prototype,"animationInfo",void 0),i([r(C)],E.prototype,"visualVariableColor",void 0),i([r(O)],E.prototype,"visualVariableOpacity",void 0),i([r(P)],E.prototype,"visualVariableSizeMinMaxValue",void 0),i([r(D)],E.prototype,"visualVariableSizeScaleStops",void 0),i([r(F)],E.prototype,"visualVariableSizeStops",void 0),i([r(R)],E.prototype,"visualVariableSizeUnitValue",void 0),i([r(M)],E.prototype,"visualVariableRotation",void 0);export{U as AAnimatedFragmentInput,E as AAnimatedShader,L as AAnimatedVertexInput,G as getValue};
@@ -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{FeatureSymbologyDrawOrder as e}from"../../../enums.js";import{FeatureTechnique as t}from"../FeatureTechnique.js";import{resolveDynamicUniforms as r,getFeatureUniforms as s,getSelectionDefines as i,isHittest as o,isHighlight as a,getFeaturePipelineState as n}from"../featureTechniqueUtils.js";import{TechniqueType as m}from"../TechniqueType.js";import{getAntialiasingControls as p}from"./utils.js";import{GradientStrokeShader as l}from"../shaders/GradientStrokeShader.js";import{FramebufferBit as c,CompareFunction as u,StencilOperation as f}from"../../../../../../webgl/enums.js";class E extends t{constructor(){super(...arguments),this.type=m.GradientStroke,this.shaders={geometry:new l},this.symbologyPlane=e.LINE}render(e,t){const{context:m,painter:l,pixelRatio:E}=e,d=t.instance.getInput();if(l.setShader({shader:this.shaders.geometry,uniforms:{...r(e,t.target,d.uniforms),...s(e,t.target),antialiasingControls:p(E),mosaicInfo:l.textureManager.getMosaicInfo(m,t.textureKey)},defines:{...i(e)},optionalAttributes:d.optionalAttributes,useComputeBuffer:o(e)}),o(e)||a(e)){const r=n(e);return l.setPipelineState(r),void l.submitDraw(e,t)}e.context.setClearDepth(1),e.context.clear(c.DEPTH);const h={color:!1,depth:{write:{zNear:0,zFar:1},test:u.LESS},stencil:{write:!1,test:{ref:e=>e.stencilRef,compare:u.EQUAL,mask:255,op:{fail:f.KEEP,zFail:f.KEEP,zPass:f.KEEP}}}};l.setPipelineState(h),l.submitDraw(e,t);const P={color:{write:[!0,!0,!0,!0],blendMode:"composite"},depth:{write:!1,test:u.EQUAL},stencil:{write:!1,test:{ref:e=>e.stencilRef,compare:u.EQUAL,mask:255,op:{fail:f.KEEP,zFail:f.KEEP,zPass:f.KEEP}}}};l.setPipelineState(P),l.submitDraw(e,t)}}export{E as GradientStrokeTechnique};
5
+ import{FeatureSymbologyDrawOrder as e}from"../../../enums.js";import{FeatureTechnique as t}from"../FeatureTechnique.js";import{isHittest as s,isHighlight as r,getFeaturePipelineState as i,resolveDynamicUniforms as o,getFeatureUniforms as a,getSelectionDefines as n}from"../featureTechniqueUtils.js";import{TechniqueType as m}from"../TechniqueType.js";import{getAntialiasingControls as u}from"./utils.js";import{GradientStrokeShader as l}from"../shaders/GradientStrokeShader.js";import{FramebufferBit as p,CompareFunction as c,StencilOperation as f}from"../../../../../../webgl/enums.js";class h extends t{constructor(){super(...arguments),this.type=m.GradientStroke,this.shaders={geometry:new l},this.symbologyPlane=e.LINE}render(e,t){const{context:m,painter:l,pixelRatio:h}=e,d=t.instance.getInput();if(s(e)||r(e)){const s=i(e);return l.setPipelineState(s),void l.submitDraw(e,t)}e.context.setClearDepth(1),e.context.clear(p.DEPTH);const E={color:!1,depth:{write:{zNear:0,zFar:1},test:c.LESS},stencil:{write:!1,test:{ref:e=>e.stencilRef,compare:c.EQUAL,mask:255,op:{fail:f.KEEP,zFail:f.KEEP,zPass:f.KEEP}}}};l.setShader({shader:this.shaders.geometry,uniforms:{...o(e,t.target,d.uniforms),...a(e,t.target),antialiasingControls:u(h),mosaicInfo:l.textureManager.getMosaicInfo(m,t.textureKey),technique:{isColorPass:0}},defines:{...n(e)},optionalAttributes:d.optionalAttributes,useComputeBuffer:s(e)}),l.setPipelineState(E),l.submitDraw(e,t);const g={color:{write:[!0,!0,!0,!0],blendMode:"composite"},depth:{write:!1,test:c.LEQUAL},stencil:{write:!1,test:{ref:e=>e.stencilRef,compare:c.EQUAL,mask:255,op:{fail:f.KEEP,zFail:f.KEEP,zPass:f.KEEP}}}};l.setShader({shader:this.shaders.geometry,uniforms:{...o(e,t.target,d.uniforms),...a(e,t.target),antialiasingControls:u(h),mosaicInfo:l.textureManager.getMosaicInfo(m,t.textureKey),technique:{isColorPass:1}},defines:{...n(e)},optionalAttributes:d.optionalAttributes,useComputeBuffer:s(e)}),l.setPipelineState(g),l.submitDraw(e,t)}}export{h as GradientStrokeTechnique};
@@ -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 e={isAlongLine:0,isAbsoluteSize:1,isDiscrete:2},i=.01;export{e as bitset,i as interiorBias};
5
+ const e={isAlongLine:0,isAbsoluteSize:1,isDiscrete:2};export{e as bitset};
@@ -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,a as e}from"../../../../../../../chunks/tslib.es6.js";import{location as i,uniform as o,input as s}from"../../GraphShaderModule.js";import{ifElse as r,greaterThan as n,Float as a,dot as l,mix as d,Vec2 as p,clamp as m,texture2D as c,length as u,sign as g,Vec4 as h}from"../../graph/glsl.js";import{bitset as v,interiorBias as y}from"../line/gradientStrokeConstants.js";import{BaseHittestVertexInput as f}from"./AFeatureShader.js";import{LineVertexInput as b,LineFragmentInput as w,LineShader as x,getLineVertexData as L,getLineAntialiasing as S}from"./LineShader.js";import{MosaicInfo as j}from"./MosaicInfo.js";import{getBit as A,getBitBool as D,oneMinus as z}from"./utils.js";class F extends b{}t([i(9,a)],F.prototype,"accumulatedDistance",void 0),t([i(10,a)],F.prototype,"totalLength",void 0),t([i(11,a)],F.prototype,"gradientSize",void 0),t([i(12,p)],F.prototype,"segmentDirection",void 0),t([i(13,h)],F.prototype,"tlbr",void 0);class I extends w{}class G extends x{vertex(t,e){const{totalLength:i,gradientSize:o,segmentDirection:s,tlbr:d}=t,p=L(this,t),m=A(t.bitset,v.isAlongLine),c=i.divide(this.view.displayZoomFactor),u=r(D(t.bitset,v.isAbsoluteSize),(()=>{const t=r(n(m,new a(.5)),c,p.halfWidth);return o.divide(t)}),o),g=t.accumulatedDistance.divide(this.view.displayZoomFactor).add(l(s,p.scaledOffset)).divide(c),h=d.divide(this.mosaicInfo.size.xyxy);return{...p,tlbr:h,relativePositionAlongLine:g,relativeGradientSize:u,isAlongLine:A(t.bitset,v.isAlongLine),isDiscrete:A(t.bitset,v.isDiscrete),...this.maybeRunHittest(t,e,p.halfWidth)}}fragment(t){const{isAlongLine:e,isDiscrete:i,relativePositionAlongLine:o,relativeGradientSize:s,normal:l,tlbr:h}=t,v=S(t,this.antialiasingControls.blur),f=new a(.5).multiply(l.y).add(new a(.5)),b=r(n(e,new a(.5)),o,f),w=r(n(i,new a(.5)),s.subtract(1),new a(0)),x=z(b.add(w).divide(s)),L=d(h.xy,h.zw,new p(m(x,new a(0),new a(1)),.5)),j=c(this.mosaicInfo.texture,L),A=t.opacity.multiply(v),D=this.getFragmentOutput(j.multiply(A),t);return D.glFragDepth=u(l).add(g(l.y).multiply(y)),D}}t([o(j)],G.prototype,"mosaicInfo",void 0),t([e(0,s(F)),e(1,s(f))],G.prototype,"vertex",null);export{I as GradientStrokeFragmentInput,G as GradientStrokeShader,F as GradientStrokeVertexInput};
5
+ import{_ as t,a as e}from"../../../../../../../chunks/tslib.es6.js";import has from"../../../../../../../core/has.js";import{location as i,uniform as o,UniformGroup as s,input as r}from"../../GraphShaderModule.js";import{ifElse as n,greaterThan as a,Float as l,dot as d,mix as p,Vec2 as m,clamp as c,texture2D as h,step as u,length as g,Vec4 as y}from"../../graph/glsl.js";import{bitset as v}from"../line/gradientStrokeConstants.js";import{BaseHittestVertexInput as f}from"./AFeatureShader.js";import{LineVertexInput as w,LineFragmentInput as b,LineShader as x,getLineVertexData as j,getLineAntialiasing as L}from"./LineShader.js";import{MosaicInfo as S}from"./MosaicInfo.js";import{getBit as A,getBitBool as D,oneMinus as z}from"./utils.js";class F extends w{}t([i(9,l)],F.prototype,"accumulatedDistance",void 0),t([i(10,l)],F.prototype,"totalLength",void 0),t([i(11,l)],F.prototype,"gradientSize",void 0),t([i(12,m)],F.prototype,"segmentDirection",void 0),t([i(13,y)],F.prototype,"tlbr",void 0);class C extends b{}class I extends s{}t([o(l)],I.prototype,"isColorPass",void 0);class P extends x{vertex(t,e){const{totalLength:i,gradientSize:o,segmentDirection:s,tlbr:r}=t,p=j(this,t),m=A(t.bitset,v.isAlongLine),c=i.divide(this.view.displayZoomFactor),h=n(D(t.bitset,v.isAbsoluteSize),(()=>{const t=n(a(m,new l(.5)),c,p.halfWidth);return o.divide(t)}),o),u=t.accumulatedDistance.divide(this.view.displayZoomFactor).add(d(s,p.scaledOffset)).divide(c),g=r.divide(this.mosaicInfo.size.xyxy);return{...p,tlbr:g,relativePositionAlongLine:u,relativeGradientSize:h,isAlongLine:A(t.bitset,v.isAlongLine),isDiscrete:A(t.bitset,v.isDiscrete),...this.maybeRunHittest(t,e,p.halfWidth)}}fragment(t){const{isAlongLine:e,isDiscrete:i,relativePositionAlongLine:o,relativeGradientSize:s,normal:r,tlbr:d}=t,y=L(t,this.antialiasingControls.blur),v=new l(.5).multiply(r.y).add(new l(.5)),f=n(a(e,new l(.5)),o,v),w=n(a(i,new l(.5)),s.subtract(1),new l(0)),b=z(f.add(w).divide(s)),x=p(d.xy,d.zw,new m(c(b,new l(0),new l(1)),.5)),j=h(this.mosaicInfo.texture,x),S=t.opacity.multiply(y),A=this.getFragmentOutput(j.multiply(S),t),D=u(new l(.5),this.technique.isColorPass).multiply(has("gradient-depth-epsilon")),F=u(new l(0),r.y).multiply(new l(has("gradient-depth-bias")).subtract(D));return A.glFragDepth=c(g(r).add(F),new l(0),new l(1)),A}}t([o(S)],P.prototype,"mosaicInfo",void 0),t([o(I)],P.prototype,"technique",void 0),t([e(0,r(F)),e(1,r(f))],P.prototype,"vertex",null);export{C as GradientStrokeFragmentInput,P as GradientStrokeShader,F as GradientStrokeVertexInput};
@@ -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{FeatureMatcher as e}from"./Matcher.js";class a extends e{static async fromLabelSchema(e,s){const r=s.classes.map((async a=>{const s=await e.createMeshWriters(a.meshes);return{minScale:a.minScale,maxScale:a.maxScale,meshes:s,expression:null,where:await e.storage.createWhereClause(a.where)}})),t=await Promise.all(r);return new a(t)}constructor(e){super(),this._labels=e}match(e,a,s){if(!this._labels.length)return null;const r=this._getLabels(a.$view.scale),t=[];for(const l of r)l.where&&!l.where(e,s)||t.push(...l.meshes);return t}_getLabels(e){return this._labels.filter((a=>this._validForTileScale(a,e)))}_validForTileScale(e,a){const s=a-a/4,r=a+a/2;return(!e.minScale||e.minScale>=s)&&(!e.maxScale||e.maxScale<=r)}}export{a as LabelMatcher};
5
+ import{FeatureMatcher as e}from"./Matcher.js";class s extends e{static async fromLabelSchema(e,a){const r=a.classes.map((async s=>{const a=await e.createMeshWriters(s.meshes);return{minScale:s.minScale,maxScale:s.maxScale,meshes:a,expression:null,where:await e.storage.createWhereClause(s.where)}})),t=await Promise.all(r);return new s(t)}constructor(e){super(),this._labels=e}match(e,s,a){if(!this._labels.length)return null;const r=this._getLabels(s.$view.scale),t=[];for(const l of r)l.where&&!l.where(e,a)||t.push(...l.meshes);return t}hasArcadeDependency(e){return this._labels.some((s=>s.meshes.some((s=>s.hasArcadeDependency(e)))))}_getLabels(e){return this._labels.filter((s=>this._validForTileScale(s,e)))}_validForTileScale(e,s){const a=s-s/4,r=s+s/2;return(!e.minScale||e.minScale>=a)&&(!e.maxScale||e.maxScale<=r)}}export{s as LabelMatcher};
@@ -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{internalTrackPartField as t,TrackPart as e}from"../../../../../layers/support/streamLayerUtils.js";import{DictionaryMatcher as r}from"./DictionaryMatcher.js";import{IntervalMatcher as a}from"./IntervalMatcher.js";import{LabelMatcher as s}from"./LabelMatcher.js";import{MapMatcher as c}from"./MapMatcher.js";import{FeatureMatcher as n}from"./Matcher.js";async function i(t,e){switch(e.type){case"simple":case"heatmap":case"dot-density":case"pie-chart":return n.from(t,e);case"interval":return a.fromIntervalSchema(t,e);case"dictionary":return r.fromDictionaryRenderer(t,e);case"label":return s.fromLabelSchema(t,e);case"map":return c.fromMatcherSchema(t,e);case"subtype":return o.fromSubtypes(t,e);case"cluster":return h.fromClusterSchema(t,e);case"track":return u.fromTrackSchema(t,e);default:throw new Error("Impl")}}class o extends n{constructor(t,e){super(),this._subMatchers=t,this._subtypeField=e}static async fromSubtypes(t,e){const r=new Map,a=[];for(const s in e.renderers){const c=parseInt(s,10),n=i(t,e.renderers[s]).then((t=>r.set(c,t)));a.push(n)}return await Promise.all(a),new o(r,e.subtypeField)}match(t,e,r){const a=t.readAttribute(this._subtypeField),s=this._subMatchers.get(a);return s?s.match(t,e,r):null}}class h extends n{static async fromClusterSchema(t,e){const[r,a]=await Promise.all([i(t,e.feature),i(t,e.cluster)]);return new h(r,a)}constructor(t,e){super(),this._featureMatcher=t,this._clusterMatcher=e}match(t,e,r){return 1===t.readAttribute("cluster_count")?this._featureMatcher.match(t,e,r):this._clusterMatcher.match(t,e,r)}}class u extends n{static async fromTrackSchema(t,e){const[r,a,s]=await Promise.all([i(t,e.previousObservation),i(t,e.latestObservation),i(t,e.trackLine)]);return new u(r,a,s)}constructor(t,e,r){super(),this._previousObservationMatcher=t,this._latestObservationMatcher=e,this._trackLineMatcher=r}match(r,a,s){switch(r.readAttribute(t)){case e.TrackLine:return this._trackLineMatcher.match(r,a,s);case e.LatestObservation:return this._latestObservationMatcher.match(r,a,s);case e.PreviousObservation:return this._previousObservationMatcher.match(r,a,s)}return null}}export{h as ClusterMatcher,o as SubtypeMatcher,i as createMatcher};
5
+ import{internalTrackPartField as e,TrackPart as t}from"../../../../../layers/support/streamLayerUtils.js";import{DictionaryMatcher as r}from"./DictionaryMatcher.js";import{IntervalMatcher as a}from"./IntervalMatcher.js";import{LabelMatcher as s}from"./LabelMatcher.js";import{MapMatcher as c}from"./MapMatcher.js";import{FeatureMatcher as n}from"./Matcher.js";async function i(e,t){switch(t.type){case"simple":case"heatmap":case"dot-density":case"pie-chart":return n.from(e,t);case"interval":return a.fromIntervalSchema(e,t);case"dictionary":return r.fromDictionaryRenderer(e,t);case"label":return s.fromLabelSchema(e,t);case"map":return c.fromMatcherSchema(e,t);case"subtype":return h.fromSubtypes(e,t);case"cluster":return o.fromClusterSchema(e,t);case"track":return u.fromTrackSchema(e,t);default:throw new Error("Impl")}}class h extends n{constructor(e,t){super(),this._subMatchers=e,this._subtypeField=t}static async fromSubtypes(e,t){const r=new Map,a=[];for(const s in t.renderers){const c=parseInt(s,10),n=i(e,t.renderers[s]).then((e=>r.set(c,e)));a.push(n)}return await Promise.all(a),new h(r,t.subtypeField)}match(e,t,r){const a=e.readAttribute(this._subtypeField),s=this._subMatchers.get(a);return s?s.match(e,t,r):null}hasArcadeDependency(e){for(const t of this._subMatchers.values())if(t.hasArcadeDependency(e))return!0;return!1}}class o extends n{static async fromClusterSchema(e,t){const[r,a]=await Promise.all([i(e,t.feature),i(e,t.cluster)]);return new o(r,a)}constructor(e,t){super(),this._featureMatcher=e,this._clusterMatcher=t}match(e,t,r){return 1===e.readAttribute("cluster_count")?this._featureMatcher.match(e,t,r):this._clusterMatcher.match(e,t,r)}hasArcadeDependency(e){return this._featureMatcher.hasArcadeDependency(e)||this._clusterMatcher.hasArcadeDependency(e)}}class u extends n{static async fromTrackSchema(e,t){const[r,a,s]=await Promise.all([i(e,t.previousObservation),i(e,t.latestObservation),i(e,t.trackLine)]);return new u(r,a,s)}constructor(e,t,r){super(),this._previousObservationMatcher=e,this._latestObservationMatcher=t,this._trackLineMatcher=r}match(r,a,s){switch(r.readAttribute(e)){case t.TrackLine:return this._trackLineMatcher.match(r,a,s);case t.LatestObservation:return this._latestObservationMatcher.match(r,a,s);case t.PreviousObservation:return this._previousObservationMatcher.match(r,a,s)}return null}hasArcadeDependency(e){return this._trackLineMatcher.hasArcadeDependency(e)||this._latestObservationMatcher.hasArcadeDependency(e)||this._previousObservationMatcher.hasArcadeDependency(e)}}export{o as ClusterMatcher,h as SubtypeMatcher,i as createMatcher};
@@ -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 has from"../../../../../core/has.js";import{clone as e}from"../../../../../core/lang.js";import{floatEqualAbsolute as t}from"../../../../../core/mathUtils.js";import{sqlAnd as r}from"../../../../../core/sql.js";import{isHostedAgolService as s}from"../../../../../layers/support/arcgisLayerUrl.js";import a from"../../../../../layers/support/FeatureFilter.js";import{exceedsMinimumSnapshotCoverage as i}from"./featureServiceUtils.js";import{addFloorFilter as o,hasFloorFilter as l}from"./floorFilterUtils.js";import{getServiceGeometryType as n}from"./geometryUtils.js";import{getLayerDeconflictionEnabled as p}from"./labelingUtils.js";import{createFeatureSourceSchema as u}from"../schema/SourceSchema.js";import{createSubtypeProcessorSchema as m}from"../schema/processor/SubtypeProcessorSchema.js";class y{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){return[{vvEvaluators:{},deconflictionEnabled:this.layer.sublayers.every((e=>p(e)))}]}async createServiceOptions(t){const r=this.layer,{capabilities:a,datesInUnknownTimezone:o,dateFieldsTimeZone:l,editingInfo:p,globalIdField:u,objectIdField:m,refreshInterval:y,subtypeField:c}=r,d=r.fieldsIndex.toJSON(),h=n(r),f=r.timeInfo?.toJSON(),b=r.spatialReference.toJSON(),S=e(this.layer.parsedUrl),g=m,F=!(null!=p?.lastEditDate)&&y>0,x=!!has("featurelayer-snapshot-enabled")&&"point"===r.geometryType&&a?.query.supportsPagination&&!a?.operations.supportsEditing&&!F,I=x&&i(t,r.fullExtent),j=s(S.path),R=t.spatialReference.toJSON();return{type:"feature-service",source:S,isSourceHosted:j,orderByFields:g,outSpatialReference:R,metadata:{timeReferenceUnknownClient:o,dateFieldsTimeZone:l,subtypeField:c,globalIdField:u,fieldsIndex:d,geometryType:h,objectIdField:m,timeInfo:f,spatialReference:b,outSpatialReference:R,subtypes:this.layer.subtypes?.map((e=>e.toJSON())),typeIdField:null,types:null},queryMetadata:{maxRecordCount:a.query.maxRecordCount,supportsCompactGeometry:a.query.supportsCompactGeometry,supportsDefaultSpatialReference:a.query.supportsDefaultSpatialReference,supportsFormatPBF:a.query.supportsFormatPBF,supportsMaxRecordCountFactor:a.query.supportsMaxRecordCountFactor,supportsQuantization:a.query.supportsQuantization,lastEditDate:p?.lastEditDate?.getTime(),snapshotInfo:{supportsSnapshotMinThreshold:x,supportsSnapshotMaxThreshold:I,snapshotCountThresholds:{min:has("featurelayer-snapshot-point-min-threshold"),max:has("featurelayer-snapshot-point-max-threshold")}}}}}createSourceSchema(e,t){const{definitionExpression:r,customParameters:s,gdbVersion:a,historicMoment:i,subtypeField:o,timeExtent:l,apiKey:n,displayFilterInfo:p}=this.layer,m={queryScaleRanges:this.layer.sublayers.items.map((e=>({subtypeCode:e.subtypeCode,minScale:e.minScale,maxScale:e.maxScale}))),definitionExpression:r,displayFilterInfo:p,customParameters:s,gdbVersion:a,historicMoment:i,subtypeField:o,timeExtent:l};return u(m,e,t,n)}createProcessorSchema(e,t,r){const s={subtypeField:this.layer.subtypeField,sublayers:Array.from(this.layer.sublayers,(e=>({featureReduction:null,geometryType:this.layer.geometryType,labelingInfo:e.labelingInfo,labelsVisible:e.labelsVisible,renderer:e.renderer,subtypeCode:e.subtypeCode,orderBy:null})))};return m(e,t,s,r)}addFilters(e,t){e=o(this.layer,e,t);const s=this.layer.sublayers.filter((e=>!c(e,t))).map((e=>e.subtypeCode));if(!s.length)return e;e??=new a;const i=`NOT ${this.layer.subtypeField} IN (${s.join(",")})`;return e.where=r(e.where,i),e}get hasRequiredSupport(){return!0}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>l(this.layer,e)?e.floors:null,()=>this.layer.outFields,()=>this.layer.gdbVersion,()=>this.layer.historicMoment,()=>this.layer.sublayers.map((({renderer:e,labelsVisible:t,labelingInfo:r,visible:s,minScale:a,maxScale:i})=>({renderer:e,labelsVisible:t,labelingInfo:r,visible:s,minScale:a,maxScale:i})))]}setGraphicOrigin(e){const t=this.layer.fieldsIndex.get(this.layer.subtypeField),r=e.attributes[t.name],s=this.layer.sublayers.find((e=>e.subtypeCode===r));e.layer=e.sourceLayer=s}}function c(e,r){return e.visible&&(0===e.minScale||t(r.scale,e.minScale)||r.scale<e.minScale)&&(0===e.maxScale||t(r.scale,e.maxScale)||r.scale>e.maxScale)}export{y as SubtypeGroupLayerAdapter};
5
+ import has from"../../../../../core/has.js";import{clone as e}from"../../../../../core/lang.js";import{floatEqualAbsolute as t}from"../../../../../core/mathUtils.js";import{sqlAnd as r}from"../../../../../core/sql.js";import{isHostedAgolService as s}from"../../../../../layers/support/arcgisLayerUrl.js";import a from"../../../../../layers/support/FeatureFilter.js";import{exceedsMinimumSnapshotCoverage as i}from"./featureServiceUtils.js";import{addFloorFilter as o,hasFloorFilter as l}from"./floorFilterUtils.js";import{getServiceGeometryType as n}from"./geometryUtils.js";import{getLayerDeconflictionEnabled as p}from"./labelingUtils.js";import{createFeatureSourceSchema as u}from"../schema/SourceSchema.js";import{createSubtypeProcessorSchema as m}from"../schema/processor/SubtypeProcessorSchema.js";class y{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){return[{vvEvaluators:{},deconflictionEnabled:this.layer.sublayers.some((e=>p(e)))}]}async createServiceOptions(t){const r=this.layer,{capabilities:a,datesInUnknownTimezone:o,dateFieldsTimeZone:l,editingInfo:p,globalIdField:u,objectIdField:m,refreshInterval:y,subtypeField:c}=r,d=r.fieldsIndex.toJSON(),h=n(r),f=r.timeInfo?.toJSON(),b=r.spatialReference.toJSON(),S=e(this.layer.parsedUrl),g=m,F=!(null!=p?.lastEditDate)&&y>0,x=!!has("featurelayer-snapshot-enabled")&&"point"===r.geometryType&&a?.query.supportsPagination&&!a?.operations.supportsEditing&&!F,I=x&&i(t,r.fullExtent),j=s(S.path),R=t.spatialReference.toJSON();return{type:"feature-service",source:S,isSourceHosted:j,orderByFields:g,outSpatialReference:R,metadata:{timeReferenceUnknownClient:o,dateFieldsTimeZone:l,subtypeField:c,globalIdField:u,fieldsIndex:d,geometryType:h,objectIdField:m,timeInfo:f,spatialReference:b,outSpatialReference:R,subtypes:this.layer.subtypes?.map((e=>e.toJSON())),typeIdField:null,types:null},queryMetadata:{maxRecordCount:a.query.maxRecordCount,supportsCompactGeometry:a.query.supportsCompactGeometry,supportsDefaultSpatialReference:a.query.supportsDefaultSpatialReference,supportsFormatPBF:a.query.supportsFormatPBF,supportsMaxRecordCountFactor:a.query.supportsMaxRecordCountFactor,supportsQuantization:a.query.supportsQuantization,lastEditDate:p?.lastEditDate?.getTime(),snapshotInfo:{supportsSnapshotMinThreshold:x,supportsSnapshotMaxThreshold:I,snapshotCountThresholds:{min:has("featurelayer-snapshot-point-min-threshold"),max:has("featurelayer-snapshot-point-max-threshold")}}}}}createSourceSchema(e,t){const{definitionExpression:r,customParameters:s,gdbVersion:a,historicMoment:i,subtypeField:o,timeExtent:l,apiKey:n,displayFilterInfo:p}=this.layer,m={queryScaleRanges:this.layer.sublayers.items.map((e=>({subtypeCode:e.subtypeCode,minScale:e.minScale,maxScale:e.maxScale}))),definitionExpression:r,displayFilterInfo:p,customParameters:s,gdbVersion:a,historicMoment:i,subtypeField:o,timeExtent:l};return u(m,e,t,n)}createProcessorSchema(e,t,r){const s={subtypeField:this.layer.subtypeField,sublayers:Array.from(this.layer.sublayers,(e=>({featureReduction:null,geometryType:this.layer.geometryType,labelingInfo:e.labelingInfo,labelsVisible:e.labelsVisible,renderer:e.renderer,subtypeCode:e.subtypeCode,orderBy:null})))};return m(e,t,s,r)}addFilters(e,t){e=o(this.layer,e,t);const s=this.layer.sublayers.filter((e=>!c(e,t))).map((e=>e.subtypeCode));if(!s.length)return e;e??=new a;const i=`NOT ${this.layer.subtypeField} IN (${s.join(",")})`;return e.where=r(e.where,i),e}get hasRequiredSupport(){return!0}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>l(this.layer,e)?e.floors:null,()=>this.layer.outFields,()=>this.layer.gdbVersion,()=>this.layer.historicMoment,()=>this.layer.sublayers.map((({renderer:e,labelsVisible:t,labelingInfo:r,visible:s,minScale:a,maxScale:i})=>({renderer:e,labelsVisible:t,labelingInfo:r,visible:s,minScale:a,maxScale:i})))]}setGraphicOrigin(e){const t=this.layer.fieldsIndex.get(this.layer.subtypeField),r=e.attributes[t.name],s=this.layer.sublayers.find((e=>e.subtypeCode===r));e.layer=e.sourceLayer=s}}function c(e,r){return e.visible&&(0===e.minScale||t(r.scale,e.minScale)||r.scale<e.minScale)&&(0===e.maxScale||t(r.scale,e.maxScale)||r.scale>e.maxScale)}export{y as SubtypeGroupLayerAdapter};
@@ -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{watch as r,initial as i}from"../../../../../../core/reactiveUtils.js";import{property as o}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";import{TileKey as n}from"../../../../../../layers/support/TileKey.js";import{distanceToTile as l}from"../../../../../interactive/snapping/featureSources/featureServiceSource/tileUtils.js";let c=class extends t{get tiles(){const e=this.tilesCoveringView,t=this._effectivePointOfInterest;if(null!=t){const r=e.map((e=>l(t,e)));for(let i=1;i<r.length;i++)if(r[i-1]>r[i])return e.sort(((e,r)=>l(t,e)-l(t,r))),e.slice()}return e}get tilesCoveringView(){return(this.view.featureTiles?.tiles?.toArray()??[]).map(p)}get tileInfo(){return this.view.featureTiles?.tilingScheme?.toTileInfo()??null}get tileSize(){return this.view.featureTiles?.tileSize??256}get _effectivePointOfInterest(){const e=this.pointOfInterest;return null!=e?e:this.view.pointsOfInterest?.focus.location}constructor(e){super(e),this.pointOfInterest=null}initialize(){this.addHandles(r((()=>this.view.featureTiles),(e=>{this.removeHandles(a),e&&this.addHandles(e.addClient(),a)}),i))}};function p({lij:[e,t,r],extent:i}){return new n(`${e}/${t}/${r}`,e,t,r,i)}e([o({readOnly:!0})],c.prototype,"tiles",null),e([o({readOnly:!0})],c.prototype,"tilesCoveringView",null),e([o({readOnly:!0})],c.prototype,"tileInfo",null),e([o({readOnly:!0})],c.prototype,"tileSize",null),e([o({constructOnly:!0})],c.prototype,"view",void 0),e([o()],c.prototype,"pointOfInterest",void 0),e([o()],c.prototype,"_effectivePointOfInterest",null),c=e([s("esri.views.3d.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiles3D")],c);const a="feature-tiles";export{c as FeatureServiceTiles3D};
5
+ import{_ as e}from"../../../../../../chunks/tslib.es6.js";import t from"../../../../../../core/Accessor.js";import{equals as r}from"../../../../../../core/arrayUtils.js";import{watch as i,initial as s}from"../../../../../../core/reactiveUtils.js";import{property as o}from"../../../../../../core/accessorSupport/decorators/property.js";import"../../../../../../core/has.js";import"../../../../../../core/Logger.js";import{subclass as n}from"../../../../../../core/accessorSupport/decorators/subclass.js";import{TileKey as l}from"../../../../../../layers/support/TileKey.js";import{distanceToTile as p}from"../../../../../interactive/snapping/featureSources/featureServiceSource/tileUtils.js";let a=class extends t{get _sortedTilesCoveringView(){const e=(this.view.featureTiles?.tiles?.toArray()??[]).map(c),t=this._effectivePointOfInterest;return null!=t&&e.sort(((e,r)=>p(t,e)-p(t,r))),e}get tileInfo(){return this.view.featureTiles?.tilingScheme?.toTileInfo()??null}get tileSize(){return this.view.featureTiles?.tileSize??256}get _effectivePointOfInterest(){const e=this.pointOfInterest;return null!=e?e:this.view.pointsOfInterest?.focus.location}constructor(e){super(e),this.tiles=[],this.pointOfInterest=null}initialize(){this.addHandles([i((()=>this.view.featureTiles),(e=>{this.removeHandles(u),e&&this.addHandles(e.addClient(),u)}),s),i((()=>this._sortedTilesCoveringView),(e=>this._set("tiles",e)),{initial:!0,equals:(e,t)=>r(e,t,((e,t)=>e.id===t.id))})])}};function c({lij:[e,t,r],extent:i}){return new l(`${e}/${t}/${r}`,e,t,r,i)}e([o({readOnly:!0})],a.prototype,"tiles",void 0),e([o({readOnly:!0})],a.prototype,"_sortedTilesCoveringView",null),e([o({readOnly:!0})],a.prototype,"tileInfo",null),e([o({readOnly:!0})],a.prototype,"tileSize",null),e([o({constructOnly:!0})],a.prototype,"view",void 0),e([o()],a.prototype,"pointOfInterest",void 0),e([o()],a.prototype,"_effectivePointOfInterest",null),a=e([n("esri.views.3d.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiles3D")],a);const u="feature-tiles";export{a as FeatureServiceTiles3D};