@arcgis/core 4.28.0-next.20231002 → 4.28.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (257) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/02120d192eafd7612475.js +1 -0
  3. package/assets/esri/core/workers/chunks/{4d967e98d229f18d61f5.js → 09e8babe75407c2e64c4.js} +1 -1
  4. package/assets/esri/core/workers/chunks/0beebbb0c6dad0e742d7.js +1 -0
  5. package/assets/esri/core/workers/chunks/0d8ca51043c7784aed96.js +1 -0
  6. package/assets/esri/core/workers/chunks/112e89da628bdea5355c.js +1 -0
  7. package/assets/esri/core/workers/chunks/{5e9edd06e624f385fa4b.js → 121a9e148509f2fe2210.js} +1 -1
  8. package/assets/esri/core/workers/chunks/1856d16d738f44f58084.js +1 -0
  9. package/assets/esri/core/workers/chunks/{0526d623d0b4c12929bd.js → 18ab9cc85a1a7988fdfd.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{7c960a2694c4c3123acf.js → 1a36703ebe934749646e.js} +1 -1
  11. package/assets/esri/core/workers/chunks/24a0cf405195421c0d06.js +1 -0
  12. package/assets/esri/core/workers/chunks/24ff267cf253feac22de.js +1 -0
  13. package/assets/esri/core/workers/chunks/{3c8613596659801fd6ab.js → 29cab345819ec02ed60a.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{169a61c6e128b8a16021.js → 2c560a075d9ef2069ed1.js} +1 -1
  15. package/assets/esri/core/workers/chunks/2f8e71dac98135bbc3e6.js +1 -0
  16. package/assets/esri/core/workers/chunks/341fb51b2165522963b3.js +1 -0
  17. package/assets/esri/core/workers/chunks/{ad8e0f82cb1feafa9e2f.js → 36ab90fb34b9716a9983.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{2688213bbff536da7917.js → 3ea0b872436fce84b927.js} +1 -1
  19. package/assets/esri/core/workers/chunks/40633064c290dc2af9ea.js +1 -0
  20. package/assets/esri/core/workers/chunks/42ec4c80b0c2944cd65c.js +1 -0
  21. package/assets/esri/core/workers/chunks/44b870cb53ba68b17c32.js +1 -0
  22. package/assets/esri/core/workers/chunks/{8a7fa4e8b0d14da7c9eb.js → 4cc680fe4c9c39d2f853.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{6730c9f0890191a95fdb.js → 4d81aa50d90f5701a343.js} +1 -1
  24. package/assets/esri/core/workers/chunks/4e0bf30da4281070e453.js +1 -0
  25. package/assets/esri/core/workers/chunks/4e6bf1efe3b0b474cbb4.js +1 -0
  26. package/assets/esri/core/workers/chunks/52cef7cd3aaaa4f45c94.js +1 -0
  27. package/assets/esri/core/workers/chunks/{4e04242e707c0eb3aa4a.js → 5a3ccc0a19ac8fa9e524.js} +1 -1
  28. package/assets/esri/core/workers/chunks/5e907ec0ee1565b5fbbc.js +1 -0
  29. package/assets/esri/core/workers/chunks/66ba749ab0a631bbfdec.js +1 -0
  30. package/assets/esri/core/workers/chunks/6b14d89d689a21014aec.js +1 -0
  31. package/assets/esri/core/workers/chunks/6b1856303d1562f05100.js +1 -0
  32. package/assets/esri/core/workers/chunks/{576269fd1f9049876aa1.js → 6b7b5544ed1f9a84623f.js} +1 -1
  33. package/assets/esri/core/workers/chunks/710a6268de62003af825.js +1 -0
  34. package/assets/esri/core/workers/chunks/77923afde29ae1ff10ca.js +1 -0
  35. package/assets/esri/core/workers/chunks/784ffd52315a4d55d683.js +1 -0
  36. package/assets/esri/core/workers/chunks/7cf7f2b991a7cbdad2ce.js +1 -0
  37. package/assets/esri/core/workers/chunks/{70dffbf49b0633b1a5f1.js → 8f3680fee85a05839489.js} +1 -1
  38. package/assets/esri/core/workers/chunks/97aecf210938015cc7a3.js +1 -0
  39. package/assets/esri/core/workers/chunks/{c7ebd5d431fb996bfcee.js → 9f8207c82a17508a87a8.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{557305b91f77569ce664.js → a01ffe03b1465c21b9e6.js} +1 -1
  41. package/assets/esri/core/workers/chunks/a298c9031962951e55a9.js +1 -0
  42. package/assets/esri/core/workers/chunks/{329669a9beda89b028dd.js → a5a7bbdd8298016535bc.js} +1 -1
  43. package/assets/esri/core/workers/chunks/a877a4826cd6a46ec99b.js +1 -0
  44. package/assets/esri/core/workers/chunks/ad38e456a7cee940a165.js +1 -0
  45. package/assets/esri/core/workers/chunks/adfbc168be8c49b51e1b.js +1 -0
  46. package/assets/esri/core/workers/chunks/b0526633a93ef69ec47b.js +1 -0
  47. package/assets/esri/core/workers/chunks/b99bc08a01e9250b0a31.js +1 -0
  48. package/assets/esri/core/workers/chunks/{36c4b4c3eca57417da2c.js → c260ad3434bb00ba64a7.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{39922ce232338de076ae.js → c459c8d8630eb4b955b1.js} +1 -1
  50. package/assets/esri/core/workers/chunks/c92e75b79aff7b505b31.js +1 -0
  51. package/assets/esri/core/workers/chunks/ca85e88dad30b5f2956b.js +1 -0
  52. package/assets/esri/core/workers/chunks/{8e56d40691b6bf75d7cc.js → ce409944221a784ddb61.js} +1 -1
  53. package/assets/esri/core/workers/chunks/d13f75f233cf313e5a1d.js +1 -0
  54. package/assets/esri/core/workers/chunks/d60d5f006375f7fcc88c.js +1 -0
  55. package/assets/esri/core/workers/chunks/{77958089748dc31757cf.js → d6ded127949160103f69.js} +1 -1
  56. package/assets/esri/core/workers/chunks/d8c696da42f8f8919b83.js +1 -0
  57. package/assets/esri/core/workers/chunks/{304c81f6297ecba3a324.js → d95eed98316e59f8f35d.js} +1 -1
  58. package/assets/esri/core/workers/chunks/df7267892b6e0493e1d7.js +1 -0
  59. package/assets/esri/core/workers/chunks/{52dca349e1a45555954d.js → e52d5a48e83d8df36f92.js} +1 -1
  60. package/assets/esri/core/workers/chunks/e8688b6cc3b3c1010b43.js +1 -0
  61. package/assets/esri/core/workers/chunks/e8c7cc974420c0b92d0e.js +1 -0
  62. package/assets/esri/core/workers/chunks/{b7ef554b1213307499fc.js → e93442c6d92229f3a4b0.js} +1 -1
  63. package/assets/esri/core/workers/chunks/{ef5772ca1848d6d01b88.js → eda86faa708cfe4c9f9a.js} +1 -1
  64. package/assets/esri/core/workers/chunks/f2718e260f594537f7fd.js +1 -0
  65. package/assets/esri/core/workers/chunks/f6b7036114b1d754fdd9.js +1 -0
  66. package/assets/esri/core/workers/chunks/{c4631241dc777ca77aaa.js → f6c0680c535c5a3c73ee.js} +1 -1
  67. package/assets/esri/core/workers/chunks/{a0ea1d3e22d52b8a59a8.js → fa6103e3d4e857b0035b.js} +9 -9
  68. package/assets/esri/core/workers/chunks/fac3e57784d7f37053af.js +1 -0
  69. package/assets/esri/geometry/support/pe-wasm.wasm +0 -0
  70. package/assets/esri/t9n/common.json +1 -1
  71. package/assets/esri/t9n/common_ar.json +1 -1
  72. package/assets/esri/t9n/common_bg.json +1 -1
  73. package/assets/esri/t9n/common_bs.json +1 -1
  74. package/assets/esri/t9n/common_ca.json +1 -1
  75. package/assets/esri/t9n/common_cs.json +1 -1
  76. package/assets/esri/t9n/common_da.json +1 -1
  77. package/assets/esri/t9n/common_de.json +1 -1
  78. package/assets/esri/t9n/common_el.json +1 -1
  79. package/assets/esri/t9n/common_en.json +1 -1
  80. package/assets/esri/t9n/common_es.json +1 -1
  81. package/assets/esri/t9n/common_et.json +1 -1
  82. package/assets/esri/t9n/common_fi.json +1 -1
  83. package/assets/esri/t9n/common_fr.json +1 -1
  84. package/assets/esri/t9n/common_he.json +1 -1
  85. package/assets/esri/t9n/common_hr.json +1 -1
  86. package/assets/esri/t9n/common_hu.json +1 -1
  87. package/assets/esri/t9n/common_id.json +1 -1
  88. package/assets/esri/t9n/common_it.json +1 -1
  89. package/assets/esri/t9n/common_ja.json +1 -1
  90. package/assets/esri/t9n/common_ko.json +1 -1
  91. package/assets/esri/t9n/common_lt.json +1 -1
  92. package/assets/esri/t9n/common_lv.json +1 -1
  93. package/assets/esri/t9n/common_nb.json +1 -1
  94. package/assets/esri/t9n/common_nl.json +1 -1
  95. package/assets/esri/t9n/common_pl.json +1 -1
  96. package/assets/esri/t9n/common_pt-BR.json +1 -1
  97. package/assets/esri/t9n/common_pt-PT.json +1 -1
  98. package/assets/esri/t9n/common_ro.json +1 -1
  99. package/assets/esri/t9n/common_ru.json +1 -1
  100. package/assets/esri/t9n/common_sk.json +1 -1
  101. package/assets/esri/t9n/common_sl.json +1 -1
  102. package/assets/esri/t9n/common_sr.json +1 -1
  103. package/assets/esri/t9n/common_sv.json +1 -1
  104. package/assets/esri/t9n/common_th.json +1 -1
  105. package/assets/esri/t9n/common_tr.json +1 -1
  106. package/assets/esri/t9n/common_uk.json +1 -1
  107. package/assets/esri/t9n/common_vi.json +1 -1
  108. package/assets/esri/t9n/common_zh-CN.json +1 -1
  109. package/assets/esri/t9n/common_zh-HK.json +1 -1
  110. package/assets/esri/t9n/common_zh-TW.json +1 -1
  111. package/assets/esri/themes/base/widgets/_DirectionalPad.scss +2 -1
  112. package/assets/esri/themes/base/widgets/_FeatureForm.scss +0 -1
  113. package/assets/esri/themes/dark/main.css +1 -1
  114. package/assets/esri/themes/light/main.css +1 -1
  115. package/assets/esri/themes/light/view.css +1 -1
  116. package/chunks/pe-wasm.js +1 -1
  117. package/config.js +1 -1
  118. package/core/pbf.js +1 -1
  119. package/geometry/support/WKIDUnitConversion.js +1 -1
  120. package/geometry/support/plane.js +1 -1
  121. package/interfaces.d.ts +37 -39
  122. package/kernel.js +1 -1
  123. package/layers/GroupLayer.js +1 -1
  124. package/layers/SceneLayer.js +1 -1
  125. package/layers/graphics/data/QueryEngine.js +1 -1
  126. package/layers/graphics/data/QueryEngineResult.js +1 -1
  127. package/layers/graphics/editingSupport.js +1 -1
  128. package/layers/graphics/sources/WFSSourceWorker.js +1 -1
  129. package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
  130. package/layers/graphics/sources/support/CSVSourceWorker.js +1 -1
  131. package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
  132. package/layers/mixins/OperationalLayer.js +1 -1
  133. package/layers/save/featureLayerUtils.js +1 -1
  134. package/layers/save/groupLayerUtils.js +5 -0
  135. package/layers/save/utils.js +1 -1
  136. package/layers/support/LayerLoadContext.js +5 -0
  137. package/layers/support/featureLayerUtils.js +1 -1
  138. package/layers/support/labelFormatUtils.js +1 -1
  139. package/layers/support/layersCreator.js +1 -1
  140. package/layers/support/versionUtils.js +1 -1
  141. package/networks/UtilityNetwork.js +1 -1
  142. package/package.json +1 -1
  143. package/portal/schemas/definitions.js +1 -1
  144. package/portal/support/jsonContext.js +1 -1
  145. package/portal/support/layersLoader.js +1 -1
  146. package/portal/support/loadUtils.js +5 -0
  147. package/portal/support/portalItemUtils.js +1 -1
  148. package/portal/support/portalLayers.js +1 -1
  149. package/renderers/support/RasterSymbolizer.js +1 -1
  150. package/rest/print.js +1 -1
  151. package/support/basemapUtils.js +1 -1
  152. package/support/revision.js +1 -1
  153. package/symbols/PolygonSymbol3D.js +1 -1
  154. package/views/2d/engine/imagery/RasterBitmap.js +1 -1
  155. package/views/2d/engine/imagery/colorizer/shadedrelief.js +1 -1
  156. package/views/2d/engine/imagery/colorizer/stretch.js +1 -1
  157. package/views/2d/input/handlers/KeyPan.js +1 -1
  158. package/views/2d/input/handlers/KeyRotate.js +1 -1
  159. package/views/2d/interactive/editingTools/draw/DrawGraphicTool2D.js +1 -1
  160. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  161. package/views/2d/layers/features/support/FeatureSetReaderPBFIndirect.js +1 -1
  162. package/views/3d/input/handlers/KeyboardNavigation.js +1 -1
  163. package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
  164. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  165. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  166. package/views/3d/layers/graphics/Graphics3DMeshObject3DGraphicLayer.js +1 -1
  167. package/views/3d/layers/i3s/featureEditing.js +1 -1
  168. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  169. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  170. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  171. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  172. package/views/3d/webgl-engine/parts/ScreenshotManager.js +1 -1
  173. package/views/DOMContainer.js +1 -1
  174. package/views/draw/DrawGraphicTool.js +1 -1
  175. package/views/draw/DrawOperation.js +1 -1
  176. package/views/draw/support/Box.js +1 -1
  177. package/views/draw/support/Reshape.js +1 -1
  178. package/views/input/VisibilityChange.js +5 -0
  179. package/views/interactive/sketch/constraints.js +1 -1
  180. package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
  181. package/views/interactive/snapping/FeatureSnappingSourceInfo.js +5 -0
  182. package/views/interactive/snapping/SnappingContext.js +1 -1
  183. package/views/interactive/snapping/SnappingDragPipelineStep.js +1 -1
  184. package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
  185. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js +1 -1
  186. package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorkerHandle.js +1 -1
  187. package/views/interactive/snapping/snappingUtils.js +1 -1
  188. package/webdoc/support/saveUtils.js +1 -1
  189. package/webdoc/webdocSaveUtils.js +1 -1
  190. package/widgets/DirectionalPad/DirectionalPadViewModel.js +1 -1
  191. package/widgets/DirectionalPad/constants.js +1 -1
  192. package/widgets/DirectionalPad.js +1 -1
  193. package/widgets/Editor/Upload.js +1 -1
  194. package/widgets/Editor/workflowUtils.js +1 -1
  195. package/widgets/ElevationProfile/support/chartUtils.js +1 -1
  196. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  197. package/widgets/FeatureForm/FieldInput.js +1 -1
  198. package/widgets/FeatureForm/FormExpressionsManager.js +1 -1
  199. package/widgets/FeatureForm/featureFormUtils.js +1 -1
  200. package/widgets/FeatureForm.js +1 -1
  201. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  202. package/widgets/FeatureTable/FieldColumn.js +1 -1
  203. package/widgets/FeatureTable/Grid/Column.js +1 -1
  204. package/widgets/FeatureTable.js +1 -1
  205. package/widgets/ScaleRangeSlider.js +1 -1
  206. package/widgets/support/DatePicker.js +1 -1
  207. package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
  208. package/widgets/support/Selector2D/SelectionOperation2D.js +1 -1
  209. package/widgets/support/Selector2D.js +1 -1
  210. package/widgets/support/TimePicker.js +1 -1
  211. package/widgets/support/dateUtils.js +1 -1
  212. package/assets/esri/core/workers/chunks/027f8b57565c65fbccda.js +0 -1
  213. package/assets/esri/core/workers/chunks/048265fb5953350e3e33.js +0 -1
  214. package/assets/esri/core/workers/chunks/0b9cf14f8aafb76c578b.js +0 -1
  215. package/assets/esri/core/workers/chunks/0ebf58c927bfc4c9d4fe.js +0 -1
  216. package/assets/esri/core/workers/chunks/10fd951bd296b2beeeba.js +0 -1
  217. package/assets/esri/core/workers/chunks/1224475f3eefdfd59c76.js +0 -1
  218. package/assets/esri/core/workers/chunks/162b0220e24e9ba72655.js +0 -1
  219. package/assets/esri/core/workers/chunks/1e611cad53b745ee146f.js +0 -1
  220. package/assets/esri/core/workers/chunks/24b1bf1a5d80f43a6c9a.js +0 -1
  221. package/assets/esri/core/workers/chunks/29ed31fd4f9d5cf53686.js +0 -1
  222. package/assets/esri/core/workers/chunks/2b6d1c8e4ed759767827.js +0 -1
  223. package/assets/esri/core/workers/chunks/34b44b0fab88f838885c.js +0 -1
  224. package/assets/esri/core/workers/chunks/364f55294a1d7bf163d7.js +0 -1
  225. package/assets/esri/core/workers/chunks/3714ab435dd5ccf9e694.js +0 -1
  226. package/assets/esri/core/workers/chunks/3788009a5ece453011f3.js +0 -1
  227. package/assets/esri/core/workers/chunks/3aafe8160b3bfbaa6935.js +0 -1
  228. package/assets/esri/core/workers/chunks/41c002e4c42c581cda8d.js +0 -1
  229. package/assets/esri/core/workers/chunks/47be4c75dd6372b96fe4.js +0 -1
  230. package/assets/esri/core/workers/chunks/4e8d1e6051f6654a5e83.js +0 -1
  231. package/assets/esri/core/workers/chunks/53746e9976758630159b.js +0 -1
  232. package/assets/esri/core/workers/chunks/5449fdd69e12e5cbd12a.js +0 -1
  233. package/assets/esri/core/workers/chunks/57ce4ece0147afb0d43c.js +0 -1
  234. package/assets/esri/core/workers/chunks/5e83d21400a5dec05c81.js +0 -1
  235. package/assets/esri/core/workers/chunks/6047f4487dcd37cca98e.js +0 -1
  236. package/assets/esri/core/workers/chunks/6967d2b3721678b38774.js +0 -1
  237. package/assets/esri/core/workers/chunks/6ac5ca7de651e3d672a1.js +0 -1
  238. package/assets/esri/core/workers/chunks/6b7ee9164149428edb9e.js +0 -1
  239. package/assets/esri/core/workers/chunks/6c495077cc79e1898927.js +0 -1
  240. package/assets/esri/core/workers/chunks/6d43648d5326e01b4474.js +0 -1
  241. package/assets/esri/core/workers/chunks/74fb07de0f990d45af89.js +0 -1
  242. package/assets/esri/core/workers/chunks/8e9a52062ce059153a89.js +0 -1
  243. package/assets/esri/core/workers/chunks/919a57d372419785cd5e.js +0 -1
  244. package/assets/esri/core/workers/chunks/939f0a1a7d605e389e45.js +0 -1
  245. package/assets/esri/core/workers/chunks/9932f23ba6589df14a3d.js +0 -1
  246. package/assets/esri/core/workers/chunks/a25a38c9f338e0beffef.js +0 -1
  247. package/assets/esri/core/workers/chunks/a97581e584336b46ede7.js +0 -1
  248. package/assets/esri/core/workers/chunks/b1cb932cfadc4dc3f1e4.js +0 -1
  249. package/assets/esri/core/workers/chunks/be3fb6113b0b27b94537.js +0 -1
  250. package/assets/esri/core/workers/chunks/c37119f5692e19aa1ce2.js +0 -1
  251. package/assets/esri/core/workers/chunks/c685f16435d9861bbbd0.js +0 -1
  252. package/assets/esri/core/workers/chunks/d5dfc03673aec8aa57e2.js +0 -1
  253. package/assets/esri/core/workers/chunks/e6416a2684866d677b3e.js +0 -1
  254. package/assets/esri/core/workers/chunks/eb01f4cdb9b918cc61e7.js +0 -1
  255. package/assets/esri/core/workers/chunks/eb4aed4fdb44495a4fe6.js +0 -1
  256. package/assets/esri/core/workers/chunks/ec8258c9dc1491e97fc8.js +0 -1
  257. package/assets/esri/core/workers/chunks/eeac53da496de4cd4182.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{urlToObject as r}from"../../core/urlUtils.js";import t from"../Portal.js";function e(e){return{origin:"portal-item",url:r(e.itemUrl),portal:e.portal||t.getDefault(),portalItem:e,readResourcePaths:[]}}function o(e){return{origin:"portal-item",messages:[],writtenProperties:[],url:e.itemUrl?r(e.itemUrl):null,portal:e.portal||t.getDefault(),portalItem:e}}export{e as createForItemRead,o as createForItemWrite};
5
+ import{urlToObject as t}from"../../core/urlUtils.js";import r from"../Portal.js";function e(e){return{origin:"portal-item",url:t(e.itemUrl),portal:e.portal||r.getDefault(),portalItem:e,readResourcePaths:[]}}function l(e){return{origin:"portal-item",messages:[],writtenProperties:[],url:e.itemUrl?t(e.itemUrl):null,portal:e.portal||r.getDefault(),portalItem:e}}function o(e){return{origin:"web-map",url:t(e.itemUrl),portal:e.portal||r.getDefault(),portalItem:e,readResourcePaths:[]}}function a(e){return{origin:"web-map",messages:[],writtenProperties:[],url:e.itemUrl?t(e.itemUrl):null,portal:e.portal||r.getDefault(),portalItem:e}}export{o as createForGroupLayerItemRead,a as createForGroupLayerItemWrite,e as createForItemRead,l as createForItemWrite};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../core/Error.js";import{parse as t}from"../../layers/support/arcgisLayerUrl.js";import{findAssociatedFeatureService as r}from"../../layers/support/associatedFeatureServiceUtils.js";import{fetchFeatureService as a}from"../../layers/support/fetchService.js";import{layerLookupMap as n}from"../../layers/support/lazyLayerLoader.js";import s from"../Portal.js";import{createForItemRead as l}from"./jsonContext.js";import{loadStyleRenderer as o}from"../../renderers/support/styleUtils.js";import{fetchArcGISServiceJSON as i}from"../../support/requestPresets.js";class c{constructor(){this._serviceMetadatas=new Map}async fetchServiceMetadata(e,t){const r=this._serviceMetadatas.get(e);if(r)return r;const a=await i(e,t);return this._serviceMetadatas.set(e,a),a}}async function u(e,t){const r=e.instance.portalItem;if(r?.id)return await r.load(t),p(e),y(e,t)}function p(t){const r=t.instance.portalItem;if(!r?.type||!t.supportedTypes.includes(r.type))throw new e("portal:invalid-layer-item-type","Invalid layer item type '${type}', expected '${expectedType}'",{type:r?.type,expectedType:t.supportedTypes.join(", ")})}async function y(e,t){const r=e.instance,a=r.portalItem;if(!a)return;const{url:n,title:s}=a,i=l(a);if("group"===r.type)return r.read({title:s},i),f(r,e);n&&r.read({url:n},i);const u=new c,p=await g(e,u,t);return p&&r.read(p,i),r.resourceReferences={portalItem:a,paths:i.readResourcePaths??[]},"subtype-group"!==r.type&&r.read({title:s},i),o(r,i)}async function f(t,r){let a;const{portalItem:n}=t;if(!n)return;const s=n.type,l=r.layerModuleTypeMap;switch(s){case"Feature Service":case"Feature Collection":a=l.FeatureLayer;break;case"Stream Service":a=l.StreamLayer;break;case"Scene Service":a=l.SceneLayer;break;default:throw new e("portal:unsupported-item-type-as-group",`The item type '${s}' is not supported as a 'IGroupLayer'`)}const o=new c;let[i,u]=await Promise.all([a(),g(r,o)]),p=()=>i;if("Feature Service"===s){u=n.url?await I(u,n.url,o):{};const e=j(u),r=F(u),a=[];if(e.length||r?.length){e.length&&a.push("SubtypeGroupLayer"),r?.length&&a.push("OrientedImageryLayer");const t=[];for(const e of a){const r=l[e];t.push(r())}const n=await Promise.all(t),s=new Map;a.forEach(((e,t)=>{s.set(e,n[t])})),p=e=>e.layerType?s.get(e.layerType)??i:i}const s=await D(n.url);return await b(t,p,u,s)}return"Scene Service"===s&&n.url&&(u=await d(n,u,o)),T(u)>0?await b(t,p,u):await m(t,p)}async function d(e,t,a){if(!e?.url)return t??{};if(t??={},!t.layers){const r=await a.fetchServiceMetadata(e.url);t.layers=r.layers?.map(h)}const{serverUrl:n,portalItem:s}=await r(e.url,{sceneLayerItem:e}).catch((()=>({serverUrl:null,portalItem:null})));if(null==n)return t.tables=[],t;if(!t.tables&&s){const e=await s.fetchData();if(e?.tables)t.tables=e.tables.map(h);else{const e=await a.fetchServiceMetadata(n);t.tables=e?.tables?.map(h)}}if(t.tables)for(const r of t.tables)r.url=`${n}/${r.id}`;return t}async function m(e,t){const{portalItem:r}=e;if(!r?.url)return;const a=await i(r.url);a&&b(e,t,{layers:a.layers?.map(h),tables:a.tables?.map(h)})}function h(e){const t={id:e.id,name:e.name};return"Oriented Imagery Layer"===e.type&&(t.layerType="OrientedImageryLayer"),t}async function b(e,t,r,a){let s=r.layers||[];const l=r.tables||[];if("Feature Collection"===e.portalItem?.type?(s.forEach(((e,t)=>{e.id=t,"Table"===e?.layerDefinition?.type&&l.push(e)})),s=s.filter((e=>"Table"!==e?.layerDefinition?.type))):(s.reverse(),l.reverse()),s.forEach((n=>{const s=a?.(n);if(s||!a){const a=w(e,t(n),r,n,s);e.add(a)}})),l.length){const t=await n.FeatureLayer();l.forEach((n=>{const s=a?.(n);if(s||!a){const a=w(e,t,r,n,s);e.tables.add(a)}}))}}function w(e,t,r,a,n){const l=e.portalItem,o={portalItem:l.clone(),layerId:a.id};null!=a.url&&(o.url=a.url);const i=new t(o);if("sourceJSON"in i&&(i.sourceJSON=n),"subtype-group"!==i.type&&(i.sublayerTitleMode="service-name"),"Feature Collection"===l.type){const e={origin:"portal-item",portal:l.portal||s.getDefault()};i.read(a,e);const t=r.showLegend;null!=t&&i.read({showLegend:t},e)}return i}async function g(e,t,r){if(!1===e.supportsData)return;const a=e.instance,n=a.portalItem;if(!n)return;let s=null;try{s=await n.fetchData("json",r)}catch(l){}if(M(a)){let e=null;const r=await v(n,s,t);if((s?.layers||s?.tables)&&r>0){if(null==a.layerId){const e=j(s);a.layerId="subtype-group"===a.type?e?.[0]:S(s)}e=L(s,a),e&&null!=s.showLegend&&(e.showLegend=s.showLegend)}return r>1&&"sublayerTitleMode"in a&&"service-name"!==a.sublayerTitleMode&&(a.sublayerTitleMode="item-title-and-service-name"),e}return s}async function v(e,r,a){if(r?.layers&&r?.tables)return T(r);const n=t(e.url);if(!n)return 1;const s=await a.fetchServiceMetadata(n.url.path).catch((()=>null));return(r?.layers?.length??s?.layers?.length??0)+(r?.tables?.length??s?.tables?.length??0)}async function I(e,t,r){if(null==e?.layers||null==e?.tables){const a=await r.fetchServiceMetadata(t);(e=e||{}).layers=e.layers||a?.layers?.map(h),e.tables=e.tables||a?.tables?.map(h)}return e}function S(e){const t=e.layers;if(t?.length)return t[0].id;const r=e.tables;return r?.length?r[0].id:null}function L(e,t){const{layerId:r}=t,a=e.layers?.find((e=>e.id===r))||e.tables?.find((e=>e.id===r));return a&&O(a,t)?a:null}function T(e){return(e?.layers?.length??0)+(e?.tables?.length??0)}function M(e){return"stream"!==e.type&&"layerId"in e}function j(e){const t=[];return e?.layers?.forEach((e=>{"SubtypeGroupLayer"===e.layerType&&t.push(e.id)})),t}function F(e){return e?.layers?.filter((({layerType:e})=>"OrientedImageryLayer"===e)).map((({id:e})=>e))}function O(e,t){return!("feature"===t.type&&"layerType"in e&&"SubtypeGroupLayer"===e.layerType||"subtype-group"===t.type&&!("layerType"in e))}async function D(e){const{layersJSON:t}=await a(e);if(!t)return null;const r=[...t.layers,...t.tables];return e=>r.find((t=>t.id===e.id))}export{c as LayerLoadContext,S as getFirstLayerOrTableId,T as getNumLayersAndTables,F as getOrientedImageryLayerIds,j as getSubtypeGroupLayerIds,u as load,d as populateSceneServiceItemData,I as preprocessFSItemData};
5
+ import e from"../../core/Error.js";import{OriginId as t}from"../../core/accessorSupport/PropertyOrigin.js";import{parse as r}from"../../layers/support/arcgisLayerUrl.js";import{fetchFeatureService as a}from"../../layers/support/fetchService.js";import{LayerLoadContext as n}from"../../layers/support/LayerLoadContext.js";import{populateGroupLayer as o}from"../../layers/support/layersCreator.js";import{layerLookupMap as s}from"../../layers/support/lazyLayerLoader.js";import i from"../Portal.js";import{createForItemRead as l,createForGroupLayerItemRead as p}from"./jsonContext.js";import{preprocessFSItemData as u,getSubtypeGroupLayerIds as c,getOrientedImageryLayerIds as y,populateSceneServiceItemData as f,getNumLayersAndTables as d,createSublayerData as m,getFirstLayerOrTableId as h}from"./loadUtils.js";import{hasTypeKeyword as w}from"./portalItemUtils.js";import{loadStyleRenderer as g}from"../../renderers/support/styleUtils.js";import{fetchArcGISServiceJSON as b}from"../../support/requestPresets.js";async function I(e,t){const r=e.instance.portalItem;if(r?.id)return await r.load(t),L(e),S(e,t)}function L(t){const r=t.instance.portalItem;if(!r?.type||!t.supportedTypes.includes(r.type))throw new e("portal:invalid-layer-item-type","Invalid layer item type '${type}', expected '${expectedType}'",{type:r?.type,expectedType:t.supportedTypes.join(", ")})}async function S(e,t){const r=e.instance,a=r.portalItem;if(!a)return;const{url:o,title:s}=a,i=l(a);if("group"===r.type)return j(r,i,e);o&&r.read({url:o},i);const p=new n,u=await C(e,p,t);return u&&r.read(u,i),r.resourceReferences={portalItem:a,paths:i.readResourcePaths??[]},"subtype-group"!==r.type&&r.read({title:s},i),g(r,i)}async function j(r,a,n){const o=r.portalItem;if(r.originIdOf("portalItem")!==t.USER)return;const{title:s,type:i}=o;if("Group Layer"===i){if(!w(o,"Map"))throw new e("portal:invalid-layer-item-typekeyword","'Group Layer' item without 'Map' type keyword is not supported");return T(r)}return r.read({title:s},a),v(r,n)}async function T(e){const t=e.portalItem,r=await t.fetchData("json");if(!r)return;const a=p(t);e.read(r,a),await o(e,r,{context:a})}async function v(t,r){let a;const{portalItem:o}=t;if(!o)return;const s=o.type,i=r.layerModuleTypeMap;switch(s){case"Feature Service":case"Feature Collection":a=i.FeatureLayer;break;case"Stream Service":a=i.StreamLayer;break;case"Scene Service":a=i.SceneLayer;break;default:throw new e("portal:unsupported-item-type-as-group",`The item type '${s}' is not supported as a 'IGroupLayer'`)}const l=new n;let[p,m]=await Promise.all([a(),C(r,l)]),h=()=>p;if("Feature Service"===s){m=o.url?await u(m,o.url,l):{};const e=c(m),r=y(m),a=[];if(e.length||r?.length){e.length&&a.push("SubtypeGroupLayer"),r?.length&&a.push("OrientedImageryLayer");const t=[];for(const e of a){const r=i[e];t.push(r())}const n=await Promise.all(t),o=new Map;a.forEach(((e,t)=>{o.set(e,n[t])})),h=e=>e.layerType?o.get(e.layerType)??p:p}const n=await k(o.url);return await x(t,h,m,n)}return"Scene Service"===s&&o.url&&(m=await f(o,m,l)),d(m)>0?await x(t,h,m):await M(t,h)}async function M(e,t){const{portalItem:r}=e;if(!r?.url)return;const a=await b(r.url);a&&x(e,t,{layers:a.layers?.map(m),tables:a.tables?.map(m)})}async function x(e,t,r,a){let n=r.layers||[];const o=r.tables||[];if("Feature Collection"===e.portalItem?.type?(n.forEach(((e,t)=>{e.id=t,"Table"===e?.layerDefinition?.type&&o.push(e)})),n=n.filter((e=>"Table"!==e?.layerDefinition?.type))):(n.reverse(),o.reverse()),n.forEach((n=>{const o=a?.(n);if(o||!a){const a=F(e,t(n),r,n,o);e.add(a)}})),o.length){const t=await s.FeatureLayer();o.forEach((n=>{const o=a?.(n);if(o||!a){const a=F(e,t,r,n,o);e.tables.add(a)}}))}}function F(e,t,r,a,n){const o=e.portalItem,s={portalItem:o.clone(),layerId:a.id};null!=a.url&&(s.url=a.url);const l=new t(s);if("sourceJSON"in l&&(l.sourceJSON=n),"subtype-group"!==l.type&&(l.sublayerTitleMode="service-name"),"Feature Collection"===o.type){const e={origin:"portal-item",portal:o.portal||i.getDefault()};l.read(a,e);const t=r.showLegend;null!=t&&l.read({showLegend:t},e)}return l}async function C(e,t,r){if(!1===e.supportsData)return;const a=e.instance,n=a.portalItem;if(!n)return;let o=null;try{o=await n.fetchData("json",r)}catch(s){}if(O(a)){let e=null;const r=await D(n,o,t);if((o?.layers||o?.tables)&&r>0){if(null==a.layerId){const e=c(o);a.layerId="subtype-group"===a.type?e?.[0]:h(o)}e=E(o,a),e&&null!=o.showLegend&&(e.showLegend=o.showLegend)}return r>1&&"sublayerTitleMode"in a&&"service-name"!==a.sublayerTitleMode&&(a.sublayerTitleMode="item-title-and-service-name"),e}return o}async function D(e,t,a){if(t?.layers&&t?.tables)return d(t);const n=r(e.url);if(!n)return 1;const o=await a.fetchServiceMetadata(n.url.path).catch((()=>null));return(t?.layers?.length??o?.layers?.length??0)+(t?.tables?.length??o?.tables?.length??0)}function E(e,t){const{layerId:r}=t,a=e.layers?.find((e=>e.id===r))||e.tables?.find((e=>e.id===r));return a&&P(a,t)?a:null}function O(e){return"stream"!==e.type&&"layerId"in e}function P(e,t){return!("feature"===t.type&&"layerType"in e&&"SubtypeGroupLayer"===e.layerType||"subtype-group"===t.type&&!("layerType"in e))}async function k(e){const{layersJSON:t}=await a(e);if(!t)return null;const r=[...t.layers,...t.tables];return e=>r.find((t=>t.id===e.id))}export{I as load};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
+ */
5
+ import{findAssociatedFeatureService as e}from"../../layers/support/associatedFeatureServiceUtils.js";function t(e){const t={id:e.id,name:e.name};return"Oriented Imagery Layer"===e.type&&(t.layerType="OrientedImageryLayer"),t}async function a(e,a,r){if(null==e?.layers||null==e?.tables){const l=await r.fetchServiceMetadata(a);(e=e||{}).layers=e.layers||l?.layers?.map(t),e.tables=e.tables||l?.tables?.map(t)}return e}function r(e){const t=e.layers;if(t?.length)return t[0].id;const a=e.tables;return a?.length?a[0].id:null}function l(e){return(e?.layers?.length??0)+(e?.tables?.length??0)}function n(e){const t=[];return e?.layers?.forEach((e=>{"SubtypeGroupLayer"===e.layerType&&t.push(e.id)})),t}function s(e){return e?.layers?.filter((({layerType:e})=>"OrientedImageryLayer"===e)).map((({id:e})=>e))}async function i(a,r,l){if(!a?.url)return r??{};if(r??={},!r.layers){const e=await l.fetchServiceMetadata(a.url);r.layers=e.layers?.map(t)}const{serverUrl:n,portalItem:s}=await e(a.url,{sceneLayerItem:a}).catch((()=>({serverUrl:null,portalItem:null})));if(null==n)return r.tables=[],r;if(!r.tables&&s){const e=await s.fetchData();if(e?.tables)r.tables=e.tables.map(t);else{const e=await l.fetchServiceMetadata(n);r.tables=e?.tables?.map(t)}}if(r.tables)for(const e of r.tables)e.url=`${n}/${e.id}`;return r}export{t as createSublayerData,r as getFirstLayerOrTableId,l as getNumLayersAndTables,s as getOrientedImageryLayerIds,n as getSubtypeGroupLayerIds,i as populateSceneServiceItemData,a as preprocessFSItemData};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{initializeProjection as e,project as t}from"../../geometry/projection.js";import r from"../../geometry/SpatialReference.js";import{webMercatorToGeographic as n}from"../../geometry/support/webMercatorUtils.js";async function o(o){const i=o.spatialReference;if(i.isWGS84)return o.clone();if(i.isWebMercator)return n(o);const s=r.WGS84;return await e(i,s),t(o,s)}function i(e,t){if(!s(e,t)){const r=e.typeKeywords;r?r.push(t):e.typeKeywords=[t]}}function s(e,t){return!!e.typeKeywords?.includes(t)}function c(e){return s(e,f.HOSTED_SERVICE)}function u(e,t){const r=e.typeKeywords;if(r){const e=r.indexOf(t);e>-1&&r.splice(e,1)}}function a(e,t,r){r?i(e,t):u(e,t)}async function l(e){const t=e.clone().normalize();let r;if(t.length>1)for(const n of t)r?n.width>r.width&&(r=n):r=n;else r=t[0];return o(r)}const f={DEVELOPER_BASEMAP:"DeveloperBasemap",JSAPI:"ArcGIS API for JavaScript",METADATA:"Metadata",MULTI_LAYER:"Multilayer",SINGLE_LAYER:"Singlelayer",TABLE:"Table",HOSTED_SERVICE:"Hosted Service",LOCAL_SCENE:"ViewingMode-Local",TILED_IMAGERY:"Tiled Imagery"};function p(e){const{portal:t,isOrgItem:r,itemControl:n}=e,o=t.user?.privileges;let i=!o||o.includes("features:user:edit"),s=!!r&&!!o?.includes("features:user:fullEdit");const c="update"===n||"admin"===n;return c?s=i=!0:s&&(i=!0),{features:{edit:i,fullEdit:s},content:{updateItem:c}}}export{f as TypeKeyword,i as addTypeKeyword,p as getUserPrivileges,l as getWGS84ExtentForItem,s as hasTypeKeyword,c as isHostedLayer,u as removeTypeKeyword,a as toggleTypeKeword};
5
+ import{initializeProjection as e,project as t}from"../../geometry/projection.js";import r from"../../geometry/SpatialReference.js";import{webMercatorToGeographic as n}from"../../geometry/support/webMercatorUtils.js";async function o(o){const i=o.spatialReference;if(i.isWGS84)return o.clone();if(i.isWebMercator)return n(o);const s=r.WGS84;return await e(i,s),t(o,s)}function i(e,t){if(!s(e,t)){const r=e.typeKeywords;r?r.push(t):e.typeKeywords=[t]}}function s(e,t){return!!e.typeKeywords?.includes(t)}function c(e){return s(e,f.HOSTED_SERVICE)}function a(e,t){const r=e.typeKeywords;if(r){const e=r.indexOf(t);e>-1&&r.splice(e,1)}}function u(e,t,r){r?i(e,t):a(e,t)}async function l(e){const t=e.clone().normalize();let r;if(t.length>1)for(const n of t)r?n.width>r.width&&(r=n):r=n;else r=t[0];return o(r)}const f={DEVELOPER_BASEMAP:"DeveloperBasemap",JSAPI:"ArcGIS API for JavaScript",METADATA:"Metadata",MULTI_LAYER:"Multilayer",SINGLE_LAYER:"Singlelayer",TABLE:"Table",HOSTED_SERVICE:"Hosted Service",LOCAL_SCENE:"ViewingMode-Local",TILED_IMAGERY:"Tiled Imagery",GROUP_LAYER_MAP:"Map"};function p(e){const{portal:t,isOrgItem:r,itemControl:n}=e,o=t.user?.privileges;let i=!o||o.includes("features:user:edit"),s=!!r&&!!o?.includes("features:user:fullEdit");const c="update"===n||"admin"===n;return c?s=i=!0:s&&(i=!0),{features:{edit:i,fullEdit:s},content:{updateItem:c}}}export{f as TypeKeyword,i as addTypeKeyword,p as getUserPrivileges,l as getWGS84ExtentForItem,s as hasTypeKeyword,c as isHostedLayer,a as removeTypeKeyword,u as toggleTypeKeword};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../core/Error.js";import{findAssociatedFeatureService as a}from"../../layers/support/associatedFeatureServiceUtils.js";import{sceneServiceLayerTypeToClassName as r}from"../../layers/support/layerUtils.js";import{layerLookupMap as t}from"../../layers/support/lazyLayerLoader.js";import n from"../PortalItem.js";import{LayerLoadContext as s,getNumLayersAndTables as c,preprocessFSItemData as i,getSubtypeGroupLayerIds as o,getOrientedImageryLayerIds as u,populateSceneServiceItemData as l,getFirstLayerOrTableId as y}from"./layersLoader.js";import{hasTypeKeyword as m}from"./portalItemUtils.js";async function p(e){!e.portalItem||e.portalItem instanceof n||(e={...e,portalItem:new n(e.portalItem)});const a=await f(e.portalItem);return new(0,a.constructor)({portalItem:e.portalItem,...a.properties})}async function f(e){await e.load();const a=new s;return L(await d(e,a))}async function d(a,r){switch(a.type){case"Map Service":return w(a,r);case"Feature Service":return S(a,r);case"Feature Collection":return I(a);case"Scene Service":return N(a,r);case"Image Service":return v(a,r);case"Stream Service":return M();case"Vector Tile Service":return h();case"GeoJson":return T();case"CSV":return g();case"KML":return j();case"WFS":return F();case"WMTS":return G();case"WMS":return b();case"Feed":return C();default:throw new e("portal:unknown-item-type","Unknown item type '${type}'",{type:a.type})}}async function L(e){const a=e.className,r=t[a];return{constructor:await r(),properties:e.properties}}async function w(e,a){return await V(e,a)?{className:"TileLayer"}:{className:"MapImageLayer"}}async function S(e,a){const r=await W(e,a);if("object"==typeof r){const e={};return null!=r.id&&(e.layerId=r.id),{className:r.className||"FeatureLayer",properties:e}}return{className:"GroupLayer"}}async function N(e,t){const n=await W(e,t,(async()=>{try{if(!e.url)return[];const{serverUrl:r}=await a(e.url,{sceneLayerItem:e}),n=await t.fetchServiceMetadata(r);return n?.tables??[]}catch{return[]}}));if("object"==typeof n){const a={};let s;if(null!=n.id?(a.layerId=n.id,s=`${e.url}/layers/${n.id}`):s=e.url,e.typeKeywords?.length)for(const t of Object.keys(r))if(e.typeKeywords.includes(t))return{className:r[t]};const c=await t.fetchServiceMetadata(s);return{className:r[c?.layerType]||"SceneLayer",properties:a}}if(!1===n){const a=await t.fetchServiceMetadata(e.url);if("Voxel"===a?.layerType)return{className:"VoxelLayer"}}return{className:"GroupLayer"}}async function I(e){await e.load();const a=m(e,"Map Notes"),r=m(e,"Markup");if(a||r)return{className:"MapNotesLayer"};if(m(e,"Route Layer"))return{className:"RouteLayer"};const t=await e.fetchData();return 1===c(t)?{className:"FeatureLayer"}:{className:"GroupLayer"}}async function v(e,a){await e.load();const r=e.typeKeywords?.map((e=>e.toLowerCase()))??[];if(r.includes("elevation 3d layer"))return{className:"ElevationLayer"};if(r.includes("tiled imagery"))return{className:"ImageryTileLayer"};const t=await e.fetchData(),n=t?.layerType;if("ArcGISTiledImageServiceLayer"===n)return{className:"ImageryTileLayer"};if("ArcGISImageServiceLayer"===n)return{className:"ImageryLayer"};const s=await a.fetchServiceMetadata(e.url),c=s.cacheType?.toLowerCase(),i=s.capabilities?.toLowerCase().includes("tilesonly");return"map"===c||i?{className:"ImageryTileLayer"}:{className:"ImageryLayer"}}function M(){return{className:"StreamLayer"}}function h(){return{className:"VectorTileLayer"}}function T(){return{className:"GeoJSONLayer"}}function g(){return{className:"CSVLayer"}}function j(){return{className:"KMLLayer"}}function F(){return{className:"WFSLayer"}}function b(){return{className:"WMSLayer"}}function G(){return{className:"WMTSLayer"}}function C(){return{className:"StreamLayer"}}async function V(e,a){return(await a.fetchServiceMetadata(e.url)).tileInfo}async function W(e,a,r){const t=e.url;if(!t||/\/\d+$/.test(t))return{};await e.load();let n=await e.fetchData();if("Feature Service"===e.type){const e=await i(n,t,a),r=K(e);if("object"==typeof r){const a=o(e),t=u(e);r.className=null!=r.id&&a.includes(r.id)?"SubtypeGroupLayer":null!=r.id&&t?.includes(r.id)?"OrientedImageryLayer":"FeatureLayer"}return r}"Scene Service"===e.type&&(n=await l(e,n,a));if(c(n)>0)return K(n);const s=await a.fetchServiceMetadata(t);return r&&(s.tables=await r()),K(s)}function K(e){return 1===c(e)&&{id:y(e)}}export{p as fromItem,d as selectLayerClassPath};
5
+ import e from"../../core/Error.js";import{findAssociatedFeatureService as a}from"../../layers/support/associatedFeatureServiceUtils.js";import{LayerLoadContext as r}from"../../layers/support/LayerLoadContext.js";import{sceneServiceLayerTypeToClassName as t}from"../../layers/support/layerUtils.js";import{layerLookupMap as n}from"../../layers/support/lazyLayerLoader.js";import s from"../PortalItem.js";import{getNumLayersAndTables as c,preprocessFSItemData as o,getSubtypeGroupLayerIds as i,getOrientedImageryLayerIds as u,populateSceneServiceItemData as l,getFirstLayerOrTableId as y}from"./loadUtils.js";import{hasTypeKeyword as m}from"./portalItemUtils.js";async function p(e){!e.portalItem||e.portalItem instanceof s||(e={...e,portalItem:new s(e.portalItem)});const a=await f(e.portalItem);return new(0,a.constructor)({portalItem:e.portalItem,...a.properties})}async function f(e){await e.load();const a=new r;return d(await L(e,a))}async function L(a,r){switch(a.type){case"Map Service":return w(a,r);case"Feature Service":return S(a,r);case"Feature Collection":return I(a);case"Scene Service":return N(a,r);case"Image Service":return v(a,r);case"Stream Service":return M();case"Vector Tile Service":return h();case"GeoJson":return T();case"CSV":return g();case"KML":return j();case"WFS":return F();case"WMTS":return b();case"WMS":return G();case"Feed":return C();case"Group Layer":return U();default:throw new e("portal:unknown-item-type","Unknown item type '${type}'",{type:a.type})}}async function d(e){const a=e.className,r=n[a];return{constructor:await r(),properties:e.properties}}async function w(e,a){return await V(e,a)?{className:"TileLayer"}:{className:"MapImageLayer"}}async function S(e,a){const r=await W(e,a);if("object"==typeof r){const e={};return null!=r.id&&(e.layerId=r.id),{className:r.className||"FeatureLayer",properties:e}}return{className:"GroupLayer"}}async function N(e,r){const n=await W(e,r,(async()=>{try{if(!e.url)return[];const{serverUrl:t}=await a(e.url,{sceneLayerItem:e}),n=await r.fetchServiceMetadata(t);return n?.tables??[]}catch{return[]}}));if("object"==typeof n){const a={};let s;if(null!=n.id?(a.layerId=n.id,s=`${e.url}/layers/${n.id}`):s=e.url,e.typeKeywords?.length)for(const r of Object.keys(t))if(e.typeKeywords.includes(r))return{className:t[r]};const c=await r.fetchServiceMetadata(s);return{className:t[c?.layerType]||"SceneLayer",properties:a}}if(!1===n){const a=await r.fetchServiceMetadata(e.url);if("Voxel"===a?.layerType)return{className:"VoxelLayer"}}return{className:"GroupLayer"}}async function I(e){await e.load();const a=m(e,"Map Notes"),r=m(e,"Markup");if(a||r)return{className:"MapNotesLayer"};if(m(e,"Route Layer"))return{className:"RouteLayer"};const t=await e.fetchData();return 1===c(t)?{className:"FeatureLayer"}:{className:"GroupLayer"}}async function v(e,a){await e.load();const r=e.typeKeywords?.map((e=>e.toLowerCase()))??[];if(r.includes("elevation 3d layer"))return{className:"ElevationLayer"};if(r.includes("tiled imagery"))return{className:"ImageryTileLayer"};const t=await e.fetchData(),n=t?.layerType;if("ArcGISTiledImageServiceLayer"===n)return{className:"ImageryTileLayer"};if("ArcGISImageServiceLayer"===n)return{className:"ImageryLayer"};const s=await a.fetchServiceMetadata(e.url),c=s.cacheType?.toLowerCase(),o=s.capabilities?.toLowerCase().includes("tilesonly");return"map"===c||o?{className:"ImageryTileLayer"}:{className:"ImageryLayer"}}function M(){return{className:"StreamLayer"}}function h(){return{className:"VectorTileLayer"}}function T(){return{className:"GeoJSONLayer"}}function g(){return{className:"CSVLayer"}}function j(){return{className:"KMLLayer"}}function F(){return{className:"WFSLayer"}}function G(){return{className:"WMSLayer"}}function b(){return{className:"WMTSLayer"}}function C(){return{className:"StreamLayer"}}function U(){return{className:"GroupLayer"}}async function V(e,a){return(await a.fetchServiceMetadata(e.url)).tileInfo}async function W(e,a,r){const t=e.url;if(!t||/\/\d+$/.test(t))return{};await e.load();let n=await e.fetchData();if("Feature Service"===e.type){const e=await o(n,t,a),r=K(e);if("object"==typeof r){const a=i(e),t=u(e);r.className=null!=r.id&&a.includes(r.id)?"SubtypeGroupLayer":null!=r.id&&t?.includes(r.id)?"OrientedImageryLayer":"FeatureLayer"}return r}"Scene Service"===e.type&&(n=await l(e,n,a));if(c(n)>0)return K(n);const s=await a.fetchServiceMetadata(t);return r&&(s.tables=await r()),K(s)}function K(e){return 1===c(e)&&{id:y(e)}}export{p as fromItem,L as selectLayerClassPath};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import{toHSV as t}from"../../core/colorUtils.js";import{JSONSupport as r}from"../../core/JSONSupport.js";import s from"../../core/Logger.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import n from"../../layers/support/RasterInfo.js";import{colorize as i,remapColor as l,lookupPixels as u,createColormapLUT as c,isValidPixelBlock as p}from"../../layers/support/rasterFunctions/pixelUtils.js";import{stretch as d,getStretchCutoff as h,createStretchLUT as m,computeGammaValues as f,createHistogramEqualizationLUT as y}from"../../layers/support/rasterFunctions/stretchUtils.js";import{hillshade as g,tintHillshade as b,calculateHillshadeParams as S}from"../../layers/support/rasterFunctions/surfaceUtils.js";import{convertColorRampToColormap as k}from"./colorRampUtils.js";import{isUVRendererSupported as R,isColormapRendererSupported as x,isShadedReliefRendererSupported as I}from"./rasterRendererChecks.js";let _=class extends r{constructor(e){super(e)}bind(){const{rendererJSON:e}=this;if(!e)return{success:!1};let t;switch(this.lookup={rendererJSON:{}},e.type){case"uniqueValue":t=this._updateUVRenderer(e);break;case"rasterColormap":t=this._updateColormapRenderer(e);break;case"rasterStretch":t=this._updateStretchRenderer(e);break;case"classBreaks":t=this._updateClassBreaksRenderer(e);break;case"rasterShadedRelief":t=this._updateShadedReliefRenderer(e);break;case"vectorField":t=this._updateVectorFieldRenderer();break;case"flowRenderer":t=this._updateFlowRenderer()}return t}symbolize(e){let t=e?.pixelBlock;if(!C(t))return t;if(e.simpleStretchParams&&"rasterStretch"===this.rendererJSON.type)return this.simpleStretch(t,e.simpleStretchParams);try{let r;switch(t.pixels.length>3&&(t=t.extractBands([0,1,2])),this.rendererJSON.type){case"uniqueValue":case"rasterColormap":r=this._symbolizeColormap(t);break;case"classBreaks":r=this._symbolizeClassBreaks(t);break;case"rasterStretch":r=this._symbolizeStretch(t,e.bandIds);break;case"rasterShadedRelief":{const s=e.extent,a=s.spatialReference.isGeographic,o={x:(s.xmax-s.xmin)/t.width,y:(s.ymax-s.ymin)/t.height};r=this._symbolizeShadedRelief(t,{isGCS:a,resolution:o});break}}return r}catch(r){return s.getLogger(this).error("symbolize",r.message),t}}simpleStretch(e,t){if(!C(e))return e;try{return e.pixels.length>3&&(e=e.extractBands([0,1,2])),d(e,{...t,isRenderer:!0})}catch(r){return s.getLogger(this).error("symbolize",r.message),e}}generateWebGLParameters(e){if(["uniqueValue","rasterColormap","classBreaks"].includes(this.rendererJSON.type)){const{indexedColormap:e,offset:t}=this.lookup.colormapLut||{};return{colormap:e,colormapOffset:t,type:"lut"}}const{pixelBlock:t,isGCS:r,resolution:s,bandIds:a}=e,{rendererJSON:o}=this;return"rasterStretch"===o.type?this._generateStretchWebGLParams(t,o,a):"rasterShadedRelief"===o.type?this._generateShadedReliefWebGLParams(o,r,s??void 0):"vectorField"===o.type?this._generateVectorFieldWebGLParams(o):null}_isLUTChanged(e){if(!this.lookup||!this.lookup.rendererJSON)return!0;if("colorRamp"in this.rendererJSON){const t=this.rendererJSON.colorRamp;return e?JSON.stringify(t)!==JSON.stringify(this.lookup.rendererJSON.colorRamp):(this.rendererJSON,this.lookup.rendererJSON,JSON.stringify(this.rendererJSON)!==JSON.stringify(this.lookup.rendererJSON))}return JSON.stringify(this.rendererJSON)!==JSON.stringify(this.lookup.rendererJSON)}_symbolizeColormap(e){if(this._isLUTChanged()){if(!this.bind().success)return e}return i(e,this.lookup.colormapLut)}_symbolizeClassBreaks(e){const{canUseIndexedLUT:t}=this._analyzeClassBreaks(this.rendererJSON);if(this._isLUTChanged()){if(!this.bind().success)return e}return t?i(e,this.lookup.colormapLut):l(e,this.lookup.remapLut??[])}_symbolizeStretch(e,t){const{rasterInfo:r}=this,{pixelType:s,bandCount:a}=r,o=this.rendererJSON,n=["u8","u16","s8","s16"].includes(s);let l,c;const{dra:p}=o,{gamma:f}=this.lookup;if("histogramEqualization"===o.stretchType){const s=p?null:this.lookup?.histogramLut,a=h(o,{rasterInfo:r,pixelBlock:e,bandIds:t,returnHistogramLut:!s}),n=d(e,{...a,gamma:f,isRenderer:!0});c=u(n,{lut:p?a.histogramLut:s,offset:0})}else if(n){if(p){const a=h(o,{rasterInfo:r,pixelBlock:e,bandIds:t});l=m({pixelType:s,...a,gamma:f,rounding:"floor"})}else if(this._isLUTChanged()){if(!this.bind().success)return e;l=this.lookup?this.lookup.stretchLut:null}else l=this.lookup?this.lookup.stretchLut:null;if(!l)return e;a>1&&null!=t&&t.length===e?.pixels.length&&l?.lut.length===a&&(l={lut:t.map((e=>l.lut[e])),offset:l.offset}),c=u(e,l)}else{const s=h(o,{rasterInfo:r,pixelBlock:e,bandIds:t});c=d(e,{...s,gamma:f,isRenderer:!0})}if(o.colorRamp){if(this._isLUTChanged(!0)){if(!this.bind().success)return e}c=i(c,this.lookup?.colormapLut)}return c}_symbolizeShadedRelief(e,t){const r=this.rendererJSON,s={...r,...t},a=g(e,s);if(!r.colorRamp)return a;let o;if(this._isLUTChanged(!0)){if(!this.bind().success)return a;o=this.lookup?this.lookup.hsvMap:null}else o=this.lookup?this.lookup.hsvMap:null;if(!o)return a;const n=this.rasterInfo.statistics?.[0]??{min:0,max:8e3};return b(a,e,o,n),a}_isVectorFieldData(){const{bandCount:e,dataType:t}=this.rasterInfo;return 2===e&&("vector-magdir"===t||"vector-uv"===t)}_updateVectorFieldRenderer(){return this._isVectorFieldData()?{success:!0}:{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; VectorFieldRenderer only supports "vector-magdir" and "vector-uv".`}}_updateFlowRenderer(){return this._isVectorFieldData()?{success:!0}:{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; FlowRenderer only supports "vector-magdir" and "vector-uv".`}}_updateUVRenderer(e){const{bandCount:t,attributeTable:r,pixelType:s}=this.rasterInfo,a=e.field1;if(!a)return{success:!1,error:"Unsupported renderer; missing UniqueValueRenderer.field."};const o=e.defaultSymbol,n=1===t&&["u8","s8"].includes(s);if(!R(this.rasterInfo,a)&&!n)return{success:!1,error:"Unsupported data; UniqueValueRenderer is only supported on single band data with a valid raster attribute table."};const i=[];if(null!=r){const t=r.fields.find((e=>"value"===e.name.toLowerCase()));if(!t)return{success:!1,error:"Unsupported data; the data's raster attribute table does not have a value field."};r.features.forEach((r=>{const s=e.uniqueValueInfos?.find((e=>String(e.value)===String(r.attributes[a]))),n=s?.symbol?.color;n?i.push([r.attributes[t.name]].concat(n)):o&&i.push([r.attributes[t.name]].concat(o.color))}))}else{if("value"!==a.toLowerCase())return{success:!1,error:'Unsupported renderer; UniqueValueRenderer.field must be "Value" when raster attribute table is not availalbe.'};e.uniqueValueInfos?.forEach((e=>{const t=e?.symbol?.color;t?i.push([parseInt(""+e.value,10)].concat(t)):o&&i.push([parseInt(""+e.value,10)].concat(o?.color))}))}if(0===i.length)return{success:!1,error:"Invalid UniqueValueRenderer. Cannot find matching records in the raster attribute table."};const l=c({colormap:i});return this.lookup={rendererJSON:e,colormapLut:l},this.canRenderInWebGL=!0,{success:!0}}_updateColormapRenderer(e){if(!x(this.rasterInfo))return{success:!1,error:"Unsupported data; the data source does not have a colormap."};const t=e.colormapInfos.map((e=>[e.value].concat(e.color))).sort(((e,t)=>e[0]-t[0]));if(!t||0===t.length)return{success:!1,error:"Unsupported renderer; ColormapRenderer must have meaningful colormapInfos."};const r=c({colormap:t});return this.lookup={rendererJSON:e,colormapLut:r},this.canRenderInWebGL=!0,{success:!0}}_updateShadedReliefRenderer(e){if(!I(this.rasterInfo))return{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; ShadedReliefRenderer only supports "elevation", or single band float/s16 data.`};if(e.colorRamp){const r=k(e.colorRamp,{interpolateAlpha:!0}),s=c({colormap:r}),a=[],o=s.indexedColormap;for(let e=0;e<o.length;e+=4){const r=t({r:o[e],g:o[e+1],b:o[e+2]});a.push([r.h/60,r.s/100,255*r.v/100])}this.lookup={rendererJSON:e,colormapLut:s,hsvMap:a}}else this.lookup=null;return this.canRenderInWebGL=!0,{success:!0}}_analyzeClassBreaks(e){const{attributeTable:t,pixelType:r}=this.rasterInfo,s=null!=t?t.fields.find((e=>"value"===e.name.toLowerCase())):null,a=null!=t?t.fields.find((t=>t.name.toLowerCase()===e.field.toLowerCase())):null,o=null!=s&&null!==a;return{canUseIndexedLUT:["u8","u16","s8","s16"].includes(r)||o,tableValueField:s,tableBreakField:a}}_updateClassBreaksRenderer(e){const{attributeTable:t}=this.rasterInfo,{canUseIndexedLUT:r,tableValueField:s,tableBreakField:a}=this._analyzeClassBreaks(e),o=e.classBreakInfos;if(!o?.length)return{success:!1,error:"Unsupported renderer; missing or invalid ClassBreaksRenderer.classBreakInfos."};const n=o.sort(((e,t)=>e.classMaxValue-t.classMaxValue)),i=n[n.length-1];let l=e.minValue;if(!r){const t=[];for(let e=0;e<n.length;e++)t.push({value:n[e].classMinValue??l,mappedColor:n[e].symbol.color}),l=n[e].classMaxValue;return t.push({value:i.classMaxValue,mappedColor:i.symbol.color}),this.lookup={rendererJSON:e,remapLut:t},this.canRenderInWebGL=!1,{success:!0}}const u=[];if(null!=t&&null!=s&&null!==a&&s!==a){const r=s.name,o=a.name,i=n[n.length-1],{classMaxValue:c}=i;l=e.minValue;for(const e of t.features){const t=e.attributes[r],s=e.attributes[o],a=s===c?i:s<l?null:n.find((({classMaxValue:e})=>e>s));a&&u.push([t].concat(a.symbol.color))}}else{l=Math.floor(e.minValue);for(let e=0;e<n.length;e++){const t=n[e];for(let e=l;e<t.classMaxValue;e++)u.push([e].concat(t.symbol.color));l=Math.ceil(t.classMaxValue)}i.classMaxValue===l&&u.push([i.classMaxValue].concat(i.symbol.color))}const p=c({colormap:u,fillUnspecified:!1});return this.lookup={rendererJSON:e,colormapLut:p},this.canRenderInWebGL=!0,{success:!0}}_isHistogramRequired(e){return"percentClip"===e||"histogramEqualization"===e}_isValidRasterStatistics(e){return null!=e&&e.length>0&&null!=e[0].min&&null!=e[0].max}_updateStretchRenderer(e){let{stretchType:t,dra:r}=e;if(!("none"===t||e.statistics?.length||this._isValidRasterStatistics(this.rasterInfo.statistics)||r))return{success:!1,error:"Unsupported renderer; StretchRenderer.statistics is required when dynamic range adjustment is not used."};const s=e.histograms||this.rasterInfo.histograms;!this._isHistogramRequired(e.stretchType)||s?.length||r||(t="minMax");const{computeGamma:a,useGamma:o,colorRamp:n}=e;let{gamma:i}=e;if(o&&a&&!i?.length){const t=e.statistics?.length?e.statistics:this.rasterInfo.statistics;i=f(this.rasterInfo.pixelType,t)}const l=this.rasterInfo.pixelType,u=!r&&["u8","u16","s8","s16"].includes(l);if("histogramEqualization"===t){const t=s.map((e=>y(e)));this.lookup={rendererJSON:e,histogramLut:t}}else if(u){const t=h(e,{rasterInfo:this.rasterInfo}),r=m({pixelType:l,...t,gamma:o?i:null,rounding:"floor"});this.lookup={rendererJSON:e,stretchLut:r}}if(n){const t=k(n,{interpolateAlpha:!0});this.lookup||(this.lookup={rendererJSON:e}),this.lookup.colormapLut=c({colormap:t}),this.lookup.rendererJSON=e}return this.lookup.gamma=o&&i?.length?i:null,this.canRenderInWebGL=!0,{success:!0}}_generateStretchWebGLParams(e,t,r){let s=null,a=null;const o=this.lookup?.colormapLut;t.colorRamp&&o&&(s=o.indexedColormap,a=o.offset),"histogramEqualization"===t.stretchType&&(t={...t,stretchType:"minMax"});const{gamma:n}=this.lookup,i=!!(t.useGamma&&n&&n.some((e=>1!==e))),{minCutOff:l,maxCutOff:u,outMin:c,outMax:p}=h(t,{rasterInfo:this.rasterInfo,pixelBlock:e,bandIds:r});let d=0;null!=e&&(d=e.getPlaneCount(),2===d&&((e=e.clone()).statistics=[e.statistics[0]],e.pixels=[e.pixels[0]]));const{bandCount:m}=this.rasterInfo,f=Math.min(3,r?.length||d||m,m),y=new Float32Array(f),g=s||i?1:255;let b;for(b=0;b<l.length;b++)y[b]=u[b]===l[b]?0:(p-c)/(u[b]-l[b])/g;const S=new Float32Array(f);if(i&&n)for(b=0;b<f;b++)n[b]>1?n[b]>2?S[b]=6.5+(n[b]-2)**2.5:S[b]=6.5+100*(2-n[b])**4:S[b]=1;return{bandCount:f,outMin:c/g,outMax:p/g,minCutOff:l,maxCutOff:u,factor:y,useGamma:i,gamma:i?n:[1,1,1],gammaCorrection:i?S:[1,1,1],colormap:s,colormapOffset:a,stretchType:t.stretchType,type:"stretch"}}_generateShadedReliefWebGLParams(e,t=!1,r={x:0,y:0}){let s=null,a=null;const o=this.lookup?.colormapLut;e.colorRamp&&o&&(s=o.indexedColormap,a=o.offset);const n={...e,isGCS:t,resolution:r},i=S(n),l=this.rasterInfo.statistics?.[0];return{...i,minValue:l?.min??0,maxValue:l?.max??8e3,hillshadeType:"traditional"===e.hillshadeType?0:1,type:"hillshade",colormap:s,colormapOffset:a}}_generateVectorFieldWebGLParams(e){const{style:t,inputUnit:r,outputUnit:s,visualVariables:a,symbolTileSize:o,flowRepresentation:n}=e;let i;const l=this.rasterInfo.statistics?.[0].min??0,u=this.rasterInfo.statistics?.[0].max??50,c=a?.find((e=>"sizeInfo"===e.type))??{type:"sizeInfo",field:"Magnitude",maxDataValue:u,maxSize:.8*o,minDataValue:l,minSize:.2*o},p=c.minDataValue??l,d=c.maxDataValue??u,h=null!=c.maxSize&&null!=c.minSize?[c.minSize/o,c.maxSize/o]:[.2,.8];if("wind_speed"===t){const e=(h[0]+h[1])/2;h[0]=h[1]=e}const m=null!=p&&null!=d?[p,d]:null;if("classified_arrow"===t)if(null!=p&&null!=d&&null!=c){i=[];const e=(c.maxDataValue-c.minDataValue)/5;for(let t=0;t<6;t++)i.push(c.minDataValue+e*t)}else i=[0,1e-6,3.5,7,10.5,14];const f="flow_to"===n===("ocean_current_kn"===t||"ocean_current_m"===t)?0:Math.PI,y=a?.find((e=>"rotationInfo"===e.type));return{breakValues:i,dataRange:m,inputUnit:r,outputUnit:s,symbolTileSize:o,symbolPercentRange:h,style:t||"single_arrow",rotation:f,rotationType:this.rasterInfo.storageInfo?.tileInfo&&"vector-uv"===this.rasterInfo.dataType?"geographic":y?.rotationType||e.rotationType,type:"vectorField"}}};function C(e){return p(e)&&0!==e.validPixelCount}e([a({json:{write:!0}})],_.prototype,"rendererJSON",void 0),e([a({type:n,json:{write:!0}})],_.prototype,"rasterInfo",void 0),e([a({json:{write:!0}})],_.prototype,"lookup",void 0),e([a()],_.prototype,"canRenderInWebGL",void 0),_=e([o("esri.renderers.support.RasterSymbolizer")],_);const L=_;export{L as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import{toHSV as t}from"../../core/colorUtils.js";import{JSONSupport as r}from"../../core/JSONSupport.js";import s from"../../core/Logger.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import n from"../../layers/support/RasterInfo.js";import{colorize as i,remapColor as l,lookupPixels as u,createColormapLUT as c,isValidPixelBlock as p}from"../../layers/support/rasterFunctions/pixelUtils.js";import{stretch as d,getStretchCutoff as h,createStretchLUT as m,computeGammaValues as f,createHistogramEqualizationLUT as y}from"../../layers/support/rasterFunctions/stretchUtils.js";import{hillshade as g,tintHillshade as b,calculateHillshadeParams as S}from"../../layers/support/rasterFunctions/surfaceUtils.js";import{convertColorRampToColormap as k}from"./colorRampUtils.js";import{isUVRendererSupported as R,isColormapRendererSupported as x,isShadedReliefRendererSupported as I}from"./rasterRendererChecks.js";let C=class extends r{constructor(e){super(e)}bind(){const{rendererJSON:e}=this;if(!e)return{success:!1};let t;switch(this.lookup={rendererJSON:{}},e.type){case"uniqueValue":t=this._updateUVRenderer(e);break;case"rasterColormap":t=this._updateColormapRenderer(e);break;case"rasterStretch":t=this._updateStretchRenderer(e);break;case"classBreaks":t=this._updateClassBreaksRenderer(e);break;case"rasterShadedRelief":t=this._updateShadedReliefRenderer(e);break;case"vectorField":t=this._updateVectorFieldRenderer();break;case"flowRenderer":t=this._updateFlowRenderer()}return t}symbolize(e){let t=e?.pixelBlock;if(!_(t))return t;if(e.simpleStretchParams&&"rasterStretch"===this.rendererJSON.type)return this.simpleStretch(t,e.simpleStretchParams);try{let r;switch(t.pixels.length>3&&(t=t.extractBands([0,1,2])),this.rendererJSON.type){case"uniqueValue":case"rasterColormap":r=this._symbolizeColormap(t);break;case"classBreaks":r=this._symbolizeClassBreaks(t);break;case"rasterStretch":r=this._symbolizeStretch(t,e.bandIds);break;case"rasterShadedRelief":{const s=e.extent,o=s.spatialReference.isGeographic,a={x:(s.xmax-s.xmin)/t.width,y:(s.ymax-s.ymin)/t.height};r=this._symbolizeShadedRelief(t,{isGCS:o,resolution:a});break}}return r}catch(r){return s.getLogger(this).error("symbolize",r.message),t}}simpleStretch(e,t){if(!_(e))return e;try{return e.pixels.length>3&&(e=e.extractBands([0,1,2])),d(e,{...t,isRenderer:!0})}catch(r){return s.getLogger(this).error("symbolize",r.message),e}}generateWebGLParameters(e){if(["uniqueValue","rasterColormap","classBreaks"].includes(this.rendererJSON.type)){const{indexedColormap:e,offset:t}=this.lookup.colormapLut||{};return{colormap:e,colormapOffset:t,type:"lut"}}const{pixelBlock:t,isGCS:r,resolution:s,bandIds:o}=e,{rendererJSON:a}=this;return"rasterStretch"===a.type?this._generateStretchWebGLParams(t,a,o):"rasterShadedRelief"===a.type?this._generateShadedReliefWebGLParams(a,r,s??void 0):"vectorField"===a.type?this._generateVectorFieldWebGLParams(a):null}_isLUTChanged(e){if(!this.lookup||!this.lookup.rendererJSON)return!0;if("colorRamp"in this.rendererJSON){const t=this.rendererJSON.colorRamp;return e?JSON.stringify(t)!==JSON.stringify(this.lookup.rendererJSON.colorRamp):(this.rendererJSON,this.lookup.rendererJSON,JSON.stringify(this.rendererJSON)!==JSON.stringify(this.lookup.rendererJSON))}return JSON.stringify(this.rendererJSON)!==JSON.stringify(this.lookup.rendererJSON)}_symbolizeColormap(e){if(this._isLUTChanged()){if(!this.bind().success)return e}return i(e,this.lookup.colormapLut)}_symbolizeClassBreaks(e){const{canUseIndexedLUT:t}=this._analyzeClassBreaks(this.rendererJSON);if(this._isLUTChanged()){if(!this.bind().success)return e}return t?i(e,this.lookup.colormapLut):l(e,this.lookup.remapLut??[])}_symbolizeStretch(e,t){const{rasterInfo:r}=this,{pixelType:s,bandCount:o}=r,a=this.rendererJSON,n=["u8","u16","s8","s16"].includes(s);let l,c;const{dra:p}=a,{gamma:f}=this.lookup;if("histogramEqualization"===a.stretchType){const s=p?null:this.lookup?.histogramLut,o=h(a,{rasterInfo:r,pixelBlock:e,bandIds:t,returnHistogramLut:!s}),n=d(e,{...o,gamma:f,isRenderer:!0});c=u(n,{lut:p?o.histogramLut:s,offset:0})}else if(n){if(p){const o=h(a,{rasterInfo:r,pixelBlock:e,bandIds:t});l=m({pixelType:s,...o,gamma:f,rounding:"floor"})}else if(this._isLUTChanged()){if(!this.bind().success)return e;l=this.lookup?this.lookup.stretchLut:null}else l=this.lookup?this.lookup.stretchLut:null;if(!l)return e;o>1&&null!=t&&t.length===e?.pixels.length&&l?.lut.length===o&&(l={lut:t.map((e=>l.lut[e])),offset:l.offset}),c=u(e,l)}else{const s=h(a,{rasterInfo:r,pixelBlock:e,bandIds:t});c=d(e,{...s,gamma:f,isRenderer:!0})}if(a.colorRamp){if(this._isLUTChanged(!0)){if(!this.bind().success)return e}c=i(c,this.lookup?.colormapLut)}return c}_symbolizeShadedRelief(e,t){const r=this.rendererJSON,s={...r,...t},o=g(e,s);if(!r.colorRamp)return o;let a;if(this._isLUTChanged(!0)){if(!this.bind().success)return o;a=this.lookup?this.lookup.hsvMap:null}else a=this.lookup?this.lookup.hsvMap:null;if(!a)return o;const n=this.rasterInfo.statistics?.[0]??{min:0,max:8e3};return b(o,e,a,n),o}_isVectorFieldData(){const{bandCount:e,dataType:t}=this.rasterInfo;return 2===e&&("vector-magdir"===t||"vector-uv"===t)}_updateVectorFieldRenderer(){return this._isVectorFieldData()?{success:!0}:{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; VectorFieldRenderer only supports "vector-magdir" and "vector-uv".`}}_updateFlowRenderer(){return this._isVectorFieldData()?{success:!0}:{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; FlowRenderer only supports "vector-magdir" and "vector-uv".`}}_updateUVRenderer(e){const{bandCount:t,attributeTable:r,pixelType:s}=this.rasterInfo,o=e.field1;if(!o)return{success:!1,error:"Unsupported renderer; missing UniqueValueRenderer.field."};const a=e.defaultSymbol,n=1===t&&["u8","s8"].includes(s);if(!R(this.rasterInfo,o)&&!n)return{success:!1,error:"Unsupported data; UniqueValueRenderer is only supported on single band data with a valid raster attribute table."};const i=[];if(null!=r){const t=r.fields.find((e=>"value"===e.name.toLowerCase()));if(!t)return{success:!1,error:"Unsupported data; the data's raster attribute table does not have a value field."};r.features.forEach((r=>{const s=e.uniqueValueInfos?.find((e=>String(e.value)===String(r.attributes[o]))),n=s?.symbol?.color;n?i.push([r.attributes[t.name]].concat(n)):a&&i.push([r.attributes[t.name]].concat(a.color))}))}else{if("value"!==o.toLowerCase())return{success:!1,error:'Unsupported renderer; UniqueValueRenderer.field must be "Value" when raster attribute table is not availalbe.'};e.uniqueValueInfos?.forEach((e=>{const t=e?.symbol?.color;t?i.push([parseInt(""+e.value,10)].concat(t)):a&&i.push([parseInt(""+e.value,10)].concat(a?.color))}))}if(0===i.length)return{success:!1,error:"Invalid UniqueValueRenderer. Cannot find matching records in the raster attribute table."};const l=c({colormap:i});return this.lookup={rendererJSON:e,colormapLut:l},this.canRenderInWebGL=!0,{success:!0}}_updateColormapRenderer(e){if(!x(this.rasterInfo))return{success:!1,error:"Unsupported data; the data source does not have a colormap."};const t=e.colormapInfos.map((e=>[e.value].concat(e.color))).sort(((e,t)=>e[0]-t[0]));if(!t||0===t.length)return{success:!1,error:"Unsupported renderer; ColormapRenderer must have meaningful colormapInfos."};const r=c({colormap:t});return this.lookup={rendererJSON:e,colormapLut:r},this.canRenderInWebGL=!0,{success:!0}}_updateShadedReliefRenderer(e){if(!I(this.rasterInfo))return{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; ShadedReliefRenderer only supports "elevation", or single band float/s16 data.`};if(e.colorRamp){const r=k(e.colorRamp,{interpolateAlpha:!0}),s=c({colormap:r}),o=[],a=s.indexedColormap;for(let e=0;e<a.length;e+=4){const r=t({r:a[e],g:a[e+1],b:a[e+2]});o.push([r.h/60,r.s/100,255*r.v/100])}this.lookup={rendererJSON:e,colormapLut:s,hsvMap:o}}else this.lookup=null;return this.canRenderInWebGL=!0,{success:!0}}_analyzeClassBreaks(e){const{attributeTable:t,pixelType:r}=this.rasterInfo,s=null!=t?t.fields.find((e=>"value"===e.name.toLowerCase())):null,o=null!=t?t.fields.find((t=>t.name.toLowerCase()===e.field.toLowerCase())):null,a=null!=s&&null!==o;return{canUseIndexedLUT:["u8","u16","s8","s16"].includes(r)||a,tableValueField:s,tableBreakField:o}}_updateClassBreaksRenderer(e){const{attributeTable:t}=this.rasterInfo,{canUseIndexedLUT:r,tableValueField:s,tableBreakField:o}=this._analyzeClassBreaks(e),a=e.classBreakInfos;if(!a?.length)return{success:!1,error:"Unsupported renderer; missing or invalid ClassBreaksRenderer.classBreakInfos."};const n=a.sort(((e,t)=>e.classMaxValue-t.classMaxValue)),i=n[n.length-1];let l=e.minValue;if(!r){const t=[];for(let e=0;e<n.length;e++)t.push({value:n[e].classMinValue??l,mappedColor:n[e].symbol.color}),l=n[e].classMaxValue;return t.push({value:i.classMaxValue,mappedColor:i.symbol.color}),this.lookup={rendererJSON:e,remapLut:t},this.canRenderInWebGL=!1,{success:!0}}const u=[];if(null!=t&&null!=s&&null!==o&&s!==o){const r=s.name,a=o.name,i=n[n.length-1],{classMaxValue:c}=i;l=e.minValue;for(const e of t.features){const t=e.attributes[r],s=e.attributes[a],o=s===c?i:s<l?null:n.find((({classMaxValue:e})=>e>s));o&&u.push([t].concat(o.symbol.color))}}else{l=Math.floor(e.minValue);for(let e=0;e<n.length;e++){const t=n[e];for(let e=l;e<t.classMaxValue;e++)u.push([e].concat(t.symbol.color));l=Math.ceil(t.classMaxValue)}i.classMaxValue===l&&u.push([i.classMaxValue].concat(i.symbol.color))}const p=c({colormap:u,fillUnspecified:!1});return this.lookup={rendererJSON:e,colormapLut:p},this.canRenderInWebGL=!0,{success:!0}}_isHistogramRequired(e){return"percentClip"===e||"histogramEqualization"===e}_isValidRasterStatistics(e){return null!=e&&e.length>0&&null!=e[0].min&&null!=e[0].max}_updateStretchRenderer(e){let{stretchType:t,dra:r}=e;if(!("none"===t||e.statistics?.length||this._isValidRasterStatistics(this.rasterInfo.statistics)||r))return{success:!1,error:"Unsupported renderer; StretchRenderer.statistics is required when dynamic range adjustment is not used."};const s=e.histograms||this.rasterInfo.histograms;!this._isHistogramRequired(e.stretchType)||s?.length||r||(t="minMax");const{computeGamma:o,useGamma:a,colorRamp:n}=e;let{gamma:i}=e;if(a&&o&&!i?.length){const t=e.statistics?.length?e.statistics:this.rasterInfo.statistics;i=f(this.rasterInfo.pixelType,t)}const l=this.rasterInfo.pixelType,u=!r&&["u8","u16","s8","s16"].includes(l);if("histogramEqualization"===t){const t=s.map((e=>y(e)));this.lookup={rendererJSON:e,histogramLut:t}}else if(u){const t=h(e,{rasterInfo:this.rasterInfo}),r=m({pixelType:l,...t,gamma:a?i:null,rounding:"floor"});this.lookup={rendererJSON:e,stretchLut:r}}if(n&&!this._isStretchColorRampNoop(n)){const t=k(n,{interpolateAlpha:!0});this.lookup||(this.lookup={rendererJSON:e}),this.lookup.colormapLut=c({colormap:t}),this.lookup.rendererJSON=e}return this.lookup.gamma=a&&i?.length?i:null,this.canRenderInWebGL=!0,{success:!0}}_isStretchColorRampNoop(e){return"algorithmic"===e.type&&["0,0,0,255","0,0,0"].includes(e.fromColor.join(","))&&["255,255,255,255","255,255,255"].includes(e.toColor.join(","))}_generateStretchWebGLParams(e,t,r){let s=null,o=null;const a=this.lookup?.colormapLut;t.colorRamp&&a&&(s=a.indexedColormap,o=a.offset),"histogramEqualization"===t.stretchType&&(t={...t,stretchType:"minMax"});const{gamma:n}=this.lookup,i=!!(t.useGamma&&n&&n.some((e=>1!==e))),{minCutOff:l,maxCutOff:u,outMin:c,outMax:p}=h(t,{rasterInfo:this.rasterInfo,pixelBlock:e,bandIds:r});let d=0;null!=e&&(d=e.getPlaneCount(),2===d&&((e=e.clone()).statistics=[e.statistics[0]],e.pixels=[e.pixels[0]]));const{bandCount:m}=this.rasterInfo,f=Math.min(3,r?.length||d||m,m),y=new Float32Array(f),g=s||i?1:255;let b;for(b=0;b<l.length;b++)y[b]=u[b]===l[b]?0:(p-c)/(u[b]-l[b])/g;const S=new Float32Array(f);if(i&&n)for(b=0;b<f;b++)n[b]>1?n[b]>2?S[b]=6.5+(n[b]-2)**2.5:S[b]=6.5+100*(2-n[b])**4:S[b]=1;return{bandCount:f,outMin:c/g,outMax:p/g,minCutOff:l,maxCutOff:u,factor:y,useGamma:i,gamma:i?n:[1,1,1],gammaCorrection:i?S:[1,1,1],colormap:s,colormapOffset:o,stretchType:t.stretchType,type:"stretch"}}_generateShadedReliefWebGLParams(e,t=!1,r={x:0,y:0}){let s=null,o=null;const a=this.lookup?.colormapLut;e.colorRamp&&a&&(s=a.indexedColormap,o=a.offset);const n={...e,isGCS:t,resolution:r},i=S(n),l=this.rasterInfo.statistics?.[0];return{...i,minValue:l?.min??0,maxValue:l?.max??8e3,hillshadeType:"traditional"===e.hillshadeType?0:1,type:"hillshade",colormap:s,colormapOffset:o}}_generateVectorFieldWebGLParams(e){const{style:t,inputUnit:r,outputUnit:s,visualVariables:o,symbolTileSize:a,flowRepresentation:n}=e;let i;const l=this.rasterInfo.statistics?.[0].min??0,u=this.rasterInfo.statistics?.[0].max??50,c=o?.find((e=>"sizeInfo"===e.type))??{type:"sizeInfo",field:"Magnitude",maxDataValue:u,maxSize:.8*a,minDataValue:l,minSize:.2*a},p=c.minDataValue??l,d=c.maxDataValue??u,h=null!=c.maxSize&&null!=c.minSize?[c.minSize/a,c.maxSize/a]:[.2,.8];if("wind_speed"===t){const e=(h[0]+h[1])/2;h[0]=h[1]=e}const m=null!=p&&null!=d?[p,d]:null;if("classified_arrow"===t)if(null!=p&&null!=d&&null!=c){i=[];const e=(c.maxDataValue-c.minDataValue)/5;for(let t=0;t<6;t++)i.push(c.minDataValue+e*t)}else i=[0,1e-6,3.5,7,10.5,14];const f="flow_to"===n===("ocean_current_kn"===t||"ocean_current_m"===t)?0:Math.PI,y=o?.find((e=>"rotationInfo"===e.type));return{breakValues:i,dataRange:m,inputUnit:r,outputUnit:s,symbolTileSize:a,symbolPercentRange:h,style:t||"single_arrow",rotation:f,rotationType:this.rasterInfo.storageInfo?.tileInfo&&"vector-uv"===this.rasterInfo.dataType?"geographic":y?.rotationType||e.rotationType,type:"vectorField"}}};function _(e){return p(e)&&0!==e.validPixelCount}e([o({json:{write:!0}})],C.prototype,"rendererJSON",void 0),e([o({type:n,json:{write:!0}})],C.prototype,"rasterInfo",void 0),e([o({json:{write:!0}})],C.prototype,"lookup",void 0),e([o()],C.prototype,"canRenderInWebGL",void 0),C=e([a("esri.renderers.support.RasterSymbolizer")],C);const L=C;export{L as default};
package/rest/print.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{id as e}from"../kernel.js";import t from"../request.js";import i from"../core/Error.js";import{JSONMap as r}from"../core/jsonMap.js";import{createScreenPoint as a,pt2px as n,px2pt as s}from"../core/screenUtils.js";import{normalize as o,dataComponents as l}from"../core/urlUtils.js";import c from"../geometry/Polygon.js";import{collectLabelingFields as u}from"../layers/support/fieldUtils.js";import{getFloorFilterClause as y}from"../layers/support/floorFilterUtils.js";import{getSizeRangeAtScale as p}from"../renderers/visualVariables/support/visualVariableUtils.js";import{asValidOptions as f,getToken as m}from"./utils.js";import{execute as d}from"./geoprocessor/execute.js";import{submitJob as g}from"./geoprocessor/submitJob.js";import{toJSON as h}from"./support/fileFormat.js";import{toJSON as b}from"./support/layoutTemplate.js";import{getVisibleLayerViews as w,isScreenshotRequired as S,isBingMapsLayer as x,isCSVLayer as v,isBlendLayer as I,applyVisualVariables as D,getContextBoundingBox as L,createPolygonLayer as T,createPolylineLayer as E,createPointLayer as O,createMultipointLayer as M}from"./support/printTaskUtils.js";import V from"./support/PrintTemplate.js";import{toJSON as P}from"./support/reportTemplate.js";const F={Feet:"ft",Kilometers:"km",Meters:"m",Miles:"mi"},R=new r({esriFeet:"Feet",esriKilometers:"Kilometers",esriMeters:"Meters",esriMiles:"Miles"}),N=new r({esriExecutionTypeSynchronous:"sync",esriExecutionTypeAsynchronous:"async"}),J=new Map;async function U(e,i,r){const a=k(e);let n=J.get(a);return Promise.resolve().then((()=>n?{data:n.gpMetadata}:(n={gpServerUrl:a,is11xService:!1,legendLayerNameMap:{},legendLayers:[]},t(a,f({f:"json"},r))))).then((e=>(n.gpMetadata=e.data,n.cimVersion=n.gpMetadata.cimVersion,n.is11xService=!!n.cimVersion,J.set(a,n),C(i,n)))).then((t=>{const a=pe(n);let s;const o=e=>"sync"===a?e.results?.[0]?.value:s.fetchResultData("Output_File",null,r).then((e=>e.value));return"async"===a?g(e,t,void 0,r).then((e=>(s=e,e.waitForJobCompletion({interval:i.updateDelay}).then(o)))):d(e,t,void 0,r).then(o)}))}async function j(e){const t=k(e);return pe(J.get(t))}async function C(t,r){r=r||{is11xService:!1,legendLayerNameMap:{},legendLayers:[]};const a=t.template||new V;null==a.showLabels&&(a.showLabels=!0);const n=a.exportOptions;let s;const o=b(a.layout);if(n){if(s={dpi:n.dpi},"map_only"===o.toLowerCase()||""===o){const e=n.width,t=n.height;s.outputSize=null!=e&&null!=t?[e,t]:void 0}}const l=a.layoutOptions;let c;if(l){let e,t;"Miles"===l.scalebarUnit||"Kilometers"===l.scalebarUnit?(e="Kilometers",t="Miles"):"Meters"!==l.scalebarUnit&&"Feet"!==l.scalebarUnit||(e="Meters",t="Feet"),c={titleText:l.titleText,authorText:l.authorText,copyrightText:l.copyrightText,customTextElements:l.customTextElements,elementOverrides:l.elementOverrides,scaleBarOptions:{metricUnit:R.toJSON(e),metricLabel:e?F[e]:void 0,nonMetricUnit:R.toJSON(t),nonMetricLabel:t?F[t]:void 0}}}let u=null;l?.legendLayers&&(u=l.legendLayers.map((e=>{const t=e.layerId;r.legendLayerNameMap[t]=e.title;const i={id:t};return e.subLayerIds&&(i.subLayerIds=e.subLayerIds),i})));const y=await A(t,a,r);if(y.operationalLayers){const e=new RegExp("[\\u4E00-\\u9FFF\\u0E00-\\u0E7F\\u0900-\\u097F\\u3040-\\u309F\\u30A0-\\u30FF\\u31F0-\\u31FF]"),t=/[\u0600-\u06FF]/,a=i=>{const r=i.text,a=i.font,n=a?.family?.toLowerCase();r&&a&&("arial"===n||"arial unicode ms"===n)&&(a.family=e.test(r)?"Arial Unicode MS":"Arial","normal"!==a.style&&t.test(r)&&(a.family="Arial Unicode MS"))},n=()=>{throw new i("print:cim-symbol-unsupported","CIMSymbol is not supported by a print service published from ArcMap")};y.operationalLayers.forEach((e=>{e.featureCollection?.layers?e.featureCollection.layers.forEach((e=>{if(e.layerDefinition?.drawingInfo?.renderer?.symbol){const t=e.layerDefinition.drawingInfo.renderer;"esriTS"===t.symbol.type?a(t.symbol):"CIMSymbolReference"!==t.symbol.type||r.is11xService||n()}e.featureSet?.features&&e.featureSet.features.forEach((e=>{e.symbol&&("esriTS"===e.symbol.type?a(e.symbol):"CIMSymbolReference"!==e.symbol.type||r.is11xService||n())}))})):!r.is11xService&&e.layerDefinition?.drawingInfo?.renderer&&JSON.stringify(e.layerDefinition.drawingInfo.renderer).includes('"type":"CIMSymbolReference"')&&n()}))}t.outSpatialReference&&(y.mapOptions.spatialReference=t.outSpatialReference.toJSON()),Object.assign(y,{exportOptions:s,layoutOptions:c||{}}),Object.assign(y.layoutOptions,{legendOptions:{operationalLayers:null!=u?u:r.legendLayers.slice()}}),r.legendLayers.length=0,J.set(r.gpServerUrl,r);const p={Web_Map_as_JSON:JSON.stringify(y),Format:h(a.format),Layout_Template:o,Layout_Item_ID:void 0,Report_Template:P(a.report),Report_Item_ID:void 0};if(a.layoutItem){delete p.Layout_Template;const t=a.layoutItem;await t.load(),"public"!==t.access&&e&&await e.getCredential(r.gpServerUrl),p.Layout_Item_ID=JSON.stringify({id:t.id})}if(a.reportItem){delete p.Report_Template;const t=a.reportItem;await t.load(),"public"!==t.access&&e&&await e.getCredential(r.gpServerUrl),p.Report_Item_ID=JSON.stringify({id:t.id})}return t.extraParameters&&Object.assign(p,t.extraParameters),p}async function A(e,t,i){const r=e.view;let a=r.spatialReference;const n={operationalLayers:await _(r,t,i)};t.includeTables&&(n.tables=await ie(r));let s=i.ssExtent||e.extent||r.extent;if(a&&a.isWrappable&&(s=s.clone()._normalize(!0),a=s.spatialReference),n.mapOptions={extent:s&&s.toJSON(),spatialReference:a&&a.toJSON(),showAttribution:t.attributionVisible},i.ssExtent=null,r.background&&(n.background=r.background.toJSON()),r.rotation&&(n.mapOptions.rotation=-r.rotation),t.scalePreserved&&(n.mapOptions.scale=t.outScale||r.scale),null!=r.timeExtent){const e=null!=r.timeExtent.start?r.timeExtent.start.getTime():null,t=null!=r.timeExtent.end?r.timeExtent.end.getTime():null;n.mapOptions.time=[e,t]}return t.reportOptions&&(n.reportOptions=t.reportOptions),n}function k(e){let t=e;const i=t.lastIndexOf("/GPServer/");return i>0&&(t=t.slice(0,i+9)),t}async function _(e,t,i){const r=[],a={layerView:null,printTemplate:t,view:e};let n=0;t.scalePreserved&&(n=t.outScale||e.scale);const s=w(e,n);for(const o of s){const e=o.layer;if(!e.loaded||"group"===e?.type)continue;let t;a.layerView=o,t=S(o)?await ee(e,a,i):x(e)?z(e):v(e)?await $(e,a,i):"feature"===e?.type?await W(e,a,i):"geojson"===e?.type?await q(e,a,i):"graphics"===e?.type?await B(e,a,i):"imagery"===e?.type?G(e,i):"imagery-tile"===e?.type?await Q(e,a,i):"kml"===e?.type?await H(e,a,i):"map-image"===e?.type?X(e,a,i):"map-notes"===e?.type?await Y(a,i):"open-street-map"===e?.type?Z():"stream"===e?.type?await te(e,a,i):"tile"===e?.type?re(e,i):"vector-tile"===e?.type?await ae(e,a,i):"web-tile"===e?.type?ne(e):"wms"===e?.type?se(e,i):"wmts"===e?.type?oe(e):await ee(e,a,i),t&&(Array.isArray(t)?r.push(...t):(t.id=e.id,t.title=i.legendLayerNameMap[e.id]||e.title,t.opacity=e.opacity,t.minScale=e.minScale||0,t.maxScale=e.maxScale||0,I(e)&&e.blendMode&&"normal"!==e.blendMode&&(t.blendMode=e.blendMode),r.push(t)))}if(n&&r.forEach((e=>{e.minScale=0,e.maxScale=0})),e.graphics&&e.graphics.length){const a=await K(null,e.graphics,t,i);a&&r.push(a)}return r}function z(e){return{culture:e.culture,key:e.key,type:"BingMaps"+("aerial"===e.style?"Aerial":"hybrid"===e.style?"Hybrid":"Road")}}async function $(e,t,i){e.legendEnabled&&i.legendLayers.push({id:e.id});const r=t.layerView,a=t.printTemplate;let n;if(!i.is11xService||r.filter){return K(e,await ye(r),a,i)}return n={type:"CSV"},e.write(n,{origin:"web-map"}),delete n.popupInfo,delete n.layerType,n.showLabels=a.showLabels&&e.labelsVisible,n}async function K(e,t,i,r){let a;const n=T(),s=E(),o=O(),l=M(),y=O();if(y.layerDefinition.name="textLayer",delete y.layerDefinition.drawingInfo,e){if("esri.layers.FeatureLayer"===e.declaredClass||"esri.layers.StreamLayer"===e.declaredClass?n.layerDefinition.name=s.layerDefinition.name=o.layerDefinition.name=l.layerDefinition.name=r.legendLayerNameMap[e.id]||e.get("arcgisProps.title")||e.title:"esri.layers.GraphicsLayer"===e.declaredClass&&(t=e.graphics.items),e.renderer){const t=e.renderer.toJSON(),i=n.layerDefinition.drawingInfo;i&&(i.renderer=t);const r=s.layerDefinition.drawingInfo;r&&(r.renderer=t);const a=o.layerDefinition.drawingInfo;a&&(a.renderer=t);const c=l.layerDefinition.drawingInfo;c&&(c.renderer=t)}if(i.showLabels&&e.labelsVisible&&"function"==typeof e.write){const t=e.write({},{origin:"web-map"}),i=t.layerDefinition?.drawingInfo?.labelingInfo;if(i){a=!0;const e=n.layerDefinition.drawingInfo;e&&(e.labelingInfo=i);const t=s.layerDefinition.drawingInfo;t&&(t.labelingInfo=i);const r=o.layerDefinition.drawingInfo;r&&(r.labelingInfo=i);const c=l.layerDefinition.drawingInfo;c&&(c.labelingInfo=i)}}}let p;e?.renderer||a||(delete n.layerDefinition.drawingInfo,delete s.layerDefinition.drawingInfo,delete o.layerDefinition.drawingInfo,delete l.layerDefinition.drawingInfo);const f=e?.fieldsIndex,m=e?.renderer;if(f){const t=new Set;a&&await u(t,e),m&&"function"==typeof m.collectRequiredFields&&await m.collectRequiredFields(t,f),p=Array.from(t);const i=f.fields.map((e=>e.toJSON()));n.layerDefinition.fields=i,s.layerDefinition.fields=i,o.layerDefinition.fields=i,l.layerDefinition.fields=i}const d=t?.length;let g;for(let u=0;u<d;u++){const a=t[u]||t.at(u);if(!1===a.visible||!a.geometry)continue;if(g=a.toJSON(),g.hasOwnProperty("popupTemplate")&&delete g.popupTemplate,g.geometry?.z&&delete g.geometry.z,g.symbol?.outline&&"esriCLS"===g.symbol.outline.type&&!r.is11xService)continue;!r.is11xService&&g.symbol?.outline?.color?.[3]&&(g.symbol.outline.color[3]=255);const f=e?.renderer&&("valueExpression"in e.renderer&&e.renderer.valueExpression||"hasVisualVariables"in e.renderer&&e.renderer.hasVisualVariables());if(!g.symbol&&e?.renderer&&f&&!r.is11xService){const t=e.renderer,i=await t.getSymbolAsync(a);if(!i)continue;g.symbol=i.toJSON(),"hasVisualVariables"in t&&t.hasVisualVariables()&&D(g.symbol,{renderer:t,graphic:a,symbol:i})}if(g.symbol&&(g.symbol.angle||delete g.symbol.angle,fe(g.symbol)?g.symbol=await ce(g.symbol,r):g.symbol.text&&delete g.attributes),(!i||!i.forceFeatureAttributes)&&p?.length){const e={};p.forEach((t=>{g.attributes?.hasOwnProperty(t)&&(e[t]=g.attributes[t])})),g.attributes=e}"polygon"===a.geometry.type?n.featureSet.features.push(g):"polyline"===a.geometry.type?s.featureSet.features.push(g):"point"===a.geometry.type?g.symbol?.text?y.featureSet.features.push(g):o.featureSet.features.push(g):"multipoint"===a.geometry.type?l.featureSet.features.push(g):"extent"===a.geometry.type&&(g.geometry=c.fromExtent(a.geometry).toJSON(),n.featureSet.features.push(g))}const h=[n,s,l,o,y].filter((e=>e.featureSet.features.length>0));for(const c of h){const e=c.featureSet.features.every((e=>e.symbol));!e||i&&i.forceFeatureAttributes||c.featureSet.features.forEach((e=>{delete e.attributes})),e&&delete c.layerDefinition.drawingInfo,c.layerDefinition.drawingInfo?.renderer&&await ue(c.layerDefinition.drawingInfo.renderer,r)}return h.length?{featureCollection:{layers:h},showLabels:a}:null}async function W(e,t,i){let r;const a=e.renderer,n=parseFloat(i.cimVersion);if("binning"===e.featureReduction?.type||"cluster"===e.featureReduction?.type&&(!i.is11xService||n<2.9)||"pie-chart"===a?.type||"dot-density"===a?.type&&(!i.is11xService||n<2.6))return ee(e,t,i);e.legendEnabled&&i.legendLayers.push({id:e.id});const s=t.layerView,{printTemplate:o,view:l}=t,c=a&&("valueExpression"in a&&a.valueExpression||"hasVisualVariables"in a&&a.hasVisualVariables()),u="feature-layer"!==e.source?.type&&"ogc-feature"!==e.source?.type;if(!i.is11xService&&c||s.filter||u||!a||"field"in a&&null!=a.field&&("string"!=typeof a.field||!e.getField(a.field))){const t=await ye(s);r=await K(e,t,o,i)}else{if(r={id:(f=e.write()).id,title:f.title,opacity:f.opacity,minScale:f.minScale,maxScale:f.maxScale,url:f.url,layerType:f.layerType,customParameters:f.customParameters,layerDefinition:f.layerDefinition,charts:o.includeCharts?f.charts:void 0},r.showLabels=o.showLabels&&e.labelsVisible,le(r,e),r.layerDefinition?.drawingInfo?.renderer&&(delete r.layerDefinition.minScale,delete r.layerDefinition.maxScale,await ue(r.layerDefinition.drawingInfo.renderer,i),"visualVariables"in a&&a.visualVariables&&a.visualVariables[0])){const e=a.visualVariables[0];if("size"===e.type&&e.maxSize&&"number"!=typeof e.maxSize&&e.minSize&&"number"!=typeof e.minSize){const t=p(e,l.scale);r.layerDefinition.drawingInfo.renderer.visualVariables[0].minSize=t.minSize,r.layerDefinition.drawingInfo.renderer.visualVariables[0].maxSize=t.maxSize}}const t=y(s);t&&(r.layerDefinition||(r.layerDefinition={}),r.layerDefinition.definitionExpression=r.layerDefinition.definitionExpression?`(${r.layerDefinition.definitionExpression}) AND (${t})`:t)}var f;return r}async function q(e,t,i){if("binning"===e.featureReduction?.type||"cluster"===e.featureReduction?.type)return ee(e,t,i);e.legendEnabled&&i.legendLayers.push({id:e.id});return K(e,await ye(t.layerView),t.printTemplate,i)}async function B(e,{printTemplate:t},i){return K(e,null,t,i)}function G(e,t){e.legendEnabled&&t.legendLayers.push({id:e.id});const i={layerType:(r=e.write()).layerType,customParameters:r.customParameters};var r;if(i.bandIds=e.bandIds,i.compressionQuality=e.compressionQuality,i.format=e.format,i.interpolation=e.interpolation,(e.mosaicRule||e.definitionExpression)&&(i.mosaicRule=e.exportImageServiceParameters.mosaicRule.toJSON()),e.rasterFunction||e.renderer)if(t.is11xService)e.rasterFunction&&(i.renderingRule=e.rasterFunction.toJSON()),e.renderer&&(i.layerDefinition=i.layerDefinition||{},i.layerDefinition.drawingInfo=i.layerDefinition.drawingInfo||{},i.layerDefinition.drawingInfo.renderer=e.renderer.toJSON());else{const t=e.exportImageServiceParameters.combineRendererWithRenderingRule();t&&(i.renderingRule=t.toJSON())}return le(i,e),i}async function Q(e,t,i){if("flow"===e.renderer?.type)return ee(e,t,i);e.legendEnabled&&i.legendLayers.push({id:e.id});const r={bandIds:(a=e.write()||{}).bandIds,customParameters:a.customParameters,interpolation:a.interpolation,layerDefinition:a.layerDefinition};var a;return r.layerType="ArcGISImageServiceLayer",le(r,e),r}async function H(e,t,i){const r=t.printTemplate;if(i.is11xService){const t={type:"kml"};return e.write(t,{origin:"web-map"}),delete t.layerType,t.url=o(e.url),t}{const a=[],n=t.layerView;n.allVisibleMapImages.forEach(((t,i)=>{const r={id:`${e.id}_image${i}`,type:"image",title:e.id,minScale:e.minScale||0,maxScale:e.maxScale||0,opacity:e.opacity,extent:t.extent};"data:image/png;base64,"===t.href.substr(0,22)?r.imageData=t.href.substr(22):r.url=t.href,a.push(r)}));const s=[...n.allVisiblePoints.items,...n.allVisiblePolylines.items,...n.allVisiblePolygons.items],o={id:e.id,...await K(null,s,r,i)};return a.push(o),a}}function X(e,{view:t},i){let r;const a={id:e.id,subLayerIds:[]};let n=[];const s=t.scale,o=e=>{const t=0===s,i=0===e.minScale||s<=e.minScale,r=0===e.maxScale||s>=e.maxScale;if(e.visible&&(t||i&&r))if(e.sublayers)e.sublayers.forEach(o);else{const t=e.toExportImageJSON(),i={id:e.id,name:e.title,layerDefinition:{drawingInfo:t.drawingInfo,definitionExpression:t.definitionExpression,source:t.source}};n.unshift(i),a.subLayerIds.push(e.id)}};var l;return e.sublayers&&e.sublayers.forEach(o),n.length&&(n=n.map((({id:e,name:t,layerDefinition:i})=>({id:e,name:t,layerDefinition:i}))),r={layerType:(l=e.write()).layerType,customParameters:l.customParameters},r.layers=n,r.visibleLayers=e.capabilities?.exportMap?.supportsDynamicLayers?void 0:a.subLayerIds,le(r,e),e.legendEnabled&&i.legendLayers.push(a)),r}async function Y({layerView:e,printTemplate:t},i){const r=[],a=e.layer;if(null!=a.featureCollections)for(const n of a.featureCollections){const e=await K(n,n.source,t,i);e&&r.push(...e.featureCollection.layers)}else if(null!=a.sublayers)for(const n of a.sublayers){const e=await K(null,n.graphics,t,i);e&&r.push(...e.featureCollection.layers)}return{featureCollection:{layers:r}}}function Z(){return{type:"OpenStreetMap"}}async function ee(e,{printTemplate:t,view:i},r){const n={type:"image"},s={format:"png",ignoreBackground:!0,layers:[e],rotation:0},o=r.ssExtent||i.extent.clone();let c=96,u=!0,y=!0;if(t.exportOptions){const e=t.exportOptions;null!=e.dpi&&e.dpi>0&&(c=e.dpi),null!=e.width&&e.width>0&&(u=e.width%2==i.width%2),null!=e.height&&e.height>0&&(y=e.height%2==i.height%2)}if("map-only"===t.layout&&t.scalePreserved&&(!t.outScale||t.outScale===i.scale)&&96===c&&(!u||!y)&&(s.area={x:0,y:0,width:i.width,height:i.height},u||(s.area.width-=1),y||(s.area.height-=1),!r.ssExtent)){const e=i.toMap(a(s.area.width,s.area.height));o.ymin=e.y,o.xmax=e.x,r.ssExtent=o}n.extent=o.clone()._normalize(!0).toJSON();const p=await i.takeScreenshot(s);return n.imageData=l(p.dataUrl)?.data,n}async function te(e,{layerView:t,printTemplate:i},r){e.legendEnabled&&r.legendLayers.push({id:e.id});return K(e,await ye(t),i,r)}async function ie(e){const t=[],i=[];for(const a of e.map.allTables)"feature"!==a.type||a.loaded||i.push(a.load());i.length&&await Promise.allSettled(i);for(const a of e.map.allTables)if("feature"===a.type&&a.loaded&&a.isTable&&"feature-layer"===a.source?.type){const e={id:(r=a.write()).id,title:r.title,customParameters:r.customParameters,layerDefinition:{definitionExpression:r.layerDefinition?.definitionExpression}};le(e,a),t.push(e)}var r;return t.length?t:void 0}function re(e,t){e.legendEnabled&&t.legendLayers.push({id:e.id});const i={layerType:(r=e.write()).layerType,customParameters:r.customParameters};var r;return le(i,e),i}async function ae(e,t,i){if(i.is11xService&&e.serviceUrl&&e.styleUrl){const t=m(e.styleUrl,e.apiKey),r=m(e.serviceUrl,e.apiKey);if(!t&&!r||"2.1.0"!==i.cimVersion){const i={type:"VectorTileLayer"};return i.styleUrl=o(e.styleUrl),i.token=t,r!==t&&(i.additionalTokens=[{url:e.serviceUrl,token:r}]),i}}return ee(e,t,i)}function ne(e){const t=e.urlTemplate?.replace(/\${/g,"{"),i={type:"WebTiledLayer",urlTemplate:t,credits:e.copyright};return e.subDomains&&e.subDomains.length>0&&(i.subDomains=e.subDomains),i}function se(e,t){let i;const r=[],a=e=>{e.visible&&(e.sublayers?e.sublayers.forEach(a):e.name&&r.unshift(e.name))};return e.sublayers&&e.sublayers.forEach(a),r.length&&(e.legendEnabled&&t.legendLayers.push({id:e.id,subLayerIds:r}),i={type:"wms",customLayerParameters:e.customLayerParameters,customParameters:e.customParameters,transparentBackground:e.imageTransparency,visibleLayers:r,url:o(e.url),version:e.version}),i}function oe(e){const t=e.activeLayer;return{type:"wmts",customLayerParameters:e.customLayerParameters,customParameters:e.customParameters,format:t.imageFormat,layer:t.id,style:t.styleId,tileMatrixSet:t.tileMatrixSetId,url:o(e.url)}}function le(e,t){t.url&&(e.url=o(e.url||t.url),e.token=m(e.url,t.apiKey))}async function ce(e,i){i.canvas||(i.canvas=document.createElement("canvas"));const r=1024;i.canvas.width=r,i.canvas.height=r;const a=i.canvas.getContext("2d");let o,l;if(e.path){const t=new Path2D(e.path);t.closePath(),a.fillStyle=Array.isArray(e.color)?`rgba(${e.color[0]},${e.color[1]},${e.color[2]},${e.color[3]/255})`:"rgb(0,0,0)",a.fill(t);const i=L(a);if(!i)return null;a.clearRect(0,0,r,r);const s=n(e.size)/Math.max(i.width,i.height);a.scale(s,s);const c=r/s,u=c/2-i.width/2-i.x,y=c/2-i.height/2-i.y;if(a.translate(u,y),Array.isArray(e.color)&&a.fill(t),e.outline?.width&&Array.isArray(e.outline.color)){const r=e.outline;a.lineWidth=n(r.width)/s,a.lineJoin="round",a.strokeStyle=`rgba(${r.color[0]},${r.color[1]},${r.color[2]},${r.color[3]/255})`,a.stroke(t),i.width+=a.lineWidth,i.height+=a.lineWidth}i.width*=s,i.height*=s;const p=a.getImageData(r/2-i.width/2,r/2-i.height/2,Math.ceil(i.width),Math.ceil(i.height));o=p.width,l=p.height,a.canvas.width=o,a.canvas.height=l,a.putImageData(p,0,0)}else{const i="image/svg+xml"===e.contentType?"data:image/svg+xml;base64,"+e.imageData:e.url,r=(await t(i,{responseType:"image"})).data;o=n(e.width),l=n(e.height),a.canvas.width=o,a.canvas.height=l,a.drawImage(r,0,0,a.canvas.width,a.canvas.height)}return{type:"esriPMS",imageData:a.canvas.toDataURL("image/png").substr(22),angle:e.angle,contentType:"image/png",height:s(l),width:s(o),xoffset:e.xoffset,yoffset:e.yoffset}}async function ue(e,t){const i=e.type;if("simple"===i&&fe(e.symbol))e.symbol=await ce(e.symbol,t);else if("uniqueValue"===i||"classBreaks"===i){fe(e.defaultSymbol)&&(e.defaultSymbol=await ce(e.defaultSymbol,t));const r=e["uniqueValue"===i?"uniqueValueInfos":"classBreakInfos"];if(r)for(const e of r)fe(e.symbol)&&(e.symbol=await ce(e.symbol,t))}}async function ye(e){return e.queryFeatures(e.createQuery()).then((e=>e.features))}function pe(e){return e.gpMetadata?.executionType?N.fromJSON(e.gpMetadata.executionType):"sync"}function fe(e){return e&&(e.path||"image/svg+xml"===e.contentType||e.url?.endsWith(".svg"))}export{U as execute,C as getGpPrintParams,k as getGpServerUrl,j as getMode,J as printCacheMap};
5
+ import{id as e}from"../kernel.js";import t from"../request.js";import i from"../core/Error.js";import{JSONMap as r}from"../core/jsonMap.js";import{createScreenPoint as a,pt2px as n,px2pt as s}from"../core/screenUtils.js";import{normalize as o,dataComponents as l}from"../core/urlUtils.js";import c from"../geometry/Polygon.js";import{collectLabelingFields as u}from"../layers/support/fieldUtils.js";import{getFloorFilterClause as y}from"../layers/support/floorFilterUtils.js";import{getSizeRangeAtScale as p}from"../renderers/visualVariables/support/visualVariableUtils.js";import{asValidOptions as f,getToken as m}from"./utils.js";import{execute as d}from"./geoprocessor/execute.js";import{submitJob as g}from"./geoprocessor/submitJob.js";import{toJSON as h}from"./support/fileFormat.js";import{toJSON as b}from"./support/layoutTemplate.js";import{getVisibleLayerViews as w,isScreenshotRequired as S,isBingMapsLayer as x,isCSVLayer as v,isBlendLayer as I,applyVisualVariables as D,getContextBoundingBox as L,createPolygonLayer as T,createPolylineLayer as E,createPointLayer as O,createMultipointLayer as M}from"./support/printTaskUtils.js";import V from"./support/PrintTemplate.js";import{toJSON as P}from"./support/reportTemplate.js";const F={Feet:"ft",Kilometers:"km",Meters:"m",Miles:"mi"},R=new r({esriFeet:"Feet",esriKilometers:"Kilometers",esriMeters:"Meters",esriMiles:"Miles"}),N=new r({esriExecutionTypeSynchronous:"sync",esriExecutionTypeAsynchronous:"async"}),J=new Map;async function U(e,i,r){const a=k(e);let n=J.get(a);return Promise.resolve().then((()=>n?{data:n.gpMetadata}:(n={gpServerUrl:a,is11xService:!1,legendLayerNameMap:{},legendLayers:[]},t(a,f({f:"json"},r))))).then((e=>(n.gpMetadata=e.data,n.cimVersion=n.gpMetadata.cimVersion,n.is11xService=!!n.cimVersion,J.set(a,n),C(i,n)))).then((t=>{const a=pe(n);let s;const o=e=>"sync"===a?e.results?.[0]?.value:s.fetchResultData("Output_File",null,r).then((e=>e.value));return"async"===a?g(e,t,void 0,r).then((e=>(s=e,e.waitForJobCompletion({interval:i.updateDelay}).then(o)))):d(e,t,void 0,r).then(o)}))}async function j(e){const t=k(e);return pe(J.get(t))}async function C(t,r){r=r||{is11xService:!1,legendLayerNameMap:{},legendLayers:[]};const a=t.template||new V;null==a.showLabels&&(a.showLabels=!0);const n=a.exportOptions;let s;const o=b(a.layout);if(n){if(s={dpi:n.dpi},"map_only"===o.toLowerCase()||""===o){const e=n.width,t=n.height;s.outputSize=null!=e&&null!=t?[e,t]:void 0}}const l=a.layoutOptions;let c;if(l){let e,t;"Miles"===l.scalebarUnit||"Kilometers"===l.scalebarUnit?(e="Kilometers",t="Miles"):"Meters"!==l.scalebarUnit&&"Feet"!==l.scalebarUnit||(e="Meters",t="Feet"),c={titleText:l.titleText,authorText:l.authorText,copyrightText:l.copyrightText,customTextElements:l.customTextElements,elementOverrides:l.elementOverrides,scaleBarOptions:{metricUnit:R.toJSON(e),metricLabel:e?F[e]:void 0,nonMetricUnit:R.toJSON(t),nonMetricLabel:t?F[t]:void 0}}}let u=null;l?.legendLayers&&(u=l.legendLayers.map((e=>{const t=e.layerId;r.legendLayerNameMap[t]=e.title;const i={id:t};return e.subLayerIds&&(i.subLayerIds=e.subLayerIds),i})));const y=await A(t,a,r);if(y.operationalLayers){const e=new RegExp("[\\u4E00-\\u9FFF\\u0E00-\\u0E7F\\u0900-\\u097F\\u3040-\\u309F\\u30A0-\\u30FF\\u31F0-\\u31FF]"),t=/[\u0600-\u06FF]/,a=i=>{const r=i.text,a=i.font,n=a?.family?.toLowerCase();r&&a&&("arial"===n||"arial unicode ms"===n)&&(a.family=e.test(r)?"Arial Unicode MS":"Arial","normal"!==a.style&&t.test(r)&&(a.family="Arial Unicode MS"))},n=()=>{throw new i("print:cim-symbol-unsupported","CIMSymbol is not supported by a print service published from ArcMap")};y.operationalLayers.forEach((e=>{e.featureCollection?.layers?e.featureCollection.layers.forEach((e=>{if(e.layerDefinition?.drawingInfo?.renderer?.symbol){const t=e.layerDefinition.drawingInfo.renderer;"esriTS"===t.symbol.type?a(t.symbol):"CIMSymbolReference"!==t.symbol.type||r.is11xService||n()}e.featureSet?.features&&e.featureSet.features.forEach((e=>{e.symbol&&("esriTS"===e.symbol.type?a(e.symbol):"CIMSymbolReference"!==e.symbol.type||r.is11xService||n())}))})):!r.is11xService&&e.layerDefinition?.drawingInfo?.renderer&&JSON.stringify(e.layerDefinition.drawingInfo.renderer).includes('"type":"CIMSymbolReference"')&&n()}))}t.outSpatialReference&&(y.mapOptions.spatialReference=t.outSpatialReference.toJSON()),Object.assign(y,{exportOptions:s,layoutOptions:c||{}}),Object.assign(y.layoutOptions,{legendOptions:{operationalLayers:null!=u?u:r.legendLayers.slice()}}),r.legendLayers.length=0,J.set(r.gpServerUrl,r);const p={Web_Map_as_JSON:JSON.stringify(y),Format:h(a.format),Layout_Template:o,Layout_Item_ID:void 0,Report_Template:P(a.report),Report_Item_ID:void 0};if(a.layoutItem){delete p.Layout_Template;const t=a.layoutItem;await t.load(),"public"!==t.access&&e&&await e.getCredential(r.gpServerUrl),p.Layout_Item_ID=JSON.stringify({id:t.id})}if(a.reportItem){delete p.Report_Template;const t=a.reportItem;await t.load(),"public"!==t.access&&e&&await e.getCredential(r.gpServerUrl),p.Report_Item_ID=JSON.stringify({id:t.id})}return t.extraParameters&&Object.assign(p,t.extraParameters),p}async function A(e,t,i){const r=e.view;let a=r.spatialReference;const n={operationalLayers:await _(r,t,i)};t.includeTables&&(n.tables=await ie(r));let s=i.ssExtent||e.extent||r.extent;if(a&&a.isWrappable&&(s=s.clone()._normalize(!0),a=s.spatialReference),n.mapOptions={extent:s&&s.toJSON(),spatialReference:a&&a.toJSON(),showAttribution:t.attributionVisible},i.ssExtent=null,r.background&&(n.background=r.background.toJSON()),r.rotation&&(n.mapOptions.rotation=-r.rotation),t.scalePreserved&&(n.mapOptions.scale=t.outScale||r.scale),null!=r.timeExtent){const e=null!=r.timeExtent.start?r.timeExtent.start.getTime():null,t=null!=r.timeExtent.end?r.timeExtent.end.getTime():null;n.mapOptions.time=[e,t]}return t.reportOptions&&(n.reportOptions=t.reportOptions),n}function k(e){let t=e;const i=t.lastIndexOf("/GPServer/");return i>0&&(t=t.slice(0,i+9)),t}async function _(e,t,i){const r=[],a={layerView:null,printTemplate:t,view:e};let n=0;t.scalePreserved&&(n=t.outScale||e.scale);const s=w(e,n);for(const o of s){const e=o.layer;if(!e.loaded||"group"===e?.type)continue;let t;a.layerView=o,t=S(o)?await ee(e,a,i):x(e)?z(e):v(e)?await $(e,a,i):"feature"===e?.type?await W(e,a,i):"geojson"===e?.type?await q(e,a,i):"graphics"===e?.type?await B(e,a,i):"imagery"===e?.type?G(e,i):"imagery-tile"===e?.type?await Q(e,a,i):"kml"===e?.type?await H(e,a,i):"map-image"===e?.type?X(e,a,i):"map-notes"===e?.type?await Y(a,i):"open-street-map"===e?.type?Z():"stream"===e?.type?await te(e,a,i):"tile"===e?.type?re(e,i):"vector-tile"===e?.type?await ae(e,a,i):"web-tile"===e?.type?ne(e):"wms"===e?.type?se(e,i):"wmts"===e?.type?oe(e):await ee(e,a,i),t&&(Array.isArray(t)?r.push(...t):(t.id=e.id,t.title=i.legendLayerNameMap[e.id]||e.title,t.opacity=e.opacity,t.minScale=e.minScale||0,t.maxScale=e.maxScale||0,I(e)&&e.blendMode&&"normal"!==e.blendMode&&(t.blendMode=e.blendMode),r.push(t)))}if(n&&r.forEach((e=>{e.minScale=0,e.maxScale=0})),e.graphics&&e.graphics.length){const a=await K(null,e.graphics,t,i);a&&r.push(a)}return r}function z(e){return{culture:e.culture,key:e.key,type:"BingMaps"+("aerial"===e.style?"Aerial":"hybrid"===e.style?"Hybrid":"Road")}}async function $(e,t,i){e.legendEnabled&&i.legendLayers.push({id:e.id});const r=t.layerView,a=t.printTemplate;let n;if(!i.is11xService||r.filter){return K(e,await ye(r),a,i)}return n={type:"CSV"},e.write(n,{origin:"web-map"}),delete n.popupInfo,delete n.layerType,n.showLabels=a.showLabels&&e.labelsVisible,n}async function K(e,t,i,r){let a;const n=T(),s=E(),o=O(),l=M(),y=O();if(y.layerDefinition.name="textLayer",delete y.layerDefinition.drawingInfo,e){if("esri.layers.FeatureLayer"===e.declaredClass||"esri.layers.StreamLayer"===e.declaredClass?n.layerDefinition.name=s.layerDefinition.name=o.layerDefinition.name=l.layerDefinition.name=r.legendLayerNameMap[e.id]||e.get("arcgisProps.title")||e.title:"esri.layers.GraphicsLayer"===e.declaredClass&&(t=e.graphics.items),e.renderer){const t=e.renderer.toJSON(),i=n.layerDefinition.drawingInfo;i&&(i.renderer=t);const r=s.layerDefinition.drawingInfo;r&&(r.renderer=t);const a=o.layerDefinition.drawingInfo;a&&(a.renderer=t);const c=l.layerDefinition.drawingInfo;c&&(c.renderer=t)}if(i.showLabels&&e.labelsVisible&&"function"==typeof e.write){const t=e.write({},{origin:"web-map"}),i=t.layerDefinition?.drawingInfo?.labelingInfo;if(i){a=!0;const e=n.layerDefinition.drawingInfo;e&&(e.labelingInfo=i);const t=s.layerDefinition.drawingInfo;t&&(t.labelingInfo=i);const r=o.layerDefinition.drawingInfo;r&&(r.labelingInfo=i);const c=l.layerDefinition.drawingInfo;c&&(c.labelingInfo=i)}}}let p;e?.renderer||a||(delete n.layerDefinition.drawingInfo,delete s.layerDefinition.drawingInfo,delete o.layerDefinition.drawingInfo,delete l.layerDefinition.drawingInfo);const f=e?.fieldsIndex,m=e?.renderer;if(f){const t=new Set;a&&await u(t,e),m&&"function"==typeof m.collectRequiredFields&&await m.collectRequiredFields(t,f),p=Array.from(t);const i=f.fields.map((e=>e.toJSON()));n.layerDefinition.fields=i,s.layerDefinition.fields=i,o.layerDefinition.fields=i,l.layerDefinition.fields=i}const d=t?.length;let g;for(let u=0;u<d;u++){const a=t[u]||t.at(u);if(!1===a.visible||!a.geometry)continue;if(g=a.toJSON(),g.hasOwnProperty("popupTemplate")&&delete g.popupTemplate,g.geometry?.z&&delete g.geometry.z,g.symbol?.outline&&"esriCLS"===g.symbol.outline.type&&!r.is11xService)continue;!r.is11xService&&g.symbol?.outline?.color?.[3]&&(g.symbol.outline.color[3]=255);const f=e?.renderer&&("valueExpression"in e.renderer&&e.renderer.valueExpression||"hasVisualVariables"in e.renderer&&e.renderer.hasVisualVariables());if(!g.symbol&&e?.renderer&&f&&!r.is11xService){const t=e.renderer,i=await t.getSymbolAsync(a);if(!i)continue;g.symbol=i.toJSON(),"hasVisualVariables"in t&&t.hasVisualVariables()&&D(g.symbol,{renderer:t,graphic:a,symbol:i})}if(g.symbol&&(g.symbol.angle||delete g.symbol.angle,fe(g.symbol)?g.symbol=await ce(g.symbol,r):g.symbol.text&&delete g.attributes),(!i||!i.forceFeatureAttributes)&&p?.length){const e={};p.forEach((t=>{g.attributes?.hasOwnProperty(t)&&(e[t]=g.attributes[t])})),g.attributes=e}"polygon"===a.geometry.type?n.featureSet.features.push(g):"polyline"===a.geometry.type?s.featureSet.features.push(g):"point"===a.geometry.type?g.symbol?.text?y.featureSet.features.push(g):o.featureSet.features.push(g):"multipoint"===a.geometry.type?l.featureSet.features.push(g):"extent"===a.geometry.type&&(g.geometry=c.fromExtent(a.geometry).toJSON(),n.featureSet.features.push(g))}const h=[n,s,l,o,y].filter((e=>e.featureSet.features.length>0));for(const c of h){const e=c.featureSet.features.every((e=>e.symbol));!e||i&&i.forceFeatureAttributes||c.featureSet.features.forEach((e=>{delete e.attributes})),e&&delete c.layerDefinition.drawingInfo,c.layerDefinition.drawingInfo?.renderer&&await ue(c.layerDefinition.drawingInfo.renderer,r)}return h.length?{featureCollection:{layers:h},showLabels:a}:null}async function W(e,t,i){let r;const a=e.renderer,n=parseFloat(i.cimVersion);if("binning"===e.featureReduction?.type||"cluster"===e.featureReduction?.type&&(!i.is11xService||n<2.9)||"pie-chart"===a?.type||"dot-density"===a?.type&&(!i.is11xService||n<2.6))return ee(e,t,i);e.legendEnabled&&i.legendLayers.push({id:e.id});const s=t.layerView,{printTemplate:o,view:l}=t,c=a&&("valueExpression"in a&&a.valueExpression||"hasVisualVariables"in a&&a.hasVisualVariables()),u="feature-layer"!==e.source?.type&&"ogc-feature"!==e.source?.type;if(!i.is11xService&&c||s.filter||u||!a||"field"in a&&null!=a.field&&("string"!=typeof a.field||!e.getField(a.field))){const t=await ye(s);r=await K(e,t,o,i)}else{if(r={id:(f=e.write()).id,title:f.title,opacity:f.opacity,minScale:f.minScale,maxScale:f.maxScale,url:f.url,layerType:f.layerType,customParameters:f.customParameters,layerDefinition:f.layerDefinition,charts:o.includeCharts?f.charts:void 0},r.showLabels=o.showLabels&&e.labelsVisible,le(r,e),r.layerDefinition?.drawingInfo?.renderer&&(delete r.layerDefinition.minScale,delete r.layerDefinition.maxScale,await ue(r.layerDefinition.drawingInfo.renderer,i),"visualVariables"in a&&a.visualVariables&&a.visualVariables[0])){const e=a.visualVariables[0];if("size"===e.type&&e.maxSize&&"number"!=typeof e.maxSize&&e.minSize&&"number"!=typeof e.minSize){const t=p(e,l.scale);r.layerDefinition.drawingInfo.renderer.visualVariables[0].minSize=t.minSize,r.layerDefinition.drawingInfo.renderer.visualVariables[0].maxSize=t.maxSize}}const t=y(s);t&&(r.layerDefinition||(r.layerDefinition={}),r.layerDefinition.definitionExpression=r.layerDefinition.definitionExpression?`(${r.layerDefinition.definitionExpression}) AND (${t})`:t)}var f;return r}async function q(e,t,i){if("binning"===e.featureReduction?.type||"cluster"===e.featureReduction?.type)return ee(e,t,i);e.legendEnabled&&i.legendLayers.push({id:e.id});return K(e,await ye(t.layerView),t.printTemplate,i)}async function B(e,{printTemplate:t},i){return K(e,null,t,i)}function G(e,t){e.legendEnabled&&t.legendLayers.push({id:e.id});const i={layerType:(r=e.write()).layerType,customParameters:r.customParameters};var r;if(i.bandIds=e.bandIds,i.compressionQuality=e.compressionQuality,i.format=e.format,i.interpolation=e.interpolation,(e.mosaicRule||e.definitionExpression)&&(i.mosaicRule=e.exportImageServiceParameters.mosaicRule.toJSON()),e.rasterFunction||e.renderer)if(t.is11xService)e.rasterFunction&&(i.renderingRule=e.rasterFunction.toJSON()),e.renderer&&(i.layerDefinition=i.layerDefinition||{},i.layerDefinition.drawingInfo=i.layerDefinition.drawingInfo||{},i.layerDefinition.drawingInfo.renderer=e.renderer.toJSON());else{const t=e.exportImageServiceParameters.combineRendererWithRenderingRule();t&&(i.renderingRule=t.toJSON())}return le(i,e),i}async function Q(e,t,i){if("flow"===e.renderer?.type)return ee(e,t,i);e.legendEnabled&&i.legendLayers.push({id:e.id});const r={bandIds:(a=e.write()||{}).bandIds,customParameters:a.customParameters,interpolation:a.interpolation,layerDefinition:a.layerDefinition};var a;return r.layerType="ArcGISImageServiceLayer",le(r,e),r}async function H(e,t,i){const r=t.printTemplate;if(i.is11xService){const t={type:"kml"};return e.write(t,{origin:"web-map"}),delete t.layerType,t.url=o(e.url),t}{const a=[],n=t.layerView;n.allVisibleMapImages.forEach(((t,i)=>{const r={id:`${e.id}_image${i}`,type:"image",title:e.id,minScale:e.minScale||0,maxScale:e.maxScale||0,opacity:e.opacity,extent:t.extent};"data:image/png;base64,"===t.href.substr(0,22)?r.imageData=t.href.substr(22):r.url=t.href,a.push(r)}));const s=[...n.allVisiblePoints.items,...n.allVisiblePolylines.items,...n.allVisiblePolygons.items],o={id:e.id,...await K(null,s,r,i)};return a.push(o),a}}function X(e,{view:t},i){let r;const a={id:e.id,subLayerIds:[]};let n=[];const s=t.scale,o=e=>{const t=0===s,i=0===e.minScale||s<=e.minScale,r=0===e.maxScale||s>=e.maxScale;if(e.visible&&(t||i&&r))if(e.sublayers)e.sublayers.forEach(o);else{const t=e.toExportImageJSON(),i={id:e.id,name:e.title,layerDefinition:{drawingInfo:t.drawingInfo,definitionExpression:t.definitionExpression,source:t.source}};n.unshift(i),a.subLayerIds.push(e.id)}};var l;return e.sublayers&&e.sublayers.forEach(o),n.length&&(n=n.map((({id:e,name:t,layerDefinition:i})=>({id:e,name:t,layerDefinition:i}))),r={layerType:(l=e.write()).layerType,customParameters:l.customParameters},r.layers=n,r.visibleLayers=e.capabilities?.exportMap?.supportsDynamicLayers?void 0:a.subLayerIds,le(r,e),e.legendEnabled&&i.legendLayers.push(a)),r}async function Y({layerView:e,printTemplate:t},i){const r=[],a=e.layer;if(null!=a.featureCollections)for(const n of a.featureCollections){const e=await K(n,n.source,t,i);e&&r.push(...e.featureCollection.layers)}else if(null!=a.sublayers)for(const n of a.sublayers){const e=await K(null,n.graphics,t,i);e&&r.push(...e.featureCollection.layers)}return{featureCollection:{layers:r}}}function Z(){return{type:"OpenStreetMap"}}async function ee(e,{printTemplate:t,view:i},r){const n={type:"image"},s={format:"png",ignoreBackground:!0,layers:[e],rotation:0},o=r.ssExtent||i.extent.clone();let c=96,u=!0,y=!0;if(t.exportOptions){const e=t.exportOptions;null!=e.dpi&&e.dpi>0&&(c=e.dpi),null!=e.width&&e.width>0&&(u=e.width%2==i.width%2),null!=e.height&&e.height>0&&(y=e.height%2==i.height%2)}if("map-only"===t.layout&&t.scalePreserved&&(!t.outScale||t.outScale===i.scale)&&96===c&&(!u||!y)&&(s.area={x:0,y:0,width:i.width,height:i.height},u||(s.area.width-=1),y||(s.area.height-=1),!r.ssExtent)){const e=i.toMap(a(s.area.width,s.area.height));o.ymin=e.y,o.xmax=e.x,r.ssExtent=o}n.extent=o.clone()._normalize(!0).toJSON();const p=await i.takeScreenshot(s);return n.imageData=l(p.dataUrl)?.data,n}async function te(e,{layerView:t,printTemplate:i},r){e.legendEnabled&&r.legendLayers.push({id:e.id});return K(e,await ye(t),i,r)}async function ie(e){const t=[],i=[];for(const a of e.map.allTables)"feature"!==a.type||a.loaded||i.push(a.load());i.length&&await Promise.allSettled(i);for(const a of e.map.allTables)if("feature"===a.type&&a.loaded&&a.isTable&&"feature-layer"===a.source?.type){const e={id:(r=a.write()).id,title:r.title,customParameters:r.customParameters,layerDefinition:{definitionExpression:r.layerDefinition?.definitionExpression},url:r.url};le(e,a),t.push(e)}var r;return t.length?t:void 0}function re(e,t){e.legendEnabled&&t.legendLayers.push({id:e.id});const i={layerType:(r=e.write()).layerType,customParameters:r.customParameters};var r;return le(i,e),i}async function ae(e,t,i){if(i.is11xService&&e.serviceUrl&&e.styleUrl){const t=m(e.styleUrl,e.apiKey),r=m(e.serviceUrl,e.apiKey);if(!t&&!r||"2.1.0"!==i.cimVersion){const i={type:"VectorTileLayer"};return i.styleUrl=o(e.styleUrl),i.token=t,r!==t&&(i.additionalTokens=[{url:e.serviceUrl,token:r}]),i}}return ee(e,t,i)}function ne(e){const t=e.urlTemplate?.replace(/\${/g,"{"),i={type:"WebTiledLayer",urlTemplate:t,credits:e.copyright};return e.subDomains&&e.subDomains.length>0&&(i.subDomains=e.subDomains),i}function se(e,t){let i;const r=[],a=e=>{e.visible&&(e.sublayers?e.sublayers.forEach(a):e.name&&r.unshift(e.name))};return e.sublayers&&e.sublayers.forEach(a),r.length&&(e.legendEnabled&&t.legendLayers.push({id:e.id,subLayerIds:r}),i={type:"wms",customLayerParameters:e.customLayerParameters,customParameters:e.customParameters,transparentBackground:e.imageTransparency,visibleLayers:r,url:o(e.url),version:e.version}),i}function oe(e){const t=e.activeLayer;return{type:"wmts",customLayerParameters:e.customLayerParameters,customParameters:e.customParameters,format:t.imageFormat,layer:t.id,style:t.styleId,tileMatrixSet:t.tileMatrixSetId,url:o(e.url)}}function le(e,t){t.url&&(e.url=o(e.url||t.url),e.token=m(e.url,t.apiKey))}async function ce(e,i){i.canvas||(i.canvas=document.createElement("canvas"));const r=1024;i.canvas.width=r,i.canvas.height=r;const a=i.canvas.getContext("2d");let o,l;if(e.path){const t=new Path2D(e.path);t.closePath(),a.fillStyle=Array.isArray(e.color)?`rgba(${e.color[0]},${e.color[1]},${e.color[2]},${e.color[3]/255})`:"rgb(0,0,0)",a.fill(t);const i=L(a);if(!i)return null;a.clearRect(0,0,r,r);const s=n(e.size)/Math.max(i.width,i.height);a.scale(s,s);const c=r/s,u=c/2-i.width/2-i.x,y=c/2-i.height/2-i.y;if(a.translate(u,y),Array.isArray(e.color)&&a.fill(t),e.outline?.width&&Array.isArray(e.outline.color)){const r=e.outline;a.lineWidth=n(r.width)/s,a.lineJoin="round",a.strokeStyle=`rgba(${r.color[0]},${r.color[1]},${r.color[2]},${r.color[3]/255})`,a.stroke(t),i.width+=a.lineWidth,i.height+=a.lineWidth}i.width*=s,i.height*=s;const p=a.getImageData(r/2-i.width/2,r/2-i.height/2,Math.ceil(i.width),Math.ceil(i.height));o=p.width,l=p.height,a.canvas.width=o,a.canvas.height=l,a.putImageData(p,0,0)}else{const i="image/svg+xml"===e.contentType?"data:image/svg+xml;base64,"+e.imageData:e.url,r=(await t(i,{responseType:"image"})).data;o=n(e.width),l=n(e.height),a.canvas.width=o,a.canvas.height=l,a.drawImage(r,0,0,a.canvas.width,a.canvas.height)}return{type:"esriPMS",imageData:a.canvas.toDataURL("image/png").substr(22),angle:e.angle,contentType:"image/png",height:s(l),width:s(o),xoffset:e.xoffset,yoffset:e.yoffset}}async function ue(e,t){const i=e.type;if("simple"===i&&fe(e.symbol))e.symbol=await ce(e.symbol,t);else if("uniqueValue"===i||"classBreaks"===i){fe(e.defaultSymbol)&&(e.defaultSymbol=await ce(e.defaultSymbol,t));const r=e["uniqueValue"===i?"uniqueValueInfos":"classBreakInfos"];if(r)for(const e of r)fe(e.symbol)&&(e.symbol=await ce(e.symbol,t))}}async function ye(e){return e.queryFeatures(e.createQuery()).then((e=>e.features))}function pe(e){return e.gpMetadata?.executionType?N.fromJSON(e.gpMetadata.executionType):"sync"}function fe(e){return e&&(e.path||"image/svg+xml"===e.contentType||e.url?.endsWith(".svg"))}export{U as execute,C as getGpPrintParams,k as getGpServerUrl,j as getMode,J as printCacheMap};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import e from"../Basemap.js";import r from"../config.js";import t from"../core/Collection.js";import n from"../core/Logger.js";import{destroyMaybe as a,mappedFind as i}from"../core/maybe.js";import{Url as l,makeAbsolute as s,normalize as u}from"../core/urlUtils.js";import{ensureType as c}from"../core/accessorSupport/ensureType.js";import{effectEquals as o}from"../layers/effects/utils.js";import{esriBasemapDefinitions as f}from"./basemapDefinitions.js";const p=n.getLogger("esri.support.basemapUtils");function y(){return{}}function m(e){for(const r in e){const t=e[r];a(t),delete e[r]}}function d(t,n){let a;if("string"==typeof t){const i=t in f,l=!i&&t.includes("/");if(!i&&!l){const e=Object.entries(f).filter((([e,t])=>r.apiKey&&!t.classic&&!t.is3d||!r.apiKey&&t.classic)).map((([e])=>`"${e}"`)).sort().join(", ");return p.warn(`Unable to find basemap definition for: ${t}. Try one of these: ${e}`),null}n&&(a=n[t]),a||(a=i?e.fromId(t):new e({style:{id:t}}),n&&(n[t]=a))}else a=c(e,t);return a?.destroyed&&(p.warn("The provided basemap is already destroyed",{basemap:a}),a=null),a}function b(e){return"Web Scene"===e.portalItem?.type}function L(e,r){return e.basemap?.referenceLayers?.some((e=>e.uid===r))||e.basemap?.baseLayers?.some((e=>e.uid===r))}function S(e,r=null){const t=d(e);if(!t)return null;const n=t.clone();return r&&(n.baseLayers=R(n.baseLayers,r.baseLayers),n.referenceLayers=R(n.referenceLayers,r.referenceLayers)),n}let v;function g(e){if(v)return v(e);let r=null;const t=x(e),n=!t?.baseLayers.length;for(const a in f){const e=B(t,$(f[a]),{mustMatchReferences:n});if("equal"===e){r=a;break}"base-layers-equal"===e&&(r=a)}return r}function h(e){v=e}function I(e,r){if(e===r)return!0;if(null!=e?.portalItem?.id&&e.portalItem.id===r?.portalItem?.id)return!0;return"equal"===B(x(e),x(r),{mustMatchReferences:!0})}function R(e,r){const n=new t;return e.forEach((e=>{const t=r.find((r=>"scene"!==r.type&&N(k(e),k(r))))||e;n.includes(t)?n.push(e):n.push(t)})),n}function T(e){return!!e?.baseLayers.concat(e.referenceLayers).some(j)}function j(e){if(q(e.url))return!0;if("vector-tile"===e.type)for(const r in e.sourceNameToSource){const t=e.sourceNameToSource[r];if(q(t?.sourceUrl))return!0}return!1}function w(e,r){if(null==r||null==e)return{spatialReference:null,updating:!1};if("not-loaded"===r.loadStatus)return r.load(),{spatialReference:null,updating:!0};if(r.spatialReference)return{spatialReference:r.spatialReference,updating:!1};if(0===r.baseLayers.length)return{spatialReference:null,updating:!1};const t=r.baseLayers.at(0);switch(t.loadStatus){case"not-loaded":t.load();case"loading":return{spatialReference:null,updating:!0};case"failed":return{spatialReference:null,updating:!1}}const n=(("supportedSpatialReferences"in t?t.supportedSpatialReferences:null)||["tileInfo"in t?t.tileInfo?.spatialReference:t.spatialReference]).filter(Boolean),a=e.spatialReference;return a?{spatialReference:n.find((e=>a.equals(e)))??n[0]??null,updating:!1}:{spatialReference:n[0],updating:!1}}const U=/^(basemaps|ibasemaps).*-api\.arcgis\.com$/i;function q(e){if(!e)return!1;const r=new l(s(e));return!!r.authority&&U.test(r.authority)}function x(e){return e?!e.loaded&&e.resourceInfo?$(e.resourceInfo.data):{baseLayers:M(e.baseLayers),referenceLayers:M(e.referenceLayers)}:null}function M(e){return(t.isCollection(e)?e.toArray():e).map(k)}function k(e){return{type:e.type,effect:"effect"in e?e.effect:void 0,url:D("urlTemplate"in e&&e.urlTemplate||e.url||"styleUrl"in e&&e.styleUrl||""),minScale:"minScale"in e&&null!=e.minScale?e.minScale:0,maxScale:"maxScale"in e&&null!=e.maxScale?e.maxScale:0,opacity:null!=e.opacity?e.opacity:1,visible:null==e.visible||!!e.visible,sublayers:"map-image"!==e.type&&"wms"!==e.type||null==e.sublayers?void 0:e.sublayers?.map((e=>({id:e.id,visible:e.visible}))),activeLayerId:"wmts"===e.type?e.activeLayer?.id:void 0}}function A(e){return e.isReference||"ArcGISSceneServiceLayer"===e.layerType}function $(e){return e?{baseLayers:C((e.baseMapLayers??[]).filter((e=>!A(e)))),referenceLayers:C((e.baseMapLayers??[]).filter((e=>A(e))))}:null}function C(e){return e.map((e=>G(e)))}function G(e){let r;switch(e.layerType){case"VectorTileLayer":r="vector-tile";break;case"ArcGISTiledMapServiceLayer":r="tile";break;case"ArcGISSceneServiceLayer":r="scene";break;default:r="unknown"}return{type:r,effect:e.effect,url:D(e.templateUrl||e.urlTemplate||e.styleUrl||e.url),minScale:e.minScale??0,maxScale:e.maxScale??0,opacity:e.opacity??1,visible:null==e.visibility||!!e.visibility,sublayers:void 0,activeLayerId:void 0}}function B(e,r,t){if(null!=e!=(null!=r))return"not-equal";if(!e||!r)return"equal";if(!K(e.baseLayers,r.baseLayers))return"not-equal";return K(e.referenceLayers,r.referenceLayers)?"equal":t.mustMatchReferences?"not-equal":"base-layers-equal"}function K(e,r){if(e.length!==r.length)return!1;for(let t=0;t<e.length;t++)if(!N(e[t],r[t]))return!1;return!0}function N(e,r){if(e.type!==r.type||e.url!==r.url||e.minScale!==r.minScale||e.maxScale!==r.maxScale||e.visible!==r.visible||e.opacity!==r.opacity)return!1;if(!o(e.effect,r.effect))return!1;if(null!=e.activeLayerId||null!=r.activeLayerId)return e.activeLayerId===r.activeLayerId;if(null!=e.sublayers||null!=r.sublayers){if(null==e.sublayers||null==r.sublayers||e.sublayers.length!==r.sublayers.length)return!1;for(let t=0;t<e.sublayers.length;t++){const n=e.sublayers.at(t),a=r.sublayers.at(t);if(n?.id!==a?.id||n?.visible!==a?.visible)return!1}}return!0}function D(e){return e?u(e).replace(/^\s*https?:/i,"").toLowerCase():""}function E(e){if(!e)return null;const{thumbnailUrl:r}=e;if(r)return r;const t=g(e);return t?f[t].thumbnailUrl:i(e.baseLayers,O)}function O(e){return"portalItem"in e?e.portalItem?.thumbnailUrl:void 0}export{S as clonePreservingTiledLayers,I as contentEquals,y as createCache,m as destroyCache,d as ensureType,w as findSpatialReference,E as getBasemapThumbnailUrl,g as getWellKnownBasemapId,T as hasDeveloperBasemapLayer,b as isBasemap3D,L as isBasemapLayer,j as isDeveloperBasemapLayer,h as overrideGetWellKnownBasemapId};
5
+ import e from"../Basemap.js";import r from"../config.js";import t from"../core/Collection.js";import n from"../core/Logger.js";import{destroyMaybe as a,mappedFind as i}from"../core/maybe.js";import{Url as l,makeAbsolute as s,normalize as u}from"../core/urlUtils.js";import{ensureType as c}from"../core/accessorSupport/ensureType.js";import{effectEquals as o}from"../layers/effects/utils.js";import{esriBasemapDefinitions as f}from"./basemapDefinitions.js";const p=n.getLogger("esri.support.basemapUtils");function y(){return{}}function m(e){for(const r in e){const t=e[r];a(t),delete e[r]}}function d(t,n){let a;if("string"==typeof t){const i=t in f,l=!i&&t.includes("/");if(!i&&!l){const e=Object.entries(f).filter((([e,t])=>r.apiKey&&!t.classic||!r.apiKey&&(t.classic||t.is3d))).map((([e])=>`"${e}"`)).sort().join(", ");return p.warn(`Unable to find basemap definition for: ${t}. Try one of these: ${e}`),null}n&&(a=n[t]),a||(a=i?e.fromId(t):new e({style:{id:t}}),n&&(n[t]=a))}else a=c(e,t);return a?.destroyed&&(p.warn("The provided basemap is already destroyed",{basemap:a}),a=null),a}function b(e){return"Web Scene"===e.portalItem?.type}function L(e,r){return e.basemap?.referenceLayers?.some((e=>e.uid===r))||e.basemap?.baseLayers?.some((e=>e.uid===r))}function S(e,r=null){const t=d(e);if(!t)return null;const n=t.clone();return r&&(n.baseLayers=R(n.baseLayers,r.baseLayers),n.referenceLayers=R(n.referenceLayers,r.referenceLayers)),n}let v;function g(e){if(v)return v(e);let r=null;const t=x(e),n=!t?.baseLayers.length;for(const a in f){const e=B(t,$(f[a]),{mustMatchReferences:n});if("equal"===e){r=a;break}"base-layers-equal"===e&&(r=a)}return r}function h(e){v=e}function I(e,r){if(e===r)return!0;if(null!=e?.portalItem?.id&&e.portalItem.id===r?.portalItem?.id)return!0;return"equal"===B(x(e),x(r),{mustMatchReferences:!0})}function R(e,r){const n=new t;return e.forEach((e=>{const t=r.find((r=>"scene"!==r.type&&N(k(e),k(r))))||e;n.includes(t)?n.push(e):n.push(t)})),n}function T(e){return!!e?.baseLayers.concat(e.referenceLayers).some(j)}function j(e){if(q(e.url))return!0;if("vector-tile"===e.type)for(const r in e.sourceNameToSource){const t=e.sourceNameToSource[r];if(q(t?.sourceUrl))return!0}return!1}function w(e,r){if(null==r||null==e)return{spatialReference:null,updating:!1};if("not-loaded"===r.loadStatus)return r.load(),{spatialReference:null,updating:!0};if(r.spatialReference)return{spatialReference:r.spatialReference,updating:!1};if(0===r.baseLayers.length)return{spatialReference:null,updating:!1};const t=r.baseLayers.at(0);switch(t.loadStatus){case"not-loaded":t.load();case"loading":return{spatialReference:null,updating:!0};case"failed":return{spatialReference:null,updating:!1}}const n=(("supportedSpatialReferences"in t?t.supportedSpatialReferences:null)||["tileInfo"in t?t.tileInfo?.spatialReference:t.spatialReference]).filter(Boolean),a=e.spatialReference;return a?{spatialReference:n.find((e=>a.equals(e)))??n[0]??null,updating:!1}:{spatialReference:n[0],updating:!1}}const U=/^(basemaps|ibasemaps).*-api\.arcgis\.com$/i;function q(e){if(!e)return!1;const r=new l(s(e));return!!r.authority&&U.test(r.authority)}function x(e){return e?!e.loaded&&e.resourceInfo?$(e.resourceInfo.data):{baseLayers:M(e.baseLayers),referenceLayers:M(e.referenceLayers)}:null}function M(e){return(t.isCollection(e)?e.toArray():e).map(k)}function k(e){return{type:e.type,effect:"effect"in e?e.effect:void 0,url:D("urlTemplate"in e&&e.urlTemplate||e.url||"styleUrl"in e&&e.styleUrl||""),minScale:"minScale"in e&&null!=e.minScale?e.minScale:0,maxScale:"maxScale"in e&&null!=e.maxScale?e.maxScale:0,opacity:null!=e.opacity?e.opacity:1,visible:null==e.visible||!!e.visible,sublayers:"map-image"!==e.type&&"wms"!==e.type||null==e.sublayers?void 0:e.sublayers?.map((e=>({id:e.id,visible:e.visible}))),activeLayerId:"wmts"===e.type?e.activeLayer?.id:void 0}}function A(e){return e.isReference||"ArcGISSceneServiceLayer"===e.layerType}function $(e){return e?{baseLayers:C((e.baseMapLayers??[]).filter((e=>!A(e)))),referenceLayers:C((e.baseMapLayers??[]).filter((e=>A(e))))}:null}function C(e){return e.map((e=>G(e)))}function G(e){let r;switch(e.layerType){case"VectorTileLayer":r="vector-tile";break;case"ArcGISTiledMapServiceLayer":r="tile";break;case"ArcGISSceneServiceLayer":r="scene";break;default:r="unknown"}return{type:r,effect:e.effect,url:D(e.templateUrl||e.urlTemplate||e.styleUrl||e.url),minScale:e.minScale??0,maxScale:e.maxScale??0,opacity:e.opacity??1,visible:null==e.visibility||!!e.visibility,sublayers:void 0,activeLayerId:void 0}}function B(e,r,t){if(null!=e!=(null!=r))return"not-equal";if(!e||!r)return"equal";if(!K(e.baseLayers,r.baseLayers))return"not-equal";return K(e.referenceLayers,r.referenceLayers)?"equal":t.mustMatchReferences?"not-equal":"base-layers-equal"}function K(e,r){if(e.length!==r.length)return!1;for(let t=0;t<e.length;t++)if(!N(e[t],r[t]))return!1;return!0}function N(e,r){if(e.type!==r.type||e.url!==r.url||e.minScale!==r.minScale||e.maxScale!==r.maxScale||e.visible!==r.visible||e.opacity!==r.opacity)return!1;if(!o(e.effect,r.effect))return!1;if(null!=e.activeLayerId||null!=r.activeLayerId)return e.activeLayerId===r.activeLayerId;if(null!=e.sublayers||null!=r.sublayers){if(null==e.sublayers||null==r.sublayers||e.sublayers.length!==r.sublayers.length)return!1;for(let t=0;t<e.sublayers.length;t++){const n=e.sublayers.at(t),a=r.sublayers.at(t);if(n?.id!==a?.id||n?.visible!==a?.visible)return!1}}return!0}function D(e){return e?u(e).replace(/^\s*https?:/i,"").toLowerCase():""}function E(e){if(!e)return null;const{thumbnailUrl:r}=e;if(r)return r;const t=g(e);return t?f[t].thumbnailUrl:i(e.baseLayers,O)}function O(e){return"portalItem"in e?e.portalItem?.thumbnailUrl:void 0}export{S as clonePreservingTiledLayers,I as contentEquals,y as createCache,m as destroyCache,d as ensureType,w as findSpatialReference,E as getBasemapThumbnailUrl,g as getWellKnownBasemapId,T as hasDeveloperBasemapLayer,b as isBasemap3D,L as isBasemapLayer,j as isDeveloperBasemapLayer,h as overrideGetWellKnownBasemapId};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- const a="20231002",e="d6e1c52b8609437e4fd68bc41063e7a46b7da8aa";export{a as buildDate,e as commitHash};
5
+ const a="20231004",e="7ca212dca3952bea39657e4b12d4e9f5da74aed5";export{a as buildDate,e as commitHash};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{_ as o}from"../chunks/tslib.es6.js";import r from"../core/Collection.js";import{clone as e}from"../core/lang.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import{enumeration as t}from"../core/accessorSupport/decorators/enumeration.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import m from"./ExtrudeSymbol3DLayer.js";import y from"./FillSymbol3DLayer.js";import a from"./IconSymbol3DLayer.js";import i from"./LineSymbol3DLayer.js";import p from"./ObjectSymbol3DLayer.js";import n from"./Symbol3D.js";import c from"./TextSymbol3DLayer.js";import b from"./WaterSymbol3DLayer.js";var f;const u=r.ofType({base:null,key:"type",typeMap:{extrude:m,fill:y,icon:a,line:i,object:p,text:c,water:b}});let L=f=class extends n{constructor(o){super(o),this.symbolLayers=new u,this.type="polygon-3d"}clone(){return new f({styleOrigin:e(this.styleOrigin),symbolLayers:e(this.symbolLayers),thumbnail:e(this.thumbnail)})}static fromJSON(o){const r=new f;if(r.read(o),2===r.symbolLayers.length&&"fill"===r.symbolLayers.at(0).type&&"line"===r.symbolLayers.at(1).type){const e=r.symbolLayers.at(0),s=r.symbolLayers.at(1);!s.enabled||o.symbolLayers?.[1]&&!1===o.symbolLayers[1].enable||(e.outline={size:s.size,color:null!=s.material?s.material.color:null}),r.symbolLayers.removeAt(1)}return r}static fromSimpleFillSymbol(o){return new f({symbolLayers:new r([y.fromSimpleFillSymbol(o)])})}};o([s({type:u,json:{write:!0}})],L.prototype,"symbolLayers",void 0),o([t({PolygonSymbol3D:"polygon-3d"},{readOnly:!0})],L.prototype,"type",void 0),L=f=o([l("esri.symbols.PolygonSymbol3D")],L);const S=L;export{S as default};
5
+ import{_ as o}from"../chunks/tslib.es6.js";import e from"../core/Collection.js";import{deprecated as r}from"../core/deprecate.js";import{clone as s}from"../core/lang.js";import t from"../core/Logger.js";import{on as l,sync as y}from"../core/reactiveUtils.js";import{property as m}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import{enumeration as a}from"../core/accessorSupport/decorators/enumeration.js";import{subclass as i}from"../core/accessorSupport/decorators/subclass.js";import n from"./ExtrudeSymbol3DLayer.js";import p from"./FillSymbol3DLayer.js";import b from"./IconSymbol3DLayer.js";import c from"./LineSymbol3DLayer.js";import L from"./ObjectSymbol3DLayer.js";import f from"./Symbol3D.js";import S from"./TextSymbol3DLayer.js";import u from"./WaterSymbol3DLayer.js";var d;const j=e.ofType({base:null,key:"type",typeMap:{extrude:n,fill:p,icon:b,line:c,object:L,text:S,water:u}});let g=d=class extends f{constructor(o){super(o),this.symbolLayers=new j,this.type="polygon-3d"}initialize(){const o=o=>{"line"===o.type&&r(t.getLogger(this),"LineSymbol3DLayer can not be used as a SymbolLayer with a PolygonSymbol3D symbol anymore.",{replacement:"Use FillSymbol3DLayer.outline instead.",version:"4.28"}),"text"===o.type&&r(t.getLogger(this),"TextSymbol3DLayer can not be used as a SymbolLayer with a PolygonSymbol3D symbol anymore.",{replacement:"Use Labels instead.",version:"4.28"})};for(const e of this.symbolLayers)o(e);this.addHandles(l((()=>this.symbolLayers),"after-add",(({item:e})=>o(e)),y))}clone(){return new d({styleOrigin:s(this.styleOrigin),symbolLayers:s(this.symbolLayers),thumbnail:s(this.thumbnail)})}static fromJSON(o){const e=new d;if(e.read(o),2===e.symbolLayers.length&&"fill"===e.symbolLayers.at(0).type&&"line"===e.symbolLayers.at(1).type){const r=e.symbolLayers.at(0),s=e.symbolLayers.at(1);!s.enabled||o.symbolLayers?.[1]&&!1===o.symbolLayers[1].enable||(r.outline={size:s.size,color:null!=s.material?s.material.color:null}),e.symbolLayers.removeAt(1)}return e}static fromSimpleFillSymbol(o){return new d({symbolLayers:new e([p.fromSimpleFillSymbol(o)])})}};o([m({type:j,json:{write:!0}})],g.prototype,"symbolLayers",void 0),o([a({PolygonSymbol3D:"polygon-3d"},{readOnly:!0})],g.prototype,"type",void 0),g=d=o([i("esri.symbols.PolygonSymbol3D")],g);const h=g;export{h as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{disposeMaybe as t}from"../../../../core/maybe.js";import{g as e,h as s,r,l as i,m as o}from"../../../../chunks/mat3.js";import{c as a}from"../../../../chunks/mat3f32.js";import{f as u}from"../../../../chunks/vec2f32.js";import{DisplayObject as h}from"../DisplayObject.js";import{TextureSamplingMode as n}from"../../../webgl/enums.js";import{createTransformTexture as l,createRasterTexture as d,createColormapTexture as c}from"../../../webgl/rasterUtils.js";const p={bandCount:3,outMin:0,outMax:1,minCutOff:[0,0,0],maxCutOff:[255,255,255],factor:[1/255,1/255,1/255],useGamma:!1,gamma:[1,1,1],gammaCorrection:[1,1,1],colormap:null,colormapOffset:null,stretchType:"none",type:"stretch"};class _ extends h{constructor(t=null,e=null,s=null){super(),this._textureInvalidated=!0,this._colormapTextureInvalidated=!0,this._rasterTexture=null,this._rasterTextureBandIds=null,this._transformGridTexture=null,this._colormapTexture=null,this._colormap=null,this._supportsBilinearTexture=!0,this._processedTexture=null,this.functionTextures=[],this.projected=!1,this.stencilRef=0,this.coordScale=[1,1],this._processed=!1,this._symbolizerParameters=null,this.height=null,this.isRendereredSource=!1,this.pixelRatio=1,this.resolution=0,this.rotation=0,this._source=null,this.rawPixelData=null,this._suspended=!1,this._bandIds=null,this._interpolation=null,this._transformGrid=null,this.width=null,this.x=0,this.y=0,this.source=t,this.transformGrid=e,this.interpolation=s}destroy(){this._disposeTextures()}get processedTexture(){return this._processedTexture}set processedTexture(t){this._processedTexture!==t&&(this._disposeTextures(!0),this._processedTexture=t)}get rasterTexture(){return this._rasterTexture}set rasterTexture(t){this._rasterTexture!==t&&(this._rasterTexture?.dispose(),this._rasterTexture=t),null==t&&(this.projected=!1)}get processed(){return this._processed}set processed(e){this._processed=e,e||(t(this.processedTexture),this.invalidateTexture())}get symbolizerParameters(){return this._symbolizerParameters||p}set symbolizerParameters(t){this._symbolizerParameters!==t&&(this._symbolizerParameters=t,this._colormapTextureInvalidated=!0,this.commonUniforms=null)}get source(){return this._source}set source(t){this._source!==t&&(this._source=t,this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTexture=null,this._rasterTextureBandIds=null),this.commonUniforms=null,this.projected=!1,this.invalidateTexture())}get suspended(){return this._suspended}set suspended(t){this._suspended&&!t&&this.stage&&(this.ready(),this.requestRender()),this._suspended=t}get bandIds(){return this._bandIds}set bandIds(t){this._bandIds=t,this._isBandIdschanged(t)&&(this.projected=!1,this.invalidateTexture())}get interpolation(){return this._interpolation||"nearest"}set interpolation(t){this._interpolation=t,this._rasterTexture&&this._rasterTexture.setSamplingMode("bilinear"===this._getTextureSamplingMethod(t||"nearest")?n.LINEAR:n.NEAREST)}get transformGrid(){return this._transformGrid}set transformGrid(e){this._transformGrid!==e&&(this._transformGrid=e,this._transformGridTexture=t(this._transformGridTexture))}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this.requestRender())}getRasterTextureSize(t=!1){const e=t||this.projected;return[e?this.width:this.source?.width||this.width,e?this.height:this.source?.height||this.height]}getRasterCellSize(){const t=this.rawPixelData?.srcPixelSize,{projected:e,resolution:s}=this;return t&&!e?[t.x,t.y]:[s,s]}_createTransforms(){return{dvs:a()}}setTransform(t){const a=e(this.transforms.dvs),[h,n]=t.toScreenNoRotation([0,0],[this.x,this.y]),l=this.resolution/this.pixelRatio/t.resolution,d=l*this.width,c=l*this.height,p=Math.PI*this.rotation/180;s(a,a,u(h,n)),s(a,a,u(d/2,c/2)),r(a,a,-p),s(a,a,u(-d/2,-c/2)),i(a,a,u(d,c)),o(this.transforms.dvs,t.displayViewMat3,a)}getTextures({forProcessing:t=!1,useProcessedTexture:e=!1}={}){const s=e?this._processedTexture??this._rasterTexture:this._rasterTexture,r=[],i=[];return s?(this._transformGridTexture&&!this.projected&&(i.push(this._transformGridTexture),r.push("u_transformGrid")),e?(i.push(s),r.push("u_image"),this._colormapTexture&&(i.push(this._colormapTexture),r.push("u_colormap")),{names:r,textures:i}):(i.push(s),r.push("u_image"),this._colormapTexture&&!t&&(i.push(this._colormapTexture),r.push("u_colormap")),{names:r,textures:i})):{names:r,textures:i}}onAttach(){this.invalidateTexture()}onDetach(){this.invalidateTexture()}updateTexture({context:t}){if(!this.stage)return void this._disposeTextures();const e=this._isValidSource(this.source);e&&this._colormapTextureInvalidated&&(this._colormapTextureInvalidated=!1,this._updateColormapTexture(t)),this._textureInvalidated&&(this._textureInvalidated=!1,this._createOrDestroyRasterTexture(t),this._rasterTexture&&(e?this.transformGrid&&!this._transformGridTexture&&(this._transformGridTexture=l(t,this.transformGrid)):this._rasterTexture.setData(null)),this.suspended||(this.ready(),this.requestRender()))}updateProcessedTexture(){const{functionTextures:t}=this;0!==t.length&&(this.processedTexture=t.shift(),t.forEach((t=>t?.dispose())),t.length=0)}_createOrDestroyRasterTexture(t){const e=this.source?.extractBands(this.bandIds);if(!this._isValidSource(e))return void(this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTextureBandIds=null,this._rasterTexture=null));const s=!this._isBandIdschanged(this.bandIds);if(this._rasterTexture){if(s)return;this._rasterTexture.dispose(),this._rasterTextureBandIds=null,this._rasterTexture=null}this._supportsBilinearTexture=!!t.capabilities.textureFloat?.textureFloatLinear;const r=this._getTextureSamplingMethod(this.interpolation),i=this.isRendereredSource||!t.capabilities.textureFloat?.textureFloat;this._rasterTexture=d(t,e,r,i),this.projected=!1,this._processed=!1,this._rasterTextureBandIds=this.bandIds?[...this.bandIds]:null}_isBandIdschanged(t){const e=this._rasterTextureBandIds;return!(null==e&&null==t||e&&t&&e.join("")===t.join(""))}_isValidSource(t){return null!=t&&t.pixels?.length>0}_getTextureSamplingMethod(t){const{type:e,colormap:s}=this.symbolizerParameters,r="lut"===e||"stretch"===e&&null!=s;return!this._supportsBilinearTexture||r||"bilinear"!==t&&"cubic"!==t?"nearest":"bilinear"}_updateColormapTexture(t){const e=this._colormap,s=this.symbolizerParameters.colormap;return s?e?s.length!==e.length||s.some(((t,s)=>t!==e[s]))?(this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null),this._colormapTexture=c(t,s),void(this._colormap=s)):void 0:(this._colormapTexture=c(t,s),void(this._colormap=s)):(this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null),void(this._colormap=null))}_disposeTextures(t=!1){!this._transformGridTexture||t&&!this.projected||(this._transformGridTexture.dispose(),this._transformGridTexture=null),!t&&this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null,this._colormap=null,this._colormapTextureInvalidated=!0),!t&&this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTexture=null,this._rasterTextureBandIds=null),this._processedTexture&&(this._processedTexture.dispose(),this._processedTexture=null)}}class x extends _{get source(){return this._source}}function m(t){return null!=t.source}export{_ as RasterBitmap,x as RasterBitmapWithSource,m as hasSource};
5
+ import{disposeMaybe as t}from"../../../../core/maybe.js";import{g as e,h as s,r,l as i,m as o}from"../../../../chunks/mat3.js";import{c as a}from"../../../../chunks/mat3f32.js";import{f as u}from"../../../../chunks/vec2f32.js";import{DisplayObject as h}from"../DisplayObject.js";import{TextureSamplingMode as n}from"../../../webgl/enums.js";import{createTransformTexture as l,createRasterTexture as d,createColormapTexture as c}from"../../../webgl/rasterUtils.js";const _={bandCount:3,outMin:0,outMax:1,minCutOff:[0,0,0],maxCutOff:[255,255,255],factor:[1/255,1/255,1/255],useGamma:!1,gamma:[1,1,1],gammaCorrection:[1,1,1],colormap:null,colormapOffset:null,stretchType:"none",type:"stretch"};class p extends h{constructor(t=null,e=null,s=null){super(),this._textureInvalidated=!0,this._colormapTextureInvalidated=!0,this._rasterTexture=null,this._rasterTextureBandIds=null,this._transformGridTexture=null,this._colormapTexture=null,this._colormap=null,this._supportsBilinearTexture=!0,this._processedTexture=null,this.functionTextures=[],this.projected=!1,this.stencilRef=0,this.coordScale=[1,1],this._processed=!1,this._symbolizerParameters=null,this.height=null,this.isRendereredSource=!1,this.pixelRatio=1,this.resolution=0,this.rotation=0,this._source=null,this.rawPixelData=null,this._suspended=!1,this._bandIds=null,this._interpolation=null,this._transformGrid=null,this.width=null,this.x=0,this.y=0,this.source=t,this.transformGrid=e,this.interpolation=s}destroy(){this._disposeTextures()}get processedTexture(){return this._processedTexture}set processedTexture(t){this._processedTexture!==t&&(this._disposeTextures(!0),this._processedTexture=t)}get rasterTexture(){return this._rasterTexture}set rasterTexture(t){this._rasterTexture!==t&&(this._rasterTexture?.dispose(),this._rasterTexture=t),null==t&&(this.projected=!1)}get processed(){return this._processed}set processed(e){this._processed=e,e||(t(this.processedTexture),this.invalidateTexture())}get symbolizerParameters(){return this._symbolizerParameters||_}set symbolizerParameters(t){this._symbolizerParameters!==t&&(this._symbolizerParameters=t,this._colormapTextureInvalidated=!0,this.commonUniforms=null)}get source(){return this._source}set source(t){this._source!==t&&(this._source=t,this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTexture=null,this._rasterTextureBandIds=null),this.commonUniforms=null,this.projected=!1,this.invalidateTexture())}get suspended(){return this._suspended}set suspended(t){this._suspended&&!t&&this.stage&&(this.ready(),this.requestRender()),this._suspended=t}get bandIds(){return this._bandIds}set bandIds(t){this._bandIds=t,this._isBandIdschanged(t)&&(this.projected=!1,this.invalidateTexture())}get interpolation(){return this._interpolation||"nearest"}set interpolation(t){this._interpolation=t,this._rasterTexture&&this._rasterTexture.setSamplingMode("bilinear"===this._getTextureSamplingMethod(t||"nearest")?n.LINEAR:n.NEAREST)}get transformGrid(){return this._transformGrid}set transformGrid(e){this._transformGrid!==e&&(this._transformGrid=e,this._transformGridTexture=t(this._transformGridTexture))}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this.requestRender())}getRasterTextureSize(t=!1){const e=t||this.projected;return[e?this.width:this.source?.width||this.width,e?this.height:this.source?.height||this.height]}getRasterCellSize(){const t=this.rawPixelData?.srcPixelSize,{projected:e,resolution:s}=this;return t&&!e?[t.x,t.y]:[s,s]}_createTransforms(){return{dvs:a()}}setTransform(t){const a=e(this.transforms.dvs),[h,n]=t.toScreenNoRotation([0,0],[this.x,this.y]),l=this.resolution/this.pixelRatio/t.resolution,d=l*this.width,c=l*this.height,_=Math.PI*this.rotation/180;s(a,a,u(h,n)),s(a,a,u(d/2,c/2)),r(a,a,-_),s(a,a,u(-d/2,-c/2)),i(a,a,u(d,c)),o(this.transforms.dvs,t.displayViewMat3,a)}getTextures({forProcessing:t=!1,useProcessedTexture:e=!1}={}){const s=e?this._processedTexture??this._rasterTexture:this._rasterTexture,r=[],i=[];return s?(this._transformGridTexture&&!this.projected&&(i.push(this._transformGridTexture),r.push("u_transformGrid")),e?(i.push(s),r.push("u_image"),this._colormapTexture&&(i.push(this._colormapTexture),r.push("u_colormap")),{names:r,textures:i}):(i.push(s),r.push("u_image"),this._colormapTexture&&!t&&(i.push(this._colormapTexture),r.push("u_colormap")),{names:r,textures:i})):{names:r,textures:i}}onAttach(){this.invalidateTexture()}onDetach(){this.invalidateTexture()}updateTexture({context:t}){if(!this.stage)return void this._disposeTextures();const e=this._isValidSource(this.source);e&&this._colormapTextureInvalidated&&(this._colormapTextureInvalidated=!1,this._updateColormapTexture(t)),this._textureInvalidated&&(this._textureInvalidated=!1,this._createOrDestroyRasterTexture(t),this._rasterTexture&&(e?this.transformGrid&&!this._transformGridTexture&&(this._transformGridTexture=l(t,this.transformGrid)):this._rasterTexture.setData(null)),this.suspended||(this.ready(),this.requestRender()))}updateProcessedTexture(){const{functionTextures:t}=this;0!==t.length&&(this.processedTexture=t.shift(),t.forEach((t=>t?.dispose())),t.length=0)}_createOrDestroyRasterTexture(t){const e=this.source?.extractBands(this.bandIds);if(!this._isValidSource(e))return void(this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTextureBandIds=null,this._rasterTexture=null));const s=!this._isBandIdschanged(this.bandIds);if(this._rasterTexture){if(s)return;this._rasterTexture.dispose(),this._rasterTextureBandIds=null,this._rasterTexture=null}this._supportsBilinearTexture=!!t.capabilities.textureFloat?.textureFloatLinear;const r=this._getTextureSamplingMethod(this.interpolation),i=this.isRendereredSource||!t.capabilities.textureFloat?.textureFloat;this._rasterTexture=d(t,e,r,i),this.projected=!1,this._processed=!1,this._rasterTextureBandIds=this.bandIds?[...this.bandIds]:null}_isBandIdschanged(t){const e=this._rasterTextureBandIds;return!(null==e&&null==t||e&&t&&e.join("")===t.join(""))}_isValidSource(t){return null!=t&&t.pixels?.length>0}_getTextureSamplingMethod(t){const{type:e}=this.symbolizerParameters,s="lut"===e||"hillshade"===e||"stretch"===e&&1===this.symbolizerParameters.bandCount;return!this._supportsBilinearTexture||s||"bilinear"!==t&&"cubic"!==t?"nearest":"bilinear"}_updateColormapTexture(t){const e=this._colormap,s=this.symbolizerParameters.colormap;return s?e?s.length!==e.length||s.some(((t,s)=>t!==e[s]))?(this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null),this._colormapTexture=c(t,s),void(this._colormap=s)):void 0:(this._colormapTexture=c(t,s),void(this._colormap=s)):(this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null),void(this._colormap=null))}_disposeTextures(t=!1){!this._transformGridTexture||t&&!this.projected||(this._transformGridTexture.dispose(),this._transformGridTexture=null),!t&&this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null,this._colormap=null,this._colormapTextureInvalidated=!0),!t&&this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTexture=null,this._rasterTextureBandIds=null),this._processedTexture&&(this._processedTexture.dispose(),this._processedTexture=null)}}class x extends p{get source(){return this._source}}function m(t){return null!=t.source}export{p as RasterBitmap,x as RasterBitmapWithSource,m as hasSource};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{getProjectionDefines as r,getInterpolationDefines as t}from"./utils.js";import{setTextures as o,setUniforms as e,getColormapUniforms as s,getShadedReliefUniforms as a}from"../../../../webgl/rasterUtils.js";const n={vsPath:"raster/common",fsPath:"raster/hillshade",attributes:new Map([["a_position",0],["a_texcoord",1]])};function m(o,e,s){const{colormap:a}=e.symbolizerParameters,m=[...s?[]:r(e.transformGrid),...t(e.interpolation,null!=a,o.context)];null!=a&&m.push("applyColormap");return{defines:m,program:o.painter.materialManager.getProgram(n,m)}}function i(r,t,n,m,i=!1){const{names:l,textures:c}=n.getTextures({useProcessedTexture:i});o(r.context,t,l,c),e(t,m,n.commonUniforms),t.setUniformMatrix3fv("u_dvsMat3",n.transforms.dvs);const f=n.symbolizerParameters,{colormap:u,colormapOffset:p}=f;if(null!=u){const r=s(u,p);e(t,m,r)}const d=a(f);e(t,m,d)}const l={createProgram:m,bindTextureAndUniforms:i};export{l as default};
5
+ import{getProjectionDefines as r,getInterpolationDefines as t}from"./utils.js";import{setTextures as o,setUniforms as e,getColormapUniforms as s,getShadedReliefUniforms as a}from"../../../../webgl/rasterUtils.js";const n={vsPath:"raster/common",fsPath:"raster/hillshade",attributes:new Map([["a_position",0],["a_texcoord",1]])};function m(o,e,s){const{colormap:a}=e.symbolizerParameters,m=[...s?[]:r(e.transformGrid),...t(e.interpolation,!0,o.context)];null!=a&&m.push("applyColormap");return{defines:m,program:o.painter.materialManager.getProgram(n,m)}}function i(r,t,n,m,i=!1){const{names:c,textures:l}=n.getTextures({useProcessedTexture:i});o(r.context,t,c,l),e(t,m,n.commonUniforms),t.setUniformMatrix3fv("u_dvsMat3",n.transforms.dvs);const f=n.symbolizerParameters,{colormap:p,colormapOffset:u}=f;if(null!=p){const r=s(p,u);e(t,m,r)}const d=a(f);e(t,m,d)}const c={createProgram:m,bindTextureAndUniforms:i};export{c as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{getProjectionDefines as r,getInterpolationDefines as t}from"./utils.js";import{setTextures as e,setUniforms as o,getColormapUniforms as s,getStretchUniforms as n}from"../../../../webgl/rasterUtils.js";const a={vsPath:"raster/common",fsPath:"raster/stretch",attributes:new Map([["a_position",0],["a_texcoord",1]])};function m(e,o,s){const{colormap:n}=o.symbolizerParameters,m=[...s?[]:r(o.transformGrid),...t(o.interpolation,null!=n,e.context)];o.isRendereredSource&&!s?m.push("noop"):null!=n&&m.push("applyColormap");return{defines:m,program:e.painter.materialManager.getProgram(a,m)}}function i(r,t,a,m,i=!1){const{names:c,textures:l}=a.getTextures({useProcessedTexture:i});e(r.context,t,c,l),o(t,m,a.commonUniforms),t.setUniformMatrix3fv("u_dvsMat3",a.transforms.dvs);const u=a.symbolizerParameters,{colormap:p,colormapOffset:f}=u;if(null!=p){const r=s(p,f);o(t,m,r)}const d=n(u);o(t,m,d)}const c={createProgram:m,bindTextureAndUniforms:i};export{c as default};
5
+ import{getProjectionDefines as r,getInterpolationDefines as t}from"./utils.js";import{setTextures as o,setUniforms as e,getColormapUniforms as s,getStretchUniforms as n}from"../../../../webgl/rasterUtils.js";const a={vsPath:"raster/common",fsPath:"raster/stretch",attributes:new Map([["a_position",0],["a_texcoord",1]])};function m(o,e,s){const{colormap:n,bandCount:m}=e.symbolizerParameters,i=[...s?[]:r(e.transformGrid),...t(e.interpolation,1===m,o.context)];e.isRendereredSource&&!s?i.push("noop"):null!=n&&i.push("applyColormap");return{defines:i,program:o.painter.materialManager.getProgram(a,i)}}function i(r,t,a,m,i=!1){const{names:c,textures:u}=a.getTextures({useProcessedTexture:i});o(r.context,t,c,u),e(t,m,a.commonUniforms),t.setUniformMatrix3fv("u_dvsMat3",a.transforms.dvs);const l=a.symbolizerParameters,{colormap:p,colormapOffset:f}=l;if(null!=p){const r=s(p,f);e(t,m,r)}const d=n(l);e(t,m,d)}const c={createProgram:m,bindTextureAndUniforms:i};export{c as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{InputHandler as e}from"../../../input/InputHandler.js";class i extends e{constructor(e,i,t){super(!0),this.view=e,this.keys=i,this._pressed=!1,this._keyMap={[i.left]:"left",[i.right]:"right",[i.up]:"up",[i.down]:"down"},this.registerIncoming("key-down",t,(e=>this._handleKeyDown(e))),this.registerIncoming("key-up",t,(e=>this._handleKeyUp(e))),this.registerIncoming("blur",t,(()=>this._handleBlur()))}_handleKeyDown(e){e.data.repeat||this._handleKey(e,!0)}_handleKeyUp(e){this._handleKey(e,!1)}_handleBlur(){this._pressed&&(this._pressed=!1,this.view.mapViewNavigation.stop())}_handleKey(e,i){const t=this._keyMap[e.data.key];if(this._pressed=null!=t,this._pressed){if(i)switch(this.view.mapViewNavigation.begin(),t){case"left":this.view.mapViewNavigation.continousPanLeft();break;case"right":this.view.mapViewNavigation.continousPanRight();break;case"up":this.view.mapViewNavigation.continousPanUp();break;case"down":this.view.mapViewNavigation.continousPanDown()}else this._pressed=!1,this.view.mapViewNavigation.stop();e.stopPropagation()}}}export{i as KeyPan};
5
+ import{InputHandler as i}from"../../../input/InputHandler.js";import{onVisibilityChange as t}from"../../../input/VisibilityChange.js";class e extends i{constructor(i,e,s){super(!0),this.view=i,this.keys=e,this._isSticky=!1,this._pressedKeys=new Set,this._timeout=void 0,this._currentDirection=void 0,this._stickyKeyDuration=200,this._handleKey=i=>{const t=this._keyMap[i.data.key];if(null==t)return;i.stopPropagation(),i.preventDefault();const e="key-down"===i.type;if(this._pressedKeys[e?"add":"delete"](t),e){if(this._direction===t)return;this._direction=t,this._isSticky=!1,this._setTimeout((()=>{this._isSticky&&this._handlePopKey()}))}else{const i=void 0===this._timeout,t=this._pressedKeys.size>0;i||t?this._handlePopKey():this._isSticky=!0}},this._handlePopKey=()=>{this._direction=Array.from(this._pressedKeys).pop(),null==this._direction&&this._stopMovement()},this._stopMovement=()=>{this._isSticky=!1,this._direction=void 0,this._pressedKeys.clear(),this._setTimeout(void 0)},this._keyMap={[e.left]:"left",[e.right]:"right",[e.up]:"up",[e.down]:"down"},this.registerIncoming("key-down",s,this._handleKey),this.registerIncoming("key-up",s,this._handleKey),this.registerIncoming("blur",s,this._stopMovement),this._visibilityHandle=t((i=>i?null:this._stopMovement()))}onUninstall(){this._stopMovement(),this._visibilityHandle?.remove()}get _direction(){return this._currentDirection}set _direction(i){const t=null!=this._currentDirection;if(null!=i){if(t||this.view.mapViewNavigation.begin(),this._currentDirection!==i)switch(i){case"left":this.view.mapViewNavigation.continousPanLeft();break;case"right":this.view.mapViewNavigation.continousPanRight();break;case"up":this.view.mapViewNavigation.continousPanUp();break;case"down":this.view.mapViewNavigation.continousPanDown()}}else t&&this.view.mapViewNavigation.stop();this._currentDirection=i}_setTimeout(i){clearTimeout(this._timeout),this._timeout=void 0===i?void 0:setTimeout((()=>{this._timeout=void 0,i()}),this._stickyKeyDuration)}}export{e as KeyPan};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{InputHandler as e}from"../../../input/InputHandler.js";class i extends e{constructor(e,i,t){super(!0),this.view=e,this.keys=i,this._pressed=!1,this._keyToDirection={[i.clockwiseOption1]:"clockwise",[i.clockwiseOption2]:"clockwise",[i.counterClockwiseOption1]:"counterClockwise",[i.counterClockwiseOption2]:"counterClockwise",[i.resetOption1]:"reset",[i.resetOption2]:"reset"},this.registerIncoming("key-down",t,(e=>this._handleKeyDown(e))),this.registerIncoming("key-up",t,(e=>this._handleKeyUp(e))),this.registerIncoming("blur",t,(()=>this._handleBlur()))}_handleKeyDown(e){e.data.repeat||this._handleKey(e,!0)}_handleKeyUp(e){this._handleKey(e,!1)}_handleBlur(){this._pressed&&(this._pressed=!1,this.view.mapViewNavigation.stop())}_handleKey(e,i){const t=e.modifiers;if(t.size>0&&!t.has("Shift")||!this.view.constraints.rotationEnabled)return;const s=this._keyToDirection[e.data.key];if(this._pressed=null!=s,this._pressed){if(i)switch(this.view.mapViewNavigation.begin(),s){case"clockwise":this.view.mapViewNavigation.continousRotateClockwise();break;case"counterClockwise":this.view.mapViewNavigation.continousRotateCounterclockwise();break;case"reset":this.view.mapViewNavigation.resetRotation()}else this._pressed=!1,this.view.mapViewNavigation.stop();e.stopPropagation()}}}export{i as KeyRotate};
5
+ import{InputHandler as e}from"../../../input/InputHandler.js";import{onVisibilityChange as i}from"../../../input/VisibilityChange.js";class t extends e{constructor(e,t,s){super(!0),this.view=e,this.keys=t,this._pressed=!1,this._keyToDirection={[t.clockwiseOption1]:"clockwise",[t.clockwiseOption2]:"clockwise",[t.counterClockwiseOption1]:"counterClockwise",[t.counterClockwiseOption2]:"counterClockwise",[t.resetOption1]:"reset",[t.resetOption2]:"reset"},this.registerIncoming("key-down",s,(e=>this._handleKeyDown(e))),this.registerIncoming("key-up",s,(e=>this._handleKeyUp(e))),this.registerIncoming("blur",s,(()=>this._handleStop())),this._visibilityHandle=i((e=>e?null:this._handleStop()))}onUninstall(){this._visibilityHandle?.remove(),this._handleStop()}_handleKeyDown(e){e.data.repeat||this._handleKey(e,!0)}_handleKeyUp(e){this._handleKey(e,!1)}_handleStop(){this._pressed&&(this._pressed=!1,this.view.mapViewNavigation.stop())}_handleKey(e,i){const t=e.modifiers;if(t.size>0&&!t.has("Shift")||!this.view.constraints.rotationEnabled)return;const s=this._keyToDirection[e.data.key];if(this._pressed=null!=s,this._pressed){if(e.preventDefault(),i)switch(this.view.mapViewNavigation.begin(),s){case"clockwise":this.view.mapViewNavigation.continousRotateClockwise();break;case"counterClockwise":this.view.mapViewNavigation.continousRotateCounterclockwise();break;case"reset":this.view.mapViewNavigation.resetRotation()}else this._pressed=!1,this.view.mapViewNavigation.stop();e.stopPropagation()}}}export{t as KeyRotate};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import"../../../../../geometry.js";import t from"../../../../../Graphic.js";import{makeHandle as i}from"../../../../../core/handleUtils.js";import{destroyMaybe as r}from"../../../../../core/maybe.js";import{property as s}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/accessorSupport/ensureType.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import{subclass as a}from"../../../../../core/accessorSupport/decorators/subclass.js";import{SnappingVisualizer2D as l}from"../../SnappingVisualizer2D.js";import{outline as n,regularVertices as o,activeVertex as c}from"./symbols.js";import{DrawGraphicTool as p,geometryTypeToDrawOperationGeometryType as h}from"../../../../draw/DrawGraphicTool.js";import{DrawOperation as m}from"../../../../draw/DrawOperation.js";import{MapDrawSurface as u}from"../../../../draw/drawSurfaces.js";import y from"../../../../../geometry/Point.js";import v from"../../../../../geometry/Multipoint.js";let d=class extends p{constructor(e){super(e),this._visualElementGraphics={outline:null,regularVertices:null,activeVertex:null},this.activeFillSymbol=null,this.type="draw-2d",this._visualElementSymbols={outline:e.activeLineSymbol??n,regularVertices:e.regularVerticesSymbol??o,activeVertex:e.activeVertexSymbol??c,fill:e.activeFillSymbol}}normalizeCtorArgs(e){const t={...e};return delete t.activeFillSymbol,delete t.activeVertexSymbol,delete t.regularVerticesSymbol,delete t.activeLineSymbol,t}initializeGraphic(e){return null!=this._visualElementSymbols.fill&&(e.symbol=this._visualElementSymbols.fill),i()}makeDrawOperation(){const{defaultZ:e,hasZ:t,view:i}=this;return new m({view:i,manipulators:this.manipulators,geometryType:h(this.geometryType),drawingMode:this.mode,hasZ:t,defaultZ:e,snapToSceneEnabled:this.snapToScene,drawSurface:new u(i,t,e),hasM:!1,snappingManager:this.snappingManager,snappingVisualizer:new l(this.internalGraphicsLayer),tooltipOptions:this.tooltipOptions})}onActiveVertexChanged(e){if("point"===this.geometryType)return i();const[s,a]=e,l=new y({x:s,y:a,spatialReference:this.view.spatialReference});return null!=this._visualElementGraphics.activeVertex?(this._visualElementGraphics.activeVertex.geometry=l,i()):(this._visualElementGraphics.activeVertex=new t({geometry:l,symbol:this._visualElementSymbols.activeVertex,attributes:{displayOrder:2}}),this.internalGraphicsLayer.add(this._visualElementGraphics.activeVertex),this.internalGraphicsLayer.graphics.sort(g),i((()=>{null!=this._visualElementGraphics.activeVertex&&(this.internalGraphicsLayer.remove(this._visualElementGraphics.activeVertex),this._visualElementGraphics.activeVertex=r(this._visualElementGraphics.activeVertex))})))}onOutlineChanged(e){const s=e.clone();if("polyline"===s.type){const e=s.paths[s.paths.length-1];e.splice(0,e.length-2)}return null!=this._visualElementGraphics.outline?(this._visualElementGraphics.outline.geometry=s,i()):(this._visualElementGraphics.outline=new t({geometry:s,symbol:this._visualElementSymbols.outline,attributes:{displayOrder:0}}),this.internalGraphicsLayer.add(this._visualElementGraphics.outline),this.internalGraphicsLayer.graphics.sort(g),i((()=>{null!=this._visualElementGraphics.outline&&(this.internalGraphicsLayer.remove(this._visualElementGraphics.outline),this._visualElementGraphics.outline=r(this._visualElementGraphics.outline))})))}onRegularVerticesChanged(e){const s=new v({points:e,spatialReference:this.view.spatialReference});return null!=this._visualElementGraphics.regularVertices?(this._visualElementGraphics.regularVertices.geometry=s,i()):(this._visualElementGraphics.regularVertices=new t({geometry:s,symbol:this._visualElementSymbols.regularVertices,attributes:{displayOrder:1}}),this.internalGraphicsLayer.add(this._visualElementGraphics.regularVertices),this.internalGraphicsLayer.graphics.sort(g),i((()=>{null!=this._visualElementGraphics.regularVertices&&(this.internalGraphicsLayer.remove(this._visualElementGraphics.regularVertices),this._visualElementGraphics.regularVertices=r(this._visualElementGraphics.regularVertices))})))}};function g(e,t){return(e.attributes?.displayOrder??-1/0)-(t.attributes?.displayOrder??-1/0)}e([s()],d.prototype,"activeFillSymbol",void 0),e([s({readOnly:!0})],d.prototype,"type",void 0),e([s({constructOnly:!0,nonNullable:!0})],d.prototype,"view",void 0),d=e([a("esri.views.2d.interactive.draw.DrawGraphicTool2D")],d);export{d as DrawGraphicTool2D};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import"../../../../../geometry.js";import t from"../../../../../Graphic.js";import{makeHandle as i}from"../../../../../core/handleUtils.js";import{destroyMaybe as r}from"../../../../../core/maybe.js";import{watch as s,initial as a}from"../../../../../core/reactiveUtils.js";import{property as l}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/accessorSupport/ensureType.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators/subclass.js";import{SnappingVisualizer2D as n}from"../../SnappingVisualizer2D.js";import{outline as c,regularVertices as h,activeVertex as p}from"./symbols.js";import{DrawGraphicTool as m,geometryTypeToDrawOperationGeometryType as u}from"../../../../draw/DrawGraphicTool.js";import{DrawOperation as v}from"../../../../draw/DrawOperation.js";import{MapDrawSurface as y}from"../../../../draw/drawSurfaces.js";import d from"../../../../../geometry/Point.js";import g from"../../../../../geometry/Multipoint.js";let G=class extends m{constructor(e){super(e),this._visualElementGraphics={outline:null,regularVertices:null,activeVertex:null},this.activeFillSymbol=null,this.type="draw-2d",this._visualElementSymbols={outline:e.activeLineSymbol??c,regularVertices:e.regularVerticesSymbol??h,activeVertex:e.activeVertexSymbol??p,fill:e.activeFillSymbol},e.activeVertexSymbol||this.addHandles(s((()=>this.view?.effectiveTheme?.accentColor),(e=>{if(!e)return;const t=this._visualElementSymbols.activeVertex.clone().set({color:e});this._visualElementGraphics.activeVertex?.set("symbol",t),this._visualElementSymbols={...this._visualElementSymbols,activeVertex:t}}),a))}normalizeCtorArgs(e){const t={...e};return delete t.activeFillSymbol,delete t.activeVertexSymbol,delete t.regularVerticesSymbol,delete t.activeLineSymbol,t}initializeGraphic(e){return null!=this._visualElementSymbols.fill&&(e.symbol=this._visualElementSymbols.fill),i()}makeDrawOperation(){const{defaultZ:e,hasZ:t,view:i}=this;return this._createOrUpdateGraphic(null),new v({view:i,manipulators:this.manipulators,geometryType:u(this.geometryType),drawingMode:this.mode,hasZ:t,defaultZ:e,snapToSceneEnabled:this.snapToScene,drawSurface:new y(i,t,e),hasM:!1,snappingManager:this.snappingManager,snappingVisualizer:new n(this.internalGraphicsLayer),tooltipOptions:this.tooltipOptions,graphic:this.graphic,cursor:this.cursor})}onActiveVertexChanged(e){if("point"===this.geometryType)return i();const[s,a]=e,l=new d({x:s,y:a,spatialReference:this.view.spatialReference});return null!=this._visualElementGraphics.activeVertex?(this._visualElementGraphics.activeVertex.geometry=l,i()):(this._visualElementGraphics.activeVertex=new t({geometry:l,symbol:this._visualElementSymbols.activeVertex,attributes:{displayOrder:2}}),this.internalGraphicsLayer.add(this._visualElementGraphics.activeVertex),this.internalGraphicsLayer.graphics.sort(_),i((()=>{null!=this._visualElementGraphics.activeVertex&&(this.internalGraphicsLayer.remove(this._visualElementGraphics.activeVertex),this._visualElementGraphics.activeVertex=r(this._visualElementGraphics.activeVertex))})))}onOutlineChanged(e){const s=e.clone();if("polyline"===s.type){const e=s.paths[s.paths.length-1];e.splice(0,e.length-2)}return null!=this._visualElementGraphics.outline?(this._visualElementGraphics.outline.geometry=s,i()):(this._visualElementGraphics.outline=new t({geometry:s,symbol:this._visualElementSymbols.outline,attributes:{displayOrder:0}}),this.internalGraphicsLayer.add(this._visualElementGraphics.outline),this.internalGraphicsLayer.graphics.sort(_),i((()=>{null!=this._visualElementGraphics.outline&&(this.internalGraphicsLayer.remove(this._visualElementGraphics.outline),this._visualElementGraphics.outline=r(this._visualElementGraphics.outline))})))}onRegularVerticesChanged(e){const s=new g({points:e,spatialReference:this.view.spatialReference});return null!=this._visualElementGraphics.regularVertices?(this._visualElementGraphics.regularVertices.geometry=s,i()):(this._visualElementGraphics.regularVertices=new t({geometry:s,symbol:this._visualElementSymbols.regularVertices,attributes:{displayOrder:1}}),this.internalGraphicsLayer.add(this._visualElementGraphics.regularVertices),this.internalGraphicsLayer.graphics.sort(_),i((()=>{null!=this._visualElementGraphics.regularVertices&&(this.internalGraphicsLayer.remove(this._visualElementGraphics.regularVertices),this._visualElementGraphics.regularVertices=r(this._visualElementGraphics.regularVertices))})))}};function _(e,t){return(e.attributes?.displayOrder??-1/0)-(t.attributes?.displayOrder??-1/0)}e([l()],G.prototype,"activeFillSymbol",void 0),e([l({readOnly:!0})],G.prototype,"type",void 0),e([l({constructOnly:!0,nonNullable:!0})],G.prototype,"view",void 0),G=e([o("esri.views.2d.interactive.draw.DrawGraphicTool2D")],G);export{G as DrawGraphicTool2D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../../geometry.js";import{ArcadeDate as e}from"../../../../../arcade/ArcadeDate.js";import has from"../../../../../core/has.js";import{assertIsSome as t}from"../../../../../core/maybe.js";import{DateOnly as r}from"../../../../../core/sql/DateOnly.js";import{TimeOnly as s}from"../../../../../core/sql/TimeOnly.js";import{GeometryCursor as i}from"../../../../../geometry/GeometryCursor.js";import{getLabelPoint as a}from"../../../../../geometry/support/labelPoint.js";import{convertToGeometry as n}from"../../../../../layers/graphics/featureConversionUtils.js";import o from"../../../../../layers/graphics/OptimizedGeometry.js";import{system as d,unknown as u}from"../../../../../time/timeZoneUtils.js";import{StaticBitSet as l}from"./StaticBitSet.js";import{fromJSON as m}from"../../../../../geometry/support/jsonUtils.js";let c=0;const h=has("featurelayer-simplify-thresholds")??[.5,.5,.5,.5],y=h[0],f=h[1],p=h[2],g=h[3],_=has("featurelayer-simplify-payload-size-factors")??[1,2,4],A=_[0],x=_[1],I=_[2],b=has("featurelayer-simplify-mobile-factor")??2,T=has("esri-mobile");class S{constructor(e,t){this.type="FeatureSetReader",this.arcadeDeclaredClass="esri.arcade.Feature",this.seen=!1,this.instance=0,this._tx=0,this._ty=0,this._sx=1,this._sy=1,this._deleted=null,this._joined=[],this._objectIdToIndex=null,this._level=0,this.contextTimeZone=null,this.instance=e,this._layerSchema=t}static createInstance(){return c++,c=c>65535?0:c,c}get isEmpty(){return null!=this._deleted&&this._deleted.countSet()===this.getSize()}set level(e){this._level=e}getAreaSimplificationThreshold(e,t){let r=1;const s=T?b:1;t>4e6?r=I*s:t>1e6?r=x*s:t>5e5?r=A*s:t>1e5&&(r=s);let i=0;e>4e3?i=g*r:e>2e3?i=p*r:e>100?i=f:e>15&&(i=y);let a=8;return this._level<4?a=1:this._level<5?a=2:this._level<6&&(a=4),i*a}createQuantizedExtrudedGeometry(e,t){return"esriGeometryPolyline"===this.geometryType?this._createQuantizedExtrudedLine(e,t):this._createQuantizedExtrudedQuad(e,t)}_createQuantizedExtrudedQuad(e,t){return new o([5],[e-1,t,1,-1,1,1,-1,1,-1,-1])}_createQuantizedExtrudedLine(e,t){return new o([2],[e-1,t+1,1,-1])}parseTimestampOffset(e){return e}setArcadeSpatialReference(e){this._arcadeSpatialReference=e}attachStorage(e){this._storage=e}getQuantizationTransform(){throw new Error("Unable to find transform for featureSet")}getStorage(){return this._storage}getComputedNumeric(e){return this.getComputedNumericAtIndex(0)}setComputedNumeric(e,t){return this.setComputedNumericAtIndex(t,0)}getComputedString(e){return this.getComputedStringAtIndex(0)}setComputedString(e,t){return this.setComputedStringAtIndex(0,t)}getComputedNumericAtIndex(e){return this._storage.getComputedNumericAtIndex(this.getDisplayId(),e)}setComputedNumericAtIndex(e,t){this._storage.setComputedNumericAtIndex(this.getDisplayId(),e,t)}getComputedStringAtIndex(e){return this._storage.getComputedStringAtIndex(this.getDisplayId(),e)}setComputedStringAtIndex(e,t){return this._storage.setComputedStringAtIndex(this.getDisplayId(),e,t)}transform(e,t,r,s){const i=this.copy();return i._tx+=e,i._ty+=t,i._sx*=r,i._sy*=s,i}readAttributeAsTimestamp(e){const t=this.readAttribute(e);return"string"==typeof t?new Date(t).getTime():"number"==typeof t||null==t?t:null}readAttribute(e,t=!1){const r=this._readAttribute(e,t);if(void 0!==r)return r;for(const s of this._joined){s.setIndex(this.getIndex());const r=s._readAttribute(e,t);if(void 0!==r)return r}}readAttributes(){const e=this._readAttributes();for(const t of this._joined){t.setIndex(this.getIndex());const r=t._readAttributes();for(const t of Object.keys(r))e[t]=r[t]}return e}joinAttributes(e){this._joined.push(e)}readArcadeFeature(){return this}hasField(e){return this.fields.has(e)}geometry(){const e=this.readHydratedGeometry(),t=n(e,this.geometryType,this.hasZ,this.hasM),r=m(t);return r&&(r.spatialReference=this._arcadeSpatialReference),r}autocastArcadeDate(t,r){return r&&r instanceof Date?this.isUnknownDateTimeField(t)?e.unknownDateJSToArcadeDate(r):e.dateJSAndZoneToArcadeDate(r,this.contextTimeZone??d):r}isUnknownDateTimeField(e){return this._layerSchema.fieldsIndex.getTimeZone(e)===u}field(t){let i=this.fields.get(t);if(i)switch(i.type){case"date-only":case"esriFieldTypeDateOnly":return r.fromReader(this.readAttribute(t,!1));case"time-only":case"esriFieldTypeTimeOnly":return s.fromReader(this.readAttribute(t,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return e.fromReaderAsTimeStampOffset(this.readAttribute(t,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(t,this.readAttribute(t,!0));default:return this.readAttribute(t,!1)}for(const a of this._joined)if(a.setIndex(this.getIndex()),i=a.fields.get(t),i)switch(i.type){case"date-only":case"esriFieldTypeDateOnly":return r.fromReader(a._readAttribute(t,!1));case"time-only":case"esriFieldTypeTimeOnly":return s.fromReader(a._readAttribute(t,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return e.fromReaderAsTimeStampOffset(a._readAttribute(t,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(t,a._readAttribute(t,!0));default:return this.readAttribute(t,!1)}throw new Error(`Field ${t} does not exist`)}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this.fields.fields.map((e=>e.name))}castToText(e=!1){if(!e)return JSON.stringify(this.readLegacyFeature());const t=this.readLegacyFeature();if(!t)return JSON.stringify(null);const r={geometry:t.geometry,attributes:{...t.attributes??{}}};for(const s in r.attributes){const e=r.attributes[s];e instanceof Date&&(r.attributes[s]=e.getTime())}return JSON.stringify(r)}gdbVersion(){return null}fullSchema(){return this._layerSchema}castAsJson(e=null){return{attributes:this._readAttributes(),geometry:!0===e?.keepGeometryType?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}removeIds(e){if(null==this._objectIdToIndex){const e=new Map,r=this.getCursor();for(;r.next();){const s=r.getObjectId();t(s),e.set(s,r.getIndex())}this._objectIdToIndex=e}const r=this._objectIdToIndex;for(const t of e)r.has(t)&&this.removeAtIndex(r.get(t))}removeAtIndex(e){null==this._deleted&&(this._deleted=l.create(this.getSize())),this._deleted.set(e)}readGeometryForDisplay(){return this.readUnquantizedGeometry(!0)}readLegacyGeometryForDisplay(){return this.readLegacyGeometry(!0)}*features(){const e=this.getCursor();for(;e.next();)yield e.readOptimizedFeature()}_getExists(){return null==this._deleted||!this._deleted.has(this.getIndex())}_computeCentroid(){if("esriGeometryPolygon"!==this.geometryType)return null;const e=this.readUnquantizedGeometry();if(!e||e.hasIndeterminateRingOrder)return null;const t=i.fromOptimized(e,this.geometryType);t.yFactor*=-1;const r=a(t);return r?(r[1]*=-1,new o([],r)):null}copyInto(e){e.seen=this.seen,e._storage=this._storage,e._arcadeSpatialReference=this._arcadeSpatialReference,e._joined=this._joined,e._tx=this._tx,e._ty=this._ty,e._sx=this._sx,e._sy=this._sy,e._deleted=this._deleted,e._objectIdToIndex=this._objectIdToIndex}}export{S as FeatureSetReader};
5
+ import"../../../../../geometry.js";import{ArcadeDate as e}from"../../../../../arcade/ArcadeDate.js";import has from"../../../../../core/has.js";import{assertIsSome as t}from"../../../../../core/maybe.js";import{DateOnly as r}from"../../../../../core/sql/DateOnly.js";import{TimeOnly as s}from"../../../../../core/sql/TimeOnly.js";import{GeometryCursor as i}from"../../../../../geometry/GeometryCursor.js";import{getLabelPoint as n}from"../../../../../geometry/support/labelPoint.js";import{convertToGeometry as a}from"../../../../../layers/graphics/featureConversionUtils.js";import o from"../../../../../layers/graphics/OptimizedGeometry.js";import{system as d,unknown as u}from"../../../../../time/timeZoneUtils.js";import{StaticBitSet as l}from"./StaticBitSet.js";import{fromJSON as m}from"../../../../../geometry/support/jsonUtils.js";let c=0;const h=has("featurelayer-simplify-thresholds")??[.5,.5,.5,.5],y=h[0],f=h[1],p=h[2],g=h[3],_=has("featurelayer-simplify-payload-size-factors")??[1,2,4],x=_[0],A=_[1],T=_[2],I=has("featurelayer-simplify-mobile-factor")??2,b=has("esri-mobile");class S{constructor(e,t){this.type="FeatureSetReader",this.arcadeDeclaredClass="esri.arcade.Feature",this.seen=!1,this.instance=0,this._tx=0,this._ty=0,this._sx=1,this._sy=1,this._deleted=null,this._joined=[],this._objectIdToIndex=null,this._contextTimeZone=null,this._level=0,this.instance=e,this._layerSchema=t}static createInstance(){return c++,c=c>65535?0:c,c}get isEmpty(){return null!=this._deleted&&this._deleted.countSet()===this.getSize()}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}set level(e){this._level=e}getAreaSimplificationThreshold(e,t){let r=1;const s=b?I:1;t>4e6?r=T*s:t>1e6?r=A*s:t>5e5?r=x*s:t>1e5&&(r=s);let i=0;e>4e3?i=g*r:e>2e3?i=p*r:e>100?i=f:e>15&&(i=y);let n=8;return this._level<4?n=1:this._level<5?n=2:this._level<6&&(n=4),i*n}createQuantizedExtrudedGeometry(e,t){return"esriGeometryPolyline"===this.geometryType?this._createQuantizedExtrudedLine(e,t):this._createQuantizedExtrudedQuad(e,t)}_createQuantizedExtrudedQuad(e,t){return new o([5],[e-1,t,1,-1,1,1,-1,1,-1,-1])}_createQuantizedExtrudedLine(e,t){return new o([2],[e-1,t+1,1,-1])}parseTimestampOffset(e){return e}setArcadeSpatialReference(e){this._arcadeSpatialReference=e}attachStorage(e){this._storage=e}getQuantizationTransform(){throw new Error("Unable to find transform for featureSet")}getStorage(){return this._storage}getComputedNumeric(e){return this.getComputedNumericAtIndex(0)}setComputedNumeric(e,t){return this.setComputedNumericAtIndex(t,0)}getComputedString(e){return this.getComputedStringAtIndex(0)}setComputedString(e,t){return this.setComputedStringAtIndex(0,t)}getComputedNumericAtIndex(e){return this._storage.getComputedNumericAtIndex(this.getDisplayId(),e)}setComputedNumericAtIndex(e,t){this._storage.setComputedNumericAtIndex(this.getDisplayId(),e,t)}getComputedStringAtIndex(e){return this._storage.getComputedStringAtIndex(this.getDisplayId(),e)}setComputedStringAtIndex(e,t){return this._storage.setComputedStringAtIndex(this.getDisplayId(),e,t)}transform(e,t,r,s){const i=this.copy();return i._tx+=e,i._ty+=t,i._sx*=r,i._sy*=s,i}readAttributeAsTimestamp(e){const t=this.readAttribute(e);return"string"==typeof t?new Date(t).getTime():"number"==typeof t||null==t?t:null}readAttribute(e,t=!1){const r=this._readAttribute(e,t);if(void 0!==r)return r;for(const s of this._joined){s.setIndex(this.getIndex());const r=s._readAttribute(e,t);if(void 0!==r)return r}}readAttributes(){const e=this._readAttributes();for(const t of this._joined){t.setIndex(this.getIndex());const r=t._readAttributes();for(const t of Object.keys(r))e[t]=r[t]}return e}joinAttributes(e){this._joined.push(e)}readArcadeFeature(){return this}hasField(e){return this.fields.has(e)}geometry(){const e=this.readHydratedGeometry(),t=a(e,this.geometryType,this.hasZ,this.hasM),r=m(t);return r&&(r.spatialReference=this._arcadeSpatialReference),r}autocastArcadeDate(t,r){return r&&r instanceof Date?this.isUnknownDateTimeField(t)?e.unknownDateJSToArcadeDate(r):e.dateJSAndZoneToArcadeDate(r,this.contextTimeZone??d):r}isUnknownDateTimeField(e){return this._layerSchema.fieldsIndex.getTimeZone(e)===u}field(t){let i=this.fields.get(t);if(i)switch(i.type){case"date-only":case"esriFieldTypeDateOnly":return r.fromReader(this.readAttribute(t,!1));case"time-only":case"esriFieldTypeTimeOnly":return s.fromReader(this.readAttribute(t,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return e.fromReaderAsTimeStampOffset(this.readAttribute(t,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(t,this.readAttribute(t,!0));default:return this.readAttribute(t,!1)}for(const n of this._joined)if(n.setIndex(this.getIndex()),i=n.fields.get(t),i)switch(i.type){case"date-only":case"esriFieldTypeDateOnly":return r.fromReader(n._readAttribute(t,!1));case"time-only":case"esriFieldTypeTimeOnly":return s.fromReader(n._readAttribute(t,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return e.fromReaderAsTimeStampOffset(n._readAttribute(t,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(t,n._readAttribute(t,!0));default:return this.readAttribute(t,!1)}throw new Error(`Field ${t} does not exist`)}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this.fields.fields.map((e=>e.name))}castToText(e=!1){if(!e)return JSON.stringify(this.readLegacyFeature());const t=this.readLegacyFeature();if(!t)return JSON.stringify(null);const r={geometry:t.geometry,attributes:{...t.attributes??{}}};for(const s in r.attributes){const e=r.attributes[s];e instanceof Date&&(r.attributes[s]=e.getTime())}return JSON.stringify(r)}gdbVersion(){return null}fullSchema(){return this._layerSchema}castAsJson(e=null){return{attributes:this._readAttributes(),geometry:!0===e?.keepGeometryType?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}removeIds(e){if(null==this._objectIdToIndex){const e=new Map,r=this.getCursor();for(;r.next();){const s=r.getObjectId();t(s),e.set(s,r.getIndex())}this._objectIdToIndex=e}const r=this._objectIdToIndex;for(const t of e)r.has(t)&&this.removeAtIndex(r.get(t))}removeAtIndex(e){null==this._deleted&&(this._deleted=l.create(this.getSize())),this._deleted.set(e)}readGeometryForDisplay(){return this.readUnquantizedGeometry(!0)}readLegacyGeometryForDisplay(){return this.readLegacyGeometry(!0)}*features(){const e=this.getCursor();for(;e.next();)yield e.readOptimizedFeature()}_getExists(){return null==this._deleted||!this._deleted.has(this.getIndex())}_computeCentroid(){if("esriGeometryPolygon"!==this.geometryType)return null;const e=this.readUnquantizedGeometry();if(!e||e.hasIndeterminateRingOrder)return null;const t=i.fromOptimized(e,this.geometryType);t.yFactor*=-1;const r=n(t);return r?(r[1]*=-1,new o([],r)):null}copyInto(e){e.seen=this.seen,e._storage=this._storage,e._arcadeSpatialReference=this._arcadeSpatialReference,e._joined=this._joined,e._tx=this._tx,e._ty=this._ty,e._sx=this._sx,e._sy=this._sy,e._deleted=this._deleted,e._objectIdToIndex=this._objectIdToIndex,e.contextTimeZone=this.contextTimeZone}}export{S as FeatureSetReader};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{FeatureSetReader as e}from"./FeatureSetReader.js";class r extends e{static from(e,t){return new r(e.copy(),t)}constructor(r,t){super(e.createInstance(),r.fullSchema()),this._currentIndex=-1,this._reader=r,this._indices=t}get fields(){return this._reader.fields}get hasNext(){return this._currentIndex+1<this._indices.length}getSize(){return this._indices.length}getCursor(){return this.copy()}copy(){const e=new r(this._reader.copy(),this._indices);return e._currentIndex=this._currentIndex,e}next(){for(;this._nextIndex()&&!this._reader._getExists(););return this._currentIndex<this._indices.length}_nextIndex(){return++this._currentIndex<this._indices.length&&(this._reader.setIndex(this._indices[this._currentIndex]),!0)}setArcadeSpatialReference(e){this._reader.setArcadeSpatialReference(e)}attachStorage(e){this._reader.attachStorage(e)}get geometryType(){return this._reader.geometryType}get hasFeatures(){return this._reader.hasFeatures}get exceededTransferLimit(){return this._reader.exceededTransferLimit}get hasZ(){return this._reader.hasZ}get hasM(){return this._reader.hasM}getStorage(){return this._reader.getStorage()}getComputedNumeric(e){return this._reader.getComputedNumericAtIndex(0)}setComputedNumeric(e,r){return this._reader.setComputedNumericAtIndex(r,0)}getComputedString(e){return this._reader.getComputedStringAtIndex(0)}setComputedString(e,r){return this._reader.setComputedStringAtIndex(0,r)}getComputedNumericAtIndex(e){return this._reader.getComputedNumericAtIndex(e)}setComputedNumericAtIndex(e,r){this._reader.setComputedNumericAtIndex(e,r)}getComputedStringAtIndex(e){return this._reader.getComputedStringAtIndex(e)}setComputedStringAtIndex(e,r){return this._reader.setComputedStringAtIndex(e,r)}transform(e,r,t,d){const a=this.copy();return a._reader=this._reader.transform(e,r,t,d),a}readAttribute(e,r=!1){return this._reader.readAttribute(e,r)}readAttributes(){return this._reader.readAttributes()}joinAttributes(e){return this._reader.joinAttributes(e)}readArcadeFeature(){return this._reader.readArcadeFeature()}geometry(){return this._reader.geometry()}field(e){return this.readAttribute(e,!0)}hasField(e){return this._reader.hasField(e)}setField(e,r){return this._reader.setField(e,r)}keys(){return this._reader.keys()}castToText(e=!1){return this._reader.castToText(e)}getQuantizationTransform(){return this._reader.getQuantizationTransform()}getAttributeHash(){return this._reader.getAttributeHash()}getObjectId(){return this._reader.getObjectId()}getDisplayId(){return this._reader.getDisplayId()}setDisplayId(e){return this._reader.setDisplayId(e)}getGroupId(){return this._reader.getGroupId()}setGroupId(e){return this._reader.setGroupId(e)}getXHydrated(){return this._reader.getXHydrated()}getYHydrated(){return this._reader.getYHydrated()}getX(){return this._reader.getX()}getY(){return this._reader.getY()}setIndex(e){return this._reader.setIndex(e)}getIndex(){return this._reader.getIndex()}readLegacyFeature(){return this._reader.readLegacyFeature()}readOptimizedFeature(){return this._reader.readOptimizedFeature()}readLegacyPointGeometry(){return this._reader.readLegacyPointGeometry()}readLegacyGeometry(){return this._reader.readLegacyGeometry()}readLegacyCentroid(){return this._reader.readLegacyCentroid()}readGeometryArea(){return this._reader.readGeometryArea()}readUnquantizedGeometry(){return this._reader.readUnquantizedGeometry()}readHydratedGeometry(){return this._reader.readHydratedGeometry()}readGeometry(){return this._reader.readGeometry()}readCentroid(){return this._reader.readCentroid()}_readAttribute(e,r){throw new Error("Error: Should not be called. Underlying _reader should be used instead")}_readAttributes(){throw new Error("Error: Should not be called. Underlying _reader should be used instead")}}export{r as FeatureSetReaderIndirect};
5
+ import{FeatureSetReader as e}from"./FeatureSetReader.js";class r extends e{static from(e,t){return new r(e.copy(),t)}constructor(r,t){super(e.createInstance(),r.fullSchema()),this._currentIndex=-1,this._reader=r,this._indices=t}get fields(){return this._reader.fields}get hasNext(){return this._currentIndex+1<this._indices.length}getSize(){return this._indices.length}getCursor(){return this.copy()}copy(){const e=new r(this._reader.copy(),this._indices);return e._currentIndex=this._currentIndex,e}next(){for(;this._nextIndex()&&!this._reader._getExists(););return this._currentIndex<this._indices.length}_nextIndex(){return++this._currentIndex<this._indices.length&&(this._reader.setIndex(this._indices[this._currentIndex]),!0)}setArcadeSpatialReference(e){this._reader.setArcadeSpatialReference(e)}attachStorage(e){this._reader.attachStorage(e)}get geometryType(){return this._reader.geometryType}get hasFeatures(){return this._reader.hasFeatures}get exceededTransferLimit(){return this._reader.exceededTransferLimit}get hasZ(){return this._reader.hasZ}get hasM(){return this._reader.hasM}get contextTimeZone(){return this._reader.contextTimeZone}set contextTimeZone(e){this._reader.contextTimeZone=e}getStorage(){return this._reader.getStorage()}getComputedNumeric(e){return this._reader.getComputedNumericAtIndex(0)}setComputedNumeric(e,r){return this._reader.setComputedNumericAtIndex(r,0)}getComputedString(e){return this._reader.getComputedStringAtIndex(0)}setComputedString(e,r){return this._reader.setComputedStringAtIndex(0,r)}getComputedNumericAtIndex(e){return this._reader.getComputedNumericAtIndex(e)}setComputedNumericAtIndex(e,r){this._reader.setComputedNumericAtIndex(e,r)}getComputedStringAtIndex(e){return this._reader.getComputedStringAtIndex(e)}setComputedStringAtIndex(e,r){return this._reader.setComputedStringAtIndex(e,r)}transform(e,r,t,d){const a=this.copy();return a._reader=this._reader.transform(e,r,t,d),a}readAttribute(e,r=!1){return this._reader.readAttribute(e,r)}readAttributes(){return this._reader.readAttributes()}joinAttributes(e){return this._reader.joinAttributes(e)}readArcadeFeature(){return this._reader.readArcadeFeature()}geometry(){return this._reader.geometry()}field(e){return this.readAttribute(e,!0)}hasField(e){return this._reader.hasField(e)}setField(e,r){return this._reader.setField(e,r)}keys(){return this._reader.keys()}castToText(e=!1){return this._reader.castToText(e)}getQuantizationTransform(){return this._reader.getQuantizationTransform()}getAttributeHash(){return this._reader.getAttributeHash()}getObjectId(){return this._reader.getObjectId()}getDisplayId(){return this._reader.getDisplayId()}setDisplayId(e){return this._reader.setDisplayId(e)}getGroupId(){return this._reader.getGroupId()}setGroupId(e){return this._reader.setGroupId(e)}getXHydrated(){return this._reader.getXHydrated()}getYHydrated(){return this._reader.getYHydrated()}getX(){return this._reader.getX()}getY(){return this._reader.getY()}setIndex(e){return this._reader.setIndex(e)}getIndex(){return this._reader.getIndex()}readLegacyFeature(){return this._reader.readLegacyFeature()}readOptimizedFeature(){return this._reader.readOptimizedFeature()}readLegacyPointGeometry(){return this._reader.readLegacyPointGeometry()}readLegacyGeometry(){return this._reader.readLegacyGeometry()}readLegacyCentroid(){return this._reader.readLegacyCentroid()}readGeometryArea(){return this._reader.readGeometryArea()}readUnquantizedGeometry(){return this._reader.readUnquantizedGeometry()}readHydratedGeometry(){return this._reader.readHydratedGeometry()}readGeometry(){return this._reader.readGeometry()}readCentroid(){return this._reader.readCentroid()}_readAttribute(e,r){throw new Error("Error: Should not be called. Underlying _reader should be used instead")}_readAttributes(){throw new Error("Error: Should not be called. Underlying _reader should be used instead")}}export{r as FeatureSetReaderIndirect};