@arcgis/core 5.0.0-next.71 → 5.0.0-next.73

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 (151) hide show
  1. package/Ground.js +1 -1
  2. package/applications/Components/analysisUtils.d.ts +1 -2
  3. package/applications/Components/analysisUtils.js +1 -1
  4. package/assets/esri/core/workers/RemoteClient.js +1 -1
  5. package/assets/esri/core/workers/chunks/00631252e8bd4a456253.js +1 -0
  6. package/assets/esri/core/workers/chunks/{322085d63719da6e443c.js → 0c02b084ae30ba138c5d.js} +1 -1
  7. package/assets/esri/core/workers/chunks/0f2f1731543ed21db0a8.js +1 -0
  8. package/assets/esri/core/workers/chunks/1b201d83e9ba7d8615c0.js +1 -0
  9. package/assets/esri/core/workers/chunks/{b4f944ef6c174b20b619.js → 23545a9adc75564ecf6e.js} +1 -1
  10. package/assets/esri/core/workers/chunks/261b5a5db022ef580a1b.js +1 -0
  11. package/assets/esri/core/workers/chunks/2bd59ece927b5c1c9f80.js +1 -0
  12. package/assets/esri/core/workers/chunks/{37e46461da3000949a26.js → 2d8b8880e6bff4414e95.js} +1 -1
  13. package/assets/esri/core/workers/chunks/2fba74bae99ece15706c.js +1 -0
  14. package/assets/esri/core/workers/chunks/2fc64404bc42b7250086.js +1 -0
  15. package/assets/esri/core/workers/chunks/33cbfc34d5e2fc1a1a4f.js +1 -0
  16. package/assets/esri/core/workers/chunks/35887be3e4a218268d99.js +1 -0
  17. package/assets/esri/core/workers/chunks/3596ae4cb2bd2f3f35d9.js +1 -0
  18. package/assets/esri/core/workers/chunks/37814bf052ab59a5fb9e.js +1 -0
  19. package/assets/esri/core/workers/chunks/4e0d299054da075e5103.js +1 -0
  20. package/assets/esri/core/workers/chunks/50186162cd6d7c2ef0f9.js +1 -0
  21. package/assets/esri/core/workers/chunks/543ea1a0e7a6f1d267d1.js +1 -0
  22. package/assets/esri/core/workers/chunks/{dbfb00fb28b8b9f687a1.js → 5bbf20135c87a1cc8a18.js} +1 -1
  23. package/assets/esri/core/workers/chunks/5ed31ec0f53c1d55c4ea.js +1 -0
  24. package/assets/esri/core/workers/chunks/6309e8beedf5e7f2a50f.js +1 -0
  25. package/assets/esri/core/workers/chunks/{1a45b4b4803337f4b99f.js → 64985e9b6e2edb3ceb37.js} +38 -38
  26. package/assets/esri/core/workers/chunks/65475370cc4ebe2aa657.js +1 -0
  27. package/assets/esri/core/workers/chunks/65d9f3bc88472008443a.js +1 -0
  28. package/assets/esri/core/workers/chunks/6ab0f16f5c8806855c47.js +1 -0
  29. package/assets/esri/core/workers/chunks/7e37a3005f2ad2c0a918.js +1 -0
  30. package/assets/esri/core/workers/chunks/7f2496a59379e1a61ee5.js +1 -0
  31. package/assets/esri/core/workers/chunks/88379cd8e8e1c7ae3c7c.js +1 -0
  32. package/assets/esri/core/workers/chunks/{25abbe1663e18e677dc2.js → 935a6dccb88557f98189.js} +2 -2
  33. package/assets/esri/core/workers/chunks/{a808be466812db51813d.js → 9382af94bf6bf1b09c8c.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{8e83c133b201b9b61e70.js → 979bc762ccc0d3fc2467.js} +1 -1
  35. package/assets/esri/core/workers/chunks/9c417f4dfb19e4c4bd71.js +1 -0
  36. package/assets/esri/core/workers/chunks/a554ad74be03b1ed1a72.js +1 -0
  37. package/assets/esri/core/workers/chunks/{e6e837e43b9348050832.js → a67c86f4254807eb6a05.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{1ec1a1997b5577619040.js → b211b53aa7616a093b90.js} +1 -1
  39. package/assets/esri/core/workers/chunks/c31babdb59382b6bc007.js +1 -0
  40. package/assets/esri/core/workers/chunks/c8182c2cbb0ead202af6.js +1 -0
  41. package/assets/esri/core/workers/chunks/ce218c10b209b58e04fd.js +1 -0
  42. package/assets/esri/core/workers/chunks/ceef586d8cc8adc4d249.js +1 -0
  43. package/assets/esri/core/workers/chunks/d13e8ce9270dc0662b87.js +1 -0
  44. package/assets/esri/core/workers/chunks/db28d00171240b4fffac.js +1 -0
  45. package/assets/esri/core/workers/chunks/dbd382546837aa7709e2.js +1 -0
  46. package/assets/esri/core/workers/chunks/ea6f897f21b4f30e8e99.js +1 -0
  47. package/assets/esri/core/workers/chunks/{e8a3ad00936f2ccaf362.js → f0a667d8d33bc51c795d.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{29b09db309ff75fb3e97.js → f65d26588d2d80680a26.js} +1 -1
  49. package/assets/esri/core/workers/chunks/f72e6c903f55ce95a6c5.js +1 -0
  50. package/assets/esri/core/workers/chunks/f893e10d660e819cca45.js +1 -0
  51. package/assets/esri/core/workers/chunks/{878010ca23da0bca9405.js → fb1ed5ef2f95ab093346.js} +1 -1
  52. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  53. package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
  54. package/chunks/lyr3DMain.js +1 -1
  55. package/config.js +1 -1
  56. package/core/workers/registry.js +1 -1
  57. package/geometry/spatialReferenceEllipsoidUtils.js +1 -1
  58. package/kernel.js +1 -1
  59. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  60. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  61. package/layers/RouteLayer.d.ts +3 -3
  62. package/layers/support/ElevationQuery.js +1 -1
  63. package/layers/support/GeometryDescriptor.js +1 -1
  64. package/layers/support/layerUtils.d.ts +4 -0
  65. package/layers/support/types.d.ts +3 -2
  66. package/package.json +1 -1
  67. package/rest/featureService/FeatureService.d.ts +1 -1
  68. package/rest/featureService/types.d.ts +4 -4
  69. package/rest/geoprocessor/GPOptions.d.ts +5 -5
  70. package/rest/geoprocessor/execute.d.ts +6 -0
  71. package/rest/layerSources/DynamicDataLayer.d.ts +2 -2
  72. package/rest/layerSources/QueryTableDataSource.d.ts +1 -1
  73. package/rest/print.d.ts +1 -1
  74. package/rest/support/ClosestFacilityParameters.d.ts +3 -3
  75. package/rest/support/ClosestFacilitySolveResult.d.ts +2 -2
  76. package/rest/support/Query.d.ts +2 -2
  77. package/rest/support/RouteParameters.d.ts +2 -5
  78. package/rest/support/RouteResult.d.ts +1 -1
  79. package/rest/support/ServiceAreaParameters.d.ts +1 -1
  80. package/rest/support/ServiceAreaSolveResult.d.ts +2 -2
  81. package/rest/support/types.d.ts +1 -1
  82. package/rest/symbolService.d.ts +2 -2
  83. package/support/revision.js +1 -1
  84. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  85. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementController.js +1 -1
  86. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementVisualization.js +1 -1
  87. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  88. package/views/3d/analysis/AreaMeasurementAnalysisView3D.js +1 -1
  89. package/views/3d/analysis/support/measurementUtils.js +1 -1
  90. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
  91. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  92. package/views/3d/interactive/visualElements/MeasurementAreaVisualElement.js +1 -1
  93. package/views/3d/interactive/visualElements/support/Segment.js +1 -1
  94. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  95. package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
  96. package/views/3d/webgl-engine/effects/RenderPlugin.js +1 -1
  97. package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
  98. package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
  99. package/views/3d/webgl-engine/lib/Material.js +1 -1
  100. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  101. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  102. package/views/3d/webgl-engine/materials/SlicePlaneMaterial.js +1 -1
  103. package/views/3d/webgl-engine/materials/VisualVariablePassParameters.js +1 -1
  104. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  105. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  106. package/views/analysis/ElevationProfile/ElevationProfileLineGroundComputation.js +1 -1
  107. package/views/analysis/ElevationProfile/elevationProfileGenerationUtils.js +1 -1
  108. package/views/support/MeasurementWorker.js +5 -0
  109. package/views/support/MeasurementWorkerHandle.js +5 -0
  110. package/views/support/automaticAreaMeasurementUtils.js +1 -1
  111. package/views/support/geodesicAreaMeasurementUtils.js +1 -1
  112. package/views/support/geodesicLengthMeasurementUtils.js +1 -1
  113. package/widgets/AreaMeasurement3D/AreaMeasurement3DViewModel.js +1 -1
  114. package/widgets/Directions/DirectionsViewModel.d.ts +2 -2
  115. package/widgets/Search/SearchResultRenderer.d.ts +0 -2
  116. package/widgets/Search/SearchSource.d.ts +2 -2
  117. package/widgets/Search/SearchViewModel.d.ts +6 -7
  118. package/widgets/Search/types.d.ts +4 -4
  119. package/assets/esri/core/workers/chunks/0367a8580fede8f804f9.js +0 -1
  120. package/assets/esri/core/workers/chunks/14f4f5b7549cea7b5a6a.js +0 -1
  121. package/assets/esri/core/workers/chunks/1b475593c80d7bccdda5.js +0 -1
  122. package/assets/esri/core/workers/chunks/27ec8688f72130239b98.js +0 -1
  123. package/assets/esri/core/workers/chunks/2dd347aa2a061d536e69.js +0 -1
  124. package/assets/esri/core/workers/chunks/2f6fa33692478e99d24b.js +0 -1
  125. package/assets/esri/core/workers/chunks/3e7ea06b342e33bc48a5.js +0 -1
  126. package/assets/esri/core/workers/chunks/4387aaf9d5e8f6d1833d.js +0 -1
  127. package/assets/esri/core/workers/chunks/668a868fe2dcb6384ac9.js +0 -1
  128. package/assets/esri/core/workers/chunks/6acfa51b81e6f4255118.js +0 -1
  129. package/assets/esri/core/workers/chunks/6f8098f9fe233833245a.js +0 -1
  130. package/assets/esri/core/workers/chunks/76dbaef0d0794913f36f.js +0 -1
  131. package/assets/esri/core/workers/chunks/7c5218eae13d3bd30598.js +0 -1
  132. package/assets/esri/core/workers/chunks/7fc09382f934e9223a9b.js +0 -1
  133. package/assets/esri/core/workers/chunks/822ef6a043c7e147b4b6.js +0 -1
  134. package/assets/esri/core/workers/chunks/980313a6c35e79812d17.js +0 -1
  135. package/assets/esri/core/workers/chunks/9c157c0eeadb824ad01e.js +0 -1
  136. package/assets/esri/core/workers/chunks/a39ac9127a215d14d412.js +0 -1
  137. package/assets/esri/core/workers/chunks/a893f8db2477cf677ac8.js +0 -1
  138. package/assets/esri/core/workers/chunks/a95e28ade258b144cbb5.js +0 -1
  139. package/assets/esri/core/workers/chunks/abcee7cfd53cfe1d91e9.js +0 -1
  140. package/assets/esri/core/workers/chunks/b9f0d313f59fc7c43560.js +0 -1
  141. package/assets/esri/core/workers/chunks/bbe2eaef7edfa33b6eea.js +0 -1
  142. package/assets/esri/core/workers/chunks/bfdf646d4c8f175a4236.js +0 -1
  143. package/assets/esri/core/workers/chunks/d749aa62ad694147aebe.js +0 -1
  144. package/assets/esri/core/workers/chunks/d7d9656b990ce8be2152.js +0 -1
  145. package/assets/esri/core/workers/chunks/d8a7004c399d539aed09.js +0 -1
  146. package/assets/esri/core/workers/chunks/df92239eefff04471a0b.js +0 -1
  147. package/assets/esri/core/workers/chunks/ee2ca25048a920e43743.js +0 -1
  148. package/assets/esri/core/workers/chunks/eeb24a4ab4993f1f4e8e.js +0 -1
  149. package/assets/esri/core/workers/chunks/fe5d2735f057c7789f4b.js +0 -1
  150. package/views/support/GeodesicMeasurementWorker.js +0 -5
  151. package/views/support/GeodesicMeasurementWorkerHandle.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as r}from"../../../../core/asyncUtils.js";import"../../../../core/has.js";import{clamp as i,lerp as s}from"../../../../core/mathUtils.js";import{removeMaybe as a,abortMaybe as n,destroyMaybe as h,releaseMaybe as o}from"../../../../core/maybe.js";import{throwIfAborted as d}from"../../../../core/promiseUtils.js";import{watch as _,syncAndInitial as l,initial as u,sync as p}from"../../../../core/reactiveUtils.js";import{signal as m}from"../../../../core/signal.js";import{Milliseconds as c}from"../../../../core/time.js";import{property as f,subclass as g}from"../../../../core/accessorSupport/decorators.js";import{equals as b,invert as P,multiply as C}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as w,create as T}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{c as S}from"../../../../chunks/vec42.js";import{ZEROS as E}from"../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import{fromValues as x,ZEROS as A}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as D}from"../../../../geometry/support/Indices.js";import{RenderCategory as I,InternalRenderCategory as R}from"../../webgl.js";import{innerAtmosphereFadeStart as y}from"../../environment/atmosphereUtils.js";import{minNearDistanceInMeters as O}from"../../state/NearFarHeuristic.js";import{debugFlags as F}from"../../support/debugFlags.js";import{FBOCache as H,defaultWebGLFBO as v}from"../core/FBOCache.js";import{RenderPassManager as M}from"../core/renderPasses/RenderPassManager.js";import{isColor as N}from"../core/shaderLibrary/ShaderOutput.js";import{distanceFadeEnd as q}from"../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{RenderNodes as G}from"../effects/RenderNodes.js";import{RenderPluginManager as L}from"../effects/RenderPluginManager.js";import{Blit as U}from"../effects/blit/Blit.js";import{maxHighlightsPerChannel as V,renderHighlightBuffer as j}from"../effects/highlight/Highlight.js";import{OITBlend as B}from"../effects/transparency/OITBlend.js";import{AnimationTimer as k}from"./AnimationTimer.js";import{AnimationTimeStep as z}from"./AnimationTimeStep.js";import{BoundingInfo as W}from"./BoundingInfo.js";import{DepthRange as Q}from"./DepthRange.js";import{depthRangeFromScene as Y}from"./depthRangeUtils.js";import{hudFragmentOpacityParameters as Z}from"./hudFragmentOpacityParameters.js";import{MainFramebuffer as J}from"./MainFramebuffer.js";import{RenderContext as K,defaultRenderOccludedMask as X}from"./RenderContext.js";import{RendererBase as $}from"./RendererBase.js";import{setupFeatureDefaults as ee}from"./RenderFeature.js";import{RenderPluginInput as te}from"./RenderPluginInput.js";import{ShadowAccumulator as re}from"./ShadowAccumulator.js";import{ShadowMap as ie}from"./ShadowMap.js";import se from"./SliceHelper.js";import{MergedRenderer as ae}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as ne}from"../parts/renderUtils.js";import{RendererPerformanceInfo as he,PerformanceCategory as oe}from"../statistics/RendererPerformanceInfo.js";import{PixelType as de,ColorAttachment1 as _e,ColorAttachment2 as le}from"../../../webgl/enums.js";let ue=class extends ${constructor(e,t,r,i,s,a){super({stage:e}),this._techniques=r,this._rctx=i,this._compositingHelper=s,this._requestRender=a,this._pluginsHas={hudElements:!1,water:!1},this.renderPassManager=new M,this._isRendering=!1,this._inGlobeView=!1,this._backgroundColor=x(0,0,0,1),this._sliceHelper=new se,this.sceneDepthRange=m(Q.Infinite),this._state=m(2),this._hasAnimations=!1,this._animationTimestep=new z,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=m(0),this._lastFrameTime=c(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new te,this._releaseNormals=e=>{e.some(({name:e})=>"normals"===e)&&this._pluginInput.release("normals")},this._debugNeedsDepth=!1,this._fboCache=new H(i),this._renderStateFeatures=m(ee(e.view.qualityProfile)),this._framebuffer=new J(this.fboCache),this._performanceInfo=new he(this._rctx),this._shadowMap=new ie(this.fboCache,e.viewingMode),this._shadowAccumulator=new re(this.fboCache,r,e,e=>{const t=this.shadowsEnabled;this._shadowMap.enabled=!0,this._ensureBindParametersCamera(e.camera,e.contentCamera),this._plugins.prepareRender(),this._shadowMap.enabled=t},(t,r,i)=>{const s=e.view.qualitySettings.maximumPixelRatio;t.shadowMap.start(t.camera,r,i,!0,s),this._renderShadowCascades(3,t.shadowMap),t.shadowMap.finish(),t.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(t.camera,t.contentCamera)},a),this._renderContext=new K(this._rctx,this._shadowMap,r),this._nodes=new G(this._renderContext),this._plugins=new L({renderContext:this._renderContext,techniques:r,materials:t,requestRender:a,controller:e,fbos:this.fboCache,isFeatureEnabled:e=>this.isFeatureEnabled(e)}),this._plugins.add(this.renderPassManager),this.addHandles([_(()=>e.view.state.camera,()=>a(),l),_(()=>F.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES,e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(0):()=>{},a()},u),_(()=>e.view.environment.background?.color,e=>{const t=e?e.toUnitRGBA():A;S(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),a()},l),_(()=>e.view.state.camera.relativeElevation,e=>this._inGlobeView=(e??1/0)>=q,l),_(()=>this._bindParameters.clouds.fadeFactor,()=>{this._bindParameters.fadeLighting(),this._requestRender(2)},p),_(()=>this._bindParameters.clouds.data?.state,()=>a(),p),_(()=>e.view.state.highlights,e=>{this._bindParameters.highlights=e,a()},u)])}destroy(){this._gpuTimerHandle=a(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowMap.dispose(),this._shadowAccumulator.destroy(),this._shadowAccumulator=null,this._loadEdgeViewTask=n(this._loadEdgeViewTask),this._edgeView=h(this._edgeView),this.renderPassManager.dispose(),this._releaseFBOs(),this._disposeOffscreenBuffers(),this._fboCache.destroy(),this._fboCache=null,this._plugins.destroy(),this._plugins=null,this._pluginInput=null,this._blit=null,this._oitBlend=null,this._compositingHelper=null,this._nodes=null,this._framebuffer=null,this._shadowMap=null,this._renderContext=null,this._performanceInfo=null,W.prune(),ae.prune(),D()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get _framebufferSize(){return this._framebuffer.size}get performanceInfo(){return this._performanceInfo}updateRenderFeatures(e){this._renderStateFeatures.value=ee(e),this._requestRender()}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,r){this._renderStateFeatures.mutate(i=>i.set(t,e,r)),this._requestRender()}get _highQualityTransparency(){return this.isFeatureEnabled(1)}get hasReflections(){return this._pluginsHas.water&&this.isFeatureEnabled(6)}get _hasHighlights(){return this._plugins.produces(8,2,4,19,14,15)}hasHighlight(e){return this._plugins.hasHighlight(e)}get _hasHUDHighlights(){return this._plugins.produces(8,14,15)}get hasSSAO(){return this.isFeatureEnabled(5)&&!this._inGlobeView}get hasSMAA(){return this.isFeatureEnabled(0)}get hasEmitters(){return this._plugins.hasEmitters&&this._hasFloatBufferBlendSupport}get highResolutionAtmosphere(){return this.isFeatureEnabled(4)}get fboCache(){return this._fboCache}_releaseFBOs(){this._bindParameters.ssr.lastFrameColor=o(this._bindParameters.ssr.lastFrameColor),this._bindParameters.terrainDepth=o(this._bindParameters.terrainDepth),this._bindParameters.geometryDepth=o(this._bindParameters.geometryDepth)}_disposeOffscreenBuffers(){this._framebuffer.dispose(),this._disposeBindBuffers()}_disposeBindBuffers(){this._shadowMap.disposeOffscreenBuffers(),this._bindParameters.depth=o(this._bindParameters.depth),this._bindParameters.hudVisibility=o(this._bindParameters.hudVisibility)}get updating(){return this._loadEdgeViewTask&&!this._loadEdgeViewTask.finished||this._edgeView?.updating||this._shadowAccumulator.readyToRun||this._plugins.updating||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||(this._loadEdgeViewTask=r(async e=>{const{EdgeView:t}=await import("./edgeRendering/EdgeView.js");d(e);const r=this._edgeView=new t({rctx:this._rctx,renderSR:this.stage.view.renderSpatialReference,viewingMode:this.stage.view.stage.viewingMode,techniques:this._techniques,setNeedsRender:()=>this._requestRender(),schedule:Ee(this.stage.view.resourceController)});return this.addHandles(_(()=>r.updating,()=>this._requestRender(),p)),this._requestRender(),this._edgeViewCallbacks.forEach(e=>e(r)),this._edgeViewCallbacks.length=0,r})),this._loadEdgeViewTask.promise}withEdgeView(e){this.loadEdgeView(),null==this._edgeView?this._edgeViewCallbacks.push(e):e(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return this._reprojectionMatrixVersion.value>=0&&b(this._bindParameters.ssr.reprojectionMatrix,w)}set _reprojectionMatrix(e){t(this._bindParameters.ssr.reprojectionMatrix,e)&&this._reprojectionMatrixVersion.value++}get shadowsEnabled(){return!!this._shadowMap?.enabled}setParameters(e){const{_shadowMap:t,_bindParameters:r}=this;if(void 0!==e.shadowMap&&this._shadowMap.enabled!==e.shadowMap&&(this._shadowMap.enabled=e.shadowMap,this._requestRender()),void 0!==e.shadowMapMaxCascades&&t.maxCascades!==e.shadowMapMaxCascades&&(t.maxCascades=e.shadowMapMaxCascades,this._requestRender()),e.environment){void 0!==e.environment.weather&&(this._bindParameters.weather=e.environment.weather);const t="virtual"!==e.environment.lighting.type;r.enableFillLights!==t&&(r.enableFillLights=t,this._requestRender())}void 0!==e.shadowCast&&this._shadowAccumulator.setOptions(e.shadowCast)}set slice(e){this._sliceHelper.update(e)&&this._requestRender()}get plugins(){return this._plugins}get _hasFloatBufferBlendSupport(){return this._rctx.driverTest.floatBufferBlend.result}get _oitEnabled(){return this.isFeatureEnabled(2)&&this._hasFloatBufferBlendSupport}commit(e,t){return this._isRendering&&console.warn("Renderer.modify called while rendering"),!!super.commit(e,t,this._plugins.context)&&(this.updateHasFlags(),!0)}rendererAdded(e){this._plugins.add(e)}rendererRemoved(e){this._plugins.remove(e)}get occludedRequiresStencil(){return this.occludedRequiresOccludeeStencil||this.occludedRequiresIntegratedMeshStencil}get occludedRequiresOccludeeStencil(){return this._bindParameters.hasOccludees&&!!(8&this.plugins.renderOccludedFlags)}get occludedRequiresIntegratedMeshStencil(){return this._plugins.produces(0,0)&&this._plugins.produces(0,10)}updateHasFlags(){const has=this._pluginsHas;has.hudElements=this._plugins.produces(0,...Pe),has.water=this._plugins.produces(2,20),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new k(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation);const r=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==r&&(this._gpuTimerHandle=r?a(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get _animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}tick(){this.fboCache.clean()}render(e,t,r,i=!1){try{return this._isRendering=!0,this._render(e,t,r,i)}catch(s){console.error(`Exception during rendering: ${s}`)}finally{this._isRendering=!1}return new ne(this._pluginInput.get(I.FINAL),null)}_render(e,t,r,i){const s=0===r;this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=s,this._disposeBindBuffers();const{camera:a,contentCamera:n,mode:h,alignPixelEnabled:o}=e;this._state.value=h;const d=this._nodes.produces("magnifier-color"),_=this._nodes.produces(I.FINAL);this._renderContext.time=t,this._renderContext.output=0,this._bindParameters.hasEmission=this.hasEmitters,this._bindParameters.oitPass=0,this._bindParameters.alignPixelEnabled=o,this._bindParameters.decorations=!i,this._bindParameters.mainDepth=null;const l=!i||!this._sliceHelper.isDecoration;this._bindParameters.slicePlane=l?this._sliceHelper.plane:null,this._bindParameters.viewshedEnabled=this._nodes.produces(R.VIEWSHED),this._bindParameters.cutFillEnabled=this._nodes.produces(R.CUTFILL_DEPTH),this._renderOverlay(),a.setGLViewport(this._rctx);const u=this._framebuffer,p=u.initialize(a.fullWidth,a.fullHeight,this._backgroundColor,this._bindParameters.hasEmission);this.hasReflections?(p?.setName("last frame color"),this._bindParameters.ssr.lastFrameColor=p):p?.release(),this._ensureBindParametersCamera(a,n),this._updateHUDOccludedFragmentOpacity(h,t),this._plugins.prepareRender(),this._bindParameters.shadowHighlightsVisible=this._needsShadowHighlight&&!i;const m=this._plugins.produces(0,...me);this._precompilePrepasses(),this.performanceInfo.advance(oe.PREPARE);const c=this._computeShadowDepthRange(a);this._renderShadowMap(a,this._bindParameters.lighting.mainLight.direction,c),this._pluginInput.set("normals",this._renderNormals()),this._renderRemainingGeometryDepth(),this._renderShadowAccumulation(c,a,n,!s),this._ensureBindParametersSSR(t),this._precompileShaders(m),this._renderContext.output=0,u.bind(),this._bindParameters.mainDepth=u.depth.attachment,this._renderOpaque(),this._renderTransparent(m),this._shadowMap.disposeMainBuffer(),this._pluginInput.set(R.FOCUSAREA,this._renderFocusAreaGeometry()),this._pluginInput.set(R.CUTFILL_DEPTH,this._renderCutFillDepth()),u.update(e=>this._renderNodes(R.TRANSPARENT_ENVIRONMENT,e)),u.update(e=>this._renderNodes(R.VIEWSHED,e)),u.update(e=>this._renderNodes(R.LASERLINES,e)),u.update(e=>this._renderNodes(R.FOCUSAREA_COLOR,e)),this._pluginInput.release(R.FOCUSAREA),this._pluginInput.release(R.CUTFILL_DEPTH),u.update(e=>this._renderNodes(R.OCCLUDED,e)),this._pluginInput.set("highlights",this._renderHighlightPrepass()),this._renderHighlightShadowMap(a,this._bindParameters.lighting.mainLight.direction,c);const f=2===r?this._renderObjectAndLayerIdColor():null;u.update(e=>this._renderNodes(I.COMPOSITE,e)),this._shadowMap.disposeOffscreenBuffers();const g=s&&!_&&!(d&&!i),b=this._pluginInput.get(I.COMPOSITE),P=g?v:this.fboCache.acquire(b.fbo.width,b.fbo.height,R.ANTIALIASING),C=this._nodes.produces(R.ANTIALIASING)?this._renderNodes(R.ANTIALIASING,P):this.blitFBO(b,P,!1);let w;this._pluginInput.set(R.ANTIALIASING,C),this._hasHUDHighlights?(this._renderHUD(1,C),w=this._renderNodes(R.HIGHLIGHTS,C)):(w=this._renderNodes(R.HIGHLIGHTS,C),this._renderHUD(1,w));const T=this._renderNodes(R.MAGNIFIER,w);return s&&d&&!i&&!_&&this.blitFBO(T),_?(T.attachDepth(u.depth),this.blitFBO(this._renderNodes(I.FINAL,T)),T.detachDepth()):this._pluginInput.set(I.FINAL,T),this._pluginInput.release("highlights"),this.onPostRender&&this.onPostRender(),this._releaseFBOs(),u.releaseDepth(),this._renderContext.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd(),this.performanceInfo.finishFrame(),s||(this._releaseFBOs(),this._disposeOffscreenBuffers()),new ne(this._pluginInput.get(I.FINAL),f)}_precompileShaders(e){++this._plugins.context.techniques.precompiling,this._renderContext.output=0,this._precompileOpaqueGeometry(),this._nodes.precompile(R.OPAQUE_ENVIRONMENT),this._bindParameters.terrainDepthTest=this._bindParameters.cullAboveTerrain=this._needsTerrainDepth,this._renderContext.output=1,this._plugins.precompile(...ce),this._needsTerrainDepth&&(this._precompileOpaqueGeometry(),this._precompileTransparentGeometry()),this._renderContext.output=0,this._plugins.precompile(...ce),e&&(this._precompileTransparentGeometry(),this._hasPhotoshopTerrain&&(this._bindParameters.cullAboveTerrain=!1,this._precompileTransparentGeometry(),this._bindParameters.cullAboveTerrain=this._needsTerrainDepth)),this._nodes.precompile(R.FOCUSAREA),this._needsHUDVisibility&&this._plugins.precompile(13),this._plugins.precompile(16),this._precompileHUD(0),this._bindParameters.terrainDepthTest=!1,this._bindParameters.cullAboveTerrain=!1,this._nodes.precompile(R.VIEWSHED,R.CUTFILL_DEPTH,R.CUTFILL_COLOR,R.LASERLINES,R.FOCUSAREA_COLOR,R.OCCLUDED,R.ANTIALIASING,R.HIGHLIGHTS);const t=this._bindParameters;t.highlightMixTexture=t.highlights.length>1?this._rctx.emptyTexture:null,this._precompileHUD(1),this._hasHighlights&&(t.highlights.forEach((e,r)=>{t.highlightLevel=r,this._precompileAllGeometry(8)}),t.highlightLevel=null),t.highlightMixTexture=null,this._nodes.precompile(I.COMPOSITE,R.MAGNIFIER),this._shadowAccumulator.precompile(),this._plugins.precompile(9),--this._plugins.context.techniques.precompiling}_renderFocusAreaGeometry(){const e=this._nodes.produce(R.FOCUSAREA,this._pluginInput);return e&&this.performanceInfo.advance(oe.FOCUS_AREA_MASK),e}_renderObjectAndLayerIdColor(){if(!this._nodes.produces("olid"))return null;const e=this._renderContext.output;++this._techniques.precompiling;const t=this._framebufferSize;let r=this.fboCache.acquire(t.width,t.height,"olid");return r.acquireDepth(14),r=this._nodes.render(r,this._pluginInput),--this._techniques.precompiling,this.performanceInfo.advance(oe.OBJECT_AND_LAYER_ID_COLOR),this._renderContext.output=e,r}finish(e){this._hasAnimations||this._animationTimestep.clear();const t=this.performanceInfo.gpuSamplingEnabled,r=0===e;if(r||t){const e=r?this.performanceInfo.elapsedTime:0;let i=0;t?i=this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.finish();const s=Math.max(e,i);this._animationTimestep.frame(s,r)}}readMainDepth(e,t){const{mainDepth:r,camera:i}=this._bindParameters;if(!r)return;const s=this.fboCache.acquire(this._framebufferSize.width,this._framebufferSize.height,"linear depth");this._rctx.bindFramebuffer(s.fbo),i.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(A),this._compositingHelper.blitDepthToLinearDepth(this._bindParameters,r),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),s.fbo?.readPixels(e[0],e[1],e[2],e[3],6408,de.UNSIGNED_BYTE,t),s.release()}readHUDVisibility(e,t,r,i,s){this._bindParameters.hudVisibility?.fbo?.readPixels(e,t,r,i,6408,de.UNSIGNED_BYTE,s)}readAccumulatedShadow(e){return this._shadowAccumulator.readAccumulatedShadow(e[0],e[1])}_renderEdges(e){const t=this._edgeView;if(!t?.shouldRender())return;const r=this._framebufferSize,i=this.fboCache.acquire(r.width,r.height,"edges"),s=this._bindParameters.geometryDepth,a=()=>t.render(this._bindParameters,e);this.renderToTargets(a,i,s??this._framebuffer.depth,A),this._framebuffer.bind(),this._compositingHelper.composite(this._bindParameters,i.getTexture()),i.release(),this.performanceInfo.advance(1===e?oe.OPAQUE_EDGES:oe.TRANSPARENT_EDGES)}_renderOverlay(){this._bindParameters.overlay=this.overlay?.render(this._renderContext.time),this._bindParameters.overlay&&this.performanceInfo.advance(oe.OVERLAY)}_renderShadowMap(e,t,r){if(!this.shadowsEnabled)return;const i=this._shadowMap;i.start(e,t,r,this.isFeatureEnabled(7),this.stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight?(this._renderShadowCascades(5,this._shadowMap),i.copySnapshot(1),this._renderShadowCascades(4,this._shadowMap)):this._renderShadowCascades(3),i.finish(),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,this._bindParameters.contentCamera),this.performanceInfo.advance(oe.SHADOW_MAP)}_renderHighlightShadowMap(e,t,r){if(!this.shadowsEnabled||!this._needsShadowHighlight)return;const i=this._shadowMap;i.start(e,t,r,this.isFeatureEnabled(7),this.stage.view.qualitySettings.maximumPixelRatio),this._renderShadowCascades(4,this._shadowMap),i.moveSnapshot(0),i.finish(),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,this._bindParameters.contentCamera),this.performanceInfo.advance(oe.SHADOW_MAP)}_renderCutFillDepth(){return this._nodes.produce(R.CUTFILL_DEPTH,this._pluginInput)}_precompileShadowCascades(e){0!==this._shadowMap.cascades.length&&this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._shadowMap){t.bindFbo();for(const r of t.cascades)r.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(r.camera,r.camera),this.renderAllGeometry(e)}get _needsDepth(){return this._plugins.consumes(1)||this._nodes.requireGeometryDepth()||this.hasReflections||this._needsShadowHighlight||this._shadowAccumulator.active||this._debugNeedsDepth}_renderRemainingGeometryDepth(){const e=this._pluginInput.get("normals");e?(this._pluginInput.set(R.SSAO,this._renderSSAO()),this._needsDepth?(this._rctx.bindFramebuffer(e.fbo),this._rctx.clear(1024),this._renderGeometryWithoutNormals(1),this._bindParameters.depth?.release(),this._bindParameters.depth=e.obtainDepthTexture(),this.performanceInfo.advance(oe.DEPTH)):(e.detachDepth(),this._bindParameters.depth=o(this._bindParameters.depth)),this.hasSSAO&&this._pluginInput.release("normals")):this._renderAllGeometryDepth()}_renderAllGeometryDepth(){if(this._bindParameters.depth=o(this._bindParameters.depth),!this._needsDepth)return;const e=this._framebufferSize,t=this.fboCache.acquire(e.width,e.height,"geometry depth",14);this._rctx.bindFramebuffer(t.fbo),this._rctx.clear(1280),this.renderAllGeometry(1),this._bindParameters.depth=t.obtainDepthTexture(),t.release(),this.performanceInfo.advance(oe.DEPTH)}_renderTerrainDepth(){if(this._bindParameters.terrainDepth=o(this._bindParameters.terrainDepth),this._bindParameters.terrainDepthTest=this._bindParameters.cullAboveTerrain=this._needsTerrainDepth,!this._needsTerrainDepth)return;const e=this._renderContext.output;this._renderContext.output=1;const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"terrain depth",14);this._rctx.bindFramebuffer(r.fbo),this._rctx.clear(1280),this._renderTransparentGround(),this._bindParameters.terrainDepth=r.obtainDepthTexture(),r.release(),this._renderContext.output=e}_renderGeometryDepth(){if(this._bindParameters.geometryDepth=o(this._bindParameters.geometryDepth),!this._needsTerrainDepth)return;const e=this._renderContext.output,{width:t,height:r}=this._framebufferSize,i=this.fboCache.acquire(t,r,"geometry depth",14);this._rctx.bindFramebuffer(i.fbo),this._rctx.clear(1280),this._renderOpaqueAndTransparentGeometry(1),this._renderContext.output=e,this._bindParameters.geometryDepth=i.obtainDepthTexture(),i.release()}get _needsShadowDepthRange(){return this._shadowMap.enabled||this._shadowAccumulator.active}_computeShadowDepthRange(e){if(!this._needsShadowDepthRange)return Q.Zero;const t=Y(e,this._plugins.plugins,this.stage.layers,0);return t.union(this._plugins.queryDepthRange(e)),t.near=Math.max(e.near,t.near),t.far=Math.min(e.far,t.far),t}updateSceneDepthRange(e){if(!this.stage.view.state.isGlobal)return void(this.sceneDepthRange.value=Q.Infinite);if((this.stage.view.renderCoordsHelper?.getAltitude(e.eye)??0)<y)return void(this.sceneDepthRange.value=Q.Infinite);const t=e.clone();t.near=O,t.far=1e10;const r=Y(t,this._plugins.plugins,this.stage.layers,1);r.union(this._plugins.queryDepthRange(t)),this.sceneDepthRange.value.equals(r)||(this.sceneDepthRange.value=r)}get _normalsRequired(){const e=this._nodes.require("normals",I.FINAL,I.COMPOSITE,I.OPAQUE,I.TRANSPARENT,R.VIEWSHED,R.LASERLINES);return(this.hasSSAO?1:0)+e}_updateHUDOccludedFragmentOpacity(e,t){const{idleOpacity:r,navigatingOpacity:a,maxDelta:n,tiltFadeStart:h,tiltFadeEnd:o,altitudeStart:d,altitudeEnd:_}=Z,l=this.stage.view,u=l.stateManager.camera,p=l.qualitySettings.fadeDuration,m=2===e?r:a,c=i((u.tilt-h)/(o-h),0,1),f=i(((u.position.z??0)-d)/(_-d),0,1),g=s(s(1,m,c),1,f),b=this._bindParameters.hudOccludedFragmentOpacity;if(p<=0||b===g||0===this._lastFrameTime||this._lastFrameTime>t)return this._bindParameters.hudOccludedFragmentOpacity=g,void(this._lastFrameTime=t);const P=t-this._lastFrameTime;this._lastFrameTime=t;const C=Math.max(1-r,Math.abs(r-a)),w=Math.min(C*P/p,n);w>=Math.abs(g-b)?this._bindParameters.hudOccludedFragmentOpacity=g:(this._bindParameters.hudOccludedFragmentOpacity=b+Math.sign(g-b)*w,this._requestRender())}_precompilePrepasses(){this._normalsRequired&&this._precompileAllGeometry(2),this._needsDepth&&this._precompileAllGeometry(1),this.shadowsEnabled&&(this._needsShadowHighlight?(this._precompileShadowCascades(4),this._precompileShadowCascades(5)):this._precompileShadowCascades(3)),this._shadowAccumulator.active&&this._precompileAllGeometry(3)}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"normals",5);r.acquireDepth(14),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer(A,!0,!0),this._renderContext.output=2,this._plugins.render(...fe);const i=this._nodes.optional("normals",I.FINAL,I.COMPOSITE,I.OPAQUE,I.TRANSPARENT,R.VIEWSHED);return r.retain(e+i-1),this.performanceInfo.advance(oe.NORMALS),r}_renderSSAO(){const e=this._pluginInput.get("normals");if(!this.hasSSAO||!e)return;const t=this._nodes.produce(R.SSAO,this._pluginInput);return this._bindParameters.ssao=t,t&&this.performanceInfo.advance(oe.SSAO),t}_precompileAllGeometry(e){const t=this._renderContext.output;this._renderContext.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(...ce),this._renderContext.output=t}renderAllGeometry(e){this._renderContext.output=e,this._renderOpaqueAndTransparentGeometry(e),this._renderTransparentGround()}precompileSlots(e,...t){for(const r of t)this._bindParameters.slot=r,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(const r of t)this._renderContext.renderOccludedMask=r,this.precompileSlots(e,...be);this._renderContext.renderOccludedMask=X}renderSlots(e,...t){for(const r of t)this._bindParameters.slot=r,e.forAll(e=>{const t=e.acquireTechniques(this._renderContext);t&&e.render(this._renderContext,t)})}renderOccludedSlots(e,t){this._renderContext.renderOccludedMask=t,this.plugins.renderOccludedFlags>1&&this._plugins.render(10),this.renderSlots(e,...be),this._renderContext.renderOccludedMask=X}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(14)}precompileViewshedShadowMap(){this._precompileAllGeometry(6)}precompileCutFill(){const e=7,t=this._renderContext.output;this._renderContext.output=e,this._plugins.precompile(0,1,...ce),this._renderContext.output=t}renderViewshedShadowMap(e){const{camera:t,contentCamera:r}=this._bindParameters,i=this._renderContext.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(6),this._ensureBindParametersCamera(t,r),this._bindParameters.camera.setGLViewport(this._rctx),this._renderContext.output=i}renderCutFillReferenceDepth(e){const{camera:t,contentCamera:r}=this._bindParameters,i=this._renderContext.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this._renderContext.output=7,this._plugins.render(0,1,...ce),this._ensureBindParametersCamera(t,r),t.setGLViewport(this._rctx),this._renderContext.output=i}_renderOpaqueAndTransparentGeometry(e){this._renderContext.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithoutNormals(e){this._renderContext.output=e,this._plugins.render(...ge)}_precompileOpaqueGeometry(){this._plugins.precompile(...pe),this._nodes.precompile("opaque-color")}_renderOpaqueGeometry(){this._plugins.render(...pe)}_renderTransparentGeometry(){this._plugins.render(...me)}get _hasPhotoshopTerrain(){return this._plugins.produces(0,6)}get _needsTerrainDepth(){return this._highQualityTransparency&&this._hasPhotoshopTerrain}_renderPhotoshopTerrain(){if(!this._hasPhotoshopTerrain)return null;const e=this._framebufferSize,t=this.fboCache.acquire(e.width,e.height,"transparent terrain");return this.renderToTargets(()=>this._plugins.render(6),t,this._framebuffer.depth,A),this.performanceInfo.advance(oe.TRANSPARENT_TERRAIN),t}_renderTransparentGround(){this._plugins.render(...ce)}get _needsHUDVisibility(){return this._plugins.produces(this._renderContext.output,13)}_renderHUDVisibility(){if(!this._needsHUDVisibility)return void(this._bindParameters.hudVisibility=o(this._bindParameters.hudVisibility));const{width:e,height:t}=this._framebufferSize;let r=this._bindParameters.hudVisibility;r?.fbo?.width===e&&r?.fbo?.height===t||(r?.release(),r=this.fboCache.acquire(e,t,"hud visibility",4),this._bindParameters.hudVisibility=r);const i=this._bindParameters.geometryDepth;r.attachDepth(i||this._framebuffer.depth),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer([0,1,0,1]),this._plugins.render(13),r.detachDepth(),this._framebuffer.bind(),this.performanceInfo.advance(oe.HUD_VISIBILITY)}_renderLineCallouts(e){if(this._bindParameters.hudRenderStyle=e,0===e){const e=()=>this._plugins.render(16),t=this._framebufferSize,r=this.fboCache.acquireDepth(13,t.width,t.height,"line callouts");this.renderToTargets(e,this._framebuffer.color,r,void 0,!0,!0),r.release()}else this._plugins.render(16)}_precompileHUD(e){if(this._precompileHUDOutput(e),this._hasHighlights){const t=this._renderContext.output;this._renderContext.output=8,this._precompileHUDOutput(e),this._renderContext.output=t}}_precompileHUDOutput(e){const t=this._bindParameters.hudRenderStyle;this._bindParameters.hudRenderStyle=e,this._oitEnabled&&N(this._renderContext.output)?(this._bindParameters.oitPass=1,this._plugins.precompile(...Pe),this._bindParameters.oitPass=2,this._plugins.precompile(...Pe),this._bindParameters.oitPass=0):this._plugins.precompile(...Pe),this._bindParameters.hudRenderStyle=t}_renderHUD(e,t){if(this._pluginsHas.hudElements){if(this._oitEnabled){const r=this._renderOIT(1,e);this._rctx.bindFramebuffer(t.fbo),this._compositingHelper.compositePreMultipliedAlpha(this._bindParameters,r.getTexture(),!1),r.release()}else if(this._renderContext.output=0,0===e){const t=()=>this._renderHUDElements(e),r=this._framebufferSize,i=this.fboCache.acquireDepth(13,r.width,r.height,"hud");this.renderToTargets(t,this._framebuffer.color,i,void 0,!0,!0),i.release()}else t.acquireDepth(13),this._rctx.bindFramebuffer(t.fbo),this._renderHUDElements(e),t.detachDepth();this.performanceInfo.advance(0===e?oe.HUD_OCCLUDED:oe.HUD)}}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(...Pe)}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(4,2)}_renderHighlightPrepass(){if(!this._hasHighlights)return;const{fboCache:e,_rctx:t,_bindParameters:r}=this,i=this._framebufferSize,{highlights:s}=r,a=e.acquire(i.width,i.height,"highlights",s.length>V?3:1);a.acquireDepth(14);const n=this._plugins.produces(8,0);return n&&this._framebuffer.color.fbo&&a.fbo&&t.blitFramebuffer(this._framebuffer.color.fbo,a.fbo,1024),t.bindFramebuffer(a.fbo),t.gl.clearBufferuiv(6144,0,[0,0,0,0]),n||t.clear(1024),this._renderContext.output=8,t.bindFramebuffer(a.fbo),j(t,e,i,r,()=>this._renderHighlightGeometries()),a.detachDepth(),this.performanceInfo.advance(oe.HIGHLIGHTS),a}_renderHighlightGeometries(){this._plugins.render(...Ce),this._rctx.clear(256),this._renderHUDElements(2)}_renderShadowAccumulation(e,t,r,i){this._shadowAccumulator.updateDepthRange(e),this._shadowAccumulator.accumulating&&this._bindParameters.depth&&this._shadowAccumulator.renderAccumulation(this._bindParameters.depth,t,r,i)&&this.performanceInfo.advance(oe.ACCUMULATED_SHADOWS)}_precompileTransparentGeometry(){this._oitEnabled&&N(this._renderContext.output)?(this._bindParameters.oitPass=1,this._plugins.precompile(...me),this._bindParameters.oitPass=2,this._plugins.precompile(...me),this._bindParameters.oitPass=0):this._plugins.precompile(...me)}_renderOIT(e,t=2){const r=1===e,i=this._framebufferSize,s=r?()=>this._renderHUDElements(t):()=>this._renderTransparentGeometry(),a=this._bindParameters,n=this._renderContext.output;this._renderContext.output=0,a.oitPass=1;const h=r?"oit hud":"oit",o=this.fboCache.acquire(i.width,i.height,h,8),d=this._bindParameters.hasEmission;d&&o.acquireColor(_e,8,"oit emissive"),o.acquireColor(d?le:_e,7,"oit alpha"),r||o.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(o.fbo),this._rctx.clearFramebuffer([0,0,0,1]),d&&this._rctx.clearBuffer(1,E),s(),o.detachDepth(),a.oitPass=2;const _=this.fboCache.acquire(i.width,i.height,r?"oit hud front":"oit front");let l;return d&&_.acquireColor(_e,8,"oit emissive front"),r?_.acquireDepth(13):_.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(_.fbo),this._rctx.clearFramebuffer(A,r),s(),_.detachDepth(),a.oitPass=0,r?(l=this.fboCache.acquire(i.width,i.height,"oit hud composite"),this._rctx.bindFramebuffer(l.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(16384)):this._framebuffer.bind(),this._oitBlend??=new B(this._techniques),this._oitBlend.blend(this._rctx,o,_,a,d,!r),l?.detachDepth(),_.release(),o.release(),this._renderContext.output=n,l}_renderOpaque(){const e=this.plugins.produces(0,...pe);if(e){this._plugins.render(0,1);const e=this._framebuffer;e.update(e=>this._renderNodes(R.CUTFILL_COLOR,e)),e.update(e=>this._renderNodes(R.OPAQUE_TERRAIN,e)),e.bind(),this._plugins.render(2,3)}const t=this._framebuffer;this._renderTerrainDepth(),t.update(t=>this._renderNodes(I.OPAQUE,t,e)),this.fboCache.debugCallback?.(I.OPAQUE,t.color.fbo),t.update(e=>this._renderNodes(R.OPAQUE_ENVIRONMENT,e)),this.fboCache.debugCallback?.(R.OPAQUE_ENVIRONMENT,t.color.fbo),this._renderEdges(1)}_renderTransparent(e){const t=this._framebuffer;t.bind(),this._renderPlugins(21,oe.VOXEL),this._renderHiddenTransparentEdges(),e&&(this._oitEnabled?this._renderOIT(0):this._renderTransparentGeometry()),t.update(t=>this._renderNodes(I.TRANSPARENT,t,e)),this.fboCache.debugCallback?.(I.TRANSPARENT,t.color.fbo),this._renderGeometryDepth(),this._renderHUDVisibility(),this._needsTerrainDepth||this._plugins.render(16),this._renderEdges(0);const r=this._renderPhotoshopTerrain(),i=r?.getTexture();i&&this._bindParameters.hudVisibility&&(this._needsTerrainDepth?this._renderLineCallouts(0):(this._rctx.bindFramebuffer(this._bindParameters.hudVisibility?.fbo),this._compositingHelper.compositeHUD(this._bindParameters,i)),this._renderHUD(0,t.color)),this._bindParameters.cullAboveTerrain=!1,i&&(t.bind(),this._compositingHelper.compositePreMultipliedAlpha(this._bindParameters,i),r?.release(),this._needsTerrainDepth&&(this._renderEdges(1),e&&(this._oitEnabled?this._renderOIT(0):this._renderTransparentGeometry(),this.performanceInfo.advance(oe.TRANSPARENT)),this._renderEdges(0))),this._bindParameters.ssao=o(this._bindParameters.ssao),this._needsTerrainDepth&&this._renderLineCallouts(1),this._bindParameters.terrainDepthTest=!1,this._renderTransparentEnvironment()}_renderTransparentEnvironment(){this._shadowAccumulator.render(this._bindParameters),this.performanceInfo.advance(oe.APPLY_ACCUMULATED_SHADOWS),this._framebuffer.bind(),this._plugins.render(9),this.performanceInfo.advance(oe.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderPlugins(e,t){this._plugins.produces(this._renderContext.output,e)&&(this._plugins.render(e),this.performanceInfo.advance(t))}_renderNodes(e,t,r=!1){if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return r&&this.performanceInfo.advance(e),t;const i=this._nodes.render(t,this._pluginInput,this._releaseNormals);return this.performanceInfo.advance(e),i}blitFBO(e,t=v,r=!0){return this._blit??=new U(this._techniques),this._blit.blit(this._rctx,e,t,this._bindParameters),this._pluginInput.set(e.name,t),r&&e.release(),t}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersSSR(e){if(this._bindParameters.ssr.lastFrameColor){null==this._ssrEnableTime&&(this._ssrEnableTime=e),this._renderContext.lastFrameCamera.equals(this._bindParameters.camera)?this._reprojectionMatrix=w:(P(Te,this._bindParameters.camera.viewMatrix),P(we,this._bindParameters.camera.projectionMatrix),C(Se,Te,we),C(Se,this._renderContext.lastFrameCamera.viewMatrix,Se),C(Se,this._renderContext.lastFrameCamera.projectionMatrix,Se),this._reprojectionMatrix=Se);const t=this.stage.view.qualitySettings.fadeDuration;this._bindParameters.ssr.fadeFactor=t>0?Math.min(t,e-this._ssrEnableTime)/t:1,this._bindParameters.ssr.fadeFactor<1&&this._requestRender()}else this._reprojectionMatrix=w,this._ssrEnableTime=null}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,r,i){this._bindParameters.updateLighting(e,t,r,i),this._requestRender(1)}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0}}renderToTargets(e,t,r,i,s=!1,a=!1){t.attachDepth(r),this._rctx.bindFramebuffer(t.fbo),this._rctx.clearFramebuffer(i,s,a),e(),t.detachDepth()}get test(){}};e([f({readOnly:!0})],ue.prototype,"highResolutionAtmosphere",null),e([f()],ue.prototype,"_edgeView",void 0),e([f()],ue.prototype,"updating",null),ue=e([g("esri.views.3d.webgl-engine.lib.Renderer")],ue);const pe=[0,1,2,3],me=[7,8,4,5],ce=[6,7,8],fe=[0,1,2,4,...ce],ge=[3,5],be=[2,4,9],Pe=[17,14,15],Ce=[4,5,2,3,0,1,...ce],we=T(),Te=T(),Se=T();function Ee(e){return t=>e.immediate.schedule(t)}export{ue as Renderer};
