@arcgis/core 5.1.0-next.101 → 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 (104) 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/{99f726f05cf80b0330ed.js → 119b84f5349f90d1dd28.js} +1 -1
  4. package/assets/esri/core/workers/chunks/15167eeb6d7dbe7e392d.js +1 -0
  5. package/assets/esri/core/workers/chunks/{156efa014b6edd9ccce9.js → 1ba37706e5d5eaabcb8e.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{7bb17d0ab1cc2b89c035.js → 1faa8a42d5a437fc40a3.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{38b1d2ffcc318ac0119d.js → 48fcc10768d93e95a04e.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{53bf9b0c2b8da12820ea.js → 55ccb8ed7325efb62091.js} +2 -2
  9. package/assets/esri/core/workers/chunks/{17de1c251242b692cf45.js → 5663df3cd1dfd4b43c73.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{5b07f3253403fe25ce5b.js → 5bc299f7f89a07a6e6a6.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{00a25dd4b057cc9f2a7e.js → 6f96ce41c47cae82e687.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{657268b3fde6da2dd735.js → 86bff154d46f8a562887.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{22fa4aa2b76573bafe21.js → 9e7c84a3a2abec4d49df.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{40ffb1aa17cbfae17b23.js → bb5512ecb5300d45d46b.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{d8c4fb66c733ab2f66d3.js → bb81da98546c4d923e0d.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{a58662698c69190a12d8.js → de25311b6d13bf1c6089.js} +2 -2
  17. package/assets/esri/core/workers/chunks/{bafe489e54f34d1841e6.js → e86c073f0b6d395c7a38.js} +1 -1
  18. package/assets/esri/core/workers/chunks/f5bd0a4f82df5e942b70.js +1 -0
  19. package/assets/esri/core/workers/chunks/{48a0e7a32ebd44045c8f.js → fa38dc5010f8630a80fe.js} +1 -1
  20. package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +125 -0
  21. package/assets/esri/themes/base/widgets/_Directions.scss +5 -1
  22. package/assets/esri/themes/dark/main.css +1 -1
  23. package/assets/esri/themes/light/main.css +1 -1
  24. package/assets/esri/themes/light/view.css +1 -1
  25. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm.json +1 -1
  26. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_en.json +1 -1
  27. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer.json +1 -1
  28. package/config.js +1 -1
  29. package/form/elements/inputs/MultipleChoiceInput.d.ts +5 -5
  30. package/form/elements/inputs/MultipleChoiceInput.js +1 -1
  31. package/interfaces.d.ts +3 -0
  32. package/kernel.js +1 -1
  33. package/layers/FeatureLayer.d.ts +29 -39
  34. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  35. package/layers/OrientedImageryLayer.d.ts +233 -0
  36. package/layers/OrientedImageryLayer.js +1 -1
  37. package/layers/VideoLayer.d.ts +35 -9
  38. package/layers/VideoLayer.js +1 -1
  39. package/layers/catalog/CatalogFootprintLayer.d.ts +147 -0
  40. package/layers/support/FeatureReductionBinning.d.ts +87 -9
  41. package/layers/support/FeatureReductionCluster.d.ts +87 -9
  42. package/layers/support/FieldConfiguration.d.ts +1 -1
  43. package/layers/support/SubtypeSublayer.d.ts +147 -0
  44. package/layers/support/TelemetryData.d.ts +5 -0
  45. package/layers/support/TelemetryData.js +1 -1
  46. package/layers/support/TelemetryDisplay.d.ts +10 -2
  47. package/layers/support/TelemetryDisplay.js +1 -1
  48. package/layers/video/VideoController.js +1 -1
  49. package/layers/video/types.d.ts +8 -1
  50. package/layers/video/videoUtils.js +1 -1
  51. package/package.json +2 -2
  52. package/portal/jsonTypes.d.ts +7 -0
  53. package/rest/print.js +1 -1
  54. package/rest/support/PrintParameters.d.ts +8 -1
  55. package/rest/support/PrintParameters.js +1 -1
  56. package/support/revision.js +1 -1
  57. package/third-party-notices.txt +4 -0
  58. package/views/2d/engine/webgl/shaderGraph/graph/GlslGraphWriter.js +1 -1
  59. package/views/2d/engine/webgl/shaderGraph/graph/ShaderGraphContext.js +1 -1
  60. package/views/2d/engine/webgl/shaderGraph/graph/ShaderGraphNode.js +1 -1
  61. package/views/2d/engine/webgl/shaderGraph/graph/glsl.js +1 -1
  62. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityPolygonShader.js +1 -1
  63. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BloomShader.js +1 -1
  64. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/AspectShader.js +1 -1
  65. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/CurvatureShader.js +1 -1
  66. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/MaskShader.js +1 -1
  67. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/RemapShader.js +1 -1
  68. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/SlopeShader.js +1 -1
  69. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/math.js +1 -1
  70. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/surface.js +1 -1
  71. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  72. package/views/2d/layers/VideoLayerView2D.js +1 -1
  73. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  74. package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
  75. package/views/3d/webgl-engine/lib/TriangleIntersectionData.js +1 -1
  76. package/views/Viewport2DBaseMixin.js +1 -1
  77. package/widgets/Attachments/support/attachmentUtils.js +1 -1
  78. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.d.ts +8 -1
  79. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  80. package/widgets/BatchAttributeForm/attachmentUtils.js +2 -0
  81. package/widgets/BatchAttributeForm/css.js +1 -1
  82. package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
  83. package/widgets/BatchAttributeForm/templates/RelationshipElementTemplate.js +1 -1
  84. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  85. package/widgets/BatchAttributeForm/templates/support/hashElementTemplate.js +1 -1
  86. package/widgets/BatchAttributeForm/types.d.ts +7 -0
  87. package/widgets/BatchAttributeForm.js +1 -1
  88. package/widgets/FeatureForm/RelationshipInput.d.ts +1 -1
  89. package/widgets/FeatureTable.js +1 -1
  90. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  91. package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
  92. package/widgets/OrientedImageryViewer/constants.js +1 -1
  93. package/widgets/OrientedImageryViewer/types.js +1 -1
  94. package/widgets/OrientedImageryViewer/videoViewerUtils.js +1 -1
  95. package/widgets/OrientedImageryViewer.js +1 -1
  96. package/widgets/PanoramicViewer/PanoramicVideoViewerViewModel.js +1 -1
  97. package/widgets/VideoPlayer/VideoPlayerViewModel.d.ts +9 -0
  98. package/widgets/VideoPlayer/VideoPlayerViewModel.js +1 -1
  99. package/widgets/VideoPlayer/components/PlayerControlsGroup.js +1 -1
  100. package/widgets/support/forms/formUtils.js +1 -1
  101. package/assets/esri/core/workers/chunks/43cc82373be791b7cb4c.js +0 -1
  102. package/assets/esri/core/workers/chunks/c9461568e1002ebac534.js +0 -1
  103. /package/assets/esri/core/workers/chunks/{53bf9b0c2b8da12820ea.js.LICENSE.txt → 55ccb8ed7325efb62091.js.LICENSE.txt} +0 -0
  104. /package/assets/esri/core/workers/chunks/{a58662698c69190a12d8.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"}
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.101";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
@@ -5987,6 +5987,9 @@ declare namespace __esri {
5987
5987
  /** @deprecated since 5.0. Refactor using \@arcgis/codemod */
5988
5988
  export type LivestreamStatus = import("./layers/video/types.js").LivestreamStatus;
5989
5989
 
5990
+ /** @deprecated since 5.0. Refactor using \@arcgis/codemod */
5991
+ export type Coverage = import("./layers/video/types.js").Coverage;
5992
+
5990
5993
  /** @deprecated since 5.0. Refactor using \@arcgis/codemod */
5991
5994
  export type VoxelColorStopProperties = import("./layers/voxel/VoxelColorStop.js").VoxelColorStopProperties;
5992
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.101",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
  /**
@@ -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};