@arcgis/core 5.1.0-next.45 → 5.1.0-next.46
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.
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{288bd32831e94e81653e.js → 08d76c600926d7642a8b.js} +1 -1
- package/assets/esri/core/workers/chunks/{54db91c0a3bd1946e026.js → 0d59f5cd3fdd7d6fd693.js} +1 -1
- package/assets/esri/core/workers/chunks/{288082ae7b19837a3d38.js → 20e715e3aeb1c3265901.js} +1 -1
- package/assets/esri/core/workers/chunks/{0155e5679ded9de5c327.js → 3a7c02616d942c81257d.js} +1 -1
- package/assets/esri/core/workers/chunks/3e9700445518b8f9ae1b.js +1 -0
- package/assets/esri/core/workers/chunks/{375eac59c9f88c7572db.js → 4b3545965b11a54184d4.js} +2 -2
- package/assets/esri/core/workers/chunks/{d3d024b3d2bb8fbbf760.js → 569e4479707bc6881d97.js} +1 -1
- package/assets/esri/core/workers/chunks/{8cafdd4addd366795600.js → 6c49ac7888679b9f7823.js} +1 -1
- package/assets/esri/core/workers/chunks/{ca88a364ef911526102e.js → 7b48c102a44606291f82.js} +1 -1
- package/assets/esri/core/workers/chunks/{e5927f9d0e757ec4c22a.js → a422cfe1e2afe0722acd.js} +1 -1
- package/assets/esri/core/workers/chunks/{f6e3954ddbb5993d56df.js → b45fdc04d399d2849d63.js} +1 -1
- package/assets/esri/core/workers/chunks/{dbafe96ce37bb82d0584.js → b49b608c0d58a9b55fa2.js} +1 -1
- package/assets/esri/core/workers/chunks/b744b950999b92393e37.js +1 -0
- package/assets/esri/core/workers/chunks/{1a3f874700f86b750390.js → ce0a6bc9df30af778ac9.js} +2 -2
- package/assets/esri/core/workers/chunks/{b86cb84c03b76e824213.js → f9fe89ced41b49608667.js} +1 -1
- package/assets/esri/core/workers/chunks/{bf4d2f42d31861ea1046.js → ff75fb0fce51ac12e656.js} +1 -1
- package/chunks/GaussianSplat.glsl.js +2 -2
- package/chunks/HUDMaterial.glsl.js +1 -1
- package/chunks/LineCallout.glsl.js +1 -1
- package/chunks/PointRenderer.glsl.js +1 -1
- package/chunks/Terrain.glsl.js +4 -4
- package/config.js +1 -1
- package/kernel.js +1 -1
- package/layers/IntegratedMesh3DTilesLayer.d.ts +2 -1
- package/layers/IntegratedMesh3DTilesLayer.js +1 -1
- package/layers/knowledgeGraph/dataModelVisualizationUtils.js +1 -1
- package/layers/support/schemaValidator.js +1 -1
- package/libs/ajv/ajv.bundle-wrapper.js +2 -0
- package/package.json +3 -3
- package/renderers/visualVariables/SizeVariable.js +1 -1
- package/rest/locator/locationToAddress.js +1 -1
- package/rest/support/LocationToAddressParameters.d.ts +62 -2
- package/rest/support/types.d.ts +6 -0
- package/support/revision.js +1 -1
- package/views/2d/analysis/AreaMeasurement/AreaMeasurementTool.js +1 -1
- package/views/2d/engine/vectorTiles/Placement.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TileCompositor.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +3 -3
- package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/RenderContext.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +1 -1
- package/views/webgl/InstanceCounter.js +1 -1
- package/webscene/support/schemaValidator.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/385f1bb9164b2d488b2d.js +0 -1
- package/assets/esri/core/workers/chunks/73d7337ac9efdbad14a4.js +0 -1
- package/chunks/ajv.bundle.js +0 -2
- /package/assets/esri/core/workers/chunks/{375eac59c9f88c7572db.js.LICENSE.txt → 4b3545965b11a54184d4.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{
|
|
2
|
+
import{releaseMaybe as t}from"../../../../core/maybe.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{create as e}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import h from"../../webgl/RenderCamera.js";import{CloudsParameters as s}from"../effects/clouds/CloudsParameters.js";import{OITPolygonOffsetLimit as r}from"./OrderIndependentTransparency.js";import{SceneLighting as n}from"../lighting/SceneLighting.js";class l{constructor(t,i){this.width=t,this.height=i}}class g{constructor(t,i){this._rctx=t,this.shadowMap=i,this._output=0,this.slot=2,this.slicePlane=null,this.hasOccludees=!1,this.hasEmission=!1,this.hasFloatOit=!0,this.enableFillLights=!0,this.alignPixelEnabled=!1,this.decorations=!0,this.overlayStretch=1,this.viewshedEnabled=!1,this.cutFillEnabled=!1,this._camera=new h,this._inverseViewport=e(),this._oldLighting=new n,this._newLighting=new n,this._fadedLighting=new n,this._lighting=this._newLighting,this.ssr=new o,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.highlights=new Array,this.highlightOrderMap=new Map,this.highlightMixOrigin=e(),this.highlightMixTexture=null,this.hudRenderStyle=0,this.snowCover=0,this.clouds=new s,this.shadowHighlightsVisible=!1}destroy(){this._camera=null,this.contentCamera=null,this.depth=t(this.depth),this.geometryDepth=null,this.mainDepth=null,this.overlay=null,this.ssao=null,this.terrainDepth=null,this.shadowMap?.dispose()}get output(){return this._output}set output(t){this._output!==t&&(this._output=t,this._rctx.resetDrawBuffers(t))}get camera(){return this._camera}set camera(t){this._camera=t,this._inverseViewport[0]=1/t.fullViewport[2],this._inverseViewport[1]=1/t.fullViewport[3]}get enableOffset(){return 1===this.output&&this.camera.relativeElevation<r}get inverseViewport(){return this._inverseViewport}get lighting(){return this._lighting}fadeLighting(){switch(this.clouds.fadeFactor){case 0:this._lighting=this._oldLighting;break;default:this._fadedLighting.lerpLighting(this._oldLighting,this._newLighting,this.clouds.fadeFactor),this._lighting=this._fadedLighting;break;case 1:this._lighting=this._newLighting,this._oldLighting.copyFrom(this._newLighting)}}updateLighting(t,i,e,h){this._oldLighting.copyFrom(this.lighting),this._newLighting.noonFactor=i,this._newLighting.globalFactor=e,this._newLighting.set(t),this._oldLighting.updateLegacy(),1===h&&this.clouds.requestFade(),this.fadeLighting()}get highlight(){return null==this.highlightLevel?null:this.highlights[this.highlightLevel]}get depth(){return this._depth}set depth(t){t&&(t.name="geometry depth"),this._depth=t}get occluder(){return 11===this.slot||12===this.slot?this.slot:null}}class o{constructor(){this.fadeFactor=1,this.reprojectionMatrix=i()}}export{g as BindParameters,l as ViewportSize};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{watch as t}from"../../../../core/reactiveUtils.js";import{property as i,subclass as s}from"../../../../core/accessorSupport/decorators.js";import{set as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{copy as r,set as o,scale as n,floor as h,subtract as
|
|
2
|
+
import{__decorate as e}from"tslib";import{watch as t}from"../../../../core/reactiveUtils.js";import{property as i,subclass as s}from"../../../../core/accessorSupport/decorators.js";import{set as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{copy as r,set as o,scale as n,floor as h,subtract as l}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as m,set as c,positiveInfinity as u,equals as d}from"../../../../geometry/support/aaBoundingBox.js";import{InternalRenderCategory as _}from"../../webgl.js";import g from"../../webgl/RenderNode.js";import{G as P}from"../../../../chunks/GaussianSplat.glsl.js";import{G as f}from"../../../../chunks/GaussianSplatComposition.glsl.js";import{GaussianSplatCompositionTechnique as C}from"../shaders/GaussianSplatCompositionTechnique.js";import{GaussianSplatCompositionTechniqueConfiguration as b}from"../shaders/GaussianSplatCompositionTechniqueConfiguration.js";import{G as x}from"../../../../chunks/GaussianSplatDepthComposition.glsl.js";import{GaussianSplatDepthCompositionTechnique as S}from"../shaders/GaussianSplatDepthCompositionTechnique.js";import{GaussianSplatTechnique as q}from"../shaders/GaussianSplatTechnique.js";import{GaussianSplatTechniqueConfiguration as v}from"../shaders/GaussianSplatTechniqueConfiguration.js";import{ColorAttachment1 as E,DepthStencilAttachment as R,PrimitiveType as T}from"../../../webgl/enums.js";var D;let w=class extends g{static{D=this}constructor(e){super(e),this.produces=_.PRE_TRANSPARENT,this.consumes={required:[_.PRE_TRANSPARENT]},this._slicePlaneEnabled=!1,this.layerView=null,this._passParameters=new P,this._compositionPassParameters=new f,this._depthCompositionPassParameters=new x,this._compositionConfiguration=new b,this._clipBox=m(),this._previousCameraDirection=p(),this._previousSortRequestCameraDirection=p(),this._sortRequestDirectionEpsilon=.01,this._directionChangeEpsilon=.001,this._configuration=new v(e.view.state.isGlobal),c(this._clipBox,u)}async initialize(){this.addHandles([t(()=>this.view.state.camera,()=>this._onCameraChange())])}precompile(){this._configuration.alphaCutoff=this.view.qualitySettings.gaussianSplat.minimumOpacity,this._configuration.terrainDepthTest=this.bindParameters.terrainDepthTest,this._configuration.fadingEnabled=this._fadeHelper.fadingEnabled,this._configuration.clippingEnabled=this._clippingEnabled,this._configuration.hasSlicePlane=this._slicePlaneEnabled&&null!=this.bindParameters.slicePlane,this.techniques.precompile(q,this._configuration),this._compositionConfiguration.hasEmission=this.bindParameters.hasEmission,this.techniques.precompile(C,this._compositionConfiguration),this.techniques.precompile(S)}render(e){const t=e.find(({name:e})=>e===this.produces);if(this._handleFading(),!this._data.visibleGaussians||!this._data.orderTexture.texture||!this._data.textureAtlas.texture)return t;const i=t.getAttachment(E);this._compositionConfiguration.hasEmission=null!=i;const s=this.techniques.getCompiled(q,this._configuration),a=this.techniques.getCompiled(C,this._compositionConfiguration),r=this.techniques.getCompiled(S);if(!s||!r||!a)return this.requestRender(1),t;const{fullWidth:o,fullHeight:n}=this.bindParameters.camera;this._prepareParameters(n,o);const h=this.renderingContext,l=this.fboCache,p=l.acquire(o,n,"gaussian color output"),m=t.getAttachment(R);p.attachDepth(m),this._renderGaussianColorAndDepth(p,s);const c=l.acquire(o,n,this.produces);return this._depthCompositionPassParameters.splatDepth=p.getTexture(E),c.attachDepth(t.getAttachment(R)),h.bindFramebuffer(c.fbo),h.bindTechnique(r,this.bindParameters,this._depthCompositionPassParameters),h.screen.draw(),this._compositionPassParameters.color=t.getTexture(),this._compositionPassParameters.splatColor=p.getTexture(),i?(c.acquireColor(E,8,"emissive"),this._compositionPassParameters.emission=t.getTexture(E)):this._compositionPassParameters.emission=null,h.bindFramebuffer(c.fbo),h.bindTechnique(a,this.bindParameters,this._compositionPassParameters),h.screen.draw(),p.release(),c}get slicePlaneEnabled(){return this._slicePlaneEnabled}set slicePlaneEnabled(e){this._slicePlaneEnabled!==e&&(this._slicePlaneEnabled=e,this.requestRender(1))}set clippingBox(e){const t=e||u;this._hasSameClipBox(t)||(c(this._clipBox,t),this._data.requestSort(),this.requestRender(1))}get clippingBox(){return this._clippingEnabled?this._clipBox:null}get _clippingEnabled(){return!d(this._clipBox,u,(e,t)=>e===t)}get _data(){return this.layerView.data}get _fadeHelper(){return this.layerView.fadeHelper}destroy(){super.destroy()}_onCameraChange(){const e=this.view.state.camera.ray.direction;if(!this._directionChanged(e))return;if(r(this._previousCameraDirection,e),!this._shouldRequestSort(e))return;this._data.requestSort()&&r(this._previousSortRequestCameraDirection,e)}_directionChanged(e){return Math.abs(e[0]-this._previousCameraDirection[0])>this._directionChangeEpsilon||Math.abs(e[1]-this._previousCameraDirection[1])>this._directionChangeEpsilon||Math.abs(e[2]-this._previousCameraDirection[2])>this._directionChangeEpsilon}_shouldRequestSort(e){return Math.abs(e[0]-this._previousSortRequestCameraDirection[0])>this._sortRequestDirectionEpsilon||Math.abs(e[1]-this._previousSortRequestCameraDirection[1])>this._sortRequestDirectionEpsilon||Math.abs(e[2]-this._previousSortRequestCameraDirection[2])>this._sortRequestDirectionEpsilon}_prepareParameters(e,t){this._passParameters.splatOrder=this._data.orderTexture.texture,this._passParameters.splatFading=this._data.fadingTexture.texture,this._passParameters.splatAtlas=this._data.textureAtlas.texture;const i=Math.tan(.5*this.camera.fovY),s=i/e*t;a(this._passParameters.tanFov,s,i),this._passParameters.focalLength=e/(2*i);const r=this.view.qualitySettings.gaussianSplat.minimumSplatPixelRadius;this._passParameters.minSplatRadius=r*Math.sqrt(t*e)/Math.sqrt(2073600),this._prepareHighPrecisionCameraPosition(),this._updateSlicePlaneLocalOrigin(),this._updateClipUniforms()}_updateClipUniforms(){if(this._clippingEnabled){const[e,t,i,s,a,r]=this._clipBox,[n,h,l]=this.camera.eye;o(this._passParameters.clipMinCameraRelative,e-n,t-h,i-l),o(this._passParameters.clipMaxCameraRelative,s-n,a-h,r-l)}}_updateSlicePlaneLocalOrigin(){this._passParameters.slicePlaneLocalOrigin=this.camera.eye}_hasSameClipBox(e){return d(this._clipBox,e,(e,t)=>e===t)}_renderGaussianColorAndDepth(e,t){const i=this.renderingContext;e.acquireColor(E,5,"gaussian depth output"),i.bindFramebuffer(e.fbo),i.setClearColor(0,0,0,0),i.clear(16384),this.renderingContext.bindTechnique(t,this.bindParameters,this._passParameters),this.renderingContext.drawArraysInstanced(T.TRIANGLE_STRIP,0,4,this._data.visibleGaussians)}_prepareHighPrecisionCameraPosition(){n(this._passParameters.tileCameraPosition,this.camera.eye,1/D.tileSize),h(this._passParameters.tileCameraPosition,this._passParameters.tileCameraPosition),n(this._passParameters.cameraDelta,this._passParameters.tileCameraPosition,D.tileSize),l(this._passParameters.cameraDelta,this.camera.eye,this._passParameters.cameraDelta)}_handleFading(){if(0===this._fadeHelper.numFadingTiles)return void(this._previousFrameStart=null);this._previousFrameStart??=this.view.stage.renderer.renderContext.time;const e=this.view.stage?.renderer.renderContext.time-this._previousFrameStart;this._fadeHelper.updateAllTileFading(e),this._previousFrameStart=this.view.stage.renderer.renderContext.time,this._data.fadingTexture.updateTexture(this._data.textureAtlas.pageAllocator.pageCount)}static{this.tileSize=2.048}};e([i()],w.prototype,"produces",void 0),e([i()],w.prototype,"consumes",void 0),e([i({constructOnly:!0})],w.prototype,"layerView",void 0),w=D=e([s("esri.views.3d.webgl-engine.lib.GaussianSplatRenderNode")],w);export{w as GaussianSplatRenderNode};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{Milliseconds as t}from"../../../../core/time.js";import e from"../../webgl/RenderCamera.js";import{BindParameters as r}from"./BindParameters.js";class i{constructor(i,n,o){this.rctx=i,this.techniques=o,this.lastFrameCamera=new e,this.renderOccludedMask=s,this.time=t(0),this.bind=new r(i,n),this.bind.alignPixelEnabled=!0}get output(){return this.bind.output}}const s=13;export{i as RenderContext,s as defaultRenderOccludedMask};
|
|
2
|
+
import{Milliseconds as t}from"../../../../core/time.js";import e from"../../webgl/RenderCamera.js";import{BindParameters as r}from"./BindParameters.js";class i{constructor(i,n,o){this.rctx=i,this.techniques=o,this.lastFrameCamera=new e,this.renderOccludedMask=s,this.time=t(0),this.bind=new r(i,n),this.bind.alignPixelEnabled=!0}destroy(){this.bind.destroy()}get output(){return this.bind.output}}const s=13;export{i as RenderContext,s as defaultRenderOccludedMask};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as s}from"../../../../core/asyncUtils.js";import has from"../../../../core/has.js";import{removeMaybe as r,abortMaybe as i,destroyMaybe as a,releaseMaybe as n}from"../../../../core/maybe.js";import{throwIfAborted as h}from"../../../../core/promiseUtils.js";import{watch as o,syncAndInitial as d,initial as _,sync as u}from"../../../../core/reactiveUtils.js";import{signal as l}from"../../../../core/signal.js";import{property as p,subclass as m}from"../../../../core/accessorSupport/decorators.js";import{equals as c,invert as f,multiply as g}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as b,create as P}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as w}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as T,ZEROS as E}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as C}from"../../../../geometry/support/Indices.js";import{RenderNodeOutput as A,InternalRenderCategory as S,AllRenderNodeOutputs as R,AllInternalRenderNodeOutputs as D}from"../../webgl.js";import{minNearDistanceInMeters as O}from"../../state/NearFarHeuristic.js";import{debugFlags as x}from"../../support/debugFlags.js";import{FBOCache as I}from"../core/FBOCache.js";import{RenderPassManager as y}from"../core/renderPasses/RenderPassManager.js";import{isColor as F}from"../core/shaderLibrary/ShaderOutput.js";import{distanceFadeEnd as v}from"../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{RenderNodes as H}from"../effects/RenderNodes.js";import{RenderPluginManager as N}from"../effects/RenderPluginManager.js";import{WeatherFader as M}from"../effects/WeatherFader.js";import{innerAtmosphereFadeStart as q}from"../effects/atmosphere/atmosphereUtils.js";import{Blit as G}from"../effects/blit/Blit.js";import{maxHighlightsPerChannel as L,renderHighlightBuffer as U}from"../effects/highlight/Highlight.js";import{OITBlend as j}from"../effects/transparency/OITBlend.js";import{AnimationTimer as V}from"./AnimationTimer.js";import{AnimationTimeStep as B}from"./AnimationTimeStep.js";import{BoundingInfo as k}from"./BoundingInfo.js";import{Compositor as W}from"./Compositor.js";import{DepthRange as z}from"./DepthRange.js";import{depthRangeFromScene as Q}from"./depthRangeUtils.js";import{MainFramebuffer as Y}from"./MainFramebuffer.js";import{RenderContext as $,defaultRenderOccludedMask as J}from"./RenderContext.js";import{RendererBase as K}from"./RendererBase.js";import{setupFeatureDefaults as Z}from"./RenderFeature.js";import{RenderPluginInput as X}from"./RenderPluginInput.js";import{ShadowAccumulator as ee}from"./ShadowAccumulator.js";import{ShadowMap as te}from"./ShadowMap.js";import se from"./SliceHelper.js";import{MergedRenderer as re}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as ie}from"../parts/renderUtils.js";import{RendererPerformanceInfo as ae,PerformanceCategory as ne}from"../statistics/RendererPerformanceInfo.js";import{PixelType as he,ColorAttachment1 as oe,ColorAttachment2 as de,ColorAttachment0 as _e}from"../../../webgl/enums.js";let ue=class extends K{constructor(e,t,s,r,i){super({stage:e}),this._techniques=s,this._rctx=r,this._requestRender=i,this._pluginsHas={occludedHudElements:!1,hudElements:!1,water:!1},this.renderPassManager=new y,this._isRendering=!1,this._inGlobeView=!1,this._backgroundColor=T(0,0,0,1),this._sliceHelper=new se,this.sceneDepthRange=l(z.Infinite),this._state=l(2),this._hasAnimations=!1,this._animationTimestep=new B,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=l(0),this._hasOIT8=!has("disable-feature:oit8"),this._hasIOSEmission=this._hasOIT8&&!has("disable-feature:oit8-emissive"),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new X,this._hasTransparentGeometry=!1,this._oitCallouts=!1,this._releaseNodeInputs=e=>{for(const t of Ce)e.some(({name:e})=>e===t)&&this._pluginInput.release(t)},this._debugNeedsDepth=!1,this._fboCache=new I(r),this._compositor=new W(r,s),this._renderStateFeatures=l(Z(e.view.qualityProfile)),this._shadowMap=new te(this._fboCache,e.viewingMode),this._renderContext=new $(this._rctx,this._shadowMap,s),this._framebuffer=new Y(this._fboCache,this._bindParameters),this._performanceInfo=new ae(this._rctx),this._blit=new G(s),this._shadowAccumulator=new ee(this.fboCache,s,e,e=>{const t=this.shadowsEnabled;this._shadowMap.enabled=!0,this._ensureBindParametersCamera(e.camera,e.contentCamera),this._plugins.prepareRender(),this._shadowMap.enabled=t},(t,s,r)=>{const i=e.view.qualitySettings.maximumPixelRatio;t.shadowMap.start(t.camera,s,r,!0,i),this._renderShadowCascades(5,t.shadowMap),t.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(t.camera,t.contentCamera)},i),this._nodes=new H(this._renderContext),this._plugins=new N({renderContext:this._renderContext,techniques:s,materials:t,requestRender:i,controller:e}),this._plugins.add(this.renderPassManager),this.weatherFader=new M({view:e.view,context:this._renderContext}),this.addHandles([o(()=>e.view.state.camera,()=>i(),d),o(()=>x.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES,e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(0):()=>{},i()},_),o(()=>e.view.environment.background?.color,e=>{const t=e?e.toUnitRGBA():E;w(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),i()},d),o(()=>e.view.state.camera.relativeElevation,e=>this._inGlobeView=(e??1/0)>=v,d),o(()=>this._bindParameters.clouds.fadeFactor,()=>{this._bindParameters.fadeLighting(),this._requestRender(2)},u),o(()=>this._bindParameters.clouds.data?.state,()=>i(),u),o(()=>e.view.state.highlights,e=>{this._bindParameters.highlights=e,i()},_),o(()=>"sun"===e.view.environment.lighting?.type,e=>{this._bindParameters.enableFillLights=e,this._requestRender()},d)])}destroy(){this._gpuTimerHandle=r(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowMap.dispose(),this._shadowAccumulator.destroy(),this._shadowAccumulator=null,this._loadEdgeViewTask=i(this._loadEdgeViewTask),this._edgeView=a(this._edgeView),this.renderPassManager.dispose(),this.weatherFader=a(this.weatherFader),this._releaseFBOs(),this._disposeOffscreenBuffers(),this._fboCache.destroy(),this._fboCache=null,this._plugins.destroy(),this._plugins=null,this._pluginInput=null,this._oitBlendOrNil=null,this._nodes=null,this._framebuffer=null,this._shadowMap=null,this._renderContext=null,this._performanceInfo=null,k.prune(),re.prune(),C()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get _oitBlend(){return this._oitBlendOrNil??=new j(this._techniques),this._oitBlendOrNil}get performanceInfo(){return this._performanceInfo}updateRenderFeatures(e){this._renderStateFeatures.value=Z(e),this._requestRender()}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,s){this._renderStateFeatures.mutate(r=>r.set(t,e,s)),this._requestRender()}get _highQualityTransparency(){return this.isFeatureEnabled(1)}get hasReflections(){return this._pluginsHas.water&&this.isFeatureEnabled(5)}get _hasHighlights(){return this._plugins.produces(10,2,4,19,13,14,15)}hasHighlight(e){return this._plugins.hasHighlight(e)}get _hasHUDHighlights(){return this._plugins.produces(10,13,14,15)}get hasSSAO(){return this.isFeatureEnabled(4)&&!this._inGlobeView}get hasSMAA(){return this.isFeatureEnabled(0)}get _hasEmission(){return this._plugins.hasEmitters&&(this._hasIOSEmission||this.hasFloatOit)}get highResolutionAtmosphere(){return this.isFeatureEnabled(3)}get fboCache(){return this._fboCache}_releaseFBOs(){this._bindParameters.ssr.lastFrameColor=n(this._bindParameters.ssr.lastFrameColor),this._bindParameters.terrainDepth=n(this._bindParameters.terrainDepth),this._bindParameters.geometryDepth=n(this._bindParameters.geometryDepth),this._bindParameters.hudOcclusion=n(this._bindParameters.hudOcclusion)}_disposeOffscreenBuffers(){this._framebuffer.dispose(),this._disposeBindBuffers()}_disposeBindBuffers(){this._shadowMap.disposeOutputs(),this._bindParameters.depth=n(this._bindParameters.depth)}get updating(){return this._loadEdgeViewTask&&!this._loadEdgeViewTask.finished||this._edgeView?.updating||this._shadowAccumulator.readyToRun||this._plugins.updating||this.weatherFader?.readyToRun||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||(this._loadEdgeViewTask=s(async e=>{const{EdgeView:t}=await import("./edgeRendering/EdgeView.js");h(e);const s=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:De(this.stage.view.resourceController)});return this.addHandles(o(()=>s.updating,()=>this._requestRender(),u)),this._requestRender(),this._edgeViewCallbacks.forEach(e=>e(s)),this._edgeViewCallbacks.length=0,s})),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&&c(this._bindParameters.ssr.reprojectionMatrix,b)}set _reprojectionMatrix(e){t(this._bindParameters.ssr.reprojectionMatrix,e)&&this._reprojectionMatrixVersion.value++}get shadowsEnabled(){return!!this._shadowMap?.enabled}setParameters(e){void 0!==e.shadowMap&&this._shadowMap.enabled!==e.shadowMap&&(this._shadowMap.enabled=e.shadowMap,this._requestRender()),e.shadowCast&&this._shadowAccumulator.setParameters(e.shadowCast)}set slice(e){this._sliceHelper.update(e)&&this._requestRender()}get plugins(){return this._plugins}get hasFloatOit(){return this._rctx.driverTest.floatBufferBlend.result&&this.isFeatureEnabled(10)}get oitEnabled(){return this.hasFloatOit||this._hasOIT8}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.occludedHudElements=this._plugins.produces(0,14),has.hudElements=has.occludedHudElements||this._plugins.produces(0,...be),has.water=this._plugins.produces(4,20),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new V(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation);const s=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==s&&(this._gpuTimerHandle=s?r(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,s,r=!1){try{return this._isRendering=!0,this._render(e,t,s,r)}catch(i){console.error(`Exception during rendering: ${i}:\n${i.stack}`)}finally{this._isRendering=!1}return new ie(this._pluginInput.get(A.FINAL),null)}_render(e,t,s,r){const i=0===s;this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=i,this._disposeBindBuffers();const{camera:a,contentCamera:n,mode:h,alignPixelEnabled:o}=e;this._state.value=h,this._renderContext.time=t,this._bindParameters.output=0,this._bindParameters.hasEmission=this._hasEmission,this._bindParameters.alignPixelEnabled=o,this._bindParameters.decorations=!r,this._bindParameters.mainDepth=null,this._bindParameters.hasFloatOit=this.hasFloatOit;const d=!r||!this._sliceHelper.isDecoration;this._bindParameters.slicePlane=d?this._sliceHelper.plane:null,this._bindParameters.viewshedEnabled=this._nodes.produces(S.VIEWSHED),this._bindParameters.cutFillEnabled=this._nodes.produces(S.CUTFILL_COMPUTATION),this._renderOverlay(),a.setGLViewport(this._rctx);const _=this._framebuffer,u=_.initialize(a.fullWidth,a.fullHeight,this._backgroundColor);this.hasReflections?(u?.setName("last frame color"),this._bindParameters.ssr.lastFrameColor=u):u?.release(),this._ensureBindParametersCamera(a,n),this._ensureBindParametersWeatherFader(this._renderContext.time),this._plugins.sortTestsTransparentOrderedSlots(we),this._plugins.prepareRender(),this._bindParameters.shadowHighlightsVisible=this._needsShadowHighlight&&!r,this._hasTransparentGeometry=this._plugins.produces(0,...pe),this._precompilePrepasses(),this.performanceInfo.advance(ne.PREPARE);const l=this._computeShadowDepthRange(a);this._renderShadowMap(a,this._bindParameters.lighting.mainLight.direction,l),this._pluginInput.set("normals",this._renderNormals()),this._renderSSAOAndDepth(),this._renderShadowAccumulation(l,!i),this._oitCallouts=this._hasTransparentGeometry&&this.oitEnabled,this._ensureBindParametersSSR(t),this._precompileShaders(),this._bindParameters.output=0,_.bind(),this._bindParameters.mainDepth=_.depth.attachment,this._renderOpaque(),this._renderTransparent(),this._shadowMap.disposeOutput(5),this._renderCutFillComputation(),this._pluginInput.set(S.FOCUSAREA,this._renderFocusAreaGeometry()),_.update(e=>this._renderNodes(S.TRANSPARENT_ENVIRONMENT,e)),_.update(e=>this._renderNodes(S.VIEWSHED,e)),_.update(e=>this._renderNodes(S.LASERLINES,e)),_.update(e=>this._renderNodes(S.FOCUSAREA_COLOR,e)),this._pluginInput.release(S.FOCUSAREA),_.update(e=>this._renderNodes(S.OCCLUDED,e)),this._pluginInput.set("highlights",this._renderHighlightPrepass());const p=2===s?this._renderObjectAndLayerIdColor():null;_.update(e=>this._renderNodes(A.COMPOSITE,e)),this._shadowMap.disposeOutputs(),_.update(e=>this._renderNodes(S.ANTIALIASING,e));const m=this._hasPhotoshopTerrain||!this._hasTransparentGeometry?1:2;let c;return this._bindParameters.hasEmission=!1,this._hasHUDHighlights&&_.update(e=>this._renderHUD(m,e)),_.update(e=>this._renderNodes(S.HIGHLIGHT_COLOR,e)),this._hasHUDHighlights||_.update(e=>this._renderHUD(m,e)),this._bindParameters.hasEmission=this._hasEmission,_.update(e=>this._renderNodes(S.MAGNIFIER,e)),_.update(e=>this._renderNodes(A.FINAL,e)),i&&this._blit.toFramebuffer(this._rctx,_.color,this._bindParameters),this.onPostRender?.(),this._releaseFBOs(),_.releaseDepth(),this._renderContext.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd(),i||(c=_.color,c.retain(),this._releaseFBOs(),this._disposeOffscreenBuffers()),this.performanceInfo.finishFrame(),new ie(c,p)}_precompileShaders(){++this._plugins.context.techniques.precompiling,this._bindParameters.output=0;const e=this._bindParameters.hasEmission;this._precompileOpaqueGeometry(),this._nodes.precompile(e,S.OPAQUE_ENVIRONMENT,S.PRE_TRANSPARENT);const t=this._bindParameters;if(t.terrainDepthTest=t.cullAboveTerrain=this._needsTerrainDepth,this._bindParameters.output=3,this._plugins.precompile(...me),this._needsDepth&&(this._precompileOpaqueGeometry(),this._precompileTransparentGeometry()),this._bindParameters.output=0,this._plugins.precompile(...me),this._hasTransparentGeometry){const e=this._pluginsHas.occludedHudElements;this._oitBlend.precompile(this._bindParameters,e,0),this._pluginsHas.hudElements&&this._oitBlend.precompile(this._bindParameters,!1,1)}this._hasTransparentGeometry&&(this._precompileTransparentGeometry(),this._hasPhotoshopTerrain&&(t.cullAboveTerrain=!1,this._precompileTransparentGeometry(),t.cullAboveTerrain=this._needsTerrainDepth)),this._nodes.precompile(e,S.FOCUSAREA);const s=this._hasPhotoshopTerrain&&!this._needsTerrainDepth;this._compositor.precompile(this._usesPremultipliedAlphaBlit,!!this._needsEdges,s,e),this._oitCallouts||this._plugins.precompile(16),t.terrainDepthTest=t.cullAboveTerrain=!1,this._nodes.precompile(e,S.TRANSPARENT_ENVIRONMENT,S.VIEWSHED,S.CUTFILL_COMPUTATION,S.LASERLINES,S.FOCUSAREA_COLOR,S.OCCLUDED,S.ANTIALIASING),t.highlightMixTexture=t.highlights.length>1?this._rctx.emptyTexture:null,this._precompileHUD(0),t.hasEmission=!1,this._precompileHUD(0),this._precompileHUD(1),t.hasEmission=this._hasEmission,this._hasHighlights&&(t.highlights.forEach((e,s)=>{t.highlightLevel=s,this._precompileAllGeometry(10),this._hasHUDHighlights&&this._plugins.precompile(14,13)}),t.highlightLevel=null,this._nodes.precompile(e,S.HIGHLIGHT_COLOR)),t.highlightMixTexture=null,this._nodes.precompile(e,A.COMPOSITE,S.MAGNIFIER),this._shadowAccumulator.precompile(),this._plugins.precompile(9),--this._plugins.context.techniques.precompiling}_renderFocusAreaGeometry(){const e=this._nodes.produce(S.FOCUSAREA,this._pluginInput);return e&&this.performanceInfo.advance(ne.FOCUS_AREA_MASK),e}_renderObjectAndLayerIdColor(){if(!this._nodes.produces("olid"))return null;const e=this._bindParameters.output;++this._techniques.precompiling;const{width:t,height:s}=this._framebuffer.size;let r=this.fboCache.acquire(t,s,"olid");return r.acquireDepth(13),r=this._nodes.render(r,this._pluginInput),--this._techniques.precompiling,this.performanceInfo.advance(ne.OBJECT_AND_LAYER_ID_COLOR),this._bindParameters.output=e,r}finish(e){this._hasAnimations||this._animationTimestep.clear();const t=this.performanceInfo.gpuSamplingEnabled,s=0===e;if(s||t){const e=s?this.performanceInfo.elapsedTime:0;let r=0;t?r=this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.finish();const i=Math.max(e,r);this._animationTimestep.frame(i,s)}}readMainDepth(e,t){const{mainDepth:s,camera:r}=this._bindParameters;if(!s)return;const i=this.fboCache.acquire(this._framebuffer.size.width,this._framebuffer.size.height,"linear depth");this._rctx.bindFramebuffer(i.fbo),r.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(E),this._compositor.blitDepthToLinearDepth(this._bindParameters,s),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),i.fbo?.readPixels(e[0],e[1],e[2],e[3],6408,he.UNSIGNED_BYTE,t),i.release()}readAccumulatedShadow(e){return this._shadowAccumulator.readAccumulatedShadow(e[0],e[1])}get _needsEdges(){return this._edgeView?.shouldRender()?this._edgeView:null}_renderEdges(e){const t=this._needsEdges;if(!t)return;const{width:s,height:r}=this._framebuffer.size,i=this.fboCache.acquire(s,r,"edges"),a=this._bindParameters.geometryDepth,n=()=>t.render(this._bindParameters,e);this._renderToTargets(n,i,a??this._framebuffer.depth,E),this._framebuffer.bind(),this._compositor.composite(this._bindParameters,i.getTexture()),i.release(),this.performanceInfo.advance(1===e?ne.OPAQUE_EDGES:ne.TRANSPARENT_EDGES)}_renderOverlay(){this._bindParameters.overlay=this.overlay?.render(this._renderContext.time),this._bindParameters.overlay&&this.performanceInfo.advance(ne.OVERLAY)}_renderShadowMap(e,t,s){if(!this.shadowsEnabled)return;const r=this._shadowMap;r.start(e,t,s,this.isFeatureEnabled(6),this.stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight?(this._renderShadowCascades(7,this._shadowMap),r.clear(),this._renderShadowCascades(6,this._shadowMap)):this._renderShadowCascades(5),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,this._bindParameters.contentCamera),this.performanceInfo.advance(ne.SHADOW_MAP)}_renderCutFillComputation(){this._nodes.produce(S.CUTFILL_COMPUTATION,this._pluginInput)?.release()}_precompileShadowCascades(e){0!==this._shadowMap.cascades.length&&this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._shadowMap){const s=this._bindParameters.output;t.bindFramebuffer();for(const r of t.cascades)r.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(r.camera,r.camera),this.renderAllGeometry(e);t.finish(e),this._bindParameters.output=s}get _needsDepth(){return this._nodes.requireGeometryDepth()||this.hasReflections||this._needsShadowHighlight||this._shadowAccumulator.active||this._debugNeedsDepth}get _usesPremultipliedAlphaBlit(){return this._pluginsHas.hudElements&&this.oitEnabled||this._hasPhotoshopTerrain}_renderSSAOAndDepth(){const e=this._pluginInput.get("normals");e?(this._pluginInput.set(S.SSAO,this._renderSSAO()),this._needsDepth?(this._rctx.bindFramebuffer(e.fbo),this._rctx.clear(1024),this._renderGeometryWithoutNormals(3),this._bindParameters.depth?.release(),this._bindParameters.depth=e.obtainDepthTexture(),this.performanceInfo.advance(ne.DEPTH)):(e.detachDepth(),this._bindParameters.depth=n(this._bindParameters.depth)),this.hasSSAO&&this._pluginInput.release("normals")):this._renderAllGeometryDepth()}_renderAllGeometryDepth(){if(this._bindParameters.depth=n(this._bindParameters.depth),!this._needsDepth)return;const{width:e,height:t}=this._framebuffer.size,s=this.fboCache.acquire(e,t,"geometry depth",13);this._rctx.bindFramebuffer(s.fbo),this._rctx.clear(1280),this.renderAllGeometry(3),this._bindParameters.depth=s.obtainDepthTexture(),s.release(),this.performanceInfo.advance(ne.DEPTH)}_renderTerrainDepth(){if(this._bindParameters.terrainDepth=n(this._bindParameters.terrainDepth),this._bindParameters.terrainDepthTest=this._bindParameters.cullAboveTerrain=this._needsTerrainDepth,!this._needsTerrainDepth)return;const e=this._bindParameters.output;this._bindParameters.output=3;const{width:t,height:s}=this._framebuffer.size,r=this.fboCache.acquire(t,s,"terrain depth",13);this._rctx.bindFramebuffer(r.fbo),this._rctx.clear(1280),this._renderTransparentGround(),this._bindParameters.terrainDepth=r.obtainDepthTexture(),r.release(),this._bindParameters.output=e}_renderGeometryDepth(){if(this._bindParameters.geometryDepth=n(this._bindParameters.geometryDepth),!this._needsTerrainDepth)return;const e=this._bindParameters.output,{width:t,height:s}=this._framebuffer.size,r=this.fboCache.acquire(t,s,"geometry depth",13);this._rctx.bindFramebuffer(r.fbo),this._rctx.clear(1280),this._renderOpaqueAndTransparentGeometry(3),this._bindParameters.output=e,this._bindParameters.geometryDepth=r.obtainDepthTexture(),r.release()}get _needsShadowDepthRange(){return this._shadowMap.enabled||this._shadowAccumulator.active}_computeShadowDepthRange(e){if(!this._needsShadowDepthRange)return z.Zero;const t=Q(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=z.Infinite);if((this.stage.view.renderCoordsHelper?.getAltitude(e.eye)??0)<q)return void(this.sceneDepthRange.value=z.Infinite);const t=e.clone();t.near=O,t.far=1e10;const s=Q(t,this._plugins.plugins,this.stage.layers,1);s.union(this._plugins.queryDepthRange(t)),this.sceneDepthRange.value.equals(s)||(this.sceneDepthRange.value=s)}get _normalsRequired(){const e=this._nodes.require("normals",...R,S.VIEWSHED,S.LASERLINES);return(this.hasSSAO?1:0)+e}_precompilePrepasses(){this._normalsRequired&&this._precompileAllGeometry(4),this._needsDepth&&this._precompileAllGeometry(3),this.shadowsEnabled&&(this._needsShadowHighlight?(this._precompileShadowCascades(6),this._precompileShadowCascades(7)):this._precompileShadowCascades(5)),this._shadowAccumulator.active&&this._precompileAllGeometry(5),this.hasSSAO&&this._normalsRequired&&this._nodes.precompile(this._bindParameters.hasEmission,S.SSAO)}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const{width:t,height:s}=this._framebuffer.size,r=this.fboCache.acquire(t,s,"normals",5);r.acquireDepth(13),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer(E,!0,!0),this._bindParameters.output=4,this._plugins.render(...ce);const i=this._nodes.optional("normals",...R,S.VIEWSHED);return r.retain(e+i-1),this.performanceInfo.advance(ne.NORMALS),r}_renderSSAO(){const e=this._pluginInput.get("normals");if(this.hasSSAO&&e)return this._bindParameters.ssao=this._nodes.produce(S.SSAO,this._pluginInput),this._bindParameters.ssao&&this.performanceInfo.advance(ne.SSAO),this._bindParameters.ssao}_precompileAllGeometry(e){const t=this._bindParameters.output;this._bindParameters.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(...me),this._bindParameters.output=t}renderAllGeometry(e){this._bindParameters.output=e,this._renderOpaqueAndTransparentGeometry(e),this._renderTransparentGround()}precompileSlots(e,...t){for(const s of t)this._bindParameters.slot=s,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(const s of t)this._renderContext.renderOccludedMask=s,this.precompileSlots(e,...ge);this._renderContext.renderOccludedMask=J}renderSlots(e,...t){for(const s of t)this._bindParameters.slot=s,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,...ge),this._renderContext.renderOccludedMask=J}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(...Te[e])}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(17),this.renderHUD(e),this._bindParameters.hudRenderStyle=e,this._plugins.render(15)}precompileViewshedShadowMap(){this._precompileAllGeometry(8)}precompileCutFillReferenceDepth(){const e=this._bindParameters.output;this._bindParameters.output=9,this._plugins.precompile(...Ee),this._bindParameters.output=e}renderViewshedShadowMap(e){const{camera:t,contentCamera:s}=this._bindParameters,r=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(8),this._ensureBindParametersCamera(t,s),this._bindParameters.camera.setGLViewport(this._rctx),this._bindParameters.output=r}renderCutFillReferenceDepth(e){const{camera:t,contentCamera:s}=this._bindParameters,r=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this._bindParameters.output=9,this._plugins.render(...Ee),this._ensureBindParametersCamera(t,s),t.setGLViewport(this._rctx),this._bindParameters.output=r}_renderOpaqueAndTransparentGeometry(e){this._bindParameters.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithoutNormals(e){this._bindParameters.output=e,this._plugins.render(...fe)}_precompileOpaqueGeometry(){this._needsOpaquePass&&(this._plugins.precompile(...le),this._nodes.precompile(this._bindParameters.hasEmission,S.CUTFILL_COLOR,"opaque-color"))}_renderOpaqueGeometry(){this._plugins.render(...le)}_renderTransparentGeometry(){this._plugins.render(...pe),this._oitCallouts&&this._plugins.render(16)}get _hasPhotoshopTerrain(){return this._plugins.produces(0,6)}get _needsTerrainDepth(){return this._highQualityTransparency&&this._hasPhotoshopTerrain}_renderPhotoshopTerrain(){if(!this._hasPhotoshopTerrain)return null;const{width:e,height:t}=this._framebuffer.size,s=this.fboCache.acquire(e,t,"transparent terrain"),r=()=>this._plugins.render(6);return this._renderToTargets(r,s,this._framebuffer.depth,E),this.performanceInfo.advance(ne.TRANSPARENT_TERRAIN),s}_renderTransparentGround(){this._plugins.render(...me)}_renderLineCallouts(e){if(this._bindParameters.hudRenderStyle=e,0===e){const e=()=>this._plugins.render(16),{width:t,height:s}=this._framebuffer.size,r=this.fboCache.acquireDepth(this._hudDepthFormat,t,s,"line callouts");this._renderToTargets(e,this._framebuffer.color,r,void 0,!0,!0),r.release()}else this._plugins.render(16)}_precompileHUD(e){if(!this._pluginsHas.hudElements)return;const t=this._bindParameters.output,s=this._bindParameters.hudRenderStyle;this._bindParameters.hudRenderStyle=e,this.oitEnabled?(this._bindParameters.output=1,this._plugins.precompile(...be),this._bindParameters.output=2,this._plugins.precompile(...be),this._bindParameters.output=0,this._oitBlend.precompile(this._bindParameters,!1,1)):(this._bindParameters.output=0,this._plugins.precompile(...be)),this._hasHighlights&&(this._bindParameters.output=10,this._plugins.precompile(...be)),this._bindParameters.output=t,this._bindParameters.hudRenderStyle=s}_renderHUD(e,t){if(!this._pluginsHas.hudElements)return t;if(this.oitEnabled){const s=this._renderOIT(1,e);this._rctx.bindFramebuffer(t.fbo);const r=!!t.getTexture(oe);this._compositor.compositePreMultipliedAlpha(this._bindParameters,s.getTexture(),r),s.release()}else if(this._bindParameters.output=0,0===e){const t=()=>this._renderHUDElements(e),{width:s,height:r}=this._framebuffer.size,i=this.fboCache.acquireDepth(this._hudDepthFormat,s,r,"hud");this._renderToTargets(t,this._framebuffer.color,i,void 0,!0,!0),i.release()}else t.acquireDepth(this._hudDepthFormat),this._rctx.bindFramebuffer(t.fbo),this._rctx.clear(256),this._renderHUDElements(e),t.detachDepth();return this.performanceInfo.advance(0===e?ne.HUD_OCCLUDED:ne.HUD),t}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(6,2)}_renderHighlightPrepass(){if(!this._hasHighlights)return;const{fboCache:e,_rctx:t,_bindParameters:s}=this,{width:r,height:i}=this._framebuffer.size,{highlights:a}=s,n=a.length>L?3:1,h=e.acquire(r,i,"highlights",n);h.acquireDepth(13);const o=this._plugins.produces(10,0);return o&&this._framebuffer.color.fbo&&h.fbo&&t.blitFramebuffer(this._framebuffer.color.fbo,h.fbo,1024),t.bindFramebuffer(h.fbo),t.gl.clearBufferuiv(6144,0,[0,0,0,0]),o||t.clear(1024),this._bindParameters.output=10,t.bindFramebuffer(h.fbo),U(t,e,r,i,s,()=>this._renderHighlightGeometries()),h.detachDepth(),this.performanceInfo.advance(ne.HIGHLIGHTS),h.retain(this._nodes.require("highlights",...D)+this._nodes.optional("highlights",...D)-1),h}_renderHighlightGeometries(){this._plugins.render(...Pe),this._rctx.clear(256),this._renderHUDElements(2)}_renderShadowAccumulation(e,t){this._shadowAccumulator.updateDepthRange(e);const{depth:s,camera:r,contentCamera:i}=this._bindParameters;this._bindParameters.output=0,this._shadowAccumulator.accumulating&&s&&this._shadowAccumulator.renderAccumulation(s,r,i,t)&&this.performanceInfo.advance(ne.ACCUMULATED_SHADOWS)}_precompileTransparentGeometry(){this.oitEnabled&&F(this._bindParameters.output)?(this._bindParameters.output=1,this._plugins.precompile(...pe),this._oitCallouts&&this._plugins.precompile(16),this._bindParameters.output=2,this._plugins.precompile(...pe),this._oitCallouts&&this._plugins.precompile(16),this._bindParameters.output=0):this._plugins.precompile(...pe)}_renderOIT(e,t=2){const s=1===e,{width:r,height:i}=this._framebuffer.size,a=s?()=>this._renderHUDElements(t):()=>this._renderTransparentGeometry(),h=this._bindParameters,o=this.hasFloatOit?8:5,d=h.output;h.output=1;const _=s?"oit hud":"oit",u=this.fboCache.acquire(r,i,_,o),l=this._bindParameters.hasEmission&&(0===e||1!==t);l&&u.acquireColor(oe,o,"oit emissive");const p=l?de:oe;u.acquireColor(p,this.hasFloatOit?7:0,"oit alpha"),s||u.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(u.fbo),this._rctx.clearFramebuffer([0,0,0,1]),l&&this._rctx.clearBuffer(1,E),a(),u.detachDepth(),h.output=2;const m=this.fboCache.acquire(r,i,s?"oit hud front":"oit front");l&&m.acquireColor(oe,o,"oit emissive front"),s?m.acquireDepth(this._hudDepthFormat):m.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(m.fbo),this._rctx.clearFramebuffer(E,s),a(),m.detachDepth();const c=this._pluginsHas.occludedHudElements&&!s;let f;return this._bindParameters.hudOcclusion=n(this._bindParameters.hudOcclusion),h.output=0,s?(f=this.fboCache.acquire(r,i,"oit hud composite"),this._rctx.bindFramebuffer(f.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(16384)):(c&&(this._framebuffer.color.acquireColor(p,0,"hud occlusion"),this._rctx.clearBuffer(p-_e,E)),this._framebuffer.bind()),this._oitBlend.blend(this._rctx,u,m,h,l,c,e),f?.detachDepth(),s||(this._rctx.bindFramebuffer(m.fbo),this._framebuffer.bind(),c&&(this._bindParameters.hudOcclusion=this._framebuffer.color.obtainAttachment(p))),m.release(),u.release(),h.output=d,f}get _hudDepthFormat(){return this.isFeatureEnabled(8)?13:12}get _needsOpaquePass(){return this.plugins.produces(0,...le)||this.plugins.produces(5,...le)||this.plugins.produces(3,3)}_renderOpaque(){const e=this._needsOpaquePass;e&&(this._plugins.render(0,1),this._framebuffer.update(e=>this._renderNodes(S.CUTFILL_COLOR,e)),this._plugins.render(2,3));const t=this._framebuffer;this._renderTerrainDepth(),t.update(t=>this._renderNodes(A.OPAQUE,t,e)),this.fboCache.debugCallback?.(A.OPAQUE,t.color.fbo),t.update(e=>this._renderNodes(S.OPAQUE_ENVIRONMENT,e)),this.fboCache.debugCallback?.(S.OPAQUE_ENVIRONMENT,t.color.fbo),this._renderEdges(1)}_renderTransparent(){const e=this._framebuffer;e.bind(),e.update(e=>this._renderNodes(S.PRE_TRANSPARENT,e)),this.fboCache.debugCallback?.(S.PRE_TRANSPARENT,e.color.fbo),this._renderHiddenTransparentEdges(),this._hasTransparentGeometry&&(this.oitEnabled?this._renderOIT(0):this._renderTransparentGeometry()),e.update(e=>this._renderNodes(A.TRANSPARENT,e,this._hasTransparentGeometry)),this.fboCache.debugCallback?.(A.TRANSPARENT,e.color.fbo),this._renderGeometryDepth(),this._needsTerrainDepth||this._oitCallouts||this._plugins.render(16),this._renderEdges(0);const t=this._renderPhotoshopTerrain(),s=t?.getTexture();s&&this._renderHUD(0,e.color),this._bindParameters.cullAboveTerrain=!1,s&&(e.bind(),this._compositor.compositePreMultipliedAlpha(this._bindParameters,s),t?.release(),this._needsTerrainDepth&&(this._renderEdges(1),this._hasTransparentGeometry&&(this.oitEnabled?this._renderOIT(0):this._renderTransparentGeometry(),this.performanceInfo.advance(ne.TRANSPARENT)),this._renderEdges(0))),this._bindParameters.ssao=n(this._bindParameters.ssao),this._needsTerrainDepth&&this._renderLineCallouts(1),this._bindParameters.terrainDepthTest=!1,this._renderTransparentEnvironment()}_renderTransparentEnvironment(){this._shadowAccumulator.render(this._bindParameters),this.performanceInfo.advance(ne.APPLY_ACCUMULATED_SHADOWS),this._framebuffer.bind(),this._plugins.render(9),this.performanceInfo.advance(ne.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderNodes(e,t,s=!1){const r=t.name;if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return s&&this.performanceInfo.advance(e),t;this._fboCache.debugCallback?.(r,t.fbo);const i=this._nodes.render(t,this._pluginInput,this._releaseNodeInputs);return this.performanceInfo.advance(e),i}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersWeatherFader(e){1===this.stage.viewingMode&&(this._bindParameters.clouds.data&&(this._bindParameters.clouds.fade(this._bindParameters.camera,e,this.stage.view.qualitySettings.fadeDuration),this.weatherFader?.cleanupCubemap()),this._bindParameters.snowCover=this.weatherFader?.snowCover??0)}_ensureBindParametersSSR(e){if(this._bindParameters.ssr.lastFrameColor){null==this._ssrEnableTime&&(this._ssrEnableTime=e),this._renderContext.lastFrameCamera.equals(this._bindParameters.camera)?this._reprojectionMatrix=b:(f(Se,this._bindParameters.camera.viewMatrix),f(Ae,this._bindParameters.camera.projectionMatrix),g(Re,Se,Ae),g(Re,this._renderContext.lastFrameCamera.viewMatrix,Re),g(Re,this._renderContext.lastFrameCamera.projectionMatrix,Re),this._reprojectionMatrix=Re);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=b,this._ssrEnableTime=null}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,s,r){this._bindParameters.updateLighting(e,t,s,r),this._requestRender(1)}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0,clouds:this.weatherFader?.usedMemory??0}}_renderToTargets(e,t,s,r,i=!1,a=!1){t.attachDepth(s),this._rctx.bindFramebuffer(t.fbo),this._rctx.clearFramebuffer(r,i,a),e(),t.detachDepth()}get test(){}};e([p({readOnly:!0})],ue.prototype,"highResolutionAtmosphere",null),e([p()],ue.prototype,"_edgeView",void 0),e([p()],ue.prototype,"updating",null),ue=e([m("esri.views.3d.webgl-engine.lib.Renderer")],ue);const le=[0,1,2,3],pe=[7,8,4,5],me=[6,7,8],ce=[0,1,2,4,...me],fe=[3,5],ge=[2,4,9],be=[17,13,15,14],Pe=[4,5,2,3,0,1,...me],we=[4,9,5,12],Te={0:[14],1:[13],2:[14,13],3:[14,13]},Ee=[0,1,...me],Ce=["normals","highlights"],Ae=P(),Se=P(),Re=P();function De(e){return t=>e.immediate.schedule(t)}export{ue as Renderer};
|
|
2
|
+
import{__decorate as e}from"tslib";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as r}from"../../../../core/asyncUtils.js";import has from"../../../../core/has.js";import{removeMaybe as s,abortMaybe as i,destroyMaybe as a,releaseMaybe as n}from"../../../../core/maybe.js";import{throwIfAborted as h}from"../../../../core/promiseUtils.js";import{watch as o,syncAndInitial as d,initial as _,sync as u}from"../../../../core/reactiveUtils.js";import{signal as l}from"../../../../core/signal.js";import{property as m,subclass as p}from"../../../../core/accessorSupport/decorators.js";import{equals as c,invert as f,multiply as g}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as b,create as P}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as T}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as w,ZEROS as E}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as C}from"../../../../geometry/support/Indices.js";import{RenderNodeOutput as A,InternalRenderCategory as S,AllRenderNodeOutputs as R,AllInternalRenderNodeOutputs as D}from"../../webgl.js";import{minNearDistanceInMeters as O}from"../../state/NearFarHeuristic.js";import{debugFlags as x}from"../../support/debugFlags.js";import"../../webgl/ManagedDepthAttachment.js";import{FBOCache as I}from"../core/FBOCache.js";import{RenderPassManager as y}from"../core/renderPasses/RenderPassManager.js";import{isColor as F}from"../core/shaderLibrary/ShaderOutput.js";import{distanceFadeEnd as v}from"../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{RenderNodes as H}from"../effects/RenderNodes.js";import{RenderPluginManager as N}from"../effects/RenderPluginManager.js";import{WeatherFader as q}from"../effects/WeatherFader.js";import{innerAtmosphereFadeStart as G}from"../effects/atmosphere/atmosphereUtils.js";import{Blit as M}from"../effects/blit/Blit.js";import{maxHighlightsPerChannel as L,renderHighlightBuffer as U}from"../effects/highlight/Highlight.js";import{OITBlend as j}from"../effects/transparency/OITBlend.js";import{AnimationTimer as V}from"./AnimationTimer.js";import{AnimationTimeStep as B}from"./AnimationTimeStep.js";import{BoundingInfo as k}from"./BoundingInfo.js";import{Compositor as W}from"./Compositor.js";import{DepthRange as z}from"./DepthRange.js";import{depthRangeFromScene as Q}from"./depthRangeUtils.js";import{MainFramebuffer as Y}from"./MainFramebuffer.js";import{RenderContext as $,defaultRenderOccludedMask as J}from"./RenderContext.js";import{RendererBase as K}from"./RendererBase.js";import{setupFeatureDefaults as Z}from"./RenderFeature.js";import{RenderPluginInput as X}from"./RenderPluginInput.js";import{ShadowAccumulator as ee}from"./ShadowAccumulator.js";import{ShadowMap as te}from"./ShadowMap.js";import re from"./SliceHelper.js";import{MergedRenderer as se}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as ie}from"../parts/renderUtils.js";import{RendererPerformanceInfo as ae,PerformanceCategory as ne}from"../statistics/RendererPerformanceInfo.js";import{PixelType as he,ColorAttachment1 as oe,ColorAttachment2 as de,ColorAttachment0 as _e}from"../../../webgl/enums.js";let ue=class extends K{constructor(e,t,r,s,i){super({stage:e}),this._techniques=r,this._rctx=s,this._requestRender=i,this._pluginsHas={occludedHudElements:!1,hudElements:!1,water:!1},this.renderPassManager=new y,this._isRendering=!1,this._inGlobeView=!1,this._backgroundColor=w(0,0,0,1),this._sliceHelper=new re,this.sceneDepthRange=l(z.Infinite),this._state=l(2),this._hasAnimations=!1,this._animationTimestep=new B,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=l(0),this._hasOIT8=!has("disable-feature:oit8"),this._hasIOSEmission=this._hasOIT8&&!has("disable-feature:oit8-emissive"),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new X,this._hasTransparentGeometry=!1,this._oitCallouts=!1,this._releaseNodeInputs=e=>{for(const t of Ce)e.some(({name:e})=>e===t)&&this._pluginInput.release(t)},this._debugNeedsDepth=!1,this._fboCache=new I(s),this._compositor=new W(s,r),this._renderStateFeatures=l(Z(e.view.qualityProfile));const a=new te(this._fboCache,e.viewingMode);this._renderContext=new $(this._rctx,a,r),this._framebuffer=new Y(this._fboCache,this._bindParameters),this._performanceInfo=new ae(this._rctx),this._blit=new M(r),this._shadowAccumulator=new ee(this.fboCache,r,e,e=>{const t=this.shadowsEnabled;a.enabled=!0,this._ensureBindParametersCamera(e.camera,e.contentCamera),this._plugins.prepareRender(),a.enabled=t},(t,r,s)=>{const i=e.view.qualitySettings.maximumPixelRatio;t.shadowMap.start(t.camera,r,s,!0,i),this._renderShadowCascades(5,t.shadowMap),t.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(t.camera,t.contentCamera)},i),this._nodes=new H(this._renderContext),this._plugins=new N({renderContext:this._renderContext,techniques:r,materials:t,requestRender:i,controller:e}),this._plugins.add(this.renderPassManager),this.weatherFader=new q({view:e.view,context:this._renderContext}),this.addHandles([o(()=>e.view.state.camera,()=>i(),d),o(()=>x.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES,e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(0):()=>{},i()},_),o(()=>e.view.environment.background?.color,e=>{const t=e?e.toUnitRGBA():E;T(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),i()},d),o(()=>e.view.state.camera.relativeElevation,e=>this._inGlobeView=(e??1/0)>=v,d),o(()=>this._bindParameters.clouds.fadeFactor,()=>{this._bindParameters.fadeLighting(),this._requestRender(2)},u),o(()=>this._bindParameters.clouds.data?.state,()=>i(),u),o(()=>e.view.state.highlights,e=>{this._bindParameters.highlights=e,i()},_),o(()=>"sun"===e.view.environment.lighting?.type,e=>{this._bindParameters.enableFillLights=e,this._requestRender()},d)])}destroy(){this._gpuTimerHandle=s(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowAccumulator.destroy(),this._shadowAccumulator=null,this._loadEdgeViewTask=i(this._loadEdgeViewTask),this._edgeView=a(this._edgeView),this.renderPassManager.dispose(),this.weatherFader=a(this.weatherFader),this._releaseFBOs(),this._disposeOffscreenBuffers(),this._fboCache.destroy(),this._fboCache=null,this._renderContext.destroy(),this._plugins.destroy(),this._plugins=null,this._pluginInput=null,this._oitBlendOrNil=null,this._nodes=null,this._framebuffer=null,this._performanceInfo=null,k.prune(),se.prune(),C()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get _oitBlend(){return this._oitBlendOrNil??=new j(this._techniques),this._oitBlendOrNil}get performanceInfo(){return this._performanceInfo}updateRenderFeatures(e){this._renderStateFeatures.value=Z(e),this._requestRender()}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,r){this._renderStateFeatures.mutate(s=>s.set(t,e,r)),this._requestRender()}get _highQualityTransparency(){return this.isFeatureEnabled(1)}get hasReflections(){return this._pluginsHas.water&&this.isFeatureEnabled(5)}get _hasHighlights(){return this._plugins.produces(10,2,4,19,13,14,15)}hasHighlight(e){return this._plugins.hasHighlight(e)}get _hasHUDHighlights(){return this._plugins.produces(10,13,14,15)}get hasSSAO(){return this.isFeatureEnabled(4)&&!this._inGlobeView}get hasSMAA(){return this.isFeatureEnabled(0)}get _hasEmission(){return this._plugins.hasEmitters&&(this._hasIOSEmission||this.hasFloatOit)}get highResolutionAtmosphere(){return this.isFeatureEnabled(3)}get fboCache(){return this._fboCache}_releaseFBOs(){this._bindParameters.ssr.lastFrameColor=n(this._bindParameters.ssr.lastFrameColor),this._bindParameters.terrainDepth=n(this._bindParameters.terrainDepth),this._bindParameters.geometryDepth=n(this._bindParameters.geometryDepth),this._bindParameters.hudOcclusion=n(this._bindParameters.hudOcclusion),this._bindParameters.depth=n(this._bindParameters.depth)}_disposeOffscreenBuffers(){this._framebuffer.dispose(),this._disposeBindBuffers()}_disposeBindBuffers(){this._bindParameters.shadowMap.disposeOutputs()}get updating(){return this._loadEdgeViewTask&&!this._loadEdgeViewTask.finished||this._edgeView?.updating||this._shadowAccumulator.readyToRun||this._plugins.updating||this.weatherFader?.readyToRun||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||(this._loadEdgeViewTask=r(async e=>{const{EdgeView:t}=await import("./edgeRendering/EdgeView.js");h(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:De(this.stage.view.resourceController)});return this.addHandles(o(()=>r.updating,()=>this._requestRender(),u)),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&&c(this._bindParameters.ssr.reprojectionMatrix,b)}set _reprojectionMatrix(e){t(this._bindParameters.ssr.reprojectionMatrix,e)&&this._reprojectionMatrixVersion.value++}get shadowsEnabled(){return!!this._bindParameters.shadowMap.enabled}setParameters(e){void 0!==e.shadowMap&&this._bindParameters.shadowMap.enabled!==e.shadowMap&&(this._bindParameters.shadowMap.enabled=e.shadowMap,this._requestRender()),e.shadowCast&&this._shadowAccumulator.setParameters(e.shadowCast)}set slice(e){this._sliceHelper.update(e)&&this._requestRender()}get plugins(){return this._plugins}get hasFloatOit(){return this._rctx.driverTest.floatBufferBlend.result&&this.isFeatureEnabled(10)}get oitEnabled(){return this.hasFloatOit||this._hasOIT8}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.occludedHudElements=this._plugins.produces(0,14),has.hudElements=has.occludedHudElements||this._plugins.produces(0,...be),has.water=this._plugins.produces(4,20),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new V(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?s(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,s=!1){try{return this._isRendering=!0,this._render(e,t,r,s)}catch(i){console.error(`Exception during rendering: ${i}:\n${i.stack}`)}finally{this._isRendering=!1}return new ie(this._pluginInput.get(A.FINAL),null)}_render(e,t,r,s){const i=0===r;this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=i,this._disposeBindBuffers();const{camera:a,contentCamera:n,mode:h,alignPixelEnabled:o}=e;this._state.value=h,this._renderContext.time=t,this._bindParameters.output=0,this._bindParameters.hasEmission=this._hasEmission,this._bindParameters.alignPixelEnabled=o,this._bindParameters.decorations=!s,this._bindParameters.mainDepth=null,this._bindParameters.hasFloatOit=this.hasFloatOit;const d=!s||!this._sliceHelper.isDecoration;this._bindParameters.slicePlane=d?this._sliceHelper.plane:null,this._bindParameters.viewshedEnabled=this._nodes.produces(S.VIEWSHED),this._bindParameters.cutFillEnabled=this._nodes.produces(S.CUTFILL_COMPUTATION),this._renderOverlay(),a.setGLViewport(this._rctx);const _=this._framebuffer,u=_.initialize(a.fullWidth,a.fullHeight,this._backgroundColor);this.hasReflections?(u?.setName("last frame color"),this._bindParameters.ssr.lastFrameColor=u):u?.release(),this._ensureBindParametersCamera(a,n),this._ensureBindParametersWeatherFader(this._renderContext.time),this._plugins.sortTestsTransparentOrderedSlots(Te),this._plugins.prepareRender(),this._bindParameters.shadowHighlightsVisible=this._needsShadowHighlight&&!s,this._hasTransparentGeometry=this._plugins.produces(0,...me),this._precompilePrepasses(),this.performanceInfo.advance(ne.PREPARE);const l=this._computeShadowDepthRange(a);this._renderShadowMap(a,this._bindParameters.lighting.mainLight.direction,l),this._pluginInput.set("normals",this._renderNormals()),this._renderSSAOAndDepth(),this._renderShadowAccumulation(l,!i),this._oitCallouts=this._hasTransparentGeometry&&this.oitEnabled,this._ensureBindParametersSSR(t),this._precompileShaders(),this._bindParameters.output=0,_.bind(),this._bindParameters.mainDepth=_.depth.attachment,this._renderOpaque(),this._renderTransparent(),this._bindParameters.shadowMap.disposeOutput(5),this._renderCutFillComputation(),this._pluginInput.set(S.FOCUSAREA,this._renderFocusAreaGeometry()),_.update(e=>this._renderNodes(S.TRANSPARENT_ENVIRONMENT,e)),_.update(e=>this._renderNodes(S.VIEWSHED,e)),_.update(e=>this._renderNodes(S.LASERLINES,e)),_.update(e=>this._renderNodes(S.FOCUSAREA_COLOR,e)),this._pluginInput.release(S.FOCUSAREA),_.update(e=>this._renderNodes(S.OCCLUDED,e)),this._pluginInput.set("highlights",this._renderHighlightPrepass());const m=2===r?this._renderObjectAndLayerIdColor():null;_.update(e=>this._renderNodes(A.COMPOSITE,e)),this._bindParameters.shadowMap.disposeOutputs(),_.update(e=>this._renderNodes(S.ANTIALIASING,e));const p=this._hasPhotoshopTerrain||!this._hasTransparentGeometry?1:2;let c;return this._bindParameters.hasEmission=!1,this._hasHUDHighlights&&_.update(e=>this._renderHUD(p,e)),_.update(e=>this._renderNodes(S.HIGHLIGHT_COLOR,e)),this._hasHUDHighlights||_.update(e=>this._renderHUD(p,e)),this._bindParameters.hasEmission=this._hasEmission,_.update(e=>this._renderNodes(S.MAGNIFIER,e)),_.update(e=>this._renderNodes(A.FINAL,e)),i&&this._blit.toFramebuffer(this._rctx,_.color,this._bindParameters),this.onPostRender?.(),this._releaseFBOs(),_.releaseDepth(),this._renderContext.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd(),i||(c=_.color,c.retain(),this._releaseFBOs(),this._disposeOffscreenBuffers()),this.performanceInfo.finishFrame(),new ie(c,m)}_precompileShaders(){++this._plugins.context.techniques.precompiling,this._bindParameters.output=0;const e=this._bindParameters.hasEmission;this._precompileOpaqueGeometry(),this._nodes.precompile(e,S.OPAQUE_ENVIRONMENT,S.PRE_TRANSPARENT);const t=this._bindParameters;if(t.terrainDepthTest=t.cullAboveTerrain=this._needsTerrainDepth,this._bindParameters.output=3,this._plugins.precompile(...pe),this._needsDepth&&(this._precompileOpaqueGeometry(),this._precompileTransparentGeometry()),this._bindParameters.output=0,this._plugins.precompile(...pe),this._hasTransparentGeometry){const e=this._pluginsHas.occludedHudElements;this._oitBlend.precompile(this._bindParameters,e,0),this._pluginsHas.hudElements&&this._oitBlend.precompile(this._bindParameters,!1,1)}this._hasTransparentGeometry&&(this._precompileTransparentGeometry(),this._hasPhotoshopTerrain&&(t.cullAboveTerrain=!1,this._precompileTransparentGeometry(),t.cullAboveTerrain=this._needsTerrainDepth)),this._nodes.precompile(e,S.FOCUSAREA);const r=this._hasPhotoshopTerrain&&!this._needsTerrainDepth;this._compositor.precompile(this._usesPremultipliedAlphaBlit,!!this._needsEdges,r,e),this._oitCallouts||this._plugins.precompile(16),t.terrainDepthTest=t.cullAboveTerrain=!1,this._nodes.precompile(e,S.TRANSPARENT_ENVIRONMENT,S.VIEWSHED,S.CUTFILL_COMPUTATION,S.LASERLINES,S.FOCUSAREA_COLOR,S.OCCLUDED,S.ANTIALIASING),t.highlightMixTexture=t.highlights.length>1?this._rctx.emptyTexture:null,this._precompileHUD(0),t.hasEmission=!1,this._precompileHUD(0),this._precompileHUD(1),t.hasEmission=this._hasEmission,this._hasHighlights&&(t.highlights.forEach((e,r)=>{t.highlightLevel=r,this._precompileAllGeometry(10),this._hasHUDHighlights&&this._plugins.precompile(14,13)}),t.highlightLevel=null,this._nodes.precompile(e,S.HIGHLIGHT_COLOR)),t.highlightMixTexture=null,this._nodes.precompile(e,A.COMPOSITE,S.MAGNIFIER),this._shadowAccumulator.precompile(),this._plugins.precompile(9),--this._plugins.context.techniques.precompiling}_renderFocusAreaGeometry(){const e=this._nodes.produce(S.FOCUSAREA,this._pluginInput);return e&&this.performanceInfo.advance(ne.FOCUS_AREA_MASK),e}_renderObjectAndLayerIdColor(){if(!this._nodes.produces("olid"))return null;const e=this._bindParameters.output;++this._techniques.precompiling;const{width:t,height:r}=this._framebuffer.size;let s=this.fboCache.acquire(t,r,"olid");return s.acquireDepth(13),s=this._nodes.render(s,this._pluginInput),--this._techniques.precompiling,this.performanceInfo.advance(ne.OBJECT_AND_LAYER_ID_COLOR),this._bindParameters.output=e,s}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 s=0;t?s=this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.finish();const i=Math.max(e,s);this._animationTimestep.frame(i,r)}}readMainDepth(e,t){const{mainDepth:r,camera:s}=this._bindParameters;if(!r)return;const i=this.fboCache.acquire(this._framebuffer.size.width,this._framebuffer.size.height,"linear depth");this._rctx.bindFramebuffer(i.fbo),s.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(E),this._compositor.blitDepthToLinearDepth(this._bindParameters,r),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),i.fbo?.readPixels(e[0],e[1],e[2],e[3],6408,he.UNSIGNED_BYTE,t),i.release()}readAccumulatedShadow(e){return this._shadowAccumulator.readAccumulatedShadow(e[0],e[1])}get _needsEdges(){return this._edgeView?.shouldRender()?this._edgeView:null}_renderEdges(e){const t=this._needsEdges;if(!t)return;const{width:r,height:s}=this._framebuffer.size,i=this.fboCache.acquire(r,s,"edges"),a=this._bindParameters.geometryDepth,n=()=>t.render(this._bindParameters,e);this._renderToTargets(n,i,a??this._framebuffer.depth,E),this._framebuffer.bind(),this._compositor.composite(this._bindParameters,i.getTexture()),i.release(),this.performanceInfo.advance(1===e?ne.OPAQUE_EDGES:ne.TRANSPARENT_EDGES)}_renderOverlay(){this._bindParameters.overlay=this.overlay?.render(this._renderContext.time),this._bindParameters.overlay&&this.performanceInfo.advance(ne.OVERLAY)}_renderShadowMap(e,t,r){if(!this.shadowsEnabled)return;const s=this._bindParameters.shadowMap;s.start(e,t,r,this.isFeatureEnabled(6),this.stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight?(this._renderShadowCascades(7,s),s.clear(),this._renderShadowCascades(6,s)):this._renderShadowCascades(5),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,this._bindParameters.contentCamera),this.performanceInfo.advance(ne.SHADOW_MAP)}_renderCutFillComputation(){this._nodes.produce(S.CUTFILL_COMPUTATION,this._pluginInput)?.release()}_precompileShadowCascades(e){0!==this._bindParameters.shadowMap.cascades.length&&this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._bindParameters.shadowMap){const r=this._bindParameters.output;t.bindFramebuffer();for(const s of t.cascades)s.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(s.camera,s.camera),this.renderAllGeometry(e);t.finish(e),this._bindParameters.output=r}get _needsDepth(){return this._nodes.requireGeometryDepth()||this.hasReflections||this._needsShadowHighlight||this._shadowAccumulator.active||this._debugNeedsDepth}get _usesPremultipliedAlphaBlit(){return this._pluginsHas.hudElements&&this.oitEnabled||this._hasPhotoshopTerrain}_renderSSAOAndDepth(){const e=this._pluginInput.get("normals");e?(this._pluginInput.set(S.SSAO,this._renderSSAO()),this._needsDepth?(this._rctx.bindFramebuffer(e.fbo),this._rctx.clear(1024),this._renderGeometryWithoutNormals(3),this._bindParameters.depth?.release(),this._bindParameters.depth=e.obtainDepthTexture(),this.performanceInfo.advance(ne.DEPTH)):(e.detachDepth(),this._bindParameters.depth=n(this._bindParameters.depth)),this.hasSSAO&&this._pluginInput.release("normals")):this._renderAllGeometryDepth()}_renderAllGeometryDepth(){if(this._bindParameters.depth=n(this._bindParameters.depth),!this._needsDepth)return;const{width:e,height:t}=this._framebuffer.size,r=this.fboCache.acquire(e,t,"geometry depth",13);this._rctx.bindFramebuffer(r.fbo),this._rctx.clear(1280),this.renderAllGeometry(3),this._bindParameters.depth=r.obtainDepthTexture(),r.release(),this.performanceInfo.advance(ne.DEPTH)}_renderTerrainDepth(){if(this._bindParameters.terrainDepth=n(this._bindParameters.terrainDepth),this._bindParameters.terrainDepthTest=this._bindParameters.cullAboveTerrain=this._needsTerrainDepth,!this._needsTerrainDepth)return;const e=this._bindParameters.output;this._bindParameters.output=3;const{width:t,height:r}=this._framebuffer.size,s=this.fboCache.acquire(t,r,"terrain depth",13);this._rctx.bindFramebuffer(s.fbo),this._rctx.clear(1280),this._renderTransparentGround(),this._bindParameters.terrainDepth=s.obtainDepthTexture(),s.release(),this._bindParameters.output=e}_renderGeometryDepth(){if(this._bindParameters.geometryDepth=n(this._bindParameters.geometryDepth),!this._needsTerrainDepth)return;const e=this._bindParameters.output,{width:t,height:r}=this._framebuffer.size,s=this.fboCache.acquire(t,r,"geometry depth",13);this._rctx.bindFramebuffer(s.fbo),this._rctx.clear(1280),this._renderOpaqueAndTransparentGeometry(3),this._bindParameters.output=e,this._bindParameters.geometryDepth=s.obtainDepthTexture(),s.release()}get _needsShadowDepthRange(){return this._bindParameters.shadowMap.enabled||this._shadowAccumulator.active}_computeShadowDepthRange(e){if(!this._needsShadowDepthRange)return z.Zero;const t=Q(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=z.Infinite);if((this.stage.view.renderCoordsHelper?.getAltitude(e.eye)??0)<G)return void(this.sceneDepthRange.value=z.Infinite);const t=e.clone();t.near=O,t.far=1e10;const r=Q(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",...R,S.VIEWSHED,S.LASERLINES);return(this.hasSSAO?1:0)+e}_precompilePrepasses(){this._normalsRequired&&this._precompileAllGeometry(4),this._needsDepth&&this._precompileAllGeometry(3),this.shadowsEnabled&&(this._needsShadowHighlight?(this._precompileShadowCascades(6),this._precompileShadowCascades(7)):this._precompileShadowCascades(5)),this._shadowAccumulator.active&&this._precompileAllGeometry(5),this.hasSSAO&&this._normalsRequired&&this._nodes.precompile(this._bindParameters.hasEmission,S.SSAO)}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const{width:t,height:r}=this._framebuffer.size,s=this.fboCache.acquire(t,r,"normals",5);s.acquireDepth(13),this._rctx.bindFramebuffer(s.fbo),this._rctx.clearFramebuffer(E,!0,!0),this._bindParameters.output=4,this._plugins.render(...ce);const i=this._nodes.optional("normals",...R,S.VIEWSHED);return s.retain(e+i-1),this.performanceInfo.advance(ne.NORMALS),s}_renderSSAO(){const e=this._pluginInput.get("normals");if(this.hasSSAO&&e)return this._bindParameters.ssao=this._nodes.produce(S.SSAO,this._pluginInput),this._bindParameters.ssao&&this.performanceInfo.advance(ne.SSAO),this._bindParameters.ssao}_precompileAllGeometry(e){const t=this._bindParameters.output;this._bindParameters.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(...pe),this._bindParameters.output=t}renderAllGeometry(e){this._bindParameters.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,...ge);this._renderContext.renderOccludedMask=J}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,...ge),this._renderContext.renderOccludedMask=J}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(...we[e])}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(17),this.renderHUD(e),this._bindParameters.hudRenderStyle=e,this._plugins.render(15)}precompileViewshedShadowMap(){this._precompileAllGeometry(8)}precompileCutFillReferenceDepth(){const e=this._bindParameters.output;this._bindParameters.output=9,this._plugins.precompile(...Ee),this._bindParameters.output=e}renderViewshedShadowMap(e){const{camera:t,contentCamera:r}=this._bindParameters,s=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(8),this._ensureBindParametersCamera(t,r),this._bindParameters.camera.setGLViewport(this._rctx),this._bindParameters.output=s}renderCutFillReferenceDepth(e){const{camera:t,contentCamera:r}=this._bindParameters,s=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this._bindParameters.output=9,this._plugins.render(...Ee),this._ensureBindParametersCamera(t,r),t.setGLViewport(this._rctx),this._bindParameters.output=s}_renderOpaqueAndTransparentGeometry(e){this._bindParameters.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithoutNormals(e){this._bindParameters.output=e,this._plugins.render(...fe)}_precompileOpaqueGeometry(){this._needsOpaquePass&&(this._plugins.precompile(...le),this._nodes.precompile(this._bindParameters.hasEmission,S.CUTFILL_COLOR,"opaque-color"))}_renderOpaqueGeometry(){this._plugins.render(...le)}_renderTransparentGeometry(){this._plugins.render(...me),this._oitCallouts&&this._plugins.render(16)}get _hasPhotoshopTerrain(){return this._plugins.produces(0,6)}get _needsTerrainDepth(){return this._highQualityTransparency&&this._hasPhotoshopTerrain}_renderPhotoshopTerrain(){if(!this._hasPhotoshopTerrain)return null;const{width:e,height:t}=this._framebuffer.size,r=this.fboCache.acquire(e,t,"transparent terrain"),s=()=>this._plugins.render(6);return this._renderToTargets(s,r,this._framebuffer.depth,E),this.performanceInfo.advance(ne.TRANSPARENT_TERRAIN),r}_renderTransparentGround(){this._plugins.render(...pe)}_renderLineCallouts(e){if(this._bindParameters.hudRenderStyle=e,0===e){const e=()=>this._plugins.render(16),{width:t,height:r}=this._framebuffer.size,s=this.fboCache.acquireDepth(this._hudDepthFormat,t,r,"line callouts");this._renderToTargets(e,this._framebuffer.color,s,void 0,!0,!0),s.release()}else this._plugins.render(16)}_precompileHUD(e){if(!this._pluginsHas.hudElements)return;const t=this._bindParameters.output,r=this._bindParameters.hudRenderStyle;this._bindParameters.hudRenderStyle=e,this.oitEnabled?(this._bindParameters.output=1,this._plugins.precompile(...be),this._bindParameters.output=2,this._plugins.precompile(...be),this._bindParameters.output=0,this._oitBlend.precompile(this._bindParameters,!1,1)):(this._bindParameters.output=0,this._plugins.precompile(...be)),this._hasHighlights&&(this._bindParameters.output=10,this._plugins.precompile(...be)),this._bindParameters.output=t,this._bindParameters.hudRenderStyle=r}_renderHUD(e,t){if(!this._pluginsHas.hudElements)return t;if(this.oitEnabled){const r=this._renderOIT(1,e);this._rctx.bindFramebuffer(t.fbo);const s=!!t.getTexture(oe);this._compositor.compositePreMultipliedAlpha(this._bindParameters,r.getTexture(),s),r.release()}else if(this._bindParameters.output=0,0===e){const t=()=>this._renderHUDElements(e),{width:r,height:s}=this._framebuffer.size,i=this.fboCache.acquireDepth(this._hudDepthFormat,r,s,"hud");this._renderToTargets(t,this._framebuffer.color,i,void 0,!0,!0),i.release()}else t.acquireDepth(this._hudDepthFormat),this._rctx.bindFramebuffer(t.fbo),this._rctx.clear(256),this._renderHUDElements(e),t.detachDepth();return this.performanceInfo.advance(0===e?ne.HUD_OCCLUDED:ne.HUD),t}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(6,2)}_renderHighlightPrepass(){if(!this._hasHighlights)return;const{fboCache:e,_rctx:t,_bindParameters:r}=this,{width:s,height:i}=this._framebuffer.size,{highlights:a}=r,n=a.length>L?3:1,h=e.acquire(s,i,"highlights",n);h.acquireDepth(13);const o=this._plugins.produces(10,0);return o&&this._framebuffer.color.fbo&&h.fbo&&t.blitFramebuffer(this._framebuffer.color.fbo,h.fbo,1024),t.bindFramebuffer(h.fbo),t.gl.clearBufferuiv(6144,0,[0,0,0,0]),o||t.clear(1024),this._bindParameters.output=10,t.bindFramebuffer(h.fbo),U(t,e,s,i,r,()=>this._renderHighlightGeometries()),h.detachDepth(),this.performanceInfo.advance(ne.HIGHLIGHTS),h.retain(this._nodes.require("highlights",...D)+this._nodes.optional("highlights",...D)-1),h}_renderHighlightGeometries(){this._plugins.render(...Pe),this._rctx.clear(256),this._renderHUDElements(2)}_renderShadowAccumulation(e,t){this._shadowAccumulator.updateDepthRange(e),this._bindParameters.output=0,this._shadowAccumulator.accumulating&&this._bindParameters.depth&&this._shadowAccumulator.renderAccumulation(this._bindParameters,t)&&this.performanceInfo.advance(ne.ACCUMULATED_SHADOWS)}_precompileTransparentGeometry(){this.oitEnabled&&F(this._bindParameters.output)?(this._bindParameters.output=1,this._plugins.precompile(...me),this._oitCallouts&&this._plugins.precompile(16),this._bindParameters.output=2,this._plugins.precompile(...me),this._oitCallouts&&this._plugins.precompile(16),this._bindParameters.output=0):this._plugins.precompile(...me)}_renderOIT(e,t=2){const r=1===e,{width:s,height:i}=this._framebuffer.size,a=r?()=>this._renderHUDElements(t):()=>this._renderTransparentGeometry(),h=this._bindParameters,o=this.hasFloatOit?8:5,d=h.output;h.output=1;const _=r?"oit hud":"oit",u=this.fboCache.acquire(s,i,_,o),l=this._bindParameters.hasEmission&&(0===e||1!==t);l&&u.acquireColor(oe,o,"oit emissive");const m=l?de:oe;u.acquireColor(m,this.hasFloatOit?7:0,"oit alpha"),r||u.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(u.fbo),this._rctx.clearFramebuffer([0,0,0,1]),l&&this._rctx.clearBuffer(1,E),a(),u.detachDepth(),h.output=2;const p=this.fboCache.acquire(s,i,r?"oit hud front":"oit front");l&&p.acquireColor(oe,o,"oit emissive front"),r?p.acquireDepth(this._hudDepthFormat):p.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(p.fbo),this._rctx.clearFramebuffer(E,r),a(),p.detachDepth();const c=this._pluginsHas.occludedHudElements&&!r;let f;return this._bindParameters.hudOcclusion=n(this._bindParameters.hudOcclusion),h.output=0,r?(f=this.fboCache.acquire(s,i,"oit hud composite"),this._rctx.bindFramebuffer(f.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(16384)):(c&&(this._framebuffer.color.acquireColor(m,0,"hud occlusion"),this._rctx.clearBuffer(m-_e,E)),this._framebuffer.bind()),this._oitBlend.blend(this._rctx,u,p,h,l,c,e),f?.detachDepth(),r||(this._rctx.bindFramebuffer(p.fbo),this._framebuffer.bind(),c&&(this._bindParameters.hudOcclusion=this._framebuffer.color.obtainAttachment(m))),p.release(),u.release(),h.output=d,f}get _hudDepthFormat(){return this.isFeatureEnabled(8)?13:12}get _needsOpaquePass(){return this.plugins.produces(0,...le)||this.plugins.produces(5,...le)||this.plugins.produces(3,3)}_renderOpaque(){const e=this._needsOpaquePass;e&&(this._plugins.render(0,1),this._framebuffer.update(e=>this._renderNodes(S.CUTFILL_COLOR,e)),this._plugins.render(2,3));const t=this._framebuffer;this._renderTerrainDepth(),t.update(t=>this._renderNodes(A.OPAQUE,t,e)),this.fboCache.debugCallback?.(A.OPAQUE,t.color.fbo),t.update(e=>this._renderNodes(S.OPAQUE_ENVIRONMENT,e)),this.fboCache.debugCallback?.(S.OPAQUE_ENVIRONMENT,t.color.fbo),this._renderEdges(1)}_renderTransparent(){const e=this._framebuffer;e.bind(),e.update(e=>this._renderNodes(S.PRE_TRANSPARENT,e)),this.fboCache.debugCallback?.(S.PRE_TRANSPARENT,e.color.fbo),this._renderHiddenTransparentEdges(),this._hasTransparentGeometry&&(this.oitEnabled?this._renderOIT(0):this._renderTransparentGeometry()),e.update(e=>this._renderNodes(A.TRANSPARENT,e,this._hasTransparentGeometry)),this.fboCache.debugCallback?.(A.TRANSPARENT,e.color.fbo),this._renderGeometryDepth(),this._needsTerrainDepth||this._oitCallouts||this._plugins.render(16),this._renderEdges(0);const t=this._renderPhotoshopTerrain(),r=t?.getTexture();r&&this._renderHUD(0,e.color),this._bindParameters.cullAboveTerrain=!1,r&&(e.bind(),this._compositor.compositePreMultipliedAlpha(this._bindParameters,r),t?.release(),this._needsTerrainDepth&&(this._renderEdges(1),this._hasTransparentGeometry&&(this.oitEnabled?this._renderOIT(0):this._renderTransparentGeometry(),this.performanceInfo.advance(ne.TRANSPARENT)),this._renderEdges(0))),this._bindParameters.ssao=n(this._bindParameters.ssao),this._needsTerrainDepth&&this._renderLineCallouts(1),this._bindParameters.terrainDepthTest=!1,this._renderTransparentEnvironment()}_renderTransparentEnvironment(){this._shadowAccumulator.render(this._bindParameters),this.performanceInfo.advance(ne.APPLY_ACCUMULATED_SHADOWS),this._framebuffer.bind(),this._plugins.render(9),this.performanceInfo.advance(ne.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderNodes(e,t,r=!1){const s=t.name;if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return r&&this.performanceInfo.advance(e),t;this._fboCache.debugCallback?.(s,t.fbo);const i=this._nodes.render(t,this._pluginInput,this._releaseNodeInputs);return this.performanceInfo.advance(e),i}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersWeatherFader(e){1===this.stage.viewingMode&&(this._bindParameters.clouds.data&&(this._bindParameters.clouds.fade(this._bindParameters.camera,e,this.stage.view.qualitySettings.fadeDuration),this.weatherFader?.cleanupCubemap()),this._bindParameters.snowCover=this.weatherFader?.snowCover??0)}_ensureBindParametersSSR(e){if(this._bindParameters.ssr.lastFrameColor){null==this._ssrEnableTime&&(this._ssrEnableTime=e),this._renderContext.lastFrameCamera.equals(this._bindParameters.camera)?this._reprojectionMatrix=b:(f(Se,this._bindParameters.camera.viewMatrix),f(Ae,this._bindParameters.camera.projectionMatrix),g(Re,Se,Ae),g(Re,this._renderContext.lastFrameCamera.viewMatrix,Re),g(Re,this._renderContext.lastFrameCamera.projectionMatrix,Re),this._reprojectionMatrix=Re);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=b,this._ssrEnableTime=null}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,r,s){this._bindParameters.updateLighting(e,t,r,s),this._requestRender(1)}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0,clouds:this.weatherFader?.usedMemory??0}}_renderToTargets(e,t,r,s,i=!1,a=!1){t.attachDepth(r),this._rctx.bindFramebuffer(t.fbo),this._rctx.clearFramebuffer(s,i,a),e(),t.detachDepth()}get test(){}};e([m({readOnly:!0})],ue.prototype,"highResolutionAtmosphere",null),e([m()],ue.prototype,"_edgeView",void 0),e([m()],ue.prototype,"updating",null),ue=e([p("esri.views.3d.webgl-engine.lib.Renderer")],ue);const le=[0,1,2,3],me=[7,8,4,5],pe=[6,7,8],ce=[0,1,2,4,...pe],fe=[3,5],ge=[2,4,9],be=[17,13,15,14],Pe=[4,5,2,3,0,1,...pe],Te=[4,9,5,12],we={0:[14],1:[13],2:[14,13],3:[14,13]},Ee=[0,1,...pe],Ce=["normals","highlights"],Ae=P(),Se=P(),Re=P();function De(e){return t=>e.immediate.schedule(t)}export{ue as Renderer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{sliceEquals as i}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{smoothstep as r}from"../../../../core/mathUtils.js";import{disposeMaybe as
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{sliceEquals as i}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{smoothstep as r}from"../../../../core/mathUtils.js";import{releaseMaybe as s,disposeMaybe as a}from"../../../../core/maybe.js";import{watch as o,sync as n}from"../../../../core/reactiveUtils.js";import{signal as h}from"../../../../core/signal.js";import{property as c,subclass as u}from"../../../../core/accessorSupport/decorators.js";import{copy as l,equals as _}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ReadShadowMapPassParameters as d}from"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{BindParameters as p}from"./BindParameters.js";import{DepthRange as f}from"./DepthRange.js";import{createQuadVAO as g}from"./glUtil3D.js";import{ShadowCastRenderer as b,shadowCastDisabledElevationThreshold as v,shadowCastDisableElevationMax as S,shadowCastDisableElevationMin as y}from"./ShadowCastRenderer.js";import{ShadowMap as w}from"./ShadowMap.js";import{S as A}from"../../../../chunks/ShadowCastAccumulate.glsl.js";import{ShadowCastAccumulateTechnique as R}from"../shaders/ShadowCastAccumulateTechnique.js";import{ShadowCastAccumulateTechniqueConfiguration as F}from"../shaders/ShadowCastAccumulateTechniqueConfiguration.js";import{ShadowCastClearTechnique as C}from"../shaders/ShadowCastClearTechnique.js";import{TaskPriority as x}from"../../../support/Scheduler.js";import{PixelType as H}from"../../../webgl/enums.js";let P=class extends t{constructor(e,t,i,r,a,h){super({}),this._fbos=e,this._techniques=t,this._stage=i,this._prepareForShadowMapPass=r,this._renderToShadowMap=a,this._requestRender=h,this._primarySet=new T(new F(0),()=>this._requestRenderIfEnabled()),this._contextSet=new T(new F(1),()=>this._requestRenderIfEnabled()),this._passParameters=new d,this._depthRange=f.Zero,this._enabled=!1,this._previewing=!1,this._shadowAccumulatorKey=Symbol("shadowAccumulator"),this._bindParameters=new p(e.rctx,new w(e,i.viewingMode)),this._bindParameters.shadowMap.enabled=!0,this._vao=g(e.rctx),this._accumulationRenderer=new b(t,e.rctx,this,h);const c=this._stage.view.resourceController.scheduler;this.addHandles([c.registerTask(x.SHADOW_ACCUMULATOR,this),o(()=>this._previewing,e=>{e?this._invalidateAccumulationSets():this._requestRenderIfEnabled()},n),o(()=>this._numActive,()=>this._numActiveChanged(),n),o(()=>this._depthRange,()=>this._invalidateAccumulationSets(),n),o(()=>this.readyToRun,e=>{e||(this._bindParameters.depth=s(this._bindParameters.depth),this.notifyChange("canAccumulate"))}),o(()=>this.accumulating&&this.canAccumulate,()=>this._precompile(),{sync:!0,once:!0})],this._shadowAccumulatorKey)}destroy(){this._disable(),this.removeHandles(this._shadowAccumulatorKey),this._accumulationRenderer=a(this._accumulationRenderer),this._fboHandle=a(this._fboHandle),this._vao=a(this._vao),this._bindParameters.destroy();for(const e of this._accumulationSets())e.destroy();this._contextSet=null,this._primarySet=null}*_accumulationSets(){yield this._primarySet,yield this._contextSet}get computedSamples(){return[this._primarySet.progress,this._contextSet.progress]}get shadowCastTexture(){return this._fboHandle?.getTexture()}get accumulating(){return this.active&&this._previewing||this._refining}get _refining(){return this.active&&!this._doneAccumulating&&!this._previewing}get active(){return this._enabled&&[...this._accumulationSets()].some(e=>e.active)}get canAccumulate(){return null!=this._bindParameters.depth&&this._depthRange!==f.Zero&&this._opacityFromElevation>v}get _doneAccumulating(){return[...this._accumulationSets()].every(e=>e.doneAccumulating)}get _opacityFromElevation(){return this._accumulationRenderer.opacityFromElevation}set _opacityFromElevation(e){this._accumulationRenderer.opacityFromElevation=e}get _numActive(){return[...this._accumulationSets()].reduce((e,t)=>e+(t.active?1:0),0)}get _colorFormat(){return 2===this._numActive?2:0}get readyToRun(){return this._refining&&this.canAccumulate&&[...this._accumulationSets()].some(e=>e.running)}runTask(e){this._clearBuffersOnAccumulationStart(),this._prepareForShadowMapPass(this._bindParameters);let t=!1;for(const i of this._accumulationSets())this._runTaskForSet(i,e)&&(t=!0);t&&this._requestRender()}_runTaskForSet(e,t){let i=!1;for(;!t.done&&!e.doneAccumulating;)this._accumulateShadow(e),t.madeProgress(),i=!0;return i}_precompile(){for(const e of this._accumulationSets())this._techniques.precompile(R,e.configuration),this._techniques.precompile(C,e.configuration)}renderAccumulation(e,t){return this._updateCamera(e.camera),this._bindParameters.contentCamera=e.contentCamera,this._bindParameters.depth?.release(),e.depth?.retain(),this._bindParameters.depth=e.depth,this._passParameters.origin=this._bindParameters.camera.center,this.notifyChange("canAccumulate"),!(!this.accumulating||!this.canAccumulate)&&(this._previewing||t?(this._clearFramebuffer(),this._reset()):this._clearBuffersOnAccumulationStart(),this._accumulateSetsForRenderFrame(t))}_clearBuffersOnAccumulationStart(){if([...this._accumulationSets()].every(e=>0===e.progress))this._clearFramebuffer();else for(const e of this._accumulationSets())0===e.progress&&this._clearFramebufferForSet(this._fboHandle,e)}_accumulateSetsForRenderFrame(e){let t=!1;for(const i of this._accumulationSets())this._accumulateSetForRenderFrame(i,e)&&(t=!0);return t&&this._requestRender(),t}_accumulateSetForRenderFrame(e,t){let i=t?e.sampleCount:Math.min(q,e.sampleCount);i-=e.progress;for(let r=0;r<i;++r)this._accumulateShadow(e);return i>0}precompile(){this._accumulationRenderer.precompile()}render(e){this._accumulationRenderer.render(e)}setParameters(e){void 0!==e.previewing&&(this._previewing=e.previewing),void 0!==e.lightDirections&&(this._primarySet.lightDirections=e.lightDirections),void 0!==e.lightDirectionsContext&&(this._contextSet.lightDirections=e.lightDirectionsContext),!0===e.enabled?this._enable():!1===e.enabled&&this._disable(),this._accumulationRenderer.setOptions(e)}readAccumulatedShadow(e,t){const i=this._primarySet.progress;return!this.active||!this._fboHandle||i<1||e<0||e>=this._fboHandle.fbo.width||t<0||t>=this._fboHandle.fbo.height?0:(this._fboHandle.fbo.readPixels(e,t,1,1,6408,H.UNSIGNED_BYTE,j),j[0]/i)}_numActiveChanged(){if(!this._enabled||!this._fboHandle)return;const e=2===this._numActive,{width:t,height:i}=this._fboHandle.fbo,r=this._createFBO(t,i);e&&(this._clearFramebuffer(r),this._contextSet.reset()),this._rctx.blitFramebuffer(this._fboHandle.fbo,r.fbo),this._fboHandle.dispose(),this._fboHandle=r,this._requestRender()}_enable(){this._enabled||(this._enabled=!0,this._invalidateAccumulationSets())}_disable(){this._enabled&&(this._fboHandle=a(this._fboHandle),this._enabled=!1,this._requestRender())}_createFBO(e,t){return this._fbos.acquire(e,t,"shadow accumulation",this._colorFormat)}_invalidateAccumulationSets(){for(const e of this._accumulationSets())e.reset();this._requestRenderIfEnabled()}_reset(){for(const e of this._accumulationSets())e.reset()}_clearFramebuffer(e=this._fboHandle){e&&(this._rctx.bindFramebuffer(e.fbo),this._rctx.setClearColor(0,0,0,0),this._rctx.clear(16384))}_clearFramebufferForSet(e,t){if(!e)return;const i=this._techniques.get(C,t.configuration);this._rctx.bindFramebuffer(e.fbo),this._rctx.bindTechnique(i,this._bindParameters,this._passParameters),this._rctx.bindVAO(this._vao),this._rctx.drawArrays(i.primitiveType,0,this._vao.vertexCount("geometry"))}_accumulateShadow(e){this._renderToShadowMap(this._bindParameters,e.lightDirections[e.progress++],this._depthRange);const t=this._techniques.get(R,e.configuration);this._rctx.bindFramebuffer(this._fboHandle?.fbo),this._rctx.bindTechnique(t,this._bindParameters,this._passParameters),this._rctx.bindVAO(this._vao),this._rctx.drawArrays(t.primitiveType,0,this._vao.vertexCount("geometry"))}_updateCamera(e){if(!this._enabled)return;const t=this._bindParameters.camera;e.equals(t)||t.copyFrom(e),this._fboHandle?.fbo.width===e.fullWidth&&this._fboHandle?.fbo.height===e.fullHeight||(this._fboHandle?.release(),this._fboHandle=this._createFBO(e.fullWidth,e.fullHeight)),this._opacityFromElevation=1-r(y,S,e.relativeElevation)}_requestRenderIfEnabled(){this._enabled&&this._requestRender()}get _rctx(){return this._fbos.rctx}updateDepthRange(e){this._depthRange.equals(e)||(this._depthRange=e)}get test(){}};e([c()],P.prototype,"_refining",null),e([c()],P.prototype,"active",null),e([c()],P.prototype,"canAccumulate",null),e([c()],P.prototype,"_doneAccumulating",null),e([c()],P.prototype,"_opacityFromElevation",null),e([c()],P.prototype,"_numActive",null),e([c()],P.prototype,"_colorFormat",null),e([c()],P.prototype,"readyToRun",null),e([c()],P.prototype,"_depthRange",void 0),e([c()],P.prototype,"_enabled",void 0),e([c()],P.prototype,"_previewing",void 0),e([c()],P.prototype,"_accumulationRenderer",void 0),P=e([u("esri.views.3d.webgl-engine.lib.ShadowAccumulator")],P);const q=6,j=new Uint8Array(4);class T{constructor(e,t){this.configuration=e,this._notifyChange=t,this._cachedLightDirections=[],this._progress=h(0),this._sampleCount=h(0)}get progress(){return this._progress.value}set progress(e){this._progress.value=e}get sampleCount(){return this._sampleCount.value}get doneAccumulating(){return this.progress>=this.sampleCount}get running(){return this.progress>0}get active(){return this.sampleCount>0}get lightDirections(){return this._cachedLightDirections}set lightDirections(e){const t=this._cachedLightDirections,r=Math.min(A,e.length);if(!i(t,0,t.length,e,0,r,_)){t.length=r,this._sampleCount.value=r;for(let i=0;i<r;++i)t[i]=l(t[i]??m(),e[i]);this.reset(),this._notifyChange()}}destroy(){this._cachedLightDirections.length=0,this._sampleCount.value=0}reset(){this.progress=0}precompile(e){e.precompile(R,this.configuration),e.precompile(C,this.configuration)}}export{P as ShadowAccumulator};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import"../../../../core/libs/gl-matrix-2/math/vec2.js";import"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/NormalUtils.glsl.js";import"../core/shaderLibrary/shading/PositionOutsideClipSpace.js";import"../core/shaderLibrary/shading/TerrainDepthTest.glsl.js";import"../core/shaderLibrary/util/ComputeCovariance.glsl.js";import"../core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js";import"../core/shaderLibrary/util/QuaternionToRotationMatrix.glsl.js";import"../core/shaderLibrary/util/RgbNormalizedDepthEncoding.glsl.js";import"../core/shaderModules/Float2BindUniform.js";import"../core/shaderModules/Float2PassUniform.js";import"../core/shaderModules/Float3BindUniform.js";import"../core/shaderModules/Float3PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Matrix4BindUniform.js";import"../core/shaderModules/Texture2DUintPassUniform.js";import"./GaussianSplatTechniqueConfiguration.js";import"../../../webgl/ShaderBuilder.js";export{G as GaussianSplatPassParameters,b as build}from"../../../../chunks/GaussianSplat.glsl.js";
|
|
2
|
+
import"../../../../core/libs/gl-matrix-2/math/vec2.js";import"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/NormalUtils.glsl.js";import"../core/shaderLibrary/shading/PositionOutsideClipSpace.js";import"../core/shaderLibrary/shading/TerrainDepthTest.glsl.js";import"../core/shaderLibrary/util/ComputeCovariance.glsl.js";import"../core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js";import"../core/shaderLibrary/util/QuaternionToRotationMatrix.glsl.js";import"../core/shaderLibrary/util/RgbNormalizedDepthEncoding.glsl.js";import"../core/shaderModules/Float2BindUniform.js";import"../core/shaderModules/Float2PassUniform.js";import"../core/shaderModules/Float3BindUniform.js";import"../core/shaderModules/Float3PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Matrix4BindUniform.js";import"../core/shaderModules/Texture2DUintPassUniform.js";import"./GaussianSplatTechniqueConfiguration.js";import"../../../webgl/ShaderBuilder.js";export{G as GaussianSplatPassParameters,b as build}from"../../../../chunks/GaussianSplat.glsl.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{
|
|
2
|
+
import{__decorate as e}from"tslib";import{SliceConfiguration as t}from"../core/shaderLibrary/Slice.glsl.js";import{parameter as i}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";class r extends t{constructor(e){super(),this.spherical=e,this.alphaCutoff=1,this.fadingEnabled=!1,this.clippingEnabled=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.receiveAmbientOcclusion=!1,this.pbrMode=0,this.useCustomDTRExponentForWater=!1,this.useFillLights=!1,this.hasColorTexture=!0}}function o(e){switch(e){case 2:return.005;case 0:return.05;default:return.01}}e([i({count:3})],r.prototype,"alphaCutoff",void 0),e([i()],r.prototype,"fadingEnabled",void 0),e([i()],r.prototype,"clippingEnabled",void 0),e([i()],r.prototype,"terrainDepthTest",void 0),e([i()],r.prototype,"cullAboveTerrain",void 0),e([i()],r.prototype,"receiveAmbientOcclusion",void 0);export{r as GaussianSplatTechniqueConfiguration,o as getGaussianSplatAlphaCutoffValue};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{isColor as o,isOITColor as r,isOITFrontFace as i}from"../core/shaderLibrary/ShaderOutput.js";import{Emissions as l}from"../core/shaderLibrary/output/Emissions.glsl.js";import{OutputHighlight as a}from"../core/shaderLibrary/output/OutputHighlight.glsl.js";import{ColorConversion as t}from"../core/shaderLibrary/util/ColorConversion.glsl.js";import{If as s,glsl as e}from"../core/shaderModules/glsl.js";import{alphaCutoff as n}from"./alphaCutoff.glsl.js";import{oitResolution as f}from"./oitResolution.glsl.js";function u(u,d){u.include(a,d),u.include(l,d);const{fragment:g,outputs:c}=u;g.include(t);const{output:m,hasEmission:C,discardInvisibleFragments:p,oitPremultipliedAlpha:h,snowCover:v,hasFloatOit:b}=d,y=11===m,O=r(m),$=i(m),E=o(m)&&!O;let j=0;(E||O)&&c.add("fragColor","vec4",j++),C&&c.add("fragEmission","vec4",j++),O&&c.add("fragAlpha","float",j++),g.include(n),g.include(f,d),g.code.add(b?"float ditherNoise() { return 0.0; }":"
|
|
2
|
+
import{isColor as o,isOITColor as r,isOITFrontFace as i}from"../core/shaderLibrary/ShaderOutput.js";import{Emissions as l}from"../core/shaderLibrary/output/Emissions.glsl.js";import{OutputHighlight as a}from"../core/shaderLibrary/output/OutputHighlight.glsl.js";import{ColorConversion as t}from"../core/shaderLibrary/util/ColorConversion.glsl.js";import{If as s,glsl as e}from"../core/shaderModules/glsl.js";import{alphaCutoff as n}from"./alphaCutoff.glsl.js";import{oitResolution as f}from"./oitResolution.glsl.js";function u(u,d){u.include(a,d),u.include(l,d);const{fragment:g,outputs:c}=u;g.include(t);const{output:m,hasEmission:C,discardInvisibleFragments:p,oitPremultipliedAlpha:h,snowCover:v,hasFloatOit:b}=d,y=11===m,O=r(m),$=i(m),E=o(m)&&!O;let j=0;(E||O)&&c.add("fragColor","vec4",j++),C&&c.add("fragEmission","vec4",j++),O&&c.add("fragAlpha","float",j++),g.include(n),g.include(f,d),g.code.add(b?"float ditherNoise() { return 0.0; }":"float ditherNoise() {\n return (1.0 / 255.0) *\n (fract(52.9829189 * fract(dot(gl_FragCoord.xy + gl_FragCoord.z, vec2(0.06711056, 0.00583715)))) - 0.5);\n }\n "),g.code.add(e`
|
|
3
3
|
void outputColorHighlightOLID(vec4 finalColor, vec3 emissiveSymbolColor ${s(v,", float snow")}) {
|
|
4
4
|
${s(y,"finalColor.a = 1.0;")}
|
|
5
5
|
${s(p,"if (finalColor.a < alphaCutoff) { discard; }")}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{getKey as t}from"../../core/object.js";import{AllocationTracer as r}from"./AllocationTracer.js";import{ResourceType as e}from"./enums.js";const o={RECORD_ALLOCATIONS:!
|
|
2
|
+
import{getKey as t}from"../../core/object.js";import{AllocationTracer as r}from"./AllocationTracer.js";import{ResourceType as e}from"./enums.js";const o={RECORD_ALLOCATIONS:!0};class n{constructor(){for(this._current=new Array,this._allocations=o.RECORD_ALLOCATIONS?new r("WebGLObject"):null;this._current.length<e.COUNT;)this._current.push(0)}increment(t,r,e=1){this._current[t]+=e,this._allocations?.add(r)}decrement(t,r,e=1){this._current[t]-=e,this._allocations?.remove(r)}get current(){return this._current}get total(){return this.current.reduce((t,r,o)=>t+(o<e.UNCOUNTED?r:0),0)}get resourceInformation(){let r="";if(this.total>0){r+="Live objects:\n";for(let o=0;o<e.COUNT;++o){const n=this._current[o];n>0&&(r+=`${t(e,o)}: ${n}\n`)}}return r+=this._allocations?.resetLog(),r}}export{n as InstanceCounter,o as test};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import e from"../../WebScene.js";import n from"../../core/Error.js";import r from"../../core/Version.js";import
|
|
2
|
+
import e from"../../WebScene.js";import n from"../../core/Error.js";import r from"../../core/Version.js";import o from"../../libs/ajv/ajv.bundle-wrapper.js";import{json as t}from"../../portal/schemas/webScene.js";import{convertAjvErrors as s}from"../../support/validationUtilsAjv.js";let i=null;function a(e,n){d(n);const r=h();return r.validate(j(n),e)?[]:s(r.errors??[])}async function c(n){let o=r.parse(n.version||"","webscene");const t=r.parse(e.version,"webscene");if(o.major===t.major&&o.minor===t.minor)return a(n);o.lessThan(1,38)&&(o=new r(1,38,"webscene"));const i=h(),c=m(o);if(null==i.getSchema(c)){const e=await fetch(l(o));if(e.ok){const n=await e.json();i.addSchema(n,c)}}return i.validate(c,n)?[]:s(i.errors??[])}async function f(e){const n=await c(e);if(n.length)throw new p(n)}function m(e){return`webscene-schema-v${e.major}.${e.minor}.json`}function l(e){return`https://js.arcgis.com/webscene-spec/${m(e)}`}function u(e){const n=e?t.definitions[j(e)]:void 0;if(!n)throw new Error(`invalid schema name to validate against '${e}'`);const r={};for(const o in n)r[o]=n[o];return r.definitions=t.definitions,r}function d(e){const n=j(e),r=h();if(!r.getSchema(n)){const o=u(e);r.addSchema(o,n)}}function h(){return i||(i=new o({allErrors:!0,extendRefs:!0}),i.addSchema(t,j()),i)}function w(){i=null}function j(e){return e?`${e}_schema.json`:"webScene_schema.json"}class p extends n{constructor(e){super("webscene:validation-failed",`WebScene validation failed with ${e.length} ${1===e.length?"error":"errors"}.`,{errors:e})}}export{p as WebSceneValidationError,f as assertValidWebScene,w as clearValidator,l as getVersionedWebSceneSchemaCDNUrl,a as validate,c as validateWebScene};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import e from"../../Color.js";import t from"../../Graphic.js";import{isSome as r,equals as n,addMany as o}from"../../core/arrayUtils.js";import{createTask as i}from"../../core/asyncUtils.js";import a from"../../core/Error.js";import{handlesGroup as s,makeHandle as l,abortHandle as c}from"../../core/handleUtils.js";import{clone as u}from"../../core/lang.js";import p from"../../core/Logger.js";import{getOrCreateMapValue as d}from"../../core/MapUtils.js";import{debounce as f,isPromiseLike as y,throwIfAborted as m,whenOrAbort as h}from"../../core/promiseUtils.js";import{watch as g,on as b,whenOnce as w}from"../../core/reactiveUtils.js";import{px2pt as I}from"../../core/screenUtils.js";import{addMany as v}from"../../core/SetUtils.js";import{diff as T}from"../../core/accessorSupport/diffUtils.js";import{isSharedTemplateOrMetadata as F,isSharedGroupTemplate as j,getCreationAttributes as S,isSharedPresetTemplate as k}from"../../editing/templateUtils.js";import{isCurvedGeometry as A,hasUnsupportedCurve as L}from"../../geometry/support/curves/curveUtils.js";import U from"../../layers/GraphicsLayer.js";import{featureHasFields as V,fixFields as M,getDisplayFieldName as O}from"../../layers/support/fieldUtils.js";import{isSubtypeSublayer as x,isGraphicsLayer as q,isSceneLayer as z}from"../../layers/support/layerUtils.js";import{calculateTolerance as C}from"../../renderers/support/clickToleranceUtils.js";import{meterIn as P}from"../../renderers/support/lengthUtils.js";import{isRenderer as E}from"../../renderers/support/typeUtils.js";import{getTransformationType as R}from"../../renderers/visualVariables/support/sizeVariableUtils.js";import{isGraphic as D}from"../../support/graphicInstanceUtils.js";import G from"../../symbols/SimpleFillSymbol.js";import B from"../../symbols/SimpleLineSymbol.js";import Z from"../../symbols/SimpleMarkerSymbol.js";import{to3D as N}from"../../symbols/support/symbolConversion.js";import{getDisplayedSymbol as Q}from"../../symbols/support/symbolUtils.js";import{getServices as W}from"../../undoredo/support/Services.js";import{GraphicState as $}from"../../views/3d/layers/graphics/GraphicState.js";import{defaultDrawingMode as H}from"../../views/draw/drawingModes.js";import{createQueryGeometry as J}from"../../views/support/drapedUtils.js";import{filterGraphicHits as K,hitTestSelectSimilarDistance as X}from"../../views/support/hitTestSelectUtils.js";import{dependencySort as Y}from"./support/dependencySort.js";import{isDrawGraphicTool as _,isDrawTool as ee}from"../Sketch/support/sketchUtils.js";const te=()=>p.getLogger("esri.widgets.Editor.workflowUtils");function re(e){return le(e)||ae(e)}function ne(e){return!!e&&"features"in e}function oe(e){return null!=e&&"create-features"===e.type}function ie(e){return!!e&&"feature"in e}function ae(e){return null!=e&&"update-features"===e.type}function se(e){return null!=e&&"update-feature"===e.type}function le(e){return null!=e&&e.type.includes("update-")&&"fullFeature"in e}function ce(e){return null!=e&&"update"===e.type}function ue(e){return null!=e&&"merge-features"===e.type}function pe(e){return null!=e&&"split-feature"===e.type}function de(e){const t=e?.type;return"update-feature"===t||"update-table-record"===t||"update-features"===t||"split-feature"===t}function fe(e){return"merge"===e?.type}function ye(e){return"split"===e?.type}function me(e){return ue(e)||pe(e)}function he(e){return"update-multiple"===e?.type}function ge(e){const t=e&&"renderer"in e?e.renderer:null;if(!je(t))return{rotation:null,size:null};const r=t.getVisualVariablesForType("rotation").filter(e=>(!e.axis||"heading"===e.axis)&&e.field&&!e.valueExpression),n=t.getVisualVariablesForType("size").filter(e=>e.field&&!e.useSymbolValue&&!e.valueExpression&&"real-world-size"===R(e));return{rotation:1===r.length?r[0]:null,size:1===n.length?n[0]:null}}function be(e){const t=e.sourceLayer;if(!(t&&"renderer"in t&&je(t.renderer)))return{rotation:null,size:null};const{rotation:r,size:n}=ge(t);let o=null,i=null;if(r){const e=t.fields?.filter(e=>e.name===r.field),n=1===e?.length?e[0]:null;o=we(r,n)}if(n){const e=t.fields?.filter(e=>e.name===n.field),r=1===e?.length?e[0]:null;i=Te(n,r)}return{rotation:o,size:i}}function we(e,t){const r="heading"===(e.axis||"heading")&&"arithmetic"===e.rotationType?-1:1,n=t?.type??"double",o={initial:0,current:0};return{field:e.field,fieldType:n,getDefaultValue:()=>Promise.resolve(0),getValue:e=>(o.current=o.initial-r*e,Fe((o.current+360)%360,n)),setInitialValue:e=>{o.initial=e,o.current=0},isUpdatingInteractively:!1,rotationType:e.rotationType??"geographic"}}function Ie(e,t){switch(t){case"width":return e[0];case"depth":return e[1];case"height":return e[2];default:return e[2]||e[1]||e[0]}}async function ve(e,t,r){if(null==t)return 0;const{symbol:n}=N(t);if(null==n||"web-style"===n.type||"cim"===n.type)return 0;const o=n.symbolLayers.at(0);if(!o)return 0;switch(o.type){case"icon":{const{computeIconLayerResourceSize:e}=await import("../../symbols/support/symbolLayerUtils.js");return Math.min(ut.icon,(await e(o,ut.icon))[0])||ut.icon}case"text":return ut.text;case"line":return ut.line;case"object":{const{computeObjectLayerResourceSize:t}=await import("../../symbols/support/symbolLayerUtils.js");return Ie(await t(o,e.scale/ut.viewScaleSizeFactor),r)}case"path":case"extrude":return e.scale/ut.viewScaleSizeFactor;default:return 0}}function Te(e,t){const r=e.axis,n=t?.type??"double",o={initial:0,current:0},i=P[e.valueUnit]??1;let a;return a="area"===e.valueRepresentation?e=>(e*i/2)**2*Math.PI:"radius"===e.valueRepresentation||"distance"===e.valueRepresentation?e=>e*i/2:e=>e*i,{field:e.field,fieldType:n,getDefaultValue:async(e,t)=>Fe(a(await ve(t,e,r)),n),getValue:(e,t)=>(o.initial||(o.initial=t.pixelSizeAt(t.center)),o.current=o.initial*e,Fe(o.current,n)),setInitialValue:e=>{o.initial=e,o.current=0},isUpdatingInteractively:!1,displayUnit:ft(e.valueUnit),axis:e.axis}}function Fe(e,t){switch(t){case"small-integer":case"integer":case"long":return Math.round(e);case"double":case"single":return e;default:return 0}}function je(e){if(!E(e))return!1;switch(e?.type){case"class-breaks":case"simple":case"unique-value":case"dot-density":case"dictionary":case"pie-chart":return!0;default:return!1}}async function Se(e,t,r){const n=await Q(e,{useSourceLayer:!0,ignoreGraphicSymbol:!0,webStyleCache:t,scale:r});null!=T(e.symbol,n)&&(e.symbol=n)}function ke(e,t){if(!e||!t)throw new Error("no geometry type");if("multipatch"===e)return{tool:"mesh",createOptions:{mode:"hybrid"}};const r=new Map;r.set("circle",{mode:"freehand"}),r.set("rectangle",{mode:"freehand"});const n={mode:H,optionsPerTool:r};if(F(t)){const o=t.defaultTool,i=j(t)?t.definition?.inputGeometryType??e:e;switch(o){case"freehand":case"stream-line":return{tool:"polyline"===i?"freehandPolyline":"freehandPolygon",createOptions:n};case"autocomplete-freehand-polygons":case"stream-polygon":return{tool:"freehandPolygon",createOptions:n};case"autocomplete-polygons":case"difference-polygon":case"create-structures":case"polygon":case"trace":return{tool:"polygon"===i?"polygon":"polyline",createOptions:n};case"circle":return r.get("circle").preserveAspectRatio=!0,{tool:"circle",createOptions:n};case"ellipse":return r.get("circle").preserveAspectRatio=!1,{tool:"circle",createOptions:n};case"create-points-along-line":case"multipoint":return{tool:"multipoint",createOptions:n};case"line":case"radial-line":case"right-angle-line":case"split":case"two-point-line":return{tool:"polyline",createOptions:n};case"rectangle":case"regular-polygon":case"right-angle-polygon":return{tool:"rectangle",createOptions:n};case"elevation-point-from-contour":case"elevation-point-from-dem":case"parcel-seed":case"point":case"point-and-rotation":case"point-at-end-of-line":return{tool:"point",createOptions:n}}}else{const o=t.drawingTool;if("circle"===o||"ellipse"===o)return r.get("circle").preserveAspectRatio="circle"===o,{tool:"circle",createOptions:n};if("rectangle"===o)return{tool:"rectangle",createOptions:n};if("freehand"===o)return{tool:"polygon"===e?"freehandPolygon":"freehandPolyline",createOptions:n}}return{tool:e,createOptions:n}}async function Ae(e,t,r,n){const{creationInfo:o,fullTemplate:i}=r;if(!o)throw new a("featureworkflow","No creation info provided.");const s=o.layer,l=S(i,o.attributeOverrides,o.layer),{view:c}=e,u="2d"===c?.type;j(i)||k(i)||await Qe(e,s,l,n,u?c.scale:null);const{capabilities:p}=s;t.elevationInfo=s.elevationInfo;const d=ke(s.geometryType,i);e.defaultCreateOptions={graphicProperties:{attributes:l,sourceLayer:s},mode:d.createOptions.mode,optionsPerTool:d.createOptions.optionsPerTool,preserveAspectRatio:d.createOptions.preserveAspectRatio,hasZ:p.data.supportsZ,defaultZ:(u?p.editing.zDefault:null)??e.defaultCreateOptions.defaultZ},null==o.geometryToPlace?await e.create(d.tool):await e.place(o.geometryToPlace,{graphicProperties:{attributes:l,sourceLayer:s}})}async function Le(e){return s([Ue(e),Ve(e)])}function Ue({creationAttributes:e,data:t,sketchViewModel:r,view:n,webStyleCache:o}){const{creationInfo:i}=t,{fullTemplate:a}=t;if(!i||"2d"!==n?.type||j(a)||k(a))return null;const s=f(t=>Qe(r,i.layer,e,o,t));return g(()=>n.scale,e=>s(e))}function Ve({data:t,sketchViewModel:r,view:n}){const{templateExecutorInfo:o}=t;if(!o)return null;const i=r.activeComponent;if(!n||!_(i)&&!ee(i))return te().error(new a("featureworkflow","Failed to set up template feedback.")),null;const c=new U({effect:"saturate(0.6) opacity(0.8)",listMode:"hide",title:"Shared Template Feedback Graphics"});n.map?.add(c);const{executor:u,serviceLayersById:p}=o,d=n.theme?.accentColor??new e([255,165,0,1]);return s([b(()=>i,["cursor-update","vertex-add"],()=>{c.removeAll();const e=_(i)?i.graphic?.geometry:i.unprocessedGeometry;if(!e||!Me(e))return;const t=u(e,"digitizing");if(!y(t))for(const r of t.edits){const e=p.get(r.id);if(e&&r.addFeatures&&0!==r.addFeatures.length)for(const t of e)if(!t.isTable)for(const e of r.addFeatures){const t=Oe(e,d);t&&c.add(t)}}}),l(()=>{n.map.remove(c),c.destroy()})])}function Me(e){switch(e.type){case"point":case"multipoint":return!0;case"polyline":{if(A(e))return e.curvePaths[0].length>1;const t=e.paths[0];return!!t&&t.length>1}case"polygon":{if(A(e))return e.curveRings[0].length>2;const t=e.rings[0];return!!t&&(n(t.at(0),t.at(-1))?t.length>2:t.length>1)}default:return!1}}function Oe(e,r){let n=null;switch(e.geometry?.type){case"point":case"multipoint":n=new Z({angle:0,color:r,outline:new B({cap:"round",color:r,join:"round",miterLimit:1,style:"solid",width:1}),path:"undefined",size:8,style:"circle",xoffset:0,yoffset:0});break;case"polygon":n=new G({color:r,outline:new B({cap:"round",color:r,join:"round",miterLimit:1,style:"solid",width:3}),style:"none"});break;case"polyline":n=new B({cap:"round",color:r,join:"round",miterLimit:1,style:"solid",width:2});break;default:return null}return new t({geometry:e.geometry,symbol:n,attributes:{...e.attributes}})}function xe(e,t){const r=W(t),n=x(e)?e.parent:e;return r.tablesAndLayersLookup.get(n)}function qe(e,t){const r=xe(e,t);if(!r)return new Map;const n=new Map;for(const o of r.layersAndTables)d(n,o.layerId,()=>[]).push(o);return n}function ze(e){const t=e.objectIdField,r=e.globalIdField??"";return{id:e.layerId,identifierFields:{objectIdField:t,globalIdField:r},addFeatures:[],deleteAttachments:[],addAttachments:[],deleteFeatures:[],updateFeatures:[]}}function Ce(e){const{edits:t,serviceInfo:n,view:o,findOriginalFeature:i}=e,a=Pe(n.layersAndTables),s=n.layersAndTables.toArray(),{allEditData:l,editDataByLayerIdMap:c,editDataByIdMap:u}=Re(t,a,i),p=De(l,Ee(s,c),c);if(o&&Ze(l,p,o),0===p.length)return t;const d=Y(p,{continueOnCircularDependency:!0}).map(e=>u.get(e)).filter(r),f=new Map;for(const r of d)f.set(r.uniqueId,r);const y=[];for(const r of l)f.has(r.uniqueId)||y.push(r);const m=[];let h=null;for(const r of d){const{layer:e}=r;switch(null==h?h=ze(e):h.id!==e.layerId&&(m.push(h),h=ze(e)),r.operationType){case"add":case"modify":h.addFeatures.push(r.after);break;case"delete":h.deleteFeatures.push(r.before)}}null!==h&&m.push(h);for(const r of y){const e=r.layer.layerId,t=m.find(t=>t.id===e)??ze(r.layer);switch(m.includes(t)||m.push(t),r.operationType){case"add":t.addFeatures.push(r.after);break;case"modify":t.updateFeatures.push(r.after);break;case"delete":t.deleteFeatures.push(r.before);break;case"deleteAttachment":t.deleteAttachments.push(r.attachmentId);break;case"addAttachment":t.addAttachments.push(r.attachment)}}for(const r of m)void 0!==r.deleteAttachments&&0===r.deleteAttachments.length&&delete r.deleteAttachments,void 0!==r.addAttachments&&0===r.addAttachments.length&&delete r.addAttachments;return m}function Pe(e){const t=new Map;for(const r of e)t.set(r.layerId,r);return t}function Ee(e,t){const r=new Map;for(const n of e)for(const e of n.relationships??[])if(r.set(Ge(n,e),""),t.has(e.relatedTableId)){const o=t.get(e.relatedTableId);if(o.length>0)for(const t of o[0].layer.relationships??[])if(t.id===e.id){r.set(Ge(n,e),t.keyField);break}}return r}function Re(e,t,r){const n=new Map,o=[],i=new Map;let s=1;for(const l of e){const e=[],c=t.get(l.id);if(!c)throw new a("featureworkflow",`Failed to prepare applyEdits payload. Layer with id ${l.id} not found.`);for(const t of l.addFeatures??[])e.push({uniqueId:"T"+s++,operationType:"add",layer:c,after:t});for(const t of l.deleteFeatures??[])e.push({uniqueId:"T"+s++,operationType:"delete",before:t,layer:c});for(const t of l.deleteAttachments??[])e.push({uniqueId:"T"+s++,operationType:"deleteAttachment",attachmentId:t,layer:c});for(const t of l.addAttachments??[])e.push({uniqueId:"T"+s++,operationType:"addAttachment",attachment:t,layer:c});for(const t of l.updateFeatures??[])e.push({uniqueId:"T"+s++,operationType:"modify",before:r(t),after:t,layer:c});n.set(c.layerId,e);for(const t of e)o.push(t),i.set(t.uniqueId,t)}return{allEditData:o,editDataByIdMap:i,editDataByLayerIdMap:n}}function De(e,t,r){const n=[];for(const o of e){const e=o.layer.relationships??[],{uniqueId:i}=o;for(const a of e){const e=a.keyField;if("origin"===a.role){const s=r.get(a.relatedTableId);if(!s||0===s.length)continue;const l=Ge(o.layer,a),c=t.get(l);if(void 0===c||""===c)continue;switch(o.operationType){case"add":for(const t of s)t!==o&&("add"!==t.operationType&&"modify"!==t.operationType||t.after.attributes[c]===o.after.attributes[e]&&n.push([i,t.uniqueId]));break;case"modify":if(o.before.attributes[e]!==o.after.attributes[e])for(const t of s){const r=t.uniqueId;t!==o&&("delete"===t.operationType?t.before.attributes[c]===o.before.attributes[e]?n.push([r,i]):t.before.attributes[c]===o.after.attributes[e]&&n.push([i,r]):"add"===t.operationType?t.after.attributes[c]===o.after.attributes[e]?n.push([i,r]):t.after.attributes[c]===o.before.attributes[e]&&n.push([r,i]):"modify"===t.operationType&&(t.before.attributes[c]!==t.after.attributes[c]?t.after.attributes[c]===o.after.attributes[e]?n.push([i,r]):n.push([r,i]):n.push([i,r])))}break;case"delete":for(const t of s)t!==o&&("delete"!==t.operationType&&"modify"!==t.operationType||t.before.attributes[c]===o.before.attributes[e]&&n.push([t.uniqueId,i]))}}}}return n}function Ge(e,t){return`${e.layerId}:${t.id}`}function Be(e,t){return!!(t?.map&&"utilityNetworks"in t.map&&t.map.utilityNetworks?.length&&t.map.utilityNetworks.some(t=>!(!t.loaded||!e.url?.startsWith(t.featureServiceUrl)||e.layerId!==t.networkSystemLayers.associationsTableId)))}function Ze(e,t,r){const n=[];for(const i of e)Be(i.layer,r)&&n.push(i);if(0===n.length)return;let o=[];for(const i of n){const r=i.layer;switch(i.operationType){case"delete":o=[...Ne(i.before.attributes[r.fieldsIndex.get("fromglobalid").name],e),...Ne(i.before.attributes[r.fieldsIndex.get("toglobalid").name],e)];for(const e of o)t.push([i.uniqueId,e.uniqueId]);break;case"add":o=[...Ne(i.after.attributes[r.fieldsIndex.get("fromglobalid").name],e),...Ne(i.after.attributes[r.fieldsIndex.get("toglobalid").name],e)];for(const e of o)t.push([e.uniqueId,i.uniqueId])}}}function Ne(e,t){const r=[],n=t.filter(({layer:e})=>""!==e.globalIdField&&null!=e.globalIdField);for(const o of n){const t=o.layer.globalIdField;("before"in o&&o.before?.attributes[t]===e||"after"in o&&o.after?.attributes[t]===e)&&r.push(o)}return r}async function Qe(e,r,n,o,i){const a=new t({sourceLayer:r,attributes:n}),{rotation:s,size:l}=be(a);let c=await Q(a,{useSourceLayer:!0,webStyleCache:o,scale:i}),u=!1;for(const t of[l,s]){if(null==t)continue;null==n[t.field]&&(n[t.field]=await t.getDefaultValue(c,e.view),u=!0)}switch(u&&(c=await Q(a,{useSourceLayer:!0,webStyleCache:o,scale:i})),c?.type){case"simple-fill":case"polygon-3d":e.polygonSymbol=c;break;case"simple-line":case"line-3d":e.polylineSymbol=c;break;case"simple-marker":case"picture-marker":case"point-3d":case"cim":e.pointSymbol=c;break;case"mesh-3d":e.meshSymbol=c}We(e.tooltipOptions,l,s)}function We(e,t,r){e.visualVariables=null!=t||null!=r?{size:null!=t?{unit:t.displayUnit,axis:t.axis,valueType:t.fieldType}:null,rotation:null!=r?{valueType:r.fieldType,rotationType:r.rotationType??"geographic"}:null}:null}function $e(e,t){return e.find(e=>e.layer===t)}function He(e,t){const r=$e(e,t);if(null==r)throw new a("no-editorItem-found","The EditorViewModel provided did not have an EditorItem associated with the specified layer");return r}function Je(e,t){return e?.find(e=>e.layer===t)}async function Ke(e,t,r,n){switch(t.type){case"3d":return Xe(e,t,r,n);case"2d":return Ye(e,t,r,n)}}async function Xe(e,t,r,n){if(0===e.length)return[];const{updatable:i,graphicsByLayer:a}=await r.defer(async()=>{const{results:o}=await h(X(t,r),n),i=new Map,a=e=>{const t=e.layer,r=i.get(t);if(!r){const e=new Array;return i.set(t,e),e}return r};K(o).forEach(({graphic:e})=>a(e).push(e));const s=e.filter(({capabilities:e,layer:t})=>e.update.enabled&&i.has(t));return 0!==s.length&&r.stopPropagation(),{updatable:s,graphicsByLayer:i}});return h(Promise.allSettled(i.map(async({layer:e})=>{const t=a.get(e),r=_e(e);if(t.every(e=>V(e,r)))return t;const i=[];for(const n of t){i.push(n.getObjectId());const e=Object.keys(n.attributes);o(r,e)}const s=e.createQuery();return s.returnGeometry=!1,s.objectIds=i,s.outFields=M(e.fieldsIndex,r),e.queryFeatures(s,{signal:n}).then(({features:e})=>e)})),n)}async function Ye(e,t,r,n){if(0===e.length)return[];const{mapPoint:o}=r;if(null==o)return[];let i=null;const a=await r.defer(async()=>{const{results:o}=await h(t.hitTest(r),n);if(0===o.length)return[];const a=new Set;i=K(o),i.forEach(({graphic:e})=>e&&a.add(e.layer));const s=e.filter(e=>a.has(e.layer)&&e.supportsUpdateWorkflow);return s.length>0&&r.stopPropagation(),s});return h(Promise.allSettled(a.map(async({layer:e})=>{const a=e.createQuery();a.returnGeometry=!0,a.outFields=_e(e);const s="renderer"in e?C({renderer:e.renderer,pointerType:r.pointerType}):0;a.geometry=J(o,s,t),a.outSpatialReference=t.spatialReference;const{features:l}=await e.queryFeatures(a,{signal:n});return i?.forEach(({graphic:t})=>{t.layer!==e||l.some(e=>e.getObjectId()===t.getObjectId())||l.push(t)}),l})),n)}function _e(e){return M(e.fieldsIndex,[e.objectIdField,O({displayField:"displayField"in e?e.displayField:null,fields:e.fields})])}async function et(e,t,n,o){return tt(e.map(e=>e.getObjectId()??e.attributes[t.objectIdField]).filter(r),t,n,o)}async function tt(e,t,r,n){const o=t.createQuery();o.objectIds=e,o.outFields=["*"],o.returnM=t.capabilities.data.supportsM,o.returnZ=t.capabilities.data.supportsZ,o.returnGeometry=!0,z(t)&&null!=t.infoFor3D||(o.outSpatialReference=r),!z(t)&&t.capabilities?.data.supportsTrueCurve&&(o.returnTrueCurves=!0);const i=await t.queryFeatures(o,{signal:n});return m(n),i.features}async function rt(e){const{graphic:t,sketchViewModel:r,sourceLayer:n,updateOptions:o,visualVariables:i}=e;await nt(e);const a={multipleSelectionEnabled:!1,...o};return"point"===n.geometryType&&(a.enableRotation=null!=i.rotation,a.enableScaling=null!=i.size),r.update(t,a)}async function nt(e){const{graphic:t,sketchLayer:r,sketchViewModel:n,sourceLayer:o,visualVariables:i,webStyleCache:a}=e;let s=!1;const{rotation:l,size:c}=i;for(const u of[l,c]){if(null==u)continue;const e=t.getAttribute(u.field);if(null!=e)u.setInitialValue(e);else{const e=await u.getDefaultValue(t.symbol,n.view);u.setInitialValue(e),t.setAttribute(u.field,e),s=!0}}if(s){const e="2d"===n.view?.type?n.view.scale:null;await Se(t,a,e)}We(n.tooltipOptions,c,l),r.elevationInfo=o.elevationInfo}function ot(e){return null==e||"rotate-start"!==e.type&&"rotate"!==e.type&&"rotate-stop"!==e.type?null:e}function it(e){return null==e||"scale-start"!==e.type&&"scale"!==e.type&&"scale-stop"!==e.type?null:e}function at(e,t,r,n){if(null==t.geometry||"point"!==t.geometry?.type)return!1;const o=t.attributes;let i=!1;const a=n.rotation,s=ot(r.toolEventInfo);if(null!=a&&null!=s){const{field:r,getValue:n}=a;if("rotate-stop"===s.type)a.isUpdatingInteractively=!1,a.setInitialValue(t.getAttribute(r));else{a.isUpdatingInteractively=!0;const l=n(s.angle,e);l!==o[r]&&t.setAttribute(r,l),i=!0}}const l=n.size,c=it(r.toolEventInfo);if(null!=l&&null!=c){const{field:r,getValue:n}=l;if("scale-stop"===c.type)l.isUpdatingInteractively=!1,l.setInitialValue(t.getAttribute(r));else{l.isUpdatingInteractively=!0;const a=n(c.xScale,e);a!==o[r]&&t.setAttribute(r,a),i=!0}}return i}async function st({feature:e,featureClone:t,sketchLayer:r,sketchViewModel:n,updateOptions:o,view:i,visualVariableAttributes:a,webStyleCache:u,addHandle:p,addUpdatingPromise:d,onUpdate:y}){await Se(t,u,"2d"===i.type?i.scale:null);let m=null;if("2d"===n?.view?.type){const e=f(e=>Se(t,u,e));m=g(()=>n?.view?.scale,t=>e(t))}const h=t.sourceLayer,b=ht(i,h);await rt({graphic:t,sketchLayer:r,sketchViewModel:n,sourceLayer:h,updateOptions:o,visualVariables:a,webStyleCache:u});let I=null;b.then(e=>I=e).catch(()=>{});const v=a.size,T=a.rotation,F=g(()=>e.attributes,async e=>{let r=!1;for(const n in e){const o=e[n];o!==t.getAttribute(n)&&(t.setAttribute(n,o),null==v||v.isUpdatingInteractively||v.field!==n||v.setInitialValue(o),null==T||T.isUpdatingInteractively||T.field!==n||T.setInitialValue(o),(null==I||I.requiredFields.includes(n))&&(r=!0))}r&&await Se(t,u,"2d"===i.type?i.scale:null)}),j=n.on("update",async e=>{const t=e.graphics[0],s={graphic:t,sketchLayer:r,sketchViewModel:n,sourceLayer:h,updateOptions:o,visualVariables:a,webStyleCache:u};if("complete"===e.state){if(null===i.activeTool)return rt(s);const e=new AbortController,t=c(e);return p(t),d(w(()=>null===i.activeTool,e.signal).then(async()=>{if(!e.signal.aborted)return e.abort(),rt(s)}))}at(i,t,e,a)&&await Se(t,u,"2d"===i.type?i.scale:null),y(bt(t),e)}),S=n.on(["undo","redo"],e=>{y(bt(e.graphics[0]),e)});return s([S,j,l(()=>n.cancel()),F,m])}async function lt(e,t,r,n){e.add(n);const o=r.sourceLayer,a=r.layer??o,c=r.getAttribute(o.objectIdField);let u=null;function p(e){u?.abort(),q(a)?r.visible=e:u=i(async r=>{const n=await ht(t,a);m(r),n.setVisibility?.(c,e)})}return await ct(t,n),p(!1),s([l(async()=>{p(!0);try{if(!t.destroyed){const e=await ht(t,a).catch(()=>{});e&&!e.destroyed&&await w(()=>!e.updating)}}finally{e.remove(n)}})])}async function ct(e,t){if("3d"===e.type){const r=new $({graphic:t}),n=e.trackGraphicState(r);await w(()=>r.displaying||r.error),n.remove()}else await w(()=>t.visible)}const ut={icon:I(24),text:I(12),line:I(1),viewScaleSizeFactor:100};function pt(e,t,r){let n=!1;return e.filter(e=>!!n||(n=e===t,n)).map(e=>r[e]())}function dt(e,t){e.viewModel.syncFeatureTemplates();const r=e.creationInfo;if("awaiting-feature-creation-info"===t[0].id&&r){const n=r.layer,o=e.viewModel.getTemplatesForLayer(n);1===o.length&&"scene"!==n.type&&(r.template=o[0],t.shift())}return t}function ft(e){return"unknown"===e?null:e}function yt(e){e.filesEnabled=!0,e.mode="view",e.capabilities={editing:!0,operations:{add:!0,update:!0,delete:!0}}}const mt=e=>e.includes("-stop")||e.includes("vertex-"),ht=(e,t)=>{const r="subtype-sublayer"===t.type?t.parent:t;return e.whenLayerView(r)};function gt(e){return"createInteractiveEditSession"in e}function bt(e){const t=e.geometry;if("mesh"===t?.type){const r=e.cloneShallow();return r.attributes=u(e.attributes),r.geometry=t.cloneShallow(),r.geometry.transform=t.transform?.clone()??null,r}return e.clone()}function wt(e){return e.acquireCursor("progress")}function It(e){for(const t of e){const{destinationGraphic:e,destinationField:r,sourceGraphic:n,sourceField:o}=t;e.setAttribute(r,n.getAttribute(o))}}function vt(e){const t=e.templateExecutorInfo?.completionResults;return t?.length?(t.forEach(e=>It(e.relationships)),t.flatMap(e=>e.edits)):null}function Tt(e){const t=ce(e)?e.activeWorkflow:e;if(null==t)return[];if(ae(t))return t.data.layers;const r=t.layer;return r?[r]:[]}function Ft({attributes:e},t){const r=new Set;r.add(t.objectIdField),"uniqueIdFields"in t&&t.uniqueIdFields&&t.uniqueIdFields.length>0&&v(r,t.uniqueIdFields);const n={};for(const o of r)null!=e[o]&&(n[o]=e[o]);if("scene"===t.type&&null!=t.infoFor3D){const r=t.associatedLayer?.globalIdField;null!=r&&(e[r]=e[r])}return n}function jt(e){if(!St(e))return e;const t=new Map;for(const r of e){const e=r.getObjectId();if(null!=e){const n=r.sourceLayer??r.layer;d(t,n,()=>[]).push(e)}}return Array.from(t.entries()).map(([e,t])=>({layer:e,objectIds:t}))}function St(e){return 0===e.length||D(e[0])}function kt({drawTool:e},t){const r=e?.mostDownstreamPlugin?.configuration?.curveTypes;if(!t||!r||0===r.length)return!1;const n=new Set(t.capabilities.supportedCurveTypes);return r.some(e=>!n.has(e))}function At(e,t){const r=new Set(t.capabilities.supportedCurveTypes);return e.some(({geometry:e})=>e&&A(e)&&L(e,r))}export{kt as activeSketchToolDrawsUnsupportedCurve,Ze as appendAllUtilityNetworkAssociationRelationships,dt as avoidFeatureTemplateSelectionWithOnlyOneItem,gt as canCreateInteractiveEditSession,bt as cloneGraphicExceptMesh,At as containsUnsupportedCurve,Pe as createLayerIdMap,Ee as createRelationshipKeyMap,ke as createToolFromGeometryType,pt as createWorkflowSteps,Ke as fetchCandidates,et as fetchFullFeatures,tt as fetchFullFeaturesByObjectId,De as findAllDependencies,Ne as findChangesByGlobalId,$e as findEditorItemForLayer,He as findEditorItemForLayerOrThrow,Je as findLayerInfo,Ge as generateHashForRelationship,Tt as getLayersFromWorkflow,we as getRotationVariableAttribute,vt as getServiceEditsFromWorkflowData,xe as getServiceInfoForLayer,qe as getServiceLayersById,Te as getSizeVariableAttribute,be as getVisualVariableAttributes,ge as getVisualVariablesForLayer,re as isAnyUpdateLeafWorkflow,ne as isBatchAttributeFormViewModel,oe as isCreateFeaturesWorkflow,ie as isFeatureFormViewModel,St as isGraphicsArray,ue as isMergeFeaturesWorkflow,fe as isMergeWorkflowOptions,de as isParentWorkflow,pe as isSplitFeatureWorkflow,ye as isSplitWorkflowOptions,mt as isTerminalUpdateEventType,se as isUpdateFeatureWorkflow,ae as isUpdateFeaturesWorkflow,he as isUpdateFeaturesWorkflowOptions,le as isUpdateRecordWorkflow,ce as isUpdateWorkflow,Be as isUtilityNetworkAssociationsTable,Ft as makeMinimalAttributes,Ce as orderEditsByRelationshipDependencies,yt as prepareAttachmentsForCreateFeaturesWorkflow,It as setRelationshipFields,st as setUpGeometryUpdate,Le as setUpSketchCreateWatchers,nt as setVisualVariablesAndElevationInfoForUpdate,wt as showProgressCursor,ut as sizeDefaults,ft as sizeVariableUnitToLengthUnit,Ae as startCreatingNewFeature,rt as startUpdatingFeatureGeometry,lt as swapForEditingSession,jt as toFeatureInfos,Se as updateGraphicSymbolWhenRequired,at as visualVariableInteractiveUpdate,ht as whenEditorLayerView,ct as whenGraphicDisplayed,me as workflowInfluencesOutcomeOfParent};
|
|
2
|
+
import e from"../../Color.js";import t from"../../Graphic.js";import{isSome as r,equals as n,addMany as o}from"../../core/arrayUtils.js";import{createTask as i}from"../../core/asyncUtils.js";import a from"../../core/Error.js";import{handlesGroup as s,makeHandle as l,abortHandle as c}from"../../core/handleUtils.js";import{clone as u}from"../../core/lang.js";import p from"../../core/Logger.js";import{getOrCreateMapValue as d}from"../../core/MapUtils.js";import{debounce as f,isPromiseLike as y,throwIfAborted as m,whenOrAbort as h}from"../../core/promiseUtils.js";import{watch as g,on as b,whenOnce as w}from"../../core/reactiveUtils.js";import{px2pt as I}from"../../core/screenUtils.js";import{addMany as v}from"../../core/SetUtils.js";import{diff as T}from"../../core/accessorSupport/diffUtils.js";import{isSharedTemplateOrMetadata as F,isSharedGroupTemplate as j,getCreationAttributes as S,isSharedPresetTemplate as k}from"../../editing/templateUtils.js";import{isCurvedGeometry as A,hasUnsupportedCurve as L}from"../../geometry/support/curves/curveUtils.js";import U from"../../layers/GraphicsLayer.js";import{featureHasFields as V,fixFields as M,getDisplayFieldName as O}from"../../layers/support/fieldUtils.js";import{isSubtypeSublayer as x,isGraphicsLayer as q,isSceneLayer as z}from"../../layers/support/layerUtils.js";import{calculateTolerance as C}from"../../renderers/support/clickToleranceUtils.js";import{meterIn as P}from"../../renderers/support/lengthUtils.js";import{isRenderer as E}from"../../renderers/support/typeUtils.js";import{getTransformationType as R}from"../../renderers/visualVariables/support/sizeVariableUtils.js";import{isGraphic as D}from"../../support/graphicInstanceUtils.js";import G from"../../symbols/SimpleFillSymbol.js";import B from"../../symbols/SimpleLineSymbol.js";import Z from"../../symbols/SimpleMarkerSymbol.js";import{to3D as N}from"../../symbols/support/symbolConversion.js";import{getDisplayedSymbol as Q}from"../../symbols/support/symbolUtils.js";import{getServices as W}from"../../undoredo/support/Services.js";import{GraphicState as $}from"../../views/3d/layers/graphics/GraphicState.js";import{defaultDrawingMode as H}from"../../views/draw/drawingModes.js";import{createQueryGeometry as J}from"../../views/support/drapedUtils.js";import{filterGraphicHits as K,hitTestSelectSimilarDistance as X}from"../../views/support/hitTestSelectUtils.js";import{dependencySort as Y}from"./support/dependencySort.js";import{isDrawGraphicTool as _,isDrawTool as ee}from"../Sketch/support/sketchUtils.js";const te=()=>p.getLogger("esri.widgets.Editor.workflowUtils");function re(e){return le(e)||ae(e)}function ne(e){return!!e&&"features"in e}function oe(e){return null!=e&&"create-features"===e.type}function ie(e){return!!e&&"feature"in e}function ae(e){return null!=e&&"update-features"===e.type}function se(e){return null!=e&&"update-feature"===e.type}function le(e){return null!=e&&e.type.includes("update-")&&"fullFeature"in e}function ce(e){return null!=e&&"update"===e.type}function ue(e){return null!=e&&"merge-features"===e.type}function pe(e){return null!=e&&"split-feature"===e.type}function de(e){const t=e?.type;return"update-feature"===t||"update-table-record"===t||"update-features"===t||"split-feature"===t}function fe(e){return"merge"===e?.type}function ye(e){return"split"===e?.type}function me(e){return ue(e)||pe(e)}function he(e){return"update-multiple"===e?.type}function ge(e){const t=e&&"renderer"in e?e.renderer:null;if(!je(t))return{rotation:null,size:null};const r=t.getVisualVariablesForType("rotation").filter(e=>(!e.axis||"heading"===e.axis)&&e.field&&!e.valueExpression),n=t.getVisualVariablesForType("size").filter(e=>e.field&&!e.useSymbolValue&&!e.valueExpression&&"real-world-size"===R(e));return{rotation:1===r.length?r[0]:null,size:1===n.length?n[0]:null}}function be(e){const t=e.sourceLayer;if(!(t&&"renderer"in t&&je(t.renderer)))return{rotation:null,size:null};const{rotation:r,size:n}=ge(t);let o=null,i=null;if(r){const e=t.fields?.filter(e=>e.name===r.field),n=1===e?.length?e[0]:null;o=we(r,n)}if(n){const e=t.fields?.filter(e=>e.name===n.field),r=1===e?.length?e[0]:null;i=Te(n,r)}return{rotation:o,size:i}}function we(e,t){const r="heading"===(e.axis||"heading")&&"arithmetic"===e.rotationType?-1:1,n=t?.type??"double",o={initial:0,current:0};return{field:e.field,fieldType:n,getDefaultValue:()=>Promise.resolve(0),getValue:e=>(o.current=o.initial-r*e,Fe((o.current+360)%360,n)),setInitialValue:e=>{o.initial=e,o.current=0},isUpdatingInteractively:!1,rotationType:e.rotationType??"geographic"}}function Ie(e,t){switch(t){case"width":return e[0];case"depth":return e[1];case"height":return e[2];default:return e[2]||e[1]||e[0]}}async function ve(e,t,r){if(null==t)return 0;const{symbol:n}=N(t);if(null==n||"web-style"===n.type||"cim"===n.type)return 0;const o=n.symbolLayers.at(0);if(!o)return 0;switch(o.type){case"icon":{const{computeIconLayerResourceSize:e}=await import("../../symbols/support/symbolLayerUtils.js");return Math.min(ut.icon,(await e(o,ut.icon))[0])||ut.icon}case"text":return ut.text;case"line":return ut.line;case"object":{const{computeObjectLayerResourceSize:t}=await import("../../symbols/support/symbolLayerUtils.js");return Ie(await t(o,e.scale/ut.viewScaleSizeFactor),r)}case"path":case"extrude":return e.scale/ut.viewScaleSizeFactor;default:return 0}}function Te(e,t){const r=e.axis,n=t?.type??"double",o={initial:0,current:0},i=P[e.valueUnit]??1;let a;return a="area"===e.valueRepresentation?e=>(e*i/2)**2*Math.PI:"radius"===e.valueRepresentation||"distance"===e.valueRepresentation?e=>e*i/2:e=>e*i,{field:e.field,fieldType:n,getDefaultValue:async(e,t)=>Fe(a(await ve(t,e,r)),n),getValue:(e,t)=>(o.initial||(o.initial=t.pixelSizeAt(t.center)),o.current=o.initial*e,Fe(o.current,n)),setInitialValue:e=>{o.initial=e,o.current=0},isUpdatingInteractively:!1,displayUnit:ft(e.valueUnit),axis:e.axis}}function Fe(e,t){switch(t){case"small-integer":case"integer":case"long":return Math.round(e);case"double":case"single":return e;default:return 0}}function je(e){if(!E(e))return!1;switch(e?.type){case"class-breaks":case"simple":case"unique-value":case"dot-density":case"dictionary":case"pie-chart":return!0;default:return!1}}async function Se(e,t,r){const n=await Q(e,{useSourceLayer:!0,ignoreGraphicSymbol:!0,webStyleCache:t,scale:r});null!=T(e.symbol,n)&&(e.symbol=n)}function ke(e,t){if(!e||!t)throw new Error("no geometry type");if("multipatch"===e)return{tool:"mesh",createOptions:{mode:"hybrid"}};const r=new Map;r.set("circle",{mode:"freehand"}),r.set("rectangle",{mode:"freehand"});const n={mode:H,optionsPerTool:r};if(F(t)){const o=t.defaultTool,i=j(t)?t.definition?.inputGeometryType??e:e;switch(o){case"freehand":case"stream-line":return{tool:"polyline"===i?"freehandPolyline":"freehandPolygon",createOptions:n};case"autocomplete-freehand-polygons":case"stream-polygon":return{tool:"freehandPolygon",createOptions:n};case"autocomplete-polygons":case"difference-polygon":case"create-structures":case"polygon":case"trace":return{tool:"polygon"===i?"polygon":"polyline",createOptions:n};case"circle":return r.get("circle").preserveAspectRatio=!0,{tool:"circle",createOptions:n};case"ellipse":return r.get("circle").preserveAspectRatio=!1,{tool:"circle",createOptions:n};case"create-points-along-line":case"multipoint":return{tool:"multipoint",createOptions:n};case"line":case"radial-line":case"right-angle-line":case"split":case"two-point-line":return{tool:"polyline",createOptions:n};case"rectangle":case"regular-polygon":case"right-angle-polygon":return{tool:"rectangle",createOptions:n};case"elevation-point-from-contour":case"elevation-point-from-dem":case"parcel-seed":case"point":case"point-and-rotation":case"point-at-end-of-line":return{tool:"point",createOptions:n}}}else{const o=t.drawingTool;if("circle"===o||"ellipse"===o)return r.get("circle").preserveAspectRatio="circle"===o,{tool:"circle",createOptions:n};if("rectangle"===o)return{tool:"rectangle",createOptions:n};if("freehand"===o)return{tool:"polygon"===e?"freehandPolygon":"freehandPolyline",createOptions:n}}return{tool:e,createOptions:n}}async function Ae(e,t,r,n){const{creationInfo:o,fullTemplate:i}=r;if(!o)throw new a("featureworkflow","No creation info provided.");const s=o.layer,l=S(i,o.attributeOverrides,o.layer),{view:c}=e,u="2d"===c?.type;j(i)||k(i)||await Qe(e,s,l,n,u?c.scale:null);const{capabilities:p}=s;t.elevationInfo=s.elevationInfo;const d=ke(s.geometryType,i);e.defaultCreateOptions={graphicProperties:{attributes:l,sourceLayer:s},mode:d.createOptions.mode,optionsPerTool:d.createOptions.optionsPerTool,preserveAspectRatio:d.createOptions.preserveAspectRatio,hasZ:p.data.supportsZ,defaultZ:(u?p.editing.zDefault:null)??e.defaultCreateOptions.defaultZ},null==o.geometryToPlace?await e.create(d.tool):await e.place(o.geometryToPlace,{graphicProperties:{attributes:l,sourceLayer:s}})}async function Le(e){return s([Ue(e),Ve(e)])}function Ue({creationAttributes:e,data:t,sketchViewModel:r,view:n,webStyleCache:o}){const{creationInfo:i}=t,{fullTemplate:a}=t;if(!i||"2d"!==n?.type||j(a)||k(a))return null;const s=f(t=>Qe(r,i.layer,e,o,t));return g(()=>n.scale,e=>s(e))}function Ve({data:t,sketchViewModel:r,view:n}){const{templateExecutorInfo:o}=t;if(!o)return null;const i=r.activeComponent;if(!n||!_(i)&&!ee(i))return te().error(new a("featureworkflow","Failed to set up template feedback.")),null;const c=new U({effect:"saturate(0.6) opacity(0.8)",listMode:"hide",title:"Shared Template Feedback Graphics"});n.map?.add(c);const{executor:u,serviceLayersById:p}=o,d=n.theme?.accentColor??new e([255,165,0,1]);return s([b(()=>i,["cursor-update","vertex-add"],()=>{c.removeAll();const e=_(i)?i.graphic?.geometry:i.unprocessedGeometry;if(!e||!Me(e))return;const t=u(e,"digitizing");if(!y(t))for(const r of t.edits){const e=p.get(r.id);if(e&&r.addFeatures&&0!==r.addFeatures.length)for(const t of e)if(!t.isTable)for(const e of r.addFeatures){const t=Oe(e,d);t&&c.add(t)}}}),l(()=>{n.map.remove(c),c.destroy()})])}function Me(e){switch(e.type){case"point":case"multipoint":return!0;case"polyline":{if(A(e))return e.curvePaths[0].length>1;const t=e.paths[0];return!!t&&t.length>1}case"polygon":{if(A(e))return e.curveRings[0].length>2;const t=e.rings[0];return!!t&&(n(t.at(0),t.at(-1))?t.length>2:t.length>1)}default:return!1}}function Oe(e,r){let n=null;switch(e.geometry?.type){case"point":case"multipoint":n=new Z({angle:0,color:r,outline:new B({cap:"round",color:r,join:"round",miterLimit:1,style:"solid",width:1}),path:"undefined",size:8,style:"circle",xoffset:0,yoffset:0});break;case"polygon":n=new G({color:r,outline:new B({cap:"round",color:r,join:"round",miterLimit:1,style:"solid",width:3}),style:"none"});break;case"polyline":n=new B({cap:"round",color:r,join:"round",miterLimit:1,style:"solid",width:2});break;default:return null}return new t({geometry:e.geometry,symbol:n,attributes:{...e.attributes}})}function xe(e,t){const r=W(t),n=x(e)?e.parent:e;return r.tablesAndLayersLookup.get(n)}function qe(e,t){const r=xe(e,t);if(!r)return new Map;const n=new Map;for(const o of r.layersAndTables)d(n,o.layerId,()=>[]).push(o);return n}function ze(e){const t=e.objectIdField,r=e.globalIdField??"";return{id:e.layerId,identifierFields:{objectIdField:t,globalIdField:r},addFeatures:[],deleteAttachments:[],addAttachments:[],deleteFeatures:[],updateFeatures:[]}}function Ce(e){const{edits:t,serviceInfo:n,view:o,findOriginalFeature:i}=e,a=Pe(n.layersAndTables),s=n.layersAndTables.toArray(),{allEditData:l,editDataByLayerIdMap:c,editDataByIdMap:u}=Re(t,a,i),p=De(l,Ee(s,c),c);if(o&&Ze(l,p,o),0===p.length)return t;const d=Y(p,{continueOnCircularDependency:!0}).map(e=>u.get(e)).filter(r),f=new Map;for(const r of d)f.set(r.uniqueId,r);const y=[];for(const r of l)f.has(r.uniqueId)||y.push(r);const m=[];let h=null;for(const r of d){const{layer:e}=r;switch(null==h?h=ze(e):h.id!==e.layerId&&(m.push(h),h=ze(e)),r.operationType){case"add":case"modify":h.addFeatures.push(r.after);break;case"delete":h.deleteFeatures.push(r.before)}}null!==h&&m.push(h);for(const r of y){const e=r.layer.layerId,t=m.find(t=>t.id===e)??ze(r.layer);switch(m.includes(t)||m.push(t),r.operationType){case"add":t.addFeatures.push(r.after);break;case"modify":t.updateFeatures.push(r.after);break;case"delete":t.deleteFeatures.push(r.before);break;case"deleteAttachment":t.deleteAttachments.push(r.attachmentId);break;case"addAttachment":t.addAttachments.push(r.attachment)}}for(const r of m)void 0!==r.deleteAttachments&&0===r.deleteAttachments.length&&delete r.deleteAttachments,void 0!==r.addAttachments&&0===r.addAttachments.length&&delete r.addAttachments;return m}function Pe(e){const t=new Map;for(const r of e)t.set(r.layerId,r);return t}function Ee(e,t){const r=new Map;for(const n of e)for(const e of n.relationships??[])if(r.set(Ge(n,e),""),t.has(e.relatedTableId)){const o=t.get(e.relatedTableId);if(o.length>0)for(const t of o[0].layer.relationships??[])if(t.id===e.id){r.set(Ge(n,e),t.keyField);break}}return r}function Re(e,t,r){const n=new Map,o=[],i=new Map;let s=1;for(const l of e){const e=[],c=t.get(l.id);if(!c)throw new a("featureworkflow",`Failed to prepare applyEdits payload. Layer with id ${l.id} not found.`);for(const t of l.addFeatures??[])e.push({uniqueId:"T"+s++,operationType:"add",layer:c,after:t});for(const t of l.deleteFeatures??[])e.push({uniqueId:"T"+s++,operationType:"delete",before:t,layer:c});for(const t of l.deleteAttachments??[])e.push({uniqueId:"T"+s++,operationType:"deleteAttachment",attachmentId:t,layer:c});for(const t of l.addAttachments??[])e.push({uniqueId:"T"+s++,operationType:"addAttachment",attachment:t,layer:c});for(const t of l.updateFeatures??[])e.push({uniqueId:"T"+s++,operationType:"modify",before:r(t),after:t,layer:c});n.set(c.layerId,e);for(const t of e)o.push(t),i.set(t.uniqueId,t)}return{allEditData:o,editDataByIdMap:i,editDataByLayerIdMap:n}}function De(e,t,r){const n=[];for(const o of e){const e=o.layer.relationships??[],{uniqueId:i}=o;for(const a of e){const e=a.keyField;if("origin"===a.role){const s=r.get(a.relatedTableId);if(!s||0===s.length)continue;const l=Ge(o.layer,a),c=t.get(l);if(void 0===c||""===c)continue;switch(o.operationType){case"add":for(const t of s)t!==o&&("add"!==t.operationType&&"modify"!==t.operationType||t.after.attributes[c]===o.after.attributes[e]&&n.push([i,t.uniqueId]));break;case"modify":if(o.before.attributes[e]!==o.after.attributes[e])for(const t of s){const r=t.uniqueId;t!==o&&("delete"===t.operationType?t.before.attributes[c]===o.before.attributes[e]?n.push([r,i]):t.before.attributes[c]===o.after.attributes[e]&&n.push([i,r]):"add"===t.operationType?t.after.attributes[c]===o.after.attributes[e]?n.push([i,r]):t.after.attributes[c]===o.before.attributes[e]&&n.push([r,i]):"modify"===t.operationType&&(t.before.attributes[c]!==t.after.attributes[c]?t.after.attributes[c]===o.after.attributes[e]?n.push([i,r]):n.push([r,i]):n.push([i,r])))}break;case"delete":for(const t of s)t!==o&&("delete"!==t.operationType&&"modify"!==t.operationType||t.before.attributes[c]===o.before.attributes[e]&&n.push([t.uniqueId,i]))}}}}return n}function Ge(e,t){return`${e.layerId}:${t.id}`}function Be(e,t){return!!(t?.map&&"utilityNetworks"in t.map&&t.map.utilityNetworks?.length&&t.map.utilityNetworks.some(t=>!(!t.loaded||!e.url?.startsWith(t.featureServiceUrl)||e.layerId!==t.networkSystemLayers.associationsTableId)))}function Ze(e,t,r){const n=[];for(const i of e)Be(i.layer,r)&&n.push(i);if(0===n.length)return;let o=[];for(const i of n){const r=i.layer;switch(i.operationType){case"delete":o=[...Ne(i.before.attributes[r.fieldsIndex.get("fromglobalid").name],e),...Ne(i.before.attributes[r.fieldsIndex.get("toglobalid").name],e)];for(const e of o)t.push([i.uniqueId,e.uniqueId]);break;case"add":o=[...Ne(i.after.attributes[r.fieldsIndex.get("fromglobalid").name],e),...Ne(i.after.attributes[r.fieldsIndex.get("toglobalid").name],e)];for(const e of o)t.push([e.uniqueId,i.uniqueId])}}}function Ne(e,t){const r=[],n=t.filter(({layer:e})=>""!==e.globalIdField&&null!=e.globalIdField);for(const o of n){const t=o.layer.globalIdField;("before"in o&&o.before?.attributes[t]===e||"after"in o&&o.after?.attributes[t]===e)&&r.push(o)}return r}async function Qe(e,r,n,o,i){const a=new t({sourceLayer:r,attributes:n}),{rotation:s,size:l}=be(a);let c=await Q(a,{useSourceLayer:!0,webStyleCache:o,scale:i}),u=!1;for(const t of[l,s]){if(null==t)continue;null==n[t.field]&&(n[t.field]=await t.getDefaultValue(c,e.view),u=!0)}switch(u&&(c=await Q(a,{useSourceLayer:!0,webStyleCache:o,scale:i})),c?.type){case"simple-fill":case"polygon-3d":e.polygonSymbol=c;break;case"simple-line":case"line-3d":e.polylineSymbol=c;break;case"simple-marker":case"picture-marker":case"point-3d":case"cim":e.pointSymbol=c;break;case"mesh-3d":e.meshSymbol=c}We(e.tooltipOptions,l,s)}function We(e,t,r){e.visualVariables=null!=t||null!=r?{size:null!=t?{unit:t.displayUnit,axis:t.axis,valueType:t.fieldType}:null,rotation:null!=r?{valueType:r.fieldType,rotationType:r.rotationType??"geographic"}:null}:null}function $e(e,t){return e.find(e=>e.layer===t)}function He(e,t){const r=$e(e,t);if(null==r)throw new a("no-editorItem-found","The EditorViewModel provided did not have an EditorItem associated with the specified layer");return r}function Je(e,t){return e?.find(e=>e.layer===t)}async function Ke(e,t,r,n){switch(t.type){case"3d":return Xe(e,t,r,n);case"2d":return Ye(e,t,r,n)}}async function Xe(e,t,r,n){if(0===e.length)return[];const{updatable:i,graphicsByLayer:a}=await r.defer(async()=>{const{results:o}=await h(X(t,r),n),i=new Map,a=e=>{const t=e.layer,r=i.get(t);if(!r){const e=new Array;return i.set(t,e),e}return r};K(o).forEach(({graphic:e})=>a(e).push(e));const s=e.filter(({capabilities:e,layer:t})=>e.update.enabled&&i.has(t));return 0!==s.length&&r.stopPropagation(),{updatable:s,graphicsByLayer:i}});return h(Promise.allSettled(i.map(async({layer:e})=>{const t=a.get(e),r=_e(e);if(t.every(e=>V(e,r)))return t;const i=[];for(const n of t){i.push(n.getObjectId());const e=Object.keys(n.attributes);o(r,e)}const s=e.createQuery();return s.returnGeometry=!1,s.objectIds=i,s.outFields=M(e.fieldsIndex,r),e.queryFeatures(s,{signal:n}).then(({features:e})=>e)})),n)}async function Ye(e,t,r,n){if(0===e.length)return[];const{mapPoint:o}=r;if(null==o)return[];let i=null;const a=await r.defer(async()=>{const{results:o}=await h(t.hitTest(r),n);if(0===o.length)return[];const a=new Set;i=K(o),i.forEach(({graphic:e})=>e&&a.add(e.layer));const s=e.filter(e=>a.has(e.layer)&&e.supportsUpdateWorkflow);return s.length>0&&r.stopPropagation(),s});return h(Promise.allSettled(a.map(async({layer:e})=>{const a=e.createQuery();a.returnGeometry=!0,a.outFields=_e(e);const s="renderer"in e?C({renderer:e.renderer,pointerType:r.pointerType}):0;a.geometry=J(o,s,t),a.outSpatialReference=t.spatialReference;const{features:l}=await e.queryFeatures(a,{signal:n});return i?.forEach(({graphic:t})=>{t.layer!==e||l.some(e=>e.getObjectId()===t.getObjectId())||l.push(t)}),l})),n)}function _e(e){return M(e.fieldsIndex,[e.objectIdField,O({displayField:"displayField"in e?e.displayField:null,fields:e.fields})])}async function et(e,t,n,o){return tt(e.map(e=>e.getObjectId()??e.attributes[t.objectIdField]).filter(r),t,n,o)}async function tt(e,t,r,n){const o=t.createQuery();o.objectIds=e,o.outFields=["*"],o.returnM=t.capabilities.data.supportsM,o.returnZ=t.capabilities.data.supportsZ,o.returnGeometry=!0,z(t)&&null!=t.infoFor3D||(o.outSpatialReference=r),!z(t)&&t.capabilities?.data.supportsTrueCurve&&(o.returnTrueCurves=!0);const i=await t.queryFeatures(o,{signal:n});return m(n),i.features}async function rt(e){const{graphic:t,sketchViewModel:r,sourceLayer:n,updateOptions:o,visualVariables:i}=e;await nt(e);const a={multipleSelectionEnabled:!1,...o};return"point"===n.geometryType&&(a.enableRotation=null!=i.rotation,a.enableScaling=null!=i.size),r.update(t,a)}async function nt(e){const{graphic:t,sketchLayer:r,sketchViewModel:n,sourceLayer:o,visualVariables:i,webStyleCache:a}=e;let s=!1;const{rotation:l,size:c}=i;for(const u of[l,c]){if(null==u)continue;const e=t.getAttribute(u.field);if(null!=e)u.setInitialValue(e);else{const e=await u.getDefaultValue(t.symbol,n.view);u.setInitialValue(e),t.setAttribute(u.field,e),s=!0}}if(s){const e="2d"===n.view?.type?n.view.scale:null;await Se(t,a,e)}We(n.tooltipOptions,c,l),r.elevationInfo=o.elevationInfo}function ot(e){return null==e||"rotate-start"!==e.type&&"rotate"!==e.type&&"rotate-stop"!==e.type?null:e}function it(e){return null==e||"scale-start"!==e.type&&"scale"!==e.type&&"scale-stop"!==e.type?null:e}function at(e,t,r,n){if(null==t.geometry||"point"!==t.geometry?.type)return!1;const o=t.attributes;let i=!1;const a=n.rotation,s=ot(r.toolEventInfo);if(null!=a&&null!=s){const{field:r,getValue:n}=a;if("rotate-stop"===s.type)a.isUpdatingInteractively=!1,a.setInitialValue(t.getAttribute(r));else{a.isUpdatingInteractively=!0;const l=n(s.angle,e);l!==o[r]&&t.setAttribute(r,l),i=!0}}const l=n.size,c=it(r.toolEventInfo);if(null!=l&&null!=c){const{field:r,getValue:n}=l;if("scale-stop"===c.type)l.isUpdatingInteractively=!1,l.setInitialValue(t.getAttribute(r));else{l.isUpdatingInteractively=!0;const a=n(c.xScale,e);a!==o[r]&&t.setAttribute(r,a),i=!0}}return i}async function st({feature:e,featureClone:t,sketchLayer:r,sketchViewModel:n,updateOptions:o,view:i,visualVariableAttributes:a,webStyleCache:u,addHandle:p,addUpdatingPromise:d,onUpdate:y}){await Se(t,u,"2d"===i.type?i.scale:null);let m=null;if("2d"===n?.view?.type){const e=f(e=>Se(t,u,e));m=g(()=>n?.view?.scale,t=>e(t))}const h=t.sourceLayer,b=ht(i,h);await rt({graphic:t,sketchLayer:r,sketchViewModel:n,sourceLayer:h,updateOptions:o,visualVariables:a,webStyleCache:u});let I=null;b.then(e=>I=e).catch(()=>{});const v=a.size,T=a.rotation,F=g(()=>e.attributes,async e=>{let r=!1;for(const n in e){const o=e[n];o!==t.getAttribute(n)&&(t.setAttribute(n,o),null==v||v.isUpdatingInteractively||v.field!==n||v.setInitialValue(o),null==T||T.isUpdatingInteractively||T.field!==n||T.setInitialValue(o),(null==I||I.requiredFields.includes(n))&&(r=!0))}r&&await Se(t,u,"2d"===i.type?i.scale:null)}),j=n.on("update",async e=>{const t=e.graphics[0],s={graphic:t,sketchLayer:r,sketchViewModel:n,sourceLayer:h,updateOptions:o,visualVariables:a,webStyleCache:u};if("complete"===e.state){if(null===i.activeTool)return rt(s);const e=new AbortController,t=c(e);return p(t),d(w(()=>null===i.activeTool,e.signal).then(async()=>{if(!e.signal.aborted)return e.abort(),rt(s)}))}at(i,t,e,a)&&await Se(t,u,"2d"===i.type?i.scale:null),y(bt(t),e)}),S=n.on(["undo","redo"],e=>{y(bt(e.graphics[0]),e)});return s([S,j,l(()=>n.cancel()),F,m])}async function lt(e,t,r,n){e.add(n);const o=r.sourceLayer,a=r.layer??o,c=r.getAttribute(o.objectIdField);let u=null;function p(e){u?.abort(),q(a)?r.visible=e:u=i(async r=>{const n=await ht(t,a);if(m(r),!t.destroyed&&!n.destroyed)try{n.setVisibility?.(c,e)}catch(o){if(r.aborted||t.destroyed||n.destroyed)return;throw o}})}return await ct(t,n),p(!1),s([l(async()=>{p(!0);try{if(!t.destroyed){const e=await ht(t,a).catch(()=>{});e&&!e.destroyed&&await w(()=>!e.updating)}}finally{e.remove(n)}})])}async function ct(e,t){if("3d"===e.type){const r=new $({graphic:t}),n=e.trackGraphicState(r);await w(()=>r.displaying||r.error),n.remove()}else await w(()=>t.visible)}const ut={icon:I(24),text:I(12),line:I(1),viewScaleSizeFactor:100};function pt(e,t,r){let n=!1;return e.filter(e=>!!n||(n=e===t,n)).map(e=>r[e]())}function dt(e,t){e.viewModel.syncFeatureTemplates();const r=e.creationInfo;if("awaiting-feature-creation-info"===t[0].id&&r){const n=r.layer,o=e.viewModel.getTemplatesForLayer(n);1===o.length&&"scene"!==n.type&&(r.template=o[0],t.shift())}return t}function ft(e){return"unknown"===e?null:e}function yt(e){e.filesEnabled=!0,e.mode="view",e.capabilities={editing:!0,operations:{add:!0,update:!0,delete:!0}}}const mt=e=>e.includes("-stop")||e.includes("vertex-"),ht=(e,t)=>{const r="subtype-sublayer"===t.type?t.parent:t;return e.whenLayerView(r)};function gt(e){return"createInteractiveEditSession"in e}function bt(e){const t=e.geometry;if("mesh"===t?.type){const r=e.cloneShallow();return r.attributes=u(e.attributes),r.geometry=t.cloneShallow(),r.geometry.transform=t.transform?.clone()??null,r}return e.clone()}function wt(e){return e.acquireCursor("progress")}function It(e){for(const t of e){const{destinationGraphic:e,destinationField:r,sourceGraphic:n,sourceField:o}=t;e.setAttribute(r,n.getAttribute(o))}}function vt(e){const t=e.templateExecutorInfo?.completionResults;return t?.length?(t.forEach(e=>It(e.relationships)),t.flatMap(e=>e.edits)):null}function Tt(e){const t=ce(e)?e.activeWorkflow:e;if(null==t)return[];if(ae(t))return t.data.layers;const r=t.layer;return r?[r]:[]}function Ft({attributes:e},t){const r=new Set;r.add(t.objectIdField),"uniqueIdFields"in t&&t.uniqueIdFields&&t.uniqueIdFields.length>0&&v(r,t.uniqueIdFields);const n={};for(const o of r)null!=e[o]&&(n[o]=e[o]);if("scene"===t.type&&null!=t.infoFor3D){const r=t.associatedLayer?.globalIdField;null!=r&&(e[r]=e[r])}return n}function jt(e){if(!St(e))return e;const t=new Map;for(const r of e){const e=r.getObjectId();if(null!=e){const n=r.sourceLayer??r.layer;d(t,n,()=>[]).push(e)}}return Array.from(t.entries()).map(([e,t])=>({layer:e,objectIds:t}))}function St(e){return 0===e.length||D(e[0])}function kt({drawTool:e},t){const r=e?.mostDownstreamPlugin?.configuration?.curveTypes;if(!t||!r||0===r.length)return!1;const n=new Set(t.capabilities.supportedCurveTypes);return r.some(e=>!n.has(e))}function At(e,t){const r=new Set(t.capabilities.supportedCurveTypes);return e.some(({geometry:e})=>e&&A(e)&&L(e,r))}export{kt as activeSketchToolDrawsUnsupportedCurve,Ze as appendAllUtilityNetworkAssociationRelationships,dt as avoidFeatureTemplateSelectionWithOnlyOneItem,gt as canCreateInteractiveEditSession,bt as cloneGraphicExceptMesh,At as containsUnsupportedCurve,Pe as createLayerIdMap,Ee as createRelationshipKeyMap,ke as createToolFromGeometryType,pt as createWorkflowSteps,Ke as fetchCandidates,et as fetchFullFeatures,tt as fetchFullFeaturesByObjectId,De as findAllDependencies,Ne as findChangesByGlobalId,$e as findEditorItemForLayer,He as findEditorItemForLayerOrThrow,Je as findLayerInfo,Ge as generateHashForRelationship,Tt as getLayersFromWorkflow,we as getRotationVariableAttribute,vt as getServiceEditsFromWorkflowData,xe as getServiceInfoForLayer,qe as getServiceLayersById,Te as getSizeVariableAttribute,be as getVisualVariableAttributes,ge as getVisualVariablesForLayer,re as isAnyUpdateLeafWorkflow,ne as isBatchAttributeFormViewModel,oe as isCreateFeaturesWorkflow,ie as isFeatureFormViewModel,St as isGraphicsArray,ue as isMergeFeaturesWorkflow,fe as isMergeWorkflowOptions,de as isParentWorkflow,pe as isSplitFeatureWorkflow,ye as isSplitWorkflowOptions,mt as isTerminalUpdateEventType,se as isUpdateFeatureWorkflow,ae as isUpdateFeaturesWorkflow,he as isUpdateFeaturesWorkflowOptions,le as isUpdateRecordWorkflow,ce as isUpdateWorkflow,Be as isUtilityNetworkAssociationsTable,Ft as makeMinimalAttributes,Ce as orderEditsByRelationshipDependencies,yt as prepareAttachmentsForCreateFeaturesWorkflow,It as setRelationshipFields,st as setUpGeometryUpdate,Le as setUpSketchCreateWatchers,nt as setVisualVariablesAndElevationInfoForUpdate,wt as showProgressCursor,ut as sizeDefaults,ft as sizeVariableUnitToLengthUnit,Ae as startCreatingNewFeature,rt as startUpdatingFeatureGeometry,lt as swapForEditingSession,jt as toFeatureInfos,Se as updateGraphicSymbolWhenRequired,at as visualVariableInteractiveUpdate,ht as whenEditorLayerView,ct as whenGraphicDisplayed,me as workflowInfluencesOutcomeOfParent};
|