@arcgis/core 4.27.0-rc.0 → 4.27.0-rc.2

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 (207) hide show
  1. package/README.md +2 -2
  2. package/arcade/featureSetUtils.js +1 -1
  3. package/arcade/featureset/actions/GroupBy.js +1 -1
  4. package/arcade/featureset/actions/OrderBy.js +1 -1
  5. package/arcade/functions/featuresetbase.js +1 -1
  6. package/arcade/functions/featuresetstring.js +1 -1
  7. package/arcade/languageUtils.js +1 -1
  8. package/arcade/treeAnalysis.js +1 -1
  9. package/assets/esri/core/workers/RemoteClient.js +1 -1
  10. package/assets/esri/core/workers/chunks/0407bf97ad621c89a734.js +1 -0
  11. package/assets/esri/core/workers/chunks/0610691a0c0d9fbbd6d2.js +1 -0
  12. package/assets/esri/core/workers/chunks/0a86c458916e83d6c523.js +1 -0
  13. package/assets/esri/core/workers/chunks/14145959a3dab1437818.js +1 -0
  14. package/assets/esri/core/workers/chunks/16db0bc87d87a7313dc4.js +1 -0
  15. package/assets/esri/core/workers/chunks/183e2e0cb86c1c640d94.js +1 -0
  16. package/assets/esri/core/workers/chunks/19d329b9d4ec2eff1d13.js +1 -0
  17. package/assets/esri/core/workers/chunks/1b8074269800b384ecf6.js +1 -0
  18. package/assets/esri/core/workers/chunks/1f69fb9687de9ebfcf90.js +1 -0
  19. package/assets/esri/core/workers/chunks/2154d395f405be3cd3ba.js +1 -0
  20. package/assets/esri/core/workers/chunks/{33dbba3b7fc648437e50.js → 21e1f3b11e7d363b727a.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{31a158c73994603c169d.js → 2446e336b1f7256d4fde.js} +1 -1
  22. package/assets/esri/core/workers/chunks/29290a44fd3b183c24e3.js +1 -0
  23. package/assets/esri/core/workers/chunks/2b55295590b4a0503749.js +1 -0
  24. package/assets/esri/core/workers/chunks/{f498c4d4831141125781.js → 2f5639886f577baedbca.js} +1 -1
  25. package/assets/esri/core/workers/chunks/33901eb1574e46abd9af.js +1 -0
  26. package/assets/esri/core/workers/chunks/{9c78ad5ab57e0d47ac43.js → 3ba2fcb9110230f8790c.js} +1 -1
  27. package/assets/esri/core/workers/chunks/3e239bfad611985e50fb.js +1 -0
  28. package/assets/esri/core/workers/chunks/42f3421740a5479559dc.js +1 -0
  29. package/assets/esri/core/workers/chunks/471f6eba213412b82840.js +1 -0
  30. package/assets/esri/core/workers/chunks/53ad34bf32f5f3d4fe18.js +1 -0
  31. package/assets/esri/core/workers/chunks/{97cdbec7532cfcdf9ad2.js → 595a2baa04d92de59558.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{2e627c94e57c924e5917.js → 5e6471dd2a08e66b47d0.js} +79 -81
  33. package/assets/esri/core/workers/chunks/624521961fe1f2c4f2c5.js +1 -0
  34. package/assets/esri/core/workers/chunks/{212d59764c275c763941.js → 659b7bad7281c0e2aed3.js} +1 -1
  35. package/assets/esri/core/workers/chunks/6a3d611e8842afbb50ab.js.LICENSE.txt +1 -1
  36. package/assets/esri/core/workers/chunks/6cd248d065f6d1616294.js +1 -0
  37. package/assets/esri/core/workers/chunks/6e562fa57c0347091154.js +1 -0
  38. package/assets/esri/core/workers/chunks/6f510f28526c73ab453c.js +1 -0
  39. package/assets/esri/core/workers/chunks/7479dc0c790337af7597.js +1 -0
  40. package/assets/esri/core/workers/chunks/{e88cff2537be52da6531.js → 74fd2059ddda9083cbcc.js} +1 -1
  41. package/assets/esri/core/workers/chunks/7dc6774c77c822b68c99.js +1 -0
  42. package/assets/esri/core/workers/chunks/82a103a8b5382300889d.js +1 -0
  43. package/assets/esri/core/workers/chunks/83e3d104886b48f00397.js +1 -0
  44. package/assets/esri/core/workers/chunks/{9849f64793f2ad39366b.js → 9290b0d330f02233d803.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{3c5a64a545272f148e93.js → 9621b7d8d951aa881686.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{36df72362b38759b895b.js → 9648a8f2b24f1ca3d637.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{ad18fb7bb54a0c4bdb38.js → a20361b4d3bdd7d196ca.js} +1 -1
  48. package/assets/esri/core/workers/chunks/a7fd2a95fde197c06828.js +1 -0
  49. package/assets/esri/core/workers/chunks/b0cda39b53ecd6c44cd0.js +1 -0
  50. package/assets/esri/core/workers/chunks/b2a423d9ce8bb784267c.js +1 -0
  51. package/assets/esri/core/workers/chunks/{b6e173eddaad4244cb5f.js → b31974524932e638df8c.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{df0453cdfe685d6436cc.js → b6dc41fce601b9d3480e.js} +1 -1
  53. package/assets/esri/core/workers/chunks/b8e6c64792a512df4c4d.js +1 -0
  54. package/assets/esri/core/workers/chunks/c6617a937440701c0180.js +1 -0
  55. package/assets/esri/core/workers/chunks/d8607326a199dd994844.js +1 -0
  56. package/assets/esri/core/workers/chunks/da57eba2fe25495ea217.js +1 -0
  57. package/assets/esri/core/workers/chunks/dabd889e064c4e7807fa.js +1 -0
  58. package/assets/esri/core/workers/chunks/{39e473586579d11d6732.js → e2432871f1329f47465d.js} +1 -1
  59. package/assets/esri/core/workers/chunks/ee5ee03dd2c7dc940272.js +1 -0
  60. package/assets/esri/core/workers/chunks/{c83669cf08391a62fb72.js → f1da7b29eecad0e9efae.js} +1 -1
  61. package/assets/esri/core/workers/chunks/f35895e03c036d67b3ed.js +1 -0
  62. package/assets/esri/core/workers/chunks/f505ebd4bd3bfb6c790d.js +1 -0
  63. package/assets/esri/core/workers/chunks/f6e68befe2812b90b40d.js +1 -0
  64. package/assets/esri/core/workers/chunks/{3c6c082157c916f8ddba.js → ffe61d5a6a9b34bee9d4.js} +1 -1
  65. package/assets/esri/themes/base/widgets/_Bookmarks.scss +5 -0
  66. package/assets/esri/themes/base/widgets/_Feature.scss +4 -0
  67. package/assets/esri/themes/base/widgets/_FeatureContent.scss +9 -2
  68. package/assets/esri/themes/base/widgets/_Features.scss +5 -7
  69. package/assets/esri/themes/base/widgets/_Popup.scss +3 -3
  70. package/assets/esri/themes/base/widgets/_ScaleRangeSlider.scss +1 -0
  71. package/assets/esri/themes/base/widgets/_Swipe.scss +11 -0
  72. package/assets/esri/themes/dark/main.css +1 -1
  73. package/assets/esri/themes/light/main.css +1 -1
  74. package/assets/esri/themes/light/view.css +1 -1
  75. package/chunks/DefaultMaterial.glsl.js +3 -2
  76. package/chunks/SSAO.glsl.js +1 -1
  77. package/chunks/ShadowCastAccumulate.glsl.js +1 -1
  78. package/chunks/languageUtils.js +1 -1
  79. package/core/timeUtils.js +1 -1
  80. package/geometry/Mesh.js +1 -1
  81. package/geometry/support/DoubleArray.js +1 -1
  82. package/geometry/support/meshUtils/bounds.js +5 -0
  83. package/geometry/support/meshUtils/georeference.js +1 -1
  84. package/geometry/support/meshVertexSpaceUtils.js +5 -0
  85. package/interfaces.d.ts +181 -33
  86. package/kernel.js +1 -1
  87. package/layers/FeatureLayer.js +1 -1
  88. package/layers/StreamLayer.js +1 -1
  89. package/layers/VideoLayer.js +1 -1
  90. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  91. package/layers/graphics/controllers/StreamController.js +1 -1
  92. package/layers/graphics/data/QueryEngine.js +1 -1
  93. package/layers/graphics/data/attributeSupport.js +1 -1
  94. package/layers/graphics/editingSupport.js +1 -1
  95. package/layers/graphics/sources/FeatureLayerSource.js +1 -1
  96. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  97. package/layers/support/FeatureReductionBinning.js +1 -1
  98. package/layers/support/FeatureReductionCluster.js +1 -1
  99. package/layers/support/featureLayerUtils.js +1 -1
  100. package/layers/support/rasterFunctions/colormaps.js +1 -1
  101. package/layers/video/VideoController.js +1 -1
  102. package/layers/video/videoUtils.js +5 -0
  103. package/package.json +2 -2
  104. package/renderers/support/utils.js +1 -1
  105. package/rest/support/meshFeatureSet.js +1 -1
  106. package/smartMapping/symbology/flow.js +1 -1
  107. package/statistics/utils.js +1 -1
  108. package/support/arcadeUtils.js +1 -1
  109. package/support/revision.js +1 -1
  110. package/symbols/cim/CIMSymbolHelper.js +1 -1
  111. package/symbols/cim/effects/EffectBuffer.js +1 -1
  112. package/symbols/cim/effects/EffectDonut.js +1 -1
  113. package/symbols/cim/effects/EffectOffset.js +1 -1
  114. package/views/2d/layers/StreamLayerView2D.js +1 -1
  115. package/views/2d/layers/features/Store2D.js +1 -1
  116. package/views/2d/layers/features/sources/StreamSource.js +1 -1
  117. package/views/3d/environment/ChapmanAtmosphereTechnique.js +1 -1
  118. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  119. package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
  120. package/views/3d/layers/I3SMeshView3D.js +1 -1
  121. package/views/3d/layers/II3SMeshView3D.js +1 -1
  122. package/views/3d/layers/SceneLayerView3D.js +1 -1
  123. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  124. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  125. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  126. package/views/3d/layers/graphics/webStyleUtils.js +1 -1
  127. package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
  128. package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
  129. package/views/3d/layers/i3s/I3SOverrides.js +1 -1
  130. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  131. package/views/3d/webgl-engine/core/renderPasses/AllRenderPasses.js +1 -1
  132. package/views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js +3 -9
  133. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +12 -9
  134. package/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js +10 -10
  135. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +2 -2
  136. package/views/3d/webgl-engine/core/shaderLibrary/shading/WaterDistortion.glsl.js +2 -2
  137. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TerrainTexture.glsl.js +8 -8
  138. package/views/3d/webgl-engine/core/shaderModules/Matrix4sDrawUniform.js +1 -1
  139. package/views/3d/webgl-engine/lib/Camera.js +1 -1
  140. package/views/3d/webgl-engine/lib/ShadowHighlight.js +1 -1
  141. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  142. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  143. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  144. package/views/3d/webgl-engine/materials/pbrUtils.js +5 -0
  145. package/views/3d/webgl-engine/shaders/AtmosphereCompositingTechnique.js +1 -1
  146. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  147. package/views/3d/webgl-engine/shaders/ShadowHighlightTechnique.js +1 -1
  148. package/views/draw/DrawGraphicTool.js +1 -1
  149. package/views/layers/GroupLayerView.js +1 -1
  150. package/webdoc/support/writeUtils.js +1 -1
  151. package/widgets/Bookmarks/css.js +1 -1
  152. package/widgets/Bookmarks.js +1 -1
  153. package/widgets/Daylight/DaylightViewModel.js +1 -1
  154. package/widgets/Editor/EditorViewModel.js +1 -1
  155. package/widgets/Editor/UpdateWorkflow.js +1 -1
  156. package/widgets/Editor/Workflow.js +1 -1
  157. package/widgets/Editor/workflowUtils.js +1 -1
  158. package/widgets/Editor.js +1 -1
  159. package/widgets/Feature/FeatureRelationship/FeatureRelationshipViewModel.js +1 -1
  160. package/widgets/Feature/FeatureRelationship.js +1 -1
  161. package/widgets/FeatureForm/EditableInput.d.ts +2 -2
  162. package/widgets/FeatureTable/FieldColumn.js +1 -1
  163. package/widgets/Features.js +1 -1
  164. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
  165. package/widgets/UtilityNetworkTrace/support/GeometryHandler.js +1 -1
  166. package/widgets/UtilityNetworkTrace/support/ResultAreaHandler.js +1 -1
  167. package/widgets/UtilityNetworkTrace.js +1 -1
  168. package/widgets/UtilityNetworkValidateTopology/UtilityNetworkValidateTopologyViewModel.js +1 -1
  169. package/widgets/UtilityNetworkValidateTopology.js +1 -1
  170. package/widgets/ValuePicker/ValuePickerBaseComponent.js +1 -1
  171. package/widgets/ValuePicker.js +1 -1
  172. package/assets/esri/core/workers/chunks/0b03165dbf289797cefa.js +0 -1
  173. package/assets/esri/core/workers/chunks/0c1c0024879f944f44c4.js +0 -1
  174. package/assets/esri/core/workers/chunks/13a48796905613bc1679.js +0 -1
  175. package/assets/esri/core/workers/chunks/1ea1104651ab15f9a13c.js +0 -1
  176. package/assets/esri/core/workers/chunks/2108cfc7921430f0b805.js +0 -1
  177. package/assets/esri/core/workers/chunks/2eacca322737aafd8f0c.js +0 -1
  178. package/assets/esri/core/workers/chunks/39577683e334eb4d904c.js +0 -1
  179. package/assets/esri/core/workers/chunks/39714837f9d3708e3806.js +0 -1
  180. package/assets/esri/core/workers/chunks/3fe357df92afa1bee70a.js +0 -1
  181. package/assets/esri/core/workers/chunks/4d3deeb0ebd0ce8c1215.js +0 -1
  182. package/assets/esri/core/workers/chunks/576bddc3fa7d91a7e5bd.js +0 -1
  183. package/assets/esri/core/workers/chunks/623d6710a4f800c622ce.js +0 -1
  184. package/assets/esri/core/workers/chunks/6782cc3feb713676d544.js +0 -1
  185. package/assets/esri/core/workers/chunks/6e7178de0b2c3d2f7e6b.js +0 -1
  186. package/assets/esri/core/workers/chunks/785a6c925f29bc962992.js +0 -1
  187. package/assets/esri/core/workers/chunks/78ce0b1af62435d8ebf4.js +0 -1
  188. package/assets/esri/core/workers/chunks/79d2baf392589588ef9b.js +0 -1
  189. package/assets/esri/core/workers/chunks/7bbdba52157da13a01fc.js +0 -1
  190. package/assets/esri/core/workers/chunks/7ec6be2bc0f354011e46.js +0 -1
  191. package/assets/esri/core/workers/chunks/84860b535a70ec448cfe.js +0 -1
  192. package/assets/esri/core/workers/chunks/9035d9e09a4e7cb94d37.js +0 -1
  193. package/assets/esri/core/workers/chunks/956b0fef7bc849415354.js +0 -1
  194. package/assets/esri/core/workers/chunks/9ab98321a4a7eaeeb018.js +0 -1
  195. package/assets/esri/core/workers/chunks/9cb7a68ff46e5c43e1d2.js +0 -1
  196. package/assets/esri/core/workers/chunks/a0f7f7f578521970c714.js +0 -1
  197. package/assets/esri/core/workers/chunks/a60eac45d3c65bd0216f.js +0 -1
  198. package/assets/esri/core/workers/chunks/aca5260f6984952a6e3d.js +0 -1
  199. package/assets/esri/core/workers/chunks/b05be356743fa5d24573.js +0 -1
  200. package/assets/esri/core/workers/chunks/ba6024465308c248170b.js +0 -1
  201. package/assets/esri/core/workers/chunks/d0983f808008920514f2.js +0 -1
  202. package/assets/esri/core/workers/chunks/dab832799bc06b0fec34.js +0 -1
  203. package/assets/esri/core/workers/chunks/e45d36aef2bc69ee9132.js +0 -1
  204. package/assets/esri/core/workers/chunks/e5bbd4cc5edbf7ab3624.js +0 -1
  205. package/assets/esri/core/workers/chunks/e700cf4d1f99291a4396.js +0 -1
  206. package/assets/esri/core/workers/chunks/f398a5cf33c3fd2522a5.js +0 -1
  207. package/assets/esri/core/workers/chunks/f4ee94a6cde4ea8837f1.js +0 -1
@@ -2,7 +2,7 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{c as e}from"../../../../../../chunks/vec3f64.js";import{RgbaFloatEncoding as a}from"../util/RgbaFloatEncoding.glsl.js";import{Float4PassUniform as s}from"../../shaderModules/Float4PassUniform.js";import{IntegerPassUniform as o}from"../../shaderModules/IntegerPassUniform.js";import{NoParameters as t,glsl as i}from"../../shaderModules/interfaces.js";import{Matrix4sDrawUniform as r}from"../../shaderModules/Matrix4sDrawUniform.js";import{Matrix4sPassUniform as d}from"../../shaderModules/Matrix4sPassUniform.js";import{Texture2DPassUniform as l}from"../../shaderModules/Texture2DPassUniform.js";class p extends t{constructor(){super(...arguments),this.origin=e()}}function n(e,a){a.receiveShadows&&(e.fragment.uniforms.add(new d("shadowMapMatrix",((e,a)=>a.shadowMap.getShadowMapMatrices(e.origin)),4)),h(e))}function c(e,a){a.receiveShadows&&(e.fragment.uniforms.add(new r("shadowMapMatrix",((e,a)=>a.shadowMap.getShadowMapMatrices(e.origin)),4)),h(e))}function h(e){const t=e.fragment;t.include(a),t.uniforms.add(new l("shadowMapTex",((e,a)=>a.shadowMap.depthTexture)),new o("numCascades",((e,a)=>a.shadowMap.numCascades)),new s("cascadeDistances",((e,a)=>a.shadowMap.cascadeDistances))),t.code.add(i`int chooseCascade(float depth, out mat4 mat) {
5
+ import{I as e}from"../../../../../../chunks/mat4f64.js";import{c as a}from"../../../../../../chunks/vec3f64.js";import{RgbaFloatEncoding as s}from"../util/RgbaFloatEncoding.glsl.js";import{Float4PassUniform as o}from"../../shaderModules/Float4PassUniform.js";import{IntegerPassUniform as t}from"../../shaderModules/IntegerPassUniform.js";import{NoParameters as i,glsl as r}from"../../shaderModules/interfaces.js";import{Matrix4sDrawUniform as d}from"../../shaderModules/Matrix4sDrawUniform.js";import{Matrix4sPassUniform as l}from"../../shaderModules/Matrix4sPassUniform.js";import{Texture2DPassUniform as n}from"../../shaderModules/Texture2DPassUniform.js";class p extends i{constructor(){super(...arguments),this.origin=a()}}class c extends p{constructor(){super(...arguments),this.modelTransformation=e}}function h(e,a){a.receiveShadows&&(e.fragment.uniforms.add(new l("shadowMapMatrix",((e,a)=>a.shadowMap.getShadowMapMatrices(e.origin,e.modelTransformation)),4)),f(e))}function v(e,a){a.receiveShadows&&(e.fragment.uniforms.add(new d("shadowMapMatrix",((e,a,s)=>a.shadowMap.getShadowMapMatrices(e.origin,s.modelTransformation)),4)),f(e))}function f(e){const a=e.fragment;a.include(s),a.uniforms.add(new n("shadowMapTex",((e,a)=>a.shadowMap.depthTexture)),new t("numCascades",((e,a)=>a.shadowMap.numCascades)),new o("cascadeDistances",((e,a)=>a.shadowMap.cascadeDistances))),a.code.add(r`int chooseCascade(float depth, out mat4 mat) {
6
6
  vec4 distance = cascadeDistances;
7
7
  int i = depth < distance[1] ? 0 : depth < distance[2] ? 1 : depth < distance[3] ? 2 : 3;
8
8
  mat = i == 0 ? shadowMapMatrix[0] : i == 1 ? shadowMapMatrix[1] : i == 2 ? shadowMapMatrix[2] : shadowMapMatrix[3];
@@ -40,4 +40,4 @@ if (lvpos.z >= 1.0) { return 0.0; }
40
40
  if (lvpos.x < 0.0 || lvpos.x > 1.0 || lvpos.y < 0.0 || lvpos.y > 1.0) { return 0.0; }
41
41
  vec2 uv = cascadeCoordinates(i, lvpos);
42
42
  return filterShadow(uv, lvpos, float(textureSize(shadowMapTex, 0).x), shadowMapTex);
43
- }`)}export{p as ReadShadowMapBindParameters,c as ReadShadowMapDraw,n as ReadShadowMapPass};
43
+ }`)}export{v as ReadShadowMapDraw,p as ReadShadowMapDrawParameters,h as ReadShadowMapPass,c as ReadShadowMapPassParameters};
@@ -2,7 +2,7 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{s as e}from"../../../../../../chunks/vec2.js";import{a as t}from"../../../../../../chunks/vec2f64.js";import{s as r}from"../../../../../../chunks/vec4.js";import{c as a}from"../../../../../../chunks/vec4f64.js";import{FoamIntensity as o}from"./FoamRendering.glsl.js";import{Float2PassUniform as m}from"../../shaderModules/Float2PassUniform.js";import{Float4PassUniform as s}from"../../shaderModules/Float4PassUniform.js";import{glsl as v,NoParameters as u}from"../../shaderModules/interfaces.js";import{Texture2DPassUniform as l}from"../../shaderModules/Texture2DPassUniform.js";function i(t){t.fragment.uniforms.add(new l("texWaveNormal",(e=>e.waveNormal)),new l("texWavePerturbation",(e=>e.wavePertubation)),new s("waveParams",(e=>r(f,e.waveStrength,e.waveTextureRepeat,e.flowStrength,e.flowOffset))),new m("waveDirection",(t=>e(c,t.waveDirection[0]*t.waveVelocity,t.waveDirection[1]*t.waveVelocity)))),t.include(o),t.fragment.code.add(v`const vec2 FLOW_JUMP = vec2(6.0/25.0, 5.0/24.0);
5
+ import{s as e}from"../../../../../../chunks/vec2.js";import{a as t}from"../../../../../../chunks/vec2f64.js";import{s as r}from"../../../../../../chunks/vec4.js";import{c as a}from"../../../../../../chunks/vec4f64.js";import{FoamIntensity as o}from"./FoamRendering.glsl.js";import{ReadShadowMapPassParameters as m}from"./ReadShadowMap.glsl.js";import{Float2PassUniform as s}from"../../shaderModules/Float2PassUniform.js";import{Float4PassUniform as v}from"../../shaderModules/Float4PassUniform.js";import{glsl as l}from"../../shaderModules/interfaces.js";import{Texture2DPassUniform as u}from"../../shaderModules/Texture2DPassUniform.js";function i(t){t.fragment.uniforms.add(new u("texWaveNormal",(e=>e.waveNormal)),new u("texWavePerturbation",(e=>e.wavePertubation)),new v("waveParams",(e=>r(f,e.waveStrength,e.waveTextureRepeat,e.flowStrength,e.flowOffset))),new s("waveDirection",(t=>e(c,t.waveDirection[0]*t.waveVelocity,t.waveDirection[1]*t.waveVelocity)))),t.include(o),t.fragment.code.add(l`const vec2 FLOW_JUMP = vec2(6.0/25.0, 5.0/24.0);
6
6
  vec2 textureDenormalized2D(sampler2D _tex, vec2 _uv) {
7
7
  return 2.0 * texture(_tex, _uv).rg - 1.0;
8
8
  }
@@ -51,4 +51,4 @@ float waveTextureRepeat = waveParams[1];
51
51
  vec3 normal = getWaveLayer(texWaveNormal, texWavePerturbation, _uv * waveTextureRepeat, waveDirection, _time);
52
52
  float foam = normals2FoamIntensity(normal, waveParams[0]);
53
53
  return vec4(normal, foam);
54
- }`)}class n extends u{}const f=a(),c=t();export{i as WaterDistortion,n as WaterDistortionPassParameters};
54
+ }`)}class n extends m{}const f=a(),c=t();export{i as WaterDistortion,n as WaterDistortionPassParameters};
@@ -2,26 +2,26 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{OverlayIndex as e}from"../../../../terrain/interfaces.js";import{BackgroundGrid as t}from"./BackgroundGrid.glsl.js";import{overlay as r}from"./Overlay.glsl.js";import{TileBlendInput as o}from"./TileBlendInput.js";import{FloatPassUniform as c}from"../../shaderModules/FloatPassUniform.js";import{NoParameters as s,glsl as n}from"../../shaderModules/interfaces.js";import{Texture2DPassUniform as a}from"../../shaderModules/Texture2DPassUniform.js";import{Uniform as d}from"../../shaderModules/Uniform.js";class i extends s{constructor(){super(...arguments),this.overlayOpacity=1}}function l(t,o){t.vertex.uniforms.add(new v("overlayTexOffset"),new v("overlayTexScale")),t.fragment.uniforms.add(new c("overlayOpacity",(e=>e.overlayOpacity)),new a("ovColorTex",((t,r)=>0===r.overlays.length?null:r.overlays[e.INNER].getColorTexture(t.overlaySource)))),r(t,o)}function u(e,r){const{vertex:c,fragment:s,varyings:a}=e;a.add("vtc","vec2"),c.uniforms.add(new v("texOffsetAndScale")),s.uniforms.add(new m("tex")),s.uniforms.add(new x("textureOpacities"));const d=r.textureFadingEnabled&&!r.renderOccluded;d&&(c.uniforms.add(new v("nextTexOffsetAndScale")),a.add("nvtc","vec2"),s.uniforms.add(new m("texNext")),s.uniforms.add(new x("nextTexOpacities")),s.uniforms.add(new f("fadeFactor")));const i=r.tileBlendInput===o.ColorComposite,l=r.tileBlendInput===o.GridComposite;l&&s.include(t),i&&s.uniforms.add(new x("backgroundColor")),c.code.add(n`
5
+ import{OverlayIndex as e}from"../../../../terrain/interfaces.js";import{ReadShadowMapPassParameters as o}from"../shading/ReadShadowMap.glsl.js";import{BackgroundGrid as r}from"./BackgroundGrid.glsl.js";import{overlay as t}from"./Overlay.glsl.js";import{TileBlendInput as s}from"./TileBlendInput.js";import{FloatPassUniform as c}from"../../shaderModules/FloatPassUniform.js";import{glsl as a}from"../../shaderModules/interfaces.js";import{Texture2DPassUniform as n}from"../../shaderModules/Texture2DPassUniform.js";import{Uniform as d}from"../../shaderModules/Uniform.js";class i extends o{constructor(){super(...arguments),this.overlayOpacity=1}}function l(o,r){o.vertex.uniforms.add(new v("overlayTexOffset"),new v("overlayTexScale")),o.fragment.uniforms.add(new c("overlayOpacity",(e=>e.overlayOpacity)),new n("ovColorTex",((o,r)=>0===r.overlays.length?null:r.overlays[e.INNER].getColorTexture(o.overlaySource)))),t(o,r)}function u(e,o){const{vertex:t,fragment:c,varyings:n}=e;n.add("vtc","vec2"),t.uniforms.add(new v("texOffsetAndScale")),c.uniforms.add(new m("tex")),c.uniforms.add(new x("textureOpacities"));const d=o.textureFadingEnabled&&!o.renderOccluded;d&&(t.uniforms.add(new v("nextTexOffsetAndScale")),n.add("nvtc","vec2"),c.uniforms.add(new m("texNext")),c.uniforms.add(new x("nextTexOpacities")),c.uniforms.add(new f("fadeFactor")));const i=o.tileBlendInput===s.ColorComposite,l=o.tileBlendInput===s.GridComposite;l&&c.include(r),i&&c.uniforms.add(new x("backgroundColor")),t.code.add(a`
6
6
  void forwardTextureCoordinatesWithTransform(in vec2 uv) {
7
7
  vtc = uv * texOffsetAndScale.zw + texOffsetAndScale.xy;
8
- ${d?n`nvtc = uv * nextTexOffsetAndScale.zw + nextTexOffsetAndScale.xy;`:n``}
9
- }`),s.code.add(n`
8
+ ${d?a`nvtc = uv * nextTexOffsetAndScale.zw + nextTexOffsetAndScale.xy;`:a``}
9
+ }`),c.code.add(a`
10
10
  vec4 getColor(vec4 color, vec2 uv, vec3 opacities) {
11
- ${l||i?n`
11
+ ${l||i?a`
12
12
  if (opacities.y <= 0.0) {
13
13
  return color * opacities.z * opacities.x;
14
14
  }
15
- vec4 bg = vec4(${i?n`backgroundColor`:n`gridColor(uv)`} * opacities.y, opacities.y);
15
+ vec4 bg = vec4(${i?a`backgroundColor`:a`gridColor(uv)`} * opacities.y, opacities.y);
16
16
  vec4 layer = color * opacities.z;
17
- return (bg * (1.0 - layer.a) + layer) * opacities.x;`:n`return color;`}
18
- }`),d?s.code.add(n`vec4 getTileColor() {
17
+ return (bg * (1.0 - layer.a) + layer) * opacities.x;`:a`return color;`}
18
+ }`),d?c.code.add(a`vec4 getTileColor() {
19
19
  vec4 color = getColor(texture(tex, vtc), vtc, textureOpacities);
20
20
  if (fadeFactor >= 1.0) {
21
21
  return color;
22
22
  }
23
23
  vec4 nextColor = getColor(texture(texNext, nvtc), nvtc, nextTexOpacities);
24
24
  return mix(nextColor, color, fadeFactor);
25
- }`):s.code.add(n`vec4 getTileColor() {
25
+ }`):c.code.add(a`vec4 getTileColor() {
26
26
  return getColor(texture(tex, vtc), vtc, textureOpacities);
27
27
  }`)}class f extends d{constructor(e){super(e,"float")}}class x extends d{constructor(e){super(e,"vec3")}}class v extends d{constructor(e){super(e,"vec4")}}class m extends d{constructor(e){super(e,"sampler2D")}}export{x as Float3Uniform,l as OverlayTerrain,i as OverlayTerrainPassParameters,u as TerrainTexture,m as Texture2DUniform};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{Uniform as r}from"./Uniform.js";import{BindType as e}from"../shaderTechnique/BindType.js";class o extends r{constructor(r,o,s){super(r,"mat4",e.Draw,((e,s,t)=>e.setUniformMatrix4fv(r,o(s,t))),s)}}export{o as Matrix4sDrawUniform};
5
+ import{Uniform as r}from"./Uniform.js";import{BindType as e}from"../shaderTechnique/BindType.js";class o extends r{constructor(r,o,s){super(r,"mat4",e.Draw,((e,s,t,i)=>e.setUniformMatrix4fv(r,o(s,t,i))),s)}}export{o as Matrix4sDrawUniform};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../../chunks/tslib.es6.js";import i from"../../../../core/Accessor.js";import e from"../../../../core/Logger.js";import{lerp as r}from"../../../../core/mathUtils.js";import{createScreenPointArray as s,createRenderScreenPointArray3 as h}from"../../../../core/screenUtils.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 n}from"../../../../core/accessorSupport/decorators/subclass.js";import{c as a,m as p,q as _,j as u,a as v,t as l,u as c}from"../../../../chunks/mat4.js";import{c as w}from"../../../../chunks/mat4f64.js";import{j as d,m as g}from"../../../../chunks/vec2.js";import{f as y}from"../../../../chunks/vec2f64.js";import{b as f,i as m,c as x,k as M,w as T,e as D,E as j,z as R,g as P,l as F,s as O,f as V,n as S,r as C}from"../../../../chunks/vec3.js";import{c as I}from"../../../../chunks/vec3f64.js";import{b,h as E,g as L,c as k,i as H,t as U}from"../../../../chunks/vec4.js";import{f as B,c as G}from"../../../../chunks/vec4f64.js";import{create as A,copy as z,fromMatrix as W}from"../../../../geometry/support/frustum.js";import{create as X}from"../../../../geometry/support/ray.js";import{projectPointSignedLength as Y}from"../../../../geometry/support/vector.js";import{ViewingMode as q}from"../../../ViewingMode.js";import{fovd2fovx as N,fovx2fovd as J,fovd2fovy as K,fovy2fovd as Q}from"./fov.js";var Z;let $=Z=class extends i{constructor(t={}){super(t),this._center=I(),this._up=I(),this._viewUp=I(),this._viewForward=I(),this._viewRight=I(),this._ray=X(),this._viewport=B(0,0,1,1),this._padding=B(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=y(1,1e3),this._viewDirty=!0,this._viewMatrix=w(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=w(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=w(),this._frustumDirty=!0,this._frustum=A(),this._fullViewport=G(),this._pixelRatio=1,this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(t){this._pixelRatio=t>0?t:1}get eye(){return this._ray.origin}set eye(t){this._compareAndSetView(t,this._ray.origin)}get center(){return this._center}set center(t){this._compareAndSetView(t,this._center,"_center")}get ray(){return f(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(t){this._compareAndSetView(t,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(t){a(this._viewMatrix,t),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get viewForward(){return this._ensureViewClean(),this._viewForward}get viewUp(){return this._ensureViewClean(),this._viewUp}get viewRight(){return this._ensureViewClean(),this._viewRight}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(t){this._nearFar[0]!==t&&(this._nearFar[0]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(t){this._nearFar[1]!==t&&(this._nearFar[1]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(t){this.x=t[0],this.y=t[1],this.width=t[2],this.height=t[3]}get screenViewport(){if(1===this.pixelRatio)return this._viewport;const t=b(G(),this._viewport,1/this.pixelRatio),i=this._get("screenViewport");return i&&E(t,i)?i:t}get screenPadding(){if(1===this.pixelRatio)return this._padding;const t=b(G(),this._padding,1/this.pixelRatio),i=this._get("screenPadding");return i&&E(t,i)?i:t}get x(){return this._viewport[0]}set x(t){t+=this._padding[ht.LEFT],this._viewport[0]!==t&&(this._viewport[0]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(t){t+=this._padding[ht.BOTTOM],this._viewport[1]!==t&&(this._viewport[1]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(t){this._viewport[2]!==t&&(this._viewport[2]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(t){this._viewport[3]!==t&&(this._viewport[3]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[ht.RIGHT]+this._padding[ht.LEFT]}set fullWidth(t){this.width=t-(this._padding[ht.RIGHT]+this._padding[ht.LEFT])}get fullHeight(){return this._viewport[3]+this._padding[ht.TOP]+this._padding[ht.BOTTOM]}set fullHeight(t){this.height=t-(this._padding[ht.TOP]+this._padding[ht.BOTTOM])}get fullViewport(){return this._fullViewport[0]=this._viewport[0]-this._padding[ht.LEFT],this._fullViewport[1]=this._viewport[1]-this._padding[ht.BOTTOM],this._fullViewport[2]=this.fullWidth,this._fullViewport[3]=this.fullHeight,this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(t){L(this._padding,t)||(this._viewport[0]+=t[ht.LEFT]-this._padding[ht.LEFT],this._viewport[1]+=t[ht.BOTTOM]-this._padding[ht.BOTTOM],this._viewport[2]-=t[ht.RIGHT]+t[ht.LEFT]-(this._padding[ht.RIGHT]+this._padding[ht.LEFT]),this._viewport[3]-=t[ht.TOP]+t[ht.BOTTOM]-(this._padding[ht.TOP]+this._padding[ht.BOTTOM]),k(this._padding,t),this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&(p(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){const t=this.width,i=this.height,e=this.near*Math.tan(this.fovY/2),r=e*this._aspect,s=_(w(),-r*(1+2*this._padding[ht.LEFT]/t),r*(1+2*this._padding[ht.RIGHT]/t),-e*(1+2*this._padding[ht.BOTTOM]/i),e*(1+2*this._padding[ht.TOP]/i),this.near,this.far),h=this._get("projectionMatrix");return h&&u(h,s)?h:s}get inverseProjectionMatrix(){return v(w(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||w()}get fov(){return this._fov}set fov(t){this._fov=t,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return N(this._fov,this.width,this.height)}set fovX(t){this._fov=J(t,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return K(this._fov,this.width,this.height)}set fovY(t){this._fov=Q(t,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return m(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&(v(this._viewInverseTransposeMatrix,this.viewMatrix),l(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(t){const i=2*t-1;return 2*this.near*this.far/(this.far+this.near-i*(this.far-this.near))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this.pixelRatio}get aboveGround(){return null!=this.relativeElevation&&this.relativeElevation>=0}copyFrom(t){x(this._ray.origin,t.eye),this.center=t.center,this.up=t.up,k(this._viewport,t.viewport),this.notifyChange("_viewport"),k(this._padding,t.padding),this.notifyChange("_padding"),d(this._nearFar,t.nearFar),this.notifyChange("_nearFar"),this._fov=t.fov,this.relativeElevation=t.relativeElevation;const i=t;return this._viewDirty=i._viewDirty,this._viewDirty||(a(this._viewMatrix,t.viewMatrix),x(this._viewRight,t.viewRight),x(this._viewUp,t.viewUp),x(this._viewForward,t.viewForward)),this._viewProjectionDirty=!0,this._frustumDirty=i._frustumDirty,this._frustumDirty||(z(this._frustum,t.frustum),this._frustumDirty=!1),i._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:(a(this._viewInverseTransposeMatrix,t.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),k(this._fullViewport,t.fullViewport),this.pixelRatio=t.pixelRatio,this}copyViewFrom(t){this.eye=t.eye,this.center=t.center,this.up=t.up}clone(){return(new Z).copyFrom(this)}equals(t){return M(this.eye,t.eye)&&M(this.center,t.center)&&M(this.up,t.up)&&L(this._viewport,t.viewport)&&L(this._padding,t.padding)&&g(this.nearFar,t.nearFar)&&this._fov===t.fov&&this.pixelRatio===t.pixelRatio&&this.relativeElevation===t.relativeElevation}almostEquals(t){if(Math.abs(t.fov-this._fov)>=.001||H(t.screenPadding,this.screenPadding)>=1||H(this.screenViewport,t.screenViewport)>=1)return!1;T(et,t.eye,t.center),T(rt,this.eye,this.center);const i=D(et,rt),e=j(et),r=j(rt),s=5e-4;return i*i>=(1-1e-10)*e*r&&R(t.eye,this.eye)<Math.max(e,r)*s*s}computeRenderPixelSizeAt(t){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(t))}computeRenderPixelSizeAtDist(t){return t*this.perRenderPixelRatio}computeScreenPixelSizeAt(t){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(t))}_viewDirectionDistance(t){return Math.abs(Y(this.viewForward,f(et,t,this.eye)))}computeScreenPixelSizeAtDist(t){return t*this.perScreenPixelRatio}computeDistanceFromRadius(t,i){return t/Math.tan(Math.min(this.fovX,this.fovY)/(2*(i||1)))}getScreenCenter(t=s()){return t[0]=(this.padding[ht.LEFT]+this.width/2)/this.pixelRatio,t[1]=(this.padding[ht.TOP]+this.height/2)/this.pixelRatio,t}getRenderCenter(t,i=.5,e=.5){return t[0]=this.padding[ht.LEFT]+this.width*i,t[1]=this.padding[ht.BOTTOM]+this.height*e,t[2]=.5,t}setGLViewport(t){const i=this.viewport,e=this.padding;t.setViewport(i[0]-e[3],i[1]-e[2],i[2]+e[1]+e[3],i[3]+e[0]+e[2])}applyProjection(t,i){t!==tt&&x(tt,t),tt[3]=1,U(tt,tt,this.projectionMatrix);const e=Math.abs(tt[3]);P(tt,tt,1/e);const s=this.fullViewport;i[0]=r(0,s[0]+s[2],.5+.5*tt[0]),i[1]=r(0,s[1]+s[3],.5+.5*tt[1]),i[2]=.5*(tt[2]+1),i[3]=e}unapplyProjection(t,i){const e=this.fullViewport;tt[0]=(t[0]/(e[0]+e[2])*2-1)*t[3],tt[1]=(t[1]/(e[1]+e[3])*2-1)*t[3],tt[2]=(2*t[2]-1)*t[3],tt[3]=t[3],null!=this.inverseProjectionMatrix&&(U(tt,tt,this.inverseProjectionMatrix),i[0]=tt[0],i[1]=tt[1],i[2]=tt[2])}projectToScreen(t,i){return this.projectToRenderScreen(t,st),this.renderToScreen(st,i),i}projectToRenderScreen(t,i){if(tt[0]=t[0],tt[1]=t[1],tt[2]=t[2],tt[3]=1,U(tt,tt,this.viewProjectionMatrix),0===tt[3])return null;P(tt,tt,1/Math.abs(tt[3]));const e=this.fullViewport;return"x"in i?(i.x=r(0,e[0]+e[2],.5+.5*tt[0]),i.y=r(0,e[1]+e[3],.5+.5*tt[1])):(i[0]=r(0,e[0]+e[2],.5+.5*tt[0]),i[1]=r(0,e[1]+e[3],.5+.5*tt[1]),i.length>2&&(i[2]=.5*(tt[2]+1))),i}unprojectFromScreen(t,i){return this.unprojectFromRenderScreen(this.screenToRender(t,st),i)}unprojectFromRenderScreen(t,i){if(p(it,this.projectionMatrix,this.viewMatrix),!v(it,it))return null;const e=this.fullViewport;return tt[0]=2*(t[0]-e[0])/e[2]-1,tt[1]=2*(t[1]-e[1])/e[3]-1,tt[2]=2*t[2]-1,tt[3]=1,U(tt,tt,it),0===tt[3]?null:(i[0]=tt[0]/tt[3],i[1]=tt[1]/tt[3],i[2]=tt[2]/tt[3],i)}constrainWindowSize(t,i,e,r){const s=t*this.pixelRatio,h=i*this.pixelRatio,o=Math.max(s-e/2,0),n=Math.max(this.fullHeight-h-r/2,0),a=-Math.min(s-e/2,0),p=-Math.min(this.fullHeight-h-r/2,0);return[o,n,e-a- -Math.min(this.fullWidth-s-e/2,0),r-p- -Math.min(h-r/2,0)]}computeUp(t){t===q.Global?this._computeUpGlobal():this._computeUpLocal()}screenToRender(t,i){const e=t[0]*this.pixelRatio,r=this.fullHeight-t[1]*this.pixelRatio;return i[0]=e,i[1]=r,i}renderToScreen(t,i){const e=t[0]/this.pixelRatio,r=(this.fullHeight-t[1])/this.pixelRatio;i[0]=e,i[1]=r}_computeUpGlobal(){f(et,this.center,this.eye);const t=F(this.center);t<1?(O(this._up,0,0,1),this._markViewDirty(),this.notifyChange("_up")):Math.abs(D(et,this.center))>.9999*F(et)*t||(V(this._up,et,this.center),V(this._up,this._up,et),S(this._up,this._up),this.notifyChange("_up"),this._markViewDirty())}_computeUpLocal(){C(et,this.eye,this.center),Math.abs(et[2])<=.9999&&(P(et,et,et[2]),O(this._up,-et[0],-et[1],1-et[2]),S(this._up,this._up),this.notifyChange("_up"),this._markViewDirty())}_compareAndSetView(t,i,r=""){"number"==typeof t[0]&&isFinite(t[0])&&"number"==typeof t[1]&&isFinite(t[1])&&"number"==typeof t[2]&&isFinite(t[2])?M(t,i)||(x(i,t),this._markViewDirty(),r.length&&this.notifyChange(r)):e.getLogger("esri.views.3d.webgl-engine.lib.Camera").warn("Camera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewDirty=!0,this._frustumDirty=!0,this._viewProjectionDirty=!0}_recomputeFrustum(){this._frustumDirty&&(W(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&(c(this._viewMatrix,this.eye,this.center,this.up),O(this._viewForward,-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10]),O(this._viewUp,this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9]),O(this._viewRight,this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8]),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};t([o()],$.prototype,"_center",void 0),t([o()],$.prototype,"_up",void 0),t([o()],$.prototype,"_viewport",void 0),t([o()],$.prototype,"_padding",void 0),t([o()],$.prototype,"_fov",void 0),t([o()],$.prototype,"_nearFar",void 0),t([o()],$.prototype,"_pixelRatio",void 0),t([o()],$.prototype,"pixelRatio",null),t([o()],$.prototype,"eye",null),t([o()],$.prototype,"center",null),t([o()],$.prototype,"up",null),t([o({readOnly:!0})],$.prototype,"nearFar",null),t([o()],$.prototype,"near",null),t([o()],$.prototype,"far",null),t([o()],$.prototype,"viewport",null),t([o({readOnly:!0})],$.prototype,"screenViewport",null),t([o({readOnly:!0})],$.prototype,"screenPadding",null),t([o()],$.prototype,"x",null),t([o()],$.prototype,"y",null),t([o()],$.prototype,"width",null),t([o()],$.prototype,"height",null),t([o()],$.prototype,"fullWidth",null),t([o()],$.prototype,"fullHeight",null),t([o({readOnly:!0})],$.prototype,"_aspect",null),t([o()],$.prototype,"padding",null),t([o({readOnly:!0})],$.prototype,"projectionMatrix",null),t([o({readOnly:!0})],$.prototype,"inverseProjectionMatrix",null),t([o()],$.prototype,"fov",null),t([o()],$.prototype,"fovX",null),t([o()],$.prototype,"fovY",null),$=Z=t([n("esri.views.3d.webgl-engine.lib.Camera")],$);const tt=G(),it=w(),et=I(),rt=I(),st=h();var ht;!function(t){t[t.TOP=0]="TOP",t[t.RIGHT=1]="RIGHT",t[t.BOTTOM=2]="BOTTOM",t[t.LEFT=3]="LEFT"}(ht||(ht={}));export{$ as Camera,ht as PaddingSide};
5
+ import{_ as t}from"../../../../chunks/tslib.es6.js";import i from"../../../../core/Accessor.js";import e from"../../../../core/Logger.js";import{lerp as r}from"../../../../core/mathUtils.js";import{createScreenPointArray as s,createRenderScreenPointArray3 as h}from"../../../../core/screenUtils.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 n}from"../../../../core/accessorSupport/decorators/subclass.js";import{c as a,m as p,q as _,j as u,a as v,t as c,u as l}from"../../../../chunks/mat4.js";import{c as w}from"../../../../chunks/mat4f64.js";import{j as d,m as g}from"../../../../chunks/vec2.js";import{f as y}from"../../../../chunks/vec2f64.js";import{b as f,i as m,c as x,k as M,w as T,e as D,E as j,z as R,g as P,l as F,s as O,f as V,n as S,r as C}from"../../../../chunks/vec3.js";import{c as I}from"../../../../chunks/vec3f64.js";import{b,h as E,g as L,c as k,i as H,t as U}from"../../../../chunks/vec4.js";import{f as B,c as G}from"../../../../chunks/vec4f64.js";import{create as A,copy as z,fromMatrix as W}from"../../../../geometry/support/frustum.js";import{create as X}from"../../../../geometry/support/ray.js";import{projectPointSignedLength as Y}from"../../../../geometry/support/vector.js";import{ViewingMode as q}from"../../../ViewingMode.js";import{fovd2fovx as N,fovx2fovd as J,fovd2fovy as K,fovy2fovd as Q}from"./fov.js";var Z;let $=Z=class extends i{constructor(t={}){super(t),this._center=I(),this._up=I(),this._viewUp=I(),this._viewForward=I(),this._viewRight=I(),this._ray=X(),this._viewport=B(0,0,1,1),this._padding=B(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=y(1,1e3),this._viewDirty=!0,this._viewMatrix=w(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=w(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=w(),this._frustumDirty=!0,this._frustum=A(),this._fullViewport=G(),this._pixelRatio=1,this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(t){this._pixelRatio=t>0?t:1}get eye(){return this._ray.origin}set eye(t){this._compareAndSetView(t,this._ray.origin)}get center(){return this._center}set center(t){this._compareAndSetView(t,this._center,"_center")}get ray(){return f(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(t){this._compareAndSetView(t,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(t){a(this._viewMatrix,t),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get viewForward(){return this._ensureViewClean(),this._viewForward}get viewUp(){return this._ensureViewClean(),this._viewUp}get viewRight(){return this._ensureViewClean(),this._viewRight}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(t){this._nearFar[0]!==t&&(this._nearFar[0]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(t){this._nearFar[1]!==t&&(this._nearFar[1]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(t){this.x=t[0],this.y=t[1],this.width=t[2],this.height=t[3]}get screenViewport(){if(1===this.pixelRatio)return this._viewport;const t=b(G(),this._viewport,1/this.pixelRatio),i=this._get("screenViewport");return i&&E(t,i)?i:t}get screenPadding(){if(1===this.pixelRatio)return this._padding;const t=b(G(),this._padding,1/this.pixelRatio),i=this._get("screenPadding");return i&&E(t,i)?i:t}get x(){return this._viewport[0]}set x(t){t+=this._padding[ht.LEFT],this._viewport[0]!==t&&(this._viewport[0]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(t){t+=this._padding[ht.BOTTOM],this._viewport[1]!==t&&(this._viewport[1]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(t){this._viewport[2]!==t&&(this._viewport[2]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(t){this._viewport[3]!==t&&(this._viewport[3]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[ht.RIGHT]+this._padding[ht.LEFT]}set fullWidth(t){this.width=t-(this._padding[ht.RIGHT]+this._padding[ht.LEFT])}get fullHeight(){return this._viewport[3]+this._padding[ht.TOP]+this._padding[ht.BOTTOM]}set fullHeight(t){this.height=t-(this._padding[ht.TOP]+this._padding[ht.BOTTOM])}get fullViewport(){return this._fullViewport[0]=this._viewport[0]-this._padding[ht.LEFT],this._fullViewport[1]=this._viewport[1]-this._padding[ht.BOTTOM],this._fullViewport[2]=this.fullWidth,this._fullViewport[3]=this.fullHeight,this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(t){L(this._padding,t)||(this._viewport[0]+=t[ht.LEFT]-this._padding[ht.LEFT],this._viewport[1]+=t[ht.BOTTOM]-this._padding[ht.BOTTOM],this._viewport[2]-=t[ht.RIGHT]+t[ht.LEFT]-(this._padding[ht.RIGHT]+this._padding[ht.LEFT]),this._viewport[3]-=t[ht.TOP]+t[ht.BOTTOM]-(this._padding[ht.TOP]+this._padding[ht.BOTTOM]),k(this._padding,t),this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&(p(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){const t=this.width,i=this.height,e=this.near*Math.tan(this.fovY/2),r=e*this._aspect,s=_(w(),-r*(1+2*this._padding[ht.LEFT]/t),r*(1+2*this._padding[ht.RIGHT]/t),-e*(1+2*this._padding[ht.BOTTOM]/i),e*(1+2*this._padding[ht.TOP]/i),this.near,this.far),h=this._get("projectionMatrix");return h&&u(h,s)?h:s}get inverseProjectionMatrix(){return v(w(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||w()}get fov(){return this._fov}set fov(t){this._fov=t,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return N(this._fov,this.width,this.height)}set fovX(t){this._fov=J(t,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return K(this._fov,this.width,this.height)}set fovY(t){this._fov=Q(t,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return m(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&(v(this._viewInverseTransposeMatrix,this.viewMatrix),c(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(t){const i=2*t-1;return 2*this.near*this.far/(this.far+this.near-i*(this.far-this.near))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this.pixelRatio}get aboveGround(){return null!=this.relativeElevation&&this.relativeElevation>=0}copyFrom(t){x(this._ray.origin,t.eye),this.center=t.center,this.up=t.up,k(this._viewport,t.viewport),this.notifyChange("_viewport"),k(this._padding,t.padding),this.notifyChange("_padding"),d(this._nearFar,t.nearFar),this.notifyChange("_nearFar"),this._fov=t.fov,this.relativeElevation=t.relativeElevation;const i=t;return this._viewDirty=i._viewDirty,this._viewDirty||(a(this._viewMatrix,t.viewMatrix),x(this._viewRight,t.viewRight),x(this._viewUp,t.viewUp),x(this._viewForward,t.viewForward)),this._viewProjectionDirty=!0,this._frustumDirty=i._frustumDirty,this._frustumDirty||(z(this._frustum,t.frustum),this._frustumDirty=!1),i._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:(a(this._viewInverseTransposeMatrix,t.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),k(this._fullViewport,t.fullViewport),this.pixelRatio=t.pixelRatio,this}copyViewFrom(t){this.eye=t.eye,this.center=t.center,this.up=t.up}clone(){return(new Z).copyFrom(this)}equals(t){return M(this.eye,t.eye)&&M(this.center,t.center)&&M(this.up,t.up)&&L(this._viewport,t.viewport)&&L(this._padding,t.padding)&&g(this.nearFar,t.nearFar)&&this._fov===t.fov&&this.pixelRatio===t.pixelRatio&&this.relativeElevation===t.relativeElevation}almostEquals(t){if(Math.abs(t.fov-this._fov)>=.001||H(t.screenPadding,this.screenPadding)>=1||H(this.screenViewport,t.screenViewport)>=1)return!1;T(et,t.eye,t.center),T(rt,this.eye,this.center);const i=D(et,rt),e=j(et),r=j(rt),s=5e-4;return i*i>=(1-1e-10)*e*r&&R(t.eye,this.eye)<Math.max(e,r)*s*s}computeRenderPixelSizeAt(t){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(t))}computeRenderPixelSizeAtDist(t){return t*this.perScreenPixelRatio}computeScreenPixelSizeAt(t){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(t))}_viewDirectionDistance(t){return Math.abs(Y(this.viewForward,f(et,t,this.eye)))}computeScreenPixelSizeAtDist(t){return t*this.perScreenPixelRatio}computeDistanceFromRadius(t,i){return t/Math.tan(Math.min(this.fovX,this.fovY)/(2*(i||1)))}getScreenCenter(t=s()){return t[0]=(this.padding[ht.LEFT]+this.width/2)/this.pixelRatio,t[1]=(this.padding[ht.TOP]+this.height/2)/this.pixelRatio,t}getRenderCenter(t,i=.5,e=.5){return t[0]=this.padding[ht.LEFT]+this.width*i,t[1]=this.padding[ht.BOTTOM]+this.height*e,t[2]=.5,t}setGLViewport(t){const i=this.viewport,e=this.padding;t.setViewport(i[0]-e[3],i[1]-e[2],i[2]+e[1]+e[3],i[3]+e[0]+e[2])}applyProjection(t,i){t!==tt&&x(tt,t),tt[3]=1,U(tt,tt,this.projectionMatrix);const e=Math.abs(tt[3]);P(tt,tt,1/e);const s=this.fullViewport;i[0]=r(0,s[0]+s[2],.5+.5*tt[0]),i[1]=r(0,s[1]+s[3],.5+.5*tt[1]),i[2]=.5*(tt[2]+1),i[3]=e}unapplyProjection(t,i){const e=this.fullViewport;tt[0]=(t[0]/(e[0]+e[2])*2-1)*t[3],tt[1]=(t[1]/(e[1]+e[3])*2-1)*t[3],tt[2]=(2*t[2]-1)*t[3],tt[3]=t[3],null!=this.inverseProjectionMatrix&&(U(tt,tt,this.inverseProjectionMatrix),i[0]=tt[0],i[1]=tt[1],i[2]=tt[2])}projectToScreen(t,i){return this.projectToRenderScreen(t,st),this.renderToScreen(st,i),i}projectToRenderScreen(t,i){if(tt[0]=t[0],tt[1]=t[1],tt[2]=t[2],tt[3]=1,U(tt,tt,this.viewProjectionMatrix),0===tt[3])return null;P(tt,tt,1/Math.abs(tt[3]));const e=this.fullViewport;return"x"in i?(i.x=r(0,e[0]+e[2],.5+.5*tt[0]),i.y=r(0,e[1]+e[3],.5+.5*tt[1])):(i[0]=r(0,e[0]+e[2],.5+.5*tt[0]),i[1]=r(0,e[1]+e[3],.5+.5*tt[1]),i.length>2&&(i[2]=.5*(tt[2]+1))),i}unprojectFromScreen(t,i){return this.unprojectFromRenderScreen(this.screenToRender(t,st),i)}unprojectFromRenderScreen(t,i){if(p(it,this.projectionMatrix,this.viewMatrix),!v(it,it))return null;const e=this.fullViewport;return tt[0]=2*(t[0]-e[0])/e[2]-1,tt[1]=2*(t[1]-e[1])/e[3]-1,tt[2]=2*t[2]-1,tt[3]=1,U(tt,tt,it),0===tt[3]?null:(i[0]=tt[0]/tt[3],i[1]=tt[1]/tt[3],i[2]=tt[2]/tt[3],i)}constrainWindowSize(t,i,e,r){const s=t*this.pixelRatio,h=i*this.pixelRatio,o=Math.max(s-e/2,0),n=Math.max(this.fullHeight-h-r/2,0),a=-Math.min(s-e/2,0),p=-Math.min(this.fullHeight-h-r/2,0);return[o,n,e-a- -Math.min(this.fullWidth-s-e/2,0),r-p- -Math.min(h-r/2,0)]}computeUp(t){t===q.Global?this._computeUpGlobal():this._computeUpLocal()}screenToRender(t,i){const e=t[0]*this.pixelRatio,r=this.fullHeight-t[1]*this.pixelRatio;return i[0]=e,i[1]=r,i}renderToScreen(t,i){const e=t[0]/this.pixelRatio,r=(this.fullHeight-t[1])/this.pixelRatio;i[0]=e,i[1]=r}_computeUpGlobal(){f(et,this.center,this.eye);const t=F(this.center);t<1?(O(this._up,0,0,1),this._markViewDirty(),this.notifyChange("_up")):Math.abs(D(et,this.center))>.9999*F(et)*t||(V(this._up,et,this.center),V(this._up,this._up,et),S(this._up,this._up),this.notifyChange("_up"),this._markViewDirty())}_computeUpLocal(){C(et,this.eye,this.center),Math.abs(et[2])<=.9999&&(P(et,et,et[2]),O(this._up,-et[0],-et[1],1-et[2]),S(this._up,this._up),this.notifyChange("_up"),this._markViewDirty())}_compareAndSetView(t,i,r=""){"number"==typeof t[0]&&isFinite(t[0])&&"number"==typeof t[1]&&isFinite(t[1])&&"number"==typeof t[2]&&isFinite(t[2])?M(t,i)||(x(i,t),this._markViewDirty(),r.length&&this.notifyChange(r)):e.getLogger("esri.views.3d.webgl-engine.lib.Camera").warn("Camera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewDirty=!0,this._frustumDirty=!0,this._viewProjectionDirty=!0}_recomputeFrustum(){this._frustumDirty&&(W(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&(l(this._viewMatrix,this.eye,this.center,this.up),O(this._viewForward,-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10]),O(this._viewUp,this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9]),O(this._viewRight,this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8]),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};t([o()],$.prototype,"_center",void 0),t([o()],$.prototype,"_up",void 0),t([o()],$.prototype,"_viewport",void 0),t([o()],$.prototype,"_padding",void 0),t([o()],$.prototype,"_fov",void 0),t([o()],$.prototype,"_nearFar",void 0),t([o()],$.prototype,"_pixelRatio",void 0),t([o()],$.prototype,"pixelRatio",null),t([o()],$.prototype,"eye",null),t([o()],$.prototype,"center",null),t([o()],$.prototype,"up",null),t([o({readOnly:!0})],$.prototype,"nearFar",null),t([o()],$.prototype,"near",null),t([o()],$.prototype,"far",null),t([o()],$.prototype,"viewport",null),t([o({readOnly:!0})],$.prototype,"screenViewport",null),t([o({readOnly:!0})],$.prototype,"screenPadding",null),t([o()],$.prototype,"x",null),t([o()],$.prototype,"y",null),t([o()],$.prototype,"width",null),t([o()],$.prototype,"height",null),t([o()],$.prototype,"fullWidth",null),t([o()],$.prototype,"fullHeight",null),t([o({readOnly:!0})],$.prototype,"_aspect",null),t([o()],$.prototype,"padding",null),t([o({readOnly:!0})],$.prototype,"projectionMatrix",null),t([o({readOnly:!0})],$.prototype,"inverseProjectionMatrix",null),t([o()],$.prototype,"fov",null),t([o()],$.prototype,"fovX",null),t([o()],$.prototype,"fovY",null),$=Z=t([n("esri.views.3d.webgl-engine.lib.Camera")],$);const tt=G(),it=w(),et=I(),rt=I(),st=h();var ht;!function(t){t[t.TOP=0]="TOP",t[t.RIGHT=1]="RIGHT",t[t.BOTTOM=2]="BOTTOM",t[t.LEFT=3]="LEFT"}(ht||(ht={}));export{$ as Camera,ht as PaddingSide};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{smoothstep as t,clamp as e}from"../../../../core/mathUtils.js";import{disposeMaybe as s,releaseMaybe as a}from"../../../../core/maybe.js";import{n as i,s as r,e as h}from"../../../../chunks/vec3.js";import{c as o}from"../../../../chunks/vec3f64.js";import{ViewingMode as c}from"../../../ViewingMode.js";import{ReadShadowMapBindParameters as m}from"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{createQuadVAO as n}from"./glUtil3D.js";import{ShadowHighlightPassParameters as _,ShadowHighlightTechnique as p}from"../shaders/ShadowHighlightTechnique.js";import{vertexCount as d}from"../../../webgl/Util.js";const u=.001953125,l=4e4,g=5e4;class w{constructor(t,e){this._rctx=t,this._viewingMode=e,this._maxOpacity=1,this._passParameters=new _,this._drawParameters=new m,this._vao=n(this._rctx)}get _technique(){return null==this._techniqueCached&&(this._techniqueCached=new p({rctx:this._rctx,viewingMode:this._viewingMode})),this._techniqueCached}render(t,e){if(!t.shadowMap.enabled||!t.linearDepthTexture||!this.isVisible)return;const s=this._technique;this._drawParameters.origin=t.camera.center,this._rctx.bindFramebuffer(e),this._rctx.bindTechnique(s,this._passParameters,t).bindDraw(this._drawParameters,t,this._passParameters),this._rctx.bindVAO(this._vao),this._rctx.drawArrays(s.primitiveType,0,d(this._vao,"geometry"))}get gpuMemoryUsage(){return this._vao?.memoryEstimate??0}setDefaultOptions(t){this._passParameters={...this._passParameters,...t},this._updateMaxOpacity()}updateParameters(s,a){this._passParameters.opacityElevation=1-t(l,g,s.relativeElevation);const o=this._viewingMode===c.Global?i(y,s.center):r(y,0,0,1),m=h(o,a);this._passParameters.dayNightTerminator=t(0,1,e(30*m,0,1))}dispose(){this._vao=s(this._vao),this._techniqueCached=a(this._techniqueCached)}get isVisible(){const{opacityElevation:t,dayNightTerminator:e}=this._passParameters;return this._maxOpacity*t*e>=u}_updateMaxOpacity(){const t=Math.max(this._passParameters.shadowOpacity,this._passParameters.occludedShadowOpacity);this._maxOpacity=t*this._passParameters.shadowColor[3]}}const y=o();export{w as ShadowHighlight};
5
+ import{smoothstep as t,clamp as e}from"../../../../core/mathUtils.js";import{disposeMaybe as s,releaseMaybe as a}from"../../../../core/maybe.js";import{n as i,s as r,e as h}from"../../../../chunks/vec3.js";import{c as o}from"../../../../chunks/vec3f64.js";import{ViewingMode as c}from"../../../ViewingMode.js";import{ReadShadowMapDrawParameters as m}from"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{createQuadVAO as n}from"./glUtil3D.js";import{ShadowHighlightPassParameters as _,ShadowHighlightTechnique as p}from"../shaders/ShadowHighlightTechnique.js";import{vertexCount as d}from"../../../webgl/Util.js";const u=.001953125,l=4e4,g=5e4;class w{constructor(t,e){this._rctx=t,this._viewingMode=e,this._maxOpacity=1,this._passParameters=new _,this._drawParameters=new m,this._vao=n(this._rctx)}get _technique(){return null==this._techniqueCached&&(this._techniqueCached=new p({rctx:this._rctx,viewingMode:this._viewingMode})),this._techniqueCached}render(t,e){if(!t.shadowMap.enabled||!t.linearDepthTexture||!this.isVisible)return;const s=this._technique;this._drawParameters.origin=t.camera.center,this._rctx.bindFramebuffer(e),this._rctx.bindTechnique(s,this._passParameters,t).bindDraw(this._drawParameters,t,this._passParameters),this._rctx.bindVAO(this._vao),this._rctx.drawArrays(s.primitiveType,0,d(this._vao,"geometry"))}get gpuMemoryUsage(){return this._vao?.memoryEstimate??0}setDefaultOptions(t){this._passParameters={...this._passParameters,...t},this._updateMaxOpacity()}updateParameters(s,a){this._passParameters.opacityElevation=1-t(l,g,s.relativeElevation);const o=this._viewingMode===c.Global?i(y,s.center):r(y,0,0,1),m=h(o,a);this._passParameters.dayNightTerminator=t(0,1,e(30*m,0,1))}dispose(){this._vao=s(this._vao),this._techniqueCached=a(this._techniqueCached)}get isVisible(){const{opacityElevation:t,dayNightTerminator:e}=this._passParameters;return this._maxOpacity*t*e>=u}_updateMaxOpacity(){const t=Math.max(this._passParameters.shadowOpacity,this._passParameters.occludedShadowOpacity);this._maxOpacity=t*this._passParameters.shadowColor[3]}}const y=o();export{w as ShadowHighlight};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import has from"../../../../core/has.js";import{clamp as t,lerp as s,acosClamped as e}from"../../../../core/mathUtils.js";import{disposeMaybe as i}from"../../../../core/maybe.js";import{c as a}from"../../../../chunks/mat3f64.js";import{w as r,m as n,a as o,u as c}from"../../../../chunks/mat4.js";import{c as h}from"../../../../chunks/mat4f64.js";import{s as u,i as m,a as _,l,k as d,c as p,g as f,n as x,e as g,j as w}from"../../../../chunks/vec2.js";import{a as M}from"../../../../chunks/vec2f64.js";import{k as b,c as S,o as C,m as T,s as j}from"../../../../chunks/vec3.js";import{c as y}from"../../../../chunks/vec3f64.js";import{s as D,t as v}from"../../../../chunks/vec4.js";import{c as z}from"../../../../chunks/vec4f64.js";import{ViewingMode as E}from"../../../ViewingMode.js";import{CascadeCamera as O}from"./CascadeCamera.js";import{applyTextureResizeModulo as R}from"./textureUtils.js";import{assert as U,logWithBase as F,verify as N,rayRay2D as k}from"./Util.js";import{TextureType as A,ClearBufferBit as L,TextureWrapMode as H,TextureSamplingMode as Q,RenderbufferFormat as V}from"../../../webgl/enums.js";import{FramebufferObject as I}from"../../../webgl/FramebufferObject.js";import{RenderbufferDescriptor as P}from"../../../webgl/RenderbufferDescriptor.js";import{Texture as B}from"../../../webgl/Texture.js";import{TextureDescriptor as G}from"../../../webgl/TextureDescriptor.js";var X;!function(t){t[t.Highlight=0]="Highlight",t[t.Default=1]="Default"}(X||(X={}));class q{constructor(){this.camera=new O,this.lightMat=h()}}class W{constructor(){this.maxNumCascadesHighQuality=4,this.maxNumCascadesLowQuality=4,this.textureSizeModHighQuality=1.3,this.textureSizeModLowQuality=.9,this.splitSchemeLambda=0}}class J{get depthTexture(){return this._fbo?.colorTexture}get textureSize(){return this._textureSize}get numCascades(){return this._numCascades}get cascadeDistances(){return D(this._usedCascadeDistances,this._cascadeDistances[0],this._numCascades>1?this._cascadeDistances[1]:1/0,this._numCascades>2?this._cascadeDistances[2]:1/0,this._numCascades>3?this._cascadeDistances[3]:1/0)}constructor(t,s){this._rctx=t,this._viewingMode=s,this._enabled=!1,this._snapshots=new Array,this._textureSize=0,this._numCascades=1,this.settings=new W,this._projectionView=h(),this._projectionViewInverse=h(),this._modelViewLight=h(),this._cascadeDistances=[0,0,0,0,0],this._usedCascadeDistances=z(),this._cascades=[new q,new q,new q,new q],this._lastOrigin=null,this._maxTextureSize=Math.min(has("esri-mobile")?2048:8192,this._rctx.parameters.maxTextureSize)}dispose(){this.enabled=!1,this.disposeOffscreenBuffers()}disposeOffscreenBuffers(){this._fbo=i(this._fbo),this._discardAllSnapshots()}set maxCascades(s){this.settings.maxNumCascadesHighQuality=t(Math.floor(s),1,4)}get maxCascades(){return this.settings.maxNumCascadesHighQuality}set enabled(t){this._enabled=t,t||this.disposeOffscreenBuffers()}get enabled(){return this._enabled}get ready(){return this._enabled&&null!=this.depthTexture}getSnapshot(t){return this.enabled?this._snapshots[t]:null}get cascades(){for(let t=0;t<this._numCascades;++t)rt[t]=this._cascades[t];return rt.length=this._numCascades,rt}start(t,s,e,i,a){U(this.enabled),this._textureSize=this._computeTextureSize(t,a,i),this._ensureDepthTexture();const{near:r,far:n}=this._clampNearFar(e);this._computeCascadeDistances(n,r,i),this._setupMatrices(t,s);const{viewMatrix:o,projectionMatrix:c}=t;for(let h=0;h<this._numCascades;++h)this._constructCascade(h,c,o,s);this._lastOrigin=null,this.clear()}finish(t){U(this.enabled),this._rctx.bindFramebuffer(t)}getShadowMapMatrices(t){if(!this._lastOrigin||!b(t,this._lastOrigin)){this._lastOrigin=this._lastOrigin||y(),S(this._lastOrigin,t);for(let s=0;s<this._numCascades;++s){r(nt,this._cascades[s].lightMat,t);for(let t=0;t<16;++t)ot[16*s+t]=nt[t]}}return ot}takeCascadeSnapshotTo(t,s){U(this.enabled);const e=this._ensureSnapshot(s);this._bindFbo();const i=this._rctx,a=i.bindTexture(e,B.TEXTURE_UNIT_FOR_UPDATES);i.gl.copyTexSubImage2D(A.TEXTURE_2D,0,t.camera.viewport[0],t.camera.viewport[1],t.camera.viewport[0],t.camera.viewport[1],t.camera.viewport[2],t.camera.viewport[3]),i.bindTexture(a,B.TEXTURE_UNIT_FOR_UPDATES)}clear(){const t=this._rctx;this._bindFbo(),t.setClearColor(1,1,1,1),t.clearSafe(L.COLOR_BUFFER_BIT|L.DEPTH_BUFFER_BIT)}_computeTextureSize(t,s,e){const i=Math.min(window.devicePixelRatio,s)/t.pixelRatio,a=Math.max(t.fullWidth,t.fullHeight)*i,r=e?this.settings.textureSizeModHighQuality:this.settings.textureSizeModLowQuality;return Math.floor(Math.min(this._maxTextureSize,R((1===this.numCascades?1:2)*a*r)))}_ensureDepthTexture(){if(this._fbo?.width===this._textureSize)return;const t=new G(this._textureSize);t.wrapMode=H.CLAMP_TO_EDGE,t.samplingMode=Q.NEAREST,this._fbo?.dispose(),this._fbo=new I(this._rctx,t,new P(V.DEPTH_COMPONENT16,this._textureSize))}_ensureSnapshot(t){let s=this._snapshots[t];if(null!=s&&s.descriptor.width===this._textureSize)return s;this._discardSnapshot(t);const e=new G;return e.wrapMode=H.CLAMP_TO_EDGE,e.samplingMode=Q.NEAREST,e.width=this._textureSize,e.height=this._textureSize,s=new B(this._rctx,e),this._snapshots[t]=s,s}_discardSnapshot(t){this._snapshots[t]=i(this._snapshots[t])}_discardAllSnapshots(){for(let t=0;t<this._snapshots.length;++t)this._discardSnapshot(t);this._snapshots.length=0}_bindFbo(){const t=this._rctx;t.unbindTexture(this.depthTexture),t.bindFramebuffer(this._fbo)}_constructCascade(t,s,e,i){const a=this._cascades[t],o=-this._cascadeDistances[t],c=-this._cascadeDistances[t+1],h=(s[10]*o+s[14])/Math.abs(s[11]*o+s[15]),u=(s[10]*c+s[14])/Math.abs(s[11]*c+s[15]);U(h<u);for(let r=0;r<8;++r){D(Y,r%4==0||r%4==3?-1:1,r%4==0||r%4==1?-1:1,r<4?h:u,1);const t=Z[r];v(t,Y,this._projectionViewInverse),t[0]/=t[3],t[1]/=t[3],t[2]/=t[3]}C(at,Z[0]),a.camera.viewMatrix=r(K,this._modelViewLight,at);for(let r=0;r<8;++r)T(Z[r],Z[r],a.camera.viewMatrix);let m=Z[0][2],_=Z[0][2];for(let r=1;r<8;++r)m=Math.min(m,Z[r][2]),_=Math.max(_,Z[r][2]);m-=200,_+=200,a.camera.near=-_,a.camera.far=-m,jt(e,i,m,_,a.camera),n(a.lightMat,a.camera.projectionMatrix,a.camera.viewMatrix);const l=this._textureSize/(1===this.numCascades?1:2);a.camera.viewport=[t%2==0?0:l,0===Math.floor(t/2)?0:l,l,l]}_setupMatrices(t,s){n(this._projectionView,t.projectionMatrix,t.viewMatrix),o(this._projectionViewInverse,this._projectionView);const e=this._viewingMode===E.Global?t.eye:j(at,0,0,1);c(this._modelViewLight,[0,0,0],[-s[0],-s[1],-s[2]],e)}_clampNearFar(t){let{near:s,far:e}=t;return s<2&&(s=2),e<2&&(e=2),s>=e&&(s=2,e=4),{near:s,far:e}}_computeCascadeDistances(t,e,i){const a=i?this.settings.maxNumCascadesHighQuality:this.settings.maxNumCascadesLowQuality;this._numCascades=Math.min(1+Math.floor(F(t/e,4)),a);const r=(t-e)/this._numCascades,n=(t/e)**(1/this._numCascades);let o=e,c=e;for(let h=0;h<this._numCascades+1;++h)this._cascadeDistances[h]=s(o,c,this.settings.splitSchemeLambda),o*=n,c+=r}get gpuMemoryUsage(){return this._snapshots.reduce(((t,s)=>t+(s?.gpuMemoryUsage??0)),this._fbo?.gpuMemoryUsage??0)}get test(){return{cascades:this._cascades,textureSize:this._textureSize}}}const K=h(),Y=z(),Z=[];for(let yt=0;yt<8;++yt)Z.push(z());const $=M(),tt=M(),st=M(),et=M(),it=M(),at=y(),rt=[],nt=h(),ot=new Array(64),ct=M(),ht=M(),ut=[M(),M(),M(),M()],mt=M(),_t=M(),lt=M(),dt=M(),pt=M(),ft=M(),xt=M();function gt(t,s,e,i,a,r,n,o){u(ct,0,0);for(let u=0;u<4;++u)m(ct,ct,t[u]);_(ct,ct,.25),u(ht,0,0);for(let u=4;u<8;++u)m(ht,ht,t[u]);_(ht,ht,.25),l(ut[0],t[4],t[5],.5),l(ut[1],t[5],t[6],.5),l(ut[2],t[6],t[7],.5),l(ut[3],t[7],t[4],.5);let c=0,h=d(ut[0],ct);for(let u=1;u<4;++u){const t=d(ut[u],ct);t<h&&(h=t,c=u)}p(mt,ut[c],t[c+4]);const M=mt[0];let b,S;mt[0]=-mt[1],mt[1]=M,p(_t,ht,ct),f(_t,mt)<0&&x(mt,mt),l(mt,mt,_t,e),g(mt,mt),b=S=f(p(lt,t[0],ct),mt);for(let u=1;u<8;++u){const s=f(p(lt,t[u],ct),mt);s<b?b=s:s>S&&(S=s)}w(i,ct),_(lt,mt,b-s),m(i,i,lt);let C=-1,T=1,j=0,y=0;for(let u=0;u<8;++u){p(dt,t[u],i),g(dt,dt);const s=mt[0]*dt[1]-mt[1]*dt[0];s>0?s>C&&(C=s,j=u):s<T&&(T=s,y=u)}N(C>0,"leftArea"),N(T<0,"rightArea"),_(pt,mt,b),m(pt,pt,ct),_(ft,mt,S),m(ft,ft,ct),xt[0]=-mt[1],xt[1]=mt[0];const D=k(i,t[y],ft,m(lt,ft,xt),1,a),v=k(i,t[j],ft,lt,1,r),z=k(i,t[j],pt,m(lt,pt,xt),1,n),E=k(i,t[y],pt,lt,1,o);N(D,"rayRay"),N(v,"rayRay"),N(z,"rayRay"),N(E,"rayRay")}function wt(t,s){return 3*s+t}const Mt=M();function bt(t,s){return u(Mt,t[s],t[s+3]),Mt}const St=M(),Ct=a();function Tt(t,s,e,i,a){p(St,e,i),_(St,St,.5),Ct[0]=St[0],Ct[1]=St[1],Ct[2]=0,Ct[3]=St[1],Ct[4]=-St[0],Ct[5]=0,Ct[6]=St[0]*St[0]+St[1]*St[1],Ct[7]=St[0]*St[1]-St[1]*St[0],Ct[8]=1,Ct[wt(0,2)]=-f(bt(Ct,0),t),Ct[wt(1,2)]=-f(bt(Ct,1),t);let r=f(bt(Ct,0),e)+Ct[wt(0,2)],n=f(bt(Ct,1),e)+Ct[wt(1,2)],o=f(bt(Ct,0),i)+Ct[wt(0,2)],c=f(bt(Ct,1),i)+Ct[wt(1,2)];r=-(r+o)/(n+c),Ct[wt(0,0)]+=Ct[wt(1,0)]*r,Ct[wt(0,1)]+=Ct[wt(1,1)]*r,Ct[wt(0,2)]+=Ct[wt(1,2)]*r,r=1/(f(bt(Ct,0),e)+Ct[wt(0,2)]),n=1/(f(bt(Ct,1),e)+Ct[wt(1,2)]),Ct[wt(0,0)]*=r,Ct[wt(0,1)]*=r,Ct[wt(0,2)]*=r,Ct[wt(1,0)]*=n,Ct[wt(1,1)]*=n,Ct[wt(1,2)]*=n,Ct[wt(2,0)]=Ct[wt(1,0)],Ct[wt(2,1)]=Ct[wt(1,1)],Ct[wt(2,2)]=Ct[wt(1,2)],Ct[wt(1,2)]+=1,r=f(bt(Ct,1),s)+Ct[wt(1,2)],n=f(bt(Ct,2),s)+Ct[wt(2,2)],o=f(bt(Ct,1),e)+Ct[wt(1,2)],c=f(bt(Ct,2),e)+Ct[wt(2,2)],r=-.5*(r/n+o/c),Ct[wt(1,0)]+=Ct[wt(2,0)]*r,Ct[wt(1,1)]+=Ct[wt(2,1)]*r,Ct[wt(1,2)]+=Ct[wt(2,2)]*r,r=f(bt(Ct,1),s)+Ct[wt(1,2)],n=f(bt(Ct,2),s)+Ct[wt(2,2)],o=-n/r,Ct[wt(1,0)]*=o,Ct[wt(1,1)]*=o,Ct[wt(1,2)]*=o,a[0]=Ct[0],a[1]=Ct[1],a[2]=0,a[3]=Ct[2],a[4]=Ct[3],a[5]=Ct[4],a[6]=0,a[7]=Ct[5],a[8]=0,a[9]=0,a[10]=1,a[11]=0,a[12]=Ct[6],a[13]=Ct[7],a[14]=0,a[15]=Ct[8]}function jt(t,s,i,a,r){const n=1/Z[0][3],o=1/Z[4][3];U(n<o);let c=n+Math.sqrt(n*o);const h=Math.sin(e(t[2]*s[0]+t[6]*s[1]+t[10]*s[2]));c/=h,gt(Z,c,h,$,tt,st,et,it),Tt($,tt,et,it,r.projectionMatrix),r.projectionMatrix[10]=2/(i-a),r.projectionMatrix[14]=-(i+a)/(i-a)}export{J as ShadowMap,X as SnapshotSlot};
5
+ import has from"../../../../core/has.js";import{clamp as t,lerp as s,acosClamped as e}from"../../../../core/mathUtils.js";import{disposeMaybe as i}from"../../../../core/maybe.js";import{c as a}from"../../../../chunks/mat3f64.js";import{w as r,m as n,a as o,u as c}from"../../../../chunks/mat4.js";import{c as h}from"../../../../chunks/mat4f64.js";import{s as u,i as m,a as _,l,k as d,c as p,g as f,n as x,e as g,j as w}from"../../../../chunks/vec2.js";import{a as M}from"../../../../chunks/vec2f64.js";import{k as b,c as S,o as C,m as T,s as j}from"../../../../chunks/vec3.js";import{c as y}from"../../../../chunks/vec3f64.js";import{s as D,t as v}from"../../../../chunks/vec4.js";import{c as z}from"../../../../chunks/vec4f64.js";import{ViewingMode as E}from"../../../ViewingMode.js";import{CascadeCamera as O}from"./CascadeCamera.js";import{applyTextureResizeModulo as R}from"./textureUtils.js";import{assert as U,logWithBase as F,verify as N,rayRay2D as k}from"./Util.js";import{TextureType as A,ClearBufferBit as L,TextureWrapMode as H,TextureSamplingMode as Q,RenderbufferFormat as V}from"../../../webgl/enums.js";import{FramebufferObject as I}from"../../../webgl/FramebufferObject.js";import{RenderbufferDescriptor as P}from"../../../webgl/RenderbufferDescriptor.js";import{Texture as B}from"../../../webgl/Texture.js";import{TextureDescriptor as G}from"../../../webgl/TextureDescriptor.js";var X;!function(t){t[t.Highlight=0]="Highlight",t[t.Default=1]="Default"}(X||(X={}));class q{constructor(){this.camera=new O,this.lightMat=h()}}class W{constructor(){this.maxNumCascadesHighQuality=4,this.maxNumCascadesLowQuality=4,this.textureSizeModHighQuality=1.3,this.textureSizeModLowQuality=.9,this.splitSchemeLambda=0}}class J{get depthTexture(){return this._fbo?.colorTexture}get textureSize(){return this._textureSize}get numCascades(){return this._numCascades}get cascadeDistances(){return D(this._usedCascadeDistances,this._cascadeDistances[0],this._numCascades>1?this._cascadeDistances[1]:1/0,this._numCascades>2?this._cascadeDistances[2]:1/0,this._numCascades>3?this._cascadeDistances[3]:1/0)}constructor(t,s){this._rctx=t,this._viewingMode=s,this._enabled=!1,this._snapshots=new Array,this._textureSize=0,this._numCascades=1,this.settings=new W,this._projectionView=h(),this._projectionViewInverse=h(),this._modelViewLight=h(),this._cascadeDistances=[0,0,0,0,0],this._usedCascadeDistances=z(),this._cascades=[new q,new q,new q,new q],this._lastOrigin=null,this._maxTextureSize=Math.min(has("esri-mobile")?2048:8192,this._rctx.parameters.maxTextureSize)}dispose(){this.enabled=!1,this.disposeOffscreenBuffers()}disposeOffscreenBuffers(){this._fbo=i(this._fbo),this._discardAllSnapshots()}set maxCascades(s){this.settings.maxNumCascadesHighQuality=t(Math.floor(s),1,4)}get maxCascades(){return this.settings.maxNumCascadesHighQuality}set enabled(t){this._enabled=t,t||this.disposeOffscreenBuffers()}get enabled(){return this._enabled}get ready(){return this._enabled&&null!=this.depthTexture}getSnapshot(t){return this.enabled?this._snapshots[t]:null}get cascades(){for(let t=0;t<this._numCascades;++t)rt[t]=this._cascades[t];return rt.length=this._numCascades,rt}start(t,s,e,i,a){U(this.enabled),this._textureSize=this._computeTextureSize(t,a,i),this._ensureDepthTexture();const{near:r,far:n}=this._clampNearFar(e);this._computeCascadeDistances(n,r,i),this._setupMatrices(t,s);const{viewMatrix:o,projectionMatrix:c}=t;for(let h=0;h<this._numCascades;++h)this._constructCascade(h,c,o,s);this._lastOrigin=null,this.clear()}finish(t){U(this.enabled),this._rctx.bindFramebuffer(t)}getShadowMapMatrices(t,s){if(!this._lastOrigin||!b(t,this._lastOrigin)){this._lastOrigin=this._lastOrigin||y(),S(this._lastOrigin,t);for(let e=0;e<this._numCascades;++e){r(nt,this._cascades[e].lightMat,t),null!=s&&n(nt,nt,s);for(let t=0;t<16;++t)ot[16*e+t]=nt[t]}}return ot}takeCascadeSnapshotTo(t,s){U(this.enabled);const e=this._ensureSnapshot(s);this._bindFbo();const i=this._rctx,a=i.bindTexture(e,B.TEXTURE_UNIT_FOR_UPDATES);i.gl.copyTexSubImage2D(A.TEXTURE_2D,0,t.camera.viewport[0],t.camera.viewport[1],t.camera.viewport[0],t.camera.viewport[1],t.camera.viewport[2],t.camera.viewport[3]),i.bindTexture(a,B.TEXTURE_UNIT_FOR_UPDATES)}clear(){const t=this._rctx;this._bindFbo(),t.setClearColor(1,1,1,1),t.clearSafe(L.COLOR_BUFFER_BIT|L.DEPTH_BUFFER_BIT)}_computeTextureSize(t,s,e){const i=Math.min(window.devicePixelRatio,s)/t.pixelRatio,a=Math.max(t.fullWidth,t.fullHeight)*i,r=e?this.settings.textureSizeModHighQuality:this.settings.textureSizeModLowQuality;return Math.floor(Math.min(this._maxTextureSize,R((1===this.numCascades?1:2)*a*r)))}_ensureDepthTexture(){if(this._fbo?.width===this._textureSize)return;const t=new G(this._textureSize);t.wrapMode=H.CLAMP_TO_EDGE,t.samplingMode=Q.NEAREST,this._fbo?.dispose(),this._fbo=new I(this._rctx,t,new P(V.DEPTH_COMPONENT16,this._textureSize))}_ensureSnapshot(t){let s=this._snapshots[t];if(null!=s&&s.descriptor.width===this._textureSize)return s;this._discardSnapshot(t);const e=new G;return e.wrapMode=H.CLAMP_TO_EDGE,e.samplingMode=Q.NEAREST,e.width=this._textureSize,e.height=this._textureSize,s=new B(this._rctx,e),this._snapshots[t]=s,s}_discardSnapshot(t){this._snapshots[t]=i(this._snapshots[t])}_discardAllSnapshots(){for(let t=0;t<this._snapshots.length;++t)this._discardSnapshot(t);this._snapshots.length=0}_bindFbo(){const t=this._rctx;t.unbindTexture(this.depthTexture),t.bindFramebuffer(this._fbo)}_constructCascade(t,s,e,i){const a=this._cascades[t],o=-this._cascadeDistances[t],c=-this._cascadeDistances[t+1],h=(s[10]*o+s[14])/Math.abs(s[11]*o+s[15]),u=(s[10]*c+s[14])/Math.abs(s[11]*c+s[15]);U(h<u);for(let r=0;r<8;++r){D(Y,r%4==0||r%4==3?-1:1,r%4==0||r%4==1?-1:1,r<4?h:u,1);const t=Z[r];v(t,Y,this._projectionViewInverse),t[0]/=t[3],t[1]/=t[3],t[2]/=t[3]}C(at,Z[0]),a.camera.viewMatrix=r(K,this._modelViewLight,at);for(let r=0;r<8;++r)T(Z[r],Z[r],a.camera.viewMatrix);let m=Z[0][2],_=Z[0][2];for(let r=1;r<8;++r)m=Math.min(m,Z[r][2]),_=Math.max(_,Z[r][2]);m-=200,_+=200,a.camera.near=-_,a.camera.far=-m,jt(e,i,m,_,a.camera),n(a.lightMat,a.camera.projectionMatrix,a.camera.viewMatrix);const l=this._textureSize/(1===this.numCascades?1:2);a.camera.viewport=[t%2==0?0:l,0===Math.floor(t/2)?0:l,l,l]}_setupMatrices(t,s){n(this._projectionView,t.projectionMatrix,t.viewMatrix),o(this._projectionViewInverse,this._projectionView);const e=this._viewingMode===E.Global?t.eye:j(at,0,0,1);c(this._modelViewLight,[0,0,0],[-s[0],-s[1],-s[2]],e)}_clampNearFar(t){let{near:s,far:e}=t;return s<2&&(s=2),e<2&&(e=2),s>=e&&(s=2,e=4),{near:s,far:e}}_computeCascadeDistances(t,e,i){const a=i?this.settings.maxNumCascadesHighQuality:this.settings.maxNumCascadesLowQuality;this._numCascades=Math.min(1+Math.floor(F(t/e,4)),a);const r=(t-e)/this._numCascades,n=(t/e)**(1/this._numCascades);let o=e,c=e;for(let h=0;h<this._numCascades+1;++h)this._cascadeDistances[h]=s(o,c,this.settings.splitSchemeLambda),o*=n,c+=r}get gpuMemoryUsage(){return this._snapshots.reduce(((t,s)=>t+(s?.gpuMemoryUsage??0)),this._fbo?.gpuMemoryUsage??0)}get test(){return{cascades:this._cascades,textureSize:this._textureSize}}}const K=h(),Y=z(),Z=[];for(let yt=0;yt<8;++yt)Z.push(z());const $=M(),tt=M(),st=M(),et=M(),it=M(),at=y(),rt=[],nt=h(),ot=new Array(64),ct=M(),ht=M(),ut=[M(),M(),M(),M()],mt=M(),_t=M(),lt=M(),dt=M(),pt=M(),ft=M(),xt=M();function gt(t,s,e,i,a,r,n,o){u(ct,0,0);for(let u=0;u<4;++u)m(ct,ct,t[u]);_(ct,ct,.25),u(ht,0,0);for(let u=4;u<8;++u)m(ht,ht,t[u]);_(ht,ht,.25),l(ut[0],t[4],t[5],.5),l(ut[1],t[5],t[6],.5),l(ut[2],t[6],t[7],.5),l(ut[3],t[7],t[4],.5);let c=0,h=d(ut[0],ct);for(let u=1;u<4;++u){const t=d(ut[u],ct);t<h&&(h=t,c=u)}p(mt,ut[c],t[c+4]);const M=mt[0];let b,S;mt[0]=-mt[1],mt[1]=M,p(_t,ht,ct),f(_t,mt)<0&&x(mt,mt),l(mt,mt,_t,e),g(mt,mt),b=S=f(p(lt,t[0],ct),mt);for(let u=1;u<8;++u){const s=f(p(lt,t[u],ct),mt);s<b?b=s:s>S&&(S=s)}w(i,ct),_(lt,mt,b-s),m(i,i,lt);let C=-1,T=1,j=0,y=0;for(let u=0;u<8;++u){p(dt,t[u],i),g(dt,dt);const s=mt[0]*dt[1]-mt[1]*dt[0];s>0?s>C&&(C=s,j=u):s<T&&(T=s,y=u)}N(C>0,"leftArea"),N(T<0,"rightArea"),_(pt,mt,b),m(pt,pt,ct),_(ft,mt,S),m(ft,ft,ct),xt[0]=-mt[1],xt[1]=mt[0];const D=k(i,t[y],ft,m(lt,ft,xt),1,a),v=k(i,t[j],ft,lt,1,r),z=k(i,t[j],pt,m(lt,pt,xt),1,n),E=k(i,t[y],pt,lt,1,o);N(D,"rayRay"),N(v,"rayRay"),N(z,"rayRay"),N(E,"rayRay")}function wt(t,s){return 3*s+t}const Mt=M();function bt(t,s){return u(Mt,t[s],t[s+3]),Mt}const St=M(),Ct=a();function Tt(t,s,e,i,a){p(St,e,i),_(St,St,.5),Ct[0]=St[0],Ct[1]=St[1],Ct[2]=0,Ct[3]=St[1],Ct[4]=-St[0],Ct[5]=0,Ct[6]=St[0]*St[0]+St[1]*St[1],Ct[7]=St[0]*St[1]-St[1]*St[0],Ct[8]=1,Ct[wt(0,2)]=-f(bt(Ct,0),t),Ct[wt(1,2)]=-f(bt(Ct,1),t);let r=f(bt(Ct,0),e)+Ct[wt(0,2)],n=f(bt(Ct,1),e)+Ct[wt(1,2)],o=f(bt(Ct,0),i)+Ct[wt(0,2)],c=f(bt(Ct,1),i)+Ct[wt(1,2)];r=-(r+o)/(n+c),Ct[wt(0,0)]+=Ct[wt(1,0)]*r,Ct[wt(0,1)]+=Ct[wt(1,1)]*r,Ct[wt(0,2)]+=Ct[wt(1,2)]*r,r=1/(f(bt(Ct,0),e)+Ct[wt(0,2)]),n=1/(f(bt(Ct,1),e)+Ct[wt(1,2)]),Ct[wt(0,0)]*=r,Ct[wt(0,1)]*=r,Ct[wt(0,2)]*=r,Ct[wt(1,0)]*=n,Ct[wt(1,1)]*=n,Ct[wt(1,2)]*=n,Ct[wt(2,0)]=Ct[wt(1,0)],Ct[wt(2,1)]=Ct[wt(1,1)],Ct[wt(2,2)]=Ct[wt(1,2)],Ct[wt(1,2)]+=1,r=f(bt(Ct,1),s)+Ct[wt(1,2)],n=f(bt(Ct,2),s)+Ct[wt(2,2)],o=f(bt(Ct,1),e)+Ct[wt(1,2)],c=f(bt(Ct,2),e)+Ct[wt(2,2)],r=-.5*(r/n+o/c),Ct[wt(1,0)]+=Ct[wt(2,0)]*r,Ct[wt(1,1)]+=Ct[wt(2,1)]*r,Ct[wt(1,2)]+=Ct[wt(2,2)]*r,r=f(bt(Ct,1),s)+Ct[wt(1,2)],n=f(bt(Ct,2),s)+Ct[wt(2,2)],o=-n/r,Ct[wt(1,0)]*=o,Ct[wt(1,1)]*=o,Ct[wt(1,2)]*=o,a[0]=Ct[0],a[1]=Ct[1],a[2]=0,a[3]=Ct[2],a[4]=Ct[3],a[5]=Ct[4],a[6]=0,a[7]=Ct[5],a[8]=0,a[9]=0,a[10]=1,a[11]=0,a[12]=Ct[6],a[13]=Ct[7],a[14]=0,a[15]=Ct[8]}function jt(t,s,i,a,r){const n=1/Z[0][3],o=1/Z[4][3];U(n<o);let c=n+Math.sqrt(n*o);const h=Math.sin(e(t[2]*s[0]+t[6]*s[1]+t[10]*s[2]));c/=h,gt(Z,c,h,$,tt,st,et,it),Tt($,tt,et,it,r.projectionMatrix),r.projectionMatrix[10]=2/(i-a),r.projectionMatrix[14]=-(i+a)/(i-a)}export{J as ShadowMap,X as SnapshotSlot};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import{f as o}from"../../../../chunks/vec3f64.js";import{ViewingMode as t}from"../../../ViewingMode.js";import{ShaderOutput as r}from"../core/shaderLibrary/ShaderOutput.js";import{PathVertexPositionPassParameters as i}from"../core/shaderLibrary/attributes/PathVertexPosition.glsl.js";import{NormalsDoubleSidedMode as s}from"../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as n}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{ReloadableShaderModule as a}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as l}from"../core/shaderTechnique/ShaderTechnique.js";import{parameter as p}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{blendingDefault as c,oitBlending as u,oitDepthTest as d,OITPolygonOffset as h}from"../lib/OrderIndependentTransparency.js";import{Program as m}from"../lib/Program.js";import{stencilWriteMaskOn as v,stencilBaseAllZerosParams as y}from"../lib/StencilUtils.js";import{TransparencyPassType as f}from"../lib/TransparencyPassType.js";import{VertexAttribute as b}from"../lib/VertexAttribute.js";import{DefaultTechniqueConfiguration as O}from"./DefaultTechniqueConfiguration.js";import{P}from"../../../../chunks/Path.glsl.js";import{makePipelineState as g,frontFaceCullingParams as T,defaultDepthWriteParams as j,defaultColorWriteParams as S}from"../../../webgl/renderState.js";const R=new Map([[b.POSITION,0],[b.PROFILERIGHT,1],[b.PROFILEUP,2],[b.PROFILEVERTEXANDNORMAL,3],[b.FEATUREVALUE,4]]);class N extends i{constructor(){super(...arguments),this.ambient=o(.2,.2,.2),this.diffuse=o(.8,.8,.8),this.specular=o(0,0,0),this.opacity=1}}class C extends l{initializeConfiguration(e,o){o.spherical=e.viewingMode===t.Global,o.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result}initializeProgram(e){return new m(e.rctx,C.shader.get().build(this.configuration),R)}initializePipeline(){const e=this.configuration.transparencyPassType,o=this.configuration,t=e===f.NONE,i=e===f.FrontFace;return g({blending:o.output!==r.Color&&o.output!==r.Alpha||!o.transparent?null:t?c:u(e),culling:o.hasSlicePlane&&!o.transparent&&o.doubleSidedMode!==s.None?T:null,depthTest:{func:d(e)},depthWrite:t||i?j:null,colorWrite:S,stencilWrite:o.hasOccludees?v:null,stencilTest:o.hasOccludees?y:null,polygonOffset:t||i?null:h})}}C.shader=new a(P,(()=>import("../shaders/Path.glsl.js")));class E extends O{constructor(){super(...arguments),this.output=r.Color,this.doubleSidedMode=s.None,this.transparencyPassType=f.NONE,this.spherical=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.vvSize=!1,this.vvColor=!1,this.vvOpacity=!1,this.hasSlicePlane=!1,this.transparent=!1,this.hasOccludees=!1,this.hasMultipassTerrain=!1,this.cullAboveGround=!1,this.doublePrecisionRequiresObfuscation=!1}}e([p({count:r.COUNT})],E.prototype,"output",void 0),e([p({count:s.COUNT})],E.prototype,"doubleSidedMode",void 0),e([p({count:f.COUNT})],E.prototype,"transparencyPassType",void 0),e([p()],E.prototype,"spherical",void 0),e([p()],E.prototype,"receiveShadows",void 0),e([p()],E.prototype,"receiveAmbientOcclusion",void 0),e([p()],E.prototype,"vvSize",void 0),e([p()],E.prototype,"vvColor",void 0),e([p()],E.prototype,"vvOpacity",void 0),e([p()],E.prototype,"hasSlicePlane",void 0),e([p()],E.prototype,"transparent",void 0),e([p()],E.prototype,"hasOccludees",void 0),e([p()],E.prototype,"hasMultipassTerrain",void 0),e([p()],E.prototype,"cullAboveGround",void 0),e([p()],E.prototype,"doublePrecisionRequiresObfuscation",void 0),e([p({constValue:n.Disabled})],E.prototype,"pbrMode",void 0),e([p({constValue:!0})],E.prototype,"hasVvInstancing",void 0),e([p({constValue:!1})],E.prototype,"useCustomDTRExponentForWater",void 0),e([p({constValue:!1})],E.prototype,"useFillLights",void 0);export{N as PathPassParameters,C as PathTechnique,E as PathTechniqueConfiguration,R as vertexAttributeLocations};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import{f as o,c as t}from"../../../../chunks/vec3f64.js";import{ViewingMode as i}from"../../../ViewingMode.js";import{ShaderOutput as r}from"../core/shaderLibrary/ShaderOutput.js";import{PathVertexPositionPassParameters as s}from"../core/shaderLibrary/attributes/PathVertexPosition.glsl.js";import{NormalsDoubleSidedMode as n}from"../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as a}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{ReloadableShaderModule as l}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as p}from"../core/shaderTechnique/ShaderTechnique.js";import{parameter as c}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{blendingDefault as u,oitBlending as d,oitDepthTest as h,OITPolygonOffset as m}from"../lib/OrderIndependentTransparency.js";import{Program as v}from"../lib/Program.js";import{stencilWriteMaskOn as y,stencilBaseAllZerosParams as f}from"../lib/StencilUtils.js";import{TransparencyPassType as b}from"../lib/TransparencyPassType.js";import{VertexAttribute as g}from"../lib/VertexAttribute.js";import{DefaultTechniqueConfiguration as O}from"./DefaultTechniqueConfiguration.js";import{P}from"../../../../chunks/Path.glsl.js";import{makePipelineState as T,frontFaceCullingParams as j,defaultDepthWriteParams as S,defaultColorWriteParams as R}from"../../../webgl/renderState.js";const N=new Map([[g.POSITION,0],[g.PROFILERIGHT,1],[g.PROFILEUP,2],[g.PROFILEVERTEXANDNORMAL,3],[g.FEATUREVALUE,4]]);class C extends s{constructor(){super(...arguments),this.ambient=o(.2,.2,.2),this.diffuse=o(.8,.8,.8),this.specular=o(0,0,0),this.opacity=1,this.origin=t(),this.modelTransformation=null}}class E extends p{initializeConfiguration(e,o){o.spherical=e.viewingMode===i.Global,o.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result}initializeProgram(e){return new v(e.rctx,E.shader.get().build(this.configuration),N)}initializePipeline(){const e=this.configuration.transparencyPassType,o=this.configuration,t=e===b.NONE,i=e===b.FrontFace;return T({blending:o.output!==r.Color&&o.output!==r.Alpha||!o.transparent?null:t?u:d(e),culling:o.hasSlicePlane&&!o.transparent&&o.doubleSidedMode!==n.None?j:null,depthTest:{func:h(e)},depthWrite:t||i?S:null,colorWrite:R,stencilWrite:o.hasOccludees?y:null,stencilTest:o.hasOccludees?f:null,polygonOffset:t||i?null:m})}}E.shader=new l(P,(()=>import("../shaders/Path.glsl.js")));class M extends O{constructor(){super(...arguments),this.output=r.Color,this.doubleSidedMode=n.None,this.transparencyPassType=b.NONE,this.spherical=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.vvSize=!1,this.vvColor=!1,this.vvOpacity=!1,this.hasSlicePlane=!1,this.transparent=!1,this.hasOccludees=!1,this.hasMultipassTerrain=!1,this.cullAboveGround=!1,this.doublePrecisionRequiresObfuscation=!1}}e([c({count:r.COUNT})],M.prototype,"output",void 0),e([c({count:n.COUNT})],M.prototype,"doubleSidedMode",void 0),e([c({count:b.COUNT})],M.prototype,"transparencyPassType",void 0),e([c()],M.prototype,"spherical",void 0),e([c()],M.prototype,"receiveShadows",void 0),e([c()],M.prototype,"receiveAmbientOcclusion",void 0),e([c()],M.prototype,"vvSize",void 0),e([c()],M.prototype,"vvColor",void 0),e([c()],M.prototype,"vvOpacity",void 0),e([c()],M.prototype,"hasSlicePlane",void 0),e([c()],M.prototype,"transparent",void 0),e([c()],M.prototype,"hasOccludees",void 0),e([c()],M.prototype,"hasMultipassTerrain",void 0),e([c()],M.prototype,"cullAboveGround",void 0),e([c()],M.prototype,"doublePrecisionRequiresObfuscation",void 0),e([c({constValue:a.Disabled})],M.prototype,"pbrMode",void 0),e([c({constValue:!0})],M.prototype,"hasVvInstancing",void 0),e([c({constValue:!1})],M.prototype,"useCustomDTRExponentForWater",void 0),e([c({constValue:!1})],M.prototype,"useFillLights",void 0);export{C as PathPassParameters,E as PathTechnique,M as PathTechniqueConfiguration,N as vertexAttributeLocations};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import has from"../../../../core/has.js";import{secondsFromMilliseconds as e}from"../../../../core/time.js";import{f as t}from"../../../../chunks/vec2f64.js";import{f as r}from"../../../../chunks/vec4f64.js";import{ShaderOutput as a}from"../core/shaderLibrary/ShaderOutput.js";import{AnimationTimer as i}from"../lib/AnimationTimer.js";import{MaterialParameters as s}from"../lib/Material.js";import{OITPolygonOffsetLimit as n}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as o}from"../lib/RenderSlot.js";import{DefaultBufferWriter as h}from"./DefaultBufferWriter.js";import{PositionUVLayoutObjectAndLayerId as c,PositionUVLayout as p}from"./DefaultLayouts.js";import{TriangleMaterial as m}from"./TriangleMaterial.js";import{WaterGLMaterial as l}from"./WaterGLMaterial.js";import{WaterTechniqueConfiguration as u}from"./WaterTechnique.js";class f extends m{constructor(e){super(e,new d),this._configuration=new u,this.animation=new i}getConfiguration(e,t){return this._configuration.output=e,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.receiveShadows=this.parameters.receiveShadows,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.parameters.transparent,this._configuration.hasScreenSpaceReflections=this.parameters.hasScreenSpaceReflections,this._configuration.hasCloudsReflections=this.parameters.hasCloudsReflections,this._configuration.isDraped=this.parameters.isDraped,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.enableOffset=t.camera.relativeElevation<n,this._configuration.hasMultipassTerrain=t.multipassTerrain.enabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration}update(t){const r=Math.min(t.camera.relativeElevation,t.camera.distance);this.animation.enabled=Math.sqrt(this.parameters.waveTextureRepeat/this.parameters.waveStrength)*r<A;const a=this.animation.advance(t);return this.setParameters({timeElapsed:e(this.animation.time)*this.parameters.animationSpeed},!1),this.animation.enabled&&a}requiresSlot(e,t){switch(t){case a.Normal:return e===o.DRAPED_WATER;case a.Color:if(this.parameters.isDraped)return e===o.DRAPED_MATERIAL;break;case a.Alpha:break;case a.Highlight:case a.ObjectAndLayerIdColor:return e===o.OPAQUE_MATERIAL||e===o.DRAPED_MATERIAL;default:return!1}let r=o.OPAQUE_MATERIAL;return this.parameters.transparent&&(r=this.parameters.writeDepth?o.TRANSPARENT_MATERIAL:o.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),e===r}createGLMaterial(e){return new l(e)}createBufferWriter(){return new h(has("enable-feature:objectAndLayerId-rendering")?c:p)}}class d extends s{constructor(){super(...arguments),this.waveStrength=.06,this.waveTextureRepeat=32,this.waveDirection=t(1,0),this.waveVelocity=.05,this.flowStrength=.015,this.flowOffset=-.5,this.animationSpeed=.35,this.timeElapsed=0,this.color=r(0,0,0,0),this.transparent=!0,this.writeDepth=!0,this.hasSlicePlane=!1,this.isDraped=!1,this.receiveShadows=!0,this.hasScreenSpaceReflections=!1,this.hasCloudsReflections=!1}}const A=35e3;export{f as WaterMaterial,d as WaterMaterialParameters};
5
+ import has from"../../../../core/has.js";import{secondsFromMilliseconds as e}from"../../../../core/time.js";import{f as t}from"../../../../chunks/vec2f64.js";import{c as r}from"../../../../chunks/vec3f64.js";import{f as a}from"../../../../chunks/vec4f64.js";import{ShaderOutput as i}from"../core/shaderLibrary/ShaderOutput.js";import{AnimationTimer as s}from"../lib/AnimationTimer.js";import{MaterialParameters as n}from"../lib/Material.js";import{OITPolygonOffsetLimit as o}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as h}from"../lib/RenderSlot.js";import{DefaultBufferWriter as c}from"./DefaultBufferWriter.js";import{PositionUVLayoutObjectAndLayerId as m,PositionUVLayout as p}from"./DefaultLayouts.js";import{TriangleMaterial as l}from"./TriangleMaterial.js";import{WaterGLMaterial as u}from"./WaterGLMaterial.js";import{WaterTechniqueConfiguration as f}from"./WaterTechnique.js";class d extends l{constructor(e){super(e,new A),this._configuration=new f,this.animation=new s}getConfiguration(e,t){return this._configuration.output=e,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.receiveShadows=this.parameters.receiveShadows,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.parameters.transparent,this._configuration.hasScreenSpaceReflections=this.parameters.hasScreenSpaceReflections,this._configuration.hasCloudsReflections=this.parameters.hasCloudsReflections,this._configuration.isDraped=this.parameters.isDraped,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.enableOffset=t.camera.relativeElevation<o,this._configuration.hasMultipassTerrain=t.multipassTerrain.enabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration}update(t){const r=Math.min(t.camera.relativeElevation,t.camera.distance);this.animation.enabled=Math.sqrt(this.parameters.waveTextureRepeat/this.parameters.waveStrength)*r<T;const a=this.animation.advance(t);return this.setParameters({timeElapsed:e(this.animation.time)*this.parameters.animationSpeed},!1),this.animation.enabled&&a}requiresSlot(e,t){switch(t){case i.Normal:return e===h.DRAPED_WATER;case i.Color:if(this.parameters.isDraped)return e===h.DRAPED_MATERIAL;break;case i.Alpha:break;case i.Highlight:case i.ObjectAndLayerIdColor:return e===h.OPAQUE_MATERIAL||e===h.DRAPED_MATERIAL;default:return!1}let r=h.OPAQUE_MATERIAL;return this.parameters.transparent&&(r=this.parameters.writeDepth?h.TRANSPARENT_MATERIAL:h.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),e===r}createGLMaterial(e){return new u(e)}createBufferWriter(){return new c(has("enable-feature:objectAndLayerId-rendering")?m:p)}}class A extends n{constructor(){super(...arguments),this.waveStrength=.06,this.waveTextureRepeat=32,this.waveDirection=t(1,0),this.waveVelocity=.05,this.flowStrength=.015,this.flowOffset=-.5,this.animationSpeed=.35,this.timeElapsed=0,this.color=a(0,0,0,0),this.transparent=!0,this.writeDepth=!0,this.hasSlicePlane=!1,this.isDraped=!1,this.receiveShadows=!0,this.hasScreenSpaceReflections=!1,this.hasCloudsReflections=!1,this.origin=r(),this.modelTransformation=null}}const T=35e3;export{d as WaterMaterial,A as WaterMaterialParameters};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
+ */
5
+ import{k as e}from"../../../../chunks/vec3.js";import{Z as l}from"../../../../chunks/vec3f64.js";function u({normalTexture:u,metallicRoughnessTexture:n,metallicFactor:r,roughnessFactor:s,emissiveTexture:o,emissiveFactor:t,occlusionTexture:c}){return null==u&&null==n&&null==o&&(null==t||e(t,l))&&null==c&&(null==s||1===s)&&(null==r||1===r||0===r)}const n=[1,1,.5],r=[0,.6,.2],s=[0,1,.2];export{n as defaultAdvancedMRRFactors,s as defaultEsriSymbologyMRRFactors,r as defaultSchematicMRRFactors,u as useSchematicPBR};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{ReloadableShaderModule as e}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../core/shaderTechnique/ShaderTechnique.js";import{Default3D as i}from"../lib/DefaultVertexAttributeLocations.js";import{Program as o}from"../lib/Program.js";import{a as t}from"../../../../chunks/AtmosphereCompositing.glsl.js";import{BlendFactor as s,CompareFunction as n}from"../../../webgl/enums.js";import{makePipelineState as m,separateBlendingParams as a,defaultColorWriteParams as l,simpleBlendingParams as h}from"../../../webgl/renderState.js";class p extends r{initializeProgram(e){return new o(e.rctx,p.shader.get().build(this.configuration),i)}initializePipeline(){return this.configuration.haze?m({blending:a(s.ONE,s.ZERO,s.ONE_MINUS_SRC_COLOR,s.ONE),depthTest:{func:n.ALWAYS},colorWrite:l}):m({blending:h(s.ONE,s.ONE_MINUS_SRC_ALPHA),depthTest:{func:n.ALWAYS},colorWrite:l})}}p.shader=new e(t,(()=>import("./AtmosphereCompositing.glsl.js")));export{p as AtmosphereCompositingTechnique};
5
+ import{ReloadableShaderModule as e}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../core/shaderTechnique/ShaderTechnique.js";import{Default3D as i}from"../lib/DefaultVertexAttributeLocations.js";import{Program as o}from"../lib/Program.js";import{a as t}from"../../../../chunks/AtmosphereCompositing.glsl.js";import{BlendFactor as s,CompareFunction as n}from"../../../webgl/enums.js";import{makePipelineState as m,separateBlendingParams as a,defaultColorWriteParams as l,simpleBlendingParams as h}from"../../../webgl/renderState.js";class p extends r{initializeProgram(e){return new o(e.rctx,p.shader.get().build(this.configuration),i)}initializePipeline(){return this.configuration.haze?m({blending:a(s.ONE,s.ZERO,s.ONE_MINUS_SRC_COLOR,s.ONE),depthTest:{func:n.ALWAYS},colorWrite:l}):m({blending:h(s.SRC_ALPHA,s.ONE_MINUS_SRC_ALPHA),depthTest:{func:n.ALWAYS},colorWrite:l})}}p.shader=new e(t,(()=>import("./AtmosphereCompositing.glsl.js")));export{p as AtmosphereCompositingTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{f as e,c as t}from"../../../../chunks/vec3f64.js";import{f as i}from"../../../../chunks/vec4f64.js";import{ViewingMode as r}from"../../../ViewingMode.js";import{ShaderOutput as s}from"../core/shaderLibrary/ShaderOutput.js";import{NormalType as o}from"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{TextureCoordinateAttributeType as a}from"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{VertexNormalPassParameters as l,VertexNormalDrawParameters as n}from"../core/shaderLibrary/attributes/VertexNormal.glsl.js";import{defaultMaskAlphaCutoff as h}from"../core/shaderLibrary/util/AlphaCutoff.js";import{ReloadableShaderModule as c}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as u}from"../core/shaderTechnique/ShaderTechnique.js";import{CullFaceOptions as p,DepthTestFunction as d,AlphaDiscardMode as m}from"../lib/basicInterfaces.js";import{Default3D as f}from"../lib/DefaultVertexAttributeLocations.js";import{RenderOccludedFlag as b}from"../lib/Material.js";import{blendingDefault as g,oitBlending as S,oitDepthTest as T,getOITPolygonOffset as y}from"../lib/OrderIndependentTransparency.js";import{Program as P}from"../lib/Program.js";import{stencilWriteMaskOn as j,stencilToolMaskBaseParams as x,stencilBaseAllZerosParams as v}from"../lib/StencilUtils.js";import{TransparencyPassType as O}from"../lib/TransparencyPassType.js";import{D as A}from"../../../../chunks/DefaultMaterial.glsl.js";import{CompareFunction as C}from"../../../webgl/enums.js";import{makePipelineState as L,cullingParams as M,defaultDepthWriteParams as D,defaultColorWriteParams as w}from"../../../webgl/renderState.js";class F extends l{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=e(0,1,.5),this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=p.Back,this.isInstanced=!1,this.hasInstancedColor=!1,this.emissiveFactor=e(0,0,0),this.instancedDoublePrecision=!1,this.normalType=o.Attribute,this.receiveSSAO=!0,this.receiveShadows=!0,this.castShadows=!0,this.shadowMappingEnabled=!1,this.ambient=e(.2,.2,.2),this.diffuse=e(.8,.8,.8),this.externalColor=i(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=t(),this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.transparent=!1,this.writeDepth=!0,this.customDepthTest=d.Less,this.textureAlphaMode=m.Blend,this.textureAlphaCutoff=h,this.textureAlphaPremultiplied=!1,this.hasOccludees=!1,this.renderOccluded=b.Occlude}}class _ extends n{constructor(){super(...arguments),this.origin=t(),this.slicePlaneLocalOrigin=this.origin}}class k extends u{initializeConfiguration(e,t){t.spherical=e.viewingMode===r.Global,t.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result,t.textureCoordinateType=t.hasColorTexture||t.hasMetallicRoughnessTexture||t.hasEmissionTexture||t.hasOcclusionTexture||t.hasNormalTexture?a.Default:a.None,t.objectAndLayerIdColorInstanced=t.instanced}initializeProgram(e){return this._initializeProgram(e,k.shader)}_initializeProgram(e,t){return new P(e.rctx,t.get().build(this.configuration),f)}_convertDepthTestFunction(e){return e===d.Lequal?C.LEQUAL:C.LESS}_makePipeline(e,t){const i=this.configuration,r=e===O.NONE,o=e===O.FrontFace;return L({blending:i.output!==s.Color&&i.output!==s.Alpha||!i.transparent?null:r?g:S(e),culling:N(i)?M(i.cullFace):null,depthTest:{func:T(e,this._convertDepthTestFunction(i.customDepthTest))},depthWrite:(r||o)&&i.writeDepth?D:null,colorWrite:w,stencilWrite:i.hasOccludees?j:null,stencilTest:i.hasOccludees?t?x:v:null,polygonOffset:r||o?null:y(i.enableOffset)})}initializePipeline(){return this._occludeePipelineState=this._makePipeline(this.configuration.transparencyPassType,!0),this._makePipeline(this.configuration.transparencyPassType,!1)}getPipelineState(e,t){return t?this._occludeePipelineState:super.getPipelineState(e,t)}}function N(e){return e.cullFace!==p.None||!e.hasSlicePlane&&(!e.transparent&&!e.doubleSidedMode)}k.shader=new c(A,(()=>import("./DefaultMaterial.glsl.js")));export{_ as DefaultMaterialDrawParameters,F as DefaultMaterialPassParameters,k as DefaultMaterialTechnique};
5
+ import{g as e,f as t,c as i}from"../../../../chunks/vec3f64.js";import{f as r}from"../../../../chunks/vec4f64.js";import{ViewingMode as s}from"../../../ViewingMode.js";import{ShaderOutput as o}from"../core/shaderLibrary/ShaderOutput.js";import{NormalType as a}from"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{TextureCoordinateAttributeType as l}from"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{VertexNormalPassParameters as n,VertexNormalDrawParameters as h}from"../core/shaderLibrary/attributes/VertexNormal.glsl.js";import{defaultMaskAlphaCutoff as c}from"../core/shaderLibrary/util/AlphaCutoff.js";import{ReloadableShaderModule as u}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as p}from"../core/shaderTechnique/ShaderTechnique.js";import{CullFaceOptions as m,DepthTestFunction as d,AlphaDiscardMode as f}from"../lib/basicInterfaces.js";import{Default3D as b}from"../lib/DefaultVertexAttributeLocations.js";import{RenderOccludedFlag as g}from"../lib/Material.js";import{blendingDefault as S,oitBlending as T,oitDepthTest as y,getOITPolygonOffset as j}from"../lib/OrderIndependentTransparency.js";import{Program as P}from"../lib/Program.js";import{stencilWriteMaskOn as x,stencilToolMaskBaseParams as v,stencilBaseAllZerosParams as O}from"../lib/StencilUtils.js";import{TransparencyPassType as A}from"../lib/TransparencyPassType.js";import{defaultAdvancedMRRFactors as C}from"../materials/pbrUtils.js";import{D as L}from"../../../../chunks/DefaultMaterial.glsl.js";import{CompareFunction as M}from"../../../webgl/enums.js";import{makePipelineState as D,cullingParams as w,defaultDepthWriteParams as F,defaultColorWriteParams as _}from"../../../webgl/renderState.js";class k extends n{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=e(C),this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=m.Back,this.isInstanced=!1,this.hasInstancedColor=!1,this.emissiveFactor=t(0,0,0),this.instancedDoublePrecision=!1,this.normalType=a.Attribute,this.receiveSSAO=!0,this.receiveShadows=!0,this.castShadows=!0,this.shadowMappingEnabled=!1,this.ambient=t(.2,.2,.2),this.diffuse=t(.8,.8,.8),this.externalColor=r(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=i(),this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.transparent=!1,this.writeDepth=!0,this.customDepthTest=d.Less,this.textureAlphaMode=f.Blend,this.textureAlphaCutoff=c,this.textureAlphaPremultiplied=!1,this.hasOccludees=!1,this.renderOccluded=g.Occlude}}class N extends h{constructor(){super(...arguments),this.origin=i(),this.slicePlaneLocalOrigin=this.origin}}class q extends p{initializeConfiguration(e,t){t.spherical=e.viewingMode===s.Global,t.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result,t.textureCoordinateType=t.hasColorTexture||t.hasMetallicRoughnessTexture||t.hasEmissionTexture||t.hasOcclusionTexture||t.hasNormalTexture?l.Default:l.None,t.objectAndLayerIdColorInstanced=t.instanced}initializeProgram(e){return this._initializeProgram(e,q.shader)}_initializeProgram(e,t){return new P(e.rctx,t.get().build(this.configuration),b)}_convertDepthTestFunction(e){return e===d.Lequal?M.LEQUAL:M.LESS}_makePipeline(e,t){const i=this.configuration,r=e===A.NONE,s=e===A.FrontFace;return D({blending:i.output!==o.Color&&i.output!==o.Alpha||!i.transparent?null:r?S:T(e),culling:z(i)?w(i.cullFace):null,depthTest:{func:y(e,this._convertDepthTestFunction(i.customDepthTest))},depthWrite:(r||s)&&i.writeDepth?F:null,colorWrite:_,stencilWrite:i.hasOccludees?x:null,stencilTest:i.hasOccludees?t?v:O:null,polygonOffset:r||s?null:j(i.enableOffset)})}initializePipeline(){return this._occludeePipelineState=this._makePipeline(this.configuration.transparencyPassType,!0),this._makePipeline(this.configuration.transparencyPassType,!1)}getPipelineState(e,t){return t?this._occludeePipelineState:super.getPipelineState(e,t)}}function z(e){return e.cullFace!==m.None||!e.hasSlicePlane&&(!e.transparent&&!e.doubleSidedMode)}q.shader=new u(L,(()=>import("./DefaultMaterial.glsl.js")));export{N as DefaultMaterialDrawParameters,k as DefaultMaterialPassParameters,q as DefaultMaterialTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{f as e}from"../../../../chunks/vec4f64.js";import{NoParameters as r}from"../core/shaderModules/interfaces.js";import{ReloadableShaderModule as t}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as i}from"../core/shaderTechnique/ShaderTechnique.js";import{Default3D as o}from"../lib/DefaultVertexAttributeLocations.js";import{Program as s}from"../lib/Program.js";import{ShadowConfiguration as a}from"./ShadowConfiguration.js";import{S as h}from"../../../../chunks/ShadowHighlight.glsl.js";import{BlendFactor as n,PrimitiveType as l}from"../../../webgl/enums.js";import{makePipelineState as d,separateBlendingParams as m,defaultColorWriteParams as c}from"../../../webgl/renderState.js";class u extends r{constructor(){super(...arguments),this.shadowColor=e(1,0,1,1),this.shadowOpacity=.2,this.occludedShadowOpacity=.1,this.opacityElevation=1,this.dayNightTerminator=1}}class p extends i{constructor(e){super(e,new a,(()=>this.destroy()))}initializeProgram(e){return new s(e.rctx,p.shader.get().build(this.configuration),o)}initializePipeline(){return d({blending:m(n.SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA),colorWrite:c,depthTest:null,depthWrite:null})}get primitiveType(){return l.TRIANGLE_STRIP}}p.shader=new t(h,(()=>import("./ShadowHighlight.glsl.js")));export{u as ShadowHighlightPassParameters,p as ShadowHighlightTechnique};
5
+ import{f as r}from"../../../../chunks/vec4f64.js";import{ReadShadowMapPassParameters as e}from"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{ReloadableShaderModule as i}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as t}from"../core/shaderTechnique/ShaderTechnique.js";import{Default3D as o}from"../lib/DefaultVertexAttributeLocations.js";import{Program as s}from"../lib/Program.js";import{ShadowConfiguration as a}from"./ShadowConfiguration.js";import{S as h}from"../../../../chunks/ShadowHighlight.glsl.js";import{BlendFactor as n,PrimitiveType as l}from"../../../webgl/enums.js";import{makePipelineState as d,separateBlendingParams as m,defaultColorWriteParams as c}from"../../../webgl/renderState.js";class p extends e{constructor(){super(...arguments),this.shadowColor=r(1,0,1,1),this.shadowOpacity=.2,this.occludedShadowOpacity=.1,this.opacityElevation=1,this.dayNightTerminator=1}}class u extends t{constructor(r){super(r,new a,(()=>this.destroy()))}initializeProgram(r){return new s(r.rctx,u.shader.get().build(this.configuration),o)}initializePipeline(){return d({blending:m(n.SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA),colorWrite:c,depthTest:null,depthWrite:null})}get primitiveType(){return l.TRIANGLE_STRIP}}u.shader=new i(h,(()=>import("./ShadowHighlight.glsl.js")));export{p as ShadowHighlightPassParameters,u as ShadowHighlightTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import i from"../../core/Evented.js";import{HandleOwnerMixin as o}from"../../core/HandleOwner.js";import{makeHandle as r}from"../../core/handleUtils.js";import{destroyMaybe as l}from"../../core/maybe.js";import{createLength as n,zeroMeters as a,zeroSquareMeters as s}from"../../core/quantityUtils.js";import{watch as p,syncAndInitial as c}from"../../core/reactiveUtils.js";import{getMetersPerVerticalUnitForSR as h}from"../../core/unitUtils.js";import{property as u}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import y from"../../layers/GraphicsLayer.js";import{getConvertedElevation as m}from"../../support/elevationInfoUtils.js";import{createSquare as g,createRectangle as f,createCircle as v,createEllipse as _,createPolygon as w,createPolyline as O,createMultipoint as T}from"./support/createUtils.js";import{getDrawHelpMessage as G}from"./support/helpMessageUtils.js";import{createViewAlignedCoordinateSystem as x}from"./support/surfaceCoordinateSystems.js";import{InteractiveToolBase as V}from"../interactive/InteractiveToolBase.js";import S from"../interactive/sketch/SketchLabelOptions.js";import b from"../interactive/sketch/SketchTooltipOptions.js";import{DrawPointTooltipInfo as I,DrawPolylineTooltipInfo as j,DrawPolygonTooltipInfo as M,DrawMeshTooltipInfo as U,DrawRectangleTooltipInfo as C,DrawCircleTooltipInfo as z}from"../interactive/tooltip/DrawTooltipInfos.js";import{Tooltip as k}from"../interactive/tooltip/Tooltip.js";import{autoAreaByElevationMode as P}from"../support/automaticAreaMeasurementUtils.js";import{autoLengthByElevationMode as A,autoHorizontalDistanceByElevationModeBetweenPoints as R}from"../support/automaticLengthMeasurementUtils.js";class D{constructor(){this.regularVertices=null,this.activeVertex=null,this.full=null,this.outline=null,this.circle=null,this.rectangle=null}}let E=class extends(o(i.EventedMixin(V))){constructor(e){super(e),this._graphic=null,this._createOperationGeometry=null,this.defaultZ=0,this.geometryType=null,this.hasZ=!0,this.labelOptions=new S,this.geometryToPlace=null,this.mode=null,this.snappingManager=null,this.snapToScene=!1,this.tooltip=null,this.tooltipOptions=new b}initialize(){this.internalGraphicsLayer=new y({listMode:"hide",internal:!0}),this.view.map.layers.add(this.internalGraphicsLayer),this.drawOperation=this.makeDrawOperation(),this.handles.add([this.drawOperation.on("vertex-add",(e=>this.onVertexAdd(e))),this.drawOperation.on("vertex-remove",(e=>this.onVertexRemove(e))),this.drawOperation.on("vertex-update",(e=>this.onVertexUpdate(e))),this.drawOperation.on("cursor-update",(e=>this.onCursorUpdate(e))),this.drawOperation.on("complete",(e=>this.onComplete(e))),p((()=>this.tooltipOptions.enabled),(e=>{this.tooltip=e?new k({view:this.view,info:this._tooltipInfo}):l(this.tooltip)}),c),p((()=>this._tooltipInfo),(e=>{null!=this.tooltip&&(this.tooltip.info=e)}),c)]),this.finishToolCreation()}destroy(){this.drawOperation=l(this.drawOperation),this.tooltip=l(this.tooltip),this._destroyAllVisualisations(),this.view.map.remove(this.internalGraphicsLayer),this.internalGraphicsLayer=l(this.internalGraphicsLayer),this._set("view",null)}get _defaultElevation(){return n(this.defaultZ,"meters")}get canRedo(){return this.drawOperation.canRedo}get canUndo(){return this.drawOperation.canUndo}set centered(e){this._set("centered",e),this._updateGraphic()}set enabled(e){this.drawOperation.interactive=e,this._set("enabled",e)}set forceUniformSize(e){this._set("forceUniformSize",e),this._updateGraphic()}get graphic(){return this._graphic}set graphicSymbol(e){this._set("graphicSymbol",e),null!=this._graphic&&(this._graphic.symbol=e)}get updating(){return this.drawOperation?.updating??!1}completeCreateOperation(){this.drawOperation.complete()}onInputEvent(e){this.drawOperation.onInputEvent(e)}redo(){this.drawOperation.redo()}reset(){}undo(){this.drawOperation.undo()}_destroyAllVisualisations(){this.handles.remove(Z.outline),this.handles.remove(Z.regularVertices),this.handles.remove(Z.activeVertex),this.handles.remove(L)}_createOrUpdateGraphic(e){if(null!=this._graphic)return this._updateGraphicGeometry(this._graphic,e),this._graphic;const i=this._graphic=new t({...this.graphicProperties,symbol:this.graphicSymbol});return this._updateGraphicGeometry(i,e),this.internalGraphicsLayer.add(i),this.handles.add(this.initializeGraphic(i)),this.notifyChange("graphic"),this.handles.add(r((()=>{this.internalGraphicsLayer.remove(i),l(i),this._graphic===i&&(this._graphic=null)})),L),i}_updateGraphicGeometry(e,t){e.geometry=t}_getCreateOperationGeometry(e={operationComplete:!1}){const{drawOperation:t}=this;if(null==t||0===t.numVertices)return null;const{coordinateHelper:i,view:o}=t,r=t.stagedVertex,l=t.committedVertices,n=l.slice(),a=null!=r;a&&n.push(i.pointToArray(r));const s=a?i.pointToArray(r):l.splice(-1)[0],p=n.length,c=o.spatialReference,h="3d"===o.type&&"global"===o.viewingMode,u=new D;switch(this.geometryType){case"point":case"mesh":u.regularVertices=l,u.activeVertex=s,u.full=i.arrayToPoint(n[0]);break;case"multipoint":u.regularVertices=l,u.activeVertex=s,p>0&&(u.full=T(n,c));break;case"polyline":u.regularVertices=l,u.activeVertex=s,p>0&&(u.full=O([n],c,h));break;case"polygon":u.regularVertices=l,u.activeVertex=s,p>0&&(u.full=w([n],c,h,!0));break;case"circle":if(p>0){const t=x(o,n[0]);if(1===p&&e.operationComplete){const e=n[0],i=t.makeMapPoint(e[0]+N*o.resolution,e[1]);u.circle=v([e,i],t,!0),u.full=null!=u.circle?u.circle.geometry:null}else 2===p&&(this.forceUniformSize?(u.circle=v(n,t,this.centered),u.full=null!=u.circle?u.circle.geometry:null):(u.rectangle=_(n,t,this.centered),u.full=u.rectangle.geometry))}break;case"rectangle":if(p>0){const t=x(o,n[0]);if(1===p&&e.operationComplete){const e=n[0],i=t.makeMapPoint(e[0]+N*o.resolution,e[1]);u.rectangle=g([e,i],t,!0),u.full=u.rectangle.geometry}else 2===p&&(u.rectangle=this.forceUniformSize?g(n,t,this.centered):f(n,t,this.centered),u.full=u.rectangle.geometry)}break;default:return null}switch(this.geometryType){case"point":case"multipoint":break;case"polyline":case"polygon":p>1&&(u.outline=O([n],c,h));break;case"circle":case"rectangle":null!=u.full&&"polygon"===u.full.type&&(u.outline=w(u.full.rings,c,h))}return u}initializeGraphic(e){return null}onComplete(e){this._updateGraphic();let t=null;if(this.drawOperation.isCompleted){const e=this._getCreateOperationGeometry({operationComplete:!0});null!=e&&(t=this._createOrUpdateGraphic(e.full).clone())}this._createOperationGeometry=null,this.emit("complete",{graphic:t,...e})}onCursorUpdate(e){this._updateGraphic(),this.emit("cursor-update",e)}onDeactivate(){this.drawOperation.isCompleted||this.drawOperation.cancel()}onVertexAdd(e){this._updateGraphic(),this.emit("vertex-add",e)}onVertexRemove(e){this._updateGraphic(),this.emit("vertex-remove",e)}onVertexUpdate(e){this._updateGraphic(),this.emit("vertex-update",e)}_updateGraphic(){const e=this._getCreateOperationGeometry();this._createOperationGeometry=e,null!=e?(null!=e.outline?this.handles.add(this.onOutlineChanged(e.outline),Z.outline):this.handles.remove(Z.outline),null!=e.regularVertices?this.handles.add(this.onRegularVerticesChanged(e.regularVertices),Z.regularVertices):this.handles.remove(Z.regularVertices),null!=e.activeVertex?this.handles.add(this.onActiveVertexChanged(e.activeVertex),Z.activeVertex):this.handles.remove(Z.activeVertex),null!=e.full?this._createOrUpdateGraphic(e.full):this.handles.remove(L)):this._destroyAllVisualisations()}get _tooltipInfo(){const{drawOperation:e}=this;if(!e)return null;switch(this.geometryType){case"point":return this._drawPointTooltipInfo;case"polyline":return this._drawPolylineTooltipInfo;case"polygon":return this._drawPolygonTooltipInfo;case"rectangle":return this._drawRectangleTooltipInfo;case"circle":return this._drawCircleTooltipInfo;case"mesh":return this._drawMeshTooltipInfo;default:return null}}get _drawPointTooltipInfo(){const{view:e,graphic:t}=this,i=t?.geometry;return"point"!==i?.type||"2d"===e.type&&0===this.defaultZ?null:new I({tooltipOptions:this.tooltipOptions,elevation:this._elevationTooltipDetail,viewType:e.type,helpMessage:G("point",i,e)})}get _drawPolylineTooltipInfo(){const e=this._createOperationGeometry,t=null!=e?e.full:null;if("polyline"!==t?.type)return null;const i=A(t,this._elevationMode),{view:o}=this;return new j({tooltipOptions:this.tooltipOptions,elevation:this._elevationTooltipDetail,totalLength:i??a,viewType:o.type,helpMessage:G("polyline",t,o)})}get _drawPolygonTooltipInfo(){const e=this._createOperationGeometry,t=null!=e?e.full:null;if("polygon"!==t?.type)return null;const i=P(t,this._elevationMode),{view:o}=this;return new M({tooltipOptions:this.tooltipOptions,elevation:this._elevationTooltipDetail,area:i??s,viewType:o.type,helpMessage:G("polygon",t,o)})}get _drawMeshTooltipInfo(){const{view:e,graphic:t}=this,i=t?.geometry;return"mesh"!==i?.type||"2d"===e.type&&0===this.defaultZ?null:new U({tooltipOptions:this.tooltipOptions,elevation:this._elevationTooltipDetail,viewType:e.type,helpMessage:G("mesh",i,e)})}get _drawRectangleTooltipInfo(){return null==this.drawOperation?null:new C({tooltipOptions:this.tooltipOptions,xSize:this._xSize??a,ySize:this._ySize??a,area:this._fullGeometryArea??s})}get _drawCircleTooltipInfo(){if(null==this.drawOperation)return null;const e=this.forceUniformSize;return new z({tooltipOptions:this.tooltipOptions,radius:e?this._circleRadius??a:null,xSize:e?null:this._xSize??a,ySize:e?null:this._ySize??a,area:this._fullGeometryArea??s})}get _circleRadius(){const e=this._createOperationGeometry;return null!=e&&null!=e.circle&&null!=e.circle.center&&null!=e.circle.edge?R(e.circle.center,e.circle.edge,this._elevationMode):null}get _xSize(){const e=this._createOperationGeometry;if(null==e?.rectangle)return null;const{midpoints:t}=e.rectangle;return null!=t?R(t.left,t.right,this._elevationMode):null}get _ySize(){const e=this._createOperationGeometry;if(null==e?.rectangle)return null;const{midpoints:t}=e.rectangle;return null!=t?R(t.top,t.bottom,this._elevationMode):null}get _fullGeometryArea(){const e=this._createOperationGeometry,t=null!=e?e.full:null;return"polygon"!==t?.type?null:P(t,this._elevationMode)}get _elevationTooltipDetail(){return{mode:this.drawOperation.elevationInfo.mode,...this._vertexTooltipElevation}}get _vertexTooltipElevation(){const{tooltipOptions:e,view:t,drawOperation:i}=this;if(null==i)return this._defaultElevation;const o=i.stagedVertex??i.lastVertex;if(null==o||"2d"===t.type)return this._defaultElevation;const r={mode:e.elevation.mode,offset:0},l=(m(t,o,i.elevationInfo,r)??0)*h(o.spatialReference);return n(l,"meters")}get _elevationMode(){return this.drawOperation.isDraped?"on-the-ground":"absolute-height"}};e([u()],E.prototype,"_createOperationGeometry",void 0),e([u()],E.prototype,"_defaultElevation",null),e([u({value:!0})],E.prototype,"centered",null),e([u({nonNullable:!0})],E.prototype,"defaultZ",void 0),e([u()],E.prototype,"drawOperation",void 0),e([u({value:!0})],E.prototype,"enabled",null),e([u({value:!0})],E.prototype,"forceUniformSize",null),e([u({constructOnly:!0})],E.prototype,"geometryType",void 0),e([u()],E.prototype,"graphic",null),e([u({constructOnly:!0})],E.prototype,"graphicProperties",void 0),e([u()],E.prototype,"graphicSymbol",null),e([u({constructOnly:!0})],E.prototype,"hasZ",void 0),e([u({constructOnly:!0,type:S})],E.prototype,"labelOptions",void 0),e([u({constructOnly:!0})],E.prototype,"geometryToPlace",void 0),e([u({constructOnly:!0})],E.prototype,"mode",void 0),e([u()],E.prototype,"snappingManager",void 0),e([u()],E.prototype,"snapToScene",void 0),e([u()],E.prototype,"tooltip",void 0),e([u({constructOnly:!0,type:b})],E.prototype,"tooltipOptions",void 0),e([u({readOnly:!0})],E.prototype,"type",void 0),e([u({readOnly:!0})],E.prototype,"updating",null),e([u({constructOnly:!0,nonNullable:!0})],E.prototype,"view",void 0),e([u()],E.prototype,"_tooltipInfo",null),e([u()],E.prototype,"_drawPointTooltipInfo",null),e([u()],E.prototype,"_drawPolylineTooltipInfo",null),e([u()],E.prototype,"_drawPolygonTooltipInfo",null),e([u()],E.prototype,"_drawMeshTooltipInfo",null),e([u()],E.prototype,"_drawRectangleTooltipInfo",null),e([u()],E.prototype,"_drawCircleTooltipInfo",null),e([u()],E.prototype,"_circleRadius",null),e([u()],E.prototype,"_xSize",null),e([u()],E.prototype,"_ySize",null),e([u()],E.prototype,"_fullGeometryArea",null),e([u()],E.prototype,"_elevationTooltipDetail",null),e([u()],E.prototype,"_vertexTooltipElevation",null),e([u()],E.prototype,"_elevationMode",null),E=e([d("esri.views.draw.DrawGraphicTool")],E);const L="create-operation-graphic",Z={outline:"outline-visual",regularVertices:"regular-vertices-visual",activeVertex:"active-vertex-visual"};function H(e){switch(e){case"point":case"polyline":case"polygon":case"multipoint":return e;case"circle":case"rectangle":return"segment";case"mesh":return"point"}}const N=48;export{D as CreateOperationGeometry,E as DrawGraphicTool,H as geometryTypeToDrawOperationGeometryType};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import i from"../../core/Evented.js";import{HandleOwnerMixin as o}from"../../core/HandleOwner.js";import{makeHandle as r}from"../../core/handleUtils.js";import{destroyMaybe as l}from"../../core/maybe.js";import{createLength as n,zeroMeters as a,zeroSquareMeters as s}from"../../core/quantityUtils.js";import{watch as p,syncAndInitial as c}from"../../core/reactiveUtils.js";import{getMetersPerVerticalUnitForSR as h}from"../../core/unitUtils.js";import{property as u}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import y from"../../layers/GraphicsLayer.js";import{getConvertedElevation as m}from"../../support/elevationInfoUtils.js";import{createSquare as g,createRectangle as f,createCircle as v,createEllipse as _,createPolygon as w,createPolyline as O,createMultipoint as T}from"./support/createUtils.js";import{getDrawHelpMessage as G}from"./support/helpMessageUtils.js";import{createViewAlignedCoordinateSystem as x}from"./support/surfaceCoordinateSystems.js";import{InteractiveToolBase as V}from"../interactive/InteractiveToolBase.js";import b from"../interactive/sketch/SketchLabelOptions.js";import S from"../interactive/sketch/SketchTooltipOptions.js";import{DrawPointTooltipInfo as I,DrawPolylineTooltipInfo as j,DrawPolygonTooltipInfo as M,DrawMeshTooltipInfo as U,DrawRectangleTooltipInfo as C,DrawCircleTooltipInfo as z}from"../interactive/tooltip/DrawTooltipInfos.js";import{Tooltip as k}from"../interactive/tooltip/Tooltip.js";import{autoAreaByElevationMode as P}from"../support/automaticAreaMeasurementUtils.js";import{autoLengthByElevationMode as A,autoHorizontalDistanceByElevationModeBetweenPoints as R}from"../support/automaticLengthMeasurementUtils.js";class D{constructor(){this.regularVertices=null,this.activeVertex=null,this.full=null,this.outline=null,this.circle=null,this.rectangle=null}}let E=class extends(o(i.EventedMixin(V))){constructor(e){super(e),this._graphic=null,this._createOperationGeometry=null,this.defaultZ=0,this.geometryType=null,this.hasZ=!0,this.labelOptions=new b,this.geometryToPlace=null,this.mode=null,this.snappingManager=null,this.snapToScene=!1,this.tooltip=null,this.tooltipOptions=new S}initialize(){this.internalGraphicsLayer=new y({listMode:"hide",internal:!0}),this.view.map.layers.add(this.internalGraphicsLayer),this.drawOperation=this.makeDrawOperation(),this.handles.add([this.drawOperation.on("vertex-add",(e=>this.onVertexAdd(e))),this.drawOperation.on("vertex-remove",(e=>this.onVertexRemove(e))),this.drawOperation.on("vertex-update",(e=>this.onVertexUpdate(e))),this.drawOperation.on("cursor-update",(e=>this.onCursorUpdate(e))),this.drawOperation.on("complete",(e=>this.onComplete(e))),p((()=>this.tooltipOptions.enabled),(e=>{this.tooltip=e?new k({view:this.view,info:this._tooltipInfo}):l(this.tooltip)}),c),p((()=>this._tooltipInfo),(e=>{null!=this.tooltip&&(this.tooltip.info=e)}),c)]),this.finishToolCreation()}destroy(){this.drawOperation=l(this.drawOperation),this.tooltip=l(this.tooltip),this._destroyAllVisualisations(),this.view.map.remove(this.internalGraphicsLayer),this.internalGraphicsLayer=l(this.internalGraphicsLayer),this._set("view",null)}get _defaultElevation(){return n(this.defaultZ,"meters")}get canRedo(){return this.drawOperation.canRedo}get canUndo(){return this.drawOperation.canUndo}set centered(e){this._set("centered",e),this._updateGraphic()}set enabled(e){this.drawOperation.interactive=e,this._set("enabled",e)}set forceUniformSize(e){this._set("forceUniformSize",e),this._updateGraphic()}get graphic(){return this._graphic}set graphicSymbol(e){this._set("graphicSymbol",e),null!=this._graphic&&(this._graphic.symbol=e)}get updating(){return this.drawOperation?.updating??!1}completeCreateOperation(){this.drawOperation.complete()}onInputEvent(e){this.drawOperation.onInputEvent(e)}redo(){this.drawOperation.redo()}reset(){}undo(){this.drawOperation.undo()}_destroyAllVisualisations(){this.handles.remove(Z.outline),this.handles.remove(Z.regularVertices),this.handles.remove(Z.activeVertex),this.handles.remove(L)}_createOrUpdateGraphic(e){if(null!=this._graphic)return this._updateGraphicGeometry(this._graphic,e),this._graphic;const i=this._graphic=new t({...this.graphicProperties,symbol:this.graphicSymbol});return this._updateGraphicGeometry(i,e),this.internalGraphicsLayer.add(i),this.handles.add(this.initializeGraphic(i)),this.notifyChange("graphic"),this.handles.add(r((()=>{this.internalGraphicsLayer.remove(i),l(i),this._graphic===i&&(this._graphic=null)})),L),i}_updateGraphicGeometry(e,t){e.geometry=t}_getCreateOperationGeometry(e={operationComplete:!1}){const{drawOperation:t}=this;if(null==t||0===t.numVertices)return null;const{coordinateHelper:i,view:o}=t,r=t.stagedVertex,l=t.committedVertices,n=l.slice(),a=null!=r;a&&n.push(i.pointToArray(r));const s=a?i.pointToArray(r):l.splice(-1)[0],p=n.length,c=o.spatialReference,h="3d"===o.type&&"global"===o.viewingMode,u=new D;switch(this.geometryType){case"point":case"mesh":u.regularVertices=l,u.activeVertex=s,u.full=i.arrayToPoint(n[0]);break;case"multipoint":u.regularVertices=l,u.activeVertex=s,p>0&&(u.full=T(n,c));break;case"polyline":u.regularVertices=l,u.activeVertex=s,p>0&&(u.full=O([n],c,h));break;case"polygon":u.regularVertices=l,u.activeVertex=s,p>0&&(u.full=w([n],c,h,!0));break;case"circle":if(p>0){const t=x(o,n[0]);if(1===p&&e.operationComplete){const e=n[0],i=t.makeMapPoint(e[0]+N*o.resolution,e[1]);u.circle=v([e,i],t,!0),u.full=null!=u.circle?u.circle.geometry:null}else 2===p&&(this.forceUniformSize?(u.circle=v(n,t,this.centered),u.full=null!=u.circle?u.circle.geometry:null):(u.rectangle=_(n,t,this.centered),u.full=u.rectangle.geometry))}break;case"rectangle":if(p>0){const t=x(o,n[0]);if(1===p&&e.operationComplete){const e=n[0],i=t.makeMapPoint(e[0]+N*o.resolution,e[1]);u.rectangle=g([e,i],t,!0),u.full=u.rectangle.geometry}else 2===p&&(u.rectangle=this.forceUniformSize?g(n,t,this.centered):f(n,t,this.centered),u.full=u.rectangle.geometry)}break;default:return null}switch(this.geometryType){case"point":case"multipoint":break;case"polyline":u.outline=p>1?O([n],c,h):null;break;case"polygon":u.outline=p>1?w([n],c,h):null;break;case"circle":case"rectangle":u.outline="polygon"===u.full?.type?w(u.full.rings,c,h):null}return u}initializeGraphic(e){return null}onComplete(e){this._updateGraphic();let t=null;if(this.drawOperation.isCompleted){const e=this._getCreateOperationGeometry({operationComplete:!0});null!=e&&(t=this._createOrUpdateGraphic(e.full).clone())}this._createOperationGeometry=null,this.emit("complete",{graphic:t,...e})}onCursorUpdate(e){this._updateGraphic(),this.emit("cursor-update",e)}onDeactivate(){this.drawOperation.isCompleted||this.drawOperation.cancel()}onVertexAdd(e){this._updateGraphic(),this.emit("vertex-add",e)}onVertexRemove(e){this._updateGraphic(),this.emit("vertex-remove",e)}onVertexUpdate(e){this._updateGraphic(),this.emit("vertex-update",e)}_updateGraphic(){const e=this._getCreateOperationGeometry();this._createOperationGeometry=e,null!=e?(null!=e.outline?this.handles.add(this.onOutlineChanged(e.outline),Z.outline):this.handles.remove(Z.outline),null!=e.regularVertices?this.handles.add(this.onRegularVerticesChanged(e.regularVertices),Z.regularVertices):this.handles.remove(Z.regularVertices),null!=e.activeVertex?this.handles.add(this.onActiveVertexChanged(e.activeVertex),Z.activeVertex):this.handles.remove(Z.activeVertex),null!=e.full?this._createOrUpdateGraphic(e.full):this.handles.remove(L)):this._destroyAllVisualisations()}get _tooltipInfo(){const{drawOperation:e}=this;if(!e)return null;switch(this.geometryType){case"point":return this._drawPointTooltipInfo;case"polyline":return this._drawPolylineTooltipInfo;case"polygon":return this._drawPolygonTooltipInfo;case"rectangle":return this._drawRectangleTooltipInfo;case"circle":return this._drawCircleTooltipInfo;case"mesh":return this._drawMeshTooltipInfo;default:return null}}get _drawPointTooltipInfo(){const{view:e,graphic:t}=this,i=t?.geometry;return"point"!==i?.type||"2d"===e.type&&0===this.defaultZ?null:new I({tooltipOptions:this.tooltipOptions,elevation:this._elevationTooltipDetail,viewType:e.type,helpMessage:G("point",i,e)})}get _drawPolylineTooltipInfo(){const e=this._createOperationGeometry,t=null!=e?e.full:null;if("polyline"!==t?.type)return null;const i=A(t,this._elevationMode),{view:o}=this;return new j({tooltipOptions:this.tooltipOptions,elevation:this._elevationTooltipDetail,totalLength:i??a,viewType:o.type,helpMessage:G("polyline",t,o)})}get _drawPolygonTooltipInfo(){const e=this._createOperationGeometry,t=null!=e?e.full:null;if("polygon"!==t?.type)return null;const i=P(t,this._elevationMode),{view:o}=this;return new M({tooltipOptions:this.tooltipOptions,elevation:this._elevationTooltipDetail,area:i??s,viewType:o.type,helpMessage:G("polygon",t,o)})}get _drawMeshTooltipInfo(){const{view:e,graphic:t}=this,i=t?.geometry;return"mesh"!==i?.type||"2d"===e.type&&0===this.defaultZ?null:new U({tooltipOptions:this.tooltipOptions,elevation:this._elevationTooltipDetail,viewType:e.type,helpMessage:G("mesh",i,e)})}get _drawRectangleTooltipInfo(){return null==this.drawOperation?null:new C({tooltipOptions:this.tooltipOptions,xSize:this._xSize??a,ySize:this._ySize??a,area:this._fullGeometryArea??s})}get _drawCircleTooltipInfo(){if(null==this.drawOperation)return null;const e=this.forceUniformSize;return new z({tooltipOptions:this.tooltipOptions,radius:e?this._circleRadius??a:null,xSize:e?null:this._xSize??a,ySize:e?null:this._ySize??a,area:this._fullGeometryArea??s})}get _circleRadius(){const e=this._createOperationGeometry;return null!=e&&null!=e.circle&&null!=e.circle.center&&null!=e.circle.edge?R(e.circle.center,e.circle.edge,this._elevationMode):null}get _xSize(){const e=this._createOperationGeometry;if(null==e?.rectangle)return null;const{midpoints:t}=e.rectangle;return null!=t?R(t.left,t.right,this._elevationMode):null}get _ySize(){const e=this._createOperationGeometry;if(null==e?.rectangle)return null;const{midpoints:t}=e.rectangle;return null!=t?R(t.top,t.bottom,this._elevationMode):null}get _fullGeometryArea(){const e=this._createOperationGeometry,t=null!=e?e.full:null;return"polygon"!==t?.type?null:P(t,this._elevationMode)}get _elevationTooltipDetail(){return{mode:this.drawOperation.elevationInfo.mode,...this._vertexTooltipElevation}}get _vertexTooltipElevation(){const{tooltipOptions:e,view:t,drawOperation:i}=this;if(null==i)return this._defaultElevation;const o=i.stagedVertex??i.lastVertex;if(null==o||"2d"===t.type)return this._defaultElevation;const r={mode:e.elevation.mode,offset:0},l=(m(t,o,i.elevationInfo,r)??0)*h(o.spatialReference);return n(l,"meters")}get _elevationMode(){return this.drawOperation.isDraped?"on-the-ground":"absolute-height"}};e([u()],E.prototype,"_createOperationGeometry",void 0),e([u()],E.prototype,"_defaultElevation",null),e([u({value:!0})],E.prototype,"centered",null),e([u({nonNullable:!0})],E.prototype,"defaultZ",void 0),e([u()],E.prototype,"drawOperation",void 0),e([u({value:!0})],E.prototype,"enabled",null),e([u({value:!0})],E.prototype,"forceUniformSize",null),e([u({constructOnly:!0})],E.prototype,"geometryType",void 0),e([u()],E.prototype,"graphic",null),e([u({constructOnly:!0})],E.prototype,"graphicProperties",void 0),e([u()],E.prototype,"graphicSymbol",null),e([u({constructOnly:!0})],E.prototype,"hasZ",void 0),e([u({constructOnly:!0,type:b})],E.prototype,"labelOptions",void 0),e([u({constructOnly:!0})],E.prototype,"geometryToPlace",void 0),e([u({constructOnly:!0})],E.prototype,"mode",void 0),e([u()],E.prototype,"snappingManager",void 0),e([u()],E.prototype,"snapToScene",void 0),e([u()],E.prototype,"tooltip",void 0),e([u({constructOnly:!0,type:S})],E.prototype,"tooltipOptions",void 0),e([u({readOnly:!0})],E.prototype,"type",void 0),e([u({readOnly:!0})],E.prototype,"updating",null),e([u({constructOnly:!0,nonNullable:!0})],E.prototype,"view",void 0),e([u()],E.prototype,"_tooltipInfo",null),e([u()],E.prototype,"_drawPointTooltipInfo",null),e([u()],E.prototype,"_drawPolylineTooltipInfo",null),e([u()],E.prototype,"_drawPolygonTooltipInfo",null),e([u()],E.prototype,"_drawMeshTooltipInfo",null),e([u()],E.prototype,"_drawRectangleTooltipInfo",null),e([u()],E.prototype,"_drawCircleTooltipInfo",null),e([u()],E.prototype,"_circleRadius",null),e([u()],E.prototype,"_xSize",null),e([u()],E.prototype,"_ySize",null),e([u()],E.prototype,"_fullGeometryArea",null),e([u()],E.prototype,"_elevationTooltipDetail",null),e([u()],E.prototype,"_vertexTooltipElevation",null),e([u()],E.prototype,"_elevationMode",null),E=e([d("esri.views.draw.DrawGraphicTool")],E);const L="create-operation-graphic",Z={outline:"outline-visual",regularVertices:"regular-vertices-visual",activeVertex:"active-vertex-visual"};function H(e){switch(e){case"point":case"polyline":case"polygon":case"multipoint":return e;case"circle":case"rectangle":return"segment";case"mesh":return"point"}}const N=48;export{D as CreateOperationGeometry,E as DrawGraphicTool,H as geometryTypeToDrawOperationGeometryType};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as i}from"../../chunks/tslib.es6.js";import e from"../../core/Collection.js";import{referenceSetter as s,castForReferenceSetter as r}from"../../core/collectionUtils.js";import{watch as t,sync as l}from"../../core/reactiveUtils.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 y}from"../../core/accessorSupport/decorators/subclass.js";import o from"./LayerView.js";let h=class extends o{constructor(i){super(i),this.type="group",this.layerViews=new e}destroy(){this.handles.removeAll();const i=this.layerViews.toArray();for(const e of i)e.destroy();this.layerViews.length=0}_allLayerViewVisibility(i){this.layerViews.forEach((e=>{e.visible=i}))}initialize(){this.handles.add([this.layerViews.on("change",(i=>this._layerViewsChangeHandler(i))),t((()=>this.layer?.visibilityMode),(()=>{this.layer&&this._applyVisibility((()=>this._allLayerViewVisibility(this.visible)),(()=>this._applyExclusiveVisibility(null)))}),l),t((()=>this.visible),(i=>{this._applyVisibility((()=>this._allLayerViewVisibility(i)),(()=>{}))}),l)],"grouplayerview"),this._layerViewsChangeHandler({target:null,added:this.layerViews.toArray(),removed:[],moved:[]})}set layerViews(i){this._set("layerViews",s(i,this._get("layerViews")))}get updatingProgress(){return 0===this.layerViews.length?1:this.layerViews.reduce(((i,e)=>i+e.updatingProgress),0)/this.layerViews.length}isUpdating(){return this.layerViews.some((i=>i.updating))}_hasLayerViewVisibleOverrides(){return this.layerViews.some((i=>i._isOverridden("visible")))}_findLayerViewForLayer(i){return i&&this.layerViews.find((e=>e.layer===i))}_firstVisibleOnLayerOrder(){const i=this.layer.layers.find((i=>{const e=this._findLayerViewForLayer(i);return!!e?.visible}));return i&&this._findLayerViewForLayer(i)}_applyExclusiveVisibility(i){null==i&&null==(i=this._firstVisibleOnLayerOrder())&&this.layerViews.length>0&&(i=this._findLayerViewForLayer(this.layer.layers.at(0))),this.layerViews.forEach((e=>{e.visible=e===i}))}_layerViewsChangeHandler(i){this.handles.remove("grouplayerview:visible"),this.handles.add(this.layerViews.map((i=>t((()=>i.visible),(e=>this._applyVisibility((()=>{e!==this.visible&&(i.visible=this.visible)}),(()=>this._applyExclusiveVisibility(e?i:null)))),l))).toArray(),"grouplayerview:visible");const e=i.added[i.added.length-1];this._applyVisibility((()=>this._allLayerViewVisibility(this.visible)),(()=>this._applyExclusiveVisibility(e?.visible?e:null)))}_applyVisibility(i,e){this._hasLayerViewVisibleOverrides()&&("inherited"===this.layer?.visibilityMode?i():"exclusive"===this.layer?.visibilityMode&&e())}};i([a({cast:r})],h.prototype,"layerViews",null),i([a({readOnly:!0})],h.prototype,"updatingProgress",null),i([a()],h.prototype,"view",void 0),h=i([y("esri.views.layers.GroupLayerView")],h);const n=h;export{n as default};
5
+ import{_ as i}from"../../chunks/tslib.es6.js";import e from"../../core/Collection.js";import{referenceSetter as s,castForReferenceSetter as r}from"../../core/collectionUtils.js";import{watch as t,sync as l}from"../../core/reactiveUtils.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 y}from"../../core/accessorSupport/decorators/subclass.js";import o from"./LayerView.js";let h=class extends o{constructor(i){super(i),this.type="group",this.layerViews=new e}destroy(){this.handles.removeAll(),this.layerViews.length=0}_allLayerViewVisibility(i){this.layerViews.forEach((e=>{e.visible=i}))}initialize(){this.handles.add([this.layerViews.on("change",(i=>this._layerViewsChangeHandler(i))),t((()=>this.layer?.visibilityMode),(()=>{this.layer&&this._applyVisibility((()=>this._allLayerViewVisibility(this.visible)),(()=>this._applyExclusiveVisibility(null)))}),l),t((()=>this.visible),(i=>{this._applyVisibility((()=>this._allLayerViewVisibility(i)),(()=>{}))}),l)],"grouplayerview"),this._layerViewsChangeHandler({target:null,added:this.layerViews.toArray(),removed:[],moved:[]})}set layerViews(i){this._set("layerViews",s(i,this._get("layerViews")))}get updatingProgress(){return 0===this.layerViews.length?1:this.layerViews.reduce(((i,e)=>i+e.updatingProgress),0)/this.layerViews.length}isUpdating(){return this.layerViews.some((i=>i.updating))}_hasLayerViewVisibleOverrides(){return this.layerViews.some((i=>i._isOverridden("visible")))}_findLayerViewForLayer(i){return i&&this.layerViews.find((e=>e.layer===i))}_firstVisibleOnLayerOrder(){const i=this.layer.layers.find((i=>{const e=this._findLayerViewForLayer(i);return!!e?.visible}));return i&&this._findLayerViewForLayer(i)}_applyExclusiveVisibility(i){null==i&&null==(i=this._firstVisibleOnLayerOrder())&&this.layerViews.length>0&&(i=this._findLayerViewForLayer(this.layer.layers.at(0))),this.layerViews.forEach((e=>{e.visible=e===i}))}_layerViewsChangeHandler(i){this.handles.remove("grouplayerview:visible"),this.handles.add(this.layerViews.map((i=>t((()=>i.visible),(e=>this._applyVisibility((()=>{e!==this.visible&&(i.visible=this.visible)}),(()=>this._applyExclusiveVisibility(e?i:null)))),l))).toArray(),"grouplayerview:visible");const e=i.added[i.added.length-1];this._applyVisibility((()=>this._allLayerViewVisibility(this.visible)),(()=>this._applyExclusiveVisibility(e?.visible?e:null)))}_applyVisibility(i,e){this._hasLayerViewVisibleOverrides()&&("inherited"===this.layer?.visibilityMode?i():"exclusive"===this.layer?.visibilityMode&&e())}};i([a({cast:r})],h.prototype,"layerViews",null),i([a({readOnly:!0})],h.prototype,"updatingProgress",null),i([a()],h.prototype,"view",void 0),h=i([y("esri.views.layers.GroupLayerView")],h);const n=h;export{n 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.27/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../core/Error.js";import{clone as t}from"../../core/lang.js";import{getDeepValue as n}from"../../core/object.js";import{numberToJSON as i}from"../../core/accessorSupport/extensions/serializableProperty/writer.js";import{isFeatureCollectionLayer as r}from"../../layers/support/layerUtils.js";const o=new Set(["bing-maps","imagery","imagery-tile","map-image","open-street-map","tile","unknown","unsupported","vector-tile","web-tile","wms","wmts"]),l=new Set(["csv","feature","geo-rss","geojson","group","imagery","imagery-tile","kml","map-image","map-notes","media","ogc-feature","route","subtype-group","tile","unknown","unsupported","vector-tile","web-tile","wfs","wms","wmts"]);function a(e){o.delete(e),l.delete(e)}function s(e){o.add(e),l.add(e)}function p(e){return"basemap"===e.layerContainerType?o:"operational-layers"===e.layerContainerType?l:null}function m(e,t){if(t.restrictedWebMapWriting){const n=p(t);return null==n||n.has(e.type)&&!r(e)}return!0}function u(e,t){if(t)if(r(e)){const i=n("featureCollection.layers",t),r=i&&i[0]&&i[0].layerDefinition;r&&c(e,r)}else if("stream"===e.type){c(e,t.layerDefinition=t.layerDefinition||{})}else"group"!==e.type&&c(e,t)}function c(e,t){"maxScale"in e&&(t.maxScale=i(e.maxScale)??void 0),"minScale"in e&&(t.minScale=i(e.minScale)??void 0)}function d(e,t){if(u(e,t),t&&("blendMode"in e&&(t.blendMode=e.blendMode,"normal"===t.blendMode&&delete t.blendMode),t.opacity=i(e.opacity)??void 0,t.title=e.title||"Layer",t.visibility=e.visible,"legendEnabled"in e&&"wmts"!==e.type))if(r(e)){const n=t.featureCollection;n&&(n.showLegend=e.legendEnabled)}else t.showLegend=e.legendEnabled}function f(n,i,r){if(!("write"in n)||!n.write)return r&&r.messages&&r.messages.push(new e("layer:unsupported",`Layers (${n.title}, ${n.id}) of type '${n.declaredClass}' cannot be persisted`,{layer:n})),null;if(m(n,r)){const e={};return n.write(e,r)?e:null}return null!=i&&d(n,i=t(i)),i}export{s as disableRestrictedWriting,a as enableRestrictedWriting,f as getLayerJSON};
5
+ import e from"../../core/Error.js";import{clone as t}from"../../core/lang.js";import{getDeepValue as n}from"../../core/object.js";import{numberToJSON as r}from"../../core/accessorSupport/extensions/serializableProperty/writer.js";import{isFeatureCollectionLayer as i}from"../../layers/support/layerUtils.js";const o=new Set(["bing-maps","imagery","imagery-tile","map-image","open-street-map","tile","unknown","unsupported","vector-tile","web-tile","wms","wmts"]),l=new Set(["csv","feature","geo-rss","geojson","group","imagery","imagery-tile","kml","map-image","map-notes","media","ogc-feature","route","stream","subtype-group","tile","unknown","unsupported","vector-tile","web-tile","wfs","wms","wmts"]);function a(e){o.delete(e),l.delete(e)}function s(e){o.add(e),l.add(e)}function p(e){return"basemap"===e.layerContainerType?o:"operational-layers"===e.layerContainerType?l:null}function m(e,t){if(t.restrictedWebMapWriting){const n=p(t);return null==n||n.has(e.type)&&!i(e)}return!0}function u(e,t){if(t)if(i(e)){const r=n("featureCollection.layers",t),i=r&&r[0]&&r[0].layerDefinition;i&&c(e,i)}else"group"!==e.type&&c(e,t)}function c(e,t){"maxScale"in e&&(t.maxScale=r(e.maxScale)??void 0),"minScale"in e&&(t.minScale=r(e.minScale)??void 0)}function d(e,t){if(u(e,t),t&&("blendMode"in e&&(t.blendMode=e.blendMode,"normal"===t.blendMode&&delete t.blendMode),t.opacity=r(e.opacity)??void 0,t.title=e.title||"Layer",t.visibility=e.visible,"legendEnabled"in e&&"wmts"!==e.type))if(i(e)){const n=t.featureCollection;n&&(n.showLegend=e.legendEnabled)}else t.showLegend=e.legendEnabled}function f(n,r,i){if(!("write"in n)||!n.write)return i&&i.messages&&i.messages.push(new e("layer:unsupported",`Layers (${n.title}, ${n.id}) of type '${n.declaredClass}' cannot be persisted`,{layer:n})),null;if(m(n,i)){const e={};return n.write(e,i)?e:null}return null!=r&&d(n,r=t(r)),r}export{s as disableRestrictedWriting,a as enableRestrictedWriting,f as getLayerJSON};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- const o="esri-bookmarks",e=`${o}__authoring`,a=`${o}__bookmark`,i=`${o}__time-extent`,n={base:`${o} esri-widget--panel`,loaderContainer:`${o}__loader-container`,loader:`${o}__loader`,fadeIn:`${o}--fade-in`,bookmarkList:`${o}__list`,bookmarkListSortable:`${o}__list--sortable`,bookmark:a,bookmarkButton:`${a}-button`,bookmarkImageContainer:`${a}-image-container`,bookmarkImageContainerHasImage:`${a}-image-container--has-image`,bookmarkEditButtonContainer:`${a}-edit-button-container`,bookmarkEditButton:`${a}-edit-button`,bookmarkDragHandle:`${o}_bookmark-drag-handle`,bookmarkDragHandleIcon:`${o}_bookmark-drag-handle-icon`,bookmarkIcon:`${a}-icon`,bookmarkImage:`${o}__image`,bookmarkLabel:`${a}-label`,bookmarkName:`${a}-name`,bookmarkTimeExtent:`${a}-time-extent`,bookmarkActive:`${a}--active`,noBookmarksContainer:"esri-widget__content--empty",noBookmarksHeader:`${o}__no-bookmarks-heading`,noBookmarksIcon:"esri-widget__no-bookmark-icon",noBookmarksDescription:`${o}__no-bookmarks-description`,addingBookmark:`${o}__adding-bookmark`,addBookmark:`${o}__add-bookmark`,addBookmarkButton:`${o}__add-bookmark-button`,addBookmarkIcon:`${o}__add-bookmark-icon`,authoringCard:`${e}-card`,authoringContainer:`${e}-container`,authoringForm:`${e}-form`,authoringLabel:`${e}-label`,authoringLabelStartPadding:`${e}-label--start-padding`,authoringActions:`${e}-actions`,authoringInputInvalid:`${e}-input--invalid`,authoringDeleteButton:`${e}-delete-button`,authoringCancelButton:`${e}-cancel-button`,timeExtentContainer:`${i}-container`,timeExtent:i,timeExtentGroup:`${i}-group`,timeExtentDate:`${i}-date`,timeExtentTime:`${i}-time`,esriWidget:"esri-widget",esriWidgetDisabled:"esri-widget--disabled",esriButton:"esri-button",esriButtonTertiary:"esri-button--tertiary",esriInput:"esri-input",iconHandle:"esri-icon-handle-vertical",iconPlus:"esri-icon-plus",iconEdit:"esri-icon-edit",iconHandleHorizontal:"esri-icon-handle-horizontal",iconRefresh:"esri-icon-refresh",iconLink:"esri-icon-link",iconRemove:"esri-icon-erase",widgetIcon:"esri-icon-bookmark",header:"esri-widget__heading",loading:"esri-icon-loading-indicator",rotating:"esri-rotating"};export{n as CSS};
5
+ const o="esri-bookmarks",a=`${o}__authoring`,e=`${o}__bookmark`,i=`${o}__time-extent`,n={base:`${o} esri-widget--panel`,loaderContainer:`${o}__loader-container`,loader:`${o}__loader`,fadeIn:`${o}--fade-in`,bookmarkList:`${o}__list`,bookmarkListSortable:`${o}__list--sortable`,bookmark:e,bookmarkButton:`${e}-button`,bookmarkImageContainer:`${e}-image-container`,bookmarkImageContainerHasImage:`${e}-image-container--has-image`,bookmarkEditButtonContainer:`${e}-edit-button-container`,bookmarkEditButton:`${e}-edit-button`,bookmarkDragHandle:`${o}_bookmark-drag-handle`,bookmarkDragHandleIcon:`${o}_bookmark-drag-handle-icon`,bookmarkIcon:`${e}-icon`,bookmarkImage:`${o}__image`,bookmarkLabel:`${e}-label`,bookmarkName:`${e}-name`,bookmarkTimeExtent:`${e}-time-extent`,bookmarkActive:`${e}--active`,noBookmarksContainer:"esri-widget__content--empty",noBookmarksHeader:`${o}__no-bookmarks-heading`,noBookmarksIcon:"esri-widget__no-bookmark-icon",noBookmarksDescription:`${o}__no-bookmarks-description`,addingBookmark:`${o}__adding-bookmark`,addBookmark:`${o}__add-bookmark`,addBookmarkButton:`${o}__add-bookmark-button`,addBookmarkIcon:`${o}__add-bookmark-icon`,authoringCard:`${a}-card`,authoringContainer:`${a}-container`,authoringForm:`${a}-form`,authoringFormAdding:`${a}-form--adding`,authoringLabel:`${a}-label`,authoringLabelStartPadding:`${a}-label--start-padding`,authoringActions:`${a}-actions`,authoringInputInvalid:`${a}-input--invalid`,authoringDeleteButton:`${a}-delete-button`,authoringCancelButton:`${a}-cancel-button`,timeExtentContainer:`${i}-container`,timeExtent:i,timeExtentGroup:`${i}-group`,timeExtentDate:`${i}-date`,timeExtentTime:`${i}-time`,esriWidget:"esri-widget",esriWidgetDisabled:"esri-widget--disabled",esriButton:"esri-button",esriButtonTertiary:"esri-button--tertiary",esriInput:"esri-input",iconHandle:"esri-icon-handle-vertical",iconPlus:"esri-icon-plus",iconEdit:"esri-icon-edit",iconHandleHorizontal:"esri-icon-handle-horizontal",iconRefresh:"esri-icon-refresh",iconLink:"esri-icon-link",iconRemove:"esri-icon-erase",widgetIcon:"esri-icon-bookmark",header:"esri-widget__heading",loading:"esri-icon-loading-indicator",rotating:"esri-rotating"};export{n as CSS};