5
+ import{__decorate as e}from"tslib";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as r}from"../../../../core/asyncUtils.js";import"../../../../core/has.js";import{clamp as i,lerp as s}from"../../../../core/mathUtils.js";import{removeMaybe as a,abortMaybe as n,destroyMaybe as h,releaseMaybe as o}from"../../../../core/maybe.js";import{throwIfAborted as d}from"../../../../core/promiseUtils.js";import{watch as _,syncAndInitial as l,initial as u,sync as p}from"../../../../core/reactiveUtils.js";import{signal as m}from"../../../../core/signal.js";import{Milliseconds as c}from"../../../../core/time.js";import{property as f,subclass as g}from"../../../../core/accessorSupport/decorators.js";import{equals as b,invert as P,multiply as C}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as w,create as T}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{c as S}from"../../../../chunks/vec42.js";import{ZEROS as E}from"../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import{fromValues as x,ZEROS as A}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as D}from"../../../../geometry/support/Indices.js";import{RenderCategory as I,InternalRenderCategory as R}from"../../webgl.js";import{innerAtmosphereFadeStart as y}from"../../environment/atmosphereUtils.js";import{minNearDistanceInMeters as O}from"../../state/NearFarHeuristic.js";import{debugFlags as F}from"../../support/debugFlags.js";import{FBOCache as H,defaultWebGLFBO as v}from"../core/FBOCache.js";import{RenderPassManager as M}from"../core/renderPasses/RenderPassManager.js";import{isColor as N}from"../core/shaderLibrary/ShaderOutput.js";import{distanceFadeEnd as q}from"../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{RenderNodes as G}from"../effects/RenderNodes.js";import{RenderPluginManager as L}from"../effects/RenderPluginManager.js";import{Blit as U}from"../effects/blit/Blit.js";import{maxHighlightsPerChannel as V,renderHighlightBuffer as j}from"../effects/highlight/Highlight.js";import{OITBlend as B}from"../effects/transparency/OITBlend.js";import{AnimationTimer as k}from"./AnimationTimer.js";import{AnimationTimeStep as z}from"./AnimationTimeStep.js";import{BoundingInfo as W}from"./BoundingInfo.js";import{DepthRange as Q}from"./DepthRange.js";import{depthRangeFromScene as Y}from"./depthRangeUtils.js";import{hudFragmentOpacityParameters as Z}from"./hudFragmentOpacityParameters.js";import{MainFramebuffer as J}from"./MainFramebuffer.js";import{RenderContext as K,defaultRenderOccludedMask as X}from"./RenderContext.js";import{RendererBase as $}from"./RendererBase.js";import{setupFeatureDefaults as ee}from"./RenderFeature.js";import{RenderPluginInput as te}from"./RenderPluginInput.js";import{ShadowAccumulator as re}from"./ShadowAccumulator.js";import{ShadowMap as ie}from"./ShadowMap.js";import se from"./SliceHelper.js";import{MergedRenderer as ae}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as ne}from"../parts/renderUtils.js";import{RendererPerformanceInfo as he,PerformanceCategory as oe}from"../statistics/RendererPerformanceInfo.js";import{PixelType as de,ColorAttachment1 as _e,ColorAttachment2 as le}from"../../../webgl/enums.js";let ue=class extends ${constructor(e,t,r,i,s,a){super({stage:e}),this._techniques=r,this._rctx=i,this._compositingHelper=s,this._requestRender=a,this._pluginsHas={hudElements:!1,water:!1},this.renderPassManager=new M,this._isRendering=!1,this._inGlobeView=!1,this._backgroundColor=x(0,0,0,1),this._sliceHelper=new se,this.sceneDepthRange=m(Q.Infinite),this._state=m(2),this._hasAnimations=!1,this._animationTimestep=new z,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=m(0),this._lastFrameTime=c(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new te,this._releaseNormals=e=>{e.some(({name:e})=>"normals"===e)&&this._pluginInput.release("normals")},this._debugNeedsDepth=!1,this._fboCache=new H(i),this._renderStateFeatures=m(ee(e.view.qualityProfile)),this._framebuffer=new J(this.fboCache),this._performanceInfo=new he(this._rctx),this._shadowMap=new ie(this.fboCache,e.viewingMode),this._shadowAccumulator=new re(this.fboCache,r,e,e=>{const t=this.shadowsEnabled;this._shadowMap.enabled=!0,this._ensureBindParametersCamera(e.camera,e.contentCamera),this._plugins.prepareRender(),this._shadowMap.enabled=t},(t,r,i)=>{const s=e.view.qualitySettings.maximumPixelRatio;t.shadowMap.start(t.camera,r,i,!0,s),this._renderShadowCascades(3,t.shadowMap),t.shadowMap.finish(),t.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(t.camera,t.contentCamera)},a),this._renderContext=new K(this._rctx,this._shadowMap,r),this._nodes=new G(this._renderContext),this._plugins=new L({renderContext:this._renderContext,techniques:r,materials:t,requestRender:a,controller:e,fbos:this.fboCache,isFeatureEnabled:e=>this.isFeatureEnabled(e)}),this._plugins.add(this.renderPassManager),this.addHandles([_(()=>e.view.state.camera,()=>a(),l),_(()=>F.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES,e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(0):()=>{},a()},u),_(()=>e.view.environment.background?.color,e=>{const t=e?e.toUnitRGBA():A;S(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),a()},l),_(()=>e.view.state.camera.relativeElevation,e=>this._inGlobeView=(e??1/0)>=q,l),_(()=>this._bindParameters.clouds.fadeFactor,()=>{this._bindParameters.fadeLighting(),this._requestRender(2)},p),_(()=>this._bindParameters.clouds.data?.state,()=>a(),p),_(()=>e.view.state.highlights,e=>{this._bindParameters.highlights=e,a()},u)])}destroy(){this._gpuTimerHandle=a(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowMap.dispose(),this._shadowAccumulator.destroy(),this._shadowAccumulator=null,this._loadEdgeViewTask=n(this._loadEdgeViewTask),this._edgeView=h(this._edgeView),this.renderPassManager.dispose(),this._releaseFBOs(),this._disposeOffscreenBuffers(),this._fboCache.destroy(),this._fboCache=null,this._plugins.destroy(),this._plugins=null,this._pluginInput=null,this._blit=null,this._oitBlend=null,this._compositingHelper=null,this._nodes=null,this._framebuffer=null,this._shadowMap=null,this._renderContext=null,this._performanceInfo=null,W.prune(),ae.prune(),D()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get _framebufferSize(){return this._framebuffer.size}get performanceInfo(){return this._performanceInfo}updateRenderFeatures(e){this._renderStateFeatures.value=ee(e),this._requestRender()}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,r){this._renderStateFeatures.mutate(i=>i.set(t,e,r)),this._requestRender()}get _highQualityTransparency(){return this.isFeatureEnabled(1)}get hasReflections(){return this._pluginsHas.water&&this.isFeatureEnabled(6)}get _hasHighlights(){return this._plugins.produces(8,2,4,19,14,15)}hasHighlight(e){return this._plugins.hasHighlight(e)}get _hasHUDHighlights(){return this._plugins.produces(8,14,15)}get hasSSAO(){return this.isFeatureEnabled(5)&&!this._inGlobeView}get hasSMAA(){return this.isFeatureEnabled(0)}get hasEmitters(){return this._plugins.hasEmitters&&this._hasFloatBufferBlendSupport}get highResolutionAtmosphere(){return this.isFeatureEnabled(4)}get fboCache(){return this._fboCache}_releaseFBOs(){this._bindParameters.ssr.lastFrameColor=o(this._bindParameters.ssr.lastFrameColor),this._bindParameters.terrainDepth=o(this._bindParameters.terrainDepth),this._bindParameters.geometryDepth=o(this._bindParameters.geometryDepth)}_disposeOffscreenBuffers(){this._framebuffer.dispose(),this._disposeBindBuffers()}_disposeBindBuffers(){this._shadowMap.disposeOffscreenBuffers(),this._bindParameters.depth=o(this._bindParameters.depth),this._bindParameters.hudVisibility=o(this._bindParameters.hudVisibility)}get updating(){return this._loadEdgeViewTask&&!this._loadEdgeViewTask.finished||this._edgeView?.updating||this._shadowAccumulator.readyToRun||this._plugins.updating||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||(this._loadEdgeViewTask=r(async e=>{const{EdgeView:t}=await import("./edgeRendering/EdgeView.js");d(e);const r=this._edgeView=new t({rctx:this._rctx,renderSR:this.stage.view.renderSpatialReference,viewingMode:this.stage.view.stage.viewingMode,techniques:this._techniques,setNeedsRender:()=>this._requestRender(),schedule:xe(this.stage.view.resourceController)});return this.addHandles(_(()=>r.updating,()=>this._requestRender(),p)),this._requestRender(),this._edgeViewCallbacks.forEach(e=>e(r)),this._edgeViewCallbacks.length=0,r})),this._loadEdgeViewTask.promise}withEdgeView(e){this.loadEdgeView(),null==this._edgeView?this._edgeViewCallbacks.push(e):e(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return this._reprojectionMatrixVersion.value>=0&&b(this._bindParameters.ssr.reprojectionMatrix,w)}set _reprojectionMatrix(e){t(this._bindParameters.ssr.reprojectionMatrix,e)&&this._reprojectionMatrixVersion.value++}get shadowsEnabled(){return!!this._shadowMap?.enabled}setParameters(e){const{_shadowMap:t,_bindParameters:r}=this;if(void 0!==e.shadowMap&&this._shadowMap.enabled!==e.shadowMap&&(this._shadowMap.enabled=e.shadowMap,this._requestRender()),void 0!==e.shadowMapMaxCascades&&t.maxCascades!==e.shadowMapMaxCascades&&(t.maxCascades=e.shadowMapMaxCascades,this._requestRender()),e.environment){void 0!==e.environment.weather&&(this._bindParameters.weather=e.environment.weather);const t="virtual"!==e.environment.lighting.type;r.enableFillLights!==t&&(r.enableFillLights=t,this._requestRender())}void 0!==e.shadowCast&&this._shadowAccumulator.setOptions(e.shadowCast)}set slice(e){this._sliceHelper.update(e)&&this._requestRender()}get plugins(){return this._plugins}get _hasFloatBufferBlendSupport(){return this._rctx.driverTest.floatBufferBlend.result}get _oitEnabled(){return this.isFeatureEnabled(2)&&this._hasFloatBufferBlendSupport}commit(e,t){return this._isRendering&&console.warn("Renderer.modify called while rendering"),!!super.commit(e,t,this._plugins.context)&&(this.updateHasFlags(),!0)}rendererAdded(e){this._plugins.add(e)}rendererRemoved(e){this._plugins.remove(e)}get occludedRequiresStencil(){return this.occludedRequiresOccludeeStencil||this.occludedRequiresIntegratedMeshStencil}get occludedRequiresOccludeeStencil(){return this._bindParameters.hasOccludees&&!!(8&this.plugins.renderOccludedFlags)}get occludedRequiresIntegratedMeshStencil(){return this._plugins.produces(0,0)&&this._plugins.produces(0,10)}updateHasFlags(){const has=this._pluginsHas;has.hudElements=this._plugins.produces(0,...Pe),has.water=this._plugins.produces(2,20),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new k(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation);const r=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==r&&(this._gpuTimerHandle=r?a(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get _animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}tick(){this.fboCache.clean()}render(e,t,r,i=!1){try{return this._isRendering=!0,this._render(e,t,r,i)}catch(s){console.error(`Exception during rendering: ${s}`)}finally{this._isRendering=!1}return new ne(this._pluginInput.get(I.FINAL),null)}_render(e,t,r,i){const s=0===r;this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=s,this._disposeBindBuffers();const{camera:a,contentCamera:n,mode:h,alignPixelEnabled:o}=e;this._state.value=h;const d=this._nodes.produces("magnifier-color"),_=this._nodes.produces(I.FINAL);this._renderContext.time=t,this._renderContext.output=0,this._bindParameters.hasEmission=this.hasEmitters,this._bindParameters.oitPass=0,this._bindParameters.alignPixelEnabled=o,this._bindParameters.decorations=!i,this._bindParameters.mainDepth=null;const l=!i||!this._sliceHelper.isDecoration;this._bindParameters.slicePlane=l?this._sliceHelper.plane:null,this._bindParameters.viewshedEnabled=this._nodes.produces(R.VIEWSHED),this._bindParameters.cutFillEnabled=this._nodes.produces(R.CUTFILL_DEPTH),this._renderOverlay(),a.setGLViewport(this._rctx);const u=this._framebuffer,p=u.initialize(a.fullWidth,a.fullHeight,this._backgroundColor,this._bindParameters.hasEmission);this.hasReflections?(p?.setName("last frame color"),this._bindParameters.ssr.lastFrameColor=p):p?.release(),this._ensureBindParametersCamera(a,n),this._updateHUDOccludedFragmentOpacity(h,t),this._plugins.sortTestsTransparentOrderedSlots(we),this._plugins.prepareRender(),this._bindParameters.shadowHighlightsVisible=this._needsShadowHighlight&&!i;const m=this._plugins.produces(0,...me);this._precompilePrepasses(),this.performanceInfo.advance(oe.PREPARE);const c=this._computeShadowDepthRange(a);this._renderShadowMap(a,this._bindParameters.lighting.mainLight.direction,c),this._pluginInput.set("normals",this._renderNormals()),this._renderRemainingGeometryDepth(),this._renderShadowAccumulation(c,a,n,!s),this._ensureBindParametersSSR(t),this._precompileShaders(m),this._renderContext.output=0,u.bind(),this._bindParameters.mainDepth=u.depth.attachment,this._renderOpaque(),this._renderTransparent(m),this._shadowMap.disposeMainBuffer(),this._pluginInput.set(R.FOCUSAREA,this._renderFocusAreaGeometry()),this._pluginInput.set(R.CUTFILL_DEPTH,this._renderCutFillDepth()),u.update(e=>this._renderNodes(R.TRANSPARENT_ENVIRONMENT,e)),u.update(e=>this._renderNodes(R.VIEWSHED,e)),u.update(e=>this._renderNodes(R.LASERLINES,e)),u.update(e=>this._renderNodes(R.FOCUSAREA_COLOR,e)),this._pluginInput.release(R.FOCUSAREA),this._pluginInput.release(R.CUTFILL_DEPTH),u.update(e=>this._renderNodes(R.OCCLUDED,e)),this._pluginInput.set("highlights",this._renderHighlightPrepass()),this._renderHighlightShadowMap(a,this._bindParameters.lighting.mainLight.direction,c);const f=2===r?this._renderObjectAndLayerIdColor():null;u.update(e=>this._renderNodes(I.COMPOSITE,e)),this._shadowMap.disposeOffscreenBuffers();const g=s&&!_&&!(d&&!i),b=this._pluginInput.get(I.COMPOSITE),P=g?v:this.fboCache.acquire(b.fbo.width,b.fbo.height,R.ANTIALIASING),C=this._nodes.produces(R.ANTIALIASING)?this._renderNodes(R.ANTIALIASING,P):this.blitFBO(b,P,!1);let w;this._pluginInput.set(R.ANTIALIASING,C),this._hasHUDHighlights?(this._renderHUD(1,C),w=this._renderNodes(R.HIGHLIGHTS,C)):(w=this._renderNodes(R.HIGHLIGHTS,C),this._renderHUD(1,w));const T=this._renderNodes(R.MAGNIFIER,w);return s&&d&&!i&&!_&&this.blitFBO(T),_?(T.attachDepth(u.depth),this.blitFBO(this._renderNodes(I.FINAL,T)),T.detachDepth()):this._pluginInput.set(I.FINAL,T),this._pluginInput.release("highlights"),this.onPostRender&&this.onPostRender(),this._releaseFBOs(),u.releaseDepth(),this._renderContext.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd(),this.performanceInfo.finishFrame(),s||(this._releaseFBOs(),this._disposeOffscreenBuffers()),new ne(this._pluginInput.get(I.FINAL),f)}_precompileShaders(e){++this._plugins.context.techniques.precompiling,this._renderContext.output=0,this._precompileOpaqueGeometry(),this._nodes.precompile(R.OPAQUE_ENVIRONMENT),this._bindParameters.terrainDepthTest=this._bindParameters.cullAboveTerrain=this._needsTerrainDepth,this._renderContext.output=1,this._plugins.precompile(...ce),this._needsTerrainDepth&&(this._precompileOpaqueGeometry(),this._precompileTransparentGeometry()),this._renderContext.output=0,this._plugins.precompile(...ce),e&&(this._precompileTransparentGeometry(),this._hasPhotoshopTerrain&&(this._bindParameters.cullAboveTerrain=!1,this._precompileTransparentGeometry(),this._bindParameters.cullAboveTerrain=this._needsTerrainDepth)),this._nodes.precompile(R.FOCUSAREA),this._needsHUDVisibility&&this._plugins.precompile(13),this._plugins.precompile(16),this._precompileHUD(0),this._bindParameters.terrainDepthTest=!1,this._bindParameters.cullAboveTerrain=!1,this._nodes.precompile(R.VIEWSHED,R.CUTFILL_DEPTH,R.CUTFILL_COLOR,R.LASERLINES,R.FOCUSAREA_COLOR,R.OCCLUDED,R.ANTIALIASING,R.HIGHLIGHTS);const t=this._bindParameters;t.highlightMixTexture=t.highlights.length>1?this._rctx.emptyTexture:null,this._precompileHUD(1),this._hasHighlights&&(t.highlights.forEach((e,r)=>{t.highlightLevel=r,this._precompileAllGeometry(8)}),t.highlightLevel=null),t.highlightMixTexture=null,this._nodes.precompile(I.COMPOSITE,R.MAGNIFIER),this._shadowAccumulator.precompile(),this._plugins.precompile(9),--this._plugins.context.techniques.precompiling}_renderFocusAreaGeometry(){const e=this._nodes.produce(R.FOCUSAREA,this._pluginInput);return e&&this.performanceInfo.advance(oe.FOCUS_AREA_MASK),e}_renderObjectAndLayerIdColor(){if(!this._nodes.produces("olid"))return null;const e=this._renderContext.output;++this._techniques.precompiling;const t=this._framebufferSize;let r=this.fboCache.acquire(t.width,t.height,"olid");return r.acquireDepth(14),r=this._nodes.render(r,this._pluginInput),--this._techniques.precompiling,this.performanceInfo.advance(oe.OBJECT_AND_LAYER_ID_COLOR),this._renderContext.output=e,r}finish(e){this._hasAnimations||this._animationTimestep.clear();const t=this.performanceInfo.gpuSamplingEnabled,r=0===e;if(r||t){const e=r?this.performanceInfo.elapsedTime:0;let i=0;t?i=this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.finish();const s=Math.max(e,i);this._animationTimestep.frame(s,r)}}readMainDepth(e,t){const{mainDepth:r,camera:i}=this._bindParameters;if(!r)return;const s=this.fboCache.acquire(this._framebufferSize.width,this._framebufferSize.height,"linear depth");this._rctx.bindFramebuffer(s.fbo),i.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(A),this._compositingHelper.blitDepthToLinearDepth(this._bindParameters,r),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),s.fbo?.readPixels(e[0],e[1],e[2],e[3],6408,de.UNSIGNED_BYTE,t),s.release()}readHUDVisibility(e,t,r,i,s){this._bindParameters.hudVisibility?.fbo?.readPixels(e,t,r,i,6408,de.UNSIGNED_BYTE,s)}readAccumulatedShadow(e){return this._shadowAccumulator.readAccumulatedShadow(e[0],e[1])}_renderEdges(e){const t=this._edgeView;if(!t?.shouldRender())return;const r=this._framebufferSize,i=this.fboCache.acquire(r.width,r.height,"edges"),s=this._bindParameters.geometryDepth,a=()=>t.render(this._bindParameters,e);this.renderToTargets(a,i,s??this._framebuffer.depth,A),this._framebuffer.bind(),this._compositingHelper.composite(this._bindParameters,i.getTexture()),i.release(),this.performanceInfo.advance(1===e?oe.OPAQUE_EDGES:oe.TRANSPARENT_EDGES)}_renderOverlay(){this._bindParameters.overlay=this.overlay?.render(this._renderContext.time),this._bindParameters.overlay&&this.performanceInfo.advance(oe.OVERLAY)}_renderShadowMap(e,t,r){if(!this.shadowsEnabled)return;const i=this._shadowMap;i.start(e,t,r,this.isFeatureEnabled(7),this.stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight?(this._renderShadowCascades(5,this._shadowMap),i.copySnapshot(1),this._renderShadowCascades(4,this._shadowMap)):this._renderShadowCascades(3),i.finish(),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,this._bindParameters.contentCamera),this.performanceInfo.advance(oe.SHADOW_MAP)}_renderHighlightShadowMap(e,t,r){if(!this.shadowsEnabled||!this._needsShadowHighlight)return;const i=this._shadowMap;i.start(e,t,r,this.isFeatureEnabled(7),this.stage.view.qualitySettings.maximumPixelRatio),this._renderShadowCascades(4,this._shadowMap),i.moveSnapshot(0),i.finish(),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,this._bindParameters.contentCamera),this.performanceInfo.advance(oe.SHADOW_MAP)}_renderCutFillDepth(){return this._nodes.produce(R.CUTFILL_DEPTH,this._pluginInput)}_precompileShadowCascades(e){0!==this._shadowMap.cascades.length&&this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._shadowMap){t.bindFbo();for(const r of t.cascades)r.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(r.camera,r.camera),this.renderAllGeometry(e)}get _needsDepth(){return this._plugins.consumes(1)||this._nodes.requireGeometryDepth()||this.hasReflections||this._needsShadowHighlight||this._shadowAccumulator.active||this._debugNeedsDepth}_renderRemainingGeometryDepth(){const e=this._pluginInput.get("normals");e?(this._pluginInput.set(R.SSAO,this._renderSSAO()),this._needsDepth?(this._rctx.bindFramebuffer(e.fbo),this._rctx.clear(1024),this._renderGeometryWithoutNormals(1),this._bindParameters.depth?.release(),this._bindParameters.depth=e.obtainDepthTexture(),this.performanceInfo.advance(oe.DEPTH)):(e.detachDepth(),this._bindParameters.depth=o(this._bindParameters.depth)),this.hasSSAO&&this._pluginInput.release("normals")):this._renderAllGeometryDepth()}_renderAllGeometryDepth(){if(this._bindParameters.depth=o(this._bindParameters.depth),!this._needsDepth)return;const e=this._framebufferSize,t=this.fboCache.acquire(e.width,e.height,"geometry depth",14);this._rctx.bindFramebuffer(t.fbo),this._rctx.clear(1280),this.renderAllGeometry(1),this._bindParameters.depth=t.obtainDepthTexture(),t.release(),this.performanceInfo.advance(oe.DEPTH)}_renderTerrainDepth(){if(this._bindParameters.terrainDepth=o(this._bindParameters.terrainDepth),this._bindParameters.terrainDepthTest=this._bindParameters.cullAboveTerrain=this._needsTerrainDepth,!this._needsTerrainDepth)return;const e=this._renderContext.output;this._renderContext.output=1;const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"terrain depth",14);this._rctx.bindFramebuffer(r.fbo),this._rctx.clear(1280),this._renderTransparentGround(),this._bindParameters.terrainDepth=r.obtainDepthTexture(),r.release(),this._renderContext.output=e}_renderGeometryDepth(){if(this._bindParameters.geometryDepth=o(this._bindParameters.geometryDepth),!this._needsTerrainDepth)return;const e=this._renderContext.output,{width:t,height:r}=this._framebufferSize,i=this.fboCache.acquire(t,r,"geometry depth",14);this._rctx.bindFramebuffer(i.fbo),this._rctx.clear(1280),this._renderOpaqueAndTransparentGeometry(1),this._renderContext.output=e,this._bindParameters.geometryDepth=i.obtainDepthTexture(),i.release()}get _needsShadowDepthRange(){return this._shadowMap.enabled||this._shadowAccumulator.active}_computeShadowDepthRange(e){if(!this._needsShadowDepthRange)return Q.Zero;const t=Y(e,this._plugins.plugins,this.stage.layers,0);return t.union(this._plugins.queryDepthRange(e)),t.near=Math.max(e.near,t.near),t.far=Math.min(e.far,t.far),t}updateSceneDepthRange(e){if(!this.stage.view.state.isGlobal)return void(this.sceneDepthRange.value=Q.Infinite);if((this.stage.view.renderCoordsHelper?.getAltitude(e.eye)??0)<y)return void(this.sceneDepthRange.value=Q.Infinite);const t=e.clone();t.near=O,t.far=1e10;const r=Y(t,this._plugins.plugins,this.stage.layers,1);r.union(this._plugins.queryDepthRange(t)),this.sceneDepthRange.value.equals(r)||(this.sceneDepthRange.value=r)}get _normalsRequired(){const e=this._nodes.require("normals",I.FINAL,I.COMPOSITE,I.OPAQUE,I.TRANSPARENT,R.VIEWSHED,R.LASERLINES);return(this.hasSSAO?1:0)+e}_updateHUDOccludedFragmentOpacity(e,t){const{idleOpacity:r,navigatingOpacity:a,maxDelta:n,tiltFadeStart:h,tiltFadeEnd:o,altitudeStart:d,altitudeEnd:_}=Z,l=this.stage.view,u=l.stateManager.camera,p=l.qualitySettings.fadeDuration,m=2===e?r:a,c=i((u.tilt-h)/(o-h),0,1),f=i(((u.position.z??0)-d)/(_-d),0,1),g=s(s(1,m,c),1,f),b=this._bindParameters.hudOccludedFragmentOpacity;if(p<=0||b===g||0===this._lastFrameTime||this._lastFrameTime>t)return this._bindParameters.hudOccludedFragmentOpacity=g,void(this._lastFrameTime=t);const P=t-this._lastFrameTime;this._lastFrameTime=t;const C=Math.max(1-r,Math.abs(r-a)),w=Math.min(C*P/p,n);w>=Math.abs(g-b)?this._bindParameters.hudOccludedFragmentOpacity=g:(this._bindParameters.hudOccludedFragmentOpacity=b+Math.sign(g-b)*w,this._requestRender())}_precompilePrepasses(){this._normalsRequired&&this._precompileAllGeometry(2),this._needsDepth&&this._precompileAllGeometry(1),this.shadowsEnabled&&(this._needsShadowHighlight?(this._precompileShadowCascades(4),this._precompileShadowCascades(5)):this._precompileShadowCascades(3)),this._shadowAccumulator.active&&this._precompileAllGeometry(3)}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"normals",5);r.acquireDepth(14),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer(A,!0,!0),this._renderContext.output=2,this._plugins.render(...fe);const i=this._nodes.optional("normals",I.FINAL,I.COMPOSITE,I.OPAQUE,I.TRANSPARENT,R.VIEWSHED);return r.retain(e+i-1),this.performanceInfo.advance(oe.NORMALS),r}_renderSSAO(){const e=this._pluginInput.get("normals");if(!this.hasSSAO||!e)return;const t=this._nodes.produce(R.SSAO,this._pluginInput);return this._bindParameters.ssao=t,t&&this.performanceInfo.advance(oe.SSAO),t}_precompileAllGeometry(e){const t=this._renderContext.output;this._renderContext.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(...ce),this._renderContext.output=t}renderAllGeometry(e){this._renderContext.output=e,this._renderOpaqueAndTransparentGeometry(e),this._renderTransparentGround()}precompileSlots(e,...t){for(const r of t)this._bindParameters.slot=r,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(const r of t)this._renderContext.renderOccludedMask=r,this.precompileSlots(e,...be);this._renderContext.renderOccludedMask=X}renderSlots(e,...t){for(const r of t)this._bindParameters.slot=r,e.forAll(e=>{const t=e.acquireTechniques(this._renderContext);t&&e.render(this._renderContext,t)})}renderOccludedSlots(e,t){this._renderContext.renderOccludedMask=t,this.plugins.renderOccludedFlags>1&&this._plugins.render(10),this.renderSlots(e,...be),this._renderContext.renderOccludedMask=X}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(14)}precompileViewshedShadowMap(){this._precompileAllGeometry(6)}precompileCutFill(){const e=7,t=this._renderContext.output;this._renderContext.output=e,this._plugins.precompile(0,1,...ce),this._renderContext.output=t}renderViewshedShadowMap(e){const{camera:t,contentCamera:r}=this._bindParameters,i=this._renderContext.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(6),this._ensureBindParametersCamera(t,r),this._bindParameters.camera.setGLViewport(this._rctx),this._renderContext.output=i}renderCutFillReferenceDepth(e){const{camera:t,contentCamera:r}=this._bindParameters,i=this._renderContext.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this._renderContext.output=7,this._plugins.render(0,1,...ce),this._ensureBindParametersCamera(t,r),t.setGLViewport(this._rctx),this._renderContext.output=i}_renderOpaqueAndTransparentGeometry(e){this._renderContext.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithoutNormals(e){this._renderContext.output=e,this._plugins.render(...ge)}_precompileOpaqueGeometry(){this._plugins.precompile(...pe),this._nodes.precompile("opaque-color")}_renderOpaqueGeometry(){this._plugins.render(...pe)}_renderTransparentGeometry(){this._plugins.render(...me)}get _hasPhotoshopTerrain(){return this._plugins.produces(0,6)}get _needsTerrainDepth(){return this._highQualityTransparency&&this._hasPhotoshopTerrain}_renderPhotoshopTerrain(){if(!this._hasPhotoshopTerrain)return null;const e=this._framebufferSize,t=this.fboCache.acquire(e.width,e.height,"transparent terrain");return this.renderToTargets(()=>this._plugins.render(6),t,this._framebuffer.depth,A),this.performanceInfo.advance(oe.TRANSPARENT_TERRAIN),t}_renderTransparentGround(){this._plugins.render(...ce)}get _needsHUDVisibility(){return this._plugins.produces(this._renderContext.output,13)}_renderHUDVisibility(){if(!this._needsHUDVisibility)return void(this._bindParameters.hudVisibility=o(this._bindParameters.hudVisibility));const{width:e,height:t}=this._framebufferSize;let r=this._bindParameters.hudVisibility;r?.fbo?.width===e&&r?.fbo?.height===t||(r?.release(),r=this.fboCache.acquire(e,t,"hud visibility",4),this._bindParameters.hudVisibility=r);const i=this._bindParameters.geometryDepth;r.attachDepth(i||this._framebuffer.depth),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer([0,1,0,1]),this._plugins.render(13),r.detachDepth(),this._framebuffer.bind(),this.performanceInfo.advance(oe.HUD_VISIBILITY)}_renderLineCallouts(e){if(this._bindParameters.hudRenderStyle=e,0===e){const e=()=>this._plugins.render(16),t=this._framebufferSize,r=this.fboCache.acquireDepth(13,t.width,t.height,"line callouts");this.renderToTargets(e,this._framebuffer.color,r,void 0,!0,!0),r.release()}else this._plugins.render(16)}_precompileHUD(e){if(this._precompileHUDOutput(e),this._hasHighlights){const t=this._renderContext.output;this._renderContext.output=8,this._precompileHUDOutput(e),this._renderContext.output=t}}_precompileHUDOutput(e){const t=this._bindParameters.hudRenderStyle;this._bindParameters.hudRenderStyle=e,this._oitEnabled&&N(this._renderContext.output)?(this._bindParameters.oitPass=1,this._plugins.precompile(...Pe),this._bindParameters.oitPass=2,this._plugins.precompile(...Pe),this._bindParameters.oitPass=0):this._plugins.precompile(...Pe),this._bindParameters.hudRenderStyle=t}_renderHUD(e,t){if(this._pluginsHas.hudElements){if(this._oitEnabled){const r=this._renderOIT(1,e);this._rctx.bindFramebuffer(t.fbo),this._compositingHelper.compositePreMultipliedAlpha(this._bindParameters,r.getTexture(),!1),r.release()}else if(this._renderContext.output=0,0===e){const t=()=>this._renderHUDElements(e),r=this._framebufferSize,i=this.fboCache.acquireDepth(13,r.width,r.height,"hud");this.renderToTargets(t,this._framebuffer.color,i,void 0,!0,!0),i.release()}else t.acquireDepth(13),this._rctx.bindFramebuffer(t.fbo),this._renderHUDElements(e),t.detachDepth();this.performanceInfo.advance(0===e?oe.HUD_OCCLUDED:oe.HUD)}}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(...Pe)}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(4,2)}_renderHighlightPrepass(){if(!this._hasHighlights)return;const{fboCache:e,_rctx:t,_bindParameters:r}=this,i=this._framebufferSize,{highlights:s}=r,a=e.acquire(i.width,i.height,"highlights",s.length>V?3:1);a.acquireDepth(14);const n=this._plugins.produces(8,0);return n&&this._framebuffer.color.fbo&&a.fbo&&t.blitFramebuffer(this._framebuffer.color.fbo,a.fbo,1024),t.bindFramebuffer(a.fbo),t.gl.clearBufferuiv(6144,0,[0,0,0,0]),n||t.clear(1024),this._renderContext.output=8,t.bindFramebuffer(a.fbo),j(t,e,i,r,()=>this._renderHighlightGeometries()),a.detachDepth(),this.performanceInfo.advance(oe.HIGHLIGHTS),a}_renderHighlightGeometries(){this._plugins.render(...Ce),this._rctx.clear(256),this._renderHUDElements(2)}_renderShadowAccumulation(e,t,r,i){this._shadowAccumulator.updateDepthRange(e),this._shadowAccumulator.accumulating&&this._bindParameters.depth&&this._shadowAccumulator.renderAccumulation(this._bindParameters.depth,t,r,i)&&this.performanceInfo.advance(oe.ACCUMULATED_SHADOWS)}_precompileTransparentGeometry(){this._oitEnabled&&N(this._renderContext.output)?(this._bindParameters.oitPass=1,this._plugins.precompile(...me),this._bindParameters.oitPass=2,this._plugins.precompile(...me),this._bindParameters.oitPass=0):this._plugins.precompile(...me)}_renderOIT(e,t=2){const r=1===e,i=this._framebufferSize,s=r?()=>this._renderHUDElements(t):()=>this._renderTransparentGeometry(),a=this._bindParameters,n=this._renderContext.output;this._renderContext.output=0,a.oitPass=1;const h=r?"oit hud":"oit",o=this.fboCache.acquire(i.width,i.height,h,8),d=this._bindParameters.hasEmission;d&&o.acquireColor(_e,8,"oit emissive"),o.acquireColor(d?le:_e,7,"oit alpha"),r||o.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(o.fbo),this._rctx.clearFramebuffer([0,0,0,1]),d&&this._rctx.clearBuffer(1,E),s(),o.detachDepth(),a.oitPass=2;const _=this.fboCache.acquire(i.width,i.height,r?"oit hud front":"oit front");let l;return d&&_.acquireColor(_e,8,"oit emissive front"),r?_.acquireDepth(13):_.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(_.fbo),this._rctx.clearFramebuffer(A,r),s(),_.detachDepth(),a.oitPass=0,r?(l=this.fboCache.acquire(i.width,i.height,"oit hud composite"),this._rctx.bindFramebuffer(l.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(16384)):this._framebuffer.bind(),this._oitBlend??=new B(this._techniques),this._oitBlend.blend(this._rctx,o,_,a,d,!r),l?.detachDepth(),_.release(),o.release(),this._renderContext.output=n,l}_renderOpaque(){const e=this.plugins.produces(0,...pe);if(e){this._plugins.render(0,1);const e=this._framebuffer;e.update(e=>this._renderNodes(R.CUTFILL_COLOR,e)),e.update(e=>this._renderNodes(R.OPAQUE_TERRAIN,e)),e.bind(),this._plugins.render(2,3)}const t=this._framebuffer;this._renderTerrainDepth(),t.update(t=>this._renderNodes(I.OPAQUE,t,e)),this.fboCache.debugCallback?.(I.OPAQUE,t.color.fbo),t.update(e=>this._renderNodes(R.OPAQUE_ENVIRONMENT,e)),this.fboCache.debugCallback?.(R.OPAQUE_ENVIRONMENT,t.color.fbo),this._renderEdges(1)}_renderTransparent(e){const t=this._framebuffer;t.bind(),this._renderPlugins(21,oe.VOXEL),this._renderHiddenTransparentEdges(),e&&(this._oitEnabled?this._renderOIT(0):this._renderTransparentGeometry()),t.update(t=>this._renderNodes(I.TRANSPARENT,t,e)),this.fboCache.debugCallback?.(I.TRANSPARENT,t.color.fbo),this._renderGeometryDepth(),this._renderHUDVisibility(),this._needsTerrainDepth||this._plugins.render(16),this._renderEdges(0);const r=this._renderPhotoshopTerrain(),i=r?.getTexture();i&&this._bindParameters.hudVisibility&&(this._needsTerrainDepth?this._renderLineCallouts(0):(this._rctx.bindFramebuffer(this._bindParameters.hudVisibility?.fbo),this._compositingHelper.compositeHUD(this._bindParameters,i)),this._renderHUD(0,t.color)),this._bindParameters.cullAboveTerrain=!1,i&&(t.bind(),this._compositingHelper.compositePreMultipliedAlpha(this._bindParameters,i),r?.release(),this._needsTerrainDepth&&(this._renderEdges(1),e&&(this._oitEnabled?this._renderOIT(0):this._renderTransparentGeometry(),this.performanceInfo.advance(oe.TRANSPARENT)),this._renderEdges(0))),this._bindParameters.ssao=o(this._bindParameters.ssao),this._needsTerrainDepth&&this._renderLineCallouts(1),this._bindParameters.terrainDepthTest=!1,this._renderTransparentEnvironment()}_renderTransparentEnvironment(){this._shadowAccumulator.render(this._bindParameters),this.performanceInfo.advance(oe.APPLY_ACCUMULATED_SHADOWS),this._framebuffer.bind(),this._plugins.render(9),this.performanceInfo.advance(oe.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderPlugins(e,t){this._plugins.produces(this._renderContext.output,e)&&(this._plugins.render(e),this.performanceInfo.advance(t))}_renderNodes(e,t,r=!1){if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return r&&this.performanceInfo.advance(e),t;const i=this._nodes.render(t,this._pluginInput,this._releaseNormals);return this.performanceInfo.advance(e),i}blitFBO(e,t=v,r=!0){return this._blit??=new U(this._techniques),this._blit.blit(this._rctx,e,t,this._bindParameters),this._pluginInput.set(e.name,t),r&&e.release(),t}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersSSR(e){if(this._bindParameters.ssr.lastFrameColor){null==this._ssrEnableTime&&(this._ssrEnableTime=e),this._renderContext.lastFrameCamera.equals(this._bindParameters.camera)?this._reprojectionMatrix=w:(P(Se,this._bindParameters.camera.viewMatrix),P(Te,this._bindParameters.camera.projectionMatrix),C(Ee,Se,Te),C(Ee,this._renderContext.lastFrameCamera.viewMatrix,Ee),C(Ee,this._renderContext.lastFrameCamera.projectionMatrix,Ee),this._reprojectionMatrix=Ee);const t=this.stage.view.qualitySettings.fadeDuration;this._bindParameters.ssr.fadeFactor=t>0?Math.min(t,e-this._ssrEnableTime)/t:1,this._bindParameters.ssr.fadeFactor<1&&this._requestRender()}else this._reprojectionMatrix=w,this._ssrEnableTime=null}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,r,i){this._bindParameters.updateLighting(e,t,r,i),this._requestRender(1)}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0}}renderToTargets(e,t,r,i,s=!1,a=!1){t.attachDepth(r),this._rctx.bindFramebuffer(t.fbo),this._rctx.clearFramebuffer(i,s,a),e(),t.detachDepth()}get test(){}};e([f({readOnly:!0})],ue.prototype,"highResolutionAtmosphere",null),e([f()],ue.prototype,"_edgeView",void 0),e([f()],ue.prototype,"updating",null),ue=e([g("esri.views.3d.webgl-engine.lib.Renderer")],ue);const pe=[0,1,2,3],me=[7,8,4,5],ce=[6,7,8],fe=[0,1,2,4,...ce],ge=[3,5],be=[2,4,9],Pe=[17,14,15],Ce=[4,5,2,3,0,1,...ce],we=[4,9,5,12],Te=T(),Se=T(),Ee=T();function xe(e){return t=>e.immediate.schedule(t)}export{ue as Renderer};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{clamp as e,deg2rad as t}from"../../../../core/mathUtils.js";import{fromMat4 as i}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{invert as r}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as n,rotate as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as l,create as c}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{h as u,p as f,n as p,e as h,j as d,t as m,c as g,d as b,b as v,B as x,a as S,g as y,i as z}from"../../../../chunks/vec32.js";import{create as O,fromValues as P}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromArray as _,create as j,freeze as D}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as M}from"../../../../geometry/support/aaBoundingRect.js";import{BufferViewVec4u8 as R}from"../../../../geometry/support/buffer/BufferView.js";import{evaluateModelTransformScale as V}from"../../layers/support/FastSymbolUpdates.js";import{debugFlags as C}from"../../support/debugFlags.js";import{isColorHighlightOrOLID as A,isColor as F}from"../core/shaderLibrary/ShaderOutput.js";import{HUDVerticalPixelOffset as w}from"../core/shaderLibrary/hud/HUD.glsl.js";import{GLTextureMaterialBindParameters as E,GLTextureMaterial as L}from"../lib/GLTextureMaterial.js";import{Material as T}from"../lib/Material.js";import{SeparateScreenSizePerspectiveEvaluators as U}from"../lib/screenSizePerspectiveUtils.js";import{assert as B}from"../lib/Util.js";import{writePosition as I,writeNormal as W,writeColor as H,writeBufferVec2 as G,writeBufferFloat as N,writeBufferVec4 as X,writeBufferVec4Zeros as Y,writeOlidColor as q}from"./internal/bufferWriterUtils.js";import{verticalOffsetAtDistance as k}from"./internal/MaterialUtil.js";import{c as J,f as K}from"../../../../chunks/HUDMaterial.glsl.js";import{getInstanceLayout as Q,baseLayout as Z,HUDMaterialTechnique as $}from"../shaders/HUDMaterialTechnique.js";import{HUDMaterialTechniqueConfiguration as ee}from"../shaders/HUDMaterialTechniqueConfiguration.js";import{alphaCutoff as te}from"../../../../webscene/support/AlphaCutoff.js";class ie extends T{constructor(e,t){super(e,je),this.produces=new Map([[14,e=>A(e)&&!this.parameters.drawAsLabel],[15,e=>A(e)&&this.parameters.drawAsLabel],[13,()=>this.parameters.useVisibilityPixel],[19,e=>this.parameters.draped&&A(e)]]),this._visible=!0,this._configuration=new ee(t)}getConfiguration(e,t){const i=this.parameters.draped;return super.getConfiguration(e,t,this._configuration),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVerticalOffset=!!this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,this._configuration.hasPolygonOffset=this.parameters.polygonOffset,this._configuration.draped=i,this._configuration.visibilityPixelEnabled=this.parameters.useVisibilityPixel,this._configuration.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,this._configuration.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,this._configuration.sampleSignedDistanceFieldTexelCenter=this.parameters.sampleSignedDistanceFieldTexelCenter,this._configuration.hasRotation=this.parameters.hasRotation,this._configuration.hasVVSize=!!this.parameters.vvSize,this._configuration.hasVVColor=!!this.parameters.vvColor,this._configuration.occlusionPass=13===t.slot,this._configuration.occludedFragmentFade=!i&&this.parameters.occludedFragmentFade,this._configuration.horizonCullingEnabled=this.parameters.horizonCullingEnabled,this._configuration.isFocused=this.parameters.isFocused,this._configuration.depthTestEnabled=this.parameters.depthEnabled||13===t.slot,F(e)&&(this._configuration.debugDrawLabelBorder=!!C.LABELS_SHOW_BORDER),this._configuration.oitPass=t.oitPass,this._configuration.terrainDepthTest=t.terrainDepthTest,this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration}intersect(e,t,s,a,n,o){const{options:{selectionMode:l,hud:c,excludeLabels:S},point:y,camera:z}=s,{parameters:P}=this;if(!l||!c||S&&P.isLabel||!e.visible||!y||!z)return;const j=e.attributes.get("featureAttribute"),D=null==j?null:_(j.data,Se),{scaleX:M,scaleY:R}=Me(D,P,z.pixelRatio),V=e.attributes.get("position"),C=e.attributes.get("size"),A=e.attributes.get("normal"),F=e.attributes.get("rotation"),w=e.attributes.get("centerOffsetAndDistance");B(V.size>=3);const E=J(P),L="screen"===this.parameters.centerOffsetUnits;for(let _=0;_<V.data.length/V.size;_++){const e=_*V.size;u(le,V.data[e],V.data[e+1],V.data[e+2]),f(le,le,t),f(le,le,z.viewMatrix);const a=_*w.size;if(u(ve,w.data[a],w.data[a+1],w.data[a+2]),!L&&(le[0]+=ve[0],le[1]+=ve[1],0!==ve[2])){const e=ve[2];p(ve,le),h(le,le,d(ve,ve,e))}const n=_*A.size;u(ce,A.data[n],A.data[n+1],A.data[n+2]),m(ce,ce,i(me,t));const{normal:l,cosAngle:c}=ae(ce,z,ye),S=Ve(this.parameters,le,c,z,oe);if(g(le,le,l,S),z.applyProjection(le,ue),ue[0]>-1){L&&(ve[0]||ve[1])&&(ue[0]+=ve[0]*z.pixelRatio,0!==ve[1]&&(ue[1]+=oe.alignmentEvaluator.apply(ve[1])*z.pixelRatio),z.unapplyProjection(ue,le)),ue[0]+=this.parameters.screenOffset[0]*z.pixelRatio,ue[1]+=this.parameters.screenOffset[1]*z.pixelRatio,ue[0]=Math.floor(ue[0]),ue[1]=Math.floor(ue[1]);const e=_*C.size;Pe[0]=C.data[e],Pe[1]=C.data[e+1],oe.evaluator.applyVec2(Pe,Pe);const t=ze*z.pixelRatio;let i=0;if(P.textureIsSignedDistanceField){i=Math.min(P.outlineSize,.5*Pe[0])*z.pixelRatio/2}Pe[0]*=M,Pe[1]*=R;const a=_*F.size,n=P.rotation+F.data[a];if(ne(y,ue[0],ue[1],Pe,t,i,n,P,E)){const e=s.ray;if(f(pe,le,r(ge,z.viewMatrix)),ue[0]=y[0],ue[1]=y[1],z.unprojectFromRenderScreen(ue,le)){const t=O();b(t,e.direction);const i=1/v(t);d(t,t,i);o(x(e.origin,le)*i,t,-1,pe)}}}}}intersectDraped(e,t,i,s,r){const a=e.attributes.get("position"),n=e.attributes.get("size"),o=e.attributes.get("rotation"),l=this.parameters,c=J(l),u=e.attributes.get("featureAttribute"),f=null==u?null:_(u.data,Se),{scaleX:p,scaleY:h}=Me(f,l,e.screenToWorldRatio),d=Oe*e.screenToWorldRatio;for(let m=0;m<a.data.length/a.size;m++){const t=m*a.size,u=a.data[t],f=a.data[t+1],g=m*n.size;Pe[0]=n.data[g],Pe[1]=n.data[g+1];let b=0;if(l.textureIsSignedDistanceField){b=Math.min(l.outlineSize,.5*Pe[0])*e.screenToWorldRatio/2}Pe[0]*=p,Pe[1]*=h;const v=m*o.size,x=l.rotation+o.data[v];ne(i,u,f,Pe,d,b,x,l,c)&&s(r.distance,r.normal,-1)}}createBufferWriter(){return new De}applyShaderOffsets(e,t,s,r,a,n,o){m(fe,s,i(me,r));const l=ae(fe,n,ye),c=Re(v(t),n),u=Ve(this.parameters,t,l.cosAngle,n,o);g(t,t,l.normal,u+c),g(e,e,fe,u+c);const f=a[3]+u;this._applyPolygonOffsetView(t,l,f,n,t),this._applyCenterOffsetView(t,a,t)}applyShaderOffsetsNDC(e,t,i,s,r){return this._applyCenterOffsetNDC(e,t,i,s),null!=r&&b(r,s),this._applyPolygonOffsetNDC(s,t,i,s),s}_applyPolygonOffsetView(t,i,s,r,a){const n=r.aboveGround?1:-1;let o=Math.sign(s);0===o&&(o=n);const l=n*o;if(this.parameters.shaderPolygonOffset<=0)return b(a,t);const c=e(Math.abs(i.cosAngle),.01,1),u=1-Math.sqrt(1-c*c)/c/r.viewport[2];return d(a,t,l>0?u:1/u),a}_applyCenterOffsetView(e,t,i){const s="screen"!==this.parameters.centerOffsetUnits;return i!==e&&b(i,e),s&&(i[0]+=t[0],i[1]+=t[1],t[2]&&(p(ce,i),S(i,i,d(ce,ce,t[2])))),i}_applyCenterOffsetNDC(e,t,i,s){const r="screen"!==this.parameters.centerOffsetUnits;return s!==e&&b(s,e),r||(s[0]+=t[0]/i.fullWidth*2,s[1]+=t[1]/i.fullHeight*2),s}_applyPolygonOffsetNDC(e,t,i,s){const r=this.parameters.shaderPolygonOffset;if(e!==s&&b(s,e),r){const e=i.aboveGround?1:-1,a=e*Math.sign(t[3]);s[2]-=(a||e)*r}return s}set visible(e){this._visible=e}get visible(){const{color:e,outlineSize:t,outlineColor:i}=this.parameters,s=e[3]>=te||t>=te&&i[3]>=te;return this._visible&&s}createGLMaterial(e){return new se(e)}calculateRelativeScreenBounds(e,t,i=M()){return re(this.parameters,e,t,i),i[2]=i[0]+e[0],i[3]=i[1]+e[1],i}}class se extends L{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.getTechnique($,e)}}function re(e,t,i,s){s[0]=e.anchorPosition[0]*-t[0]+e.screenOffset[0]*i,s[1]=e.anchorPosition[1]*-t[1]+e.screenOffset[1]*i}function ae(e,t,i){return f(i.normal,e,t.viewInverseTransposeMatrix),i.cosAngle=y(i.normal,_e),i}function ne(e,i,s,r,a,l,c,u,f){let p=i-a-r[0]*f[0],h=p+r[0]+2*a,d=s-a-r[1]*f[1],m=d+r[1]+2*a;const g=u.distanceFieldBoundingBox;return u.textureIsSignedDistanceField&&null!=g&&(p+=r[0]*g[0],d+=r[1]*g[1],h-=r[0]*(1-g[2]),m-=r[1]*(1-g[3]),p-=l,h+=l,d-=l,m+=l),n(de,i,s),o(he,e,de,t(c)),he[0]>p&&he[0]<h&&he[1]>d&&he[1]<m}const oe=new U,le=O(),ce=O(),ue=j(),fe=O(),pe=O(),he=c(),de=c(),me=s(),ge=a(),be=j(),ve=O(),xe=O(),Se=j(),ye={normal:O(),cosAngle:0},ze=1,Oe=2,Pe=l(0,0),_e=P(0,0,1);class je extends E{constructor(){super(...arguments),this.renderOccluded=1,this.isDecoration=!1,this.color=D(1,1,1,1),this.polygonOffset=!1,this.anchorPosition=l(.5,.5),this.screenOffset=[0,0],this.shaderPolygonOffset=1e-5,this.textureIsSignedDistanceField=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.outlineColor=D(1,1,1,1),this.outlineSize=0,this.distanceFieldBoundingBox=j(),this.rotation=0,this.hasRotation=!1,this.vvSizeEnabled=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.hasSlicePlane=!1,this.pixelSnappingEnabled=!0,this.useVisibilityPixel=!0,this.occludedFragmentFade=!1,this.horizonCullingEnabled=!1,this.occludedVisibilityMode="hidden",this.centerOffsetUnits="world",this.drawAsLabel=!1,this.depthEnabled=!0,this.isFocused=!0,this.focusStyle="bright",this.draped=!1,this.isLabel=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}class De{constructor(){this.layout=Q(),this.baseInstanceLayout=Z}elementCount(e){return e.get("position").indices.length}elementCountBaseInstance(e){return e.get("uv0").indices.length}write(e,t,i,s,r,a){const{position:n,normal:o,color:l,size:c,rotation:u,centerOffsetAndDistance:f,featureAttribute:p,uvi:h}=r;I(i.get("position"),e,n,a),W(i.get("normal"),t,o,a);const d=i.get("position").indices.length;let m=0,g=0,b=K,v=K;const x=i.get("uvi")?.data;x&&x.length>=4&&(m=x[0],g=x[1],b=x[2],v=x[3]);for(let S=0;S<d;++S){const e=a+S;h.setValues(e,m,g,b,v)}if(H(i.get("color"),4,l,a),G(i.get("size"),c,a),N(i.get("rotation"),u,a),i.get("centerOffsetAndDistance")?X(i.get("centerOffsetAndDistance"),f,a):Y(f,a,d),i.get("featureAttribute")?X(i.get("featureAttribute"),p,a):Y(p,a,d),null!=s){const e=i.get("position")?.indices;if(e){const t=e.length,i=r.getField("olidColor",R);q(s,i,t,a)}}return{numVerticesPerItem:1,numItems:d}}writeBaseInstance(e,t){const{uv0:i}=t;G(e.get("uv0"),i,0)}intersect(e,t,i,s,a,n,o){const{options:{selectionMode:l,hud:c,excludeLabels:m},point:S,camera:y}=s;if(!l||!c||m&&t.isLabel||!S)return;const P=this.layout.createView(e),{position:_,normal:j,rotation:D,size:M,featureAttribute:R,centerOffsetAndDistance:V}=P,C="screen"===t.centerOffsetUnits,A=J(t);if(null==_||null==j||null==D||null==M||null==V||null==y)return;const F=null==R?null:R.getVec(0,Se),{scaleX:w,scaleY:E}=Me(F,t,y.pixelRatio),L=_.count;for(let T=0;T<L;T++){if(_.getVec(T,le),null!=i&&z(le,le,i),f(le,le,y.viewMatrix),V.getVec(T,be),u(ve,be[0],be[1],be[2]),!C&&(le[0]+=ve[0],le[1]+=ve[1],0!==ve[2])){const e=ve[2];p(ve,le),h(le,le,d(ve,ve,e))}j.getVec(T,ce),ae(ce,y,ye);const e=Ve(t,le,ye.cosAngle,y,oe);if(g(le,le,ye.normal,e),y.applyProjection(le,ue),ue[0]>-1){C&&(ve[0]||ve[1])&&(ue[0]+=ve[0]*y.pixelRatio,0!==ve[1]&&(ue[1]+=oe.alignmentEvaluator.apply(ve[1])*y.pixelRatio),y.unapplyProjection(ue,le)),ue[0]+=t.screenOffset[0]*y.pixelRatio,ue[1]+=t.screenOffset[1]*y.pixelRatio,ue[0]=Math.floor(ue[0]),ue[1]=Math.floor(ue[1]),M.getVec(T,Pe),oe.evaluator.applyVec2(Pe,Pe);const e=ze*y.pixelRatio;let i=0;if(t.textureIsSignedDistanceField){i=Math.min(t.outlineSize,.5*Pe[0])*y.pixelRatio/2}Pe[0]*=w,Pe[1]*=E;const a=D.get(T),n=t.rotation+a;if(ne(S,ue[0],ue[1],Pe,e,i,n,t,A)){const e=s.ray;if(f(pe,le,r(ge,y.viewMatrix)),ue[0]=S[0],ue[1]=S[1],y.unprojectFromRenderScreen(ue,le)){const t=O();b(t,e.direction);const i=1/v(t);d(t,t,i);o(x(e.origin,le)*i,t,T,pe)}}}}}}function Me(e,t,i){return null==e||null==t.vvSize?{scaleX:i,scaleY:i}:(V(xe,t,e),{scaleX:xe[0]*i,scaleY:xe[1]*i})}function Re(e,t){const i=t.computeRenderPixelSizeAtDist(e)*w;return(t.aboveGround?1:-1)*i}function Ve(e,t,i,s,r){if(!e.verticalOffset?.screenLength){const s=v(t);return r.update(i,s,e.screenSizePerspective,e.screenSizePerspectiveMinPixelReferenceSize,e.screenSizePerspectiveAlignment,null),0}const a=v(t),n=e.screenSizePerspectiveAlignment??e.screenSizePerspective,o=k(s,a,e.verticalOffset,i,n,e.screenSizePerspectiveMinPixelReferenceSize);return r.update(i,a,e.screenSizePerspective,e.screenSizePerspectiveMinPixelReferenceSize,e.screenSizePerspectiveAlignment,null),o}export{ie as HUDMaterial,je as Parameters};
5
+ import{clamp as e,deg2rad as t}from"../../../../core/mathUtils.js";import{fromMat4 as i}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{invert as r}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as n,rotate as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as l,create as c}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{h as u,p as f,n as p,e as h,j as d,t as m,c as g,d as b,b as v,B as x,a as S,g as y,i as z}from"../../../../chunks/vec32.js";import{create as O,fromValues as P}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromArray as _,create as j,freeze as R}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as D}from"../../../../geometry/support/aaBoundingRect.js";import{BufferViewVec4u8 as M}from"../../../../geometry/support/buffer/BufferView.js";import{evaluateModelTransformScale as V}from"../../layers/support/FastSymbolUpdates.js";import{debugFlags as C}from"../../support/debugFlags.js";import{isColorHighlightOrOLID as A,isColor as F}from"../core/shaderLibrary/ShaderOutput.js";import{HUDVerticalPixelOffset as w}from"../core/shaderLibrary/hud/HUD.glsl.js";import{GLTextureMaterialBindParameters as T,GLTextureMaterial as E}from"../lib/GLTextureMaterial.js";import{Material as L}from"../lib/Material.js";import{SeparateScreenSizePerspectiveEvaluators as U}from"../lib/screenSizePerspectiveUtils.js";import{assert as B}from"../lib/Util.js";import{writePosition as I,writeNormal as W,writeColor as H,writeBufferVec2 as G,writeBufferFloat as N,writeBufferVec4 as X,writeBufferVec4Zeros as Y,writeOlidColor as q}from"./internal/bufferWriterUtils.js";import{verticalOffsetAtDistance as k}from"./internal/MaterialUtil.js";import{c as J,f as K}from"../../../../chunks/HUDMaterial.glsl.js";import{getInstanceLayout as Q,baseLayout as Z,HUDMaterialTechnique as $}from"../shaders/HUDMaterialTechnique.js";import{HUDMaterialTechniqueConfiguration as ee}from"../shaders/HUDMaterialTechniqueConfiguration.js";import{alphaCutoff as te}from"../../../../webscene/support/AlphaCutoff.js";class ie extends L{constructor(e,t){super(e,je),this.produces=new Map([[14,e=>A(e)&&!this.parameters.drawAsLabel],[15,e=>A(e)&&this.parameters.drawAsLabel],[13,()=>this.parameters.useVisibilityPixel],[19,e=>this.parameters.draped&&A(e)]]),this._visible=!0,this._configuration=new ee(t)}getConfiguration(e,t){const i=this.parameters.draped;return super.getConfiguration(e,t,this._configuration),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVerticalOffset=!!this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,this._configuration.hasPolygonOffset=this.parameters.polygonOffset,this._configuration.draped=i,this._configuration.visibilityPixelEnabled=this.parameters.useVisibilityPixel,this._configuration.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,this._configuration.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,this._configuration.sampleSignedDistanceFieldTexelCenter=this.parameters.sampleSignedDistanceFieldTexelCenter,this._configuration.hasRotation=this.parameters.hasRotation,this._configuration.hasVVSize=!!this.parameters.vvSize,this._configuration.hasVVColor=!!this.parameters.vvColor,this._configuration.occlusionPass=13===t.slot,this._configuration.occludedFragmentFade=!i&&this.parameters.occludedFragmentFade,this._configuration.horizonCullingEnabled=this.parameters.horizonCullingEnabled,this._configuration.isFocused=this.parameters.isFocused,this._configuration.depthTestEnabled=this.parameters.depthEnabled||13===t.slot,F(e)&&(this._configuration.debugDrawLabelBorder=!!C.LABELS_SHOW_BORDER),this._configuration.oitPass=t.oitPass,this._configuration.terrainDepthTest=t.terrainDepthTest,this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration}intersect(e,t,s,a,n,o){const{options:{selectionMode:l,hud:c,excludeLabels:S},point:y,camera:z}=s,{parameters:P}=this;if(!l||!c||S&&P.isLabel||!e.visible||!y||!z)return;const j=e.attributes.get("featureAttribute"),R=null==j?null:_(j.data,Se),{scaleX:D,scaleY:M}=De(R,P,z.pixelRatio),V=e.attributes.get("position"),C=e.attributes.get("size"),A=e.attributes.get("normal"),F=e.attributes.get("rotation"),w=e.attributes.get("centerOffsetAndDistance");B(V.size>=3);const T=J(P),E="screen"===this.parameters.centerOffsetUnits;for(let _=0;_<V.data.length/V.size;_++){const e=_*V.size;u(le,V.data[e],V.data[e+1],V.data[e+2]),f(le,le,t),f(le,le,z.viewMatrix);const a=_*w.size;if(u(ve,w.data[a],w.data[a+1],w.data[a+2]),!E&&(le[0]+=ve[0],le[1]+=ve[1],0!==ve[2])){const e=ve[2];p(ve,le),h(le,le,d(ve,ve,e))}const n=_*A.size;u(ce,A.data[n],A.data[n+1],A.data[n+2]),m(ce,ce,i(me,t));const{normal:l,cosAngle:c}=ae(ce,z,ye),S=Ve(this.parameters,le,c,z,oe);if(g(le,le,l,S),z.applyProjection(le,ue),ue[0]>-1){E&&(ve[0]||ve[1])&&(ue[0]+=ve[0]*z.pixelRatio,0!==ve[1]&&(ue[1]+=oe.alignmentEvaluator.apply(ve[1])*z.pixelRatio),z.unapplyProjection(ue,le)),ue[0]+=this.parameters.screenOffset[0]*z.pixelRatio,ue[1]+=this.parameters.screenOffset[1]*z.pixelRatio,ue[0]=Math.floor(ue[0]),ue[1]=Math.floor(ue[1]);const e=_*C.size;Pe[0]=C.data[e],Pe[1]=C.data[e+1],oe.evaluator.applyVec2(Pe,Pe);const t=ze*z.pixelRatio;let i=0;if(P.textureIsSignedDistanceField){i=Math.min(P.outlineSize,.5*Pe[0])*z.pixelRatio/2}Pe[0]*=D,Pe[1]*=M;const a=_*F.size,n=P.rotation+F.data[a];if(ne(y,ue[0],ue[1],Pe,t,i,n,P,T)){const e=s.ray;if(f(pe,le,r(ge,z.viewMatrix)),ue[0]=y[0],ue[1]=y[1],z.unprojectFromRenderScreen(ue,le)){const t=O();b(t,e.direction);const i=1/v(t);d(t,t,i);o(x(e.origin,le)*i,t,-1,pe)}}}}}intersectDraped(e,t,i,s,r){const a=e.attributes.get("position"),n=e.attributes.get("size"),o=e.attributes.get("rotation"),l=this.parameters,c=J(l),u=e.attributes.get("featureAttribute"),f=null==u?null:_(u.data,Se),{scaleX:p,scaleY:h}=De(f,l,e.screenToWorldRatio),d=Oe*e.screenToWorldRatio;for(let m=0;m<a.data.length/a.size;m++){const t=m*a.size,u=a.data[t],f=a.data[t+1],g=m*n.size;Pe[0]=n.data[g],Pe[1]=n.data[g+1];let b=0;if(l.textureIsSignedDistanceField){b=Math.min(l.outlineSize,.5*Pe[0])*e.screenToWorldRatio/2}Pe[0]*=p,Pe[1]*=h;const v=m*o.size,x=l.rotation+o.data[v];ne(i,u,f,Pe,d,b,x,l,c)&&s(r.distance,r.normal,-1)}}createBufferWriter(){return new Re}applyShaderOffsets(e,t,s,r,a,n,o){m(fe,s,i(me,r));const l=ae(fe,n,ye),c=Me(v(t),n),u=Ve(this.parameters,t,l.cosAngle,n,o);g(t,t,l.normal,u+c),g(e,e,fe,u+c);const f=a[3]+u;this._applyPolygonOffsetView(t,l,f,n,t),this._applyCenterOffsetView(t,a,t)}applyShaderOffsetsNDC(e,t,i,s,r){return this._applyCenterOffsetNDC(e,t,i,s),null!=r&&b(r,s),this._applyPolygonOffsetNDC(s,t,i,s),s}_applyPolygonOffsetView(t,i,s,r,a){const n=r.aboveGround?1:-1;let o=Math.sign(s);0===o&&(o=n);const l=n*o;if(this.parameters.shaderPolygonOffset<=0)return b(a,t);const c=e(Math.abs(i.cosAngle),.01,1),u=1-Math.sqrt(1-c*c)/c/r.viewport[2];return d(a,t,l>0?u:1/u),a}_applyCenterOffsetView(e,t,i){const s="screen"!==this.parameters.centerOffsetUnits;return i!==e&&b(i,e),s&&(i[0]+=t[0],i[1]+=t[1],t[2]&&(p(ce,i),S(i,i,d(ce,ce,t[2])))),i}_applyCenterOffsetNDC(e,t,i,s){const r="screen"!==this.parameters.centerOffsetUnits;return s!==e&&b(s,e),r||(s[0]+=t[0]/i.fullWidth*2,s[1]+=t[1]/i.fullHeight*2),s}_applyPolygonOffsetNDC(e,t,i,s){const r=this.parameters.shaderPolygonOffset;if(e!==s&&b(s,e),r){const e=i.aboveGround?1:-1,a=e*Math.sign(t[3]);s[2]-=(a||e)*r}return s}set visible(e){this._visible=e}get visible(){const{color:e,outlineSize:t,outlineColor:i}=this.parameters,s=e[3]>=te||t>=te&&i[3]>=te;return this._visible&&s}createGLMaterial(e){return new se(e)}calculateRelativeScreenBounds(e,t,i=D()){return re(this.parameters,e,t,i),i[2]=i[0]+e[0],i[3]=i[1]+e[1],i}}class se extends E{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.getTechnique($,e)}}function re(e,t,i,s){s[0]=e.anchorPosition[0]*-t[0]+e.screenOffset[0]*i,s[1]=e.anchorPosition[1]*-t[1]+e.screenOffset[1]*i}function ae(e,t,i){return f(i.normal,e,t.viewInverseTransposeMatrix),i.cosAngle=y(i.normal,_e),i}function ne(e,i,s,r,a,l,c,u,f){let p=i-a-r[0]*f[0],h=p+r[0]+2*a,d=s-a-r[1]*f[1],m=d+r[1]+2*a;const g=u.distanceFieldBoundingBox;return u.textureIsSignedDistanceField&&null!=g&&(p+=r[0]*g[0],d+=r[1]*g[1],h-=r[0]*(1-g[2]),m-=r[1]*(1-g[3]),p-=l,h+=l,d-=l,m+=l),n(de,i,s),o(he,e,de,t(c)),he[0]>p&&he[0]<h&&he[1]>d&&he[1]<m}const oe=new U,le=O(),ce=O(),ue=j(),fe=O(),pe=O(),he=c(),de=c(),me=s(),ge=a(),be=j(),ve=O(),xe=O(),Se=j(),ye={normal:O(),cosAngle:0},ze=1,Oe=2,Pe=l(0,0),_e=P(0,0,1);class je extends T{constructor(){super(...arguments),this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1,this.color=R(1,1,1,1),this.polygonOffset=!1,this.anchorPosition=l(.5,.5),this.screenOffset=[0,0],this.shaderPolygonOffset=1e-5,this.textureIsSignedDistanceField=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.outlineColor=R(1,1,1,1),this.outlineSize=0,this.distanceFieldBoundingBox=j(),this.rotation=0,this.hasRotation=!1,this.vvSizeEnabled=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.hasSlicePlane=!1,this.pixelSnappingEnabled=!0,this.useVisibilityPixel=!0,this.occludedFragmentFade=!1,this.horizonCullingEnabled=!1,this.occludedVisibilityMode="hidden",this.centerOffsetUnits="world",this.drawAsLabel=!1,this.depthEnabled=!0,this.isFocused=!0,this.focusStyle="bright",this.draped=!1,this.isLabel=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}class Re{constructor(){this.layout=Q(),this.baseInstanceLayout=Z}elementCount(e){return e.get("position").indices.length}elementCountBaseInstance(e){return e.get("uv0").indices.length}write(e,t,i,s,r,a){const{position:n,normal:o,color:l,size:c,rotation:u,centerOffsetAndDistance:f,featureAttribute:p,uvi:h}=r;I(i.get("position"),e,n,a),W(i.get("normal"),t,o,a);const d=i.get("position").indices.length;let m=0,g=0,b=K,v=K;const x=i.get("uvi")?.data;x&&x.length>=4&&(m=x[0],g=x[1],b=x[2],v=x[3]);for(let S=0;S<d;++S){const e=a+S;h.setValues(e,m,g,b,v)}if(H(i.get("color"),4,l,a),G(i.get("size"),c,a),N(i.get("rotation"),u,a),i.get("centerOffsetAndDistance")?X(i.get("centerOffsetAndDistance"),f,a):Y(f,a,d),i.get("featureAttribute")?X(i.get("featureAttribute"),p,a):Y(p,a,d),null!=s){const e=i.get("position")?.indices;if(e){const t=e.length,i=r.getField("olidColor",M);q(s,i,t,a)}}return{numVerticesPerItem:1,numItems:d}}writeBaseInstance(e,t){const{uv0:i}=t;G(e.get("uv0"),i,0)}intersect(e,t,i,s,a,n,o){const{options:{selectionMode:l,hud:c,excludeLabels:m},point:S,camera:y}=s;if(!l||!c||m&&t.isLabel||!S)return;const P=this.layout.createView(e),{position:_,normal:j,rotation:R,size:D,featureAttribute:M,centerOffsetAndDistance:V}=P,C="screen"===t.centerOffsetUnits,A=J(t);if(null==_||null==j||null==R||null==D||null==V||null==y)return;const F=null==M?null:M.getVec(0,Se),{scaleX:w,scaleY:T}=De(F,t,y.pixelRatio),E=_.count;for(let L=0;L<E;L++){if(_.getVec(L,le),null!=i&&z(le,le,i),f(le,le,y.viewMatrix),V.getVec(L,be),u(ve,be[0],be[1],be[2]),!C&&(le[0]+=ve[0],le[1]+=ve[1],0!==ve[2])){const e=ve[2];p(ve,le),h(le,le,d(ve,ve,e))}j.getVec(L,ce),ae(ce,y,ye);const e=Ve(t,le,ye.cosAngle,y,oe);if(g(le,le,ye.normal,e),y.applyProjection(le,ue),ue[0]>-1){C&&(ve[0]||ve[1])&&(ue[0]+=ve[0]*y.pixelRatio,0!==ve[1]&&(ue[1]+=oe.alignmentEvaluator.apply(ve[1])*y.pixelRatio),y.unapplyProjection(ue,le)),ue[0]+=t.screenOffset[0]*y.pixelRatio,ue[1]+=t.screenOffset[1]*y.pixelRatio,ue[0]=Math.floor(ue[0]),ue[1]=Math.floor(ue[1]),D.getVec(L,Pe),oe.evaluator.applyVec2(Pe,Pe);const e=ze*y.pixelRatio;let i=0;if(t.textureIsSignedDistanceField){i=Math.min(t.outlineSize,.5*Pe[0])*y.pixelRatio/2}Pe[0]*=w,Pe[1]*=T;const a=R.get(L),n=t.rotation+a;if(ne(S,ue[0],ue[1],Pe,e,i,n,t,A)){const e=s.ray;if(f(pe,le,r(ge,y.viewMatrix)),ue[0]=S[0],ue[1]=S[1],y.unprojectFromRenderScreen(ue,le)){const t=O();b(t,e.direction);const i=1/v(t);d(t,t,i);o(x(e.origin,le)*i,t,L,pe)}}}}}}function De(e,t,i){return null==e||null==t.vvSize?{scaleX:i,scaleY:i}:(V(xe,t,e),{scaleX:xe[0]*i,scaleY:xe[1]*i})}function Me(e,t){const i=t.computeRenderPixelSizeAtDist(e)*w;return(t.aboveGround?1:-1)*i}function Ve(e,t,i,s,r){if(!e.verticalOffset?.screenLength){const s=v(t);return r.update(i,s,e.screenSizePerspective,e.screenSizePerspectiveMinPixelReferenceSize,e.screenSizePerspectiveAlignment,null),0}const a=v(t),n=e.screenSizePerspectiveAlignment??e.screenSizePerspective,o=k(s,a,e.verticalOffset,i,n,e.screenSizePerspectiveMinPixelReferenceSize);return r.update(i,a,e.screenSizePerspective,e.screenSizePerspectiveMinPixelReferenceSize,e.screenSizePerspectiveAlignment,null),o}export{ie as HUDMaterial,je as Parameters};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{isColor as r}from"../core/shaderLibrary/ShaderOutput.js";import{InstancedDoubleConfiguration as e}from"../core/shaderLibrary/attributes/InstancedDoubleConfiguration.js";import t from"../lib/GLMaterial.js";import{DefaultBufferWriter as i}from"./DefaultBufferWriter.js";import{PositionUvLayout as s}from"./DefaultLayouts.js";import{TriangleMaterial as o}from"./TriangleMaterial.js";import{SlicePlaneMaterialPassParameters as a,SlicePlaneMaterialTechnique as n}from"../shaders/SlicePlaneMaterialTechnique.js";class u extends o{constructor(t){super(t,f),this.visible=!0,this.produces=new Map([[9,e=>r(e)]]),this._configuration=new e}createGLMaterial(r){return new c(r)}createBufferWriter(){return new i(s)}getConfiguration(){return this._configuration}}class c extends t{constructor(r){super(r)}beginSlot(r){return this.getTechnique(n,r)}}class f extends a{constructor(){super(...arguments),this.renderOccluded=1,this.isDecoration=!1}}export{f as Parameters,u as SlicePlaneMaterial};
5
+ import{isColor as r}from"../core/shaderLibrary/ShaderOutput.js";import{InstancedDoubleConfiguration as e}from"../core/shaderLibrary/attributes/InstancedDoubleConfiguration.js";import t from"../lib/GLMaterial.js";import{DefaultBufferWriter as s}from"./DefaultBufferWriter.js";import{PositionUvLayout as i}from"./DefaultLayouts.js";import{TriangleMaterial as o}from"./TriangleMaterial.js";import{SlicePlaneMaterialPassParameters as a,SlicePlaneMaterialTechnique as n}from"../shaders/SlicePlaneMaterialTechnique.js";class u extends o{constructor(t){super(t,f),this.visible=!0,this.produces=new Map([[9,e=>r(e)]]),this._configuration=new e}createGLMaterial(r){return new c(r)}createBufferWriter(){return new s(i)}getConfiguration(){return this._configuration}}class c extends t{constructor(r){super(r)}beginSlot(r){return this.getTechnique(n,r)}}class f extends a{constructor(){super(...arguments),this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1}}export{f as Parameters,u as SlicePlaneMaterial};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{VisualVariablesParameters as s}from"../../layers/support/FastSymbolUpdates.js";class t extends s{constructor(){super(...arguments),this.renderOccluded=1,this.isDecoration=!1}}const r=8;export{t as VisualVariablePassParameters,r as vvColorNumber};
5
+ import{VisualVariablesParameters as s}from"../../layers/support/FastSymbolUpdates.js";class r extends s{constructor(){super(...arguments),this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1}}const t=8;export{r as VisualVariablePassParameters,t as vvColorNumber};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import"../../../../../core/has.js";import{property as t,subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{SyncRenderPlugin as s}from"../../effects/RenderPlugin.js";import{MergedBuffer as i}from"./MergedBuffer.js";import{VaoRenderer as a}from"./VaoRenderer.js";let n=class extends s{constructor(e){super(e),this._dataByBaseInstance=new Map,this._buffer=null,this._renderer=null,this.drapedPriority=0}initialize(){this._buffer=new i({material:this.material,dataByBaseInstance:this._dataByBaseInstance,highlightOrderMap:this.highlightOrderMap}),this._renderer=new a({material:this.material,dataByBaseInstance:this._dataByBaseInstance})}destroy(){for(const e of this._dataByBaseInstance.values())e.dispose();this._dataByBaseInstance.clear(),this._buffer.destroy(),this._renderer.destroy()}hasHighlight(e){return this._renderer.hasHighlight(e)}initializeRenderContext(e){this._buffer.initializeRenderContext(e),this._renderer.initializeRenderContext(e)}uninitializeRenderContext(){this._buffer.uninitializeRenderContext(),this._renderer.uninitializeRenderContext()}get produces(){return this._renderer.produces}get hasOccludees(){return this._buffer.hasOccludees}get hasOnlyOccluders(){return!!(-2&this.renderOccludedFlags)}get hasEmitters(){return this.material.hasEmissions}get isDecoration(){return this.material.parameters.isDecoration}get renderOccludedFlags(){return this.material.renderOccludedFlags}get numGeometries(){let e=0;for(const t of this._dataByBaseInstance.values())for(const r of t.dataByOrigin.values())e+=r.buffers.reduce((e,t)=>e+t.instances.size,0);return e}get usedMemory(){let e=0;for(const t of this._dataByBaseInstance.values())for(const r of t.dataByOrigin.values())e+=r.buffers.reduce((e,t)=>e+t.vao.usedMemory,0);return e}forEachGeometry(e){for(const t of this._dataByBaseInstance.values())for(const r of t.dataByOrigin.values())for(const t of r.buffers)for(const{geometry:r}of t.instances.values())e(r)}modify(e,t){this._buffer.modify(e,t),this._renderer.updateHighlights()}get canCompact(){return this._buffer.canCompact}compact(e){return this._buffer.compact(e)}updateHighlights(e){this.highlightOrderMap=e,this._buffer.updateHighlights(e),this._renderer.updateHighlights()}updateAnimation(e){return this.material.update(e)}acquireTechniques(e){return this._renderer.acquireTechniques(e)}render(e,t){return this._renderer.render(e,t)}static prune(){i.prune()}get test(){}};e([t({constructOnly:!0})],n.prototype,"material",void 0),e([t()],n.prototype,"highlightOrderMap",void 0),n=e([r("esri.views.3d.webgl-engine.materials.renderers.MergedRenderer")],n);export{n as MergedRenderer};
5
+ import{__decorate as e}from"tslib";import"../../../../../core/has.js";import{property as t,subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{SyncRenderPlugin as s}from"../../effects/RenderPlugin.js";import{MergedBuffer as i}from"./MergedBuffer.js";import{VaoRenderer as a}from"./VaoRenderer.js";let n=class extends s{constructor(e){super(e),this._dataByBaseInstance=new Map,this._buffer=null,this._renderer=null,this.drapedPriority=0}initialize(){this._buffer=new i({material:this.material,dataByBaseInstance:this._dataByBaseInstance,highlightOrderMap:this.highlightOrderMap}),this._renderer=new a({material:this.material,dataByBaseInstance:this._dataByBaseInstance})}destroy(){for(const e of this._dataByBaseInstance.values())e.dispose();this._dataByBaseInstance.clear(),this._buffer.destroy(),this._renderer.destroy()}hasHighlight(e){return this._renderer.hasHighlight(e)}initializeRenderContext(e){this._buffer.initializeRenderContext(e),this._renderer.initializeRenderContext(e)}uninitializeRenderContext(){this._buffer.uninitializeRenderContext(),this._renderer.uninitializeRenderContext()}get produces(){return this._renderer.produces}get hasOccludees(){return this._buffer.hasOccludees}get hasOnlyOccluders(){return!!(-2&this.renderOccludedFlags)}get hasEmitters(){return this.material.hasEmissions}get isDecoration(){return this.material.parameters.isDecoration}get renderOccludedFlags(){return this.material.renderOccludedFlags}get testsTransparentRenderOrder(){return 0}get numGeometries(){let e=0;for(const t of this._dataByBaseInstance.values())for(const r of t.dataByOrigin.values())e+=r.buffers.reduce((e,t)=>e+t.instances.size,0);return e}get usedMemory(){let e=0;for(const t of this._dataByBaseInstance.values())for(const r of t.dataByOrigin.values())e+=r.buffers.reduce((e,t)=>e+t.vao.usedMemory,0);return e}forEachGeometry(e){for(const t of this._dataByBaseInstance.values())for(const r of t.dataByOrigin.values())for(const t of r.buffers)for(const{geometry:r}of t.instances.values())e(r)}modify(e,t){this._buffer.modify(e,t),this._renderer.updateHighlights()}get canCompact(){return this._buffer.canCompact}compact(e){return this._buffer.compact(e)}updateHighlights(e){this.highlightOrderMap=e,this._buffer.updateHighlights(e),this._renderer.updateHighlights()}updateAnimation(e){return this.material.update(e)}acquireTechniques(e){return this._renderer.acquireTechniques(e)}render(e,t){return this._renderer.render(e,t)}static prune(){i.prune()}get test(){}};e([t({constructOnly:!0})],n.prototype,"material",void 0),e([t()],n.prototype,"highlightOrderMap",void 0),n=e([r("esri.views.3d.webgl-engine.materials.renderers.MergedRenderer")],n);export{n as MergedRenderer};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{ZEROS as i,freeze as s,create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as o}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{glLayout as l}from"../../support/buffer/glUtil.js";import{newLayout as n}from"../../support/buffer/InterleavedLayout.js";import{isColor as a}from"../core/shaderLibrary/ShaderOutput.js";import{VertexNormalPassParameters as c,VertexNormalDrawParameters as h}from"../core/shaderLibrary/attributes/VertexNormal.glsl.js";import{ReloadableShader as u}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as m,depthOnlyOutputBuffersOr as p}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as d}from"../effects/geometry/olidUtils.js";import{oitPolygonOffset as f,depthWrite as v,depthTest as b,blending as g,drawBuffers as S}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as y,stencilBaseAllZerosParams as j,stencilWriteMaskOn as x}from"../lib/StencilUtils.js";import{getRenderInstanceDataLayout as C}from"../lib/lodRendering/RenderInstanceData.js";import{advancedMRRFactors as P}from"../materials/pbrUtils.js";import{D as T}from"../../../../chunks/DefaultMaterial.glsl.js";import{makePipelineState as O,cullingParams as D,defaultColorWrite as w}from"../../../webgl/renderState.js";import{alphaCutoff as V}from"../../../../webscene/support/AlphaCutoff.js";class A extends c{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=P,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=2,this.instanced=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.instanceColorEncodesAlphaIgnore=!1,this.emissiveStrengthFromSymbol=0,this.emissiveStrengthKHR=1,this.emissiveSource=1,this.emissiveBaseColor=i,this.instancedDoublePrecision=!1,this.normalType=0,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=s(.2,.2,.2),this.diffuse=s(.8,.8,.8),this.externalColor=o(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=r(),this.hasSlicePlane=!1,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.drivenOpacity=!1,this.writeDepth=!0,this.customDepthTest=0,this.textureAlphaMode=0,this.textureAlphaCutoff=V,this.textureAlphaPremultiplied=!1,this.renderOccluded=1,this.isDecoration=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}class M extends h{constructor(){super(...arguments),this.origin=r(),this.slicePlaneLocalOrigin=this.origin}}let F=class extends m{constructor(e,t){let i=l(z(t));t.instanced&&t.instancedDoublePrecision&&(i=i.concat(l(C(t)))),super(e,t,i),this.shader=new u(T,()=>import("./DefaultMaterial.glsl.js"))}_makePipeline(e,t){const{oitPass:i,output:s,hasEmission:r,transparent:o,cullFace:l,customDepthTest:n,hasOccludees:c}=e;return O({blending:a(s)&&o?g(i):null,culling:k(e)?D(l):null,depthTest:b(i,R(n)),depthWrite:v(e),drawBuffers:p(s,S(i,r)),colorWrite:w,stencilWrite:c?x:null,stencilTest:c?t?y:j:null,polygonOffset:f(e)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e,t){return t?this._occludeePipelineState:super.getPipeline(e)}};function R(e){switch(e){case 1:return 515;case 0:case 3:return 513;case 2:return 516}}function k(e){return 0!==e.cullFace||!e.hasSlicePlane&&(!e.transparent&&!e.doubleSidedMode)}function z(e){const t=n().vec3f("position");return 1===e.normalType?t.vec2i16("normalCompressed",{glNormalized:!0}):t.vec3f("normal"),e.hasVertexTangents&&t.vec4f("tangent"),e.hasTextures&&t.vec2f16("uv0"),e.hasVertexColors&&t.vec4u8("color"),e.hasSymbolColors&&t.vec4u8("symbolColor"),!e.instanced&&d()&&t.vec4u8("olidColor"),t}F=e([t("esri.views.3d.webgl-engine.shaders.DefaultMaterialTechnique")],F);export{M as DefaultMaterialDrawParameters,A as DefaultMaterialPassParameters,F as DefaultMaterialTechnique,z as getLayout};
5
+ import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{ZEROS as i,freeze as s,create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as o}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{glLayout as l}from"../../support/buffer/glUtil.js";import{newLayout as n}from"../../support/buffer/InterleavedLayout.js";import{isColor as a}from"../core/shaderLibrary/ShaderOutput.js";import{VertexNormalPassParameters as c,VertexNormalDrawParameters as h}from"../core/shaderLibrary/attributes/VertexNormal.glsl.js";import{ReloadableShader as u}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as m,depthOnlyOutputBuffersOr as p}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as d}from"../effects/geometry/olidUtils.js";import{oitPolygonOffset as f,depthWrite as v,depthTest as b,blending as g,drawBuffers as S}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as y,stencilBaseAllZerosParams as j,stencilWriteMaskOn as x}from"../lib/StencilUtils.js";import{getRenderInstanceDataLayout as T}from"../lib/lodRendering/RenderInstanceData.js";import{advancedMRRFactors as C}from"../materials/pbrUtils.js";import{D as P}from"../../../../chunks/DefaultMaterial.glsl.js";import{makePipelineState as O,cullingParams as D,defaultColorWrite as w}from"../../../webgl/renderState.js";import{alphaCutoff as V}from"../../../../webscene/support/AlphaCutoff.js";class A extends c{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=C,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=2,this.instanced=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.instanceColorEncodesAlphaIgnore=!1,this.emissiveStrengthFromSymbol=0,this.emissiveStrengthKHR=1,this.emissiveSource=1,this.emissiveBaseColor=i,this.instancedDoublePrecision=!1,this.normalType=0,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=s(.2,.2,.2),this.diffuse=s(.8,.8,.8),this.externalColor=o(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=r(),this.hasSlicePlane=!1,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.drivenOpacity=!1,this.writeDepth=!0,this.customDepthTest=0,this.textureAlphaMode=0,this.textureAlphaCutoff=V,this.textureAlphaPremultiplied=!1,this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}class M extends h{constructor(){super(...arguments),this.origin=r(),this.slicePlaneLocalOrigin=this.origin}}let R=class extends m{constructor(e,t){let i=l(z(t));t.instanced&&t.instancedDoublePrecision&&(i=i.concat(l(T(t)))),super(e,t,i),this.shader=new u(P,()=>import("./DefaultMaterial.glsl.js"))}_makePipeline(e,t){const{oitPass:i,output:s,hasEmission:r,transparent:o,cullFace:l,customDepthTest:n,hasOccludees:c}=e;return O({blending:a(s)&&o?g(i):null,culling:k(e)?D(l):null,depthTest:b(i,F(n)),depthWrite:v(e),drawBuffers:p(s,S(i,r)),colorWrite:w,stencilWrite:c?x:null,stencilTest:c?t?y:j:null,polygonOffset:f(e)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e,t){return t?this._occludeePipelineState:super.getPipeline(e)}};function F(e){switch(e){case 1:return 515;case 0:case 3:return 513;case 2:return 516}}function k(e){return 0!==e.cullFace||!e.hasSlicePlane&&(!e.transparent&&!e.doubleSidedMode)}function z(e){const t=n().vec3f("position");return 1===e.normalType?t.vec2i16("normalCompressed",{glNormalized:!0}):t.vec3f("normal"),e.hasVertexTangents&&t.vec4f("tangent"),e.hasTextures&&t.vec2f16("uv0"),e.hasVertexColors&&t.vec4u8("color"),e.hasSymbolColors&&t.vec4u8("symbolColor"),!e.instanced&&d()&&t.vec4u8("olidColor"),t}R=e([t("esri.views.3d.webgl-engine.shaders.DefaultMaterialTechnique")],R);export{M as DefaultMaterialDrawParameters,A as DefaultMaterialPassParameters,R as DefaultMaterialTechnique,z as getLayout};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{dedupeResult as t}from"../../../core/dedupeResult.js";import{equalsShallow as r}from"../../../core/lang.js";import{watch as o}from"../../../core/reactiveUtils.js";import{getMetersPerVerticalUnitForSR as i}from"../../../core/units.js";import{property as n,subclass as s}from"../../../core/accessorSupport/decorators.js";import{ElevationProfileLineComputation as l}from"./ElevationProfileLineComputation.js";import{getGroundMinDemResolution as a}from"./elevationProfileQuerySourceUtils.js";let u=class extends l{constructor(){super(...arguments),this.type="ground",this.numSamplesForPreview=50,this.numSamplesPerChunk=1e3,this._getStableQueryElevationDependencies=t(()=>({ground:this._ground,groundLayers:this._getStableGroundLayers()}),r),this._getStableGroundLayers=t(()=>this._ground?.layers?.toArray(),r)}get minDemResolution(){return a(this._ground)}get available(){return!0===this._ground?.layers.some(e=>e.visible)}initialize(){this.addHandles([o(()=>this._queryElevationDependencies,()=>this.onInvalidate(this)),o(()=>this._ground,e=>{e&&!e.loaded&&e.load()},{initial:!0})])}async queryElevation(e,t){const r=this._queryElevationDependencies;if(null==r)throw new Error(`${this.declaredClass}: no dependencies`);const{ground:o}=r;if(null==o)throw new Error("No ground configured in the view");const n=await o.queryElevation(e,t),s=i(e.spatialReference),l=i(o.layers.at(0).spatialReference);if(s!==l){const e=n.geometry;e.points=e.points.map(([e,r,o])=>[e,r,o===t.noDataValue?o:o*l/s])}return n}get _queryElevationDependencies(){return this._getStableQueryElevationDependencies()}get _ground(){return this.controller.view?.map?.ground}};e([n()],u.prototype,"minDemResolution",null),e([n()],u.prototype,"available",null),e([n()],u.prototype,"_queryElevationDependencies",null),e([n()],u.prototype,"_ground",null),u=e([s("esri.views.analysis.ElevationProfile.ElevationProfileLineGroundComputation")],u);export{u as ElevationProfileLineGroundComputation};
5
+ import{__decorate as e}from"tslib";import{dedupeResult as r}from"../../../core/dedupeResult.js";import{equalsShallow as t}from"../../../core/lang.js";import{watch as o}from"../../../core/reactiveUtils.js";import{getMetersPerVerticalUnitForSR as n}from"../../../core/units.js";import{property as i,subclass as s}from"../../../core/accessorSupport/decorators.js";import{ElevationProfileLineComputation as a}from"./ElevationProfileLineComputation.js";import{getGroundMinDemResolution as l}from"./elevationProfileQuerySourceUtils.js";let u=class extends a{constructor(){super(...arguments),this.type="ground",this.numSamplesForPreview=50,this.numSamplesPerChunk=1e3,this._getStableQueryElevationDependencies=r(()=>({ground:this._ground,groundLayers:this._getStableGroundLayers()}),t),this._getStableGroundLayers=r(()=>this._ground?.layers?.toArray(),t)}get minDemResolution(){return l(this._ground)}get available(){return!0===this._ground?.layers.some(e=>e.visible)||!0===this._groundLayers?.some(e=>e.visible)}initialize(){this.addHandles([o(()=>this._queryElevationDependencies,()=>this.onInvalidate(this)),o(()=>this._ground,e=>{e&&!e.loaded&&e.load()},{initial:!0})])}async queryElevation(e,r){const t=this._queryElevationDependencies;if(null==t)throw new Error(`${this.declaredClass}: no dependencies`);const{ground:o}=t;if(null==o)throw new Error("No ground configured in the view");const i=await o.queryElevation(e,r),s=n(e.spatialReference),a=n(o.allLayers.at(0).spatialReference);if(s!==a){const e=i.geometry;e.points=e.points.map(([e,t,o])=>[e,t,o===r.noDataValue?o:o*a/s])}return i}get _queryElevationDependencies(){return this._getStableQueryElevationDependencies()}get _ground(){return this.controller.view?.map?.ground}get _groundLayers(){return this.controller.view?.map?.basemap?.groundLayers}};e([i()],u.prototype,"minDemResolution",null),e([i()],u.prototype,"available",null),e([i()],u.prototype,"_queryElevationDependencies",null),e([i()],u.prototype,"_ground",null),e([i()],u.prototype,"_groundLayers",null),u=e([s("esri.views.analysis.ElevationProfile.ElevationProfileLineGroundComputation")],u);export{u as ElevationProfileLineGroundComputation};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{splitIntoChunks as e}from"../../../core/arrayUtils.js";import{lerp as t}from"../../../core/mathUtils.js";import{throwIfAborted as r,throwIfNotAbortError as n,after as o}from"../../../core/promiseUtils.js";import s from"../../../geometry/Multipoint.js";import{unnormalizedCoordinate as i}from"../../../geometry/support/coordsUtils.js";import{getInfo as l}from"../../../geometry/support/spatialReferenceUtils.js";import{getConfig as a}from"./constants.js";import{InvalidGeometryError as c,TooComplexError as u,ElevationQueryError as p}from"./elevationProfileErrors.js";import{isValidInputPath as f,countPoints as m,densifyPath as d}from"./elevationProfileGeometryUtils.js";import{getStatistics as h}from"./elevationProfileStatisticsUtils.js";import{breadthFirstBinaryPartitioning as y}from"./elevationProfileTraversalUtils.js";import{ScheduledQueueProcessor as w}from"../../support/ScheduledQueueProcessor.js";import{TaskPriority as g}from"../../support/Scheduler.js";async function*v(e,t){const{view:n,geometry:s,elevationInfo:i,providers:l,options:p}=e,h=n.spatialReference;if(!h||null==s||!f(s))throw new c;const y=l.length;if(0===y)return null;const w=Math.round(p.maxTotalSamples/y);if(m(s)>w)throw new u;const g=await d(s,i,n,h,p,w,t);r(t);let v=0;const j=new Array(y),R=new Array(y);for(let r=0;r<y;r++){const n=x(g);j[r]=n,v+=n.samples.length;const o={...e,provider:l[r],result:n,densificationResult:g};R[r]=P(o,t)[Symbol.iterator]()}if(v>p.maxTotalSamples)throw new u;const Z=await Promise.all(R.map(e=>{const t=e.next();return!0===t.done?Promise.resolve(null):t.value}));r(t);for(let r=0;r<y;r++)j[r]=Z[r];yield j,await o(e.delayAfterPreview??a().delayAfterPreviewMillis,null,t.signal),r(t);const S=[];try{let e;do{e=!1;for(let t=0;t<y;t++){const r=R[t].next();!1===r.done&&(S.push({resultPromise:r.value,index:t}),e=!0)}}while(e)}finally{R.forEach(e=>e.return?.())}for(const{resultPromise:o,index:a}of S)j[a]=await o,r(t),yield j;for(const r of j)null!=r&&(r.progress=1);yield j}function*P(t,r){const{densificationResult:n}=t,o={...t,abortOptions:r,densificationResult:n},s=y(0,o.result.samples.length),i=s.slice(0,o.provider.numSamplesForPreview);yield j(o,i,!0);const l=e(s,o.provider.numSamplesPerChunk);for(const e of l)yield j(o,e,!1)}async function j({densificationResult:e,result:t,provider:r,queue:o,abortOptions:i,cache:l},c,u){const{densifiedPath:p,pathLength:f}=e,m=t.spatialReference,{samples:d}=t,h=[];for(let n=0;n<c.length;n++){const e=d[c[n]];h[n]=[...e.coordinate]}try{return await o.push({geometry:new s({spatialReference:m,points:h,hasZ:p.hasZ}),provider:r,indices:c,preview:u,result:t,parameters:{...a().defaultQueryOptions(),minDemResolution:u?Math.round(f/r.numSamplesForPreview):Math.round(f/d.length),cache:l}},i),{...t}}catch(y){return n(y),null}}function R(e){return new w({priority:g.ELEVATION_PROFILE,concurrency:1,scheduler:e,process:async e=>{r(e.parameters);try{await Z(e)}catch(t){n(t)}}})}async function Z({geometry:e,provider:t,indices:r,preview:n,result:o,parameters:s}){if(0===r.length)return;const i=(await O(t,e,s)).geometry,{hasZ:l,points:a}=i,c=s.noDataValue,{samples:u}=o;for(let p=0;p<r.length;p++){const e=u[r[p]];if(e.isHole)continue;const t=l?a[p][2]:null;null===t||t===c?e.sampledZ=null:(o.hasZ=!0,e.sampledZ=t),e.sampled=!0}S(u),o.progress=n?0:o.progress+r.length/u.length,o.statistics=h(o.samples,o.spatialReference)}function S(e){const t=e.length-1;let r=0;for(let n=1;n<=t;n++){(e[n].sampled||n===t)&&(U(e,r,n),r=n)}}function U(e,r,n){if(n-r===1)return;const o=e[r],s=o.sampledZ,i=e[n],l=i.sampledZ;if(null==s||null==l){for(let t=r+1;t<n;t++)e[t].sampledZ=null;return}const a=o.distance,c=i.distance-a;for(let u=r+1;u<n;u++){const r=e[u],n=(r.distance-a)/c;r.sampledZ=t(s,l,n)}}function x({densifiedPath:e,distances:t}){const r=e.spatialReference,n=l(r),o=e.paths,s=o.length,a=[];let c=null,u=0;for(let l=0;l<s;l++){const e=o[l],r=e.length,s=t[l];for(let t=0;t<r;t++){const r=e[t],o=s[t];n&&(r[0]=i(r[0],n.valid[0],n.valid[1])),c&&0===t&&E(a,c,r,u,o),a.push(M(r,o)),c=r,u=o}}return{progress:0,samples:a,hasZ:!1,statistics:null,spatialReference:r}}function E(e,t,r,n,o){e.push(A(t,n)),e.push(A(r,o))}function M(e,t){return{coordinate:e,distance:t,sampledZ:null,sampled:!1,isHole:!1}}function A(e,t){return{coordinate:e,distance:t,sampledZ:null,sampled:!0,isHole:!0}}async function O(e,t,r){try{return await e.queryElevation(t,r)}catch(n){throw new p}}function T(e,t,r){if(!e||0===e.length)return;const n=e.length-1,o=e[0];if(t<=r(o))return o;const s=e[n];if(t>=r(s))return s;let i=0,l=0,a=n;for(;i<a;){l=i+Math.floor((a-i)/2);const o=e[l],s=r(o);if(s===t)return o;if(t<s){if(l>0){const n=e[l-1],i=r(n);if(t>i)return t-i>=s-t?o:n}a=l}else{if(l<n){const n=e[l+1],i=r(n);if(t<i)return t-s>=i-t?n:o}i=l+1}}return e[l]}function b(e){return e>.999999?1:e}export{T as binaryFindClosest,R as createProfileQueue,P as generateProfile,v as generateProfiles,S as interpolateElevations,b as sanitizeProgress};
5
+ import{splitIntoChunks as e}from"../../../core/arrayUtils.js";import{lerp as t}from"../../../core/mathUtils.js";import{throwIfAborted as r,throwIfNotAbortError as n,after as o}from"../../../core/promiseUtils.js";import s from"../../../geometry/Multipoint.js";import{unnormalizedCoordinate as i}from"../../../geometry/support/coordsUtils.js";import{getInfo as l}from"../../../geometry/support/spatialReferenceUtils.js";import{getConfig as a}from"./constants.js";import{InvalidGeometryError as c,TooComplexError as u,ElevationQueryError as p}from"./elevationProfileErrors.js";import{isValidInputPath as f,countPoints as m,densifyPath as d}from"./elevationProfileGeometryUtils.js";import{getStatistics as h}from"./elevationProfileStatisticsUtils.js";import{breadthFirstBinaryPartitioning as y}from"./elevationProfileTraversalUtils.js";import{ScheduledQueueProcessor as g}from"../../support/ScheduledQueueProcessor.js";import{TaskPriority as w}from"../../support/Scheduler.js";async function*v(e,t){const{view:n,geometry:s,elevationInfo:i,providers:l,options:p}=e,h=n.spatialReference;if(!h||null==s||!f(s))throw new c;const y=l.length;if(0===y)return null;const g=Math.round(p.maxTotalSamples/y);if(m(s)>g)throw new u;const w=await d(s,i,n,h,p,g,t);r(t);let v=0;const j=new Array(y),R=new Array(y);for(let r=0;r<y;r++){const n=x(w);j[r]=n,v+=n.samples.length;const o={...e,provider:l[r],result:n,densificationResult:w};R[r]=P(o,t)[Symbol.iterator]()}if(v>p.maxTotalSamples)throw new u;const Z=await Promise.all(R.map(e=>{const t=e.next();return!0===t.done?Promise.resolve(null):t.value}));r(t);for(let r=0;r<y;r++)j[r]=Z[r];yield j,await o(e.delayAfterPreview??a().delayAfterPreviewMillis,null,t.signal),r(t);const S=[];try{let e;do{e=!1;for(let t=0;t<y;t++){const r=R[t].next();!1===r.done&&(S.push({resultPromise:r.value,index:t}),e=!0)}}while(e)}finally{R.forEach(e=>e.return?.())}for(const{resultPromise:o,index:a}of S)j[a]=await o,r(t),yield j;for(const r of j)null!=r&&(r.progress=1);yield j}function*P(t,r){const{densificationResult:n}=t,o={...t,abortOptions:r,densificationResult:n},s=y(0,o.result.samples.length),i=s.slice(0,o.provider.numSamplesForPreview);yield j(o,i,!0);const l=e(s,o.provider.numSamplesPerChunk);for(const e of l)yield j(o,e,!1)}async function j({densificationResult:e,result:t,provider:r,queue:o,abortOptions:i,cache:l},c,u){const{densifiedPath:p,pathLength:f}=e,m=t.spatialReference,{samples:d}=t,h=[];for(let n=0;n<c.length;n++){const e=d[c[n]];h[n]=[...e.coordinate]}try{return await o.push({geometry:new s({spatialReference:m,points:h,hasZ:p.hasZ}),provider:r,indices:c,preview:u,result:t,parameters:{...a().defaultQueryOptions(),minDemResolution:u?Math.round(f/r.numSamplesForPreview):Math.round(f/d.length),cache:l,signal:i.signal??null,noDataValue:Number.MAX_VALUE}},i),{...t}}catch(y){return n(y),null}}function R(e){return new g({priority:w.ELEVATION_PROFILE,concurrency:1,scheduler:e,process:async e=>{r(e.parameters);try{await Z(e)}catch(t){n(t)}}})}async function Z({geometry:e,provider:t,indices:r,preview:n,result:o,parameters:s}){if(0===r.length)return;const i=await O(t,e,s),l=i.geometry,{hasZ:a,points:c}=l,u=i.noDataValue||s.noDataValue,{samples:p}=o;for(let f=0;f<r.length;f++){const e=p[r[f]];if(e.isHole)continue;const t=a?c[f][2]:null;null===t||t===u?e.sampledZ=null:(o.hasZ=!0,e.sampledZ=t),e.sampled=!0}S(p),o.progress=n?0:o.progress+r.length/p.length,o.statistics=h(o.samples,o.spatialReference)}function S(e){const t=e.length-1;let r=0;for(let n=1;n<=t;n++){(e[n].sampled||n===t)&&(U(e,r,n),r=n)}}function U(e,r,n){if(n-r===1)return;const o=e[r],s=o.sampledZ,i=e[n],l=i.sampledZ;if(null==s||null==l){for(let t=r+1;t<n;t++)e[t].sampledZ=null;return}const a=o.distance,c=i.distance-a;for(let u=r+1;u<n;u++){const r=e[u],n=(r.distance-a)/c;r.sampledZ=t(s,l,n)}}function x({densifiedPath:e,distances:t}){const r=e.spatialReference,n=l(r),o=e.paths,s=o.length,a=[];let c=null,u=0;for(let l=0;l<s;l++){const e=o[l],r=e.length,s=t[l];for(let t=0;t<r;t++){const r=e[t],o=s[t];n&&(r[0]=i(r[0],n.valid[0],n.valid[1])),c&&0===t&&A(a,c,r,u,o),a.push(E(r,o)),c=r,u=o}}return{progress:0,samples:a,hasZ:!1,statistics:null,spatialReference:r}}function A(e,t,r,n,o){e.push(M(t,n)),e.push(M(r,o))}function E(e,t){return{coordinate:e,distance:t,sampledZ:null,sampled:!1,isHole:!1}}function M(e,t){return{coordinate:e,distance:t,sampledZ:null,sampled:!0,isHole:!0}}async function O(e,t,r){try{return await e.queryElevation(t,r)}catch(n){throw new p}}function V(e,t,r){if(!e||0===e.length)return;const n=e.length-1,o=e[0];if(t<=r(o))return o;const s=e[n];if(t>=r(s))return s;let i=0,l=0,a=n;for(;i<a;){l=i+Math.floor((a-i)/2);const o=e[l],s=r(o);if(s===t)return o;if(t<s){if(l>0){const n=e[l-1],i=r(n);if(t>i)return t-i>=s-t?o:n}a=l}else{if(l<n){const n=e[l+1],i=r(n);if(t<i)return t-s>=i-t?n:o}i=l+1}}return e[l]}function b(e){return e>.999999?1:e}export{V as binaryFindClosest,R as createProfileQueue,P as generateProfile,v as generateProfiles,S as interpolateElevations,b as sanitizeProgress};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ import{createArea as t,createLength as r}from"../../core/quantity.js";import e from"../../geometry/Polygon.js";import o from"../../geometry/Polyline.js";import{l as i,e as n}from"../../chunks/geodeticAreaOperator.js";import{l as a,e as s}from"../../chunks/geodeticLengthOperator.js";async function m({geometryJSON:r,options:o}){await i();const a=e.fromJSON(r),s=o?.unit??"square-meters",{execute:m}=await import("../../geometry/operators/simplifyOperator.js"),p=m(a)??a,c=n(p,{unit:s,...o});return{area:t(c,s),centroid:o?.returnCentroid?(await u(p)).toJSON():void 0}}async function u(t){const{execute:r}=await import("../../geometry/operators/centroidOperator.js");return r(t)}async function p({geometryJSON:t,options:i}){await a();const n=i?.unit??"meters",m={...i,unit:n},u="rings"in t?e.fromJSON(t):o.fromJSON(t);return r(s(u,m),n)}async function c({geometryJSON:r,options:o}){const i=e.fromJSON(r),n=o?.unit??"square-meters",[{execute:a},{execute:s}]=await Promise.all([import("../../geometry/operators/simplifyOperator.js"),import("../../geometry/operators/areaOperator.js")]),m=a(i)??i,p=s(m,{unit:n,...o});return{area:t(p,n),centroid:o?.returnCentroid?(await u(m)).toJSON():void 0}}async function y({geometryJSON:t,options:i}){const{execute:n}=await import("../../geometry/operators/lengthOperator.js"),a=i?.unit??"meters",s={...i,unit:a},m="rings"in t?e.fromJSON(t):o.fromJSON(t);return r(n(m,s),a)}export{m as geodesicArea,p as geodesicLength,c as planarArea,y as planarLength};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ import{WorkerHandle as t}from"../../core/workers/WorkerHandle.js";import e from"../../geometry/Point.js";class o extends t{constructor(){super("MeasurementWorker","geodesicArea",{},void 0,{strategy:"distributed"})}async geodesicArea(t,o,r){const i=this._geometryWithStagedPointJSON(t,o),{area:n,centroid:a}=await this.invokeMethod("geodesicArea",{geometryJSON:i,options:o},r);return{area:n,centroid:a?e.fromJSON(a):void 0}}geodesicLength(t,e,o){const r=this._geometryWithStagedPointJSON(t,e);return this.invokeMethod("geodesicLength",{geometryJSON:r,options:e},o)}async planarArea(t,o,r){const i=this._geometryWithStagedPointJSON(t,o),{area:n,centroid:a}=await this.invokeMethod("planarArea",{geometryJSON:i,options:o},r);return{area:n,centroid:a?e.fromJSON(a):void 0}}planarLength(t,e,o){const r=this._geometryWithStagedPointJSON(t,e);return this.invokeMethod("planarLength",{geometryJSON:r,options:e},o)}_geometryWithStagedPointJSON(t,e){const o=t.toJSON();if(e?.stagedPoint){const r="paths"in o?o.paths:o.rings;r.at(-1)?.push(this._pointToArray(e.stagedPoint,t))}return o}_pointToArray(t,{hasZ:e,hasM:o}){return e&&o?[t.x,t.y,t.z??0,t.m??0]:e?[t.x,t.y,t.z??0]:o?[t.x,t.y,t.m??0]:[t.x,t.y]}}export{o as MeasurementWorkerHandle};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{createEuclideanPlanarAreaCache as e,euclideanHorizontalPlanarArea as r,euclideanPlanarArea as t}from"./euclideanAreaMeasurementUtils.js";import{GeodesicMeasurementWorkerHandle as n}from"./GeodesicMeasurementWorkerHandle.js";const o=n=>({async autoAreaByElevationMode(o,a,i=e(),s){if("on-the-ground"===a){const e=o.spatialReference;return e.isGeographic||e.isWebMercator?await n(o,{unit:"square-meters",curveType:"geodesic"},s):r(o,i)}return t(o,i)},async autoArea2D(r,t=e(),n){return this.autoAreaByElevationMode(r,"on-the-ground",t,n)}});let a=null;async function i(){if(!a){const e=new n;a=o(e.geodesicArea.bind(e))}return a}export{i as loadAutomaticAreaMeasurementUtils};
5
+ import{createEuclideanPlanarAreaCache as e,euclideanHorizontalPlanarArea as r,euclideanPlanarArea as n}from"./euclideanAreaMeasurementUtils.js";import{MeasurementWorkerHandle as t}from"./MeasurementWorkerHandle.js";const o=t=>({async autoAreaByElevationMode(o,a,i=e(),u){if("on-the-ground"===a){if(s(o.spatialReference)){const{area:e}=await t(o,{unit:"square-meters",curveType:"geodesic"},u);return e}return r(o,i)}return n(o,i)},async autoArea2D(r,n=e(),t){return this.autoAreaByElevationMode(r,"on-the-ground",n,t)}});let a=null;async function i(){if(!a){const e=new t;a=o(e.geodesicArea.bind(e))}return a}function s(e){const{isGeographic:r,isWebMercator:n}=e;return r||n}export{i as loadAutomaticAreaMeasurementUtils,s as useGeodesicAreaMeasurement};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{createArea as e}from"../../core/quantity.js";import{geodesicAreas as r}from"../../geometry/geodesicUtils.js";import{l as t,e as s}from"../../chunks/geodeticAreaOperator.js";import{isCurvedGeometry as o}from"../../geometry/support/curves/curveUtils.js";import{geodesicMeasure as a}from"./geodesicMeasurementUtils.js";const n=e=>({geodesicArea(r){const{spatialReference:t}=r,s=o(r);return a(t,s?m:u,s?m:r=>c(e,r),r)}});async function i(){const e=await import("../../geometry/geometryEngine.js");return await t(),n(e)}function u(t){return e(Math.abs(r([t],"square-meters")[0]),"square-meters")}function c(r,t){try{return e(Math.abs(r.geodesicArea(t,"square-meters")),"square-meters")}catch(s){return null}}function m(r){return e(s(r,{unit:"square-meters",curveType:"geodesic"}),"square-meters")}export{i as loadGeodesicAreaMeasurementUtils};
5
+ import{MeasurementWorkerHandle as e}from"./MeasurementWorkerHandle.js";const r=e=>({geodesicArea:(r,n)=>e.geodesicArea(r,{unit:"square-meters",curveType:"geodesic",...n})});async function n(){const n=new e;return r(n)}export{n as loadGeodesicAreaMeasurementUtils};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{createLength as e}from"../../core/quantity.js";import{create as t}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{inverseGeodeticSolver as r,InverseGeodeticSolverResult as n,geodesicLengths as s}from"../../geometry/geodesicUtils.js";import o from"../../geometry/Polyline.js";import{l as i,e as c}from"../../chunks/geodeticLengthOperator.js";import{equals as a}from"../../geometry/support/spatialReferenceUtils.js";import{isCurvedGeometry as m}from"../../geometry/support/curves/curveUtils.js";import{geodesicMeasure as u}from"./geodesicMeasurementUtils.js";function f(e){const{spatialReference:t}=e,r=m(e);return u(t,r?w:R,w,e)}function p(e,t){if(!a(e.spatialReference,t.spatialReference))return null;const{spatialReference:r}=e;return v[0]=e.x,v[1]=e.y,v[2]=e.hasZ?e.z:0,D[0]=t.x,D[1]=t.y,D[2]=t.hasZ?t.z:0,l(v,D,r)}function l(e,t,r){return u(r,j,h,e,t,r)}const g={geodesicLength:f,geodesicDistanceBetweenPoints:p,geodesicDistance:l},y={geodesicDistanceBetweenPoints:p};async function d(){return await i(),g}function j(t,n,s){return e(r(U,t,n,s).distance,"meters")}function h(t,r,n){return e(c(x(t,r,n),{unit:"meters"}),"meters")}function R(t){return e(s([t],"meters")[0],"meters")}function w(t){return e(c(t,{unit:"meters"}),"meters")}function x(e,t,r){return new o({spatialReference:r,paths:[[[...e],[...t]]]})}const U=new n,v=t(),D=t();export{d as loadGeodesicLengthMeasurementUtils,y as test};
5
+ import{createLength as e}from"../../core/quantity.js";import{create as t}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{inverseGeodeticSolver as r,InverseGeodeticSolverResult as n,geodesicLengths as s}from"../../geometry/geodesicUtils.js";import o from"../../geometry/Polyline.js";import{l as i,e as c}from"../../chunks/geodeticLengthOperator.js";import{equals as m}from"../../geometry/support/spatialReferenceUtils.js";import{isCurvedGeometry as a}from"../../geometry/support/curves/curveUtils.js";import{geodesicMeasure as u}from"./geodesicMeasurementUtils.js";import{MeasurementWorkerHandle as f}from"./MeasurementWorkerHandle.js";const p=e=>({geodesicLength:d,geodesicDistanceBetweenPoints:y,geodesicDistance:j,geodesicLengthAsync:e.geodesicLength.bind(e)}),g={geodesicDistanceBetweenPoints:y};async function l(){return await i(),p(new f)}function d(e){const{spatialReference:t}=e,r=a(e);return u(t,r?x:R,x,e)}function y(e,t){if(!m(e.spatialReference,t.spatialReference))return null;const{spatialReference:r}=e;return v[0]=e.x,v[1]=e.y,v[2]=e.hasZ?e.z:0,D[0]=t.x,D[1]=t.y,D[2]=t.hasZ?t.z:0,j(v,D,r)}function j(e,t,r){return u(r,h,w,e,t,r)}function h(t,n,s){return e(r(U,t,n,s).distance,"meters")}function w(t,r,n){return e(c(L(t,r,n),{unit:"meters"}),"meters")}function R(t){return e(s([t],"meters")[0],"meters")}function x(t){return e(c(t,{unit:"meters"}),"meters")}function L(e,t,r){return new o({spatialReference:r,paths:[[[...e],[...t]]]})}const U=new n,v=t(),D=t();export{l as loadGeodesicLengthMeasurementUtils,g as test};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../analysis/AreaMeasurementAnalysis.js";import s from"../../core/Accessor.js";import{deprecateUnnecessaryViewModel as i}from"../../core/deprecate.js";import r from"../../core/Logger.js";import{watch as n,syncAndInitial as o}from"../../core/reactiveUtils.js";import{measurementAreaUnits as l}from"../../core/units.js";import{property as a,subclass as u}from"../../core/accessorSupport/decorators.js";import{defaultUnitPropertyMetadata as p}from"../../properties/defaultUnit.js";import{AnalysisViewModelMixin as d}from"../support/AnalysisViewModelMixin.js";let m=class extends(d(s)){constructor(e){super(e),this.analysis=null,this._userUnitOptions=null,this._userUnit=null,this.supportedViewType="3d",this.unsupportedErrorMessage="AreaMeasurement3DViewModel is only supported in 3D views.",e?.isDefaultViewModel||i(r.getLogger(this),"Area Measurement 3D","arcgis-area-measurement-3d",{version:"4.33"})}initialize(){this.addHandles(n(()=>({analysis:this.analysis,unit:this.unit}),({analysis:e,unit:t})=>{null!=e&&(e.unit=t)},o))}get state(){return this.disabled||!this.ready?"disabled":null==this.tool?"ready":this.tool.state}get measurement(){if(null==this.tool||this.disabled||this.tool.destroyed)return null;const{analysisView:e}=this;if(null==e)return null;const{viewData:t,areaLabel:s,perimeterLengthLabel:i}=e,r=t.validMeasurement,n="euclidean"===t.mode,o=0===t.intersectingSegments.size,l=o?r?"available":"unavailable":"invalid";return{mode:n?"euclidean":"geodesic",area:{text:o&&r?s:null,state:l},perimeterLength:{text:o&&r?i:null,state:l}}}get unitOptions(){const e=this._userUnitOptions?.filter(e=>l.includes(e));return e&&e.length>0?e:l.slice()}set unitOptions(e){this._userUnitOptions=e}get unit(){const e=this._userUnit,t=this.unitOptions;if(e&&t.includes(e))return e;const s=this.defaultUnit;return s&&t.includes(s)?s:t[0]}set unit(e){this._userUnit=e}constructAnalysis(){return new t}};e([a({type:t})],m.prototype,"analysis",void 0),e([a({readOnly:!0})],m.prototype,"state",null),e([a({readOnly:!0})],m.prototype,"measurement",null),e([a()],m.prototype,"unitOptions",null),e([a()],m.prototype,"_userUnitOptions",void 0),e([a()],m.prototype,"unit",null),e([a()],m.prototype,"_userUnit",void 0),e([a(p)],m.prototype,"defaultUnit",void 0),m=e([u("esri.widgets.AreaMeasurement3D.AreaMeasurement3DViewModel")],m);const c=m;export{c as default};
5
+ import{__decorate as e}from"tslib";import t from"../../analysis/AreaMeasurementAnalysis.js";import s from"../../core/Accessor.js";import{deprecateUnnecessaryViewModel as i}from"../../core/deprecate.js";import r from"../../core/Logger.js";import{watch as n,syncAndInitial as o}from"../../core/reactiveUtils.js";import{measurementAreaUnits as l}from"../../core/units.js";import{property as a,subclass as u}from"../../core/accessorSupport/decorators.js";import{defaultUnitPropertyMetadata as p}from"../../properties/defaultUnit.js";import{AnalysisViewModelMixin as d}from"../support/AnalysisViewModelMixin.js";let m=class extends(d(s)){constructor(e){super(e),this.analysis=null,this._userUnitOptions=null,this._userUnit=null,this.supportedViewType="3d",this.unsupportedErrorMessage="AreaMeasurement3DViewModel is only supported in 3D views.",e?.isDefaultViewModel||i(r.getLogger(this),"Area Measurement 3D","arcgis-area-measurement-3d",{version:"4.33"})}initialize(){this.addHandles(n(()=>({analysis:this.analysis,unit:this.unit}),({analysis:e,unit:t})=>{null!=e&&(e.unit=t)},o))}get state(){return this.disabled||!this.ready?"disabled":null==this.tool?"ready":this.tool.state}get measurement(){if(null==this.tool||this.disabled||this.tool.destroyed)return null;const{analysisView:e}=this;if(null==e)return null;const{viewData:t,areaLabel:s,perimeterLabel:i}=e,r=t.validMeasurement,n=r?"available":"unavailable";return{mode:null==t.mode||"euclidean"===t.mode?"euclidean":"geodesic",area:{text:r?s:null,state:n},perimeterLength:{text:r?i:null,state:n}}}get unitOptions(){const e=this._userUnitOptions?.filter(e=>l.includes(e));return e&&e.length>0?e:l.slice()}set unitOptions(e){this._userUnitOptions=e}get unit(){const e=this._userUnit,t=this.unitOptions;if(e&&t.includes(e))return e;const s=this.defaultUnit;return s&&t.includes(s)?s:t[0]}set unit(e){this._userUnit=e}constructAnalysis(){return new t}};e([a({type:t})],m.prototype,"analysis",void 0),e([a({readOnly:!0})],m.prototype,"state",null),e([a({readOnly:!0})],m.prototype,"measurement",null),e([a()],m.prototype,"unitOptions",null),e([a()],m.prototype,"_userUnitOptions",void 0),e([a()],m.prototype,"unit",null),e([a()],m.prototype,"_userUnit",void 0),e([a(p)],m.prototype,"defaultUnit",void 0),m=e([u("esri.widgets.AreaMeasurement3D.AreaMeasurement3DViewModel")],m);const c=m;export{c as default};
@@ -29,7 +29,7 @@ export interface DirectionsViewModelProperties extends EventedMixinProperties, G
29
29
  */
30
30
  routeParameters?: RouteParametersProperties;
31
31
  /**
32
- * The {@link layers/support/TravelMode travel mode} that will be used by [getDirections()](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#getDirections)
32
+ * The [travel mode](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-TravelMode.html) that will be used by [getDirections()](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#getDirections)
33
33
  * when requesting the route and directions.
34
34
  *
35
35
  * For a list of available travel modes please access [travelModes](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#travelModes) or the `supportedTravelModes`
@@ -160,7 +160,7 @@ export default class DirectionsViewModel extends DirectionsViewModelSuperclass {
160
160
  get routeParameters(): RouteParameters;
161
161
  set routeParameters(value: RouteParametersProperties);
162
162
  /**
163
- * The {@link layers/support/TravelMode travel mode} that will be used by [getDirections()](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#getDirections)
163
+ * The [travel mode](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-TravelMode.html) that will be used by [getDirections()](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#getDirections)
164
164
  * when requesting the route and directions.
165
165
  *
166
166
  * For a list of available travel modes please access [travelModes](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#travelModes) or the `supportedTravelModes`
@@ -31,8 +31,6 @@ export interface SearchResultRendererProperties extends WidgetProperties, Partia
31
31
  * or [Search component](https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-search/) results and allows expanding a DOM element to show alternative matches. These alternative matches
32
32
  * appear in the `Show more results` link.
33
33
  *
34
- * The required properties are: {@link widgets/Search/SearchResultRenderer#view} and [viewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchResultRenderer.html#viewModel).
35
- *
36
34
  * @since 4.3
37
35
  * @see [Search widget](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html) - _Deprecated since 4.33. Use the [Search component](https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-search/) instead._
38
36
  * @see [Search component](https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-search/)
@@ -81,7 +81,7 @@ export default class SearchSource extends SearchSourceSuperclass {
81
81
  */
82
82
  accessor filter: SearchFilter | null | undefined;
83
83
  /**
84
- * Function used to get search results. See {@link widgets/Search/support/types!GetResultsCallback} for the function definition.
84
+ * Function used to get search results. See [GetResultsCallback](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-types.html#GetResultsCallback) for the function definition.
85
85
  * When resolved, returns an object containing an array of [search results](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-types.html#SearchResult).
86
86
  *
87
87
  * @returns When resolved, returns an object containing an array of [search results](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-types.html#SearchResult).
@@ -89,7 +89,7 @@ export default class SearchSource extends SearchSourceSuperclass {
89
89
  */
90
90
  accessor getResults: GetResultsCallback | null | undefined;
91
91
  /**
92
- * Function used to get search suggestions. See {@link widgets/Search/support/types!GetSuggestionsCallback} for the function definition.
92
+ * Function used to get search suggestions. See [GetSuggestionsCallback](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-types.html#GetSuggestionsCallback) for the function definition.
93
93
  * When resolved, returns an object containing an array of [suggest results](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-types.html#SuggestResult).
94
94
  *
95
95
  * @returns When resolved, returns an object containing an array of [suggest results](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-types.html#SuggestResult).
@@ -467,7 +467,7 @@ export default class SearchViewModel extends SearchViewModelSuperclass {
467
467
  set searchTerm(value: string | null | undefined);
468
468
  /** The result selected from a search. */
469
469
  get selectedResult(): SearchResult | null | undefined;
470
- /** The selected {@link widgets/Search/SearchViewModel#SuggestResult}. */
470
+ /** The selected [SuggestResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-types.html#SuggestResult). */
471
471
  get selectedSuggestion(): SuggestResult | null | undefined;
472
472
  /**
473
473
  * Search may be used to search features in a
@@ -617,7 +617,7 @@ export default class SearchViewModel extends SearchViewModelSuperclass {
617
617
  * If a geometry is supplied, then it will reverse geocode (locator) or
618
618
  * findAddressCandidates with geometry instead of text (featurelayer).
619
619
  * @param options - An object containing an optional `signal` property that can be used to cancel the request.
620
- * @returns When resolved, returns an object containing an array of {@link widgets/Search/SearchViewModel#SearchResult search results}.
620
+ * @returns When resolved, returns an object containing an array of [search results](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-types.html#SearchResult).
621
621
  */
622
622
  search(searchItem?: SearchItem | null | undefined, options?: AbortOptions): Promise<SearchResponse | null | undefined>;
623
623
  /**
@@ -627,9 +627,8 @@ export default class SearchViewModel extends SearchViewModelSuperclass {
627
627
  * it will return search results nearby your current location.
628
628
  *
629
629
  * @param options - An object containing an optional `signal` property that can be used to cancel the request.
630
- * @returns When
631
- * resolved, returns {@link widgets/Search/SearchViewModel#SearchResponse} containing an array of search objects.
632
- * Each of these objects contains a {@link widgets/Search/SearchViewModel#SearchResult}.
630
+ * @returns When resolved, returns [SearchResponse](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-types.html#SearchResponse) containing an array of search objects.
631
+ * Each of these objects contains a [SearchResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-types.html#SearchResult).
633
632
  */
634
633
  searchNearby(options?: AbortOptions): Promise<SearchResponse | null | undefined>;
635
634
  /**
@@ -637,7 +636,7 @@ export default class SearchViewModel extends SearchViewModelSuperclass {
637
636
  *
638
637
  * @param value - The result object to select.
639
638
  * @returns When
640
- * resolved, returns {@link widgets/Search/SearchViewModel#SearchResult}.
639
+ * resolved, returns [SearchResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-types.html#SearchResult).
641
640
  * @since 4.32
642
641
  */
643
642
  select(value: SearchResult | null | undefined): Promise<SearchResult>;
@@ -653,7 +652,7 @@ export default class SearchViewModel extends SearchViewModelSuperclass {
653
652
  * nothing is passed in, takes the current value.
654
653
  * @param suggestionDelay - The millisecond delay after keyup and before making a `suggest()` network request.
655
654
  * @param options - An object containing an optional `signal` property that can be used to cancel the request.
656
- * @returns When resolved, returns {@link widgets/Search/SearchViewModel#SuggestResponse} containing an array of result objects. Each of these results contains a {@link widgets/Search/SearchViewModel#SuggestResult}.
655
+ * @returns When resolved, returns [SuggestResponse](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-types.html#SuggestResponse) containing an array of result objects. Each of these results contains a [SuggestResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-types.html#SuggestResult).
657
656
  */
658
657
  suggest(suggestTerm?: string, suggestionDelay?: number | null | undefined, options?: AbortOptions): Promise<SuggestResponse | null | undefined>;
659
658
  /**