@arcgis/core 5.1.0-next.100 → 5.1.0-next.102

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 (158) hide show
  1. package/arcgisGlobal.d.ts +1449 -0
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/0d81409721d29d8bc276.js +1 -0
  4. package/assets/esri/core/workers/chunks/{9478a0478fb49a88685e.js → 119b84f5349f90d1dd28.js} +1 -1
  5. package/assets/esri/core/workers/chunks/15167eeb6d7dbe7e392d.js +1 -0
  6. package/assets/esri/core/workers/chunks/{6881ae969b48bd04f064.js → 1ba37706e5d5eaabcb8e.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{889a0405e3cdfa59b8e7.js → 1faa8a42d5a437fc40a3.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{40137b23d8ad4af7ff9c.js → 3996149146dd1eca7cc5.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{38b1d2ffcc318ac0119d.js → 48fcc10768d93e95a04e.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{e7637d6a8ce0af46843c.js → 55ccb8ed7325efb62091.js} +2 -2
  11. package/assets/esri/core/workers/chunks/{2b2e5628d08d0e3108d2.js → 5663df3cd1dfd4b43c73.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{0253292939b981134663.js → 5bc299f7f89a07a6e6a6.js} +1 -1
  13. package/assets/esri/core/workers/chunks/5dafd35801dca4229aed.js +1 -0
  14. package/assets/esri/core/workers/chunks/{d345030a89914348d3c5.js → 6f96ce41c47cae82e687.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{b6b6f190687813267d77.js → 7db09c5bf024242becfa.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{df232b8aa77f7e3285e3.js → 86bff154d46f8a562887.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{07ddf1b1f7602063ceb0.js → 8f9117d589de7caaa02d.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{2ad7c221ad317706387a.js → 9e7c84a3a2abec4d49df.js} +2 -2
  19. package/assets/esri/core/workers/chunks/{490e4a648cb2ab3e7956.js → a318cf6bb900e0ee268c.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{3ba29e7cf9fba3aa5f41.js → b1b8a7c00ec4d998ab84.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{fff4b9e43464ebb3fb4e.js → bb5512ecb5300d45d46b.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{d8c4fb66c733ab2f66d3.js → bb81da98546c4d923e0d.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{765ee0f2bfcec6d5bcc6.js → bc6a809a965355eb425f.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{53ff47c06ccfc0be885c.js → d30790c69724258dab2b.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{7a20941913d0115cfe26.js → de25311b6d13bf1c6089.js} +2 -2
  26. package/assets/esri/core/workers/chunks/{9940b318f38ea9d7a533.js → e86c073f0b6d395c7a38.js} +1 -1
  27. package/assets/esri/core/workers/chunks/f5bd0a4f82df5e942b70.js +1 -0
  28. package/assets/esri/core/workers/chunks/{b8d10d8db44c7c6acebe.js → fa38dc5010f8630a80fe.js} +1 -1
  29. package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +125 -0
  30. package/assets/esri/themes/base/widgets/_Directions.scss +5 -1
  31. package/assets/esri/themes/dark/main.css +1 -1
  32. package/assets/esri/themes/light/main.css +1 -1
  33. package/assets/esri/themes/light/view.css +1 -1
  34. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm.json +1 -1
  35. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_en.json +1 -1
  36. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer.json +1 -1
  37. package/chunks/GaussianSplatShadow.glsl.js +39 -0
  38. package/chunks/GlobalIllumination.glsl.js +1 -1
  39. package/config.js +1 -1
  40. package/form/elements/inputs/MultipleChoiceInput.d.ts +5 -5
  41. package/form/elements/inputs/MultipleChoiceInput.js +1 -1
  42. package/interfaces.d.ts +17 -0
  43. package/kernel.js +1 -1
  44. package/layers/FeatureLayer.d.ts +29 -39
  45. package/layers/KnowledgeGraphLayer.d.ts +1 -1
  46. package/layers/KnowledgeGraphLayer.js +1 -1
  47. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  48. package/layers/OrientedImageryLayer.d.ts +233 -0
  49. package/layers/OrientedImageryLayer.js +1 -1
  50. package/layers/ParquetLayer.d.ts +73 -24
  51. package/layers/ParquetLayer.js +1 -1
  52. package/layers/SceneLayer.d.ts +2 -2
  53. package/layers/VideoLayer.d.ts +35 -9
  54. package/layers/VideoLayer.js +1 -1
  55. package/layers/catalog/CatalogFootprintLayer.d.ts +147 -0
  56. package/layers/graphics/sources/ParquetSource.js +1 -1
  57. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  58. package/layers/knowledgeGraph/KnowledgeGraphSublayer.d.ts +3 -1
  59. package/layers/support/FeatureReductionBinning.d.ts +87 -9
  60. package/layers/support/FeatureReductionCluster.d.ts +87 -9
  61. package/layers/support/FieldConfiguration.d.ts +1 -1
  62. package/layers/support/ParquetFilesData.d.ts +46 -0
  63. package/layers/support/ParquetFilesData.js +2 -0
  64. package/layers/support/ParquetPortalItemData.d.ts +25 -0
  65. package/layers/support/ParquetPortalItemData.js +2 -0
  66. package/layers/support/SubtypeSublayer.d.ts +147 -0
  67. package/layers/support/TelemetryData.d.ts +5 -0
  68. package/layers/support/TelemetryData.js +1 -1
  69. package/layers/support/TelemetryDisplay.d.ts +10 -2
  70. package/layers/support/TelemetryDisplay.js +1 -1
  71. package/layers/support/parquetUtils.js +1 -1
  72. package/layers/support/types.d.ts +9 -0
  73. package/layers/video/VideoController.js +1 -1
  74. package/layers/video/types.d.ts +8 -1
  75. package/layers/video/videoUtils.js +1 -1
  76. package/networks/UtilityNetworkTraceAnalysis.d.ts +1 -1
  77. package/networks/UtilityNetworkTraceAnalysis.js +1 -1
  78. package/package.json +3 -3
  79. package/portal/jsonTypes.d.ts +7 -0
  80. package/renderers/support/ClassBreakInfo.d.ts +3 -3
  81. package/renderers/support/ClassBreakInfo.js +1 -1
  82. package/renderers/support/UniqueValueInfo.d.ts +3 -3
  83. package/renderers/support/UniqueValueInfo.js +1 -1
  84. package/rest/print.js +1 -1
  85. package/rest/support/PrintParameters.d.ts +8 -1
  86. package/rest/support/PrintParameters.js +1 -1
  87. package/support/revision.js +1 -1
  88. package/third-party-notices.txt +4 -0
  89. package/views/2d/engine/webgl/shaderGraph/graph/GlslGraphWriter.js +1 -1
  90. package/views/2d/engine/webgl/shaderGraph/graph/ShaderGraphContext.js +1 -1
  91. package/views/2d/engine/webgl/shaderGraph/graph/ShaderGraphNode.js +1 -1
  92. package/views/2d/engine/webgl/shaderGraph/graph/glsl.js +1 -1
  93. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityPolygonShader.js +1 -1
  94. package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterColorizerTechnique.js +1 -1
  95. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BloomShader.js +1 -1
  96. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/AspectShader.js +1 -1
  97. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/CurvatureShader.js +1 -1
  98. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/MaskShader.js +1 -1
  99. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/RemapShader.js +1 -1
  100. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/SlopeShader.js +1 -1
  101. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/math.js +1 -1
  102. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/surface.js +1 -1
  103. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  104. package/views/2d/layers/VideoLayerView2D.js +1 -1
  105. package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
  106. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  107. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  108. package/views/3d/support/gaussianSplatting/GaussianSplatFadeHelper.js +1 -1
  109. package/views/3d/webgl/RenderNode.js +1 -1
  110. package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js +5 -2
  111. package/views/3d/webgl-engine/effects/RenderNodes.js +1 -1
  112. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  113. package/views/3d/webgl-engine/lib/GaussianSplatShadowRenderNode.js +2 -0
  114. package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
  115. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  116. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  117. package/views/3d/webgl-engine/lib/TriangleIntersectionData.js +1 -1
  118. package/views/3d/webgl-engine/shaders/GaussianSplatShadow.glsl.js +2 -0
  119. package/views/3d/webgl-engine/shaders/GaussianSplatShadowTechnique.js +2 -0
  120. package/views/3d/webgl.js +1 -1
  121. package/views/Viewport2DBaseMixin.js +1 -1
  122. package/widgets/Attachments/support/attachmentUtils.js +1 -1
  123. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.d.ts +8 -1
  124. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  125. package/widgets/BatchAttributeForm/attachmentUtils.js +2 -0
  126. package/widgets/BatchAttributeForm/css.js +1 -1
  127. package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
  128. package/widgets/BatchAttributeForm/templates/RelationshipElementTemplate.js +1 -1
  129. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  130. package/widgets/BatchAttributeForm/templates/support/hashElementTemplate.js +1 -1
  131. package/widgets/BatchAttributeForm/types.d.ts +7 -0
  132. package/widgets/BatchAttributeForm.js +1 -1
  133. package/widgets/FeatureForm/RelationshipInput.d.ts +1 -1
  134. package/widgets/FeatureTable.js +1 -1
  135. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  136. package/widgets/OrientedImageryViewer/OrientedImageryViewerVisibleElements.js +1 -1
  137. package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
  138. package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
  139. package/widgets/OrientedImageryViewer/constants.js +1 -1
  140. package/widgets/OrientedImageryViewer/services/SuperimposeService.js +1 -1
  141. package/widgets/OrientedImageryViewer/services/TransformationService.js +1 -1
  142. package/widgets/OrientedImageryViewer/support/dataCaptureUtils.js +1 -1
  143. package/widgets/OrientedImageryViewer/support/geometryUtils.js +1 -1
  144. package/widgets/OrientedImageryViewer/support/superimposeUtils.js +1 -1
  145. package/widgets/OrientedImageryViewer/types.js +1 -1
  146. package/widgets/OrientedImageryViewer/videoViewerUtils.js +1 -1
  147. package/widgets/OrientedImageryViewer.js +1 -1
  148. package/widgets/PanoramicViewer/PanoramicVideoViewerViewModel.js +1 -1
  149. package/widgets/VideoPlayer/VideoPlayerViewModel.d.ts +9 -0
  150. package/widgets/VideoPlayer/VideoPlayerViewModel.js +1 -1
  151. package/widgets/VideoPlayer/components/PlayerControlsGroup.js +1 -1
  152. package/widgets/support/forms/formUtils.js +1 -1
  153. package/assets/esri/core/workers/chunks/26f28406056ddc0e159c.js +0 -1
  154. package/assets/esri/core/workers/chunks/43cc82373be791b7cb4c.js +0 -1
  155. package/assets/esri/core/workers/chunks/b06cc59068d32baaaa87.js +0 -1
  156. package/assets/esri/core/workers/chunks/c9461568e1002ebac534.js +0 -1
  157. /package/assets/esri/core/workers/chunks/{e7637d6a8ce0af46843c.js.LICENSE.txt → 55ccb8ed7325efb62091.js.LICENSE.txt} +0 -0
  158. /package/assets/esri/core/workers/chunks/{7a20941913d0115cfe26.js.LICENSE.txt → de25311b6d13bf1c6089.js.LICENSE.txt} +0 -0
@@ -1 +1 @@
1
- {"differentValues":"Different values","differentValuesPlaceholder":"(Different values)","empty":"No value","expressionEvaluationFailed":"Form failed to run calculations","failedToCalculateValues":"Failed to calculate values","formFailedToLoad":"Form failed to load.","formFailedToLoadTooManyComplexFeatures":"This form uses functions that limit attribute editing to {num} features.","formFailedToLoadTooManyFeatures":"Select up to {num} features to edit attributes.","noVisibleFields":{"allElementsHidden":"The selected features have no fields to display","elementsHiddenInSome":"The selected features have shared fields that are not displayed because of visibility expressions","noElements":"The selected feature has no fields to display","noElementsInCommon":"The selected features have no shared fields"},"requiredFieldBatchMode":"This field is required for one or more features.","requiredFieldLabel":"{name} - required field","showAllOptions":"Show all options","unsupportedContingentValues":"Editing attributes for multiple features is not available for layers with contingent values.","validationErrors":{"cannotBeNull":"Please enter a value","invalidCodedValue":"Value should be one of the listed values.","invalidType":"Not a valid value","invalidBatchFormType":"One or more features contain invalid values. Check individual features.","featuresInError":"One or more features have errors. Check individual features.","featuresWithInvalidValues":"One or more features have invalid values","nonVisibleError_changeValues":"The selected feature has hidden fields with invalid values. Change the values so that fields are visible.","nonVisibleError_checkIndividualFeatures":"One or more features have hidden fields with invalid values. Check individual features and correct the issues.","outsideRange":"Value should be between {min} and {max}","outsideRangeMax":"Value should be less than or equal to {max}","outsideRangeMin":"Value should be greater than or equal to {min}","tooShort":"This field requires a minimum of {min} characters"},"valueExpressionError":"Failed to calculate value"}
1
+ {"attachments":{"attachmentNumberedLabel":"Attachment {index}","attach":"Attach","download":"Download","fileName":"File name","maximize":"Maximize","noAttachments":"No attachments","noPreviewAvailable":"No preview available","replace":"Replace","size":"Size","type":"Type"},"unsupportedDomainGroupTitle":"Unsupported values","differentValues":"Different values","differentValuesPlaceholder":"(Different values)","empty":"No value","expressionEvaluationFailed":"Form failed to run calculations","failedToCalculateValues":"Failed to calculate values","formFailedToLoad":"Form failed to load.","formFailedToLoadTooManyComplexFeatures":"This form uses functions that limit attribute editing to {num} features.","formFailedToLoadTooManyFeatures":"Select up to {num} features to edit attributes.","noVisibleFields":{"allElementsHidden":"The selected features have no fields to display","elementsHiddenInSome":"The selected features have shared fields that are not displayed because of visibility expressions","noElements":"The selected feature has no fields to display","noElementsInCommon":"The selected features have no shared fields"},"requiredFieldBatchMode":"This field is required for one or more features.","requiredFieldLabel":"{name} - required field","showAllOptions":"Show all options","unsupportedContingentValues":"Editing attributes for multiple features is not available for layers with contingent values.","validationErrors":{"cannotBeNull":"Please enter a value","invalidCodedValue":"Value should be one of the listed values.","invalidType":"Not a valid value","invalidBatchFormType":"One or more features contain invalid values. Check individual features.","featuresInError":"One or more features have errors. Check individual features.","featuresWithInvalidValues":"One or more features have invalid values","nonVisibleError_changeValues":"The selected feature has hidden fields with invalid values. Change the values so that fields are visible.","nonVisibleError_checkIndividualFeatures":"One or more features have hidden fields with invalid values. Check individual features and correct the issues.","outsideRange":"Value should be between {min} and {max}","outsideRangeMax":"Value should be less than or equal to {max}","outsideRangeMin":"Value should be greater than or equal to {min}","tooShort":"This field requires a minimum of {min} characters"},"valueExpressionError":"Failed to calculate value"}
@@ -1 +1 @@
1
- {"differentValues":"Different values","differentValuesPlaceholder":"(Different values)","empty":"No value","expressionEvaluationFailed":"Form failed to run calculations","failedToCalculateValues":"Failed to calculate values","formFailedToLoad":"Form failed to load.","formFailedToLoadTooManyComplexFeatures":"This form uses functions that limit attribute editing to {num} features.","formFailedToLoadTooManyFeatures":"Select up to {num} features to edit attributes.","noVisibleFields":{"allElementsHidden":"The selected features have no fields to display","elementsHiddenInSome":"The selected features have shared fields that are not displayed because of visibility expressions","noElements":"The selected feature has no fields to display","noElementsInCommon":"The selected features have no shared fields"},"requiredFieldBatchMode":"This field is required for one or more features.","requiredFieldLabel":"{name} - required field","showAllOptions":"Show all options","unsupportedContingentValues":"Editing attributes for multiple features is not available for layers with contingent values.","validationErrors":{"cannotBeNull":"Please enter a value","invalidCodedValue":"Value should be one of the listed values.","invalidType":"Not a valid value","invalidBatchFormType":"One or more features contain invalid values. Check individual features.","featuresInError":"One or more features have errors. Check individual features.","featuresWithInvalidValues":"One or more features have invalid values","nonVisibleError_changeValues":"The selected feature has hidden fields with invalid values. Change the values so that fields are visible.","nonVisibleError_checkIndividualFeatures":"One or more features have hidden fields with invalid values. Check individual features and correct the issues.","outsideRange":"Value should be between {min} and {max}","outsideRangeMax":"Value should be less than or equal to {max}","outsideRangeMin":"Value should be greater than or equal to {min}","tooShort":"This field requires a minimum of {min} characters"},"valueExpressionError":"Failed to calculate value"}
1
+ {"attachments":{"attachmentNumberedLabel":"Attachment {index}","attachmentTypes":{"audio":"Audio","document":"Document","image":"Image","unknown":"Unknown","video":"Video"},"attach":"Attach","download":"Download","fileName":"File name","maximize":"Maximize","noAttachments":"No attachments","noPreviewAvailable":"No preview available","replace":"Replace","size":"Size","type":"Type"},"unsupportedDomainGroupTitle":"Unsupported values","differentValues":"Different values","differentValuesPlaceholder":"(Different values)","empty":"No value","expressionEvaluationFailed":"Form failed to run calculations","failedToCalculateValues":"Failed to calculate values","formFailedToLoad":"Form failed to load.","formFailedToLoadTooManyComplexFeatures":"This form uses functions that limit attribute editing to {num} features.","formFailedToLoadTooManyFeatures":"Select up to {num} features to edit attributes.","noVisibleFields":{"allElementsHidden":"The selected features have no fields to display","elementsHiddenInSome":"The selected features have shared fields that are not displayed because of visibility expressions","noElements":"The selected feature has no fields to display","noElementsInCommon":"The selected features have no shared fields"},"requiredFieldBatchMode":"This field is required for one or more features.","requiredFieldLabel":"{name} - required field","showAllOptions":"Show all options","unsupportedContingentValues":"Editing attributes for multiple features is not available for layers with contingent values.","validationErrors":{"cannotBeNull":"Please enter a value","invalidCodedValue":"Value should be one of the listed values.","invalidType":"Not a valid value","invalidBatchFormType":"One or more features contain invalid values. Check individual features.","featuresInError":"One or more features have errors. Check individual features.","featuresWithInvalidValues":"One or more features have invalid values","nonVisibleError_changeValues":"The selected feature has hidden fields with invalid values. Change the values so that fields are visible.","nonVisibleError_checkIndividualFeatures":"One or more features have hidden fields with invalid values. Check individual features and correct the issues.","outsideRange":"Value should be between {min} and {max}","outsideRangeMax":"Value should be less than or equal to {max}","outsideRangeMin":"Value should be greater than or equal to {min}","tooShort":"This field requires a minimum of {min} characters"},"valueExpressionError":"Failed to calculate value"}
@@ -1 +1 @@
1
- {"beginning":"Beginning","color":"Color","end":"End","errorLoadingLayer":"Error loading the layer","follow":"Follow","forward":"Forward","frame":"Frame","frameCenter":"Frame Center","frameInfo":"Frame Information","frameOutline":"Frame Outline","graphics":"Graphics","layers":"Layers","metadata":"Metadata","metadataDescription":"Press the play button or adjust the slider handle to load metadata","metadataNotLoaded":"Metadata not available yet","missionInfo":"Mission Information","none":"None","pause":"Pause","platformInfo":"Platform Information","play":"Play","playbackSpeed":"Playback Speed","quality":"Quality","reverse":"Reverse","sensor":"Sensor","sensorTrail":"Sensor Trail","settings":"Settings","sightLine":"Sight Line","speed":"Speed","video":"Video"}
1
+ {"beginning":"Beginning","color":"Color","end":"End","errorLoadingLayer":"Error loading the layer","follow":"Follow","forward":"Forward","frame":"Frame","frameCenter":"Frame Center","frameInfo":"Frame Information","frameOutline":"Frame Outline","graphics":"Graphics","layers":"Layers","metadata":"Metadata","metadataDescription":"Press the play button or adjust the slider handle to load metadata","metadataNotLoaded":"Metadata not available yet","missionInfo":"Mission Information","none":"None","pause":"Pause","platformInfo":"Platform Information","play":"Play","playbackSpeed":"Playback Speed","quality":"Quality","reverse":"Reverse","sensor":"Sensor","sensorPath":"Sensor Path","sensorTrail":"Sensor Trail","settings":"Settings","sightLine":"Sight Line","speed":"Speed","video":"Video"}
@@ -0,0 +1,39 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import{set as e}from"../core/libs/gl-matrix-2/math/vec2.js";import{create as a}from"../core/libs/gl-matrix-2/factories/vec2f64.js";import{create as i}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{RejectBySlicePass as n}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{OutputDepth as r}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputDepth.glsl.js";import{positionOutsideClipSpace as o}from"../views/3d/webgl-engine/core/shaderLibrary/shading/PositionOutsideClipSpace.js";import{GaussianSplatCovariance as c}from"../views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatCovariance.glsl.js";import{GaussianSplatEvaluation as s}from"../views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatEvaluation.glsl.js";import{GaussianSplatTextureFetch as t}from"../views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatTextureFetch.glsl.js";import{GaussianSplatUnpackingPassParameters as l,GaussianSplatUnpacking as v}from"../views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js";import{QuaternionToRotationMatrix as d}from"../views/3d/webgl-engine/core/shaderLibrary/util/QuaternionToRotationMatrix.glsl.js";import{Float2BindUniform as u}from"../views/3d/webgl-engine/core/shaderModules/Float2BindUniform.js";import{Float3PassUniform as p}from"../views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js";import{FloatPassUniform as m}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as f,If as x}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Matrix4BindUniform as g}from"../views/3d/webgl-engine/core/shaderModules/Matrix4BindUniform.js";import{Texture2DUintPassUniform as w}from"../views/3d/webgl-engine/core/shaderModules/Texture2DUintPassUniform.js";import{ShaderBuilder as h}from"../views/webgl/ShaderBuilder.js";class P extends l{constructor(){super(...arguments),this.clipMinCameraRelative=i(),this.clipMaxCameraRelative=i(),this.minSplatRadius=-1}}function S(a){const{clippingEnabled:i,hasSlicePlane:l}=a,P=new h,{fragment:S,varyings:G,vertex:y}=P;P.include(r,a),G.add("conic","vec3"),G.add("gaussianLogAlphaCutoff","float"),G.add("offsetFromCenter","vec2"),G.add("depth","float",{invariant:!0}),y.uniforms.add(new w("splatOrderTexture",e=>e.splatOrder),new w("splatAtlasTexture",e=>e.splatAtlas),new m("minSplatRadius",e=>e.minSplatRadius),new u("inverseScreenSize",({camera:a})=>e(j,1/a.fullWidth,1/a.fullHeight)),new g("proj",e=>e.camera.projectionMatrix),new g("view",e=>e.camera.viewMatrix),new u("nearFar",e=>e.camera.nearFar)),i&&y.uniforms.add(new p("clipMin",e=>e.clipMinCameraRelative),new p("clipMax",e=>e.clipMaxCameraRelative)),y.include(v),y.include(t),y.include(d),y.include(c),y.include(s),y.include(n,a),y.code.add(f`float safeClipW(float clipW) {
3
+ return abs(clipW) < 1e-7 ? (clipW < 0.0 ? -1e-7 : 1e-7) : clipW;
4
+ }`),y.code.add(f`vec3 computeProjectivePixelGradient(
5
+ vec3 clipGradient,
6
+ vec3 clipWGradient,
7
+ float clipValue,
8
+ float safeW,
9
+ float invWSquared,
10
+ float halfScreenSize
11
+ ) {
12
+ return (clipGradient * safeW - clipValue * clipWGradient) * invWSquared * halfScreenSize;
13
+ }`),y.code.add(f`vec3 multiplyCovariance3D(float[6] covariance3D, vec3 value) {
14
+ return vec3(
15
+ covariance3D[0] * value.x + covariance3D[1] * value.y + covariance3D[2] * value.z,
16
+ covariance3D[1] * value.x + covariance3D[3] * value.y + covariance3D[4] * value.z,
17
+ covariance3D[2] * value.x + covariance3D[4] * value.y + covariance3D[5] * value.z
18
+ );
19
+ }`),y.code.add(f`vec3 computeProjectiveCovariance2D(vec3 pixelXGradient, vec3 pixelYGradient, float[6] covariance3D, mat4 view) {
20
+ mat3 worldToView = transpose(mat3(view));
21
+ vec3 axisX = worldToView * pixelXGradient;
22
+ vec3 axisY = worldToView * pixelYGradient;
23
+ vec3 covarianceAxisX = multiplyCovariance3D(covariance3D, axisX);
24
+ vec3 covarianceAxisY = multiplyCovariance3D(covariance3D, axisY);
25
+ const float regularization = 0.3;
26
+ float covarianceXX = dot(axisX, covarianceAxisX) + regularization;
27
+ float covarianceXY = dot(axisX, covarianceAxisY);
28
+ float covarianceYY = dot(axisY, covarianceAxisY) + regularization;
29
+ return vec3(covarianceXX, covarianceXY, covarianceYY);
30
+ }`);const b=.25,D=Math.log(b);return y.main.add(`\n uint gaussianIndex = fetchOrderedGaussianIndex(uint(gl_InstanceID));\n uvec4 packedGaussian = fetchPackedGaussian(gaussianIndex);\n\n float opacity = unpackOpacity(packedGaussian);\n\n gl_Position = ${o};\n\n if (opacity < ${b}) {\n return;\n }\n\n vec3 cameraRelativePosition = fetchGaussianCameraRelativePosition(gaussianIndex, packedGaussian);\n\n ${x(i,f`if (cameraRelativePosition.x < clipMin.x || cameraRelativePosition.y < clipMin.y || cameraRelativePosition.z < clipMin.z ||
31
+ cameraRelativePosition.x > clipMax.x || cameraRelativePosition.y > clipMax.y || cameraRelativePosition.z > clipMax.z) {
32
+ return;
33
+ }`)}\n\n ${x(l,f`if (rejectBySlice(cameraRelativePosition)) {
34
+ return;
35
+ }`)}\n\n vec4 viewPos = vec4(mat3(view) * cameraRelativePosition, 1.0);\n\n if (viewPos.z > -nearFar.x || viewPos.z < -nearFar.y) {\n return;\n }\n\n vec3 covarianceA;\n vec3 covarianceB;\n computePackedGaussianCovariance3D(packedGaussian, covarianceA, covarianceB);\n\n float covariance3D[6] = float[6](covarianceA.x, covarianceA.y, covarianceA.z, covarianceB.x, covarianceB.y, covarianceB.z);\n\n vec4 projPos = proj * viewPos;\n float safeW = safeClipW(projPos.w);\n float invWSquared = 1.0 / (safeW * safeW);\n vec2 halfScreenSize = 0.5 / inverseScreenSize;\n\n // Projection matrix columns are the clip-space derivatives with respect to view-space xyz.\n vec3 clipWGradient = vec3(proj[0][3], proj[1][3], proj[2][3]);\n vec3 pixelXGradient = computeProjectivePixelGradient(\n vec3(proj[0][0], proj[1][0], proj[2][0]),\n clipWGradient,\n projPos.x,\n safeW,\n invWSquared,\n halfScreenSize.x\n );\n vec3 pixelYGradient = computeProjectivePixelGradient(\n vec3(proj[0][1], proj[1][1], proj[2][1]),\n clipWGradient,\n projPos.y,\n safeW,\n invWSquared,\n halfScreenSize.y\n );\n vec3 covariance2D = computeProjectiveCovariance2D(pixelXGradient, pixelYGradient, covariance3D, view);\n\n float determinant = computeGaussianCovarianceDeterminant(covariance2D);\n if (determinant <= 0.0) {\n return;\n }\n\n vec2 eigenvalues = computeGaussianCovarianceEigenvalues(covariance2D);\n\n gaussianLogAlphaCutoff = ${D} - log(opacity);\n float gaussianEllipseThreshold = computeGaussianEllipseThreshold(gaussianLogAlphaCutoff);\n vec2 axisLengths = computeGaussianAxisLengths(eigenvalues, gaussianEllipseThreshold);\n float maxRadius = max(axisLengths.x, axisLengths.y);\n\n if (rejectGaussianByMinimumRadius(maxRadius, opacity, minSplatRadius)) {\n return;\n }\n\n vec3 ndcPos = projPos.xyz / safeW;\n vec2 clipSpacePixelScale = 2.0 * inverseScreenSize;\n\n if (rejectGaussianByScreenBounds(ndcPos.xy, maxRadius, clipSpacePixelScale)) {\n return;\n }\n\n offsetFromCenter = computeGaussianQuadOffset(covariance2D, eigenvalues, axisLengths, gl_VertexID);\n conic = computeGaussianConic(covariance2D, determinant);\n depth = (-viewPos.z - nearFar.x) / (nearFar.y - nearFar.x);\n\n vec2 clipPos = ndcPos.xy + offsetFromCenter * clipSpacePixelScale - inverseScreenSize;\n gl_Position = vec4(clipPos, ndcPos.z, 1.0);\n `),S.include(s),S.main.add(f`float gaussianExponent = evaluateGaussianExponent(conic, offsetFromCenter);
36
+ if (gaussianExponent > 0.0 || gaussianExponent < gaussianLogAlphaCutoff) {
37
+ discard;
38
+ }
39
+ outputDepth(depth);`),P}const j=a(),G=Object.freeze(Object.defineProperty({__proto__:null,GaussianSplatShadowPassParameters:P,build:S},Symbol.toStringTag,{value:"Module"}));export{P as G,G as a,S as b};
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{ReadDepthLastFrame as a}from"../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepthLastFrame.glsl.js";import{addMainLightDirection as o}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js";import{ScreenSpaceRayMarching as t}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceRayMarching.glsl.js";import{CameraSpace as r}from"../views/3d/webgl-engine/core/shaderLibrary/util/CameraSpace.glsl.js";import{FloatPassUniform as i}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as l,If as n}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Matrix4BindUniform as c}from"../views/3d/webgl-engine/core/shaderModules/Matrix4BindUniform.js";import{Texture2DBindUniform as s}from"../views/3d/webgl-engine/core/shaderModules/Texture2DBindUniform.js";import{Texture2DPassUniform as m}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{ColorAttachment1 as h}from"../views/webgl/enums.js";import{NoParameters as u}from"../views/webgl/NoParameters.js";import{ShaderBuilder as d}from"../views/webgl/ShaderBuilder.js";const p=.01,f=.008,g=.002,v=.5,x=.02,M=.1,y=.008,b=.012,w=.008,S=40,W=.095,C=.008,F=60,R=2,D=.0039,j=.25,z=1/3,I=2/3,B=2,G=.05,P=.15,T=.75,$=25,E=.15,L=.5,O=1,U=1.5,V=16;class k extends u{constructor(){super(...arguments),this.projScale=1,this.scaleGlobalIllumination=1,this.accumulatedFrames=0,this.frameCount=0,this.rayMarchMinReach=E,this.rayMarchMaxReach=L,this.rayMarchWorldReach=$,this.rayMarchMinReachEmissionWeight=O,this.rayMarchMaxReachEmissionWeight=U,this.rayMarchMaxSteps=V}}function N(u){const $=new d,E=$.fragment;return $.include(e),$.include(r),o(E),E.include(a),$.include(t,u),E.uniforms.add(new m("normalMap",e=>e.normalTexture),new m("depthMap",e=>e.depthTexture),new m("lastFrameColorTexture",(e,a)=>a.reprojection.lastFrameColor?.getTexture()),new m("lastFrameDepthTexture",(e,a)=>a.reprojection.lastFrameDepth?.attachment),new s("lastFrameGlobalIlluminationTexture",e=>e.globalIllumination?.getTexture()),new s("lastFrameGlobalIlluminationWeightTexture",e=>e.globalIllumination?.getTexture(h)),new c("reprojectionViewMatrix",e=>e.reprojection.viewMatrix),new c("view",e=>e.camera.viewMatrix),new i("accumulatedFramesGI",e=>e.accumulatedFrames),new i("frameCount",e=>e.frameCount),new i("scaleGlobalIllumination",e=>e.scaleGlobalIllumination),new m("blueNoiseTex",e=>e.noiseTexture)),E.uniforms.add(new i("rayMarchMinReach",e=>e.rayMarchMinReach),new i("rayMarchMaxReach",e=>e.rayMarchMaxReach),new i("rayMarchWorldReach",e=>e.rayMarchWorldReach),new i("rayMarchMinReachEmissionWeight",e=>e.rayMarchMinReachEmissionWeight),new i("rayMarchMaxReachEmissionWeight",e=>e.rayMarchMaxReachEmissionWeight),new i("rayMarchMaxSteps",e=>e.rayMarchMaxSteps)),u.hasEmission&&E.uniforms.add(new m("lastFrameEmissionTexture",(e,a)=>a.reprojection.lastFrameEmission?.attachment)),E.constants.add("timeSamplesSize","float",64),E.constants.add("blueNoiseGridSize","float",8),E.code.add(l`
2
+ import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{ReadDepthLastFrame as a}from"../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepthLastFrame.glsl.js";import{addMainLightDirection as o}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js";import{ScreenSpaceRayMarching as t}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceRayMarching.glsl.js";import{CameraSpace as r}from"../views/3d/webgl-engine/core/shaderLibrary/util/CameraSpace.glsl.js";import{FloatPassUniform as i}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as l,If as n}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Matrix4BindUniform as c}from"../views/3d/webgl-engine/core/shaderModules/Matrix4BindUniform.js";import{Texture2DBindUniform as s}from"../views/3d/webgl-engine/core/shaderModules/Texture2DBindUniform.js";import{Texture2DPassUniform as m}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{ColorAttachment1 as h}from"../views/webgl/enums.js";import{NoParameters as u}from"../views/webgl/NoParameters.js";import{ShaderBuilder as d}from"../views/webgl/ShaderBuilder.js";const p=.01,f=.008,g=.002,v=.5,x=.02,M=.1,y=.008,b=.012,w=.008,S=40,W=.095,C=.008,F=60,R=2,D=.0039,j=.25,z=1/3,I=2/3,B=2,G=.05,P=.15,T=.75,$=25,E=.15,L=.5,O=1,U=1,V=16;class k extends u{constructor(){super(...arguments),this.projScale=1,this.scaleGlobalIllumination=1,this.accumulatedFrames=0,this.frameCount=0,this.rayMarchMinReach=E,this.rayMarchMaxReach=L,this.rayMarchWorldReach=$,this.rayMarchMinReachEmissionWeight=O,this.rayMarchMaxReachEmissionWeight=U,this.rayMarchMaxSteps=V}}function N(u){const $=new d,E=$.fragment;return $.include(e),$.include(r),o(E),E.include(a),$.include(t,u),E.uniforms.add(new m("normalMap",e=>e.normalTexture),new m("depthMap",e=>e.depthTexture),new m("lastFrameColorTexture",(e,a)=>a.reprojection.lastFrameColor?.getTexture()),new m("lastFrameDepthTexture",(e,a)=>a.reprojection.lastFrameDepth?.attachment),new s("lastFrameGlobalIlluminationTexture",e=>e.globalIllumination?.getTexture()),new s("lastFrameGlobalIlluminationWeightTexture",e=>e.globalIllumination?.getTexture(h)),new c("reprojectionViewMatrix",e=>e.reprojection.viewMatrix),new c("view",e=>e.camera.viewMatrix),new i("accumulatedFramesGI",e=>e.accumulatedFrames),new i("frameCount",e=>e.frameCount),new i("scaleGlobalIllumination",e=>e.scaleGlobalIllumination),new m("blueNoiseTex",e=>e.noiseTexture)),E.uniforms.add(new i("rayMarchMinReach",e=>e.rayMarchMinReach),new i("rayMarchMaxReach",e=>e.rayMarchMaxReach),new i("rayMarchWorldReach",e=>e.rayMarchWorldReach),new i("rayMarchMinReachEmissionWeight",e=>e.rayMarchMinReachEmissionWeight),new i("rayMarchMaxReachEmissionWeight",e=>e.rayMarchMaxReachEmissionWeight),new i("rayMarchMaxSteps",e=>e.rayMarchMaxSteps)),u.hasEmission&&E.uniforms.add(new m("lastFrameEmissionTexture",(e,a)=>a.reprojection.lastFrameEmission?.attachment)),E.constants.add("timeSamplesSize","float",64),E.constants.add("blueNoiseGridSize","float",8),E.code.add(l`
3
3
  float computeIdleColorBlendWeight(float accumulatedFrames) {
4
4
  float idleColorBlendProgress = clamp(
5
5
  accumulatedFrames / ${l.float(S)},
package/config.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="5.1.0-next.100";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
2
+ import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="5.1.0-next.102";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
@@ -4,7 +4,7 @@ import type OtherChoice from "./multipleChoice/OtherChoice.js";
4
4
  import type { ChoiceProperties } from "./multipleChoice/Choice.js";
5
5
  import type { OtherChoiceProperties } from "./multipleChoice/OtherChoice.js";
6
6
 
7
- export interface MultipleChoiceInputProperties extends Partial<Pick<MultipleChoiceInput, "choiceDelimiter" | "includeSelectAllChoices" | "maxSelectedChoices" | "minSelectedChoices">> {
7
+ export interface MultipleChoiceInputProperties extends Partial<Pick<MultipleChoiceInput, "choiceDelimiter" | "includeSelectAllChoices" | "maximumChoices" | "minimumChoices">> {
8
8
  /** An array of available choices. */
9
9
  choices?: ChoiceProperties[];
10
10
  /** The configuration for the `other` choice. */
@@ -25,8 +25,8 @@ export interface MultipleChoiceInputProperties extends Partial<Pick<MultipleChoi
25
25
  * label: "Other",
26
26
  * hint: "Provide additional details"
27
27
  * },
28
- * minSelectedChoices: 1,
29
- * maxSelectedChoices: 3,
28
+ * minimumChoices: 1,
29
+ * maximumChoices: 3,
30
30
  * choices: [
31
31
  * { label: "Option 1", value: "option1" },
32
32
  * { label: "Option 2", value: "option2" },
@@ -48,9 +48,9 @@ export default class MultipleChoiceInput extends Input {
48
48
  /** Indicates whether a `select all` choice should be displayed. */
49
49
  accessor includeSelectAllChoices: boolean | null | undefined;
50
50
  /** The maximum number of choices allowed. */
51
- accessor maxSelectedChoices: number | null | undefined;
51
+ accessor maximumChoices: number | null | undefined;
52
52
  /** The minimum number of choices required. */
53
- accessor minSelectedChoices: number | null | undefined;
53
+ accessor minimumChoices: number | null | undefined;
54
54
  /** The configuration for the `other` choice. */
55
55
  get otherChoice(): OtherChoice | null | undefined;
56
56
  set otherChoice(value: OtherChoiceProperties | null | undefined);
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{property as t,subclass as i}from"../../../core/accessorSupport/decorators.js";import o from"./Input.js";import c from"./multipleChoice/Choice.js";import l from"./multipleChoice/OtherChoice.js";var s;let r=s=class extends o{constructor(e){super(e),this.choiceDelimiter=",",this.choices=[],this.includeSelectAllChoices=null,this.maxSelectedChoices=null,this.minSelectedChoices=null,this.otherChoice=null,this.type="multiple-choice"}clone(){return new s({choiceDelimiter:this.choiceDelimiter,choices:this.choices.map(e=>e.clone()),includeSelectAllChoices:this.includeSelectAllChoices,maxSelectedChoices:this.maxSelectedChoices,minSelectedChoices:this.minSelectedChoices,otherChoice:this.otherChoice?.clone()??null})}};e([t({type:String,json:{write:!0}})],r.prototype,"choiceDelimiter",void 0),e([t({type:[c],json:{write:!0}})],r.prototype,"choices",void 0),e([t({type:Boolean,json:{write:!0}})],r.prototype,"includeSelectAllChoices",void 0),e([t({type:Number,json:{write:!0}})],r.prototype,"maxSelectedChoices",void 0),e([t({type:Number,json:{write:!0}})],r.prototype,"minSelectedChoices",void 0),e([t({type:l,json:{write:!0}})],r.prototype,"otherChoice",void 0),e([t({type:["multiple-choice"],json:{read:!1,write:!0}})],r.prototype,"type",void 0),r=s=e([i("esri.form.elements.inputs.MultipleChoiceInput")],r);const h=r;export{h as default};
2
+ import{__decorate as e}from"tslib";import{property as i,subclass as o}from"../../../core/accessorSupport/decorators.js";import t from"./Input.js";import c from"./multipleChoice/Choice.js";import s from"./multipleChoice/OtherChoice.js";var r;let h=r=class extends t{constructor(e){super(e),this.choiceDelimiter=",",this.choices=[],this.includeSelectAllChoices=null,this.maximumChoices=null,this.minimumChoices=null,this.otherChoice=null,this.type="multiple-choice"}clone(){return new r({choiceDelimiter:this.choiceDelimiter,choices:this.choices.map(e=>e.clone()),includeSelectAllChoices:this.includeSelectAllChoices,maximumChoices:this.maximumChoices,minimumChoices:this.minimumChoices,otherChoice:this.otherChoice?.clone()??null})}};e([i({type:String,json:{write:!0}})],h.prototype,"choiceDelimiter",void 0),e([i({type:[c],json:{write:!0}})],h.prototype,"choices",void 0),e([i({type:Boolean,json:{write:!0}})],h.prototype,"includeSelectAllChoices",void 0),e([i({type:Number,json:{write:!0}})],h.prototype,"maximumChoices",void 0),e([i({type:Number,json:{write:!0}})],h.prototype,"minimumChoices",void 0),e([i({type:s,json:{write:!0}})],h.prototype,"otherChoice",void 0),e([i({type:["multiple-choice"],json:{read:!1,write:!0}})],h.prototype,"type",void 0),h=r=e([o("esri.form.elements.inputs.MultipleChoiceInput")],h);const l=h;export{l as default};
package/interfaces.d.ts CHANGED
@@ -5378,6 +5378,20 @@ declare namespace __esri {
5378
5378
  export type OrderByInfo = import("./layers/support/OrderByInfo.js").default;
5379
5379
  export const OrderByInfo: typeof import("./layers/support/OrderByInfo.js").default;
5380
5380
 
5381
+ /** @deprecated since 5.0. Refactor using \@arcgis/codemod */
5382
+ export type ParquetFilesDataProperties = import("./layers/support/ParquetFilesData.js").ParquetFilesDataProperties;
5383
+
5384
+ /** @deprecated since 5.0. Refactor using \@arcgis/codemod */
5385
+ export type ParquetFilesData = import("./layers/support/ParquetFilesData.js").default;
5386
+ export const ParquetFilesData: typeof import("./layers/support/ParquetFilesData.js").default;
5387
+
5388
+ /** @deprecated since 5.0. Refactor using \@arcgis/codemod */
5389
+ export type ParquetPortalItemDataProperties = import("./layers/support/ParquetPortalItemData.js").ParquetPortalItemDataProperties;
5390
+
5391
+ /** @deprecated since 5.0. Refactor using \@arcgis/codemod */
5392
+ export type ParquetPortalItemData = import("./layers/support/ParquetPortalItemData.js").default;
5393
+ export const ParquetPortalItemData: typeof import("./layers/support/ParquetPortalItemData.js").default;
5394
+
5381
5395
  /** @deprecated since 5.0. Refactor using \@arcgis/codemod */
5382
5396
  export type PixelBlockProperties = import("./layers/support/PixelBlock.js").PixelBlockProperties;
5383
5397
 
@@ -5973,6 +5987,9 @@ declare namespace __esri {
5973
5987
  /** @deprecated since 5.0. Refactor using \@arcgis/codemod */
5974
5988
  export type LivestreamStatus = import("./layers/video/types.js").LivestreamStatus;
5975
5989
 
5990
+ /** @deprecated since 5.0. Refactor using \@arcgis/codemod */
5991
+ export type Coverage = import("./layers/video/types.js").Coverage;
5992
+
5976
5993
  /** @deprecated since 5.0. Refactor using \@arcgis/codemod */
5977
5994
  export type VoxelColorStopProperties = import("./layers/voxel/VoxelColorStop.js").VoxelColorStopProperties;
5978
5995
 
package/kernel.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.1";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="5.1.0-next.100",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
2
+ import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.1";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="5.1.0-next.102",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
@@ -152,23 +152,19 @@ export interface FeatureLayerProperties extends LayerProperties, APIKeyMixinProp
152
152
  dynamicDataSource?: DynamicDataLayerProperties | null;
153
153
  /**
154
154
  * An array of [FieldConfiguration](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FieldConfiguration/) objects that control how fields are displayed in popups and other UI elements. Each object specifies options for an individual field, such as its display name, via `alias`, and formatting rules, via `fieldFormat`. Assign this property before the layer loads to ensure the configurations take effect. For more information, see the [FieldConfiguration](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FieldConfiguration/) documentation.
155
- *
156
155
  * If no field configurations are provided, they are automatically created when a [popupTemplate](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#popupTemplate) is assigned to the layer. If no [popupTemplate](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#popupTemplate) is set, you can manually define field configurations to customize how fields are shown.
157
- *
158
156
  * > [!WARNING]
159
157
  * >
160
- * > Support is limited in version 4.34. For details, see the [FieldConfiguration](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FieldConfiguration/) documentation.
158
+ * > Support is limited in version 5.1. For details, see the [FieldConfiguration](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FieldConfiguration/) documentation.
161
159
  *
162
- * To modify field configurations, clone [fieldConfigurations](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#fieldConfigurations), make the changes, and then reassign the updated clone back to `FeatureLayer.fieldConfigurations`.
160
+ * To modify field configurations, clone [fieldConfigurations](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#fieldConfigurations), make the changes, and then reassign the updated clone back to [fieldConfigurations](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#fieldConfigurations).
163
161
  *
164
162
  * @since 4.34
165
- * @see [getFieldConfiguration()](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#getFieldConfiguration)
166
- * @see [getFieldAlias()](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#getFieldAlias)
167
- * @see [FieldConfiguration](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FieldConfiguration/)
163
+ * @see [FeatureLayer.getFieldConfiguration](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#getFieldConfiguration)
164
+ * @see [FeatureLayer.getFieldAlias](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#getFieldAlias)
168
165
  * @example
169
166
  * // Adding a new field configuration
170
- * const addNewConfig = (layer, fieldName, alias,
171
- * fieldFormat) => {
167
+ * const addNewConfig = (layer, fieldName, alias, fieldFormat) => {
172
168
  * // Check if there is already an existing configuration for fieldName
173
169
  * const existingConfig = layer.getFieldConfiguration(fieldName);
174
170
  * if (!existingConfig) {
@@ -180,8 +176,7 @@ export interface FeatureLayerProperties extends LayerProperties, APIKeyMixinProp
180
176
  * };
181
177
  * @example
182
178
  * // Updating an existing field configuration
183
- * const updateConfig = (layer, fieldName, alias,
184
- * fieldFormat) => {
179
+ * const updateConfig = (layer, fieldName, alias, fieldFormat) => {
185
180
  * const existingConfig = layer.getFieldConfiguration(fieldName);
186
181
  * if (existingConfig) {
187
182
  * const newConfig = existingConfig.clone();
@@ -203,7 +198,7 @@ export interface FeatureLayerProperties extends LayerProperties, APIKeyMixinProp
203
198
  * var newConfigs = clone(layer.fieldConfigurations);
204
199
  * newConfigs.splice(index, 1);
205
200
  * layer.fieldConfigurations = newConfigs;
206
- * }
201
+ * }
207
202
  * };
208
203
  */
209
204
  fieldConfigurations?: FieldConfigurationProperties[] | null;
@@ -902,23 +897,19 @@ export abstract class __FeatureLayerSansType extends FeatureLayerSuperclass {
902
897
  accessor editingEnabled: boolean;
903
898
  /**
904
899
  * An array of [FieldConfiguration](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FieldConfiguration/) objects that control how fields are displayed in popups and other UI elements. Each object specifies options for an individual field, such as its display name, via `alias`, and formatting rules, via `fieldFormat`. Assign this property before the layer loads to ensure the configurations take effect. For more information, see the [FieldConfiguration](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FieldConfiguration/) documentation.
905
- *
906
900
  * If no field configurations are provided, they are automatically created when a [popupTemplate](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#popupTemplate) is assigned to the layer. If no [popupTemplate](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#popupTemplate) is set, you can manually define field configurations to customize how fields are shown.
907
- *
908
901
  * > [!WARNING]
909
902
  * >
910
- * > Support is limited in version 4.34. For details, see the [FieldConfiguration](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FieldConfiguration/) documentation.
903
+ * > Support is limited in version 5.1. For details, see the [FieldConfiguration](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FieldConfiguration/) documentation.
911
904
  *
912
- * To modify field configurations, clone [fieldConfigurations](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#fieldConfigurations), make the changes, and then reassign the updated clone back to `FeatureLayer.fieldConfigurations`.
905
+ * To modify field configurations, clone [fieldConfigurations](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#fieldConfigurations), make the changes, and then reassign the updated clone back to [fieldConfigurations](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#fieldConfigurations).
913
906
  *
914
907
  * @since 4.34
915
- * @see [getFieldConfiguration()](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#getFieldConfiguration)
916
- * @see [getFieldAlias()](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#getFieldAlias)
917
- * @see [FieldConfiguration](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FieldConfiguration/)
908
+ * @see [FeatureLayer.getFieldConfiguration](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#getFieldConfiguration)
909
+ * @see [FeatureLayer.getFieldAlias](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#getFieldAlias)
918
910
  * @example
919
911
  * // Adding a new field configuration
920
- * const addNewConfig = (layer, fieldName, alias,
921
- * fieldFormat) => {
912
+ * const addNewConfig = (layer, fieldName, alias, fieldFormat) => {
922
913
  * // Check if there is already an existing configuration for fieldName
923
914
  * const existingConfig = layer.getFieldConfiguration(fieldName);
924
915
  * if (!existingConfig) {
@@ -930,8 +921,7 @@ export abstract class __FeatureLayerSansType extends FeatureLayerSuperclass {
930
921
  * };
931
922
  * @example
932
923
  * // Updating an existing field configuration
933
- * const updateConfig = (layer, fieldName, alias,
934
- * fieldFormat) => {
924
+ * const updateConfig = (layer, fieldName, alias, fieldFormat) => {
935
925
  * const existingConfig = layer.getFieldConfiguration(fieldName);
936
926
  * if (existingConfig) {
937
927
  * const newConfig = existingConfig.clone();
@@ -953,7 +943,7 @@ export abstract class __FeatureLayerSansType extends FeatureLayerSuperclass {
953
943
  * var newConfigs = clone(layer.fieldConfigurations);
954
944
  * newConfigs.splice(index, 1);
955
945
  * layer.fieldConfigurations = newConfigs;
956
- * }
946
+ * }
957
947
  * };
958
948
  */
959
949
  get fieldConfigurations(): FieldConfiguration[] | null | undefined;
@@ -1454,13 +1444,13 @@ export abstract class __FeatureLayerSansType extends FeatureLayerSuperclass {
1454
1444
  * Creates default field configuration objects that define the display properties of fields.
1455
1445
  * These field configurations are generated from the layer's [fields](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#fields) property.
1456
1446
  *
1457
- * @returns An array of field configuration objects, or `null` if
1458
- * the layer does not have any fields that require formatting.
1447
+ * @returns An array of field configuration objects, or `null` if the layer does not have any fields that require formatting.
1459
1448
  * @since 4.34
1460
- * @see [fieldConfigurations](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#fieldConfigurations)
1449
+ * @see [FeatureLayer.fieldConfigurations](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#fieldConfigurations)
1450
+ * @returns An array of field configuration objects, or `null` if the layer does not have any fields that require formatting.
1461
1451
  * @example
1462
- * const fieldConfigs = featureLayer.createFieldConfigurations();
1463
- * featureLayer.fieldConfigurations = fieldConfigs;
1452
+ * const fieldConfigs = layer.createFieldConfigurations();
1453
+ * layer.fieldConfigurations = fieldConfigs;
1464
1454
  */
1465
1455
  createFieldConfigurations(): FieldConfiguration[] | null | undefined;
1466
1456
  /**
@@ -1563,30 +1553,30 @@ export abstract class __FeatureLayerSansType extends FeatureLayerSuperclass {
1563
1553
  */
1564
1554
  getFeatureType(feature: Graphic | null | undefined): FeatureType | null | undefined;
1565
1555
  /**
1566
- * Returns the alias of the specified field. Previously, this value was commonly retrieved from [FeatureLayer.popupTemplate.fieldInfos[x].label](https://developers.arcgis.com/javascript/latest/references/core/popup/FieldInfo/#label) or [FeatureLayer.fields[x].alias](https://developers.arcgis.com/javascript/latest/references/core/layers/support/Field/#alias). While these properties are still supported, this method is now the recommended approach for obtaining a field's alias.
1556
+ * Returns the alias of the specified field. Previously, this value was commonly retrieved from [Layer.popupTemplate.fieldInfos[x].label](https://developers.arcgis.com/javascript/latest/references/core/popup/FieldInfo/#label) or [Layer.fields[x].alias](https://developers.arcgis.com/javascript/latest/references/core/layers/support/Field/#alias). While these properties are still supported, this method is now the recommended approach for obtaining a field's alias.
1567
1557
  *
1568
1558
  * The alias is resolved in the following order:
1569
1559
  *
1570
1560
  * 1. [Field configuration alias](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#fieldConfigurations)
1571
- * 2. [Field.alias](https://developers.arcgis.com/javascript/latest/references/core/layers/support/Field/#alias) defined on the field.
1561
+ * 2. [Field alias](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#fields) defined on the field.
1572
1562
  *
1573
- * @param fieldName - The name of the field.
1574
- * @returns The field alias of the specified field.
1563
+ * @param fieldName - The name of the field for which to get the alias.
1564
+ * @returns The alias of the specified field.
1575
1565
  * @since 4.34
1576
- * @see [fieldConfigurations](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#fieldConfigurations)
1577
- * @see [getFieldConfiguration()](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#getFieldConfiguration)
1566
+ * @see [FeatureLayer.fieldConfigurations](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#fieldConfigurations)
1567
+ * @see [FeatureLayer.getFieldConfiguration](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#getFieldConfiguration)
1578
1568
  */
1579
1569
  getFieldAlias(fieldName: string): string | null | undefined;
1580
1570
  /**
1581
1571
  * Returns the [FieldConfigurations](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FieldConfiguration/) for the specified field. The field configuration provides optional formatting and display information for the field.
1582
1572
  *
1583
- * Previously, field formatting was commonly retrieved from [FeatureLayer.popupTemplate.fieldInfos[x].format](https://developers.arcgis.com/javascript/latest/references/core/popup/FieldInfo/#format). This is no longer needed, instead use [FeatureLayer.getFieldConfiguration(fieldname).fieldFormat](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FieldConfiguration/#fieldFormat) to retrieve the field configuration formatting.
1573
+ * Previously, field formatting was commonly retrieved from [Layer.popupTemplate.fieldInfos[x].format](https://developers.arcgis.com/javascript/latest/references/core/popup/FieldInfo/#format). This is no longer needed, instead use [Layer.getFieldConfiguration(fieldname).fieldFormat](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FieldConfiguration/#fieldFormat) to retrieve the field configuration formatting.
1584
1574
  *
1585
- * @param fieldName - The name of the field.
1575
+ * @param fieldName - The name of the field for which to get the configuration.
1586
1576
  * @returns The field configuration of the specified field.
1587
1577
  * @since 4.34
1588
- * @see [fieldConfigurations](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#fieldConfigurations)
1589
- * @see [getFieldAlias()](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#getFieldAlias)
1578
+ * @see [FeatureLayer.fieldConfigurations](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#fieldConfigurations)
1579
+ * @see [FeatureLayer.getFieldAlias](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#getFieldAlias)
1590
1580
  */
1591
1581
  getFieldConfiguration(fieldName: string): FieldConfiguration | null | undefined;
1592
1582
  /**
@@ -307,7 +307,7 @@ export default class KnowledgeGraphLayer extends KnowledgeGraphLayerSuperclass {
307
307
  * const layerInclusionMemberDefinition = new Map();
308
308
  * layerInclusionMemberDefinition.set("{1A4W8G4-W52G-W89G-1W5G-J1R4S8H52H4S}",{id:"{1A4W8G4-W52G-W89G-1W5G-J1R4S8H52H4S}"})
309
309
  *
310
- * //The layerInclusionDefinition specifies whether to use all of the data in a named type or only the records
310
+ * // The layerInclusionDefinition specifies whether to use all of the data in a named type or only the records
311
311
  * // specified in the 'members' list. In this case we only want the records specified.
312
312
  * const layerInclusionDefinition = {
313
313
  * useAllData: false, //only include instances in the member list
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{fetchAndConvertSerializedKnowledgeIdMap as i,serializeInclusionDefinitionToIdCollectionsMapPbf as t}from"../applications/KnowledgeStudio/resourceSerializationUtils.js";import a from"../core/Collection.js";import s from"../core/Error.js";import n from"../core/Logger.js";import{getOrCreateMapValue as r}from"../core/MapUtils.js";import{MultiOriginJSONSupportMixin as o}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as l}from"../core/promiseUtils.js";import{watch as d,sync as h}from"../core/reactiveUtils.js";import{isAbsolute as p,join as y}from"../core/urlUtils.js";import{generateUUID as c}from"../core/uuid.js";import{property as m,subclass as u}from"../core/accessorSupport/decorators.js";import{idToName as f,nameToId as g}from"../core/accessorSupport/PropertyOrigin.js";import w from"./Layer.js";import{KnowledgeGraphLayerDataManager as b}from"./knowledgeGraph/KnowledgeGraphLayerDataManager.js";import M from"./knowledgeGraph/KnowledgeGraphSublayer.js";import{getTitleFromServerUrl as T,initializeLayersFromClientData as D,getUserKGSPrivileges as _,createCapabilitiesFromKnowledgeGraph as S}from"./knowledgeGraph/layerUtils.js";import{ArcGISService as v}from"./mixins/ArcGISService.js";import{BlendLayer as L}from"./mixins/BlendLayer.js";import{CustomParametersMixin as k}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as j}from"./mixins/OperationalLayer.js";import{PortalLayer as C}from"./mixins/PortalLayer.js";import{RefreshableLayer as G}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as I}from"./mixins/ScaleRangeLayer.js";import{url as N}from"./support/commonProperties.js";import{fetchKnowledgeGraph as A}from"../rest/knowledgeGraphService.js";import{f as E,t as x}from"../chunks/persistableUrlUtils.js";import{timeZoneProperty as R}from"../time/timeZoneUtils.js";import{reader as O}from"../core/accessorSupport/decorators/reader.js";import{writer as K}from"../core/accessorSupport/decorators/writer.js";let U=class extends(L(I(G(v(j(C(o(k(w))))))))){constructor(e){super(e),this._graphTypeLookup=new Map,this._namedTypesModified=!1,this.dataManager=null,this.definitionSetMap=null,this.knowledgeGraph=null,this.layers=new(a.ofType(M)),this.memberEntityTypes=null,this.memberRelationshipTypes=null,this.operationalLayerType="KnowledgeGraphLayer",this.sublayerIdsCache=new Map,this.tables=new(a.ofType(M)),this.type="knowledge-graph",this.url=null,!e?.title&&e?.url&&(this.title=T(e.url)),this.addHandles(d(()=>this.layers.concat(this.tables),(e,i)=>this._handleSublayersChange(e,i),h))}load(e){return this.addResolvingPromise(this._doLoad(e)),Promise.resolve(this)}async _doLoad(e){try{await this.loadFromPortal({supportedTypes:["Knowledge Graph Layer"]},e)}catch(i){l(i)}await this._fetchMetadata(e),await this._initializeLayerProperties(e),this.loadLayerAssumingLocalCache(),this._layersLoadedFromAuthoritativeItem()||await D(this)}async _fetchMetadata(e){if(!this.url)throw new s("knowledge-graph:missing-url","KnowledgeGraphLayer must be created with a url");const i=await A(this.url);this.knowledgeGraph=i;const{edit:t,fullEdit:a,updateItem:n}=await _(i.serviceDefinition.serviceItemId,this.url,e);this._set("userHasEditingPrivileges",t),this._set("userHasFullEditingPrivileges",a),this._set("userHasUpdateItemPrivileges",n),this.read({dateFieldsTimeReference:i.serviceDefinition.dateFieldsTimeReference},{origin:"service"}),this._forEachGraphType(e=>{e.name&&this._graphTypeLookup.set(e.name,e)})}async _initializeLayerProperties(e){7===this.originIdOf("inclusionModeDefinition")?this._validateInclusionModeDefinition():await this._initializeInclusionModeDefinition(e),this._setMemberTypes(),this.dataManager=new b({knowledgeGraph:this.knowledgeGraph,inclusionModeDefinition:this.inclusionModeDefinition})}async _initializeInclusionModeDefinition(e){const t=this.definitionSetMap?await i(this.definitionSetMap,!0,e?.signal?{signal:e.signal}:void 0):{generateAllSublayers:!0,namedTypeDefinitions:new Map};[...this.layers.toArray(),...this.tables.toArray()].forEach(e=>{const i=this._graphTypeLookup.get(e.graphTypeName);i&&!t.namedTypeDefinitions.has(i.name)&&t.namedTypeDefinitions.set(i.name,{useAllData:!0})}),this.setAtOrigin("inclusionModeDefinition",t,f(this.originIdOf("definitionSetMap")))}_validateInclusionModeDefinition(){const{inclusionModeDefinition:e}=this;if(!e)return;const{namedTypeDefinitions:i}=e;if(i?.size>0)i.forEach((e,t)=>{const a=this._graphTypeLookup.get(t);if(!a)return n.getLogger(this).warn(`A named type, ${t}, was in the inclusion list that wasn't in the data model and will be removed`),void i.delete(t);"relationship"!==a.type&&"entity"!==a.type&&(n.getLogger(this).warn(`A named type, ${t}, was in the inclusion list that wasn't properly modeled and will be removed`),i.delete(t))});else if(!e.generateAllSublayers)throw new s("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined")}_setMemberTypes(){let e=[],i=[];const{inclusionModeDefinition:t}=this,a=t?.namedTypeDefinitions;!t||t.generateAllSublayers?(e=this.knowledgeGraph.dataModel?.entityTypes??[],i=this.knowledgeGraph.dataModel?.relationshipTypes??[]):a&&a.size>0&&a.forEach((t,a)=>{const s=this._graphTypeLookup.get(a);switch(s?.type){case"relationship":i.push(s);break;case"entity":e.push(s)}}),this.memberEntityTypes=e,this.memberRelationshipTypes=i}_forEachGraphType(e){[...this.knowledgeGraph.dataModel?.entityTypes??[],...this.knowledgeGraph.dataModel?.relationshipTypes??[]].forEach(i=>{e(i)})}_refreshNamedTypes(){this._namedTypesModified=!0;for(const e of this.layers)e.emit("refresh",{dataChanged:!0});for(const e of this.tables)e.emit("refresh",{dataChanged:!0})}async _handleNewRecords(e){const i=new Set,t=[];for(const a of e){if(!this._graphTypeLookup.has(a.typeName))continue;!1===this.layers.concat(this.tables).some(e=>e.objectType.name===a.typeName)&&(this.dataManager.sublayerCaches.set(a.typeName,new Map),i.add(a.typeName));r(this.sublayerIdsCache,a.typeName,()=>new Set).add(a.id),t.push(a)}this.dataManager.addToLayer(t);for(const a of i){const e=this._graphTypeLookup.get(a);e&&(this._addSublayer(e),"entity"===e.type?this.dataManager.entityTypeNames.add(a):this.dataManager.relationshipTypeNames.add(a))}await D(this,Array.from(i)),this._refreshNamedTypes()}_createSublayers(e,i,t){e.forEach(e=>{const a=this._createSublayer(e);t(a)&&i.push(a),this._updateSublayerCaches(e)})}_addSublayer(e){const i=this._createSublayer(e);return i.geometryType?this.layers.push(i):this.tables.push(i),i}_createSublayer(e){return new M({objectType:e,parentCompositeLayer:this,graphType:e.type})}_updateSublayers(e,i){i.forEach(i=>{i.parentCompositeLayer=this;const t=e.find(e=>e.type===i.graphType&&e.name===i.graphTypeName);t&&(i.objectType=t,this._updateSublayerCaches(t))})}_updateSublayerCaches({name:e}){if(!e)return;const i=this.dataManager.sublayerCaches;i.has(e)||i.set(e,new Map)}_saveUrlAsNewResource(e,i,t,a){e[i]="<pending>",t.pendingOperations.push(F(this.inclusionModeDefinition).then(s=>{const n=z(a);e[i]=n.itemRelativeUrl,t.toAdd.push({resource:n,content:{type:"blob",blob:s},compress:!1,finish:e=>{this.definitionSetMap=e.url}})}))}_displaysAllRecords(e){for(const[,{useAllData:i}]of e.namedTypeDefinitions)if(!i)return!1;return!0}_handleSublayersChange(e,i){i&&(i.forEach(e=>{e.parent=null}),this.removeHandles("sublayers-owner")),e&&(e.forEach(e=>{e.parent=this}),this.addHandles([e.on("after-add",({item:e})=>{e.parent=this}),e.on("after-remove",({item:e})=>{e.parent=null})],"sublayers-owner"))}_layersLoadedFromAuthoritativeItem(){const e=this.originIdOf("layers");return e>=3&&e<7}readDefinitionSetMap(e,i,t){return E(e,t)}writeDefinitionSetMap(e,i,t,a){const s=a?.portalItem,n=a?.resources,r=g(a?.origin);if(!s||!n||null==r)return void(e&&(i[t]=x(e,a)));const{inclusionModeDefinition:o}=this;if(!o||this._displaysAllRecords(o))return void(this.definitionSetMap=null);const l=this.originIdOf("inclusionModeDefinition");if(7===l||this._namedTypesModified||r<l)this._saveUrlAsNewResource(i,t,n,s);else if(r===l&&e){const r=x(e,a);p(r)?this._saveUrlAsNewResource(i,t,n,s):i[t]=r}}set inclusionModeDefinition(e){"loaded"!==this.loadStatus&&"failed"!==this.loadStatus?this._set("inclusionModeDefinition",e):n.getLogger(this).error("#inclusionModeDefinition","inclusionModeDefinition cannot be changed after the layer is loaded.")}get sublayerCapabilities(){return S(this.knowledgeGraph)}loadLayerAssumingLocalCache(){const e=[...this.memberEntityTypes,...this.memberRelationshipTypes];this.layers.length||0===this.originIdOf("tables")?0===this.originIdOf("layers")?this._createSublayers(e,this.layers,e=>!!e.geometryType):this._updateSublayers(e,this.layers):this.layers=new a,this.tables.length||0===this.originIdOf("layers")?0===this.originIdOf("tables")?this._createSublayers(e,this.tables,e=>!e.geometryType):this._updateSublayers(e,this.tables):this.tables=new a,this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e,i)=>{const t=r(this.sublayerIdsCache,i,()=>new Set);e.members?.forEach(e=>{t.add(e.id)})})}async addRecords(e){await this.load(),await this._handleNewRecords(e)}async createSublayerForNamedType(e){await this.load();const i=this._graphTypeLookup.get(e);if(!i)throw new s("knowledge-graph:missing-type","The specified type does not exist in the layer's graph data model.");if(this.dataManager.sublayerCaches.has(e))throw new s("knowledge-graph:duplicate-type","The specified type already exists as a sublayer.");this.dataManager.sublayerCaches.set(e,new Map),r(this.sublayerIdsCache,e,()=>new Set);const t=this._addSublayer(i);return"entity"===i.type?this.dataManager.entityTypeNames.add(e):this.dataManager.relationshipTypeNames.add(e),this.dataManager.inclusionModeDefinition&&this.dataManager.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!0}),await D(this,[e]),this._refreshNamedTypes(),t}convertSublayerToDynamicData(e){if(!this.dataManager.inclusionModeDefinition)throw new s("knowledge-graph:fully-dynamic-membership","This Knowledge Graph Layer already uses fully dynamic membership, individual sublayers cannot be converted");if(!this._graphTypeLookup.get(e))throw new s("knowledge-graph:missing-type","The specified type does not exist in the layer's graph data model.");if(!this.dataManager.sublayerCaches.has(e))throw new s("knowledge-graph:duplicate-type","The specified type does not exist as a sublayer.");const i=this.dataManager.inclusionModeDefinition.namedTypeDefinitions.get(e);i?.useAllData?n.getLogger(this).warn("This Knowledge Graph Layer already uses dynamic membership for the sublayer - no conversion was made"):(this.dataManager.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!0}),this.sublayerIdsCache.delete(e),this._refreshNamedTypes())}convertSublayerToExplicitMembership(e){if(!this.dataManager.inclusionModeDefinition)throw new s("knowledge-graph:fully-dynamic-membership","This Knowledge Graph Layer already uses fully dynamic membership, individual sublayers cannot be converted");if(!this._graphTypeLookup.get(e))throw new s("knowledge-graph:missing-type","The specified type does not exist in the layer's graph data model.");const i=this.dataManager.inclusionModeDefinition.namedTypeDefinitions.get(e);if(!i||i.useAllData){if(!this.dataManager.sublayerCaches.has(e))throw new s("knowledge-graph:duplicate-type","The specified type does not exist as a sublayer.");this.sublayerIdsCache.set(e,new Set),this.dataManager.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!1,members:new Map}),this._refreshNamedTypes()}else n.getLogger(this).warn("This Knowledge Graph Layer already uses explicit membership for the sublayer - no conversion was made")}convertToFullyDynamicData(){this.dataManager.inclusionModeDefinition||n.getLogger(this).warn("This Knowledge Graph Layer already uses fully dynamic membership - no conversion was made"),this.sublayerIdsCache.clear(),this.dataManager.inclusionModeDefinition=null,this._refreshNamedTypes()}convertToExplicitMembership(){this.dataManager.inclusionModeDefinition&&this.dataManager.inclusionModeDefinition.namedTypeDefinitions.size>0&&n.getLogger(this).warn("This Knowledge Graph Layer already uses explicit membership - no conversion was made"),this.dataManager.inclusionModeDefinition={generateAllSublayers:!1,namedTypeDefinitions:new Map};for(const e of this.dataManager.sublayerCaches.keys())r(this.sublayerIdsCache,e,()=>new Set),this.dataManager.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!1,members:new Map});this._refreshNamedTypes()}async removeRecords(e){await this.load();const i=[];for(const t of e)!1===this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(t.typeName)?.useAllData&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(t.typeName)?.members?.has(t.id)&&i.push(t);this.dataManager.removeFromLayer(i);for(const t of i)this.sublayerIdsCache.get(t.typeName)?.delete(t.id);return this._refreshNamedTypes(),i}};e([m()],U.prototype,"dataManager",void 0),e([m({json:{write:{ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],U.prototype,"definitionSetMap",void 0),e([O("definitionSetMap")],U.prototype,"readDefinitionSetMap",null),e([K("definitionSetMap")],U.prototype,"writeDefinitionSetMap",null),e([m()],U.prototype,"inclusionModeDefinition",null),e([m()],U.prototype,"knowledgeGraph",void 0),e([m({type:a.ofType(M),json:{write:{ignoreOrigin:!0}}})],U.prototype,"layers",void 0),e([m()],U.prototype,"memberEntityTypes",void 0),e([m()],U.prototype,"memberRelationshipTypes",void 0),e([m({type:["KnowledgeGraphLayer"]})],U.prototype,"operationalLayerType",void 0),e([m()],U.prototype,"sublayerCapabilities",null),e([m()],U.prototype,"sublayerIdsCache",void 0),e([m({type:a.ofType(M),json:{write:{ignoreOrigin:!0}}})],U.prototype,"tables",void 0),e([m({json:{read:!1}})],U.prototype,"type",void 0),e([m(N)],U.prototype,"url",void 0),e([m(R("dateFieldsTimeReference"))],U.prototype,"dateFieldsTimeZone",void 0),U=e([u("esri.layers.KnowledgeGraphLayer")],U);const P=U;async function F(e){const i=await t(e);return new Blob([i],{type:"application/x-protobuf"})}function z(e){const i=`definitionSetMap-${c()}.dat`,t=y("knowledgeGraphLayer",i);return e.resourceFromPath(t)}export{P as default};
2
+ import{__decorate as e}from"tslib";import{fetchAndConvertSerializedKnowledgeIdMap as i,serializeInclusionDefinitionToIdCollectionsMapPbf as t}from"../applications/KnowledgeStudio/resourceSerializationUtils.js";import a from"../core/Collection.js";import s from"../core/Error.js";import n from"../core/Logger.js";import{getOrCreateMapValue as o}from"../core/MapUtils.js";import{MultiOriginJSONSupportMixin as r}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as l}from"../core/promiseUtils.js";import{watch as d,sync as h}from"../core/reactiveUtils.js";import{isAbsolute as p,join as y}from"../core/urlUtils.js";import{generateUUID as c}from"../core/uuid.js";import{property as m,subclass as u}from"../core/accessorSupport/decorators.js";import{idToName as f,nameToId as g}from"../core/accessorSupport/PropertyOrigin.js";import w from"./Layer.js";import{KnowledgeGraphLayerDataManager as M}from"./knowledgeGraph/KnowledgeGraphLayerDataManager.js";import b from"./knowledgeGraph/KnowledgeGraphSublayer.js";import{getTitleFromServerUrl as T,initializeLayersFromClientData as D,getUserKGSPrivileges as _,createCapabilitiesFromKnowledgeGraph as S}from"./knowledgeGraph/layerUtils.js";import{ArcGISService as v}from"./mixins/ArcGISService.js";import{BlendLayer as L}from"./mixins/BlendLayer.js";import{CustomParametersMixin as k}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as j}from"./mixins/OperationalLayer.js";import{PortalLayer as A}from"./mixins/PortalLayer.js";import{RefreshableLayer as C}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as G}from"./mixins/ScaleRangeLayer.js";import{url as I}from"./support/commonProperties.js";import{fetchKnowledgeGraph as N}from"../rest/knowledgeGraphService.js";import{f as E,t as x}from"../chunks/persistableUrlUtils.js";import{timeZoneProperty as R}from"../time/timeZoneUtils.js";import{reader as O}from"../core/accessorSupport/decorators/reader.js";import{writer as K}from"../core/accessorSupport/decorators/writer.js";let U=class extends(L(G(C(v(j(A(r(k(w))))))))){constructor(e){super(e),this._graphTypeLookup=new Map,this._namedTypesModified=!1,this.dataManager=null,this.definitionSetMap=null,this.knowledgeGraph=null,this.layers=new(a.ofType(b)),this.memberEntityTypes=null,this.memberRelationshipTypes=null,this.operationalLayerType="KnowledgeGraphLayer",this.sublayerIdsCache=new Map,this.tables=new(a.ofType(b)),this.type="knowledge-graph",this.url=null,!e?.title&&e?.url&&(this.title=T(e.url)),this.addHandles(d(()=>this.layers.concat(this.tables),(e,i)=>this._handleSublayersChange(e,i),h))}load(e){return this.addResolvingPromise(this._doLoad(e)),Promise.resolve(this)}async _doLoad(e){try{await this.loadFromPortal({supportedTypes:["Knowledge Graph Layer"]},e)}catch(i){l(i)}await this._fetchMetadata(e),await this._initializeLayerProperties(e),this.loadLayerAssumingLocalCache(),this._layersLoadedFromAuthoritativeItem()||await D(this)}async _fetchMetadata(e){if(!this.url)throw new s("knowledge-graph:missing-url","KnowledgeGraphLayer must be created with a url");const i=await N(this.url);this.knowledgeGraph=i;const{edit:t,fullEdit:a,updateItem:n}=await _(i.serviceDefinition.serviceItemId,this.url,e);this._set("userHasEditingPrivileges",t),this._set("userHasFullEditingPrivileges",a),this._set("userHasUpdateItemPrivileges",n),this.read({dateFieldsTimeReference:i.serviceDefinition.dateFieldsTimeReference},{origin:"service"}),this._forEachGraphType(e=>{e.name&&this._graphTypeLookup.set(e.name,e)})}async _initializeLayerProperties(e){7===this.originIdOf("inclusionModeDefinition")?this._validateInclusionModeDefinition():await this._initializeInclusionModeDefinition(e),this._setMemberTypes(),this.dataManager=new M({knowledgeGraph:this.knowledgeGraph,inclusionModeDefinition:this.inclusionModeDefinition})}async _initializeInclusionModeDefinition(e){const t=this.definitionSetMap?await i(this.definitionSetMap,!0,e?.signal?{signal:e.signal}:void 0):{generateAllSublayers:!0,namedTypeDefinitions:new Map};[...this.layers.toArray(),...this.tables.toArray()].forEach(e=>{const i=this._graphTypeLookup.get(e.graphTypeName);i&&!t.namedTypeDefinitions.has(i.name)&&t.namedTypeDefinitions.set(i.name,{useAllData:!0})}),this.setAtOrigin("inclusionModeDefinition",t,f(this.originIdOf("definitionSetMap")))}_validateInclusionModeDefinition(){const{inclusionModeDefinition:e}=this;if(!e)return;const{namedTypeDefinitions:i}=e;if(i?.size>0)i.forEach((e,t)=>{const a=this._graphTypeLookup.get(t);if(!a)return n.getLogger(this).warn(`A named type, ${t}, was in the inclusion list that wasn't in the data model and will be removed`),void i.delete(t);"relationship"!==a.type&&"entity"!==a.type&&(n.getLogger(this).warn(`A named type, ${t}, was in the inclusion list that wasn't properly modeled and will be removed`),i.delete(t))});else if(!e.generateAllSublayers)throw new s("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined")}_setMemberTypes(){let e=[],i=[];const{inclusionModeDefinition:t}=this,a=t?.namedTypeDefinitions;!t||t.generateAllSublayers?(e=this.knowledgeGraph.dataModel?.entityTypes??[],i=this.knowledgeGraph.dataModel?.relationshipTypes??[]):a&&a.size>0&&a.forEach((t,a)=>{const s=this._graphTypeLookup.get(a);switch(s?.type){case"relationship":i.push(s);break;case"entity":e.push(s)}}),this.memberEntityTypes=e,this.memberRelationshipTypes=i}_forEachGraphType(e){[...this.knowledgeGraph.dataModel?.entityTypes??[],...this.knowledgeGraph.dataModel?.relationshipTypes??[]].forEach(i=>{e(i)})}_refreshNamedTypes(){this._namedTypesModified=!0;for(const e of this.layers)e.emit("refresh",{dataChanged:!0});for(const e of this.tables)e.emit("refresh",{dataChanged:!0})}async _handleNewRecords(e){const i=new Set,t=[];for(const a of e){if(!this._graphTypeLookup.has(a.typeName))continue;!1===this.layers.concat(this.tables).some(e=>e.objectType.name===a.typeName)&&(this.dataManager.sublayerCaches.set(a.typeName,new Map),i.add(a.typeName));o(this.sublayerIdsCache,a.typeName,()=>new Set).add(a.id),t.push(a)}this.dataManager.addToLayer(t);for(const a of i){const e=this._graphTypeLookup.get(a);e&&(this._addSublayer(e),"entity"===e.type?this.dataManager.entityTypeNames.add(a):this.dataManager.relationshipTypeNames.add(a))}await D(this,Array.from(i)),this._refreshNamedTypes()}_createSublayers(e,i,t){e.forEach(e=>{const a=this._createSublayer(e);t(a)&&i.push(a),this._updateSublayerCaches(e)})}_addSublayer(e){const i=this._createSublayer(e);return i.geometryType?this.layers.push(i):this.tables.push(i),i}_createSublayer(e){return new b({objectType:e,parentCompositeLayer:this,graphType:e.type})}_updateSublayers(e,i){i.forEach(i=>{i.parentCompositeLayer=this;const t=e.find(e=>e.type===i.graphType&&e.name===i.graphTypeName);t&&(i.objectType=t,this._updateSublayerCaches(t))})}_updateSublayerCaches({name:e}){if(!e)return;const i=this.dataManager.sublayerCaches;i.has(e)||i.set(e,new Map)}_saveUrlAsNewResource(e,i,t,a){e[i]="<pending>",t.pendingOperations.push(F(this.inclusionModeDefinition).then(s=>{const n=z(a);e[i]=n.itemRelativeUrl,t.toAdd.push({resource:n,content:{type:"blob",blob:s},compress:!1,finish:e=>{this.definitionSetMap=e.url}})}))}_displaysAllRecords(e){for(const[,{useAllData:i}]of e.namedTypeDefinitions)if(!i)return!1;return!0}_handleSublayersChange(e,i){i&&(i.forEach(e=>{e.parent=null}),this.removeHandles("sublayers-owner")),e&&(e.forEach(e=>{e.parent=this}),this.addHandles([e.on("after-add",({item:e})=>{e.parent=this}),e.on("after-remove",({item:e})=>{e.parent=null})],"sublayers-owner"))}_layersLoadedFromAuthoritativeItem(){const e=this.originIdOf("layers");return e>=3&&e<7}readDefinitionSetMap(e,i,t){return E(e,t)}writeDefinitionSetMap(e,i,t,a){const s=a?.portalItem,n=a?.resources,o=g(a?.origin);if(!s||!n||null==o)return void(e&&(i[t]=x(e,a)));const{inclusionModeDefinition:r}=this;if(!r||this._displaysAllRecords(r))return void(this.definitionSetMap=null);const l=this.originIdOf("inclusionModeDefinition");if(7===l||this._namedTypesModified||o<l)this._saveUrlAsNewResource(i,t,n,s);else if(o===l&&e){const o=x(e,a);p(o)?this._saveUrlAsNewResource(i,t,n,s):i[t]=o}}set inclusionModeDefinition(e){"loaded"!==this.loadStatus&&"failed"!==this.loadStatus?this._set("inclusionModeDefinition",e):n.getLogger(this).error("#inclusionModeDefinition","inclusionModeDefinition cannot be changed after the layer is loaded.")}get sublayerCapabilities(){return S(this.knowledgeGraph)}loadLayerAssumingLocalCache(){const e=[...this.memberEntityTypes,...this.memberRelationshipTypes];this.layers.length||0===this.originIdOf("tables")?0===this.originIdOf("layers")?this._createSublayers(e,this.layers,e=>!!e.geometryType):this._updateSublayers(e,this.layers):this.layers=new a,this.tables.length||0===this.originIdOf("layers")?0===this.originIdOf("tables")?this._createSublayers(e,this.tables,e=>!e.geometryType):this._updateSublayers(e,this.tables):this.tables=new a,this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e,i)=>{const t=o(this.sublayerIdsCache,i,()=>new Set);e.members?.forEach(e=>{t.add(e.id)})})}async addRecords(e){await this.load(),await this._handleNewRecords(e)}async createSublayerForNamedType(e){await this.load();const i=this._graphTypeLookup.get(e);if(!i)throw new s("knowledge-graph:missing-type","The specified type does not exist in the layer's graph data model.");if(this.dataManager.sublayerCaches.has(e))throw new s("knowledge-graph:duplicate-type","The specified type already exists as a sublayer.");this.dataManager.sublayerCaches.set(e,new Map),o(this.sublayerIdsCache,e,()=>new Set);const t=this._addSublayer(i);return"entity"===i.type?this.dataManager.entityTypeNames.add(e):this.dataManager.relationshipTypeNames.add(e),this.dataManager.inclusionModeDefinition&&this.dataManager.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!0}),await D(this,[e]),this._refreshNamedTypes(),t}convertSublayerToDynamicData(e){if(!this.dataManager.inclusionModeDefinition)throw new s("knowledge-graph:fully-dynamic-membership","This Knowledge Graph Layer already uses fully dynamic membership, individual sublayers cannot be converted");if(!this._graphTypeLookup.get(e))throw new s("knowledge-graph:missing-type","The specified type does not exist in the layer's graph data model.");if(!this.dataManager.sublayerCaches.has(e))throw new s("knowledge-graph:duplicate-type","The specified type does not exist as a sublayer.");const i=this.dataManager.inclusionModeDefinition.namedTypeDefinitions.get(e);i?.useAllData?n.getLogger(this).warn("This Knowledge Graph Layer already uses dynamic membership for the sublayer - no conversion was made"):(this.dataManager.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!0}),this.sublayerIdsCache.delete(e),this._refreshNamedTypes())}convertSublayerToExplicitMembership(e){if(!this.dataManager.inclusionModeDefinition)throw new s("knowledge-graph:fully-dynamic-membership","This Knowledge Graph Layer already uses fully dynamic membership, individual sublayers cannot be converted");if(!this._graphTypeLookup.get(e))throw new s("knowledge-graph:missing-type","The specified type does not exist in the layer's graph data model.");const i=this.dataManager.inclusionModeDefinition.namedTypeDefinitions.get(e);if(!i||i.useAllData){if(!this.dataManager.sublayerCaches.has(e))throw new s("knowledge-graph:duplicate-type","The specified type does not exist as a sublayer.");this.sublayerIdsCache.set(e,new Set),this.dataManager.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!1,members:new Map}),this._refreshNamedTypes()}else n.getLogger(this).warn("This Knowledge Graph Layer already uses explicit membership for the sublayer - no conversion was made")}convertToFullyDynamicData(){this.dataManager.inclusionModeDefinition||n.getLogger(this).warn("This Knowledge Graph Layer already uses fully dynamic membership - no conversion was made"),this.sublayerIdsCache.clear(),this.dataManager.inclusionModeDefinition=null,this.setAtOrigin("inclusionModeDefinition",this.dataManager.inclusionModeDefinition,f(7)),this._refreshNamedTypes()}convertToExplicitMembership(){this.dataManager.inclusionModeDefinition&&this.dataManager.inclusionModeDefinition.namedTypeDefinitions.size>0&&n.getLogger(this).warn("This Knowledge Graph Layer already uses explicit membership - no conversion was made"),this.dataManager.inclusionModeDefinition={generateAllSublayers:!1,namedTypeDefinitions:new Map},this.setAtOrigin("inclusionModeDefinition",this.dataManager.inclusionModeDefinition,f(7));for(const e of this.dataManager.sublayerCaches.keys())o(this.sublayerIdsCache,e,()=>new Set),this.dataManager.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!1,members:new Map});this._refreshNamedTypes()}async removeRecords(e){await this.load();const i=[];for(const t of e)!1===this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(t.typeName)?.useAllData&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(t.typeName)?.members?.has(t.id)&&i.push(t);this.dataManager.removeFromLayer(i);for(const t of i)this.sublayerIdsCache.get(t.typeName)?.delete(t.id);return this._refreshNamedTypes(),i}};e([m()],U.prototype,"dataManager",void 0),e([m({json:{write:{ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],U.prototype,"definitionSetMap",void 0),e([O("definitionSetMap")],U.prototype,"readDefinitionSetMap",null),e([K("definitionSetMap")],U.prototype,"writeDefinitionSetMap",null),e([m()],U.prototype,"inclusionModeDefinition",null),e([m()],U.prototype,"knowledgeGraph",void 0),e([m({type:a.ofType(b),json:{write:{ignoreOrigin:!0}}})],U.prototype,"layers",void 0),e([m()],U.prototype,"memberEntityTypes",void 0),e([m()],U.prototype,"memberRelationshipTypes",void 0),e([m({type:["KnowledgeGraphLayer"]})],U.prototype,"operationalLayerType",void 0),e([m()],U.prototype,"sublayerCapabilities",null),e([m()],U.prototype,"sublayerIdsCache",void 0),e([m({type:a.ofType(b),json:{write:{ignoreOrigin:!0}}})],U.prototype,"tables",void 0),e([m({json:{read:!1}})],U.prototype,"type",void 0),e([m(I)],U.prototype,"url",void 0),e([m(R("dateFieldsTimeReference"))],U.prototype,"dateFieldsTimeZone",void 0),U=e([u("esri.layers.KnowledgeGraphLayer")],U);const P=U;async function F(e){const i=await t(e);return new Blob([i],{type:"application/x-protobuf"})}function z(e){const i=`definitionSetMap-${c()}.dat`,t=y("knowledgeGraphLayer",i);return e.resourceFromPath(t)}export{P as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import i from"../request.js";import{has}from"../applications/Components/baUtils.js";import t from"../core/Accessor.js";import s from"../core/Error.js";import r from"../core/Logger.js";import{someMap as a}from"../core/MapUtils.js";import{createAbortError as n,isAborted as o,isAbortError as l}from"../core/promiseUtils.js";import{watch as d}from"../core/reactiveUtils.js";import{property as h,subclass as _}from"../core/accessorSupport/decorators.js";import y from"../geometry/SpatialReference.js";import{isGeographic as u}from"../geometry/support/spatialReferenceUtils.js";import c from"../geometry/support/WKIDUnitConversion.js";import{wasmFailedToInit as g,elevQueriesFull as m,elevQueriesGenericFail as p,invalidLayerView as w}from"./ILyr3DWasmPerSceneView.js";import{Lyr3DWorkerHandle as b}from"./Lyr3DWorkerHandle.js";import{getVCSFromHeightModelInfo as f}from"./support/tiles3DUtils.js";import{loadLyr3DMainWASM as v}from"../libs/lyr3d/Lyr3DModule.js";import{getElevationOffsetInMeters as D}from"../support/elevationInfoUtils.js";import{makeScheduleFunction as R}from"../views/3d/layers/support/makeScheduleFunction.js";import{TaskPriority as M}from"../views/support/Scheduler.js";import{Yield as k}from"../views/support/Yield.js";const L=3857,C=32662,S=4326,W=5773;let V=class extends t{constructor(e){super(e),this._lyr3DMainPromise=null,this._lyr3DMain=null,this._layers=new Map,this._viewSR=null,this._haveAddedViewSRForNoOpPrj=!1,this._lyr3DBusyCount=0,this._lyr3DInternalMemoryBytes=0,this._isTerrainReady=!1,this._hasLayerThatReplacesTerrain=!1,this._elevationQueries=new Map,this._pendingJobCompleted=new Array,this._pendingJobFailed=new Array,this._pendingRenderableCreated=new Array,this._debugFlags=new Set,this._debugLevel=2,this._wasmNotLoaded="method requiring WASM was called when WASM isn't loaded",this._pulseTaskHandle=null,this._cameraDirty=!0,this._cameraElevationDirty=!0,this._debugFlags.add(0),this._debugFlags.add(1),this._debugFlags.add(2)}_debugLog(e,i,t,s=!0){if(this._debugFlags.has(e)&&this._debugLevel>=i){const e=s?`[js] ${t}`:`${t}`;0===i||1===i?r.getLogger(this).error(e):2===i&&r.getLogger(this).warn(e),r.getLogger(this).info(e)}}get viewSR(){return this._viewSR}get lyr3DInternalMemoryBytes(){return this._lyr3DInternalMemoryBytes}initialize(){this._debugLevel>2&&(r.getLogger(this).level="info"),this._debugLog(0,3,"Lyr3DWasmPerSceneView.initialize()"),this.addHandles([d(()=>this.view.state?.contentCamera,()=>this._updateWasmCamera()),d(()=>this.view.state?.contentCamera.relativeElevation,()=>{this._cameraElevationDirty=!0,this._markAllLayerViewsUpdating()})]),this._pulseTaskHandle=this.view.resourceController.scheduler.registerTask(M.LYR3D,this)}destroy(){this._debugLog(0,3,"Lyr3DWasmPerSceneView.destroy()"),this._lyr3DMain&&(this._layers.forEach(e=>{e.abortController.abort()}),this._elevationQueries.forEach((e,i)=>{this._lyr3DMain.cancel_elevation_query(i),e.rejectCallback(n())}),this._elevationQueries.clear(),this._lyr3DMain.uninitialize_lyr3d_wasm(),this._lyr3DMain=null),this._pendingJobCompleted.length=0,this._pendingJobFailed.length=0,this._pendingRenderableCreated.length=0;const e=this._workerHandle;e&&e.destroyWasm().then(()=>{this._workerHandle?.destroy(),this._workerHandle=null}),this._pulseTaskHandle?.remove(),this._pulseTaskHandle=null}get readyToRun(){return this._hasPendingPulseWork()}runTask(e){return this._pulseTask(e),k}_hasPendingPulseWork(){return!!this._lyr3DMain&&(this._cameraDirty||this._cameraElevationDirty||this._pendingJobCompleted.length>0||this._pendingJobFailed.length>0||this._pendingRenderableCreated.length>0||this._elevationQueries.size>0||a(this._layers,e=>this._isUpdating(e)))}addLayerView(e){return this._lyr3DMain?this._addLayerView(e):(this._debugLog(0,1,"Lyr3DWasmPerSceneView.add3DTilesLayerView() called when WASM wasn't initialized"),{wasmLayerId:g})}removeLayerView(e){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),0;this._doRemoveLayerView(e);const i=this._layers.size;return 0===i&&(this._debugLog(0,3,"Lyr3DWasmPerSceneView.remove3DTilesLayerView() no Lyr3D layers left after removing a layer, destroying"),this.destroy()),i}getValidLayerViewCount(){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),0;let e=0;return this._layers.forEach(i=>{i.layerView.wasmLayerId>=0&&++e}),e}setEnabled(e,i){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const t=this._layers.get(e.wasmLayerId);if(t){this._lyr3DMain.set_enabled(e.wasmLayerId,i),t.needMemoryUsageUpdate=!0;const s=this._isUpdating(t);t.needFrame=!0,s||t.layerView.updatingFlagChanged()}}setLayerOffset(e,i){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const t=this._layers.get(e.wasmLayerId);t&&(this._lyr3DMain.set_carto_offset_z(e.wasmLayerId,i),t.needFrame=!0,t.layerView.updatingFlagChanged())}getAttributionText(){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),[];return this._lyr3DMain.get_current_attribution_text().split("|")}onRenderableEvicted(e,i,t){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);this._layers.get(e.wasmLayerId)&&this._lyr3DMain.on_renderable_evicted(e.wasmLayerId,i,t)}setMeshModifications(e,i){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const t=this._layers.get(e.wasmLayerId);if(t){const s=this._lyr3DMain._malloc(8*i.length),r=new Float64Array(this._lyr3DMain.HEAPF64.buffer,s,i.length);for(let e=0;e<i.length;++e)r[e]=i[e];this._lyr3DMain.set_mesh_modification_polygons(e.wasmLayerId,s,i.length),this._lyr3DMain._free(s);const a=this._isUpdating(t);t.needFrame=!0,a||t.layerView.updatingFlagChanged()}}isUpdating(e){if(!this._lyr3DMain&&this._lyr3DMainPromise)return!0;const i=this._layers.get(e);return!!i&&(i.outstandingJobCount>0||i.outstandingRenderableCount>0||i.needFrame||this._lyr3DBusyCount>0)}initializeWasm(e,i){return this._lyr3DMain?Promise.resolve():this.view.renderSpatialReference?(this._debugLog(0,3,"Lyr3DWasmPerSceneView.initializeWasm()"),this._lyr3DMainPromise||(this._lyr3DMainPromise=v().then(t=>{this._lyr3DMain=t,this._lyr3DMainPromise=null;const s=this._lyr3DMain.addFunction(this._onNewJob.bind(this),"v"),r=this._lyr3DMain.addFunction(this._onNewRenderable.bind(this),"v"),a=this._lyr3DMain.addFunction(this._freeRenderables.bind(this),"viii"),n=this._lyr3DMain.addFunction(this._setRenderableVisibility.bind(this),"viiii"),o=this._lyr3DMain.addFunction(this._onWasmError.bind(this),"viiii"),l=this._lyr3DMain.addFunction(this._onElevQueryComplete.bind(this),"vi");if(!this.view.renderSpatialReference)return void(this._lyr3DMain=null);this._viewSR=this.view.renderSpatialReference?.toJSON();let d="global"===this.view.viewingMode?6:4;6===d?(this._viewSR.wkid=this._viewSR.latestWkid=S,this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=W,this._viewSR.wkt=""):(this._viewSR.vcsWkid||(this._viewSR.vcsWkid=f(this.view.heightModelInfo)),this.view.renderSpatialReference?.isWebMercator?(this._viewSR.wkid=this._viewSR.latestWkid=L,this._viewSR.vcsWkid||(this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=W)):this.view.renderSpatialReference?.wkid===C?(this._viewSR.wkid=this._viewSR.latestWkid=S,d=3,this._viewSR.vcsWkid||(this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=W)):this._viewSR.vcsWkid||this._viewSR.latestVcsWkid||(this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=-1));const h=has("esri-lyr3D-max-concurrent-requests")??16;return this._lyr3DMain.initialize_lyr3d_wasm(o,s,r,a,n,l,e,i,d,this._cleanUpSR(this._makeSRWasmSerializable(this._viewSR)),Math.max(this._debugLevel,0),h)?(this._workerHandle=new b(R(this.view.resourceController)),this._workerHandle.promise?this._workerHandle.promise:void 0):(this._lyr3DMain=null,void this._debugLog(0,0,"Lyr3d Main WASM failed to initialize",!1))}).catch(e=>{this._debugLog(0,0,`Lyr3d WASM failed to download error = ${e}`,!1)})),this._lyr3DMainPromise):Promise.reject()}get isTerrainReady(){return this._isTerrainReady}setLodPixelThreshold(e,i){this._lyr3DMain?.set_lod_pixel_threshold(i);const t=this._layers.get(e.wasmLayerId);t&&(t.needFrame=!0,t.layerView.updatingFlagChanged())}setMaximumGaussianSplatCount(e){this._lyr3DMain.set_maximum_splat_count(e),this._layers.forEach(e=>{"gaussian-splat-3d"===e.layerView.type&&(e.needFrame=!0,e.layerView.updatingFlagChanged())})}queryElevation(e,i,t){if(!this._lyr3DMain)return Promise.reject(this._wasmNotLoaded);if(0===i.coordinates.length)return Promise.reject("no coordinates for elevation query");const s="global"===this.view.viewingMode?y.WGS84:this._viewSR.wkid===L?y.WebMercator:y.PlateCarree,r=i.projectSync(s);r&&(i=r);const a=2*i.coordinates.length,n=this._lyr3DMain._malloc(8*a),o=new Float64Array(this._lyr3DMain.HEAPF64.buffer,n,a);for(let y=0;y<i.coordinates.length;++y){const e=i.coordinates[y];o[2*y]=e.x,o[2*y+1]=e.y}const l=t?.maxGeometricError??0,d=this._lyr3DMain.create_elevation_query(e.wasmLayerId,l,n,a);if(this._lyr3DMain._free(n),d===m)return Promise.reject("max mesh elevation query limit exceeded");if(d===p)return Promise.reject("elevation query failed");const h={descriptor:i,signal:t?.signal,resolveCallback:null,rejectCallback:null},_=new Promise((e,i)=>{h.resolveCallback=e,h.rejectCallback=i});return this._elevationQueries.set(d,h),_}_checkForAbortedElevationQueries(){const e=[];this._elevationQueries.forEach((i,t)=>{o(i.signal)&&(this._lyr3DMain.cancel_elevation_query(t),i.rejectCallback(n()),e.push(t))});for(let i=0;i<e.length;++i)this._elevationQueries.delete(e[i])}_pulseTask(e){const i=this._lyr3DMain;if(i){if(this._cameraDirty){const e=this.view.state?.contentCamera;if(e){const{eye:t,center:s,up:r,near:a,far:n,fovY:o}=e,l=[e.viewport[2],e.viewport[3]],d={eye:t,center:s,up:r,near:a,far:n,fov:o,aspectRatio:e.width/e.height,viewport:l};i.set_camera_parameters(d),this._cameraDirty=!1}}if(this._cameraElevationDirty){const e=this.view.state?.contentCamera.relativeElevation;i.set_camera_elevation(e)}this._checkForAbortedElevationQueries();let t=0,s=0;this._layers.forEach(e=>{t+=e.layerView.usedMemory,s+=e.layerView.cachedMemory}),t/=1048576,s/=1048576;const r=this.view.resourceController.memoryController,a=r.usedMemory*r.maxMemory-t-this._lyr3DInternalMemoryBytes/1048576;this._lyr3DBusyCount=this._lyr3DMain.frame_pulse(r.memoryFactor,t,s,a,r.maxMemory),this._lyr3DInternalMemoryBytes=this._lyr3DMain.get_index_memory_bytes(),this._layers.forEach(e=>{this._cameraElevationDirty||(e.needFrame=!1),e.layerView.updatingFlagChanged()}),this._hasLayerThatReplacesTerrain&&!this._isTerrainReady&&(this._isTerrainReady=this._lyr3DMain.is_terrain_ready(),this._isTerrainReady&&this.notifyChange("isTerrainReady")),this._flushPendingWasmCalls(e),this._cameraElevationDirty=!1}}_isUpdating(e){return e.outstandingJobCount>0||e.outstandingRenderableCount>0||e.needFrame||this._cameraDirty||this._lyr3DBusyCount>0}_incrementJobCount(e,i){if(i.isForElevationQuery)return;const t=this._isUpdating(e);e.outstandingJobCount+=1,t||e.layerView.updatingFlagChanged()}_decrementJobCount(e,i){if(i.isForElevationQuery)return;const t=this._isUpdating(e);e.outstandingJobCount-=1;t!==this._isUpdating(e)&&e.layerView.updatingFlagChanged()}_incrementRenderableCount(e){const i=this._isUpdating(e);e.outstandingRenderableCount+=1,i||e.layerView.updatingFlagChanged()}_decrementRenderableCount(e){const i=this._isUpdating(e);e.outstandingRenderableCount-=1;i!==this._isUpdating(e)&&e.layerView.updatingFlagChanged()}_flushPendingWasmCalls(e){this._lyr3DMain&&(this._flushPendingCalls(this._pendingJobFailed,e),this._flushPendingCalls(this._pendingJobCompleted,e),this._flushPendingCalls(this._pendingRenderableCreated,e))}_flushPendingCalls(e,i){for(;!i.done&&e.length>0;){e.shift()(this._lyr3DMain),i.madeProgress()}}_onJobFailed(e,i,t){i.error.length&&this._debugLog(1,1,i.error,!1),this._lyr3DMain&&!e.layerView.destroyed&&this._pendingJobFailed.push(e=>e.on_job_failed(t.jobId,t.desc)),this._decrementJobCount(e,t)}_onJobSucceeded(e,i,t){if(this._lyr3DMain){if(e.layerView.destroyed)return void this._pendingJobFailed.push(e=>e.on_job_failed(t.jobId,t.desc));const{data:s}=i,r=e=>{const r=s.byteLength,a=e._malloc(r);try{new Uint8Array(e.HEAPU8.buffer,a,r).set(s),e.on_job_completed(t.jobId,i.jobDescJson,a,r)}finally{e._free(a)}};this._pendingJobCompleted.push(r)}this._decrementJobCount(e,t)}_getRequestPromises(e,t,s,r){const a=[];for(const n of e){const e=new URL(n);if("integrated-mesh-3dtiles"===r.type){if(e.origin===s.origin&&e.pathname===s.pathname){if(r.rootTileset){a.push(Promise.resolve(r.rootTileset.slice()));continue}}else r.session&&e.searchParams.set("session",r.session)}a.push(i(e.toString(),t).then(e=>e.data))}return a}_getInitialPromise(e,i,t,s,r,a,n){const o=this._getRequestPromises(e.urls,i,t,s);return Promise.all(o).then(e=>(r.inputs=e,this._workerHandle.invoke(r,a))).then(e=>e).catch(i=>{let t=1;return l(i)?this._debugLog(1,2,`job ${e.jobId} was cancelled.`):n&&400===i.details?.httpStatus?(t=3,this._debugLog(1,2,"Session expired, trying to create new Session.")):this._debugLog(1,1,`job ${e.jobId} failed with error ${i}.`),{status:t,error:"",jobDescJson:"",data:new Uint8Array(0),missingInputUrls:[],inputs:[]}})}async _onNewJob(){const e=this._lyr3DMain.get_next_job(),i=this._layers.get(e.layerId);if(!i)return;this._incrementJobCount(i,e);const t=i.abortController.signal,s=i.layerView.layer,r="integrated-mesh-3dtiles"===s.type?s.key:null,a="integrated-mesh-3dtiles"===s.type?s.session:null,n={responseType:"array-buffer",signal:t,query:{...i.customParameters,token:i.apiKey,key:r}},o={id:e.jobId,inputs:[],jobDescJson:e.desc.slice(),isMissingResourceCase:!1},d=new URL(s.url),h=r=>{if(1===r.status)this._onJobFailed(i,r,e);else if(0===r.status)this._onJobSucceeded(i,r,e);else if(2===r.status){const a=this._getRequestPromises(r.missingInputUrls,n,d,s);Promise.all(a).then(e=>{o.jobDescJson=r.jobDescJson,r.originalInputs?o.inputs=r.originalInputs:o.inputs=[],o.isMissingResourceCase=!0;for(const i of e)o.inputs.push(i);return this._workerHandle.invoke(o,t)}).then(t=>{1===t.status?this._onJobFailed(i,t,e):0===t.status&&this._onJobSucceeded(i,t,e)}).catch(t=>{this._decrementJobCount(i,e),l(t)?this._debugLog(1,2,`job ${e.jobId} was cancelled.`):this._debugLog(1,1,`job ${e.jobId} failed with error ${t}.`),this._lyr3DMain&&this._pendingJobFailed.push(i=>i.on_job_failed(e.jobId,e.desc))})}};try{const i=await this._getInitialPromise(e,n,d,s,o,t,a);if(3===i.status&&"integrated-mesh-3dtiles"===s.type){a===s.session&&null!==s.session&&await s.requestRootAndSession(t);h(await this._getInitialPromise(e,n,d,s,o,t,s.session))}else h(i)}catch(_){_&&this._debugLog(1,1,_.toString(),!1),this._lyr3DMain&&this._pendingJobFailed.push(i=>i.on_job_failed(e.jobId,e.desc)),this._decrementJobCount(i,e)}}_onNewRenderable(){const e=this._lyr3DMain.get_next_renderable(),{meshData:i}=e;i.data&&i.data.byteLength>0&&(i.data=i.data.slice());const t=this._layers.get(e.layerId);t&&(this._incrementRenderableCount(t),t.layerView.createRenderable(e).then(i=>{const s=i.numGaussians??0;if(this._lyr3DMain&&!t.layerView.destroyed){const{layerId:t,handle:r}=e,{memUsageBytes:a}=i;this._pendingRenderableCreated.push(e=>e.on_renderable_created(!0,t,r,a,s))}this._decrementRenderableCount(t)}).catch(i=>{if(l(i)||this._debugLog(2,1,`createRenderable failed with error ${i}.`),this._lyr3DMain&&!t.layerView.destroyed){const{layerId:i,handle:t}=e;this._pendingRenderableCreated.push(e=>e.on_renderable_created(!1,i,t,0,0))}this._decrementRenderableCount(t)}))}_freeRenderables(e,i,t){if(t<1)return;const s=this._layers.get(e);if(!s)return;const r=s.layerView,a=[],n=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,i,t);for(let o=0;o<t;++o)a.push(n[o]);for(let o=0;o<t;++o)r.freeRenderable(a[o])}_setRenderableVisibility(e,i,t,s){if(s<1)return;const r=this._layers.get(e);if(!r)return;const a=r.layerView,n=[],o=[],l=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,i,s),d=new Uint8Array(this._lyr3DMain.HEAPU8.buffer,t,s);for(let h=0;h<s;++h)n.push(l[h]),o.push(!!(1&d[h]));a.setRenderableVisibility(n,o,s)}_onWasmError(e,i,t,s){this._lyr3DMain&&this._debugLog(t,s,this._lyr3DMain.UTF8ToString(e,i),!1)}_onElevQueryComplete(e){const i=this._elevationQueries.get(e),t=this._lyr3DMain.get_elevation_query_result(e);if(i)if(t.succeeded&&t.zs){const s=t.zs.slice(),r=i.descriptor.clone();for(let e=0;e<s.length;++e)r.coordinates[e].z=s[e];this._debugLog(2,3,`Success EQ ${e}, number points ${s.length}.`),i.resolveCallback(r),this._elevationQueries.delete(e)}else i.rejectCallback(new s("elevation-query:error",t?.error??"Elevation query failed")),this._elevationQueries.delete(e);else this._debugLog(2,1,`_onElevQueryComplete called for unknown queryId ${e}.`)}_doRemoveLayerView(e){const i=this._layers.get(e.wasmLayerId);return!!i&&(i.abortController.abort(),this._lyr3DMain.remove_layer(e.wasmLayerId),this._is3DTilesIMLayerView(e)&&e.layer.replacesTerrain&&(this._hasLayerThatReplacesTerrain=!1,this._isTerrainReady=!1,this.notifyChange("isTerrainReady")),this._layers.delete(e.wasmLayerId),!0)}_is3DTilesIMLayerView(e){return"integrated-mesh-3dtiles"===e.layer.type}_isGaussianSplatLayerView(e){return"gaussian-splat"===e.layer.type}_isGaussianSplatLayer(e){return"gaussian-splat"===e.type}_toWasmQuality(e){switch(e){case"low":return 1;case"medium":return 2;case"high":return 3}}_addLayerView(e){const i=e.layer;if(!i.url||!i.rootTilesetJSON)return{wasmLayerId:w};const t="integrated-mesh-3dtiles"===i.type?0:2,s=this._lyr3DMain.validate_root_tileset(JSON.stringify(i.rootTilesetJSON),t);if(0!==s.errorCode)return{wasmLayerId:w,check:s};const a=this._lyr3DMain.get_next_layer_id(),n=new AbortController;this._layers.set(a,{layerView:e,abortController:n,needMemoryUsageUpdate:!1,outstandingJobCount:0,outstandingRenderableCount:0,customParameters:i.customParameters,apiKey:i.apiKey,needFrame:!0});const o=D(i.elevationInfo),l=this._toWasmQuality(this.view?.qualityProfile),d=e=>r.getLogger(this).error("add-spatial-reference-error","Error when adding SR:",e);let h=!1;if(this._isGaussianSplatLayerView(e)&&this._isGaussianSplatLayer(i)){let t=i.spatialReference;if(e.useEsriCrs&&i.esriCrsSpatialReference){t=i.esriCrsSpatialReference;const s=u(t);let r=1,a=1;!s&&t.wkid&&-1!==t.wkid&&(r=c.values[c[t.wkid]],a=e.metersPerVCSUnit),this._workerHandle.addSpatialReferenceInfo(this._cleanUpSR(this._makeSRWasmSerializable(t)),s,r,a).catch(d),!this._haveAddedViewSRForNoOpPrj&&t.vcsWkid&&this._viewSR.vcsWkid&&-1!==this._viewSR.vcsWkid&&this._viewSR.vcsWkid!==t.vcsWkid&&(this._workerHandle.addSpatialReferenceInfo(this._cleanUpSR(this._makeSRWasmSerializable(this._viewSR)),!1,1,1).catch(d),this._haveAddedViewSRForNoOpPrj=!0)}h=this._lyr3DMain.add_gaussian_splat_layer(l,i.url,a,o)}else this._is3DTilesIMLayerView(e)&&(h=this._lyr3DMain.add_3dtiles_layer(l,i.url,a,o,e.layer.replacesTerrain),h&&e.layer.replacesTerrain&&(this._hasLayerThatReplacesTerrain=!0,this._isTerrainReady=!1,this.notifyChange("isTerrainReady")));return h?(this._updateWasmCamera(),e.updatingFlagChanged(),{wasmLayerId:a}):(this._layers.delete(a),{wasmLayerId:w})}_updateWasmCamera(){const e=this.view.state?.contentCamera;e&&this._lyr3DMain&&(this._cameraDirty=!0,this._markAllLayerViewsUpdating())}_markAllLayerViewsUpdating(){this._layers.forEach(e=>{const i=this._isUpdating(e);e.needFrame=!0,i||e.layerView.updatingFlagChanged()})}_makeSRWasmSerializable(e){return{wkid:e?.wkid??-1,latestWkid:e?.latestWkid??-1,vcsWkid:e?.vcsWkid??-1,latestVcsWkid:e?.latestVcsWkid??-1,wkt:e?.wkt??""}}_cleanUpSR(e){return-1===e?.wkid&&e.latestWkid&&-1!==e.latestWkid?e.wkid=e.latestWkid:-1===e?.latestWkid&&e.wkid&&-1!==e.wkid&&(e.latestWkid=e.wkid),-1===e?.vcsWkid&&e.latestVcsWkid&&-1!==e.latestVcsWkid?e.vcsWkid=e.latestVcsWkid:-1===e?.latestVcsWkid&&e.vcsWkid&&-1!==e.vcsWkid&&(e.latestVcsWkid=e.vcsWkid),e}};e([h({constructOnly:!0})],V.prototype,"view",void 0),e([h({readOnly:!0})],V.prototype,"isTerrainReady",null),V=e([_("esri.layers.Lyr3DWasmPerSceneView")],V);const j=V;export{j as default};
2
+ import{__decorate as e}from"tslib";import t from"../request.js";import{has}from"../applications/Components/baUtils.js";import i from"../core/Accessor.js";import s from"../core/Error.js";import r from"../core/Logger.js";import{someMap as a}from"../core/MapUtils.js";import{createAbortError as n,isAborted as o,isAbortError as l}from"../core/promiseUtils.js";import{watch as d}from"../core/reactiveUtils.js";import{property as h,subclass as _}from"../core/accessorSupport/decorators.js";import y from"../geometry/SpatialReference.js";import{isGeographic as u}from"../geometry/support/spatialReferenceUtils.js";import c from"../geometry/support/WKIDUnitConversion.js";import{wasmFailedToInit as g,elevQueriesFull as m,elevQueriesGenericFail as p,invalidLayerView as w}from"./ILyr3DWasmPerSceneView.js";import{Lyr3DWorkerHandle as f}from"./Lyr3DWorkerHandle.js";import{getVCSFromHeightModelInfo as b}from"./support/tiles3DUtils.js";import{loadLyr3DMainWASM as v}from"../libs/lyr3d/Lyr3DModule.js";import{getElevationOffsetInMeters as D}from"../support/elevationInfoUtils.js";import{makeScheduleFunction as M}from"../views/3d/layers/support/makeScheduleFunction.js";import{TaskPriority as R}from"../views/support/Scheduler.js";import{Yield as k}from"../views/support/Yield.js";const L=3857,C=32662,S=4326,W=5773;let j=class extends i{constructor(e){super(e),this._lyr3DMainPromise=null,this._lyr3DMain=null,this._layers=new Map,this._viewSR=null,this._haveAddedViewSRForNoOpPrj=!1,this._lyr3DBusyCount=0,this._lyr3DInternalMemoryBytes=0,this._isTerrainReady=!1,this._hasLayerThatReplacesTerrain=!1,this._elevationQueries=new Map,this._pendingJobCompleted=new Array,this._pendingJobFailed=new Array,this._pendingRenderableCreated=new Array,this._jobDataBufferPtr=0,this._jobDataBufferCapacity=0,this._debugFlags=new Set,this._debugLevel=2,this._wasmNotLoaded="method requiring WASM was called when WASM isn't loaded",this._pulseTaskHandle=null,this._cameraDirty=!0,this._cameraElevationDirty=!0,this._debugFlags.add(0),this._debugFlags.add(1),this._debugFlags.add(2)}_debugLog(e,t,i,s=!0){if(this._debugFlags.has(e)&&this._debugLevel>=t){const e=s?`[js] ${i}`:`${i}`;0===t||1===t?r.getLogger(this).error(e):2===t&&r.getLogger(this).warn(e),r.getLogger(this).info(e)}}get viewSR(){return this._viewSR}get lyr3DInternalMemoryBytes(){return this._lyr3DInternalMemoryBytes}initialize(){this._debugLevel>2&&(r.getLogger(this).level="info"),this._debugLog(0,3,"Lyr3DWasmPerSceneView.initialize()"),this.addHandles([d(()=>this.view.state?.contentCamera,()=>this._updateWasmCamera()),d(()=>this.view.state?.contentCamera.relativeElevation,()=>{this._cameraElevationDirty=!0,this._markAllLayerViewsUpdating()})]),this._pulseTaskHandle=this.view.resourceController.scheduler.registerTask(R.LYR3D,this)}destroy(){this._debugLog(0,3,"Lyr3DWasmPerSceneView.destroy()"),this._lyr3DMain&&(this._jobDataBufferPtr&&(this._lyr3DMain._free(this._jobDataBufferPtr),this._jobDataBufferPtr=0,this._jobDataBufferCapacity=0),this._layers.forEach(e=>{e.abortController.abort()}),this._elevationQueries.forEach((e,t)=>{this._lyr3DMain.cancel_elevation_query(t),e.rejectCallback(n())}),this._elevationQueries.clear(),this._lyr3DMain.uninitialize_lyr3d_wasm(),this._lyr3DMain=null),this._pendingJobCompleted.length=0,this._pendingJobFailed.length=0,this._pendingRenderableCreated.length=0;const e=this._workerHandle;e&&e.destroyWasm().then(()=>{this._workerHandle?.destroy(),this._workerHandle=null}),this._pulseTaskHandle?.remove(),this._pulseTaskHandle=null}get readyToRun(){return this._hasPendingPulseWork()}runTask(e){return this._pulseTask(e),k}_hasPendingPulseWork(){return!!this._lyr3DMain&&(this._cameraDirty||this._cameraElevationDirty||this._pendingJobCompleted.length>0||this._pendingJobFailed.length>0||this._pendingRenderableCreated.length>0||this._elevationQueries.size>0||a(this._layers,e=>this._isUpdating(e)))}addLayerView(e){return this._lyr3DMain?this._addLayerView(e):(this._debugLog(0,1,"Lyr3DWasmPerSceneView.add3DTilesLayerView() called when WASM wasn't initialized"),{wasmLayerId:g})}removeLayerView(e){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),0;this._doRemoveLayerView(e);const t=this._layers.size;return 0===t&&(this._debugLog(0,3,"Lyr3DWasmPerSceneView.remove3DTilesLayerView() no Lyr3D layers left after removing a layer, destroying"),this.destroy()),t}getValidLayerViewCount(){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),0;let e=0;return this._layers.forEach(t=>{t.layerView.wasmLayerId>=0&&++e}),e}setEnabled(e,t){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const i=this._layers.get(e.wasmLayerId);if(i){this._lyr3DMain.set_enabled(e.wasmLayerId,t),i.needMemoryUsageUpdate=!0;const s=this._isUpdating(i);i.needFrame=!0,s||i.layerView.updatingFlagChanged()}}setLayerOffset(e,t){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const i=this._layers.get(e.wasmLayerId);i&&(this._lyr3DMain.set_carto_offset_z(e.wasmLayerId,t),i.needFrame=!0,i.layerView.updatingFlagChanged())}getAttributionText(){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),[];return this._lyr3DMain.get_current_attribution_text().split("|")}onRenderableEvicted(e,t,i){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);this._layers.get(e.wasmLayerId)&&this._lyr3DMain.on_renderable_evicted(e.wasmLayerId,t,i)}setMeshModifications(e,t){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const i=this._layers.get(e.wasmLayerId);if(i){const s=this._lyr3DMain._malloc(8*t.length),r=new Float64Array(this._lyr3DMain.HEAPF64.buffer,s,t.length);for(let e=0;e<t.length;++e)r[e]=t[e];this._lyr3DMain.set_mesh_modification_polygons(e.wasmLayerId,s,t.length),this._lyr3DMain._free(s);const a=this._isUpdating(i);i.needFrame=!0,a||i.layerView.updatingFlagChanged()}}isUpdating(e){if(!this._lyr3DMain&&this._lyr3DMainPromise)return!0;const t=this._layers.get(e);return!!t&&(t.outstandingJobCount>0||t.outstandingRenderableCount>0||t.needFrame||this._lyr3DBusyCount>0)}initializeWasm(e,t){return this._lyr3DMain?Promise.resolve():this.view.renderSpatialReference?(this._debugLog(0,3,"Lyr3DWasmPerSceneView.initializeWasm()"),this._lyr3DMainPromise||(this._lyr3DMainPromise=v().then(i=>{this._lyr3DMain=i,this._lyr3DMainPromise=null;const s=this._lyr3DMain.addFunction(this._onNewJob.bind(this),"v"),r=this._lyr3DMain.addFunction(this._onNewRenderable.bind(this),"v"),a=this._lyr3DMain.addFunction(this._freeRenderables.bind(this),"viii"),n=this._lyr3DMain.addFunction(this._setRenderableVisibility.bind(this),"viiii"),o=this._lyr3DMain.addFunction(this._onWasmError.bind(this),"viiii"),l=this._lyr3DMain.addFunction(this._onElevQueryComplete.bind(this),"vi");if(!this.view.renderSpatialReference)return void(this._lyr3DMain=null);this._viewSR=this.view.renderSpatialReference?.toJSON();let d="global"===this.view.viewingMode?6:4;6===d?(this._viewSR.wkid=this._viewSR.latestWkid=S,this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=W,this._viewSR.wkt=""):(this._viewSR.vcsWkid||(this._viewSR.vcsWkid=b(this.view.heightModelInfo)),this.view.renderSpatialReference?.isWebMercator?(this._viewSR.wkid=this._viewSR.latestWkid=L,this._viewSR.vcsWkid||(this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=W)):this.view.renderSpatialReference?.wkid===C?(this._viewSR.wkid=this._viewSR.latestWkid=S,d=3,this._viewSR.vcsWkid||(this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=W)):this._viewSR.vcsWkid||this._viewSR.latestVcsWkid||(this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=-1));const h=has("esri-lyr3D-max-concurrent-requests")??16;return this._lyr3DMain.initialize_lyr3d_wasm(o,s,r,a,n,l,e,t,d,this._cleanUpSR(this._makeSRWasmSerializable(this._viewSR)),Math.max(this._debugLevel,0),h)?(this._workerHandle=new f(M(this.view.resourceController)),this._workerHandle.promise?this._workerHandle.promise:void 0):(this._lyr3DMain=null,void this._debugLog(0,0,"Lyr3d Main WASM failed to initialize",!1))}).catch(e=>{this._debugLog(0,0,`Lyr3d WASM failed to download error = ${e}`,!1)})),this._lyr3DMainPromise):Promise.reject()}get isTerrainReady(){return this._isTerrainReady}setLodPixelThreshold(e,t){this._lyr3DMain?.set_lod_pixel_threshold(t);const i=this._layers.get(e.wasmLayerId);i&&(i.needFrame=!0,i.layerView.updatingFlagChanged())}setMaximumGaussianSplatCount(e){this._lyr3DMain.set_maximum_splat_count(e),this._layers.forEach(e=>{"gaussian-splat-3d"===e.layerView.type&&(e.needFrame=!0,e.layerView.updatingFlagChanged())})}queryElevation(e,t,i){if(!this._lyr3DMain)return Promise.reject(this._wasmNotLoaded);if(0===t.coordinates.length)return Promise.reject("no coordinates for elevation query");const s="global"===this.view.viewingMode?y.WGS84:this._viewSR.wkid===L?y.WebMercator:y.PlateCarree,r=t.projectSync(s);r&&(t=r);const a=2*t.coordinates.length,n=this._lyr3DMain._malloc(8*a),o=new Float64Array(this._lyr3DMain.HEAPF64.buffer,n,a);for(let y=0;y<t.coordinates.length;++y){const e=t.coordinates[y];o[2*y]=e.x,o[2*y+1]=e.y}const l=i?.maxGeometricError??0,d=this._lyr3DMain.create_elevation_query(e.wasmLayerId,l,n,a);if(this._lyr3DMain._free(n),d===m)return Promise.reject("max mesh elevation query limit exceeded");if(d===p)return Promise.reject("elevation query failed");const h={descriptor:t,signal:i?.signal,resolveCallback:null,rejectCallback:null},_=new Promise((e,t)=>{h.resolveCallback=e,h.rejectCallback=t});return this._elevationQueries.set(d,h),_}_checkForAbortedElevationQueries(){const e=[];this._elevationQueries.forEach((t,i)=>{o(t.signal)&&(this._lyr3DMain.cancel_elevation_query(i),t.rejectCallback(n()),e.push(i))});for(let t=0;t<e.length;++t)this._elevationQueries.delete(e[t])}_pulseTask(e){const t=this._lyr3DMain;if(t){if(this._cameraDirty){const e=this.view.state?.contentCamera;if(e){const{eye:i,center:s,up:r,near:a,far:n,fovY:o}=e,l=[e.viewport[2],e.viewport[3]],d={eye:i,center:s,up:r,near:a,far:n,fov:o,aspectRatio:e.width/e.height,viewport:l};t.set_camera_parameters(d),this._cameraDirty=!1}}if(this._cameraElevationDirty){const e=this.view.state?.contentCamera.relativeElevation;t.set_camera_elevation(e)}this._checkForAbortedElevationQueries();let i=0,s=0;this._layers.forEach(e=>{i+=e.layerView.usedMemory,s+=e.layerView.cachedMemory}),i/=1048576,s/=1048576;const r=this.view.resourceController.memoryController,a=r.usedMemory*r.maxMemory-i-this._lyr3DInternalMemoryBytes/1048576;this._lyr3DBusyCount=this._lyr3DMain.frame_pulse(r.memoryFactor,i,s,a,r.maxMemory),this._lyr3DInternalMemoryBytes=this._lyr3DMain.get_index_memory_bytes(),this._layers.forEach(e=>{this._cameraElevationDirty||(e.needFrame=!1),e.layerView.updatingFlagChanged()}),this._hasLayerThatReplacesTerrain&&!this._isTerrainReady&&(this._isTerrainReady=this._lyr3DMain.is_terrain_ready(),this._isTerrainReady&&this.notifyChange("isTerrainReady")),this._flushPendingWasmCalls(e),this._cameraElevationDirty=!1}}_isUpdating(e){return e.outstandingJobCount>0||e.outstandingRenderableCount>0||e.needFrame||this._cameraDirty||this._lyr3DBusyCount>0}_incrementJobCount(e,t){if(t.isForElevationQuery)return;const i=this._isUpdating(e);e.outstandingJobCount+=1,i||e.layerView.updatingFlagChanged()}_decrementJobCount(e,t){if(t.isForElevationQuery)return;const i=this._isUpdating(e);e.outstandingJobCount-=1;i!==this._isUpdating(e)&&e.layerView.updatingFlagChanged()}_incrementRenderableCount(e){const t=this._isUpdating(e);e.outstandingRenderableCount+=1,t||e.layerView.updatingFlagChanged()}_decrementRenderableCount(e){const t=this._isUpdating(e);e.outstandingRenderableCount-=1;t!==this._isUpdating(e)&&e.layerView.updatingFlagChanged()}_flushPendingWasmCalls(e){this._lyr3DMain&&(this._flushPendingCalls(this._pendingJobFailed,e),this._flushPendingCalls(this._pendingJobCompleted,e),this._flushPendingCalls(this._pendingRenderableCreated,e))}_flushPendingCalls(e,t){for(;!t.done&&e.length>0;){e.shift()(this._lyr3DMain),t.madeProgress()}}_onJobFailed(e,t,i){t.error.length&&this._debugLog(1,1,t.error,!1),this._lyr3DMain&&!e.layerView.destroyed&&this._pendingJobFailed.push(e=>e.on_job_failed(i.jobId,i.desc)),this._decrementJobCount(e,i)}_onJobSucceeded(e,t,i){if(this._lyr3DMain){if(e.layerView.destroyed)return void this._pendingJobFailed.push(e=>e.on_job_failed(i.jobId,i.desc));const{data:s}=t,r=e=>{const r=s.byteLength,a=this._ensureJobDataBuffer(r);new Uint8Array(e.HEAPU8.buffer,a,r).set(s),e.on_job_completed(i.jobId,t.jobDescJson,a,r)};this._pendingJobCompleted.push(r)}this._decrementJobCount(e,i)}_ensureJobDataBuffer(e){return e<=this._jobDataBufferCapacity&&this._jobDataBufferPtr||(this._jobDataBufferPtr&&this._lyr3DMain._free(this._jobDataBufferPtr),this._jobDataBufferPtr=this._lyr3DMain._malloc(e),this._jobDataBufferCapacity=e),this._jobDataBufferPtr}_getRequestPromises(e,i,s,r){const a=[];for(const n of e){const e=new URL(n);if("integrated-mesh-3dtiles"===r.type){if(e.origin===s.origin&&e.pathname===s.pathname){if(r.rootTileset){a.push(Promise.resolve(r.rootTileset.slice()));continue}}else r.session&&e.searchParams.set("session",r.session)}a.push(t(e.toString(),i).then(e=>e.data))}return a}_getInitialPromise(e,t,i,s,r,a,n){const o=this._getRequestPromises(e.urls,t,i,s);return Promise.all(o).then(e=>(r.inputs=e,this._workerHandle.invoke(r,a))).then(e=>e).catch(t=>{let i=1;return l(t)?this._debugLog(1,2,`job ${e.jobId} was cancelled.`):n&&400===t.details?.httpStatus?(i=3,this._debugLog(1,2,"Session expired, trying to create new Session.")):this._debugLog(1,1,`job ${e.jobId} failed with error ${t}.`),{status:i,error:"",jobDescJson:"",data:new Uint8Array(0),missingInputUrls:[],inputs:[]}})}async _onNewJob(){const e=this._lyr3DMain.get_next_job(),t=this._layers.get(e.layerId);if(!t)return;this._incrementJobCount(t,e);const i=t.abortController.signal,s=t.layerView.layer,r="integrated-mesh-3dtiles"===s.type?s.key:null,a="integrated-mesh-3dtiles"===s.type?s.session:null,n={responseType:"array-buffer",signal:i,query:{...t.customParameters,token:t.apiKey,key:r}},o={id:e.jobId,inputs:[],jobDescJson:e.desc.slice(),isMissingResourceCase:!1},d=new URL(s.url),h=r=>{if(1===r.status)this._onJobFailed(t,r,e);else if(0===r.status)this._onJobSucceeded(t,r,e);else if(2===r.status){const a=this._getRequestPromises(r.missingInputUrls,n,d,s);Promise.all(a).then(e=>{o.jobDescJson=r.jobDescJson,r.originalInputs?o.inputs=r.originalInputs:o.inputs=[],o.isMissingResourceCase=!0;for(const t of e)o.inputs.push(t);return this._workerHandle.invoke(o,i)}).then(i=>{1===i.status?this._onJobFailed(t,i,e):0===i.status&&this._onJobSucceeded(t,i,e)}).catch(i=>{this._decrementJobCount(t,e),l(i)?this._debugLog(1,2,`job ${e.jobId} was cancelled.`):this._debugLog(1,1,`job ${e.jobId} failed with error ${i}.`),this._lyr3DMain&&this._pendingJobFailed.push(t=>t.on_job_failed(e.jobId,e.desc))})}};try{const t=await this._getInitialPromise(e,n,d,s,o,i,a);if(3===t.status&&"integrated-mesh-3dtiles"===s.type){a===s.session&&null!==s.session&&await s.requestRootAndSession(i);h(await this._getInitialPromise(e,n,d,s,o,i,s.session))}else h(t)}catch(_){_&&this._debugLog(1,1,_.toString(),!1),this._lyr3DMain&&this._pendingJobFailed.push(t=>t.on_job_failed(e.jobId,e.desc)),this._decrementJobCount(t,e)}}_onNewRenderable(){const e=this._lyr3DMain.get_next_renderable(),{meshData:t}=e;t.data&&t.data.byteLength>0&&(t.data=t.data.slice());const i=this._layers.get(e.layerId);i&&(this._incrementRenderableCount(i),i.layerView.createRenderable(e).then(t=>{const s=t.numGaussians??0;if(this._lyr3DMain&&!i.layerView.destroyed){const{layerId:i,handle:r}=e,{memUsageBytes:a}=t;this._pendingRenderableCreated.push(e=>e.on_renderable_created(!0,i,r,a,s))}this._decrementRenderableCount(i)}).catch(t=>{if(l(t)||this._debugLog(2,1,`createRenderable failed with error ${t}.`),this._lyr3DMain&&!i.layerView.destroyed){const{layerId:t,handle:i}=e;this._pendingRenderableCreated.push(e=>e.on_renderable_created(!1,t,i,0,0))}this._decrementRenderableCount(i)}))}_freeRenderables(e,t,i){if(i<1)return;const s=this._layers.get(e);if(!s)return;const r=s.layerView,a=[],n=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,t,i);for(let o=0;o<i;++o)a.push(n[o]);for(let o=0;o<i;++o)r.freeRenderable(a[o])}_setRenderableVisibility(e,t,i,s){if(s<1)return;const r=this._layers.get(e);if(!r)return;const a=r.layerView,n=[],o=[],l=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,t,s),d=new Uint8Array(this._lyr3DMain.HEAPU8.buffer,i,s);for(let h=0;h<s;++h)n.push(l[h]),o.push(!!(1&d[h]));a.setRenderableVisibility(n,o,s)}_onWasmError(e,t,i,s){this._lyr3DMain&&this._debugLog(i,s,this._lyr3DMain.UTF8ToString(e,t),!1)}_onElevQueryComplete(e){const t=this._elevationQueries.get(e),i=this._lyr3DMain.get_elevation_query_result(e);if(t)if(i.succeeded&&i.zs){const s=i.zs.slice(),r=t.descriptor.clone();for(let e=0;e<s.length;++e)r.coordinates[e].z=s[e];this._debugLog(2,3,`Success EQ ${e}, number points ${s.length}.`),t.resolveCallback(r),this._elevationQueries.delete(e)}else t.rejectCallback(new s("elevation-query:error",i?.error??"Elevation query failed")),this._elevationQueries.delete(e);else this._debugLog(2,1,`_onElevQueryComplete called for unknown queryId ${e}.`)}_doRemoveLayerView(e){const t=this._layers.get(e.wasmLayerId);return!!t&&(t.abortController.abort(),this._lyr3DMain.remove_layer(e.wasmLayerId),this._is3DTilesIMLayerView(e)&&e.layer.replacesTerrain&&(this._hasLayerThatReplacesTerrain=!1,this._isTerrainReady=!1,this.notifyChange("isTerrainReady")),this._layers.delete(e.wasmLayerId),!0)}_is3DTilesIMLayerView(e){return"integrated-mesh-3dtiles"===e.layer.type}_isGaussianSplatLayerView(e){return"gaussian-splat"===e.layer.type}_isGaussianSplatLayer(e){return"gaussian-splat"===e.type}_toWasmQuality(e){switch(e){case"low":return 1;case"medium":return 2;case"high":return 3}}_addLayerView(e){const t=e.layer;if(!t.url||!t.rootTilesetJSON)return{wasmLayerId:w};const i="integrated-mesh-3dtiles"===t.type?0:2,s=this._lyr3DMain.validate_root_tileset(JSON.stringify(t.rootTilesetJSON),i);if(0!==s.errorCode)return{wasmLayerId:w,check:s};const a=this._lyr3DMain.get_next_layer_id(),n=new AbortController;this._layers.set(a,{layerView:e,abortController:n,needMemoryUsageUpdate:!1,outstandingJobCount:0,outstandingRenderableCount:0,customParameters:t.customParameters,apiKey:t.apiKey,needFrame:!0});const o=D(t.elevationInfo),l=this._toWasmQuality(this.view?.qualityProfile),d=e=>r.getLogger(this).error("add-spatial-reference-error","Error when adding SR:",e);let h=!1;if(this._isGaussianSplatLayerView(e)&&this._isGaussianSplatLayer(t)){let i=t.spatialReference;if(e.useEsriCrs&&t.esriCrsSpatialReference){i=t.esriCrsSpatialReference;const s=u(i);let r=1,a=1;!s&&i.wkid&&-1!==i.wkid&&(r=c.values[c[i.wkid]],a=e.metersPerVCSUnit),this._workerHandle.addSpatialReferenceInfo(this._cleanUpSR(this._makeSRWasmSerializable(i)),s,r,a).catch(d),!this._haveAddedViewSRForNoOpPrj&&i.vcsWkid&&this._viewSR.vcsWkid&&-1!==this._viewSR.vcsWkid&&this._viewSR.vcsWkid!==i.vcsWkid&&(this._workerHandle.addSpatialReferenceInfo(this._cleanUpSR(this._makeSRWasmSerializable(this._viewSR)),!1,1,1).catch(d),this._haveAddedViewSRForNoOpPrj=!0)}h=this._lyr3DMain.add_gaussian_splat_layer(l,t.url,a,o)}else this._is3DTilesIMLayerView(e)&&(h=this._lyr3DMain.add_3dtiles_layer(l,t.url,a,o,e.layer.replacesTerrain),h&&e.layer.replacesTerrain&&(this._hasLayerThatReplacesTerrain=!0,this._isTerrainReady=!1,this.notifyChange("isTerrainReady")));return h?(this._updateWasmCamera(),e.updatingFlagChanged(),{wasmLayerId:a}):(this._layers.delete(a),{wasmLayerId:w})}_updateWasmCamera(){const e=this.view.state?.contentCamera;e&&this._lyr3DMain&&(this._cameraDirty=!0,this._markAllLayerViewsUpdating())}_markAllLayerViewsUpdating(){this._layers.forEach(e=>{const t=this._isUpdating(e);e.needFrame=!0,t||e.layerView.updatingFlagChanged()})}_makeSRWasmSerializable(e){return{wkid:e?.wkid??-1,latestWkid:e?.latestWkid??-1,vcsWkid:e?.vcsWkid??-1,latestVcsWkid:e?.latestVcsWkid??-1,wkt:e?.wkt??""}}_cleanUpSR(e){return-1===e?.wkid&&e.latestWkid&&-1!==e.latestWkid?e.wkid=e.latestWkid:-1===e?.latestWkid&&e.wkid&&-1!==e.wkid&&(e.latestWkid=e.wkid),-1===e?.vcsWkid&&e.latestVcsWkid&&-1!==e.latestVcsWkid?e.vcsWkid=e.latestVcsWkid:-1===e?.latestVcsWkid&&e.vcsWkid&&-1!==e.vcsWkid&&(e.latestVcsWkid=e.vcsWkid),e}};e([h({constructOnly:!0})],j.prototype,"view",void 0),e([h({readOnly:!0})],j.prototype,"isTerrainReady",null),j=e([_("esri.layers.Lyr3DWasmPerSceneView")],j);const V=j;export{V as default};