@arcgis/core 5.2.0-next.132 → 5.2.0-next.135

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/107f4bcf8e6c91a67010.js +1 -0
  3. package/assets/esri/core/workers/chunks/{081c9ccaa5884c730a91.js → 1688c4dcd36db992a9dc.js} +1 -1
  4. package/assets/esri/core/workers/chunks/3a6b8f9aabde7e138834.js +1 -0
  5. package/assets/esri/core/workers/chunks/9a76a43b0e929b423e88.js +1 -0
  6. package/assets/esri/core/workers/chunks/c3767cbe6ada1ba40c37.js +1 -0
  7. package/assets/esri/core/workers/chunks/{18d5bad86ea3ef3ec747.js → eba9e03c1c9aa55044a3.js} +120 -120
  8. package/assets/esri/core/workers/chunks/f6c8e5abe1d55ab5c7dd.js +1 -0
  9. package/chunks/GaussianSplat.glsl.js +24 -9
  10. package/chunks/LineMarker.glsl.js +23 -23
  11. package/chunks/RibbonLine.glsl.js +136 -99
  12. package/config.js +1 -1
  13. package/core/PooledArray.js +1 -1
  14. package/geometry/operators/affineTransformOperator.d.ts +4 -0
  15. package/geometry/operators/alphaShapeOperator.d.ts +10 -1
  16. package/geometry/operators/areaOperator.d.ts +3 -0
  17. package/geometry/operators/autoCompleteOperator.d.ts +3 -0
  18. package/geometry/operators/boundaryOperator.d.ts +4 -0
  19. package/geometry/operators/bufferOperator.d.ts +6 -0
  20. package/geometry/operators/centroidOperator.d.ts +3 -0
  21. package/geometry/operators/clipOperator.d.ts +4 -0
  22. package/geometry/operators/containsOperator.d.ts +4 -0
  23. package/geometry/operators/convexHullOperator.d.ts +6 -0
  24. package/geometry/operators/crossesOperator.d.ts +4 -0
  25. package/geometry/operators/cutOperator.d.ts +3 -0
  26. package/geometry/operators/densifyOperator.d.ts +5 -0
  27. package/geometry/operators/differenceOperator.d.ts +4 -0
  28. package/geometry/operators/disjointOperator.d.ts +4 -0
  29. package/geometry/operators/distanceOperator.d.ts +4 -0
  30. package/geometry/operators/equalsOperator.d.ts +4 -0
  31. package/geometry/operators/extendOperator.d.ts +4 -0
  32. package/geometry/operators/generalizeOperator.d.ts +5 -0
  33. package/geometry/operators/geodesicBufferOperator.d.ts +8 -0
  34. package/geometry/operators/geodesicProximityOperator.d.ts +9 -0
  35. package/geometry/operators/geodeticAreaOperator.d.ts +6 -0
  36. package/geometry/operators/geodeticDensifyOperator.d.ts +7 -0
  37. package/geometry/operators/geodeticDistanceOperator.d.ts +6 -0
  38. package/geometry/operators/geodeticLengthOperator.d.ts +6 -0
  39. package/geometry/operators/geodeticUtilsOperator.d.ts +7 -0
  40. package/geometry/operators/graphicBufferOperator.d.ts +4 -0
  41. package/geometry/operators/integrateOperator.d.ts +3 -0
  42. package/geometry/operators/intersectionOperator.d.ts +5 -0
  43. package/geometry/operators/intersectsOperator.d.ts +4 -0
  44. package/geometry/operators/isNearOperator.d.ts +4 -0
  45. package/geometry/operators/labelPointOperator.d.ts +4 -0
  46. package/geometry/operators/lengthOperator.d.ts +3 -0
  47. package/geometry/operators/linesToPolygonsOperator.d.ts +3 -0
  48. package/geometry/operators/locateBetweenOperator.d.ts +3 -0
  49. package/geometry/operators/minimumBoundingCircleOperator.d.ts +5 -0
  50. package/geometry/operators/multiPartToSinglePartOperator.d.ts +4 -0
  51. package/geometry/operators/offsetOperator.d.ts +5 -0
  52. package/geometry/operators/overlapsOperator.d.ts +4 -0
  53. package/geometry/operators/polygonOverlayOperator.d.ts +9 -1
  54. package/geometry/operators/polygonSlicerOperator.d.ts +7 -0
  55. package/geometry/operators/projectOperator.d.ts +6 -0
  56. package/geometry/operators/proximityOperator.d.ts +7 -0
  57. package/geometry/operators/relateOperator.d.ts +5 -0
  58. package/geometry/operators/reshapeOperator.d.ts +3 -0
  59. package/geometry/operators/shapePreservingProjectOperator.d.ts +7 -0
  60. package/geometry/operators/simplifyOGCOperator.d.ts +5 -0
  61. package/geometry/operators/simplifyOperator.d.ts +5 -0
  62. package/geometry/operators/support/GeographicTransformation.d.ts +2 -0
  63. package/geometry/operators/support/GeographicTransformationStep.d.ts +2 -0
  64. package/geometry/operators/support/Transformation.d.ts +6 -1
  65. package/geometry/operators/support/geographicTransformationUtils.d.ts +4 -0
  66. package/geometry/operators/symmetricDifferenceOperator.d.ts +4 -0
  67. package/geometry/operators/touchesOperator.d.ts +4 -0
  68. package/geometry/operators/types.d.ts +1 -0
  69. package/geometry/operators/unionOperator.d.ts +4 -0
  70. package/geometry/operators/withinOperator.d.ts +4 -0
  71. package/kernel.js +1 -1
  72. package/layers/GaussianSplatLayer.d.ts +0 -1
  73. package/layers/GeospatialPDFLayer.js +1 -1
  74. package/package.json +2 -2
  75. package/support/revision.js +1 -1
  76. package/symbols/LineSymbol3D.d.ts +0 -7
  77. package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
  78. package/views/2d/layers/GeospatialPDFLayerView2D.js +1 -1
  79. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  80. package/views/3d/interactive/placementTools/GroundNavigationPlacementTool3D.js +1 -1
  81. package/views/3d/layers/GeospatialPDFLayerView3D.js +1 -1
  82. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  83. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  84. package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
  85. package/views/3d/navigation/modes/GroundNavigationMode3D.js +1 -1
  86. package/views/3d/state/Constraints.js +1 -1
  87. package/views/3d/state/utils/OffsetCorrectionController.js +1 -1
  88. package/views/3d/state/utils/groundNavigationUtils.js +1 -1
  89. package/views/3d/state/utils/navigationUtils.js +1 -1
  90. package/views/3d/terrain/SphericalPatch.js +1 -1
  91. package/views/3d/webgl-engine/collections/Component/ComponentObjectElevationAgnosticBVH.js +1 -1
  92. package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +23 -12
  93. package/views/3d/webgl-engine/core/shaderLibrary/shading/MarkerSizing.glsl.js +35 -25
  94. package/views/3d/webgl-engine/core/shaderLibrary/shading/readShadow.glsl.js +2 -2
  95. package/views/3d/webgl-engine/core/shaderLibrary/util/cameraUniforms.js +1 -1
  96. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  97. package/views/3d/webgl-engine/lib/GaussianSplatRenderer.js +1 -1
  98. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  99. package/views/3d/webgl-engine/lib/IntersectorResult.js +1 -1
  100. package/views/3d/webgl-engine/lib/LineMaterial.js +1 -1
  101. package/views/3d/webgl-engine/lib/PolygonIntersectionResults.js +1 -1
  102. package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
  103. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  104. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  105. package/views/3d/webgl-engine/lib/lodRendering/LodResources.js +1 -1
  106. package/views/3d/webgl-engine/lib/screenPolygonTriangleIntersections.js +1 -1
  107. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  108. package/views/3d/webgl-engine/materials/intersectWithPolygonOffset.js +1 -1
  109. package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
  110. package/views/3d/webgl-engine/shaders/GaussianSplatPass.glsl.js +4 -4
  111. package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
  112. package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
  113. package/views/3d/webgl-engine/shaders/LineTechniqueConfiguration.js +1 -1
  114. package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
  115. package/views/support/PromiseQueue.js +1 -1
  116. package/views/support/Scheduler.js +1 -1
  117. package/widgets/BatchAttributeForm/ValueChangeTransaction.js +1 -1
  118. package/widgets/BatchAttributeForm/expressions/ExpressionsManager.js +1 -1
  119. package/widgets/BatchAttributeForm/expressions/ExpressionsModel.js +1 -1
  120. package/widgets/BatchAttributeForm/inputs/InputBase.js +1 -1
  121. package/widgets/OrientedImageryViewer/OrientedImageryViewerVisibleElements.d.ts +148 -1
  122. package/assets/esri/core/workers/chunks/540f60e31b19d85e9371.js +0 -1
  123. package/assets/esri/core/workers/chunks/55a560fd872f7463b33d.js +0 -1
  124. package/assets/esri/core/workers/chunks/8048ce97ce22b32c454d.js +0 -1
  125. package/assets/esri/core/workers/chunks/b34305474a861aaf6ccb.js +0 -1
  126. package/assets/esri/core/workers/chunks/cf6f671823fa6c2a9a5e.js +0 -1
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as i,createScreenPointArray as r}from"../../../../core/screenUtils.js";import{secondsFromMilliseconds as s,Seconds as n}from"../../../../core/time.js";import{copy as a,set as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as p,subtract as c,dot as u,scale as m,add as h,copy as f,length as d,distance as g,lerp as b,transformMat4 as _,normalize as S}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as P}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as y}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{fromPoints as w,distance2 as E,closestLineSegmentPoint as v,projectPoint as x,projectPointFraction as T,create as z}from"../../../../geometry/support/lineSegment.js";import{fromPoints as j,signedDistance as L,getNormal as A,create as C}from"../../../../geometry/support/plane.js";import{BufferViewVec3f as M,BufferViewFloat as R,BufferViewVec4Unorm8 as F,BufferViewVec4f16 as O,BufferViewUint32 as B}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOLID as W,isColor as U,isDepth as V,isColorHighlightOLIDOrDepth as I,is2DGeometryOutput as N}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as k}from"../effects/geometry/olidUtils.js";import D from"../lib/GLMaterial.js";import{LineMaterial as Y}from"../lib/LineMaterial.js";import{projectWorldLineSegmentToRenderScreen as J,screenPolygonIntersectsBufferedSegment as q}from"../lib/screenPolygonOverlapUtils.js";import{Hit as X,DrapedHit as G}from"../lib/screenPolygonTriangleIntersections.js";import{ScreenSizePerspectiveEvaluator as H}from"../lib/screenSizePerspectiveUtils.js";import{isTranslationMatrix as K,assert as Q}from"../lib/Util.js";import{isImagePattern as Z}from"./lineStippleUtils.js";import{VisualVariablePassParameters as $}from"./VisualVariablePassParameters.js";import{writeColor as ee}from"./internal/bufferWriterUtils.js";import{n as te}from"../../../../chunks/RibbonLine.glsl.js";import{getLayout as ie,getTextureBufferLayout as re}from"../shaders/RibbonLineLayouts.js";import{RibbonLineTechnique as se}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as ne}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as ae}from"../../../../webscene/support/AlphaCutoff.js";class oe extends Y{constructor(e,t){super(e,pe),this.produces=new Map([[2,e=>W(e)||U(e)&&8===this.parameters.renderOccluded],[3,e=>V(e)],[10,e=>I(e)&&8===this.parameters.renderOccluded],[11,e=>I(e)&&8===this.parameters.renderOccluded],[4,e=>U(e)&&this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[8,e=>U(e)&&!this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[18,e=>N(e)]]),this._configuration=new ne(t)}updateConfiguration(e){super.updateConfiguration(e);const{draped:t}=this._configuration,i=null!=this.parameters.stipplePattern&&null!=this.parameters.stippleTexture&&10!==e.output,r=i&&this.parameters.isImagePattern(),s=t&&this.parameters.usesWorldSizedWidth(r);this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.stippleEnabled=i,this._configuration.stippleOffColorEnabled=i&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=i&&this.parameters.stipplePreferContinuous,this._configuration.numJoinSubdivisions=ge(this.parameters.join,i),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&de(this.parameters.markerParameters),this._configuration.polygonOffsetIndex=this.parameters.polygonOffsetIndex,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration.emissionSource=this.emissions?1:0,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective&&!s,this._configuration.worldSized=s,this._configuration.imagePattern=r}get visible(){return this.parameters.color[3]>=ae||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>ae}get emissions(){return this.parameters.emissiveStrength>0?8!==this.parameters.renderOccluded?2:1:0}setParameters(e,t){e.animation=this.parameters.animation,super.setParameters(e,t)}intersectRayDraped({attributes:e},i,r,s,n,a,o){if(!i.options.selectionMode)return;const l=this._getLineSize(e,!0),p=r[0],c=r[1],u=he(l,a,o,this.parameters.usesWorldSizedWidth());let m=Number.MAX_VALUE,h=0;for(const f of fe(Pe,ye,this.parameters,e)){const e=p-Pe[0],i=c-Pe[1],r=ye[0]-Pe[0],s=ye[1]-Pe[1],n=t((r*e+s*i)/(r*r+s*s),0,1),a=r*n-e,o=s*n-i,l=a*a+o*o;l<m&&(m=l,h=f)}m<u*u&&s(n.distance,n.renderDistance,n.normal,h)}intersectRay(t,i,r,s,n,o){const{options:l,camera:b,rayBegin:_,rayEnd:S}=r;if(!l.selectionMode||!t.visible||!b)return;if(!K(i))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const P=t.attributes,y=P.get("position").data,x=this._getLineSize(P),T=ze;a(T,r.point);const z=x*b.pixelRatio,C=Ye*b.pixelRatio,M=z/2+C;p(Ue[0],T[0]-M,T[1]+M,0),p(Ue[1],T[0]+M,T[1]+M,0),p(Ue[2],T[0]+M,T[1]-M,0),p(Ue[3],T[0]-M,T[1]-M,0);for(let e=0;e<4;e++)if(!b.unprojectFromRenderScreen(Ue[e],Ve[e]))return;j(b.eye,Ve[0],Ve[1],Ie),j(b.eye,Ve[1],Ve[2],Ne),j(b.eye,Ve[2],Ve[3],ke),j(b.eye,Ve[3],Ve[0],De);let R=Number.MAX_VALUE,F=0;for(const e of this._forEachTransformedLineSegment(_e,Se,y,i,me(this.parameters,P))){if(L(Ie,_e)<0&&L(Ie,Se)<0||L(Ne,_e)<0&&L(Ne,Se)<0||L(ke,_e)<0&&L(ke,Se)<0||L(De,_e)<0&&L(De,Se)<0)continue;const t=b.projectToRenderScreen(_e,je),i=b.projectToRenderScreen(Se,Le);if(null==t||null==i)continue;if(t[2]<0&&i[2]>0){c(xe,_e,Se);const e=b.frustum,i=-L(e[4],_e)/u(xe,A(e[4]));if(m(xe,xe,i),h(_e,_e,xe),!b.projectToRenderScreen(_e,t))continue}else if(t[2]>0&&i[2]<0){c(xe,Se,_e);const e=b.frustum,t=-L(e[4],Se)/u(xe,A(e[4]));if(m(xe,xe,t),h(Se,Se,xe),!b.projectToRenderScreen(Se,i))continue}else if(t[2]<0&&i[2]<0)continue;t[2]=0,i[2]=0;const r=w(t,i,Fe),s=E(r,T);if(!(s>=R)){if(this.parameters.screenSizePerspective){const e=this.computeScreenSizePerspectiveWidth(r,_e,Se,T,b,x,C);if(s>=e*e)continue}R=s,f(Me,_e),f(Re,Se),F=e}}if(R<M*M){let e=Number.MAX_VALUE;if(v(w(Me,Re,Fe),w(_,S,Oe),Te)){c(Te,Te,_);const t=d(Te);m(Te,Te,1/t),e=t/g(_,S)}o(e,e,Te,F)}}intersectScreenPolygon(t,i,r,s){const{options:n,camera:a,screenPolygonPrimitiveProcessor:o}=r;if(!n.selectionMode||!t.visible)return null;if(!K(i))return e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix"),null;const l=t.attributes,p=l.get("position").data,c=this._getLineSize(l),u=Ye,m=u*a.pixelRatio,h=new X(4);for(const e of this._forEachTransformedLineSegment(_e,Se,p,i,me(this.parameters,l)))for(const[t,i]of o.processLineSegment(qe,_e,Se)){if(!J(a,t,i,je,Le))continue;const r=w(je,Le,Fe);let n=c/2+u;this.parameters.screenSizePerspective&&(b(ze,je,Le,.5),n=Math.max(n,this.computeScreenSizePerspectiveWidth(r,t,i,ze,a,c,m)/a.pixelRatio)),a.renderToScreen(je,Ae),a.renderToScreen(Le,Ce),q(s,Ae,Ce,n)&&(x(w(t,i,Oe),a.eye,we),h.updateIfCloserFromValues(g(a.eye,we),e,we,null))}return h}intersectScreenPolygonDraped({attributes:e},t,i,r,s,n){if(!i.options.selectionMode)return null;const a=he(this._getLineSize(e,!0),s,n,this.parameters.usesWorldSizedWidth());for(const o of fe(Pe,ye,this.parameters,e,t))if(q(r,Pe,ye,a))return new G(o);return null}createBufferWriter(){return new ce(ie(this.parameters),re(this.parameters),this.parameters)}createGLMaterial(e){return new le(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}update(e){return!!this.parameters.hasAnimation&&(this.setParameters({timeElapsed:s(e.time)},!1),0!==e.dt)}computeScreenSizePerspectiveWidth(e,t,i,r,s,n,a){const o=T(e,r);b(we,t,i,o),_(Ee,we,s.viewMatrix);const l=d(Ee),p=this.computeCameraAbsCosAngle(we,s,this._configuration.spherical);be.update(p,l,this.parameters.screenSizePerspective,this.parameters.screenSizePerspectiveMinPixelReferenceSize);return be.apply(n)*s.pixelRatio/2+a}computeCameraAbsCosAngle(e,t,i){return i?S(Te,e):p(Te,0,0,1),c(ve,e,t.eye),S(ve,ve),Math.abs(u(Te,ve))}_getLineSize(e,i=!1){let r=this.parameters.width;if(this.parameters.vvSize){const s=e.get("sizeFeatureAttribute").data[0];Number.isNaN(s)?i&&(r*=this.parameters.vvSize.fallback[0]):r*=t(this.parameters.vvSize.offset[0]+s*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else e.has("size")&&(r*=e.get("size").data[0]);return r}*_forEachTransformedLineSegment(e,t,i,r,s){const n=s?i.length-2:i.length-5;for(let a=0;a<n;a+=3){e[0]=i[a]+r[12],e[1]=i[a+1]+r[13],e[2]=i[a+2]+r[14];const s=(a+3)%i.length;t[0]=i[s]+r[12],t[1]=i[s+1]+r[13],t[2]=i[s+2]+r[14],yield a/3}}}class le extends D{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures?.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){const{stipplePattern:t}=this._material.parameters;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(se,e)}}class pe extends ${constructor(){super(...arguments),this._width=0,this.color=y,this.join="miter",this.cap=0,this.miterLimit=5,this.shadingEnabled=!1,this.writeDepth=!0,this.polygonOffset=0,this.polygonOffsetIndex=0,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1,this.timeElapsed=n(0),this.animation=0,this.animationSpeed=1,this.trailLength=1,this.startTime=n(0),this.endTime=n(1/0),this.worldSized=!1}get width(){return this.isImagePattern()?this.stipplePattern.width:this._width}set width(e){this._width=e}get transparent(){return this.color[3]<1||this.hasAnimation||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return 0!==this.animation}usesWorldSizedWidth(e=this.isImagePattern()){return this.worldSized||e}isImagePattern(){return Z(this.stipplePattern)&&null!=this.stippleTexture}}class ce{constructor(e,t,i){this.layout=e,this.textureBufferLayout=t,this._parameters=i,this.numJoinSubdivisions=ge(this._parameters.join,null!=this._parameters.stipplePattern)}_isClosed(e){return me(this._parameters,e)}allocate(e){return this.layout.createBuffer(e)}elementCountTextureBuffer(e){return e.get("position").data.length/3+(this._isClosed(e)?3:2)}elementCount(e){const t=2,i=e.get("position").indices.length/2+1,r=this._isClosed(e);let s=r?2:2*t;return s+=((r?i:i-1)-(r?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(e,t,i,r,s,n){null!=n&&this._writeTextureBuffer(e,i,n),null!=r&&this._writeVertexBuffer(e,i,r,s)}_writeTextureBuffer(e,t,i){const r=t.get("position"),s=r.data.length/3,n=this._isClosed(t),{buffer:a,offset:o}=i,l=a.getField("position",M),p=a.getField("u0",R),c=a.getField("sizeFeatureAttribute",R),u=a.getField("size",R),m=a.getField("colorFeatureAttribute",R),h=a.getField("color",F),d=a.getField("olidColor",F),b=a.getField("timeStamps",O),_=a.getField("opacityFeatureAttribute",R),S=t.get("sizeFeatureAttribute")?.data,P=t.get("size")?.data,y=t.get("colorFeatureAttribute")?.data,w=t.get("color")?.data,E=t.get("opacityFeatureAttribute")?.data,v=t.get("distanceToStart")?.data,x=t.get("timeStamps");Q(null!==l,"Expected valid position field in texture buffer"),Q(null!==p,"Expected valid u0 field in texture buffer");let T=0;for(let j=0;j<s;++j){this._getTransformedPosition(We,r.data,j,e),j>0&&(null!=v?T=v[j]??T:T+=g(Be,We));const t=o+j+1;if(l.setVec(t,We),p.set(t,T),f(Be,We),c&&c.set(t,1===S?.length?S[0]:S?.[j]??0),u&&u.set(t,1===P?.length?P[0]:P?.[j]??1),m&&m.set(t,1===y?.length?y[0]:y?.[j]??0),h)if(null!=w){const e=Math.min(4*j,w.length-4);h.setValues(t,w[e],w[e+1],w[e+2],w[e+3])}else h.setValues(t,1,1,1,1);_&&_.set(t,1===E?.length?E[0]:E?.[j]??0)}if(null!=b&&null!=x){Q(4===x.size);const e=x.data;for(let t=0;t<s;++t){const i=4*t,r=o+t+1;b.set(r,0,e[i]),b.set(r,1,e[i+1]),b.set(r,2,e[i+2]),b.set(r,3,e[i+3])}}if(n){const e=o,t=o+1,i=o+2,r=o+s,n=r+1,c=r+2;a.copyItem(r,e),a.copyItem(t,n),a.copyItem(i,c),l.getVec(r,Be),l.getVec(t,We);const u=v?.[s]??T+g(Be,We);p.set(n,u)}else{const e=o,t=o+1,i=o+s,r=i+1;a.copyItem(t,e),a.copyItem(i,r)}const z=t.get("olidColor");k()&&null!=z&&null!=d&&ee(z,4,d,o)}_writeVertexBuffer(e,t,i,r){const{buffer:s,offset:n}=i,{layout:a}=this,o=t.get("position"),l=o.indices,p=o.data.length/3,c=this._isClosed(t),u=p+(c?3:2);l&&l.length!==2*(p-1)&&console.warn("RibbonLineMaterial does not support indices");const m=s.getField("textureElementIndex",B);Q(null!=m,"Missing texture buffer index field"),Q(null!=r,"Using a texture layout, but the texture range for this instance was not provided");const h=r.from;Q(r.numElements===u,"Expected number of elements in TextureBuffer to equal number of points");const f=new Float32Array(s.buffer),d=new Float16Array(s.buffer),g=new Uint32Array(s.buffer),b=a.stride/4;let _=n*b;const S=_,P=f.BYTES_PER_ELEMENT/d.BYTES_PER_ELEMENT,y=(e,t,i)=>{const r=i+1;g[_]=h+r,_++;let s=_*P;d[s++]=e,d[s++]=t,_=Math.ceil(s/P)};_+=b;let w=0,E=0;c?(w=0,E=p):(y(1,-4,0),y(1,4,0),w=1,E=p-1);for(let v=w;v<E;v++){y(0,-1,v),y(0,1,v);const e=this.numJoinSubdivisions;for(let t=0;t<e;++t){const i=(t+1)/(e+1);y(i,-1,v),y(i,1,v)}y(1,-2,v),y(1,2,v)}c?(y(0,-1,E),y(0,1,E)):(y(0,-5,E),y(0,5,E)),ue(f,S+b,f,S,b);_=ue(f,_-b,f,_,b),this._parameters.wireframe&&this._addWireframeVertices(s,S,_,b)}_getTransformedPosition(e,t,i,r){const s=3*i;p(e,t[s+0],t[s+1],t[s+2]),r&&_(e,e,r)}_addWireframeVertices(e,t,i,r){const s=new Uint8Array(e.buffer,i*Float32Array.BYTES_PER_ELEMENT),n=new Uint8Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,(i-t)*Float32Array.BYTES_PER_ELEMENT),a=r*Float32Array.BYTES_PER_ELEMENT;let o=0;const l=e=>o=ue(n,e,s,o,a);for(let p=0;p<=n.length-4*a;p+=2*a)l(p),l(p+2*a),l(p+1*a),l(p+2*a),l(p+1*a),l(p+3*a)}}function ue(e,t,i,r,s){for(let n=0;n<s;n++)i[r++]=e[t++];return r}function me(e,t){if(!e.isClosed)return!1;return t.get("position").indices.length>2}function he(e,t,i,r){return r?e/(2*i)+Ye*t:(e/2+Ye)*t}function*fe(e,t,i,r,s){const n=r.get("position").data,l=me(i,r)?n.length-2:n.length-5,p=s?.[0]??0,c=s?.[1]??0;o(e,n[0]+p,n[1]+c);for(let u=3;u<l+3;u+=3){const i=u%n.length;o(t,n[i]+p,n[i+1]+c),yield u/3,a(e,t)}}function de(e){return 1===e.anchor&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}function ge(e,t){const i=t?1:0;switch(e){case"miter":case"bevel":return i;case"round":return te+i}}const be=new H,_e=P(),Se=P(),Pe=l(),ye=l(),we=P(),Ee=P(),ve=P(),xe=P(),Te=P(),ze=P(),je=i(),Le=i(),Ae=r(),Ce=r(),Me=P(),Re=P(),Fe=z(),Oe=z(),Be=P(),We=P(),Ue=[i(),i(),i(),i()],Ve=[P(),P(),P(),P()],Ie=C(),Ne=C(),ke=C(),De=C(),Ye=4,Je={getDrapedRibbonLineMaxDistance:he},qe=[P(),P()];export{pe as Parameters,oe as RibbonLineMaterial,Je as test};
2
+ import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as i,createScreenPointArray as r}from"../../../../core/screenUtils.js";import{secondsFromMilliseconds as s,Seconds as n}from"../../../../core/time.js";import{copy as a,set as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as p,subtract as c,dot as u,scale as m,add as h,copy as f,length as d,distance as g,lerp as b,transformMat4 as _,normalize as S}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as P}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as y}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{fromPoints as w,distance2 as E,closestLineSegmentPoint as v,projectPoint as x,projectPointFraction as T,create as z}from"../../../../geometry/support/lineSegment.js";import{fromPoints as j,signedDistance as L,getNormal as A,create as C}from"../../../../geometry/support/plane.js";import{BufferViewVec3f as M,BufferViewFloat as R,BufferViewVec4Unorm8 as F,BufferViewVec4f16 as O,BufferViewUint32 as B}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOLID as W,isColor as U,isDepth as V,isColorHighlightOLIDOrDepth as I,is2DGeometryOutput as N}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as k}from"../effects/geometry/olidUtils.js";import D from"../lib/GLMaterial.js";import{LineMaterial as Y}from"../lib/LineMaterial.js";import{projectWorldLineSegmentToRenderScreen as J,screenPolygonIntersectsBufferedSegment as q}from"../lib/screenPolygonOverlapUtils.js";import{Hit as X,DrapedHit as G}from"../lib/screenPolygonTriangleIntersections.js";import{ScreenSizePerspectiveEvaluator as H}from"../lib/screenSizePerspectiveUtils.js";import{isTranslationMatrix as K,assert as Q}from"../lib/Util.js";import{isImagePattern as Z}from"./lineStippleUtils.js";import{VisualVariablePassParameters as $}from"./VisualVariablePassParameters.js";import{writeColor as ee}from"./internal/bufferWriterUtils.js";import{n as te}from"../../../../chunks/RibbonLine.glsl.js";import{getLayout as ie,getTextureBufferLayout as re}from"../shaders/RibbonLineLayouts.js";import{RibbonLineTechnique as se}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as ne}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as ae}from"../../../../webscene/support/AlphaCutoff.js";class oe extends Y{constructor(e,t){super(e,pe),this.produces=new Map([[2,e=>W(e)||U(e)&&8===this.parameters.renderOccluded],[3,e=>V(e)],[10,e=>I(e)&&8===this.parameters.renderOccluded],[11,e=>I(e)&&8===this.parameters.renderOccluded],[4,e=>U(e)&&this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[8,e=>U(e)&&!this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[18,e=>N(e)]]),this._configuration=new ne(t)}updateConfiguration(e){super.updateConfiguration(e);const t=null!=this.parameters.stipplePattern&&null!=this.parameters.stippleTexture&&10!==e.output,i=t&&this.parameters.isImagePattern()&&this._configuration.draped,r=this.parameters.usesWorldSizedWidth(i);this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.stippleEnabled=t,this._configuration.stippleOffColorEnabled=t&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=t&&this.parameters.stipplePreferContinuous,this._configuration.numJoinSubdivisions=ge(this.parameters.join,t),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&de(this.parameters.markerParameters),this._configuration.polygonOffsetIndex=this.parameters.polygonOffsetIndex,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration.emissionSource=this.emissions?1:0,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective&&!r,this._configuration.worldSized=r,this._configuration.imagePattern=i}get visible(){return this.parameters.color[3]>=ae||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>ae}get emissions(){return this.parameters.emissiveStrength>0?8!==this.parameters.renderOccluded?2:1:0}setParameters(e,t){e.animation=this.parameters.animation,super.setParameters(e,t)}intersectRayDraped({attributes:e},i,r,s,n,a,o){if(!i.options.selectionMode)return;const l=this._getLineSize(e,!0),p=r[0],c=r[1],u=he(l,a,o,this.parameters.usesWorldSizedWidth());let m=Number.MAX_VALUE,h=0;for(const f of fe(Pe,ye,this.parameters,e)){const e=p-Pe[0],i=c-Pe[1],r=ye[0]-Pe[0],s=ye[1]-Pe[1],n=t((r*e+s*i)/(r*r+s*s),0,1),a=r*n-e,o=s*n-i,l=a*a+o*o;l<m&&(m=l,h=f)}m<u*u&&s(n.distance,n.renderDistance,n.normal,h)}intersectRay(t,i,r,s,n,o){const{options:l,camera:b,rayBegin:_,rayEnd:S}=r;if(!l.selectionMode||!t.visible||!b)return;if(!K(i))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const P=t.attributes,y=P.get("position").data,x=this._getLineSize(P),T=ze;a(T,r.point);const z=x*b.pixelRatio,C=Ye*b.pixelRatio,M=z/2+C;p(Ue[0],T[0]-M,T[1]+M,0),p(Ue[1],T[0]+M,T[1]+M,0),p(Ue[2],T[0]+M,T[1]-M,0),p(Ue[3],T[0]-M,T[1]-M,0);for(let e=0;e<4;e++)if(!b.unprojectFromRenderScreen(Ue[e],Ve[e]))return;j(b.eye,Ve[0],Ve[1],Ie),j(b.eye,Ve[1],Ve[2],Ne),j(b.eye,Ve[2],Ve[3],ke),j(b.eye,Ve[3],Ve[0],De);let R=Number.MAX_VALUE,F=0;for(const e of this._forEachTransformedLineSegment(_e,Se,y,i,me(this.parameters,P))){if(L(Ie,_e)<0&&L(Ie,Se)<0||L(Ne,_e)<0&&L(Ne,Se)<0||L(ke,_e)<0&&L(ke,Se)<0||L(De,_e)<0&&L(De,Se)<0)continue;const t=b.projectToRenderScreen(_e,je),i=b.projectToRenderScreen(Se,Le);if(null==t||null==i)continue;if(t[2]<0&&i[2]>0){c(xe,_e,Se);const e=b.frustum,i=-L(e[4],_e)/u(xe,A(e[4]));if(m(xe,xe,i),h(_e,_e,xe),!b.projectToRenderScreen(_e,t))continue}else if(t[2]>0&&i[2]<0){c(xe,Se,_e);const e=b.frustum,t=-L(e[4],Se)/u(xe,A(e[4]));if(m(xe,xe,t),h(Se,Se,xe),!b.projectToRenderScreen(Se,i))continue}else if(t[2]<0&&i[2]<0)continue;t[2]=0,i[2]=0;const r=w(t,i,Fe),s=E(r,T);if(!(s>=R)){if(this.parameters.screenSizePerspective){const e=this.computeScreenSizePerspectiveWidth(r,_e,Se,T,b,x,C);if(s>=e*e)continue}R=s,f(Me,_e),f(Re,Se),F=e}}if(R<M*M){let e=Number.MAX_VALUE;if(v(w(Me,Re,Fe),w(_,S,Oe),Te)){c(Te,Te,_);const t=d(Te);m(Te,Te,1/t),e=t/g(_,S)}o(e,e,Te,F)}}intersectScreenPolygon(t,i,r,s){const{options:n,camera:a,screenPolygonPrimitiveProcessor:o}=r;if(!n.selectionMode||!t.visible)return null;if(!K(i))return e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix"),null;const l=t.attributes,p=l.get("position").data,c=this._getLineSize(l),u=Ye,m=u*a.pixelRatio,h=new X(4);for(const e of this._forEachTransformedLineSegment(_e,Se,p,i,me(this.parameters,l)))for(const[t,i]of o.processLineSegment(qe,_e,Se)){if(!J(a,t,i,je,Le))continue;const r=w(je,Le,Fe);let n=c/2+u;this.parameters.screenSizePerspective&&(b(ze,je,Le,.5),n=Math.max(n,this.computeScreenSizePerspectiveWidth(r,t,i,ze,a,c,m)/a.pixelRatio)),a.renderToScreen(je,Ae),a.renderToScreen(Le,Ce),q(s,Ae,Ce,n)&&(x(w(t,i,Oe),a.eye,we),h.updateIfCloserFromValues(g(a.eye,we),e,we,null))}return h}intersectScreenPolygonDraped({attributes:e},t,i,r,s,n){if(!i.options.selectionMode)return null;const a=he(this._getLineSize(e,!0),s,n,this.parameters.usesWorldSizedWidth());for(const o of fe(Pe,ye,this.parameters,e,t))if(q(r,Pe,ye,a))return new G(o);return null}createBufferWriter(){return new ce(ie(this.parameters),re(this.parameters),this.parameters)}createGLMaterial(e){return new le(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}update(e){return!!this.parameters.hasAnimation&&(this.setParameters({timeElapsed:s(e.time)},!1),0!==e.dt)}computeScreenSizePerspectiveWidth(e,t,i,r,s,n,a){const o=T(e,r);b(we,t,i,o),_(Ee,we,s.viewMatrix);const l=d(Ee),p=this.computeCameraAbsCosAngle(we,s,this._configuration.spherical);be.update(p,l,this.parameters.screenSizePerspective,this.parameters.screenSizePerspectiveMinPixelReferenceSize);return be.apply(n)*s.pixelRatio/2+a}computeCameraAbsCosAngle(e,t,i){return i?S(Te,e):p(Te,0,0,1),c(ve,e,t.eye),S(ve,ve),Math.abs(u(Te,ve))}_getLineSize(e,i=!1){let r=this.parameters.width;if(this.parameters.vvSize){const s=e.get("sizeFeatureAttribute").data[0];Number.isNaN(s)?i&&(r*=this.parameters.vvSize.fallback[0]):r*=t(this.parameters.vvSize.offset[0]+s*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else e.has("size")&&(r*=e.get("size").data[0]);return r}*_forEachTransformedLineSegment(e,t,i,r,s){const n=s?i.length-2:i.length-5;for(let a=0;a<n;a+=3){e[0]=i[a]+r[12],e[1]=i[a+1]+r[13],e[2]=i[a+2]+r[14];const s=(a+3)%i.length;t[0]=i[s]+r[12],t[1]=i[s+1]+r[13],t[2]=i[s+2]+r[14],yield a/3}}}class le extends D{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures?.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){const{stipplePattern:t}=this._material.parameters;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(se,e)}}class pe extends ${constructor(){super(...arguments),this._width=0,this.color=y,this.join="miter",this.cap=0,this.miterLimit=5,this.shadingEnabled=!1,this.writeDepth=!0,this.polygonOffset=0,this.polygonOffsetIndex=0,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1,this.timeElapsed=n(0),this.animation=0,this.animationSpeed=1,this.trailLength=1,this.startTime=n(0),this.endTime=n(1/0),this.worldSized=!1}get width(){return this.isImagePattern()?this.stipplePattern.width:this._width}set width(e){this._width=e}get transparent(){return this.color[3]<1||this.hasAnimation||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return 0!==this.animation}usesWorldSizedWidth(e=this.isImagePattern()){return this.worldSized||e}isImagePattern(){return Z(this.stipplePattern)&&null!=this.stippleTexture}}class ce{constructor(e,t,i){this.layout=e,this.textureBufferLayout=t,this._parameters=i,this.numJoinSubdivisions=ge(this._parameters.join,null!=this._parameters.stipplePattern)}_isClosed(e){return me(this._parameters,e)}allocate(e){return this.layout.createBuffer(e)}elementCountTextureBuffer(e){return e.get("position").data.length/3+(this._isClosed(e)?3:2)}elementCount(e){const t=2,i=e.get("position").indices.length/2+1,r=this._isClosed(e);let s=r?2:2*t;return s+=((r?i:i-1)-(r?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(e,t,i,r,s,n){null!=n&&this._writeTextureBuffer(e,i,n),null!=r&&this._writeVertexBuffer(e,i,r,s)}_writeTextureBuffer(e,t,i){const r=t.get("position"),s=r.data.length/3,n=this._isClosed(t),{buffer:a,offset:o}=i,l=a.getField("position",M),p=a.getField("u0",R),c=a.getField("sizeFeatureAttribute",R),u=a.getField("size",R),m=a.getField("colorFeatureAttribute",R),h=a.getField("color",F),d=a.getField("olidColor",F),b=a.getField("timeStamps",O),_=a.getField("opacityFeatureAttribute",R),S=t.get("sizeFeatureAttribute")?.data,P=t.get("size")?.data,y=t.get("colorFeatureAttribute")?.data,w=t.get("color")?.data,E=t.get("opacityFeatureAttribute")?.data,v=t.get("distanceToStart")?.data,x=t.get("timeStamps");Q(null!==l,"Expected valid position field in texture buffer"),Q(null!==p,"Expected valid u0 field in texture buffer");let T=0;for(let j=0;j<s;++j){this._getTransformedPosition(We,r.data,j,e),j>0&&(null!=v?T=v[j]??T:T+=g(Be,We));const t=o+j+1;if(l.setVec(t,We),p.set(t,T),f(Be,We),c&&c.set(t,1===S?.length?S[0]:S?.[j]??0),u&&u.set(t,1===P?.length?P[0]:P?.[j]??1),m&&m.set(t,1===y?.length?y[0]:y?.[j]??0),h)if(null!=w){const e=Math.min(4*j,w.length-4);h.setValues(t,w[e],w[e+1],w[e+2],w[e+3])}else h.setValues(t,1,1,1,1);_&&_.set(t,1===E?.length?E[0]:E?.[j]??0)}if(null!=b&&null!=x){Q(4===x.size);const e=x.data;for(let t=0;t<s;++t){const i=4*t,r=o+t+1;b.set(r,0,e[i]),b.set(r,1,e[i+1]),b.set(r,2,e[i+2]),b.set(r,3,e[i+3])}}if(n){const e=o,t=o+1,i=o+2,r=o+s,n=r+1,c=r+2;a.copyItem(r,e),a.copyItem(t,n),a.copyItem(i,c),l.getVec(r,Be),l.getVec(t,We);const u=v?.[s]??T+g(Be,We);p.set(n,u)}else{const e=o,t=o+1,i=o+s,r=i+1;a.copyItem(t,e),a.copyItem(i,r)}const z=t.get("olidColor");k()&&null!=z&&null!=d&&ee(z,4,d,o)}_writeVertexBuffer(e,t,i,r){const{buffer:s,offset:n}=i,{layout:a}=this,o=t.get("position"),l=o.indices,p=o.data.length/3,c=this._isClosed(t),u=p+(c?3:2);l&&l.length!==2*(p-1)&&console.warn("RibbonLineMaterial does not support indices");const m=s.getField("textureElementIndex",B);Q(null!=m,"Missing texture buffer index field"),Q(null!=r,"Using a texture layout, but the texture range for this instance was not provided");const h=r.from;Q(r.numElements===u,"Expected number of elements in TextureBuffer to equal number of points");const f=new Float32Array(s.buffer),d=new Float16Array(s.buffer),g=new Uint32Array(s.buffer),b=a.stride/4;let _=n*b;const S=_,P=f.BYTES_PER_ELEMENT/d.BYTES_PER_ELEMENT,y=(e,t,i)=>{const r=i+1;g[_]=h+r,_++;let s=_*P;d[s++]=e,d[s++]=t,_=Math.ceil(s/P)};_+=b;let w=0,E=0;c?(w=0,E=p):(y(1,-4,0),y(1,4,0),w=1,E=p-1);for(let v=w;v<E;v++){y(0,-1,v),y(0,1,v);const e=this.numJoinSubdivisions;for(let t=0;t<e;++t){const i=(t+1)/(e+1);y(i,-1,v),y(i,1,v)}y(1,-2,v),y(1,2,v)}c?(y(0,-1,E),y(0,1,E)):(y(0,-5,E),y(0,5,E)),ue(f,S+b,f,S,b);_=ue(f,_-b,f,_,b),this._parameters.wireframe&&this._addWireframeVertices(s,S,_,b)}_getTransformedPosition(e,t,i,r){const s=3*i;p(e,t[s+0],t[s+1],t[s+2]),r&&_(e,e,r)}_addWireframeVertices(e,t,i,r){const s=new Uint8Array(e.buffer,i*Float32Array.BYTES_PER_ELEMENT),n=new Uint8Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,(i-t)*Float32Array.BYTES_PER_ELEMENT),a=r*Float32Array.BYTES_PER_ELEMENT;let o=0;const l=e=>o=ue(n,e,s,o,a);for(let p=0;p<=n.length-4*a;p+=2*a)l(p),l(p+2*a),l(p+1*a),l(p+2*a),l(p+1*a),l(p+3*a)}}function ue(e,t,i,r,s){for(let n=0;n<s;n++)i[r++]=e[t++];return r}function me(e,t){if(!e.isClosed)return!1;return t.get("position").indices.length>2}function he(e,t,i,r){return r?e/(2*i)+Ye*t:(e/2+Ye)*t}function*fe(e,t,i,r,s){const n=r.get("position").data,l=me(i,r)?n.length-2:n.length-5,p=s?.[0]??0,c=s?.[1]??0;o(e,n[0]+p,n[1]+c);for(let u=3;u<l+3;u+=3){const i=u%n.length;o(t,n[i]+p,n[i+1]+c),yield u/3,a(e,t)}}function de(e){return 1===e.anchor&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}function ge(e,t){const i=t?1:0;switch(e){case"miter":case"bevel":return i;case"round":return te+i}}const be=new H,_e=P(),Se=P(),Pe=l(),ye=l(),we=P(),Ee=P(),ve=P(),xe=P(),Te=P(),ze=P(),je=i(),Le=i(),Ae=r(),Ce=r(),Me=P(),Re=P(),Fe=z(),Oe=z(),Be=P(),We=P(),Ue=[i(),i(),i(),i()],Ve=[P(),P(),P(),P()],Ie=C(),Ne=C(),ke=C(),De=C(),Ye=4,Je={getDrapedRibbonLineMaxDistance:he},qe=[P(),P()];export{pe as Parameters,oe as RibbonLineMaterial,Je as test};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{direction as t,dot as n}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as o}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{polygonOffset as r}from"./PolygonOffset.js";import{TriangleTechniqueConfiguration as e}from"./TriangleTechniqueConfiguration.js";function s(o,e,s,f){c.output=e.transparent?1:0,c.polygonOffset=e.polygonOffset,c.enableOITOffset=e.enableOITOffset;const i=r(c);if(!i)return o;const a=l*i.units,p=t(m,f,s);return(t,r,e,s)=>{const f=(e?1-Math.abs(n(p,e)):0)*i.factor*u+a;return o(t,r+f,e,s)}}function f(n,o,e,s,f){const i=r(e);return i?a(i,t(m,f,s),n,o):n}function i(t,n,o){return null==t?null:(t.distance=f(t.distance,t.hasNormal?t.normal:null,n,o,t.point),t)}function a({units:t,factor:o},r,e,s){const f=l*t;return e+((s?1-Math.abs(n(r,s)):0)*o*u+f)}const c=new e,u=2e-5,l=2e-6,m=o();export{f as applyPolygonOffsetToDistance,i as applyPolygonOffsetToHit,s as intersectWithPolygonOffset};
2
+ import{direction as n,dot as t}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{polygonOffset as o}from"./PolygonOffset.js";import{TriangleTechniqueConfiguration as e}from"./TriangleTechniqueConfiguration.js";function f(t,r,o,e){const f=c(r);if(!f)return t;const i=n(p,e,o);return(n,r,o,e)=>t(n,u(f,i,r,o),o,e)}function i(t,r,o,e,f){const i=c(o);return i?u(i,n(p,f,e),t,r):t}function s(n,t,r){return null==n?null:(n.renderDistance=i(n.renderDistance,n.hasNormal?n.normal:null,t,r,n.point),n)}function c(n){return a.output=n.transparent?1:0,a.polygonOffset=n.polygonOffset,a.enableOITOffset=n.enableOITOffset,o(a)}function u({units:n,factor:r},o,e,f){const i=m*n;return e+((f?1-Math.abs(t(o,f)):0)*r*l+i)}const a=new e,l=2e-5,m=2e-6,p=r();export{i as applyPolygonOffsetToDistance,s as applyPolygonOffsetToHit,f as intersectWithPolygonOffset};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/NormalUtils.glsl.js";import"../core/shaderLibrary/shading/readShadow.glsl.js";import"../core/shaderLibrary/util/RgbNormalizedDepthEncoding.glsl.js";import"../core/shaderModules/Float3BindUniform.js";import"../core/shaderModules/glsl.js";import"./GaussianSplatDepthPolicy.js";import"./GaussianSplatPass.glsl.js";import"./GaussianSplatTechniqueConfiguration.js";import"../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../chunks/GaussianSplat.glsl.js";
2
+ import"../core/shaderLibrary/shading/calculateUVZShadow.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/NormalUtils.glsl.js";import"../core/shaderLibrary/shading/readShadow.glsl.js";import"../core/shaderLibrary/util/RgbNormalizedDepthEncoding.glsl.js";import"../core/shaderModules/Float3BindUniform.js";import"../core/shaderModules/glsl.js";import"./GaussianSplatDepthPolicy.js";import"./GaussianSplatPass.glsl.js";import"./GaussianSplatTechniqueConfiguration.js";import"../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../chunks/GaussianSplat.glsl.js";
@@ -1,7 +1,7 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{rejectBySlicePass as a}from"../core/shaderLibrary/Slice.glsl.js";import{DepthConversion as e}from"../core/shaderLibrary/output/DepthConversion.glsl.js";import{positionOutsideClipSpace as i}from"../core/shaderLibrary/shading/PositionOutsideClipSpace.js";import{inverseProjectionMatrix as n,inverseScreenSize as t,projMatrix as s,viewMatrix as r,nearFar as o}from"../core/shaderLibrary/util/cameraUniforms.js";import{GaussianSplatCovariance as c}from"../core/shaderLibrary/util/GaussianSplatCovariance.glsl.js";import{GaussianSplatEvaluation as l}from"../core/shaderLibrary/util/GaussianSplatEvaluation.glsl.js";import{GaussianSplatTextureFetch as u}from"../core/shaderLibrary/util/GaussianSplatTextureFetch.glsl.js";import{GaussianSplatUnpacking as d}from"../core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js";import{QuaternionToRotationMatrix as p}from"../core/shaderLibrary/util/QuaternionToRotationMatrix.glsl.js";import{Float2PassUniform as m}from"../core/shaderModules/Float2PassUniform.js";import{Float3PassUniform as v}from"../core/shaderModules/Float3PassUniform.js";import{FloatPassUniform as f}from"../core/shaderModules/FloatPassUniform.js";import{glsl as g,If as y}from"../core/shaderModules/glsl.js";import{Texture2DUintPassUniform as x}from"../core/shaderModules/Texture2DUintPassUniform.js";function P(e,i){const{clippingEnabled:n}=i,{fragment:m,varyings:y,vertex:P}=e;y.add("gaussianCoordinates","vec2"),y.add("gaussianLogAlphaCutoff","float"),y.add("fragmentPositionCameraRelative","vec3"),P.uniforms.add(new x("splatOrderTexture",a=>a.splatOrder),new x("splatAtlasTexture",a=>a.splatAtlas),new x("splatHeaderTexture",a=>a.splatHeader),new f("minSplatRadius",a=>a.minSplatRadius),t,s,r,o),n&&(P.uniforms.add(new v("clipMin",a=>a.clipMinCameraRelative),new v("clipMax",a=>a.clipMaxCameraRelative)),m.uniforms.add(new v("clipMin",a=>a.clipMinCameraRelative),new v("clipMax",a=>a.clipMaxCameraRelative))),P.include(d),P.include(u),P.include(p),P.include(c),P.include(l),P.include(a,i),m.include(l),m.include(a,i),m.main.add(g`
2
+ import{rejectBySlicePass as a}from"../core/shaderLibrary/Slice.glsl.js";import{DepthConversion as e}from"../core/shaderLibrary/output/DepthConversion.glsl.js";import{positionOutsideClipSpace as i}from"../core/shaderLibrary/shading/PositionOutsideClipSpace.js";import{inverseProjectionMatrix as n,inverseScreenSize as t,projMatrix as s,viewMatrix as r,nearFar as o}from"../core/shaderLibrary/util/cameraUniforms.js";import{GaussianSplatCovariance as c}from"../core/shaderLibrary/util/GaussianSplatCovariance.glsl.js";import{GaussianSplatEvaluation as l}from"../core/shaderLibrary/util/GaussianSplatEvaluation.glsl.js";import{GaussianSplatTextureFetch as u}from"../core/shaderLibrary/util/GaussianSplatTextureFetch.glsl.js";import{GaussianSplatUnpacking as d}from"../core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js";import{QuaternionToRotationMatrix as p}from"../core/shaderLibrary/util/QuaternionToRotationMatrix.glsl.js";import{Float2PassUniform as v}from"../core/shaderModules/Float2PassUniform.js";import{Float3PassUniform as m}from"../core/shaderModules/Float3PassUniform.js";import{FloatPassUniform as f}from"../core/shaderModules/FloatPassUniform.js";import{glsl as g,If as y}from"../core/shaderModules/glsl.js";import{Texture2DUintPassUniform as x}from"../core/shaderModules/Texture2DUintPassUniform.js";function P(e,i){const{clippingEnabled:n}=i,{fragment:v,varyings:y,vertex:P}=e;y.add("gaussianCoordinates","vec2"),y.add("gaussianLogAlphaCutoff","float"),y.add("fragmentPositionCameraRelative","vec3"),P.uniforms.add(new x("splatOrderTexture",a=>a.splatOrder),new x("splatAtlasTexture",a=>a.splatAtlas),new x("splatHeaderTexture",a=>a.splatHeader),new f("minSplatRadius",a=>a.minSplatRadius),t,s,r,o),n&&(P.uniforms.add(new m("clipMin",a=>a.clipMinCameraRelative),new m("clipMax",a=>a.clipMaxCameraRelative)),v.uniforms.add(new m("clipMin",a=>a.clipMinCameraRelative),new m("clipMax",a=>a.clipMaxCameraRelative))),P.include(d),P.include(u),P.include(p),P.include(c),P.include(l),P.include(a,i),v.include(l),v.include(a,i),v.main.add(g`
3
3
  ${z(i)}
4
- `)}function R(a,i){a.include(P,i),a.vertex.uniforms.add(new f("focalLength",a=>a.focalLength),new m("tanFov",a=>a.tanFov)),i.preciseDepth?(a.include(h),a.vertex.uniforms.add(n),a.fragment.include(e),a.fragment.code.add(g`float gaussianSplatDepth() {
4
+ `)}function R(a,i){a.include(P,i),a.vertex.uniforms.add(new f("focalLength",a=>a.focalLength),new v("tanFov",a=>a.tanFov)),i.preciseDepth?(a.include(h),a.vertex.uniforms.add(n),a.fragment.include(e),a.fragment.code.add(g`float gaussianSplatDepth() {
5
5
  float rayDepth = gaussianSplatRayDepth();
6
6
  return delinearizeDepth(-rayDepth);
7
7
  }`)):a.fragment.code.add(g`float gaussianSplatDepth() {
@@ -21,9 +21,9 @@ vec3 inverseGaussianScale = 1.0 / gaussianScale;
21
21
  vec3 rayGaussianFactorCenter = (gaussianRotation * cameraRelativePosition) * inverseGaussianScale;
22
22
  vec3 rayGaussianFactorRay = (gaussianRotation * (transpose(viewRotation) * rayView)) * inverseGaussianScale;
23
23
  return vec4(rayGaussianFactorRay, dot(rayGaussianFactorCenter, rayGaussianFactorRay));
24
- }`),a.fragment.code.add(g`float gaussianSplatRayDepth() {
24
+ }`);const e=g`float gaussianSplatRayDepth() {
25
25
  return rayGaussianFactor.w / dot(rayGaussianFactor.xyz, rayGaussianFactor.xyz);
26
- }`)}function S(a){a.uniforms.add(new x("splatFadingTexture",a=>a.splatFading)),a.code.add(g`float applyGaussianSplatFading(float opacity, uint gaussianIndex) {
26
+ }`;a.vertex.code.add(e),a.fragment.code.add(e)}function S(a){a.uniforms.add(new x("splatFadingTexture",a=>a.splatFading)),a.code.add(g`float applyGaussianSplatFading(float opacity, uint gaussianIndex) {
27
27
  uint pageIndex = fetchGaussianPageIndex(gaussianIndex);
28
28
  uint fadingTextureWidth = uint(textureSize(splatFadingTexture, 0).x);
29
29
  uint fadeX = pageIndex % fadingTextureWidth;
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{SliceConfiguration as i}from"../core/shaderLibrary/Slice.glsl.js";import{parameter as e}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";class o extends i{constructor(t){super(),this.spherical=t,this.alphaCutoff=1,this.fadingEnabled=!1,this.clippingEnabled=!1,this.writeNormals=!1,this.preciseDepth=!1,this.receiveShadows=!1,this.hasShadowHighlights=!1,this.output=0,this.hasEmission=!1,this.receiveAmbientOcclusion=!1,this.receiveGlobalIllumination=!1,this.pbrMode=0,this.useCustomDTRExponentForWater=!1,this.useFillLights=!1,this.draped=!1,this.hasColorTexture=!0}}function r(t){switch(t){case 2:return.005;case 0:return.05;default:return.01}}t([e({count:3})],o.prototype,"alphaCutoff",void 0),t([e()],o.prototype,"fadingEnabled",void 0),t([e()],o.prototype,"clippingEnabled",void 0),t([e()],o.prototype,"writeNormals",void 0),t([e()],o.prototype,"preciseDepth",void 0),t([e()],o.prototype,"receiveShadows",void 0),t([e()],o.prototype,"hasShadowHighlights",void 0),t([e({count:12})],o.prototype,"output",void 0),t([e()],o.prototype,"receiveAmbientOcclusion",void 0),t([e()],o.prototype,"receiveGlobalIllumination",void 0);export{o as GaussianSplatTechniqueConfiguration,r as getGaussianSplatAlphaCutoffValue};
2
+ import{__decorate as t}from"tslib";import{SliceConfiguration as i}from"../core/shaderLibrary/Slice.glsl.js";import{parameter as e}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";class o extends i{constructor(t){super(),this.spherical=t,this.alphaCutoff=1,this.fadingEnabled=!1,this.clippingEnabled=!1,this.writeNormals=!1,this.preciseDepth=!1,this.receiveShadows=!1,this.fragmentShading=!0,this.hasShadowHighlights=!1,this.output=0,this.hasEmission=!1,this.receiveAmbientOcclusion=!1,this.receiveGlobalIllumination=!1,this.pbrMode=0,this.useCustomDTRExponentForWater=!1,this.useFillLights=!1,this.draped=!1,this.hasColorTexture=!0}}function r(t){switch(t){case 2:return.005;case 0:return.05;default:return.01}}t([e({count:3})],o.prototype,"alphaCutoff",void 0),t([e()],o.prototype,"fadingEnabled",void 0),t([e()],o.prototype,"clippingEnabled",void 0),t([e()],o.prototype,"writeNormals",void 0),t([e()],o.prototype,"preciseDepth",void 0),t([e()],o.prototype,"receiveShadows",void 0),t([e()],o.prototype,"fragmentShading",void 0),t([e()],o.prototype,"hasShadowHighlights",void 0),t([e({count:12})],o.prototype,"output",void 0),t([e()],o.prototype,"receiveAmbientOcclusion",void 0),t([e()],o.prototype,"receiveGlobalIllumination",void 0);export{o as GaussianSplatTechniqueConfiguration,r as getGaussianSplatAlphaCutoffValue};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"../../support/engineContent/marker.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js";import"../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/MainLighting.glsl.js";import"../core/shaderLibrary/shading/MarkerSizing.glsl.js";import"../core/shaderLibrary/shading/NormalUtils.glsl.js";import"../core/shaderLibrary/shading/PositionOutsideClipSpace.js";import"../core/shaderLibrary/shading/readFragmentShadow.glsl.js";import"../core/shaderLibrary/util/cameraUniforms.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/NoPerspective.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/FloatBindUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Texture2DPassUniform.js";import"./alphaCutoff.glsl.js";import"./OutputColorHighlightOLID.glsl.js";import"../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../chunks/LineMarker.glsl.js";
2
+ import"../../support/engineContent/marker.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js";import"../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/MainLighting.glsl.js";import"../core/shaderLibrary/shading/MarkerSizing.glsl.js";import"../core/shaderLibrary/shading/NormalUtils.glsl.js";import"../core/shaderLibrary/shading/PositionOutsideClipSpace.js";import"../core/shaderLibrary/shading/readFragmentShadow.glsl.js";import"../core/shaderLibrary/util/cameraUniforms.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/NoPerspective.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Texture2DPassUniform.js";import"./alphaCutoff.glsl.js";import"./OutputColorHighlightOLID.glsl.js";import"../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../chunks/LineMarker.glsl.js";
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{parameter as o}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{DefaultTechniqueConfiguration as i}from"../materials/DefaultTechniqueConfiguration.js";class t extends i{constructor(e){super(),this.spherical=e,this.emissionSource=0,this.pbrMode=0,this.draped=!1,this.shadingEnabled=!1,this.worldSized=!1,this.hasScreenSizePerspective=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.hasVVOpacity=!1,this.hasOccludees=!1,this.occluder=!1,this.receiveShadows=!0,this.hasShadowHighlights=!1,this.receiveAmbientOcclusion=!0,this.receiveGlobalIllumination=!0,this.textureCoordinateType=0,this.hasVVInstancing=!1,this.hasSliceTranslatedView=!0,this.overlayEnabled=!1,this.snowCover=!1,this.renderOccluded=!1,this.useCustomDTRExponentForWater=!1,this.hasColorTexture=!1,this.useFillLights=!1}}e([o({count:8})],t.prototype,"emissionSource",void 0),e([o({count:8})],t.prototype,"pbrMode",void 0),e([o()],t.prototype,"draped",void 0),e([o()],t.prototype,"shadingEnabled",void 0),e([o()],t.prototype,"worldSized",void 0),e([o()],t.prototype,"hasScreenSizePerspective",void 0),e([o()],t.prototype,"hasVVSize",void 0),e([o()],t.prototype,"hasVVColor",void 0),e([o()],t.prototype,"hasVVOpacity",void 0),e([o()],t.prototype,"hasOccludees",void 0),e([o()],t.prototype,"occluder",void 0),e([o()],t.prototype,"receiveShadows",void 0),e([o()],t.prototype,"hasShadowHighlights",void 0),e([o()],t.prototype,"receiveAmbientOcclusion",void 0),e([o()],t.prototype,"receiveGlobalIllumination",void 0);export{t as LineTechniqueConfiguration};
2
+ import{__decorate as e}from"tslib";import{parameter as i}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{DefaultTechniqueConfiguration as o}from"../materials/DefaultTechniqueConfiguration.js";class t extends o{constructor(e){super(),this.spherical=e,this.emissionSource=0,this.pbrMode=0,this.draped=!1,this.shadingEnabled=!1,this.worldSized=!1,this.hasScreenSizePerspective=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.hasVVOpacity=!1,this.hasOccludees=!1,this.occluder=!1,this.receiveShadows=!0,this.hasShadowHighlights=!1,this.receiveAmbientOcclusion=!0,this.receiveGlobalIllumination=!0,this.textureCoordinateType=0,this.hasVVInstancing=!1,this.hasSliceTranslatedView=!0,this.overlayEnabled=!1,this.snowCover=!1,this.renderOccluded=!1,this.useCustomDTRExponentForWater=!1,this.hasColorTexture=!1,this.useFillLights=!1}get lineWidthRequiresPosition(){return this.hasScreenSizePerspective||this.worldSized&&!this.draped}}e([i({count:8})],t.prototype,"emissionSource",void 0),e([i({count:8})],t.prototype,"pbrMode",void 0),e([i()],t.prototype,"draped",void 0),e([i()],t.prototype,"shadingEnabled",void 0),e([i()],t.prototype,"worldSized",void 0),e([i()],t.prototype,"hasScreenSizePerspective",void 0),e([i()],t.prototype,"hasVVSize",void 0),e([i()],t.prototype,"hasVVColor",void 0),e([i()],t.prototype,"hasVVOpacity",void 0),e([i()],t.prototype,"hasOccludees",void 0),e([i()],t.prototype,"occluder",void 0),e([i()],t.prototype,"receiveShadows",void 0),e([i()],t.prototype,"hasShadowHighlights",void 0),e([i()],t.prototype,"receiveAmbientOcclusion",void 0),e([i()],t.prototype,"receiveGlobalIllumination",void 0);export{t as LineTechniqueConfiguration};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as o}from"tslib";import{parameter as t}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{LineTechniqueConfiguration as e}from"./LineTechniqueConfiguration.js";const i=16,p=8;class n extends e{constructor(){super(...arguments),this.capType=0,this.animation=2,this.polygonOffsetIndex=0,this.numJoinSubdivisions=1,this.polygonOffset=0,this.writeDepth=!1,this.transparent=!1,this.enableOITOffset=!0,this.stippleEnabled=!1,this.stippleOffColorEnabled=!1,this.stipplePreferContinuous=!0,this.roundJoins=!1,this.applyMarkerOffset=!1,this.falloffEnabled=!1,this.innerColorEnabled=!1,this.wireframe=!1,this.imagePattern=!1}get hasAnimation(){return 0!==this.animation}}o([t({count:3})],n.prototype,"capType",void 0),o([t({count:4})],n.prototype,"animation",void 0),o([t({count:i})],n.prototype,"polygonOffsetIndex",void 0),o([t({count:p})],n.prototype,"numJoinSubdivisions",void 0),o([t({count:5})],n.prototype,"polygonOffset",void 0),o([t()],n.prototype,"writeDepth",void 0),o([t()],n.prototype,"transparent",void 0),o([t()],n.prototype,"enableOITOffset",void 0),o([t()],n.prototype,"stippleEnabled",void 0),o([t()],n.prototype,"stippleOffColorEnabled",void 0),o([t()],n.prototype,"stipplePreferContinuous",void 0),o([t()],n.prototype,"roundJoins",void 0),o([t()],n.prototype,"applyMarkerOffset",void 0),o([t()],n.prototype,"falloffEnabled",void 0),o([t()],n.prototype,"innerColorEnabled",void 0),o([t()],n.prototype,"wireframe",void 0),o([t()],n.prototype,"imagePattern",void 0);export{p as NUM_JOIN_SUBDIVISION_COUNT,i as POLYGON_OFFSET_INDEX_COUNT,n as RibbonLineTechniqueConfiguration};
2
+ import{__decorate as t}from"tslib";import{parameter as o}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{LineTechniqueConfiguration as e}from"./LineTechniqueConfiguration.js";const i=16,p=8;class r extends e{constructor(){super(...arguments),this.capType=0,this.animation=2,this.polygonOffsetIndex=0,this.numJoinSubdivisions=1,this.polygonOffset=0,this.writeDepth=!1,this.transparent=!1,this.enableOITOffset=!0,this.stippleEnabled=!1,this.stippleOffColorEnabled=!1,this.stipplePreferContinuous=!0,this.roundJoins=!1,this.applyMarkerOffset=!1,this.falloffEnabled=!1,this.innerColorEnabled=!1,this.wireframe=!1,this.imagePattern=!1}get hasAnimation(){return 0!==this.animation}get usePerspectiveCorrectStipple(){return this.worldSized&&!this.draped}}t([o({count:3})],r.prototype,"capType",void 0),t([o({count:4})],r.prototype,"animation",void 0),t([o({count:i})],r.prototype,"polygonOffsetIndex",void 0),t([o({count:p})],r.prototype,"numJoinSubdivisions",void 0),t([o({count:5})],r.prototype,"polygonOffset",void 0),t([o()],r.prototype,"writeDepth",void 0),t([o()],r.prototype,"transparent",void 0),t([o()],r.prototype,"enableOITOffset",void 0),t([o()],r.prototype,"stippleEnabled",void 0),t([o()],r.prototype,"stippleOffColorEnabled",void 0),t([o()],r.prototype,"stipplePreferContinuous",void 0),t([o()],r.prototype,"roundJoins",void 0),t([o()],r.prototype,"applyMarkerOffset",void 0),t([o()],r.prototype,"falloffEnabled",void 0),t([o()],r.prototype,"innerColorEnabled",void 0),t([o()],r.prototype,"wireframe",void 0),t([o()],r.prototype,"imagePattern",void 0);export{p as NUM_JOIN_SUBDIVISION_COUNT,i as POLYGON_OFFSET_INDEX_COUNT,r as RibbonLineTechniqueConfiguration};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import t from"../../core/Error.js";import e from"../../core/Logger.js";import{isAborted as s,createAbortError as r,isPromiseLike as o,isAbortError as a}from"../../core/promiseUtils.js";import{signal as n}from"../../core/signal.js";import{Yield as i}from"./Yield.js";class c{constructor(){this._tasks=new Array,this._numPendingTasks=n(0),this._readyToRun=n(!1)}get length(){return this._tasks.length}get updating(){return this._numPendingTasks.value>0}get readyToRun(){return this._readyToRun.value}_updateReadyToRun(){this._readyToRun.value=this._tasks.length>0}destroy(){this.cancelAll()}runTask(t){if(0===this.length)return i;for(;!t.done&&this._process(t);)t.madeProgress()}push(t,e,s){return this._addTask((r,o)=>new p(r,o,t,e,s),Array.prototype.push)}unshift(t,e,s){return this._addTask((r,o)=>new p(r,o,t,e,s),Array.prototype.unshift)}pushGenerator(t,e,s){return this._addTask((r,o)=>new _(r,o,t,e,s),Array.prototype.push)}_process(t){if(0===this._tasks.length)return!1;const e=this._tasks.shift();this._updateReadyToRun();try{if(s(e.signal))this._cancelTask(e,r());else switch(e.type){case 0:this._processSimple(e,t);break;case 1:this._processGenerator(e,t);break;case 2:this._processIterator(e,t)}}catch(o){e.reject(o)}return!0}cancelAll(){const t=r();for(const e of this._tasks)this._cancelTask(e,t);this._tasks.length=0,this._updateReadyToRun()}_cancelTask(t,e){if(t.abortCallback){const s=t.abortCallback(e);2===t.type&&t.iterator.return&&h(t.iterator.return()),o(s)?s.then(t.resolve,t.reject):t.resolve(s)}else 2===t.type&&t.iterator.throw&&h(t.iterator.throw(e)),t.reject(e)}_onIteratorResult(t,e){e.done?t.resolve(e.value):(this._tasks.unshift(t),this._updateReadyToRun())}_processSimple(t,e){const s=t.callback(e);o(s)?s.then(t.resolve,t.reject):t.resolve(s)}_processGenerator(t,e){const s=t.generatorFunction(e),r=new d(t.resolve,t.reject,s,t.signal,t.abortCallback);this._processIterator(r,e)}_processIterator(t,e){const s=t.iterator.next(e);o(s)?s.then(e=>this._onIteratorResult(t,e),t.reject):this._onIteratorResult(t,s)}_addTask(t,e){return new Promise((s,r)=>{const o=t(s,r);e.call(this._tasks,o),++this._numPendingTasks.value,this._updateReadyToRun()}).finally(()=>--this._numPendingTasks.value)}}function h(t){o(t)?t.then(l,l):l(t)}function l(s){a(s)||s instanceof Error||s instanceof t||null!=s&&"object"==typeof s&&"done"in s&&s.done||e.getLogger("esri.layers.support.PromiseQueue").warn("Generator iterator was aborted, but it is not done.")}class u{constructor(t,e,s,r){this.resolve=t,this.reject=e,this.signal=s,this.abortCallback=r}}class p extends u{constructor(t,e,s,r,o){super(t,e,r,o),this.callback=s,this.type=0}}class _ extends u{constructor(t,e,s,r,o){super(t,e,r,o),this.generatorFunction=s,this.type=1}}class d extends u{constructor(t,e,s,r,o){super(t,e,r,o),this.iterator=s,this.type=2}}export{c as PromiseQueue};
2
+ import t from"../../core/Error.js";import e from"../../core/Logger.js";import{isAborted as s,createAbortError as r,isPromiseLike as a,isAbortError as n}from"../../core/promiseUtils.js";import{signal as i}from"../../core/signal.js";import{Yield as o}from"./Yield.js";class h{constructor(){this._tasks=new Array,this._drainBudget=null,this._numPendingTasks=i(0),this._readyToRun=i(!1)}get length(){return this._tasks.length}get updating(){return this._numPendingTasks.value>0}get readyToRun(){return this._readyToRun.value}_updateReadyToRun(){this._readyToRun.value=this._tasks.length>0}destroy(){this.cancelAll()}drain(t){this._drainBudget=t,this.runTask(t)}runTask(t){if(this._clearFinishedDrain(),0===this.length)return o;for(;!t.done&&this._process(t);)t.madeProgress();this._clearFinishedDrain()}_clearFinishedDrain(){!this._drainBudget?.done&&this.updating||(this._drainBudget=null)}push(t,e,s){return this._addTask((r,a)=>new d(r,a,t,e,s),Array.prototype.push)}unshift(t,e,s){return this._addTask((r,a)=>new d(r,a,t,e,s),Array.prototype.unshift)}pushGenerator(t,e,s){return this._addTask((r,a)=>new _(r,a,t,e,s),Array.prototype.push)}_process(t){if(0===this._tasks.length)return!1;const e=this._tasks.shift();this._updateReadyToRun();try{if(s(e.signal))this._cancelTask(e,r());else switch(e.type){case 0:this._processSimple(e,t);break;case 1:this._processGenerator(e,t);break;case 2:this._processIterator(e,t)}}catch(a){e.reject(a)}return!0}cancelAll(){const t=r();for(const e of this._tasks)this._cancelTask(e,t);this._tasks.length=0,this._updateReadyToRun()}_cancelTask(t,e){if(t.abortCallback){const s=t.abortCallback(e);2===t.type&&t.iterator.return&&c(t.iterator.return()),a(s)?s.then(t.resolve,t.reject):t.resolve(s)}else 2===t.type&&t.iterator.throw&&c(t.iterator.throw(e)),t.reject(e)}_onIteratorResult(t,e){e.done?t.resolve(e.value):(this._tasks.unshift(t),this._updateReadyToRun())}_processSimple(t,e){const s=t.callback(e);a(s)?s.then(t.resolve,t.reject):t.resolve(s)}_processGenerator(t,e){const s=t.generatorFunction(e),r=new p(t.resolve,t.reject,s,t.signal,t.abortCallback);this._processIterator(r,e)}_processIterator(t,e){const s=t.iterator.next(e);a(s)?s.then(e=>{this._onIteratorResult(t,e),this._drainBudget&&this.runTask(this._drainBudget)},t.reject):this._onIteratorResult(t,s)}_addTask(t,e){return new Promise((s,r)=>{const a=t(s,r);e.call(this._tasks,a),++this._numPendingTasks.value,this._updateReadyToRun()}).finally(()=>{--this._numPendingTasks.value,this._clearFinishedDrain()})}}function c(t){a(t)?t.then(u,u):u(t)}function u(s){n(s)||s instanceof Error||s instanceof t||null!=s&&"object"==typeof s&&"done"in s&&s.done||e.getLogger("esri.layers.support.PromiseQueue").warn("Generator iterator was aborted, but it is not done.")}class l{constructor(t,e,s,r){this.resolve=t,this.reject=e,this.signal=s,this.abortCallback=r}}class d extends l{constructor(t,e,s,r,a){super(t,e,r,a),this.callback=s,this.type=0}}class _ extends l{constructor(t,e,s,r,a){super(t,e,r,a),this.generatorFunction=s,this.type=1}}class p extends l{constructor(t,e,s,r,a){super(t,e,r,a),this.iterator=s,this.type=2}}export{h as PromiseQueue};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{removeUnordered as e,filterInPlace as t}from"../../core/arrayUtils.js";import s from"../../core/Handles.js";import"../../core/has.js";import r from"../../core/Logger.js";import{removeMaybe as i}from"../../core/maybe.js";import{recordPerformance as a}from"../../core/performance.js";import n from"../../core/PerformanceSampler.js";import{isAborted as u,createAbortError as _,when as o,isPromiseLike as h,ignoreAbortErrors as E}from"../../core/promiseUtils.js";import{watch as d,initial as T,when as c}from"../../core/reactiveUtils.js";import{signal as m}from"../../core/signal.js";import{Milliseconds as l}from"../../core/time.js";import R from"./debugFlags.js";import{PromiseQueue as g}from"./PromiseQueue.js";import{Yield as I}from"./Yield.js";function A(){return new C}const p={RESOURCE_CONTROLLER_IMMEDIATE:"immediate",RESOURCE_CONTROLLER:"schedule",SLIDE:"slide",STREAM_DATA_LOADER:"stream loader",ELEVATION_QUERY:"elevation query",TERRAIN_SURFACE:"terrain",SURFACE_GEOMETRY_UPDATES:"surface geometry updates",LOD_RENDERER:"LoD renderer",GRAPHICS_CORE:"Graphics3D",I3S:"I3S",LYR3D:"Lyr3D",TILES3D:"3DTiles",POINT_CLOUD_LAYER:"point cloud",FEATURE_TILE_FETCHER:"feature fetcher",STREAM_CONTROLLER:"stream controller",SCREEN_POLYGON_INTERSECTION:"screen polygon intersection",OCCLUSION_QUERY:"occlusion query",OVERLAY:"overlay",OVERLAY_RENDERER:"overlay renderer",STAGE:"stage",GRAPHICS_DECONFLICTOR:"graphics deconflictor",FILTER_VISIBILITY:"graphics filter visibility",SCALE_VISIBILITY:"graphics scale visibility",FRUSTUM_VISIBILITY:"graphics frustum visibility",POINT_OF_INTEREST_FREQUENT:"POI frequent",POINT_OF_INTEREST_INFREQUENT:"POI infrequent",LABELER:"labeler",FEATURE_QUERY_ENGINE:"feature query",FEATURE_TILE_TREE:"feature tile tree",FEATURE_TILE_TREE_ACTIVE:"fast feature tile tree",ELEVATION_ALIGNMENT:"elevation alignment",ELEVATION_ALIGNMENT_SCENE:"elevation alignment scene",TEXT_TEXTURE_ATLAS:"text texture atlas",TEXTURE_UNLOAD:"texture unload",LINE_OF_SIGHT_TOOL:"line of sight tool",LINE_OF_SIGHT_TOOL_INTERACTIVE:"interactive line of sight tool",VOLUME_MEASUREMENT:"volume measurement",ELEVATION_PROFILE:"elevation profile",SNAPPING:"snapping",SHADOW_ACCUMULATOR:"shadow accumulator",CLOUDS_GENERATOR:"clouds generator",FLOW_GENERATOR:"flow generator",GAUSSIAN_SPLAT_SORTING:"gaussian splat sorting",GAUSSIAN_SPLAT_TEXTURE_ATLAS:"gaussian splat texture atlas",MAPVIEW_FETCH_QUEUE:"mapview fetch queue",MAPVIEW_LAYERVIEW_UPDATE:"mapview layerview update",MAPVIEW_VECTOR_TILE_PARSING_QUEUE:"mapview vector tile parsing queue",NONE:0,TEST_PRIO:1},L=0,f=new Map([[p.RESOURCE_CONTROLLER_IMMEDIATE,L],[p.RESOURCE_CONTROLLER,4],[p.SLIDE,L],[p.STREAM_DATA_LOADER,L],[p.ELEVATION_QUERY,L],[p.TERRAIN_SURFACE,1],[p.SURFACE_GEOMETRY_UPDATES,1],[p.LOD_RENDERER,2],[p.GRAPHICS_CORE,2],[p.I3S,2],[p.LYR3D,2],[p.TILES3D,3],[p.POINT_CLOUD_LAYER,2],[p.FEATURE_TILE_FETCHER,2],[p.STREAM_CONTROLLER,2],[p.SCREEN_POLYGON_INTERSECTION,L],[p.CLOUDS_GENERATOR,2],[p.OCCLUSION_QUERY,2],[p.OVERLAY,4],[p.OVERLAY_RENDERER,4],[p.STAGE,4],[p.GRAPHICS_DECONFLICTOR,4],[p.FILTER_VISIBILITY,4],[p.SCALE_VISIBILITY,4],[p.FRUSTUM_VISIBILITY,4],[p.POINT_OF_INTEREST_FREQUENT,6],[p.POINT_OF_INTEREST_INFREQUENT,30],[p.LABELER,8],[p.FEATURE_QUERY_ENGINE,8],[p.FEATURE_TILE_TREE,16],[p.FEATURE_TILE_TREE_ACTIVE,L],[p.ELEVATION_ALIGNMENT,12],[p.ELEVATION_ALIGNMENT_SCENE,14],[p.TEXT_TEXTURE_ATLAS,12],[p.TEXTURE_UNLOAD,12],[p.LINE_OF_SIGHT_TOOL,16],[p.LINE_OF_SIGHT_TOOL_INTERACTIVE,L],[p.VOLUME_MEASUREMENT,4],[p.SNAPPING,L],[p.SHADOW_ACCUMULATOR,30],[p.FLOW_GENERATOR,12],[p.GAUSSIAN_SPLAT_SORTING,2],[p.GAUSSIAN_SPLAT_TEXTURE_ATLAS,12],[p.MAPVIEW_FETCH_QUEUE,L],[p.MAPVIEW_LAYERVIEW_UPDATE,2],[p.MAPVIEW_VECTOR_TILE_PARSING_QUEUE,L]]);function O(e){return f.has(e)?f.get(e):"number"==typeof e?e:1}const N=l(6.5),S=l(1),U=l(30),b=l(1e3/30),P=l(100),k=.9;class C{get updating(){return this._updating.value}_updatingChanged(){this._updating.value=this._tasks.some(e=>e.needsUpdate)}constructor(){this._updating=m(!0),this._microTaskQueued=!1,this._frameNumber=0,this.performanceInfo={total:new n("total"),tasks:new Map},this._frameTaskTimes=new Map,this._budget=new F,this.state=1,this._tasks=new Array,this._runQueue=new Array,this._load=0,this._forceTask=!1,this._debug=!1,this._debugHandle=d(()=>R.SCHEDULER_LOG_SLOW_TASKS,e=>this._debug=e,T);for(const e of Object.keys(p))this.performanceInfo.tasks.set(p[e],new n(String(p[e])))}destroy(){this._tasks.forEach(e=>e.remove()),this._tasks.length=0,this._runQueue.length=0,i(this._debugHandle),this._microTaskQueued=!1,this._updatingChanged()}taskRunningChanged(e){this._updatingChanged(),e&&this._budget.remaining>0&&!this._microTaskQueued&&(this._microTaskQueued=!0,queueMicrotask(()=>{this._microTaskQueued&&(this._microTaskQueued=!1,this._budget.remaining>0&&this._schedule()&&this._runFrame())}))}registerTask(e,t){const s=new y(this,e,t);return this._tasks.push(s),this._updatingChanged(),this.performanceInfo.tasks.has(e)||this.performanceInfo.tasks.set(e,new n(e)),s}get load(){return this._load}frame(e){if(this._startFrameTaskTimes(),this._updateBudget(e)){const e=this._budget.now();this._runFrame();const t=this._budget.now();this._recordFrameTaskTimes(t-e);const s=2===this.state?"Idle":1===this.state?"Interacting":"Animating";return a(`${s} Frame Tasks`,e,t,"Maps SDK","Scheduling"),!0}return this._recordFrameTaskTimes(0),!1}_updateBudget(e){this._test&&(this._test.usedBudget=0),++this._frameNumber;let t=N,s=e.frameDuration,r=S;switch(this.state){case 2:t=l(0),s=l(Math.max(P,e.frameDuration)),r=U;break;case 1:s=l(Math.max(b,e.frameDuration))}return s=l(s-e.elapsedFrameTime-t),2!==this.state&&s<S&&!this._forceTask?(this._forceTask=!0,!1):(s=l(Math.max(s,r)),this._budget.reset(s),this._updateLoad(),this._schedule())}_runFrame(){this._forceTask=!1,this._microTaskQueued=!1,this._run(),this._test&&(this._test.usedBudget=this._budget.elapsed)}stopFrame(){this._budget.reset(l(0)),this._budget.madeProgress()}removeTask(t){e(this._tasks,t),e(this._runQueue,t),this._updatingChanged()}_updateTask(e){this._tasks.forEach(t=>{t.name===e&&t.setPriority(e)})}_getState(e){if(this._runQueue.some(t=>t.name===e))return"s";let t="i";return this._tasks.forEach(s=>{s.name===e&&s.needsUpdate&&(s.schedulePriority<=1?t="r":"r"!==t&&(t="w"))}),t}_getRuntime(e){let t=0;return this._tasks.forEach(s=>{s.name===e&&(t+=s.runtime)}),t}_resetRuntimes(){this._tasks.forEach(e=>e.runtime=0)}_getRunning(){const e=new Map;if(this._tasks.forEach(t=>{t.needsUpdate&&e.set(t.name,(e.get(t.name)||0)+1)}),0===e.size)return null;let t="";return e.forEach((e,s)=>{t+=e>1?` ${e}x ${s}`:` ${s}`}),t}_updateLoad(){const e=this._tasks.reduce((e,t)=>t.needsUpdate?++e:e,0);this._load=this._load*k+e*(1-k)}_schedule(){for(t(this._runQueue,e=>!!e.needsUpdate||(e.schedulePriority=e.basePriority,!1)),this._tasks.forEach(e=>{e.basePriority===L&&e.needsUpdate&&!this._runQueue.includes(e)&&e.blockFrame!==this._frameNumber&&this._runQueue.unshift(e)});0===this._runQueue.length;){let e=!1,t=0;if(this._tasks.forEach(s=>{if(s.needsUpdate&&0!==s.schedulePriority&&s.basePriority!==L&&s.blockFrame!==this._frameNumber)if(e=!0,t=Math.max(t,s.basePriority),1===s.schedulePriority)s.schedulePriority=0,this._runQueue.push(s);else--s.schedulePriority}),!e)return this._updatingChanged(),!1}return this._updatingChanged(),!0}_run(){do{for(;this._runQueue.length>0;){const t=this._budget.now(),s=this._runQueue.pop();this._budget.resetProgress();try{s.task.runTask(this._budget)===I&&(s.blockFrame=this._frameNumber)}catch(e){r.getLogger("esri.views.support.Scheduler").error(`Exception in task "${s.name}"`,e),s.blockFrame=this._frameNumber}!this._budget.hasProgressed&&s.blockFrame!==this._frameNumber&&s.needsUpdate&&(s.name,p.I3S,s.blockFrame=this._frameNumber),s.schedulePriority=s.basePriority;const i=this._budget.now(),n=i-t;if(a(`${s.name}`,t,i,"Maps SDK","Scheduling"),s.runtime+=n,this._frameTaskTimes.set(s.priority,this._frameTaskTimes.get(s.priority)+n),this._budget.remaining<=0)return void this._updatingChanged()}}while(this._schedule());this._updatingChanged()}_startFrameTaskTimes(){for(const e of Object.keys(p))this._frameTaskTimes.set(p[e],0)}_recordFrameTaskTimes(e){this._frameTaskTimes.forEach((e,t)=>this.performanceInfo.tasks.get(t).push(e)),this.performanceInfo.total.push(e)}get test(){return this._test}}class y{get task(){return this._task.value}get readyToRun(){return this._queue.readyToRun}get updating(){return this._queue.updating}constructor(e,t,r){this._scheduler=e,this.name=t,this.blockFrame=0,this.runtime=0,this._queue=new g,this._handles=new s,this._basePriority=O(t),this.schedulePriority=this._basePriority,this._task=m(null!=r?r:this._queue),this._handles.add(c(()=>this.task.readyToRun,t=>e.taskRunningChanged(t)))}remove(){this.processQueue(w),this._scheduler.removeTask(this),this.schedule=G.schedule,this.reschedule=G.reschedule,this.scheduleGenerator=G.scheduleGenerator,this._handles.destroy()}[Symbol.dispose](){this.remove()}get basePriority(){return this._basePriority}setPriority(e){if(this.name===e)return;this.name=e;const t=O(e);this._basePriority!==L&&0===this.schedulePriority||(this.schedulePriority=t),this._basePriority=t}get priority(){return this.name}set priority(e){this.setPriority(e)}get needsUpdate(){return this.readyToRun||!this.task.destroyed&&this.task.readyToRun}schedule(e,t,s){return this._queue.push(e,t,s)}reschedule(e,t,s){return this._queue.unshift(e,t,s)}scheduleGenerator(e,t,s){return this._queue.pushGenerator(e,t,s)}processQueue(e){return this._queue.runTask(e)}}class F{constructor(){this._begin=performance?.now()??0,this._budget=0,this._done=!1,this._progressed=!1,this._enabled=!0}run(e){return!this.done&&(!0===e()&&this.madeProgress(),!0)}get done(){return this._done}get budget(){return this._budget}madeProgress(){return this._progressed=!0,this._done=this.elapsed>=this._budget&&this._enabled,this._done}get enabled(){return this._enabled}set enabled(e){this._enabled=e}reset(e){this._begin=this.now(),this._budget=e,this.resetProgress()}get remaining(){return Math.max(this._budget-this.elapsed,0)}now(){return performance.now()}get elapsed(){return this.now()-this._begin}resetProgress(){this._progressed=!1,this._done=!1}get hasProgressed(){return this._progressed}}const w=new F;function D(e){const t=new F;return t.reset(e),t}w.enabled=!1;class M{remove(){}[Symbol.dispose](){this.remove()}processQueue(){}schedule(e,t,s){try{if(u(t)){const e=_();return s?Promise.resolve(s(e)):Promise.reject(e)}return o(e(w))}catch(r){return Promise.reject(r)}}reschedule(e,t,s){return this.schedule(e,t,s)}async scheduleGenerator(e,t,s){if(u(t)){const e=_();if(s)return s(e);throw e}const r=e(w);for(;;){const e=r.next(w),i=h(e)?await e:e;if(u(t)){const e=_();if(s){const t=s(e),i=r.return(null);return h(i)&&await E(i),t}const t=r.throw(e);throw h(t)&&await E(t),e}if(i.done)return i.value}}}const G=new M;export{G as ImmediateTask,p as TaskPriority,O as getTaskPriority,D as makeBudget,A as newScheduler,w as noBudget,f as taskPriorities};
2
+ import{removeUnordered as e,filterInPlace as t}from"../../core/arrayUtils.js";import s from"../../core/Handles.js";import"../../core/has.js";import r from"../../core/Logger.js";import{removeMaybe as i}from"../../core/maybe.js";import{recordPerformance as a}from"../../core/performance.js";import n from"../../core/PerformanceSampler.js";import{isAborted as u,createAbortError as _,when as o,isPromiseLike as h,ignoreAbortErrors as E}from"../../core/promiseUtils.js";import{watch as d,initial as T,when as m}from"../../core/reactiveUtils.js";import{signal as c}from"../../core/signal.js";import{Milliseconds as l}from"../../core/time.js";import R from"./debugFlags.js";import{PromiseQueue as g}from"./PromiseQueue.js";import{Yield as I}from"./Yield.js";function A(){return new C}const p={RESOURCE_CONTROLLER_IMMEDIATE:"immediate",RESOURCE_CONTROLLER:"schedule",SLIDE:"slide",STREAM_DATA_LOADER:"stream loader",ELEVATION_QUERY:"elevation query",TERRAIN_SURFACE:"terrain",SURFACE_GEOMETRY_UPDATES:"surface geometry updates",LOD_RENDERER:"LoD renderer",GRAPHICS_CORE:"Graphics3D",I3S:"I3S",LYR3D:"Lyr3D",TILES3D:"3DTiles",POINT_CLOUD_LAYER:"point cloud",FEATURE_TILE_FETCHER:"feature fetcher",STREAM_CONTROLLER:"stream controller",SCREEN_POLYGON_INTERSECTION:"screen polygon intersection",OCCLUSION_QUERY:"occlusion query",OVERLAY:"overlay",OVERLAY_RENDERER:"overlay renderer",STAGE:"stage",GRAPHICS_DECONFLICTOR:"graphics deconflictor",FILTER_VISIBILITY:"graphics filter visibility",SCALE_VISIBILITY:"graphics scale visibility",FRUSTUM_VISIBILITY:"graphics frustum visibility",POINT_OF_INTEREST_FREQUENT:"POI frequent",POINT_OF_INTEREST_INFREQUENT:"POI infrequent",LABELER:"labeler",FEATURE_QUERY_ENGINE:"feature query",FEATURE_TILE_TREE:"feature tile tree",FEATURE_TILE_TREE_ACTIVE:"fast feature tile tree",ELEVATION_ALIGNMENT:"elevation alignment",ELEVATION_ALIGNMENT_SCENE:"elevation alignment scene",TEXT_TEXTURE_ATLAS:"text texture atlas",TEXTURE_UNLOAD:"texture unload",LINE_OF_SIGHT_TOOL:"line of sight tool",LINE_OF_SIGHT_TOOL_INTERACTIVE:"interactive line of sight tool",VOLUME_MEASUREMENT:"volume measurement",ELEVATION_PROFILE:"elevation profile",SNAPPING:"snapping",SHADOW_ACCUMULATOR:"shadow accumulator",CLOUDS_GENERATOR:"clouds generator",FLOW_GENERATOR:"flow generator",GAUSSIAN_SPLAT_SORTING:"gaussian splat sorting",GAUSSIAN_SPLAT_TEXTURE_ATLAS:"gaussian splat texture atlas",MAPVIEW_FETCH_QUEUE:"mapview fetch queue",MAPVIEW_LAYERVIEW_UPDATE:"mapview layerview update",MAPVIEW_VECTOR_TILE_PARSING_QUEUE:"mapview vector tile parsing queue",NONE:0,TEST_PRIO:1},L=0,f=new Map([[p.RESOURCE_CONTROLLER_IMMEDIATE,L],[p.RESOURCE_CONTROLLER,4],[p.SLIDE,L],[p.STREAM_DATA_LOADER,L],[p.ELEVATION_QUERY,L],[p.TERRAIN_SURFACE,1],[p.SURFACE_GEOMETRY_UPDATES,1],[p.LOD_RENDERER,2],[p.GRAPHICS_CORE,2],[p.I3S,2],[p.LYR3D,2],[p.TILES3D,3],[p.POINT_CLOUD_LAYER,2],[p.FEATURE_TILE_FETCHER,2],[p.STREAM_CONTROLLER,2],[p.SCREEN_POLYGON_INTERSECTION,L],[p.CLOUDS_GENERATOR,2],[p.OCCLUSION_QUERY,2],[p.OVERLAY,4],[p.OVERLAY_RENDERER,4],[p.STAGE,4],[p.GRAPHICS_DECONFLICTOR,4],[p.FILTER_VISIBILITY,4],[p.SCALE_VISIBILITY,4],[p.FRUSTUM_VISIBILITY,4],[p.POINT_OF_INTEREST_FREQUENT,6],[p.POINT_OF_INTEREST_INFREQUENT,30],[p.LABELER,8],[p.FEATURE_QUERY_ENGINE,8],[p.FEATURE_TILE_TREE,16],[p.FEATURE_TILE_TREE_ACTIVE,L],[p.ELEVATION_ALIGNMENT,12],[p.ELEVATION_ALIGNMENT_SCENE,14],[p.TEXT_TEXTURE_ATLAS,12],[p.TEXTURE_UNLOAD,12],[p.LINE_OF_SIGHT_TOOL,16],[p.LINE_OF_SIGHT_TOOL_INTERACTIVE,L],[p.VOLUME_MEASUREMENT,4],[p.SNAPPING,L],[p.SHADOW_ACCUMULATOR,30],[p.FLOW_GENERATOR,12],[p.GAUSSIAN_SPLAT_SORTING,2],[p.GAUSSIAN_SPLAT_TEXTURE_ATLAS,12],[p.MAPVIEW_FETCH_QUEUE,L],[p.MAPVIEW_LAYERVIEW_UPDATE,2],[p.MAPVIEW_VECTOR_TILE_PARSING_QUEUE,L]]);function O(e){return f.has(e)?f.get(e):"number"==typeof e?e:1}const N=l(6.5),S=l(1),U=l(30),b=l(1e3/30),P=l(100),k=.9;class C{get updating(){return this._updating.value}_updatingChanged(){this._updating.value=this._tasks.some(e=>e.needsUpdate)}constructor(){this._updating=c(!0),this._microTaskQueued=!1,this._frameNumber=0,this.performanceInfo={total:new n("total"),tasks:new Map},this._frameTaskTimes=new Map,this._budget=new F,this.state=1,this._tasks=new Array,this._runQueue=new Array,this._load=0,this._forceTask=!1,this._debug=!1,this._debugHandle=d(()=>R.SCHEDULER_LOG_SLOW_TASKS,e=>this._debug=e,T);for(const e of Object.keys(p))this.performanceInfo.tasks.set(p[e],new n(String(p[e])))}destroy(){this._tasks.forEach(e=>e.remove()),this._tasks.length=0,this._runQueue.length=0,i(this._debugHandle),this._microTaskQueued=!1,this._updatingChanged()}taskRunningChanged(e){this._updatingChanged(),e&&this._budget.remaining>0&&!this._microTaskQueued&&(this._microTaskQueued=!0,queueMicrotask(()=>{this._microTaskQueued&&(this._microTaskQueued=!1,this._budget.remaining>0&&this._schedule()&&this._runFrame())}))}registerTask(e,t){const s=new y(this,e,t);return this._tasks.push(s),this._updatingChanged(),this.performanceInfo.tasks.has(e)||this.performanceInfo.tasks.set(e,new n(e)),s}get load(){return this._load}frame(e){if(this._startFrameTaskTimes(),this._updateBudget(e)){const e=this._budget.now();this._runFrame();const t=this._budget.now();this._recordFrameTaskTimes(t-e);const s=2===this.state?"Idle":1===this.state?"Interacting":"Animating";return a(`${s} Frame Tasks`,e,t,"Maps SDK","Scheduling"),!0}return this._recordFrameTaskTimes(0),!1}_updateBudget(e){this._test&&(this._test.usedBudget=0),++this._frameNumber;let t=N,s=e.frameDuration,r=S;switch(this.state){case 2:t=l(0),s=l(Math.max(P,e.frameDuration)),r=U;break;case 1:s=l(Math.max(b,e.frameDuration))}return s=l(s-e.elapsedFrameTime-t),2!==this.state&&s<S&&!this._forceTask?(this._forceTask=!0,!1):(s=l(Math.max(s,r)),this._budget.reset(s),this._updateLoad(),this._schedule())}_runFrame(){this._forceTask=!1,this._microTaskQueued=!1,this._run(),this._test&&(this._test.usedBudget=this._budget.elapsed)}stopFrame(){this._budget.reset(l(0)),this._budget.madeProgress()}removeTask(t){e(this._tasks,t),e(this._runQueue,t),this._updatingChanged()}_updateTask(e){this._tasks.forEach(t=>{t.name===e&&t.setPriority(e)})}_getState(e){if(this._runQueue.some(t=>t.name===e))return"s";let t="i";return this._tasks.forEach(s=>{s.name===e&&s.needsUpdate&&(s.schedulePriority<=1?t="r":"r"!==t&&(t="w"))}),t}_getRuntime(e){let t=0;return this._tasks.forEach(s=>{s.name===e&&(t+=s.runtime)}),t}_resetRuntimes(){this._tasks.forEach(e=>e.runtime=0)}_getRunning(){const e=new Map;if(this._tasks.forEach(t=>{t.needsUpdate&&e.set(t.name,(e.get(t.name)||0)+1)}),0===e.size)return null;let t="";return e.forEach((e,s)=>{t+=e>1?` ${e}x ${s}`:` ${s}`}),t}_updateLoad(){const e=this._tasks.reduce((e,t)=>t.needsUpdate?++e:e,0);this._load=this._load*k+e*(1-k)}_schedule(){for(t(this._runQueue,e=>!!e.needsUpdate||(e.schedulePriority=e.basePriority,!1)),this._tasks.forEach(e=>{e.basePriority===L&&e.needsUpdate&&!this._runQueue.includes(e)&&e.blockFrame!==this._frameNumber&&this._runQueue.unshift(e)});0===this._runQueue.length;){let e=!1,t=0;if(this._tasks.forEach(s=>{if(s.needsUpdate&&0!==s.schedulePriority&&s.basePriority!==L&&s.blockFrame!==this._frameNumber)if(e=!0,t=Math.max(t,s.basePriority),1===s.schedulePriority)s.schedulePriority=0,this._runQueue.push(s);else--s.schedulePriority}),!e)return this._updatingChanged(),!1}return this._updatingChanged(),!0}_run(){do{for(;this._runQueue.length>0;){const t=this._budget.now(),s=this._runQueue.pop();this._budget.resetProgress();try{s.task.runTask(this._budget)===I&&(s.blockFrame=this._frameNumber)}catch(e){r.getLogger("esri.views.support.Scheduler").error(`Exception in task "${s.name}"`,e),s.blockFrame=this._frameNumber}!this._budget.hasProgressed&&s.blockFrame!==this._frameNumber&&s.needsUpdate&&(s.name,p.I3S,s.blockFrame=this._frameNumber),s.schedulePriority=s.basePriority;const i=this._budget.now(),n=i-t;if(a(`${s.name}`,t,i,"Maps SDK","Scheduling"),s.runtime+=n,this._frameTaskTimes.set(s.priority,this._frameTaskTimes.get(s.priority)+n),this._budget.remaining<=0)return void this._updatingChanged()}}while(this._schedule());this._updatingChanged()}_startFrameTaskTimes(){for(const e of Object.keys(p))this._frameTaskTimes.set(p[e],0)}_recordFrameTaskTimes(e){this._frameTaskTimes.forEach((e,t)=>this.performanceInfo.tasks.get(t).push(e)),this.performanceInfo.total.push(e)}get test(){return this._test}}class y{get task(){return this._task.value}get readyToRun(){return this._queue.readyToRun}get updating(){return this._queue.updating}constructor(e,t,r){this._scheduler=e,this.name=t,this.blockFrame=0,this.runtime=0,this._queue=new g,this._handles=new s,this._basePriority=O(t),this.schedulePriority=this._basePriority,this._task=c(null!=r?r:this._queue),this._handles.add(m(()=>this.task.readyToRun,t=>e.taskRunningChanged(t)))}remove(){this._queue.drain(w),this._scheduler.removeTask(this),this.schedule=G.schedule,this.reschedule=G.reschedule,this.scheduleGenerator=G.scheduleGenerator,this._handles.destroy()}[Symbol.dispose](){this.remove()}get basePriority(){return this._basePriority}setPriority(e){if(this.name===e)return;this.name=e;const t=O(e);this._basePriority!==L&&0===this.schedulePriority||(this.schedulePriority=t),this._basePriority=t}get priority(){return this.name}set priority(e){this.setPriority(e)}get needsUpdate(){return this.readyToRun||!this.task.destroyed&&this.task.readyToRun}schedule(e,t,s){return this._queue.push(e,t,s)}reschedule(e,t,s){return this._queue.unshift(e,t,s)}scheduleGenerator(e,t,s){return this._queue.pushGenerator(e,t,s)}processQueue(e){return this._queue.runTask(e)}}class F{constructor(){this._begin=performance?.now()??0,this._budget=0,this._done=!1,this._progressed=!1,this._enabled=!0}run(e){return!this.done&&(!0===e()&&this.madeProgress(),!0)}get done(){return this._done}get budget(){return this._budget}madeProgress(){return this._progressed=!0,this._done=this.elapsed>=this._budget&&this._enabled,this._done}get enabled(){return this._enabled}set enabled(e){this._enabled=e}reset(e){this._begin=this.now(),this._budget=e,this.resetProgress()}get remaining(){return Math.max(this._budget-this.elapsed,0)}now(){return performance.now()}get elapsed(){return this.now()-this._begin}resetProgress(){this._progressed=!1,this._done=!1}get hasProgressed(){return this._progressed}}const w=new F;function D(e){const t=new F;return t.reset(e),t}w.enabled=!1;class M{remove(){}[Symbol.dispose](){this.remove()}processQueue(){}schedule(e,t,s){try{if(u(t)){const e=_();return s?Promise.resolve(s(e)):Promise.reject(e)}return o(e(w))}catch(r){return Promise.reject(r)}}reschedule(e,t,s){return this.schedule(e,t,s)}async scheduleGenerator(e,t,s){if(u(t)){const e=_();if(s)return s(e);throw e}const r=e(w);for(;;){const e=r.next(w),i=h(e)?await e:e;if(u(t)){const e=_();if(s){const t=s(e),i=r.return(null);return h(i)&&await E(i),t}const t=r.throw(e);throw h(t)&&await E(t),e}if(i.done)return i.value}}}const G=new M;export{G as ImmediateTask,p as TaskPriority,O as getTaskPriority,D as makeBudget,A as newScheduler,w as noBudget,f as taskPriorities};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../core/Error.js";import{getOrCreateMapValue as t}from"../../core/MapUtils.js";class s{constructor(e,t,s){this.changes=new Map,this.isOpen=!0,this.priorInvalidFeatures=new Set,this.viewModel=e,this.originActor=t,this.originField=s,this.priorInvalidFeatures=new Set(e.invalidFeatures)}get hasChanges(){return this.changes.size>0}changesForFeature(e){return this.changes.get(e)}async close(){if(this._assertIsOpen(),this.isOpen=!1,0!==this.changes.size){"single"!==this.viewModel.mode&&1!==this.viewModel.features.length||this.viewModel.validateContingentValues(this.changes.keys(),!0),this._reconcileValidityTracking(),this.viewModel.emit("values-change",this._makeEventPayload());for(const e of this._makeDeprecatedEventPayloads())this.viewModel.emit("value-change",e)}}setValue(e,s,i){if(this._assertIsOpen(),e.getAttribute(s)===i)return;e.setAttribute(s,i);t(this.changes,e,()=>new Map).set(s,i)}_assertIsOpen(){if(!this.isOpen)throw new e("batch-attribute-form:transaction-closed","Operation cannot be performed on a closed transaction.")}_makeEventPayload(){return{data:Array.from(this.changes.entries()).map(([e,t])=>({feature:e.source,changes:Array.from(t.entries()).map(([e,t])=>({fieldName:e,value:t}))})),fieldName:this.originField,name:"values-change",source:this.originActor}}_makeDeprecatedEventPayloads(){const e=this.originField;if(!e)return[];const s=new Map;for(const i of this.changes.keys()){t(s,i.getAttribute(e),()=>[]).push(i.source)}return Array.from(s.entries()).map(([t,s])=>({features:s,fieldName:e,name:"value-change",value:t}))}_reconcileValidityTracking(){if("expression"===this.originActor)return;const e=new Set(this.viewModel.invalidFeatures);for(const t of this.changes.keys()){const s=t.source,i=this.priorInvalidFeatures.has(s),a=e.has(s);i!==a&&(t.userChangesHaveMadeInvalid=a)}}}export{s as ValueChangeTransaction};
2
+ import e from"../../core/Error.js";import{getOrCreateMapValue as t}from"../../core/MapUtils.js";class s{constructor(e,t,s){this.changes=new Map,this.currentCheckpoint=0,this.isOpen=!0,this.priorInvalidFeatures=new Set,this.viewModel=e,this.originActor=t,this.originField=s,this.priorInvalidFeatures=new Set(e.invalidFeatures)}get hasChanges(){return this.changes.size>0}changesForFeature(e){return this.changes.get(e)}async close(){if(this._assertIsOpen(),this.isOpen=!1,0!==this.changes.size){"single"!==this.viewModel.mode&&1!==this.viewModel.features.length||this.viewModel.validateContingentValues(this.changes.keys(),!0),this._reconcileValidityTracking(),this.viewModel.emit("values-change",this._makeEventPayload());for(const e of this._makeDeprecatedEventPayloads())this.viewModel.emit("value-change",e)}}setValue(e,s,i){if(this._assertIsOpen(),e.getAttribute(s)===i)return;e.setAttribute(s,i);t(this.changes,e,()=>new Map).set(s,++this.currentCheckpoint)}_assertIsOpen(){if(!this.isOpen)throw new e("batch-attribute-form:transaction-closed","Operation cannot be performed on a closed transaction.")}_makeEventPayload(){return{data:Array.from(this.changes.entries()).map(([e,t])=>({feature:e.source,changes:Array.from(t.entries()).map(([t])=>({fieldName:t,value:e.getAttribute(t)}))})),fieldName:this.originField,name:"values-change",source:this.originActor}}_makeDeprecatedEventPayloads(){const e=this.originField;if(!e)return[];const s=new Map;for(const i of this.changes.keys()){t(s,i.getAttribute(e),()=>[]).push(i.source)}return Array.from(s.entries()).map(([t,s])=>({features:s,fieldName:e,name:"value-change",value:t}))}_reconcileValidityTracking(){if("expression"===this.originActor)return;const e=new Set(this.viewModel.invalidFeatures);for(const t of this.changes.keys()){const s=t.source,i=this.priorInvalidFeatures.has(s),r=e.has(s);i!==r&&(t.userChangesHaveMadeInvalid=r)}}}export{s as ValueChangeTransaction};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import s from"../../../core/Error.js";import r from"../../../core/Logger.js";import{getOrCreateMapValue as o}from"../../../core/MapUtils.js";import{whenOrAbort as n,settleWithPromise as a}from"../../../core/promiseUtils.js";import i from"../../../core/ReactiveMap.js";import{addMany as l}from"../../../core/SetUtils.js";import{property as c,subclass as u}from"../../../core/accessorSupport/decorators.js";import{makeArcadeContext as p,castArcadeValue as d}from"./expressionUtils.js";import{makeUseId as f}from"../inputs/support/inputUtils.js";import{isFieldElementTemplate as h,isGroupElementTemplate as m}from"../templates/support/templateUtils.js";let x=null;const v=()=>r.getLogger("esri.widgets.BatchAttributeForm.expressions.ExpressionsManager");let g=class extends t{constructor(e){super(e),this.calculating=!1,this.arcadeContext=null,this._abortController=new AbortController,this.layerExpressionsModelMap=new Map,this.evaluatedExpressions=new i,this.expressionEvaluationFailed=!1}destroy(){this.abort()}abort(){this._abortController.abort()}async runAllExpressions(e,t){return this._evaluateSpecifiedComponentsForEachFeature(e,b,t)}async runGeometryDependentExpressions(e,t){return this._evaluateSpecifiedComponentsForEachFeature(e,y,t)}async runOriginalFeatureDependentExpressions(e,t){return this._evaluateSpecifiedComponentsForEachFeature([e],C,t)}async runExpressionsDependentOnChangedFields(e){try{this.calculating=!0;const t=Array.from(e.changes).map(([t,s])=>this.runExpressionsDependentOnChangedFieldsForFeature([...s.keys()],t,e));_(await Promise.allSettled(t))}catch(t){v().error(t),this.expressionEvaluationFailed=!0}finally{this.calculating=!1}}async runExpressionsDependentOnChangedFieldsForFeature(e,t,s){if(this._abortController.signal.aborted)return;const r=this.layerExpressionsModelMap.get(t.layer);if(!r||0===r.components.length)return;const o=w(r,e);0!==o.length&&await this.evaluateAffectedComponents([...o],t,r,s)}async evaluateAffectedComponents(e,t,s,r){const a=new Map;for(const n of e){o(a,n,()=>this.createSccEvaluator({scc:n,feature:t,evaluatorMap:a,expressionModel:s,isRoot:!0})).isRoot=!0}if(0===a.size)return;const l=[...a.values()],c={transaction:r,previousOutcomes:new i},u=l.map(e=>e.evaluate(c));_(await n(Promise.allSettled(u),this._abortController))}createSccEvaluator({scc:e,feature:t,evaluatorMap:s,expressionModel:r,isRoot:n}){const a=new E(e,t,this.arcadeContext,r,this.evaluatedExpressions,n,this._abortController);for(const i of e.adjacencyList){o(s,i,()=>this.createSccEvaluator({scc:i,feature:t,evaluatorMap:s,expressionModel:r,isRoot:!1})).dependencies.push(a)}return a}async _evaluateSpecifiedComponentsForEachFeature(e,t,s){this.calculating=!0;try{const r=[];for(const o of e){const e=this.layerExpressionsModelMap.get(o.layer);e&&0!==e.components.length&&r.push(this.evaluateAffectedComponents(t(e),o,e,s))}_(await n(Promise.allSettled(r),this._abortController))}catch(r){v().error(r),this.expressionEvaluationFailed=!0}finally{this.calculating=!1}}};e([c()],g.prototype,"calculating",void 0),e([c({constructOnly:!0})],g.prototype,"arcadeContext",void 0),e([c()],g.prototype,"_abortController",void 0),e([c()],g.prototype,"layerExpressionsModelMap",void 0),e([c()],g.prototype,"evaluatedExpressions",void 0),e([c()],g.prototype,"expressionEvaluationFailed",void 0),g=e([u("esri.widgets.BatchAttributeForm.expressions.ExpressionsManager")],g);class E{constructor(e,t,s,r,o,n,a){this.scc=e,this.feature=t,this.arcadeContextInfo=s,this.expressionsModel=r,this.evaluatedExpressions=o,this.isRoot=n,this._abortController=a,this._resolver=null,this.dependencies=[]}get baseContext(){return p(this.arcadeContextInfo,this.feature,this._abortController.signal)}evaluate(e){return this._resolver||(this._resolver=Promise.withResolvers(),a(this._resolver,this._evaluate(e))),this._resolver.promise}async _evaluate(e){null===x&&(x=await(import("../../../arcade/languageUtils.js")));const t=[],r=this.dependencies.map(t=>t.evaluate(e));if(_(await n(Promise.allSettled(r),this._abortController)),this._shouldEvaluate(e.transaction)){for(const r of this.scc.executors){const n=this.baseContext;if(this._abortController.signal.aborted)break;const c=this.expressionsModel.arcadeExecutorUses.get(r)??[],u=o(this.evaluatedExpressions,this.feature,()=>new i);let p=null,h=null;try{p=r.isAsync?await r.executeAsync(n.variables,n.executeContext):r.execute(n.variables,n.executeContext),h={result:p,status:"success"}}catch(a){h={error:a,status:"error"}}const{transaction:m,previousOutcomes:g}=e;for(const t of c){const s=f(t),r=u.get(s);r&&g.set(s,r),u.set(f(t),h);const o=this.expressionsModel.elementTemplateMap.get(t.elementId);switch(t.executorPurpose){case"editableExpression":if(!1===h.result&&!1!==r?.result){const e=u.get(f({elementId:o.elementId,executorPurpose:"valueExpression"}));if(e){const{fieldName:t}=o,s=F(this.feature,t),r=d(e.result,s,this.arcadeContextInfo.timeZone,x);m.setValue(this.feature,t,r)}}break;case"valueExpression":{if("error"===h?.status)continue;const e=o.getExpressionExecutorsForLayer(this.feature.layer);let t=!0;if(e?.editableExpression&&(t=!1===u.get(f({elementId:o.elementId,executorPurpose:"editableExpression"}))?.result),t){const e=o.fieldName,t=this.feature.getAttribute(e)??null;try{const s=F(this.feature,e),r=d(h.result,s,this.arcadeContextInfo.timeZone,x);r!==t&&m.setValue(this.feature,e,r)}catch(l){v().error(`Failed to set calculated value for field '${e}'`,l)}}}break;case"visibilityExpression":this.expressionsModel.preserveFieldValuesWhenHidden||!0!==r?.result||!1!==h.result||"user"!==m.originActor||A(o,this.feature,u,e)}}if("error"===h?.status){const e=new Set;for(const t of c){const s=this.expressionsModel.elementTemplateMap.get(t.elementId);if(s)switch(t.executorPurpose){case"editableExpression":e.add(s.label+" - Editable expression");break;case"requiredExpression":e.add(s.label+" - Required expression");break;case"valueExpression":e.add(s.label+" - Value expression");break;case"visibilityExpression":e.add(s.label+" - Visibility expression")}}t.push(e.size>0?new s("expression-evaluation-failed","Arcade evaluation failed ("+[...e].join(",")+")"):new s("expression-evaluation-failed","Arcade evaluation failed "))}}if(t.length>0)throw M(t)}}_shouldEvaluate(e){if(this._abortController.signal.aborted)return!1;if(this.isRoot)return!0;const t=e.changesForFeature(this.feature);return!(!t||0===t.size)&&this.scc.fieldsReferenced.values().some(e=>t.has(e))}}function b(e){return e.components}function y(e){return Array.from(e.geometryReferences)}function C(e){return Array.from(e.originalFeatureReferences)}function F(e,t){const r=e.layer.fieldsIndex.get(t);if(!r)throw new s("field-not-found",`Field '${t}' not found on layer.`);return r}function w(e,t){const s=new Set;for(const r of t)l(s,e.fieldReferencesMap.get(r));return Array.from(s)}function M(e){return new AggregateError(e,`One or more expression executions failed. First error message: ${e[0].message}`)}function _(e){const t=[],s=new Set;for(const r of e){if("fulfilled"===r.status)continue;const e=r.reason instanceof AggregateError?r.reason.errors:[r.reason];for(const r of e)s.has(r)||(s.add(r),t.push(r))}if(t.length>0)throw M(t)}function A(e,t,s,r){h(e)?S(e,t,s,r):m(e)&&j(e,t,s,r)}function S(e,t,s,r){const{group:o}=e;o&&!R(o,s,r.previousOutcomes)||I(t,e,r)}function j(e,t,s,r){for(const o of e.elements)h(o)&&R(o,s,r.previousOutcomes)&&I(t,o,r)}function I(e,{fieldName:t},s){s.transaction.setValue(e,t,null)}function R(e,t,s){const r=f({elementId:e.elementId,executorPurpose:"visibilityExpression"}),o=s.get(r)??t.get(r);return!o||!!o.result}export{g as ExpressionsManager};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import o from"../../../core/Error.js";import r from"../../../core/Logger.js";import{getOrCreateMapValue as s}from"../../../core/MapUtils.js";import{whenOrAbort as n,settleWithPromise as a}from"../../../core/promiseUtils.js";import i from"../../../core/ReactiveMap.js";import{addMany as c,first as l}from"../../../core/SetUtils.js";import{property as u,subclass as p}from"../../../core/accessorSupport/decorators.js";import{makeArcadeContext as d,castArcadeValue as f}from"./expressionUtils.js";import{makeUseId as h}from"../inputs/support/inputUtils.js";import{isFieldElementTemplate as x,isGroupElementTemplate as m}from"../templates/support/templateUtils.js";let v=null;const g=()=>r.getLogger("esri.widgets.BatchAttributeForm.expressions.ExpressionsManager"),E=3;let y=class extends t{constructor(e){super(e),this.calculating=!1,this.arcadeContext=null,this._abortController=new AbortController,this.layerExpressionsModelMap=new Map,this.outcomes=new i,this.expressionEvaluationFailed=!1}destroy(){this.abort()}abort(){this._abortController.abort()}async runAllExpressions(e,t){return this._evaluateSpecifiedExecutorsForEachFeature(e,_,t)}async runGeometryDependentExpressions(e,t){return this._evaluateSpecifiedExecutorsForEachFeature(e,w,t)}async runOriginalFeatureDependentExpressions(e,t){return this._evaluateSpecifiedExecutorsForEachFeature([e],C,t)}async runExpressionsDependentOnChangedFields(e){try{this.calculating=!0;const t=Array.from(e.changes).map(([t,o])=>this.runExpressionsDependentOnChangedFieldsForFeature([...o.keys()],t,e));S(await Promise.allSettled(t))}catch(t){g().error(t),this.expressionEvaluationFailed=!0}finally{this.calculating=!1}}async runExpressionsDependentOnChangedFieldsForFeature(e,t,o){if(this._abortController.signal.aborted)return;const r=this.layerExpressionsModelMap.get(t.layer);if(!r||0===r.components.length)return;const s=F(r,e);0!==s.length&&await this.evaluateAffectedExecutors([...s],t,r,o)}async evaluateAffectedExecutors(e,t,o,r){const a=new Map,c=s(this.outcomes,t,()=>new i);for(const n of e){const e=P(n,c,o);e&&(e.invalidated||=!0);const r=o.dependencyGraphComponents.get(n);r&&s(a,r,()=>this.createSccEvaluator({scc:r,feature:t,evaluatorMap:a,expressionModel:o}))}const l=[...a.values()],u={transaction:r,previousOutcomes:new i},p=l.map(e=>e.evaluate(u));S(await n(Promise.allSettled(p),this._abortController))}createSccEvaluator({scc:e,feature:t,evaluatorMap:o,expressionModel:r}){const n=s(this.outcomes,t,()=>new i),a=new b(e,t,this.arcadeContext,r,n,this._abortController);for(const i of e.adjacencyList){s(o,i,()=>this.createSccEvaluator({scc:i,feature:t,evaluatorMap:o,expressionModel:r})).dependencies.push(a)}return a}async _evaluateSpecifiedExecutorsForEachFeature(e,t,o){this.calculating=!0;try{const r=[];for(const s of e){const{layer:e}=s,n=this.layerExpressionsModelMap.get(e);n&&0!==n.components.length&&r.push(this.evaluateAffectedExecutors(t(n,e),s,n,o))}S(await n(Promise.allSettled(r),this._abortController))}catch(r){g().error(r),this.expressionEvaluationFailed=!0}finally{this.calculating=!1}}};e([u()],y.prototype,"calculating",void 0),e([u({constructOnly:!0})],y.prototype,"arcadeContext",void 0),e([u()],y.prototype,"_abortController",void 0),e([u()],y.prototype,"layerExpressionsModelMap",void 0),e([u()],y.prototype,"outcomes",void 0),e([u()],y.prototype,"expressionEvaluationFailed",void 0),y=e([p("esri.widgets.BatchAttributeForm.expressions.ExpressionsManager")],y);class b{constructor(e,t,o,r,s,n){this.scc=e,this.feature=t,this.arcadeContextInfo=o,this.expressionsModel=r,this.outcomes=s,this._abortController=n,this._resolver=null,this.dependencies=[]}get baseContext(){return d(this.arcadeContextInfo,this.feature,this._abortController.signal)}evaluate(e){return this._resolver||(this._resolver=Promise.withResolvers(),a(this._resolver,this._evaluate(e))),this._resolver.promise}async _evaluate(e){null===v&&(v=await(import("../../../arcade/languageUtils.js")));const t=[],o=this.dependencies.map(t=>t.evaluate(e));S(await n(Promise.allSettled(o),this._abortController));const{executors:r}=this.scc;if(1===r.size?await this._evaluateSingleExecutorComponent({context:e,executor:l(r),errorsToReport:t}):await this._evaluateMultiExecutorComponent({context:e,errorsToReport:t}),t.length>0)throw A(t)}async _evaluateMultiExecutorComponent({context:e,errorsToReport:t}){const{transaction:o}=e,r=new Map;let s=!0,n=0;for(;s&&n<E;){s=!1,n++;for(const n of this.scc.executors){const a=this._findOutcome(n)??{status:"not-run",invalidated:!0};a.invalidated||=this._invalidatedSinceCheckpoint(n,o,r.get(n)),this._shouldEvaluate(a)&&(s=!0,r.set(n,o.currentCheckpoint),await this._performEvaluation({context:e,executor:n,errorsToReport:t}))}}}async _evaluateSingleExecutorComponent({context:e,executor:t,errorsToReport:o}){const r=this._findOutcome(t)??{status:"not-run",invalidated:!0};r.invalidated||=this._invalidatedSinceCheckpoint(t,e.transaction),this._shouldEvaluate(r)&&await this._performEvaluation({context:e,executor:t,errorsToReport:o})}async _performEvaluation({context:e,executor:t,errorsToReport:r}){const{variables:s,executeContext:n}=this.baseContext;let a=null,i=null;try{a=t.isAsync?await t.executeAsync(s,n):t.execute(s,n),i={result:a,status:"success"}}catch(d){i={error:d,status:"error"}}const{transaction:c,previousOutcomes:l}=e,{outcomes:u}=this,p=this.expressionsModel.arcadeExecutorUses.get(t)??[];for(const o of p){const e=h(o),t=u.get(e);t&&l.set(e,t),u.set(h(o),i);const r=this.expressionsModel.elementTemplateMap.get(o.elementId);switch(o.executorPurpose){case"editableExpression":if(!1===i.result&&!1!==t?.result){const e=u.get(h({elementId:r.elementId,executorPurpose:"valueExpression"}));if(e){const{fieldName:t}=r,o=M(this.feature,t),s=f(e.result,o,this.arcadeContextInfo.timeZone,v);c.setValue(this.feature,t,s)}}break;case"valueExpression":{if("error"===i?.status)continue;const e=r.getExpressionExecutorsForLayer(this.feature.layer);let t=!0;if(e?.editableExpression&&(t=!1===u.get(h({elementId:r.elementId,executorPurpose:"editableExpression"}))?.result),t){const e=r.fieldName,t=this.feature.getAttribute(e)??null;try{const o=M(this.feature,e),r=f(i.result,o,this.arcadeContextInfo.timeZone,v);r!==t&&c.setValue(this.feature,e,r)}catch(x){g().error(`Failed to set calculated value for field '${e}'`,x)}}}break;case"visibilityExpression":this.expressionsModel.preserveFieldValuesWhenHidden||!0!==t?.result||!1!==i.result||"user"!==c.originActor||j(r,this.feature,u,{transaction:c,previousOutcomes:l})}}if("error"===i?.status){const e=new Set;for(const t of p){const o=this.expressionsModel.elementTemplateMap.get(t.elementId);if(o)switch(t.executorPurpose){case"editableExpression":e.add(o.label+" - Editable expression");break;case"requiredExpression":e.add(o.label+" - Required expression");break;case"valueExpression":e.add(o.label+" - Value expression");break;case"visibilityExpression":e.add(o.label+" - Visibility expression")}}r.push(e.size>0?new o("expression-evaluation-failed","Arcade evaluation failed ("+[...e].join(",")+")"):new o("expression-evaluation-failed","Arcade evaluation failed "))}}_invalidatedSinceCheckpoint(e,t,o=-1){const r=t.changesForFeature(this.feature);if(!r||0===r.size)return!1;return this.scc.getFieldsReferenced(e).values().some(e=>r.has(e)&&r.get(e)>o)}_shouldEvaluate(e){return!this._abortController.signal.aborted&&!!e.invalidated}_findOutcome(e){return P(e,this.outcomes,this.expressionsModel)}}function _(e){return Array.from(e.dependencyGraphComponents.keys())}function w(e){return Array.from(e.geometryReferences)}function C(e){return Array.from(e.originalFeatureReferences)}function M(e,t){const r=e.layer.fieldsIndex.get(t);if(!r)throw new o("field-not-found",`Field '${t}' not found on layer.`);return r}function F(e,t){const o=new Set;for(const r of t)c(o,e.fieldReferencesMap.get(r));return Array.from(o)}function A(e){return new AggregateError(e,`One or more expression executions failed. First error message: ${e[0].message}`)}function S(e){const t=[],o=new Set;for(const r of e){if("fulfilled"===r.status)continue;const e=r.reason instanceof AggregateError?r.reason.errors:[r.reason];for(const r of e)o.has(r)||(o.add(r),t.push(r))}if(t.length>0)throw A(t)}function j(e,t,o,r){x(e)?O(e,t,o,r):m(e)&&R(e,t,o,r)}function O(e,t,o,r){const{group:s}=e;s&&!k(s,o,r.previousOutcomes)||I(t,e,r)}function R(e,t,o,r){for(const s of e.elements)x(s)&&k(s,o,r.previousOutcomes)&&I(t,s,r)}function I(e,{fieldName:t},o){o.transaction.setValue(e,t,null)}function k(e,t,o){const r=h({elementId:e.elementId,executorPurpose:"visibilityExpression"}),s=o.get(r)??t.get(r);return!s||!!s.result}function P(e,t,o){const r=o.arcadeExecutorUses.get(e);if(r)for(const s of r){const e=t.get(h(s));if(e)return e}}export{y as ExpressionsManager};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{isSome as e,addMany as n,pushIfSome as s}from"../../../core/arrayUtils.js";import{getOrCreateMapValue as t}from"../../../core/MapUtils.js";import o from"../../../core/Queue.js";import{addMany as i,last as r}from"../../../core/SetUtils.js";import{isFieldElementTemplate as a}from"../templates/support/templateUtils.js";class c{constructor({executorMap:e,fieldsIndex:n,preserveFieldValuesWhenHidden:s}){this.arcadeExecutorUses=new Map,this.components=[],this.preserveFieldValuesWhenHidden=!1,this.fieldsIndex=n,this.preserveFieldValuesWhenHidden=!0===s,this.elementTemplateMap=new Map;for(const t of e.keys())this.elementTemplateMap.set(t.elementId,t);this._buildDependencyGraph(e)}_buildDependencyGraph(e){const n=m(e,this.fieldsIndex),s={components:[],arcadeExecutorUses:this.arcadeExecutorUses,elementTemplatesById:new Map([...e.keys()].map(e=>[e.elementId,e])),executorMap:e,fieldElementTemplateMap:f(e),fieldReferencesMap:new Map,geometryReferences:new Set,originalFeatureReferences:new Set,nextIndex:0,nodeInfoMap:n,nodeStack:new o(r),shouldConsiderVisibility:!this.preserveFieldValuesWhenHidden};for(const[o,i]of e)if(null!=i)for(const e of Object.keys(i))switch(e){case"choiceExpression":case"editableExpression":case"requiredExpression":case"valueExpression":case"visibilityExpression":{const n=i[e];if(null==n)break;t(this.arcadeExecutorUses,n,()=>[]).push({elementId:o.elementId,executorPurpose:e});break}case"textExpressions":{const n=i[e];if(!Array.isArray(n))break;n.forEach((e,n)=>{t(this.arcadeExecutorUses,e,()=>[]).push({elementId:o.elementId,executorPurpose:"textExpressions",textExpressionIndex:n})});break}}for(const t of this.arcadeExecutorUses.values())t.sort(e=>"editableExpression"===e.executorPurpose?-1:1);for(const t of n.values())-1===t.index&&d(t,s);this.dependencyGraphComponents=x(n),this.fieldReferencesMap=h(s),this.geometryReferences=y(s.geometryReferences,n),this.originalFeatureReferences=y(s.originalFeatureReferences,n),this.components=s.components}}class l{constructor(){this._executors=new Set,this._fieldsReferenced=new Set,this.adjacencyList=new Set}get executors(){return this._executors}get fieldsReferenced(){return this._fieldsReferenced}addExecutor(e){this._executors.add(e.executor),i(this._fieldsReferenced,e.fieldsUsedNormalized)}}function d(e,n){e.index=e.lowlink=n.nextIndex++,n.nodeStack.push(e);for(const s of p(e,n))-1===s.index?(d(s,n),e.lowlink=Math.min(e.lowlink,s.lowlink)):s.index<e.index&&n.nodeStack.contains(s)&&(e.lowlink=Math.min(e.lowlink,s.index)),n.nodeStack.contains(s)||null!=s.component&&e.incomingCrossLinkNeighbors.add(s.component);if(e.lowlink===e.index){const s=new l;for(n.components.push(s);E(n.nodeStack)>=e.index;){const e=n.nodeStack.pop();if(null!=e){e.component=s,s.addExecutor(e);for(const n of e.incomingCrossLinkNeighbors)n.adjacencyList.add(s)}}}}function p({executor:n,fieldsUsedNormalized:s},o){const r=new Set;for(const e of s){t(o.fieldReferencesMap,e,()=>new Set).add(n),i(r,u(e,o))}n.geometryUsed&&o.geometryReferences.add(n),n.variablesUsed.includes("$originalfeature")&&o.originalFeatureReferences.add(n);const c=o.arcadeExecutorUses.get(n)??[];for(const e of c)switch(e.executorPurpose){case"valueExpression":{const s=o.executorMap.get(o.elementTemplatesById.get(e.elementId));s?.editableExpression&&s.editableExpression!==n&&r.add(s.editableExpression);break}case"visibilityExpression":{const n=o.elementTemplatesById.get(e.elementId);if(o.shouldConsiderVisibility&&n&&a(n)){const e=n.group,s=e?o.executorMap.get(e):null;s?.visibilityExpression&&r.add(s.visibilityExpression)}break}}return Array.from(r).map(e=>o.nodeInfoMap.get(e)).filter(e)}function u(e,{executorMap:n,fieldElementTemplateMap:t,shouldConsiderVisibility:o}){const i=[],r=t.get(e);if(null==r)return i;const a=n.get(r);if(null==a)return i;if(s(i,a.editableExpression),s(i,a.valueExpression),o){s(i,a.visibilityExpression);const{group:e}=r;if(null!=e){const t=n.get(e)?.visibilityExpression;s(i,t)}}return i}function f(e){const n=new Map;for(const s of e.keys())a(s)&&n.set(s.fieldName,s);return n}function m(s,t){const o=Array.from(s.values()).filter(e),i=new Set(o.flatMap(e=>{const{textExpressions:s,...t}=e,o=[];return s?.length&&n(o,s),n(o,Object.values(t)),o})),r=Array.from(i).filter(e).map(e=>({component:null,incomingCrossLinkNeighbors:new Set,executor:e,fieldsUsedNormalized:e.fieldsUsed.map(e=>t.normalizeFieldName(e)??e),index:-1,lowlink:-1,onStack:!1}));return new Map(r.map(e=>[e.executor,e]))}function x(e){return new Map([...e.values()].map(({component:e,executor:n})=>[n,e]))}function h({fieldReferencesMap:e,nodeInfoMap:n}){const s=new Map;for(const[t,o]of e.entries())s.set(t,y(o,n));return s}function y(e,n){const s=new Set;for(const t of e){const e=n.get(t);e?.component&&s.add(e.component)}return s}function E(e){return e.peek()?.index??-1}export{c as ExpressionsModel,l as StronglyConnectedComponent,p as getDirectDependencies};
2
+ import{isSome as e,addMany as s,pushIfSome as t}from"../../../core/arrayUtils.js";import{getOrCreateMapValue as n}from"../../../core/MapUtils.js";import o from"../../../core/Queue.js";import{addMany as i,last as r}from"../../../core/SetUtils.js";import{isFieldElementTemplate as a}from"../templates/support/templateUtils.js";class c{constructor({executorMap:e,fieldsIndex:s,preserveFieldValuesWhenHidden:t}){this.arcadeExecutorUses=new Map,this.components=[],this.preserveFieldValuesWhenHidden=!1,this.fieldsIndex=s,this.preserveFieldValuesWhenHidden=!0===t,this.elementTemplateMap=new Map;for(const n of e.keys())this.elementTemplateMap.set(n.elementId,n);this._buildDependencyGraph(e)}_buildDependencyGraph(e){const s=x(e,this.fieldsIndex),t={components:[],arcadeExecutorUses:this.arcadeExecutorUses,elementTemplatesById:new Map([...e.keys()].map(e=>[e.elementId,e])),executorMap:e,fieldElementTemplateMap:f(e),fieldReferencesMap:new Map,geometryReferences:new Set,originalFeatureReferences:new Set,nextIndex:0,nodeInfoMap:s,nodeStack:new o(r),shouldConsiderVisibility:!this.preserveFieldValuesWhenHidden};for(const[o,i]of e)if(null!=i)for(const e of Object.keys(i))switch(e){case"choiceExpression":case"editableExpression":case"requiredExpression":case"valueExpression":case"visibilityExpression":{const s=i[e];if(null==s)break;n(this.arcadeExecutorUses,s,()=>[]).push({elementId:o.elementId,executorPurpose:e});break}case"textExpressions":{const s=i[e];if(!Array.isArray(s))break;s.forEach((e,s)=>{n(this.arcadeExecutorUses,e,()=>[]).push({elementId:o.elementId,executorPurpose:"textExpressions",textExpressionIndex:s})});break}}for(const n of this.arcadeExecutorUses.values())n.sort(e=>"editableExpression"===e.executorPurpose?-1:1);for(const n of s.values())-1===n.index&&d(n,t);this.dependencyGraphComponents=m(s),this.fieldReferencesMap=t.fieldReferencesMap,this.geometryReferences=t.geometryReferences,this.originalFeatureReferences=t.originalFeatureReferences,this.components=t.components}}class l{constructor(){this._executors=new Set,this._fieldsReferencedByExecutor=new Map,this.adjacencyList=new Set}get executors(){return this._executors}addExecutor(e){this._executors.add(e.executor),this._fieldsReferencedByExecutor.set(e.executor,new Set(e.fieldsUsedNormalized))}getFieldsReferenced(e){return this._fieldsReferencedByExecutor.get(e)??new Set}}function d(e,s){e.index=e.lowlink=s.nextIndex++,s.nodeStack.push(e);for(const t of p(e,s))-1===t.index?(d(t,s),e.lowlink=Math.min(e.lowlink,t.lowlink)):t.index<e.index&&s.nodeStack.contains(t)&&(e.lowlink=Math.min(e.lowlink,t.index)),s.nodeStack.contains(t)||null!=t.component&&e.incomingCrossLinkNeighbors.add(t.component);if(e.lowlink===e.index){const t=new l;for(s.components.push(t);h(s.nodeStack)>=e.index;){const e=s.nodeStack.pop();if(null!=e){e.component=t,t.addExecutor(e);for(const s of e.incomingCrossLinkNeighbors)s.adjacencyList.add(t)}}}}function p({executor:s,fieldsUsedNormalized:t},o){const r=new Set;for(const e of t){n(o.fieldReferencesMap,e,()=>new Set).add(s),i(r,u(e,o))}s.geometryUsed&&o.geometryReferences.add(s),s.variablesUsed.includes("$originalfeature")&&o.originalFeatureReferences.add(s);const c=o.arcadeExecutorUses.get(s)??[];for(const e of c)switch(e.executorPurpose){case"valueExpression":{const t=o.executorMap.get(o.elementTemplatesById.get(e.elementId));t?.editableExpression&&t.editableExpression!==s&&r.add(t.editableExpression);break}case"visibilityExpression":{const s=o.elementTemplatesById.get(e.elementId);if(o.shouldConsiderVisibility&&s&&a(s)){const e=s.group,t=e?o.executorMap.get(e):null;t?.visibilityExpression&&r.add(t.visibilityExpression)}break}}return Array.from(r).map(e=>o.nodeInfoMap.get(e)).filter(e)}function u(e,{executorMap:s,fieldElementTemplateMap:n,shouldConsiderVisibility:o}){const i=[],r=n.get(e);if(null==r)return i;const a=s.get(r);if(null==a)return i;if(t(i,a.editableExpression),t(i,a.valueExpression),o){t(i,a.visibilityExpression);const{group:e}=r;if(null!=e){const n=s.get(e)?.visibilityExpression;t(i,n)}}return i}function f(e){const s=new Map;for(const t of e.keys())a(t)&&s.set(t.fieldName,t);return s}function x(t,n){const o=Array.from(t.values()).filter(e),i=new Set(o.flatMap(e=>{const{textExpressions:t,...n}=e,o=[];return t?.length&&s(o,t),s(o,Object.values(n)),o})),r=Array.from(i).filter(e).map(e=>({component:null,incomingCrossLinkNeighbors:new Set,executor:e,fieldsUsedNormalized:e.fieldsUsed.map(e=>n.normalizeFieldName(e)??e),index:-1,lowlink:-1,onStack:!1}));return new Map(r.map(e=>[e.executor,e]))}function m(e){return new Map([...e.values()].map(({component:e,executor:s})=>[s,e]))}function h(e){return e.peek()?.index??-1}export{c as ExpressionsModel,l as StronglyConnectedComponent,p as getDirectDependencies};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import i from"../../../core/Collection.js";import{property as s,subclass as r}from"../../../core/accessorSupport/decorators.js";import{getEffectiveTimeZone as o,isAttributeFormSupportedLayerUnion as l}from"../batchAttributeFormUtils.js";import{parseFormTemplateString as a}from"../stringUtils.js";import{visibilityCodeToBoolean as n,makeUseId as p}from"./support/inputUtils.js";import{isEmptyValue as u}from"../../support/forms/formUtils.js";let y=class extends t{constructor(e){super(e),this.existsInAllLayers=!0,this.features=new i}get description(){return this._computeStringLiteralText(this.template.description)}get effectiveTimeZone(){return o(this.template.formTimeZone,this.template.layerTimeZone)}get featuresHaveSameCalculatedVisibility(){const e=new Set;for(const t of this.features){if(null==this.template.getExpressionExecutorsForLayer(t.layer)?.visibilityExpression){e.add(!0);continue}const i=this._lookupEvaluatedExpression(t,"visibilityExpression");if("success"===i?.status){if(e.add(!0===i.result),e.size>1)return!1}else e.add(!1)}return e.size<=1}get label(){return this._computeStringLiteralText(this.template.label)}get layers(){return Array.from(new Set(this.features.map(e=>e.layer).filter(l)))}get visibilityCode(){return this._baseVisibilityCode}get visible(){return n(this.visibilityCode)}get _baseVisibilityCode(){return this.existsInAllLayers?this.featuresHaveSameCalculatedVisibility?!1===this._evaluatedVisibilityExpression?"hidden:visibility-expression:all-features":"visible":"hidden:visibility-expression:some-features":"hidden:not-in-all-layers"}get _evaluatedVisibilityExpression(){let e=!0,t=!0;for(const i of this.features){if(null==this.template.getExpressionExecutorsForLayer(i.layer)?.visibilityExpression){e=e&&!0;continue}t=!1;const s=this._lookupEvaluatedExpression(i,"visibilityExpression");"success"===s?.status?e=e&&!0===s.result:e=!1}return t?null:e}_lookupEvaluatedExpression(e,t,i){return this.expressionsManager.evaluatedExpressions.get(e)?.get(p({elementId:this.template.elementId,executorPurpose:t,textExpressionIndex:i}))}_computeStringLiteralText(e){const t=this.features.getItemAt(0);return!t||1!==this.features.length||u(e)?e:a({attributes:t.attributes,label:e,layer:t.layer,timeZone:this.effectiveTimeZone})}};e([s({constructOnly:!0})],y.prototype,"expressionsManager",void 0),e([s()],y.prototype,"description",null),e([s()],y.prototype,"effectiveTimeZone",null),e([s()],y.prototype,"existsInAllLayers",void 0),e([s()],y.prototype,"features",void 0),e([s()],y.prototype,"featuresHaveSameCalculatedVisibility",null),e([s()],y.prototype,"label",null),e([s()],y.prototype,"layers",null),e([s({constructOnly:!0})],y.prototype,"template",void 0),e([s()],y.prototype,"visibilityCode",null),e([s()],y.prototype,"visible",null),e([s()],y.prototype,"_baseVisibilityCode",null),e([s()],y.prototype,"_evaluatedVisibilityExpression",null),y=e([r("esri.widgets.BatchAttributeForm.inputs.InputBase")],y);const m=y;export{m as default};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import i from"../../../core/Collection.js";import{property as s,subclass as r}from"../../../core/accessorSupport/decorators.js";import{getEffectiveTimeZone as o,isAttributeFormSupportedLayerUnion as l}from"../batchAttributeFormUtils.js";import{parseFormTemplateString as n}from"../stringUtils.js";import{visibilityCodeToBoolean as a,makeUseId as p}from"./support/inputUtils.js";import{isEmptyValue as u}from"../../support/forms/formUtils.js";let m=class extends t{constructor(e){super(e),this.existsInAllLayers=!0,this.features=new i}get description(){return this._computeStringLiteralText(this.template.description)}get effectiveTimeZone(){return o(this.template.formTimeZone,this.template.layerTimeZone)}get featuresHaveSameCalculatedVisibility(){const e=new Set;for(const t of this.features){if(null==this.template.getExpressionExecutorsForLayer(t.layer)?.visibilityExpression){e.add(!0);continue}const i=this._lookupEvaluatedExpression(t,"visibilityExpression");if("success"===i?.status){if(e.add(!0===i.result),e.size>1)return!1}else e.add(!1)}return e.size<=1}get label(){return this._computeStringLiteralText(this.template.label)}get layers(){return Array.from(new Set(this.features.map(e=>e.layer).filter(l)))}get visibilityCode(){return this._baseVisibilityCode}get visible(){return a(this.visibilityCode)}get _baseVisibilityCode(){return this.existsInAllLayers?this.featuresHaveSameCalculatedVisibility?!1===this._evaluatedVisibilityExpression?"hidden:visibility-expression:all-features":"visible":"hidden:visibility-expression:some-features":"hidden:not-in-all-layers"}get _evaluatedVisibilityExpression(){let e=!0,t=!0;for(const i of this.features){if(null==this.template.getExpressionExecutorsForLayer(i.layer)?.visibilityExpression){e=e&&!0;continue}t=!1;const s=this._lookupEvaluatedExpression(i,"visibilityExpression");"success"===s?.status?e=e&&!0===s.result:e=!1}return t?null:e}_lookupEvaluatedExpression(e,t,i){return this.expressionsManager.outcomes.get(e)?.get(p({elementId:this.template.elementId,executorPurpose:t,textExpressionIndex:i}))}_computeStringLiteralText(e){const t=this.features.getItemAt(0);return!t||1!==this.features.length||u(e)?e:n({attributes:t.attributes,label:e,layer:t.layer,timeZone:this.effectiveTimeZone})}};e([s({constructOnly:!0})],m.prototype,"expressionsManager",void 0),e([s()],m.prototype,"description",null),e([s()],m.prototype,"effectiveTimeZone",null),e([s()],m.prototype,"existsInAllLayers",void 0),e([s()],m.prototype,"features",void 0),e([s()],m.prototype,"featuresHaveSameCalculatedVisibility",null),e([s()],m.prototype,"label",null),e([s()],m.prototype,"layers",null),e([s({constructOnly:!0})],m.prototype,"template",void 0),e([s()],m.prototype,"visibilityCode",null),e([s()],m.prototype,"visible",null),e([s()],m.prototype,"_baseVisibilityCode",null),e([s()],m.prototype,"_evaluatedVisibilityExpression",null),m=e([r("esri.widgets.BatchAttributeForm.inputs.InputBase")],m);const y=m;export{y as default};
@@ -1,7 +1,7 @@
1
1
  import type Accessor from "../../core/Accessor.js";
2
2
 
3
3
  /** @since 5.1 */
4
- export interface OrientedImageryViewerVisibleElementsProperties extends Partial<Pick<OrientedImageryViewerVisibleElements, "header" | "menu">> {}
4
+ export interface OrientedImageryViewerVisibleElementsProperties extends Partial<Pick<OrientedImageryViewerVisibleElements, "additionalCameraLocationsToggle" | "additionalFootprintToggle" | "currentFootprintToggle" | "digitization" | "directionalNavigation" | "enhancementTool" | "exploreImages" | "exploreImages3D" | "header" | "imageGallery" | "imageNavigationTools" | "imageOverlays" | "mapImageConversionTool" | "measurementTools" | "menu" | "navigationTool" | "overlays" | "searchTools" | "sequentialNavigation" | "showPopupsAction" | "showSelectedImage" | "superimpose" | "utilityTools">> {}
5
5
 
6
6
  /**
7
7
  * An object containing properties that control the visibility of certain elements within the [OrientedImageryViewer](https://developers.arcgis.com/javascript/latest/references/core/widgets/OrientedImageryViewer/) widget.
@@ -11,6 +11,62 @@ export interface OrientedImageryViewerVisibleElementsProperties extends Partial<
11
11
  export default class OrientedImageryViewerVisibleElements extends Accessor {
12
12
  /** @since 5.1 */
13
13
  constructor(properties?: OrientedImageryViewerVisibleElementsProperties);
14
+ /**
15
+ * Indicates whether to display the additional camera locations toggle.
16
+ *
17
+ * @default true
18
+ * @since 5.2
19
+ */
20
+ accessor additionalCameraLocationsToggle: boolean;
21
+ /**
22
+ * Indicates whether to display the additional footprint toggle.
23
+ *
24
+ * @default true
25
+ * @since 5.2
26
+ */
27
+ accessor additionalFootprintToggle: boolean;
28
+ /**
29
+ * Indicates whether to display the current footprint toggle.
30
+ *
31
+ * @default true
32
+ * @since 5.2
33
+ */
34
+ accessor currentFootprintToggle: boolean;
35
+ /**
36
+ * Indicates whether to display digitization controls.
37
+ *
38
+ * @default true
39
+ * @since 5.2
40
+ */
41
+ accessor digitization: boolean;
42
+ /**
43
+ * Indicates whether to display directional navigation.
44
+ *
45
+ * @default true
46
+ * @since 5.2
47
+ */
48
+ accessor directionalNavigation: boolean;
49
+ /**
50
+ * Indicates whether to display the enhancement tool.
51
+ *
52
+ * @default true
53
+ * @since 5.2
54
+ */
55
+ accessor enhancementTool: boolean;
56
+ /**
57
+ * Indicates whether to display the explore images action.
58
+ *
59
+ * @default true
60
+ * @since 5.2
61
+ */
62
+ accessor exploreImages: boolean;
63
+ /**
64
+ * Indicates whether to display the 3D explore images action.
65
+ *
66
+ * @default true
67
+ * @since 5.2
68
+ */
69
+ accessor exploreImages3D: boolean;
14
70
  /**
15
71
  * Indicates whether to display the header of the widget.
16
72
  *
@@ -18,6 +74,41 @@ export default class OrientedImageryViewerVisibleElements extends Accessor {
18
74
  * @since 5.1
19
75
  */
20
76
  accessor header: boolean;
77
+ /**
78
+ * Indicates whether to display the image gallery.
79
+ *
80
+ * @default true
81
+ * @since 5.2
82
+ */
83
+ accessor imageGallery: boolean;
84
+ /**
85
+ * Indicates whether to display image navigation tools.
86
+ *
87
+ * @default true
88
+ * @since 5.2
89
+ */
90
+ accessor imageNavigationTools: boolean;
91
+ /**
92
+ * Indicates whether to display the image overlays action.
93
+ *
94
+ * @default true
95
+ * @since 5.2
96
+ */
97
+ accessor imageOverlays: boolean;
98
+ /**
99
+ * Indicates whether to display the map-image conversion tool.
100
+ *
101
+ * @default true
102
+ * @since 5.2
103
+ */
104
+ accessor mapImageConversionTool: boolean;
105
+ /**
106
+ * Indicates whether to display measurement tools.
107
+ *
108
+ * @default true
109
+ * @since 5.2
110
+ */
111
+ accessor measurementTools: boolean;
21
112
  /**
22
113
  * Indicates whether to display the action bar of the widget.
23
114
  *
@@ -25,4 +116,60 @@ export default class OrientedImageryViewerVisibleElements extends Accessor {
25
116
  * @since 5.1
26
117
  */
27
118
  accessor menu: boolean;
119
+ /**
120
+ * Indicates whether to display the navigation tool.
121
+ *
122
+ * @default true
123
+ * @since 5.2
124
+ */
125
+ accessor navigationTool: boolean;
126
+ /**
127
+ * Indicates whether to display overlay controls.
128
+ *
129
+ * @default true
130
+ * @since 5.2
131
+ */
132
+ accessor overlays: boolean;
133
+ /**
134
+ * Indicates whether to display search tools.
135
+ *
136
+ * @default true
137
+ * @since 5.2
138
+ */
139
+ accessor searchTools: boolean;
140
+ /**
141
+ * Indicates whether to display sequential navigation.
142
+ *
143
+ * @default true
144
+ * @since 5.2
145
+ */
146
+ accessor sequentialNavigation: boolean;
147
+ /**
148
+ * Indicates whether to display the show popups action.
149
+ *
150
+ * @default true
151
+ * @since 5.2
152
+ */
153
+ accessor showPopupsAction: boolean;
154
+ /**
155
+ * Indicates whether to display the show selected image action.
156
+ *
157
+ * @default true
158
+ * @since 5.2
159
+ */
160
+ accessor showSelectedImage: boolean;
161
+ /**
162
+ * Indicates whether to display superimpose controls.
163
+ *
164
+ * @default true
165
+ * @since 5.2
166
+ */
167
+ accessor superimpose: boolean;
168
+ /**
169
+ * Indicates whether to display utility tools.
170
+ *
171
+ * @default true
172
+ * @since 5.2
173
+ */
174
+ accessor utilityTools: boolean;
28
175
  }