@arcgis/core 4.33.0-next.20250403 → 4.33.0-next.20250405

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 (142) hide show
  1. package/WebScene.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/{361a3253877acd3b4f07.js → 1014513c0ec85f9414a4.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{18f8b41bd761e9ab60d0.js → 114599ed0752d9a70eef.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{30a047bd66f333bb7d2d.js → 1364744b15b327abd5a1.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{5beb525b4adde1d98532.js → 27b7ef3442700f6d6123.js} +84 -84
  7. package/assets/esri/core/workers/chunks/{628395830c78b95b46dc.js → 290aed587aa647226b46.js} +1 -1
  8. package/assets/esri/core/workers/chunks/358a3a9326615d5e6d3b.js +1 -0
  9. package/assets/esri/core/workers/chunks/35ab75010817f1525e54.js +1 -0
  10. package/assets/esri/core/workers/chunks/386ea90e87254b0282ec.js +1 -0
  11. package/assets/esri/core/workers/chunks/{2a654d8de99be40dd0e6.js → 3f6dc811b5d515c2725c.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{8d421e0a01e2c3f6980c.js → 4275dcec730a11173661.js} +1 -1
  13. package/assets/esri/core/workers/chunks/43b19c58b2d16ae8e7cc.js +1 -0
  14. package/assets/esri/core/workers/chunks/{ddfb5a2055a36576ba0d.js → 4523ba4a3c8987abca56.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{0b6ceb0194a07bbc3433.js → 4baef5262ce401bf81bb.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{5660f479c005149bce8d.js → 4de3d692557120a4bbf7.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{5e79642851e888eddfe4.js → 4e3b60156bee3b8b3367.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{4dc135e0133d58a06d67.js → 519028f42b817d3e9933.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{1377ddd582518e5fa051.js → 60472225a228e499b1a2.js} +1 -1
  20. package/assets/esri/core/workers/chunks/61737e442b1f8e86164e.js +1 -0
  21. package/assets/esri/core/workers/chunks/69e606267dc5842ebf9d.js +1 -0
  22. package/assets/esri/core/workers/chunks/7099564a8853b81ba181.js +1 -0
  23. package/assets/esri/core/workers/chunks/{3db517369c5dd891a75f.js → 72f4cea853ce9fcf2cb6.js} +1 -1
  24. package/assets/esri/core/workers/chunks/7ccc02a4ec6d3552ecca.js +1 -0
  25. package/assets/esri/core/workers/chunks/8221f2e540abe1e0f048.js +1 -0
  26. package/assets/esri/core/workers/chunks/8fecd1337d84c26c692b.js +1 -0
  27. package/assets/esri/core/workers/chunks/{6280e1fe944ea4a71b91.js → 9643a9516783e8c32180.js} +1 -1
  28. package/assets/esri/core/workers/chunks/b06e3ba73f353592c81d.js +1 -0
  29. package/assets/esri/core/workers/chunks/c2d0fc13f4b746318a38.js +1 -0
  30. package/assets/esri/core/workers/chunks/{6ab96eaaad0aaad46db9.js → cc307d34a68e44e3cbc5.js} +1 -1
  31. package/assets/esri/core/workers/chunks/d46c82a55219b27c301b.js +1 -0
  32. package/assets/esri/core/workers/chunks/{1df34b7fd68f5ab55bd3.js → d89f105b8a0b13dd8e5f.js} +1 -1
  33. package/assets/esri/core/workers/chunks/eaead9e927ebadcf2cc3.js +1 -0
  34. package/assets/esri/core/workers/chunks/ed517687b3728fd2eb64.js +1 -0
  35. package/assets/esri/core/workers/chunks/f41a9ceb8e49baafe9fa.js +1 -0
  36. package/assets/esri/core/workers/chunks/{e3b0bb6850d5252d5f24.js → f7d33d18bf1bd4db9df8.js} +1 -1
  37. package/assets/esri/themes/base/_core.scss +2 -0
  38. package/assets/esri/themes/base/widgets/_SelectionList.scss +61 -0
  39. package/assets/esri/themes/dark/main.css +1 -1
  40. package/assets/esri/themes/light/main.css +1 -1
  41. package/assets/esri/themes/light/view.css +1 -1
  42. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList.json +1 -0
  43. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_en.json +1 -0
  44. package/core/MultiOriginJSONSupport.js +1 -1
  45. package/core/accessorSupport/DefaultsStore.js +1 -1
  46. package/core/accessorSupport/MultiOriginStore.js +1 -1
  47. package/core/accessorSupport/Properties.js +1 -1
  48. package/core/accessorSupport/Store.js +1 -1
  49. package/core/unitUtils.js +1 -1
  50. package/geometry/support/HalfFloatArray.js +1 -1
  51. package/geometry/support/buffer/BufferView.js +1 -1
  52. package/geometry/support/float16.js +5 -0
  53. package/interfaces.d.ts +630 -26
  54. package/layers/BuildingSceneLayer.js +1 -1
  55. package/layers/ParquetLayer.d.ts +4 -0
  56. package/layers/SceneLayer.js +1 -1
  57. package/layers/WMSLayer.js +1 -1
  58. package/layers/support/VideoElement.js +1 -1
  59. package/layers/support/rasterFunctions/rasterFunctionHelper.js +1 -1
  60. package/package.json +2 -2
  61. package/portal/schemas/definitions.js +1 -1
  62. package/smartMapping/statistics/types.d.ts +4 -0
  63. package/smartMapping/statistics/types.js +5 -0
  64. package/support/revision.js +1 -1
  65. package/versionManagement/VersioningState.js +1 -1
  66. package/views/2d/engine/Stage.js +1 -1
  67. package/views/2d/engine/webgl/Mesh2D.js +1 -1
  68. package/views/2d/engine/webgl/Painter.js +1 -1
  69. package/views/2d/engine/webgl/effects/highlight/HighlightSurfaces.js +1 -1
  70. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityResources.js +1 -1
  71. package/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapResources.js +1 -1
  72. package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
  73. package/views/2d/layers/features/support/FeatureSetReaderPBFHeader.js +1 -1
  74. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  75. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  76. package/views/3d/layers/graphics/defaultSymbolComplexity.js +1 -1
  77. package/views/3d/layers/graphics/pipeline/Feature3DPipeline.js +1 -1
  78. package/views/3d/terrain/support/MultiSizeFramebuffer.js +1 -1
  79. package/views/3d/webgl/formats.js +1 -1
  80. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  81. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +15 -15
  82. package/views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js +5 -5
  83. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueRepository.js +1 -1
  84. package/views/3d/webgl-engine/lib/AttributeArray.js +1 -1
  85. package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
  86. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  87. package/views/3d/webgl-engine/lib/VertexAttribute.js +1 -1
  88. package/views/3d/webgl-engine/lib/glUtil3D.js +1 -1
  89. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  90. package/views/3d/webgl-engine/lib/textureUtils.js +1 -1
  91. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  92. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  93. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  94. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  95. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  96. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  97. package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
  98. package/views/FocusAreas.js +1 -1
  99. package/views/SceneView.js +1 -1
  100. package/views/View.js +1 -1
  101. package/views/ViewAnimation.js +1 -1
  102. package/views/layers/ParquetLayerView.d.ts +4 -0
  103. package/views/support/TextureCompressionWorker.js +1 -1
  104. package/views/webgl/FramebufferObject.js +1 -1
  105. package/views/webgl/ShaderBuilder.js +1 -1
  106. package/views/webgl/Texture.js +1 -1
  107. package/views/webgl/Util.js +1 -1
  108. package/views/webgl/checkWebGLError.js +1 -1
  109. package/views/webgl/enums.js +1 -1
  110. package/views/webgl/textureUtils.js +1 -1
  111. package/widgets/Feature/support/relatedFeatureUtils.js +1 -1
  112. package/widgets/FeatureForm/UtilityNetworkAssociationAddAssociationViewModel.js +1 -1
  113. package/widgets/FeatureTable/support/tableUtils.js +1 -1
  114. package/widgets/FeatureTable.js +1 -1
  115. package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
  116. package/widgets/support/SelectionList/SelectionListFeatureItem.js +5 -0
  117. package/widgets/support/SelectionList/SelectionListGroupLayerItem.js +5 -0
  118. package/widgets/support/SelectionList/SelectionListItemBase.js +5 -0
  119. package/widgets/support/SelectionList/SelectionListLayerItem.js +5 -0
  120. package/widgets/support/SelectionList/SelectionListViewModel.js +5 -0
  121. package/widgets/support/SelectionList/VisibleElements.js +5 -0
  122. package/widgets/support/SelectionList/selectionListUtils.js +5 -0
  123. package/widgets/support/SelectionList.js +5 -0
  124. package/widgets/support/Selector2D/selectorUtils.js +1 -1
  125. package/widgets/support/UtilityNetworkAssociations/utils/getFeatureTitle.js +1 -1
  126. package/widgets/support/iconUtils.js +1 -1
  127. package/assets/esri/core/workers/chunks/0cd5f15b8558b23e5fcd.js +0 -1
  128. package/assets/esri/core/workers/chunks/1d322685016263f86cf5.js +0 -1
  129. package/assets/esri/core/workers/chunks/2219d970ece5676ca6ee.js +0 -1
  130. package/assets/esri/core/workers/chunks/222446da9cb58c3c3b7e.js +0 -1
  131. package/assets/esri/core/workers/chunks/401ff3c83789c72e9ac9.js +0 -1
  132. package/assets/esri/core/workers/chunks/555c95b149e3a82a4460.js +0 -1
  133. package/assets/esri/core/workers/chunks/6828e4936db0121a9638.js +0 -1
  134. package/assets/esri/core/workers/chunks/6b0a6469673417563616.js +0 -1
  135. package/assets/esri/core/workers/chunks/6e679703b5d6fc1b91a5.js +0 -1
  136. package/assets/esri/core/workers/chunks/6f3731f19497cbc6ea74.js +0 -1
  137. package/assets/esri/core/workers/chunks/7649d59b0b7d53818a29.js +0 -1
  138. package/assets/esri/core/workers/chunks/7b8f0b63b968ff40d00d.js +0 -1
  139. package/assets/esri/core/workers/chunks/c977a47cabc419610277.js +0 -1
  140. package/assets/esri/core/workers/chunks/e8312c999b3f0c9ef09e.js +0 -1
  141. package/assets/esri/core/workers/chunks/fa9ef9e8eae505371965.js +0 -1
  142. package/assets/esri/core/workers/chunks/fb5b852d0f72df014377.js +0 -1
@@ -0,0 +1,4 @@
1
+ import "../../interfaces";
2
+
3
+ export type HistogramBin = __esri.types.HistogramBin;
4
+ export type HistogramResult = __esri.types.HistogramResult;
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
+ */
5
+ function n(){}export{n as __exported__};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- const c="20250403",f="378291f9d13234dc2483cf348050c8f6de4c332f";export{c as buildDate,f as commitHash};
5
+ const b="20250405",f="4d15bbe6b49fa5448fb1c7656fd720ef3894c14d";export{b as buildDate,f as commitHash};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Collection.js";import r from"../core/Error.js";import s from"../core/JSONSupport.js";import i from"../core/Loadable.js";import n from"../core/Logger.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";let c=class extends(s.JSONSupportMixin(i)){constructor(e){super(e),this.versionManagementService=null,this.featureServiceUrl=null,this.url=null,this.currentVersion=null,this.currentVersionInfo=null,this.versionInfos=[],this.versionableItems=new t,this.usePersistentReadSessions=!1,this.state="lock-none"}initialize(){this.url=this.versionManagementService.url,this.featureServiceUrl=this.url.replace(/\/VersionManagementServer/i,"/FeatureServer"),this.addHandles([this.versionableItems.on("before-add",(e=>{if(e.item.featureServiceUrl.toLowerCase()!==this.featureServiceUrl.toLowerCase())return e.preventDefault(),void n.getLogger(this).error("#add()","Cannot add versionAdapter, feature service urls do not match.")})),this.versionableItems.on("before-remove",(e=>{if(0===this.versionableItems.items.length&&this.currentVersion&&"name"in this.currentVersion&&"none"!==this.versionManagementService.getLockType(this.currentVersion))return e.preventDefault(),void n.getLogger(this).error("#remove()","Cannot remove last versionAdapter.")}))])}load(e){return this.addResolvingPromise(this._setUpState(e)),Promise.resolve(this)}get defaultVersionIdentifier(){return this.versionManagementService.defaultVersionIdentifier}get isDefault(){return!this.currentVersion||!!this.currentVersion&&"name"in this.currentVersion&&this.currentVersion.name===this.defaultVersionIdentifier.name}async getVersionInfos(e=!1){return e&&(this.versionInfos=await this.versionManagementService.getVersionInfos()),this.versionInfos}async alterVersion(e,t){if(this.currentVersion&&"guid"in this.currentVersion&&e.guid===this.currentVersion.guid)return!1;const r=await this.versionManagementService.alterVersion(e,t);return r&&await this.getVersionInfos(!0),r}async deleteVersion(e){if(this.currentVersion&&"guid"in this.currentVersion&&e.guid===this.currentVersion.guid)return!1;const t=await this.versionManagementService.deleteVersion(e);return t&&await this.getVersionInfos(!0),t}async getVersionInfoExtended(){return this.currentVersion&&"name"in this.currentVersion?this.versionManagementService.getVersionInfoExtended(this.currentVersion):this.versionManagementService.getVersionInfoExtended(this.defaultVersionIdentifier)}async startEditing(){if(this._isDefaultOrHistoricVersion())return{success:!1};if(!this.usePersistentReadSessions){const e=await this.versionManagementService.startReadingWithResult(this.currentVersion);if(!e.success)return e;this.state="lock-read"}const e=await this.versionManagementService.startEditingWithResult(this.currentVersion);return e.success&&(this.state="lock-write"),e}async stopEditing(e){if(this._isDefaultOrHistoricVersion())return{success:!1};const t=await this.versionManagementService.stopEditingWithResult(this.currentVersion,e);if(!t.success)return t;if(this.state="lock-read",!this.usePersistentReadSessions){const e=await this.versionManagementService.stopReadingWithResult(this.currentVersion);return e.success&&(this.state="lock-none"),e}return t}async changeVersion(e){let t=null;if(this.usePersistentReadSessions){if(this._isDefaultOrHistoricVersion(e))e&&"name"in e?(t=await this.versionManagementService.getVersionInfoExtended(e),this.state="public"===t?.access?"lock-none":"lock-read"):this.state="lock-read";else if(!await this.versionManagementService.startReading(e))throw new r("internal","Failed to acquire read lock for version: "+e);this._isDefaultOrHistoricVersion(this.currentVersion)||await this.versionManagementService.stopReading(this.currentVersion)}const s=await this.versionManagementService.changeVersionWithResult(this.versionableItems,this.currentVersion,e);let i=!1;return s.forEach(((e,t)=>{i=i||e.success})),i&&(this.currentVersion=e,this.currentVersionInfo=t||await this.getVersionInfoExtended(),this._isDefaultOrHistoricVersion()?this.currentVersion&&"name"in this.currentVersion?this.state="public"===this.currentVersionInfo?.access?"lock-none":"lock-read":this.state="lock-read":this.state="read"!==this.versionManagementService.getLockType(this.currentVersion)?"lock-none":"lock-read"),s}async undo(){return this._isDefaultOrHistoricVersion()?{success:!1}:(this.versionManagementService.undo(this.currentVersion),{success:!0})}async redo(){return this._isDefaultOrHistoricVersion()?{success:!1}:(this.versionManagementService.redo(this.currentVersion),{success:!0})}async _setUpState(e){await this.versionManagementService.load(e),this.state="lock-none",this.currentVersionInfo=await this.getVersionInfoExtended(),this.versionableItems.forEach((e=>{this.currentVersion?"name"in this.currentVersion?(e.gdbVersion=this.currentVersion.name,e.historicMoment=null):(e.historicMoment=this.currentVersion,e.gdbVersion=null):(e.gdbVersion=null,e.historicMoment=null)})),this.usePersistentReadSessions&&(this._isDefaultOrHistoricVersion()?this.currentVersion&&"name"in this.currentVersion?this.state="public"===this.currentVersionInfo?.access?"lock-none":"lock-read":this.state="lock-read":await this.versionManagementService.startReading(this.currentVersion)&&(this.state="lock-read"))}_isDefaultOrHistoricVersion(e=this.currentVersion){return!(e&&"name"in e)||e.name===this.versionManagementService.defaultVersionIdentifier.name}};e([o()],c.prototype,"versionManagementService",void 0),e([o()],c.prototype,"featureServiceUrl",void 0),e([o()],c.prototype,"url",void 0),e([o()],c.prototype,"currentVersion",void 0),e([o()],c.prototype,"currentVersionInfo",void 0),e([o()],c.prototype,"versionInfos",void 0),e([o()],c.prototype,"versionableItems",void 0),e([o()],c.prototype,"usePersistentReadSessions",void 0),e([o()],c.prototype,"state",void 0),e([o({readOnly:!0})],c.prototype,"defaultVersionIdentifier",null),e([o({readOnly:!0})],c.prototype,"isDefault",null),c=e([a("esri.versionManagement.VersioningState")],c);const u=c;export{u as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Collection.js";import r from"../core/Error.js";import s from"../core/JSONSupport.js";import i from"../core/Loadable.js";import n from"../core/Logger.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";let c=class extends(s.JSONSupportMixin(i)){constructor(e){super(e),this.versionManagementService=null,this.featureServiceUrl=null,this.url=null,this.currentVersion=null,this.currentVersionInfo=null,this.versionInfos=[],this.versionableItems=new t,this.usePersistentReadSessions=!1,this.state="lock-none"}initialize(){this.url=this.versionManagementService.url,this.featureServiceUrl=this.url.replace(/\/VersionManagementServer/i,"/FeatureServer"),this.addHandles([this.versionableItems.on("before-add",(e=>{if(e.item.featureServiceUrl.toLowerCase()!==this.featureServiceUrl.toLowerCase())return e.preventDefault(),void n.getLogger(this).error("#add()","Cannot add versionAdapter, feature service urls do not match.")})),this.versionableItems.on("before-remove",(e=>{if(0===this.versionableItems.items.length&&this.currentVersion&&"name"in this.currentVersion&&"none"!==this.versionManagementService.getLockType(this.currentVersion))return e.preventDefault(),void n.getLogger(this).error("#remove()","Cannot remove last versionAdapter.")}))])}load(e){return this.addResolvingPromise(this._setUpState(e)),Promise.resolve(this)}get defaultVersionIdentifier(){return this.versionManagementService.defaultVersionIdentifier}get isDefault(){return!this.currentVersion||!!this.currentVersion&&"name"in this.currentVersion&&this.currentVersion.name===this.defaultVersionIdentifier.name}async getVersionInfos(e=!1){return e&&(this.versionInfos=await this.versionManagementService.getVersionInfos()),this.versionInfos}async alterVersion(e,t){if(this.currentVersion&&"guid"in this.currentVersion&&e.guid===this.currentVersion.guid)return!1;const r=await this.versionManagementService.alterVersion(e,t);return r&&await this.getVersionInfos(!0),r}async deleteVersion(e){if(this.currentVersion&&"guid"in this.currentVersion&&e.guid===this.currentVersion.guid)return!1;const t=await this.versionManagementService.deleteVersion(e);return t&&await this.getVersionInfos(!0),t}async getVersionInfoExtended(){return this.currentVersion&&"name"in this.currentVersion?this.versionManagementService.getVersionInfoExtended(this.currentVersion):this.versionManagementService.getVersionInfoExtended(this.defaultVersionIdentifier)}async startEditing(){if(this._isDefaultOrHistoricVersion())return{success:!1};if(!this.usePersistentReadSessions){const e=await this.versionManagementService.startReadingWithResult(this.currentVersion);if(!e.success)return e;this.state="lock-read"}const e=await this.versionManagementService.startEditingWithResult(this.currentVersion);return e.success&&(this.state="lock-write"),e}async stopEditing(e){if(this._isDefaultOrHistoricVersion())return{success:!1};const t=await this.versionManagementService.stopEditingWithResult(this.currentVersion,e);if(!t.success)return t;if(this.state="lock-read",!this.usePersistentReadSessions){const e=await this.versionManagementService.stopReadingWithResult(this.currentVersion);return e.success&&(this.state="lock-none"),e}return t}async changeVersion(e){let t=null;if(this.usePersistentReadSessions){if(this._isDefaultOrHistoricVersion(e))e&&"name"in e?(t=await this.versionManagementService.getVersionInfoExtended(e),this.state="public"===t?.access?"lock-none":"lock-read"):this.state="lock-read";else if(!await this.versionManagementService.startReading(e))throw new r("versioning:failed-lock","Failed to acquire read lock for version: "+e);this._isDefaultOrHistoricVersion(this.currentVersion)||await this.versionManagementService.stopReading(this.currentVersion)}const s=await this.versionManagementService.changeVersionWithResult(this.versionableItems,this.currentVersion,e);let i=!1;return s.forEach(((e,t)=>{i=i||e.success})),i&&(this.currentVersion=e,this.currentVersionInfo=t||await this.getVersionInfoExtended(),this._isDefaultOrHistoricVersion()?this.currentVersion&&"name"in this.currentVersion?this.state="public"===this.currentVersionInfo?.access?"lock-none":"lock-read":this.state="lock-read":this.state="read"!==this.versionManagementService.getLockType(this.currentVersion)?"lock-none":"lock-read"),s}async undo(){return this._isDefaultOrHistoricVersion()?{success:!1}:(this.versionManagementService.undo(this.currentVersion),{success:!0})}async redo(){return this._isDefaultOrHistoricVersion()?{success:!1}:(this.versionManagementService.redo(this.currentVersion),{success:!0})}async _setUpState(e){await this.versionManagementService.load(e),this.state="lock-none",this.currentVersionInfo=await this.getVersionInfoExtended(),this.versionableItems.forEach((e=>{this.currentVersion?"name"in this.currentVersion?(e.gdbVersion=this.currentVersion.name,e.historicMoment=null):(e.historicMoment=this.currentVersion,e.gdbVersion=null):(e.gdbVersion=null,e.historicMoment=null)})),this.usePersistentReadSessions&&(this._isDefaultOrHistoricVersion()?this.currentVersion&&"name"in this.currentVersion?this.state="public"===this.currentVersionInfo?.access?"lock-none":"lock-read":this.state="lock-read":await this.versionManagementService.startReading(this.currentVersion)&&(this.state="lock-read"))}_isDefaultOrHistoricVersion(e=this.currentVersion){return!(e&&"name"in e)||e.name===this.versionManagementService.defaultVersionIdentifier.name}};e([o()],c.prototype,"versionManagementService",void 0),e([o()],c.prototype,"featureServiceUrl",void 0),e([o()],c.prototype,"url",void 0),e([o()],c.prototype,"currentVersion",void 0),e([o()],c.prototype,"currentVersionInfo",void 0),e([o()],c.prototype,"versionInfos",void 0),e([o()],c.prototype,"versionableItems",void 0),e([o()],c.prototype,"usePersistentReadSessions",void 0),e([o()],c.prototype,"state",void 0),e([o({readOnly:!0})],c.prototype,"defaultVersionIdentifier",null),e([o({readOnly:!0})],c.prototype,"isDefault",null),c=e([a("esri.versionManagement.VersioningState")],c);const u=c;export{u as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../core/Error.js";import has from"../../../core/has.js";import{removeMaybe as t}from"../../../core/maybe.js";import{addFrameTask as r}from"../../../core/scheduling.js";import{signal as s}from"../../../core/signal.js";import{create as i}from"../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{CIMAnalyzer as n}from"../../../symbols/cim/cimAnalyzer.js";import{Container as a}from"./Container.js";import{ManagedCanvas as o}from"./ManagedCanvas.js";import{MAX_TILE_RESHUFFLES_PER_FRAME as h}from"./webgl/definitions.js";import{WGLDrawPhase as d}from"./webgl/enums.js";import l from"./webgl/Painter.js";import{ArrayBufferPool as m}from"./webgl/PooledUint32Array.js";import{Profiler as c}from"./webgl/Profiler.js";import{TileReshuffleManager as u}from"./webgl/TileReshuffleManager.js";import{startup as p,shutdown as f}from"./webgl/shaderGraph/techniques/TechniqueRegistry.js";import{MeshWriterRegistry as g}from"./webgl/shaderGraph/techniques/mesh/MeshWriterRegistry.js";import{Timeline as _}from"../support/Timeline.js";import{TextureWrapMode as b,SizedPixelFormat as w,RenderbufferFormat as R,PixelFormat as y,PixelType as x}from"../../webgl/enums.js";import{FramebufferObject as P}from"../../webgl/FramebufferObject.js";import{RenderbufferDescriptor as j}from"../../webgl/RenderbufferDescriptor.js";import{RenderingContext as C}from"../../webgl/RenderingContext.js";import{TextureDescriptor as T}from"../../webgl/TextureDescriptor.js";const M=2e3;class O extends a{constructor(t,i){super(),this.meshWriterRegistry=new g,this._trash=new Set,this._renderRemainingTime=0,this._lastFrameRenderTime=0,this._renderRequested=s(!1),this.stage=this,this._stationary=!0,this._reshuffleManager=new u,this._canvas=new o(t),this.context=new C(this._canvas.gl,i.contextOptions??{}),this.painter=new l(this.context,this),this._cimAnalyzer=new n(this.painter.textureManager.resourceManager),has("esri-2d-profiler")&&(this._debugOutput=document.createElement("div"),this._debugOutput.setAttribute("style","margin: 24px 64px; position: absolute; color: red;"),t.appendChild(this._debugOutput));const a=()=>this.highlightGradient;this._renderParameters={drawPhase:0,state:this.state,pixelRatio:window.devicePixelRatio,stationary:!1,globalOpacity:1,blendMode:null,deltaTime:-1,time:0,inFadeTransition:!1,effects:null,context:this.context,painter:this.painter,timeline:i.timeline||new _,renderingOptions:i.renderingOptions,requestRender:()=>this.requestRender(),allowDelayedRender:!1,requireFBO:!1,profiler:new c(this.context,this._debugOutput),dataUploadCounter:0,get highlightGradient(){return a()},reshuffleManager:this._reshuffleManager,backgroundColor:i.backgroundColor},this._taskHandle=r({render:e=>this.renderFrame(e)}),this._taskHandle.pause(),this._lostWebGLContextHandle=this._canvas.events.on("webgl-context-lost",(t=>this.emit("webgl-error",{error:new e("webgl-context-lost",t.statusMessage)}))),this._bufferPool=new m,p()}destroy(){f(this.context),this.removeAllChildren(),this._emptyTrash(),this._taskHandle=t(this._taskHandle),this._lostWebGLContextHandle=t(this._lostWebGLContextHandle),this._canvas.destroy(),this._debugOutput?.parentNode?.removeChild(this._debugOutput),this._bufferPool.destroy(),this.painter.dispose(),this.context.dispose(),this._canvas=null}get textureManager(){return this.painter.textureManager}get backgroundColor(){return this._renderParameters.backgroundColor}set backgroundColor(e){this._renderParameters.backgroundColor=e,this.requestRender()}get bufferPool(){return this._bufferPool}get cimAnalyzer(){return this._cimAnalyzer}get renderingOptions(){return this._renderingOptions}set renderingOptions(e){this._renderingOptions=e,this.requestRender()}get renderRequested(){return this._renderRequested.value}get state(){return this._state}set state(e){this._state=e,this.requestRender()}get stationary(){return this._stationary}set stationary(e){this._stationary!==e&&(this._stationary=e,this.requestRender())}trashDisplayObject(e){this._trash.add(e),this.requestRender()}untrashDisplayObject(e){return this._trash.delete(e)}requestRender(){this._renderRemainingTime=M,this.renderRequested||(this._renderRequested.value=!0,this._taskHandle.resume())}renderFrame(e){const t=this._lastFrameRenderTime?e.time-this._lastFrameRenderTime:0;this._renderRemainingTime-=t,this._renderRemainingTime<=0&&this._taskHandle.pause(),this._lastFrameRenderTime=e.time,this._renderRequested.value=!1,this._renderParameters.state=this._state,this._renderParameters.stationary=this.stationary,this._renderParameters.pixelRatio=window.devicePixelRatio,this._renderParameters.globalOpacity=1,this._renderParameters.time=e.time,this._renderParameters.deltaTime=e.deltaTime,this._renderParameters.effects=null,this.processRender(this._renderParameters),this._emptyTrash()}_createTransforms(){return{displayViewScreenMat3:i()}}renderChildren(e){for(const t of this.children)t.beforeRender(e);this._reshuffleManager.reshuffle(h),this._canvas.render(e,(()=>this._renderChildren(this.children,e)));for(const t of this.children)t.afterRender(e)}_renderChildren(e,t){const r=this.context;this.painter.textureUploadManager.upload(),r.resetInfo(),t.profiler.recordStart("drawLayers"),t.dataUploadCounter=0,this.painter.beforeRenderPhases(t,t.backgroundColor,this.state.padding),t.drawPhase=d.MAP;for(const s of e)s.processRender(t);if(this.children.some((e=>e.hasHighlight))){t.drawPhase=d.HIGHLIGHT;for(const r of e)r.processRender(t)}if(this.children.some((e=>e.hasLabels))){t.drawPhase=d.LABEL;for(const r of e)r.processRender(t)}if(has("esri-tiles-debug")){t.drawPhase=d.DEBUG;for(const r of e)r.processRender(t)}this.painter.afterRenderPhases(t),t.profiler.recordEnd("drawLayers"),r.logInfo()}doRender(e){const t=this.context,{state:r,pixelRatio:s}=e;this._canvas.resize(e),t.setViewport(0,0,s*r.size[0],s*r.size[1]),t.setDepthWriteEnabled(!0),t.setStencilWriteMask(255),this.renderChildren(e)}async takeScreenshot(e,t,r,s){const i=Math.round(this.state.size[0]*e.resolutionScale),n=Math.round(this.state.size[1]*e.resolutionScale),a=e.resolutionScale,o=this.context,h=this._state.clone();if(null!=s){const e=h.viewpoint;h.viewpoint.rotation=s,h.viewpoint=e}const d={...this._renderParameters,drawPhase:null,globalOpacity:1,stationary:!0,state:h,pixelRatio:a,time:performance.now(),deltaTime:0,blendMode:null,effects:null,inFadeTransition:!1,backgroundColor:r},l=new T(i,n);l.wrapMode=b.CLAMP_TO_EDGE,l.internalFormat=w.RGBA8,l.isImmutable=!0;const m=new P(o,l,new j(R.DEPTH_STENCIL,i,n)),c=o.getBoundFramebufferObject(),u=o.getViewport();o.bindFramebuffer(m),o.setViewport(0,0,i,n),this._renderChildren(t??this.children,d);const p=this._readbackScreenshot(m,{...e.cropArea,y:n-(e.cropArea.y+e.cropArea.height)});o.bindFramebuffer(c),o.setViewport(u.x,u.y,u.width,u.height),this.requestRender();const f=await p;let g;return 1===e.outputScale?g=f:(g=new ImageData(Math.round(f.width*e.outputScale),Math.round(f.height*e.outputScale)),(await import("../../support/screenshotUtils.js")).resampleHermite(f,g,!0)),m.dispose(),g}async _readbackScreenshot(e,t){const r=(await import("../../support/screenshotUtils.js")).createEmptyImageData(t.width,t.height,document.createElement("canvas"));return await e.readPixelsAsync(t.x,t.y,t.width,t.height,y.RGBA,x.UNSIGNED_BYTE,new Uint8Array(r.data.buffer)),r}_emptyTrash(){for(;this._trash.size>0;){const e=Array.from(this._trash);this._trash.clear();for(const t of e)t.processDetach()}}}export{O as Stage,M as extraRenderTime};
5
+ import e from"../../../core/Error.js";import has from"../../../core/has.js";import{removeMaybe as t}from"../../../core/maybe.js";import{addFrameTask as r}from"../../../core/scheduling.js";import{signal as s}from"../../../core/signal.js";import{create as i}from"../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{CIMAnalyzer as n}from"../../../symbols/cim/cimAnalyzer.js";import{Container as a}from"./Container.js";import{ManagedCanvas as o}from"./ManagedCanvas.js";import{MAX_TILE_RESHUFFLES_PER_FRAME as h}from"./webgl/definitions.js";import{WGLDrawPhase as d}from"./webgl/enums.js";import l from"./webgl/Painter.js";import{ArrayBufferPool as m}from"./webgl/PooledUint32Array.js";import{Profiler as c}from"./webgl/Profiler.js";import{TileReshuffleManager as u}from"./webgl/TileReshuffleManager.js";import{startup as p,shutdown as f}from"./webgl/shaderGraph/techniques/TechniqueRegistry.js";import{MeshWriterRegistry as g}from"./webgl/shaderGraph/techniques/mesh/MeshWriterRegistry.js";import{Timeline as _}from"../support/Timeline.js";import{TextureWrapMode as b,SizedPixelFormat as w,SizedDepthStencilFormat as R,PixelFormat as y,PixelType as x}from"../../webgl/enums.js";import{FramebufferObject as P}from"../../webgl/FramebufferObject.js";import{RenderbufferDescriptor as j}from"../../webgl/RenderbufferDescriptor.js";import{RenderingContext as C}from"../../webgl/RenderingContext.js";import{TextureDescriptor as T}from"../../webgl/TextureDescriptor.js";const M=2e3;class O extends a{constructor(t,i){super(),this.meshWriterRegistry=new g,this._trash=new Set,this._renderRemainingTime=0,this._lastFrameRenderTime=0,this._renderRequested=s(!1),this.stage=this,this._stationary=!0,this._reshuffleManager=new u,this._canvas=new o(t),this.context=new C(this._canvas.gl,i.contextOptions??{}),this.painter=new l(this.context,this),this._cimAnalyzer=new n(this.painter.textureManager.resourceManager),has("esri-2d-profiler")&&(this._debugOutput=document.createElement("div"),this._debugOutput.setAttribute("style","margin: 24px 64px; position: absolute; color: red;"),t.appendChild(this._debugOutput));const a=()=>this.highlightGradient;this._renderParameters={drawPhase:0,state:this.state,pixelRatio:window.devicePixelRatio,stationary:!1,globalOpacity:1,blendMode:null,deltaTime:-1,time:0,inFadeTransition:!1,effects:null,context:this.context,painter:this.painter,timeline:i.timeline||new _,renderingOptions:i.renderingOptions,requestRender:()=>this.requestRender(),allowDelayedRender:!1,requireFBO:!1,profiler:new c(this.context,this._debugOutput),dataUploadCounter:0,get highlightGradient(){return a()},reshuffleManager:this._reshuffleManager,backgroundColor:i.backgroundColor},this._taskHandle=r({render:e=>this.renderFrame(e)}),this._taskHandle.pause(),this._lostWebGLContextHandle=this._canvas.events.on("webgl-context-lost",(t=>this.emit("webgl-error",{error:new e("webgl-context-lost",t.statusMessage)}))),this._bufferPool=new m,p()}destroy(){f(this.context),this.removeAllChildren(),this._emptyTrash(),this._taskHandle=t(this._taskHandle),this._lostWebGLContextHandle=t(this._lostWebGLContextHandle),this._canvas.destroy(),this._debugOutput?.parentNode?.removeChild(this._debugOutput),this._bufferPool.destroy(),this.painter.dispose(),this.context.dispose(),this._canvas=null}get textureManager(){return this.painter.textureManager}get backgroundColor(){return this._renderParameters.backgroundColor}set backgroundColor(e){this._renderParameters.backgroundColor=e,this.requestRender()}get bufferPool(){return this._bufferPool}get cimAnalyzer(){return this._cimAnalyzer}get renderingOptions(){return this._renderingOptions}set renderingOptions(e){this._renderingOptions=e,this.requestRender()}get renderRequested(){return this._renderRequested.value}get state(){return this._state}set state(e){this._state=e,this.requestRender()}get stationary(){return this._stationary}set stationary(e){this._stationary!==e&&(this._stationary=e,this.requestRender())}trashDisplayObject(e){this._trash.add(e),this.requestRender()}untrashDisplayObject(e){return this._trash.delete(e)}requestRender(){this._renderRemainingTime=M,this.renderRequested||(this._renderRequested.value=!0,this._taskHandle.resume())}renderFrame(e){const t=this._lastFrameRenderTime?e.time-this._lastFrameRenderTime:0;this._renderRemainingTime-=t,this._renderRemainingTime<=0&&this._taskHandle.pause(),this._lastFrameRenderTime=e.time,this._renderRequested.value=!1,this._renderParameters.state=this._state,this._renderParameters.stationary=this.stationary,this._renderParameters.pixelRatio=window.devicePixelRatio,this._renderParameters.globalOpacity=1,this._renderParameters.time=e.time,this._renderParameters.deltaTime=e.deltaTime,this._renderParameters.effects=null,this.processRender(this._renderParameters),this._emptyTrash()}_createTransforms(){return{displayViewScreenMat3:i()}}renderChildren(e){for(const t of this.children)t.beforeRender(e);this._reshuffleManager.reshuffle(h),this._canvas.render(e,(()=>this._renderChildren(this.children,e)));for(const t of this.children)t.afterRender(e)}_renderChildren(e,t){const r=this.context;this.painter.textureUploadManager.upload(),r.resetInfo(),t.profiler.recordStart("drawLayers"),t.dataUploadCounter=0,this.painter.beforeRenderPhases(t,t.backgroundColor,this.state.padding),t.drawPhase=d.MAP;for(const s of e)s.processRender(t);if(this.children.some((e=>e.hasHighlight))){t.drawPhase=d.HIGHLIGHT;for(const r of e)r.processRender(t)}if(this.children.some((e=>e.hasLabels))){t.drawPhase=d.LABEL;for(const r of e)r.processRender(t)}if(has("esri-tiles-debug")){t.drawPhase=d.DEBUG;for(const r of e)r.processRender(t)}this.painter.afterRenderPhases(t),t.profiler.recordEnd("drawLayers"),r.logInfo()}doRender(e){const t=this.context,{state:r,pixelRatio:s}=e;this._canvas.resize(e),t.setViewport(0,0,s*r.size[0],s*r.size[1]),t.setDepthWriteEnabled(!0),t.setStencilWriteMask(255),this.renderChildren(e)}async takeScreenshot(e,t,r,s){const i=Math.round(this.state.size[0]*e.resolutionScale),n=Math.round(this.state.size[1]*e.resolutionScale),a=e.resolutionScale,o=this.context,h=this._state.clone();if(null!=s){const e=h.viewpoint;h.viewpoint.rotation=s,h.viewpoint=e}const d={...this._renderParameters,drawPhase:null,globalOpacity:1,stationary:!0,state:h,pixelRatio:a,time:performance.now(),deltaTime:0,blendMode:null,effects:null,inFadeTransition:!1,backgroundColor:r},l=new T(i,n);l.wrapMode=b.CLAMP_TO_EDGE,l.internalFormat=w.RGBA8,l.isImmutable=!0;const m=new P(o,l,new j(R.DEPTH24_STENCIL8,i,n)),c=o.getBoundFramebufferObject(),u=o.getViewport();o.bindFramebuffer(m),o.setViewport(0,0,i,n),this._renderChildren(t??this.children,d);const p=this._readbackScreenshot(m,{...e.cropArea,y:n-(e.cropArea.y+e.cropArea.height)});o.bindFramebuffer(c),o.setViewport(u.x,u.y,u.width,u.height),this.requestRender();const f=await p;let g;return 1===e.outputScale?g=f:(g=new ImageData(Math.round(f.width*e.outputScale),Math.round(f.height*e.outputScale)),(await import("../../support/screenshotUtils.js")).resampleHermite(f,g,!0)),m.dispose(),g}async _readbackScreenshot(e,t){const r=(await import("../../support/screenshotUtils.js")).createEmptyImageData(t.width,t.height,document.createElement("canvas"));return await e.readPixelsAsync(t.x,t.y,t.width,t.height,y.RGBA,x.UNSIGNED_BYTE,new Uint8Array(r.data.buffer)),r}_emptyTrash(){for(;this._trash.size>0;){const e=Array.from(this._trash);this._trash.clear();for(const t of e)t.processDetach()}}}export{O as Stage,M as extraRenderTime};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Error.js";import r from"../../../../core/Logger.js";import{e as t}from"../../../../chunks/earcut.js";import{set as n}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as o}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{convertFromNestedArray as s,convertFromPolygon as i}from"../../../../layers/graphics/featureConversionUtils.js";import c from"../../../../layers/graphics/OptimizedGeometry.js";import{i1616to32 as a}from"./number.js";import{BufferObject as f}from"../../../webgl/BufferObject.js";import{PrimitiveType as m,Usage as h,DataType as u}from"../../../webgl/enums.js";const l=r=>{switch(r.BYTES_PER_ELEMENT){case 1:return u.UNSIGNED_BYTE;case 2:return u.UNSIGNED_SHORT;case 4:return u.UNSIGNED_INT;default:throw new e("internal","Cannot get DataType of array")}},y=(e,r,t,n)=>{let o=0;for(let s=1;s<t;s++){const t=e[2*(r+s-1)],n=e[2*(r+s-1)+1];o+=(e[2*(r+s)]-t)*(e[2*(r+s)+1]+n)}return n?o>0:o<0},g=({coords:e,lengths:r},n)=>{const o=[];for(let s=0,i=0;s<r.length;i+=r[s],s+=1){const c=i,a=[];for(;s<r.length-1&&y(e,i+r[s],r[s+1],n);s+=1,i+=r[s])a.push(i+r[s]-c);const f=e.slice(2*c,2*(i+r[s])),m=t(f,a,2);for(const e of m)o.push(e+c)}return o};class p{constructor(e,r,t,n=!1){this._cache={},this.vertices=e,this.indices=r,this.primitiveType=t,this.isMapSpace=n}static fromPath(e){const r=s(new c,e.path,!1,!1),t=r.coords,n=new Uint32Array(g(r,!0)),o=new Uint32Array(t.length/2);for(let s=0;s<o.length;s++)o[s]=a(Math.floor(t[2*s]),Math.floor(t[2*s+1]));return new p({geometry:o},n,m.TRIANGLES)}static fromGeometry(t,n){const o=n.geometry?.type;switch(o){case"polygon":return p.fromPolygon(t,n.geometry);case"extent":return p.fromMapExtent(t,n.geometry);default:return r.getLogger("esri.views.2d.engine.webgl.Mesh2D").error(new e("mapview-bad-type",`Unable to create a mesh from type ${o}`,n)),p.fromScreenExtent({xmin:0,ymin:0,xmax:1,ymax:1})}}static fromPolygon(e,r){const t=i(new c,r,!1,!1),s=t.coords,f=new Uint32Array(g(t,!1)),h=new Uint32Array(s.length/2),u=o(),l=o();for(let o=0;o<h.length;o++)n(u,s[2*o],s[2*o+1]),e.toScreen(l,u),h[o]=a(Math.floor(l[0]),Math.floor(l[1]));return new p({geometry:h},f,m.TRIANGLES,!0)}static fromScreenExtent({xmin:e,xmax:r,ymin:t,ymax:n}){const o={geometry:new Uint32Array([a(e,t),a(r,t),a(e,n),a(e,n),a(r,t),a(r,n)])},s=new Uint32Array([0,1,2,3,4,5]);return new p(o,s,m.TRIANGLES)}static fromMapExtent(e,r){const[t,n]=e.toScreen([0,0],[r.xmin,r.ymin]),[o,s]=e.toScreen([0,0],[r.xmax,r.ymax]),i={geometry:new Uint32Array([a(t,n),a(o,n),a(t,s),a(t,s),a(o,n),a(o,s)])},c=new Uint32Array([0,1,2,3,4,5]);return new p(i,c,m.TRIANGLES)}destroy(){null!=this._cache.indexBuffer&&this._cache.indexBuffer.dispose(),this._cache.vertexBuffers?.forEach((e=>e?.dispose())),this._cache.indexBuffer=this._cache.vertexBuffers=null}get elementType(){return l(this.indices)}getIndexBuffer(e,r=h.STATIC_DRAW){return this._cache.indexBuffer??=f.createIndex(e,r,this.indices),this._cache.indexBuffer}getVertexBuffers(e,r=h.STATIC_DRAW){return this._cache.vertexBuffers??=new Map(Object.keys(this.vertices).reduce(((t,n)=>(t.push([n,f.createVertex(e,r,this.vertices[n])]),t)),new Array)),this._cache.vertexBuffers}}export{p as default};
5
+ import e from"../../../../core/Error.js";import r from"../../../../core/Logger.js";import{e as t}from"../../../../chunks/earcut.js";import{set as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{convertFromNestedArray as s,convertFromPolygon as i}from"../../../../layers/graphics/featureConversionUtils.js";import c from"../../../../layers/graphics/OptimizedGeometry.js";import{i1616to32 as a}from"./number.js";import{BufferObject as f}from"../../../webgl/BufferObject.js";import{PrimitiveType as m,Usage as h}from"../../../webgl/enums.js";const l=(e,r,t,o)=>{let n=0;for(let s=1;s<t;s++){const t=e[2*(r+s-1)],o=e[2*(r+s-1)+1];n+=(e[2*(r+s)]-t)*(e[2*(r+s)+1]+o)}return o?n>0:n<0},u=({coords:e,lengths:r},o)=>{const n=[];for(let s=0,i=0;s<r.length;i+=r[s],s+=1){const c=i,a=[];for(;s<r.length-1&&l(e,i+r[s],r[s+1],o);s+=1,i+=r[s])a.push(i+r[s]-c);const f=e.slice(2*c,2*(i+r[s])),m=t(f,a,2);for(const e of m)n.push(e+c)}return n};class y{constructor(e,r,t,o=!1){this._cache={},this.vertices=e,this.indices=r,this.primitiveType=t,this.isMapSpace=o}static fromPath(e){const r=s(new c,e.path,!1,!1),t=r.coords,o=new Uint32Array(u(r,!0)),n=new Uint32Array(t.length/2);for(let s=0;s<n.length;s++)n[s]=a(Math.floor(t[2*s]),Math.floor(t[2*s+1]));return new y({geometry:n},o,m.TRIANGLES)}static fromGeometry(t,o){const n=o.geometry?.type;switch(n){case"polygon":return y.fromPolygon(t,o.geometry);case"extent":return y.fromMapExtent(t,o.geometry);default:return r.getLogger("esri.views.2d.engine.webgl.Mesh2D").error(new e("mapview-bad-type",`Unable to create a mesh from type ${n}`,o)),y.fromScreenExtent({xmin:0,ymin:0,xmax:1,ymax:1})}}static fromPolygon(e,r){const t=i(new c,r,!1,!1),s=t.coords,f=new Uint32Array(u(t,!1)),h=new Uint32Array(s.length/2),l=n(),x=n();for(let n=0;n<h.length;n++)o(l,s[2*n],s[2*n+1]),e.toScreen(x,l),h[n]=a(Math.floor(x[0]),Math.floor(x[1]));return new y({geometry:h},f,m.TRIANGLES,!0)}static fromScreenExtent({xmin:e,xmax:r,ymin:t,ymax:o}){const n={geometry:new Uint32Array([a(e,t),a(r,t),a(e,o),a(e,o),a(r,t),a(r,o)])},s=new Uint32Array([0,1,2,3,4,5]);return new y(n,s,m.TRIANGLES)}static fromMapExtent(e,r){const[t,o]=e.toScreen([0,0],[r.xmin,r.ymin]),[n,s]=e.toScreen([0,0],[r.xmax,r.ymax]),i={geometry:new Uint32Array([a(t,o),a(n,o),a(t,s),a(t,s),a(n,o),a(n,s)])},c=new Uint32Array([0,1,2,3,4,5]);return new y(i,c,m.TRIANGLES)}destroy(){null!=this._cache.indexBuffer&&this._cache.indexBuffer.dispose(),this._cache.vertexBuffers?.forEach((e=>e?.dispose())),this._cache.indexBuffer=this._cache.vertexBuffers=null}getIndexBuffer(e,r=h.STATIC_DRAW){return this._cache.indexBuffer??=f.createIndex(e,r,this.indices),this._cache.indexBuffer}getVertexBuffers(e,r=h.STATIC_DRAW){return this._cache.vertexBuffers??=new Map(Object.keys(this.vertices).reduce(((t,o)=>(t.push([o,f.createVertex(e,r,this.vertices[o])]),t)),new Array)),this._cache.vertexBuffers}}export{y as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../core/has.js";import{disposeMaybe as e,destroyMaybe as t}from"../../../../core/maybe.js";import{brushes as s}from"../brushes.js";import r from"../vectorTiles/shaders/VTLMaterialManager.js";import{BitBlitRenderer as i}from"./BitBlitRenderer.js";import{backbufferStencilVisible as n}from"./definitions.js";import{WGLDrawPhase as a}from"./enums.js";import o from"./MaterialManager.js";import h from"./TextureManager.js";import{TextureUploadManager as l}from"./TextureUploadManager.js";import{WorldExtentRenderer as f}from"./WorldExtentClipRenderer.js";import{BlendEffect as c}from"./effects/BlendEffect.js";import{FeatureEffect as d}from"./effects/FeatureEffect.js";import u from"./effects/HighlightEffect.js";import{HittestEffect as p}from"./effects/HittestEffect.js";import{EffectManager as _}from"./effects/post-processing/EffectManager.js";import{SimpleMesh as b}from"./meshing/SimpleMesh.js";import m from"./painter/RenderPass.js";import{TechniqueProgramCache as E}from"./shaderGraph/techniques/TechniqueProgramCache.js";import{TextureSamplingMode as S,TextureWrapMode as g,FramebufferBit as w,CompareFunction as M,BlendFactor as P,RenderbufferFormat as C,BlendOperation as B,Face as N}from"../../../webgl/enums.js";import{FramebufferObject as O}from"../../../webgl/FramebufferObject.js";import{Renderbuffer as R}from"../../../webgl/Renderbuffer.js";import{RenderbufferDescriptor as A}from"../../../webgl/RenderbufferDescriptor.js";import{TextureDescriptor as T}from"../../../webgl/TextureDescriptor.js";class F{constructor(e,t){this.context=e,this._currentPipelineStateNeedsUpdate=!1,this._blitRenderer=new i,this._worldExtentRenderer=new f,this._brushCache=new Map,this._lastWidth=null,this._lastHeight=null,this._vtlMaterialManager=new r,this._blendEffect=new c,this._stencilBuf=null,this._prevBeforeLayerFBOStack=[],this._fboPool=[],this.effects={highlight:new u,hittest:new p,insideEffect:new d("inside"),outsideEffect:new d("outside")},this._programCache=new E,this._shaderState={shader:null,uniforms:null,defines:null,optionalAttributes:null,useComputeBuffer:!1},this.materialManager=new o(e),this.textureManager=new h(t),this.textureUploadManager=new l(t),this._effectsManager=new _,this._quadMesh=b.fromVertexStream(e,[0,0,1,0,0,1,1,1])}dispose(){if(this._programCache.destroy(),this.materialManager.dispose(),this.textureManager.dispose(),this.textureUploadManager.destroy(),this._blitRenderer=e(this._blitRenderer),this._worldExtentRenderer=e(this._worldExtentRenderer),this._quadMesh=t(this._quadMesh),this._brushCache&&(this._brushCache.forEach((e=>e.dispose())),this._brushCache.clear(),this._brushCache=null),this._fbos){let e;for(e in this._fbos)this._fbos[e]&&this._fbos[e].dispose()}for(const e of this._fboPool)e.dispose();if(this._fboPool.length=0,this.effects){let e;for(e in this.effects)this.effects[e]&&this.effects[e].dispose()}this._effectsManager.dispose(),this._blendEffect.dispose(this.context),this._vtlMaterialManager=e(this._vtlMaterialManager)}clearShaderCache(){this._programCache.destroy(),this._programCache=new E}get blitRenderer(){return this._blitRenderer}get vectorTilesMaterialManager(){return this._vtlMaterialManager}get quadMesh(){return this._quadMesh}getFbos(){if(!this._fbos)throw new Error("InternalError: Painter FBOs not initialized");return this._fbos}acquireFbo(e,t){let s;if(this._fboPool.length>0)s=this._fboPool.pop();else{const r=new T(e,t);r.samplingMode=S.NEAREST,r.wrapMode=g.CLAMP_TO_EDGE,s=new O(this.context,r,this._stencilBuf)}return s.width===e&&s.height===t||s.resize(e,t),s}releaseFbo(e){this._fboPool.push(e)}getSharedStencilBuffer(){return this._stencilBuf}beforeRenderPhases(e,t,s){const{context:r}=e;this._worldExtentRenderer.render(e,t,s);const{width:i,height:n}=r.getViewport();if(this.updateFBOs(i,n),this._prevFBO=r.getBoundFramebufferObject(),r.bindFramebuffer(this.getFbos().output),r.setColorMask(!0,!0,!0,!0),null!=t){const{r:e,g:s,b:i,a:n}=t;r.setClearColor(n*e/255,n*s/255,n*i/255,n)}else r.setClearColor(0,0,0,0);r.setDepthWriteEnabled(!0),r.setClearDepth(1),r.clear(w.COLOR|w.DEPTH),r.setDepthWriteEnabled(!1)}afterRenderPhases(e){const{context:t}=e;t.bindFramebuffer(this._prevFBO),t.setStencilFunction(M.EQUAL,n,255),t.setStencilTestEnabled(!0),t.setDepthTestEnabled(!1),this.blitTexture(t,this.getFbos().output.colorTexture,S.NEAREST)}beforeRenderLayer(e,t,s){const{context:r,blendMode:i,effects:n,drawPhase:a,requireFBO:o}=e;if(o||x(a,i,n,s)){const e=r.getBoundFramebufferObject();this._prevBeforeLayerFBOStack.push(e);const{width:t,height:s}=r.getViewport(),i=this.acquireFbo(t,s);r.bindFramebuffer(i),r.setColorMask(!0,!0,!0,!0),r.setClearColor(0,0,0,0),r.setDepthWriteEnabled(!0),r.setClearDepth(1),r.clear(w.COLOR|w.DEPTH),r.setDepthWriteEnabled(!1)}r.setDepthWriteEnabled(!1),r.setDepthTestEnabled(!1),r.setStencilTestEnabled(!0),r.setClearStencil(t),r.setStencilWriteMask(255),r.clear(w.STENCIL)}afterRenderLayer(e,t){const{context:s,blendMode:r,effects:i,requireFBO:n,drawPhase:o}=e;if(n||x(o,r,i,t)){const n=s.getBoundFramebufferObject();null!=i&&i.length>0&&o===a.MAP&&(s.setColorMask(!0,!0,!0,!0),this._applyEffects(e,i,n)),s.bindFramebuffer(this._prevBeforeLayerFBOStack.pop()),s.setStencilTestEnabled(!1),s.setStencilWriteMask(0),s.setBlendingEnabled(!0),s.setBlendFunctionSeparate(P.ONE,P.ONE_MINUS_SRC_ALPHA,P.ONE,P.ONE_MINUS_SRC_ALPHA),s.setColorMask(!0,!0,!0,!0);const h=null==r||o===a.HIGHLIGHT||o===a.LABEL?"normal":r;this._blendEffect.draw(e,n.colorTexture,S.NEAREST,h,t),this.releaseFbo(n)}}renderObject(e,t,r,i){const n=s[r];if(!n)return;let a=this._brushCache.get(n);void 0===a&&(a=new n,this._brushCache.set(n,a)),a.prepareState(e),a.draw(e,t,i)}renderObjects(e,t,r,i){const n=s[r];if(!n)return;let a=this._brushCache.get(n);void 0===a&&(a=new n,this._brushCache.set(n,a)),a.drawMany(e,t,i)}registerRenderPass(e){const t=e.brushes.map((e=>(this._brushCache.has(e)||this._brushCache.set(e,new e),this._brushCache.get(e))));return new m(t,e)}blitTexture(e,t,s,r=1){e.setBlendingEnabled(!0),e.setBlendFunctionSeparate(P.ONE,P.ONE_MINUS_SRC_ALPHA,P.ONE,P.ONE_MINUS_SRC_ALPHA),e.setColorMask(!0,!0,!0,!0),this._blitRenderer.render(e,t,s,r),this._currentPipelineStateNeedsUpdate=!0}getPostProcessingEffects(e){return this._effectsManager.getPostProcessingEffects(e)}updateFBOs(e,t){if(e!==this._lastWidth||t!==this._lastHeight){if(this._lastWidth=e,this._lastHeight=t,this._fbos){let s;for(s in this._fbos)this._fbos[s].resize(e,t);return}const s=new T(e,t);s.samplingMode=S.NEAREST,s.wrapMode=g.CLAMP_TO_EDGE;const r=new A(C.DEPTH_STENCIL,e,t);this._stencilBuf=new R(this.context,r),this._fbos={output:new O(this.context,s,this._stencilBuf),effect0:new O(this.context,s,this._stencilBuf)}}}_applyEffects(e,t,s){const{context:r}=e,i=this._effectsManager.getPostProcessingEffects(t);for(const{postProcessingEffect:n,effect:a}of i)r.bindFramebuffer(s),n.draw(e,s,a);this._currentPipelineStateNeedsUpdate=!0}setShader(e){this._shaderState.shader=e.shader,this._shaderState.uniforms=e.uniforms,this._shaderState.defines=e.defines,this._shaderState.optionalAttributes=e.optionalAttributes,this._shaderState.useComputeBuffer=e.useComputeBuffer??!1}setPipelineState(e){e!==this._currentPipelineState&&(this._currentPipelineState=e,this._currentPipelineStateNeedsUpdate=!0)}submitDraw(e,t){const{shader:s,uniforms:r,defines:i,optionalAttributes:n}=this._shaderState,a=e.context,o=t.getAttributePrecisionPackFactors(),h=this._programCache.getProgram(s,o,r,i??{},n??{});return h.setUniforms(r),h.bind(a),this.updatePipelineState(a),this.setStencilRef(a,t),t.draw(e,s.locationInfo),h.cleanupTemporaryTextures(),{vertexShader:h.vertexShader,fragmentShader:h.fragmentShader}}submitDrawMesh(e,t,s,r){this.submitDrawMeshUntyped(e,t,s,r)}submitDrawMeshUntyped(e,t,s,r){this.setShader(t);const{shader:i,uniforms:n,defines:a,optionalAttributes:o}=this._shaderState,h=this._programCache.getProgram(i,{},n,a??{},o??{});if(h.setUniforms(n),h.bind(e),this.updatePipelineState(e),r)for(const l of r)s.bind(e,t.shader.locationInfo,l),s.draw(e);else for(let l=0;l<s.parts.length;l++)s.bind(e,t.shader.locationInfo,l),s.draw(e);s.unbind(e),h.cleanupTemporaryTextures()}updatePipelineState(e){this._currentPipelineStateNeedsUpdate&&(this._currentPipelineStateNeedsUpdate=!1,this._updatePipelineState(e))}_updatePipelineState(e){if(null==this._currentPipelineState)throw new Error("Pipeline state not defined. Call setPipelineState before calling submitDraw ");const{color:t,depth:s,stencil:r}=this._currentPipelineState;if(t){const{blendMode:s,write:r}=t;switch(e.setColorMask(...r),e.setBlendingEnabled(!0),e.setBlendEquation(B.ADD),s){case"composite":e.setBlendFunctionSeparate(P.ONE,P.ONE_MINUS_SRC_ALPHA,P.ONE,P.ONE_MINUS_SRC_ALPHA);break;case"additive":e.setBlendFunctionSeparate(P.ONE,P.ONE,P.ONE,P.ONE);break;case"custom":{const{blendParameters:s}=t,{dstAlpha:r,dstRGB:i,srcAlpha:n,srcRGB:a}=s;e.setBlendFunctionSeparate(a,i,n,r);break}case"delete":e.setBlendEquation(B.REVERSE_SUBTRACT),e.setBlendFunctionSeparate(P.ONE,P.ONE_MINUS_SRC_ALPHA,P.ONE,P.ONE_MINUS_SRC_ALPHA)}}else e.setColorMask(!1,!1,!1,!1);if(s){const{test:t,write:r}=s;r?(e.setDepthWriteEnabled(!0),e.setDepthRange(r.zNear,r.zFar)):e.setDepthWriteEnabled(!1),t?(e.setDepthTestEnabled(!0),e.setDepthFunction(t)):e.setDepthTestEnabled(!1)}else e.setDepthTestEnabled(!1),e.setDepthWriteEnabled(!1);if(r){const{test:t,write:s}=r;if(t){const{compare:s,mask:r,op:i,ref:n}=t;e.setStencilTestEnabled(!0),"function"!=typeof n&&e.setStencilFunctionSeparate(N.FRONT_AND_BACK,s,n,r),e.setStencilOpSeparate(N.FRONT_AND_BACK,i.fail,i.zFail,i.zPass)}else e.setStencilTestEnabled(!1);if(s){const{mask:t}=s;e.setStencilWriteMask(t)}else e.setStencilWriteMask(0)}else e.setStencilTestEnabled(!1),e.setStencilWriteMask(0)}setStencilRef(e,t){if(null==this._currentPipelineState)throw new Error("Pipeline state not defined. Call setPipelineState before calling submitDraw ");const{stencil:s}=this._currentPipelineState;if(s){const{test:r}=s;if(r){const{compare:s,mask:i,ref:n}=r;if("function"==typeof n){const r=t.getStencilReference();if(null===r)throw new Error("InternalError: Stencil reference expected for target but not defined");e.setStencilFunctionSeparate(N.FRONT_AND_BACK,s,r,i)}}}}}function x(e,t,s,r){return e!==a.LABEL_ALPHA&&e!==a.LABEL&&e!==a.HIGHLIGHT&&(1!==r||null!=t&&"normal"!==t||null!=s&&s.length>0)}export{F as default};
5
+ import"../../../../core/has.js";import{disposeMaybe as e,destroyMaybe as t}from"../../../../core/maybe.js";import{brushes as s}from"../brushes.js";import r from"../vectorTiles/shaders/VTLMaterialManager.js";import{BitBlitRenderer as i}from"./BitBlitRenderer.js";import{backbufferStencilVisible as n}from"./definitions.js";import{WGLDrawPhase as a}from"./enums.js";import o from"./MaterialManager.js";import h from"./TextureManager.js";import{TextureUploadManager as l}from"./TextureUploadManager.js";import{WorldExtentRenderer as f}from"./WorldExtentClipRenderer.js";import{BlendEffect as c}from"./effects/BlendEffect.js";import{FeatureEffect as d}from"./effects/FeatureEffect.js";import u from"./effects/HighlightEffect.js";import{HittestEffect as p}from"./effects/HittestEffect.js";import{EffectManager as _}from"./effects/post-processing/EffectManager.js";import{SimpleMesh as b}from"./meshing/SimpleMesh.js";import m from"./painter/RenderPass.js";import{TechniqueProgramCache as E}from"./shaderGraph/techniques/TechniqueProgramCache.js";import{TextureSamplingMode as S,TextureWrapMode as g,FramebufferBit as w,CompareFunction as M,BlendFactor as P,SizedDepthStencilFormat as C,BlendOperation as B,Face as N}from"../../../webgl/enums.js";import{FramebufferObject as O}from"../../../webgl/FramebufferObject.js";import{Renderbuffer as R}from"../../../webgl/Renderbuffer.js";import{RenderbufferDescriptor as A}from"../../../webgl/RenderbufferDescriptor.js";import{TextureDescriptor as T}from"../../../webgl/TextureDescriptor.js";class F{constructor(e,t){this.context=e,this._currentPipelineStateNeedsUpdate=!1,this._blitRenderer=new i,this._worldExtentRenderer=new f,this._brushCache=new Map,this._lastWidth=null,this._lastHeight=null,this._vtlMaterialManager=new r,this._blendEffect=new c,this._stencilBuf=null,this._prevBeforeLayerFBOStack=[],this._fboPool=[],this.effects={highlight:new u,hittest:new p,insideEffect:new d("inside"),outsideEffect:new d("outside")},this._programCache=new E,this._shaderState={shader:null,uniforms:null,defines:null,optionalAttributes:null,useComputeBuffer:!1},this.materialManager=new o(e),this.textureManager=new h(t),this.textureUploadManager=new l(t),this._effectsManager=new _,this._quadMesh=b.fromVertexStream(e,[0,0,1,0,0,1,1,1])}dispose(){if(this._programCache.destroy(),this.materialManager.dispose(),this.textureManager.dispose(),this.textureUploadManager.destroy(),this._blitRenderer=e(this._blitRenderer),this._worldExtentRenderer=e(this._worldExtentRenderer),this._quadMesh=t(this._quadMesh),this._brushCache&&(this._brushCache.forEach((e=>e.dispose())),this._brushCache.clear(),this._brushCache=null),this._fbos){let e;for(e in this._fbos)this._fbos[e]&&this._fbos[e].dispose()}for(const e of this._fboPool)e.dispose();if(this._fboPool.length=0,this.effects){let e;for(e in this.effects)this.effects[e]&&this.effects[e].dispose()}this._effectsManager.dispose(),this._blendEffect.dispose(this.context),this._vtlMaterialManager=e(this._vtlMaterialManager)}clearShaderCache(){this._programCache.destroy(),this._programCache=new E}get blitRenderer(){return this._blitRenderer}get vectorTilesMaterialManager(){return this._vtlMaterialManager}get quadMesh(){return this._quadMesh}getFbos(){if(!this._fbos)throw new Error("InternalError: Painter FBOs not initialized");return this._fbos}acquireFbo(e,t){let s;if(this._fboPool.length>0)s=this._fboPool.pop();else{const r=new T(e,t);r.samplingMode=S.NEAREST,r.wrapMode=g.CLAMP_TO_EDGE,s=new O(this.context,r,this._stencilBuf)}return s.width===e&&s.height===t||s.resize(e,t),s}releaseFbo(e){this._fboPool.push(e)}getSharedStencilBuffer(){return this._stencilBuf}beforeRenderPhases(e,t,s){const{context:r}=e;this._worldExtentRenderer.render(e,t,s);const{width:i,height:n}=r.getViewport();if(this.updateFBOs(i,n),this._prevFBO=r.getBoundFramebufferObject(),r.bindFramebuffer(this.getFbos().output),r.setColorMask(!0,!0,!0,!0),null!=t){const{r:e,g:s,b:i,a:n}=t;r.setClearColor(n*e/255,n*s/255,n*i/255,n)}else r.setClearColor(0,0,0,0);r.setDepthWriteEnabled(!0),r.setClearDepth(1),r.clear(w.COLOR|w.DEPTH),r.setDepthWriteEnabled(!1)}afterRenderPhases(e){const{context:t}=e;t.bindFramebuffer(this._prevFBO),t.setStencilFunction(M.EQUAL,n,255),t.setStencilTestEnabled(!0),t.setDepthTestEnabled(!1),this.blitTexture(t,this.getFbos().output.colorTexture,S.NEAREST)}beforeRenderLayer(e,t,s){const{context:r,blendMode:i,effects:n,drawPhase:a,requireFBO:o}=e;if(o||x(a,i,n,s)){const e=r.getBoundFramebufferObject();this._prevBeforeLayerFBOStack.push(e);const{width:t,height:s}=r.getViewport(),i=this.acquireFbo(t,s);r.bindFramebuffer(i),r.setColorMask(!0,!0,!0,!0),r.setClearColor(0,0,0,0),r.setDepthWriteEnabled(!0),r.setClearDepth(1),r.clear(w.COLOR|w.DEPTH),r.setDepthWriteEnabled(!1)}r.setDepthWriteEnabled(!1),r.setDepthTestEnabled(!1),r.setStencilTestEnabled(!0),r.setClearStencil(t),r.setStencilWriteMask(255),r.clear(w.STENCIL)}afterRenderLayer(e,t){const{context:s,blendMode:r,effects:i,requireFBO:n,drawPhase:o}=e;if(n||x(o,r,i,t)){const n=s.getBoundFramebufferObject();null!=i&&i.length>0&&o===a.MAP&&(s.setColorMask(!0,!0,!0,!0),this._applyEffects(e,i,n)),s.bindFramebuffer(this._prevBeforeLayerFBOStack.pop()),s.setStencilTestEnabled(!1),s.setStencilWriteMask(0),s.setBlendingEnabled(!0),s.setBlendFunctionSeparate(P.ONE,P.ONE_MINUS_SRC_ALPHA,P.ONE,P.ONE_MINUS_SRC_ALPHA),s.setColorMask(!0,!0,!0,!0);const h=null==r||o===a.HIGHLIGHT||o===a.LABEL?"normal":r;this._blendEffect.draw(e,n.colorTexture,S.NEAREST,h,t),this.releaseFbo(n)}}renderObject(e,t,r,i){const n=s[r];if(!n)return;let a=this._brushCache.get(n);void 0===a&&(a=new n,this._brushCache.set(n,a)),a.prepareState(e),a.draw(e,t,i)}renderObjects(e,t,r,i){const n=s[r];if(!n)return;let a=this._brushCache.get(n);void 0===a&&(a=new n,this._brushCache.set(n,a)),a.drawMany(e,t,i)}registerRenderPass(e){const t=e.brushes.map((e=>(this._brushCache.has(e)||this._brushCache.set(e,new e),this._brushCache.get(e))));return new m(t,e)}blitTexture(e,t,s,r=1){e.setBlendingEnabled(!0),e.setBlendFunctionSeparate(P.ONE,P.ONE_MINUS_SRC_ALPHA,P.ONE,P.ONE_MINUS_SRC_ALPHA),e.setColorMask(!0,!0,!0,!0),this._blitRenderer.render(e,t,s,r),this._currentPipelineStateNeedsUpdate=!0}getPostProcessingEffects(e){return this._effectsManager.getPostProcessingEffects(e)}updateFBOs(e,t){if(e!==this._lastWidth||t!==this._lastHeight){if(this._lastWidth=e,this._lastHeight=t,this._fbos){let s;for(s in this._fbos)this._fbos[s].resize(e,t);return}const s=new T(e,t);s.samplingMode=S.NEAREST,s.wrapMode=g.CLAMP_TO_EDGE;const r=new A(C.DEPTH24_STENCIL8,e,t);this._stencilBuf=new R(this.context,r),this._fbos={output:new O(this.context,s,this._stencilBuf),effect0:new O(this.context,s,this._stencilBuf)}}}_applyEffects(e,t,s){const{context:r}=e,i=this._effectsManager.getPostProcessingEffects(t);for(const{postProcessingEffect:n,effect:a}of i)r.bindFramebuffer(s),n.draw(e,s,a);this._currentPipelineStateNeedsUpdate=!0}setShader(e){this._shaderState.shader=e.shader,this._shaderState.uniforms=e.uniforms,this._shaderState.defines=e.defines,this._shaderState.optionalAttributes=e.optionalAttributes,this._shaderState.useComputeBuffer=e.useComputeBuffer??!1}setPipelineState(e){e!==this._currentPipelineState&&(this._currentPipelineState=e,this._currentPipelineStateNeedsUpdate=!0)}submitDraw(e,t){const{shader:s,uniforms:r,defines:i,optionalAttributes:n}=this._shaderState,a=e.context,o=t.getAttributePrecisionPackFactors(),h=this._programCache.getProgram(s,o,r,i??{},n??{});return h.setUniforms(r),h.bind(a),this.updatePipelineState(a),this.setStencilRef(a,t),t.draw(e,s.locationInfo),h.cleanupTemporaryTextures(),{vertexShader:h.vertexShader,fragmentShader:h.fragmentShader}}submitDrawMesh(e,t,s,r){this.submitDrawMeshUntyped(e,t,s,r)}submitDrawMeshUntyped(e,t,s,r){this.setShader(t);const{shader:i,uniforms:n,defines:a,optionalAttributes:o}=this._shaderState,h=this._programCache.getProgram(i,{},n,a??{},o??{});if(h.setUniforms(n),h.bind(e),this.updatePipelineState(e),r)for(const l of r)s.bind(e,t.shader.locationInfo,l),s.draw(e);else for(let l=0;l<s.parts.length;l++)s.bind(e,t.shader.locationInfo,l),s.draw(e);s.unbind(e),h.cleanupTemporaryTextures()}updatePipelineState(e){this._currentPipelineStateNeedsUpdate&&(this._currentPipelineStateNeedsUpdate=!1,this._updatePipelineState(e))}_updatePipelineState(e){if(null==this._currentPipelineState)throw new Error("Pipeline state not defined. Call setPipelineState before calling submitDraw ");const{color:t,depth:s,stencil:r}=this._currentPipelineState;if(t){const{blendMode:s,write:r}=t;switch(e.setColorMask(...r),e.setBlendingEnabled(!0),e.setBlendEquation(B.ADD),s){case"composite":e.setBlendFunctionSeparate(P.ONE,P.ONE_MINUS_SRC_ALPHA,P.ONE,P.ONE_MINUS_SRC_ALPHA);break;case"additive":e.setBlendFunctionSeparate(P.ONE,P.ONE,P.ONE,P.ONE);break;case"custom":{const{blendParameters:s}=t,{dstAlpha:r,dstRGB:i,srcAlpha:n,srcRGB:a}=s;e.setBlendFunctionSeparate(a,i,n,r);break}case"delete":e.setBlendEquation(B.REVERSE_SUBTRACT),e.setBlendFunctionSeparate(P.ONE,P.ONE_MINUS_SRC_ALPHA,P.ONE,P.ONE_MINUS_SRC_ALPHA)}}else e.setColorMask(!1,!1,!1,!1);if(s){const{test:t,write:r}=s;r?(e.setDepthWriteEnabled(!0),e.setDepthRange(r.zNear,r.zFar)):e.setDepthWriteEnabled(!1),t?(e.setDepthTestEnabled(!0),e.setDepthFunction(t)):e.setDepthTestEnabled(!1)}else e.setDepthTestEnabled(!1),e.setDepthWriteEnabled(!1);if(r){const{test:t,write:s}=r;if(t){const{compare:s,mask:r,op:i,ref:n}=t;e.setStencilTestEnabled(!0),"function"!=typeof n&&e.setStencilFunctionSeparate(N.FRONT_AND_BACK,s,n,r),e.setStencilOpSeparate(N.FRONT_AND_BACK,i.fail,i.zFail,i.zPass)}else e.setStencilTestEnabled(!1);if(s){const{mask:t}=s;e.setStencilWriteMask(t)}else e.setStencilWriteMask(0)}else e.setStencilTestEnabled(!1),e.setStencilWriteMask(0)}setStencilRef(e,t){if(null==this._currentPipelineState)throw new Error("Pipeline state not defined. Call setPipelineState before calling submitDraw ");const{stencil:s}=this._currentPipelineState;if(s){const{test:r}=s;if(r){const{compare:s,mask:i,ref:n}=r;if("function"==typeof n){const r=t.getStencilReference();if(null===r)throw new Error("InternalError: Stencil reference expected for target but not defined");e.setStencilFunctionSeparate(N.FRONT_AND_BACK,s,r,i)}}}}}function x(e,t,s,r){return e!==a.LABEL_ALPHA&&e!==a.LABEL&&e!==a.HIGHLIGHT&&(1!==r||null!=t&&"normal"!==t||null!=s&&s.length>0)}export{F as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{TextureWrapMode as r,RenderbufferFormat as e}from"../../../../../webgl/enums.js";import{FramebufferObject as s}from"../../../../../webgl/FramebufferObject.js";import{RenderbufferDescriptor as t}from"../../../../../webgl/RenderbufferDescriptor.js";import{TextureDescriptor as o}from"../../../../../webgl/TextureDescriptor.js";function i(i,h,u){const l=new o(h,u);return l.wrapMode=r.CLAMP_TO_EDGE,new s(i,l,new t(e.STENCIL_INDEX8,h,u))}class h{constructor(){this._width=void 0,this._height=void 0,this._resources=null}dispose(){this._resources&&(this._resources.sharedBlur1Fbo.dispose(),this._resources.sharedBlur2Fbo.dispose(),this._resources=null)}_initialize(r,e,s){this._width=e,this._height=s;const t=i(r,e,s),o=i(r,e,s);this._resources={sharedBlur1Fbo:t,sharedBlur2Fbo:o}}setup(r,e,s){!this._resources||this._width===e&&this._height===s||this.dispose(),this._resources||this._initialize(r,e,s)}get sharedBlur1Tex(){return this._resources.sharedBlur1Fbo.colorTexture}get sharedBlur1Fbo(){return this._resources.sharedBlur1Fbo}get sharedBlur2Tex(){return this._resources.sharedBlur2Fbo.colorTexture}get sharedBlur2Fbo(){return this._resources.sharedBlur2Fbo}}export{h as default};
5
+ import{TextureWrapMode as r,SizedStencilFormat as e}from"../../../../../webgl/enums.js";import{FramebufferObject as s}from"../../../../../webgl/FramebufferObject.js";import{RenderbufferDescriptor as t}from"../../../../../webgl/RenderbufferDescriptor.js";import{TextureDescriptor as o}from"../../../../../webgl/TextureDescriptor.js";function i(i,h,u){const l=new o(h,u);return l.wrapMode=r.CLAMP_TO_EDGE,new s(i,l,new t(e.STENCIL_INDEX8,h,u))}class h{constructor(){this._width=void 0,this._height=void 0,this._resources=null}dispose(){this._resources&&(this._resources.sharedBlur1Fbo.dispose(),this._resources.sharedBlur2Fbo.dispose(),this._resources=null)}_initialize(r,e,s){this._width=e,this._height=s;const t=i(r,e,s),o=i(r,e,s);this._resources={sharedBlur1Fbo:t,sharedBlur2Fbo:o}}setup(r,e,s){!this._resources||this._width===e&&this._height===s||this.dispose(),this._resources||this._initialize(r,e,s)}get sharedBlur1Tex(){return this._resources.sharedBlur1Fbo.colorTexture}get sharedBlur1Fbo(){return this._resources.sharedBlur1Fbo}get sharedBlur2Tex(){return this._resources.sharedBlur2Fbo.colorTexture}get sharedBlur2Fbo(){return this._resources.sharedBlur2Fbo}}export{h as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../../../../../core/RandomLCG.js";import{tileSize as e}from"../../../definitions.js";import{SimpleMesh as s}from"../../../meshing/SimpleMesh.js";import{DataType as o,TextureSamplingMode as r,TextureWrapMode as i,RenderbufferFormat as n,PrimitiveType as h,PixelType as d}from"../../../../../../webgl/enums.js";import{FramebufferObject as u}from"../../../../../../webgl/FramebufferObject.js";import{Renderbuffer as l}from"../../../../../../webgl/Renderbuffer.js";import{RenderbufferDescriptor as _}from"../../../../../../webgl/RenderbufferDescriptor.js";import{Texture as T}from"../../../../../../webgl/Texture.js";import{TextureDescriptor as m}from"../../../../../../webgl/TextureDescriptor.js";const p={pos:{count:2,type:o.UNSIGNED_SHORT}};class f{constructor(){this._dotTextureSize=0,this._dotTextures=null,this._dotMesh=null}destroy(){this._disposeTextures(),this._dotFBO&&this._dotFBO.dispose(),this._dotMesh&&this._dotMesh.destroy()}getFBO(t){if(null==this._dotFBO){const s=e,o=e,h=new m(s,o);h.samplingMode=r.NEAREST,h.wrapMode=i.CLAMP_TO_EDGE;const d=new l(t,new _(n.DEPTH_STENCIL,s,o));this._dotFBO=new u(t,h,d)}return this._dotFBO}getDotDensityMesh(t){if(null==this._dotMesh){const o=e,r=o*o,i=2,n=new Int16Array(r*i);for(let t=0;t<o;t++)for(let e=0;e<o;e++)n[i*(e+t*o)]=e,n[i*(e+t*o)+1]=t;this._dotMesh=s.create(t,{primitive:h.POINTS,vertex:n,count:r,layout:p})}return this._dotMesh}getDotDensityTextures(e,s,o){if(this._dotTextureSize===s&&this._seed===o||(this._disposeTextures(),this._dotTextureSize=s,this._seed=o),null===this._dotTextures){const r=new t(o);this._dotTextures=[this._allocDotDensityTexture(e,s,r),this._allocDotDensityTexture(e,s,r)]}return this._dotTextures}_disposeTextures(){if(this._dotTextures){for(let t=0;t<this._dotTextures.length;t++)this._dotTextures[t].dispose();this._dotTextures=null}}_allocDotDensityTexture(t,e,s){const o=new Float32Array(e*e*4);for(let r=0;r<o.length;r++)o[r]=s.getFloat();const i=new m;return i.dataType=d.FLOAT,i.samplingMode=r.NEAREST,i.width=e,i.height=e,new T(t,i,o)}}export{f as DotDensityResources};
5
+ import t from"../../../../../../../core/RandomLCG.js";import{tileSize as e}from"../../../definitions.js";import{SimpleMesh as s}from"../../../meshing/SimpleMesh.js";import{DataType as o,TextureSamplingMode as r,TextureWrapMode as i,SizedDepthStencilFormat as n,PrimitiveType as h,PixelType as d}from"../../../../../../webgl/enums.js";import{FramebufferObject as u}from"../../../../../../webgl/FramebufferObject.js";import{Renderbuffer as l}from"../../../../../../webgl/Renderbuffer.js";import{RenderbufferDescriptor as _}from"../../../../../../webgl/RenderbufferDescriptor.js";import{Texture as T}from"../../../../../../webgl/Texture.js";import{TextureDescriptor as m}from"../../../../../../webgl/TextureDescriptor.js";const p={pos:{count:2,type:o.UNSIGNED_SHORT}};class f{constructor(){this._dotTextureSize=0,this._dotTextures=null,this._dotMesh=null}destroy(){this._disposeTextures(),this._dotFBO&&this._dotFBO.dispose(),this._dotMesh&&this._dotMesh.destroy()}getFBO(t){if(null==this._dotFBO){const s=e,o=e,h=new m(s,o);h.samplingMode=r.NEAREST,h.wrapMode=i.CLAMP_TO_EDGE;const d=new l(t,new _(n.DEPTH24_STENCIL8,s,o));this._dotFBO=new u(t,h,d)}return this._dotFBO}getDotDensityMesh(t){if(null==this._dotMesh){const o=e,r=o*o,i=2,n=new Int16Array(r*i);for(let t=0;t<o;t++)for(let e=0;e<o;e++)n[i*(e+t*o)]=e,n[i*(e+t*o)+1]=t;this._dotMesh=s.create(t,{primitive:h.POINTS,vertex:n,count:r,layout:p})}return this._dotMesh}getDotDensityTextures(e,s,o){if(this._dotTextureSize===s&&this._seed===o||(this._disposeTextures(),this._dotTextureSize=s,this._seed=o),null===this._dotTextures){const r=new t(o);this._dotTextures=[this._allocDotDensityTexture(e,s,r),this._allocDotDensityTexture(e,s,r)]}return this._dotTextures}_disposeTextures(){if(this._dotTextures){for(let t=0;t<this._dotTextures.length;t++)this._dotTextures[t].dispose();this._dotTextures=null}}_allocDotDensityTexture(t,e,s){const o=new Float32Array(e*e*4);for(let r=0;r<o.length;r++)o[r]=s.getFloat();const i=new m;return i.dataType=d.FLOAT,i.samplingMode=r.NEAREST,i.width=e,i.height=e,new T(t,i,o)}}export{f as DotDensityResources};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../../../../core/Logger.js";import{disposeMaybe as r}from"../../../../../../../core/maybe.js";import{PixelType as t,TextureWrapMode as a,RenderbufferFormat as i}from"../../../../../../webgl/enums.js";import{FramebufferObject as s}from"../../../../../../webgl/FramebufferObject.js";import{loadHeatmapTextureConfiguration as u}from"../../../../../../webgl/heatmapTextureUtils.js";import{RenderbufferDescriptor as l}from"../../../../../../webgl/RenderbufferDescriptor.js";import{Texture as o}from"../../../../../../webgl/Texture.js";import{TextureDescriptor as n}from"../../../../../../webgl/TextureDescriptor.js";const m=()=>e.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.heatmap.HeatmapResources");class f{destroy(){this._accumulateFramebuffer=r(this._accumulateFramebuffer),this._resolveGradientTexture=r(this._resolveGradientTexture),this._prevGradientHash=null,this._qualityProfile=null}get initialized(){return null!=this._accumulateFramebuffer&&null!=this._resolveGradientTexture}get accumulateFramebuffer(){return this._accumulateFramebuffer}get resolveGradientTexture(){return this._resolveGradientTexture}loadQualityProfile(e){if(null==this._qualityProfile){const r=u(e,m());this._qualityProfile={...r,defines:{usesHalfFloatPrecision:r.dataType!==t.FLOAT}}}return this._qualityProfile}ensureAccumulateFBO(e,r,t){if(null==this._accumulateFramebuffer){const{dataType:u,samplingMode:o,pixelFormat:m,internalFormat:f}=this.loadQualityProfile(e),h=new n(r,t);h.pixelFormat=m,h.internalFormat=f,h.dataType=u,h.samplingMode=o,h.wrapMode=a.CLAMP_TO_EDGE;const c=new l(i.DEPTH_STENCIL,r,t);this._accumulateFramebuffer=new s(e,h,c)}else{const{width:e,height:a}=this._accumulateFramebuffer;e===r&&a===t||this._accumulateFramebuffer.resize(r,t)}return this._accumulateFramebuffer}ensureResolveGradientTexture(e,r,t){if(null==this._resolveGradientTexture){const r=new n;r.wrapMode=a.CLAMP_TO_EDGE,this._resolveGradientTexture=new o(e,r),this._prevGradientHash=null}return this._prevGradientHash!==r&&(this._resolveGradientTexture.resize(t.length/4,1),this._resolveGradientTexture.setData(t),this._prevGradientHash=r),this._resolveGradientTexture}}export{f as HeatmapResources};
5
+ import e from"../../../../../../../core/Logger.js";import{disposeMaybe as r}from"../../../../../../../core/maybe.js";import{PixelType as t,TextureWrapMode as a,SizedDepthStencilFormat as i}from"../../../../../../webgl/enums.js";import{FramebufferObject as s}from"../../../../../../webgl/FramebufferObject.js";import{loadHeatmapTextureConfiguration as u}from"../../../../../../webgl/heatmapTextureUtils.js";import{RenderbufferDescriptor as l}from"../../../../../../webgl/RenderbufferDescriptor.js";import{Texture as o}from"../../../../../../webgl/Texture.js";import{TextureDescriptor as n}from"../../../../../../webgl/TextureDescriptor.js";const m=()=>e.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.heatmap.HeatmapResources");class f{destroy(){this._accumulateFramebuffer=r(this._accumulateFramebuffer),this._resolveGradientTexture=r(this._resolveGradientTexture),this._prevGradientHash=null,this._qualityProfile=null}get initialized(){return null!=this._accumulateFramebuffer&&null!=this._resolveGradientTexture}get accumulateFramebuffer(){return this._accumulateFramebuffer}get resolveGradientTexture(){return this._resolveGradientTexture}loadQualityProfile(e){if(null==this._qualityProfile){const r=u(e,m());this._qualityProfile={...r,defines:{usesHalfFloatPrecision:r.dataType!==t.FLOAT}}}return this._qualityProfile}ensureAccumulateFBO(e,r,t){if(null==this._accumulateFramebuffer){const{dataType:u,samplingMode:o,pixelFormat:m,internalFormat:f}=this.loadQualityProfile(e),h=new n(r,t);h.pixelFormat=m,h.internalFormat=f,h.dataType=u,h.samplingMode=o,h.wrapMode=a.CLAMP_TO_EDGE;const c=new l(i.DEPTH24_STENCIL8,r,t);this._accumulateFramebuffer=new s(e,h,c)}else{const{width:e,height:a}=this._accumulateFramebuffer;e===r&&a===t||this._accumulateFramebuffer.resize(r,t)}return this._accumulateFramebuffer}ensureResolveGradientTexture(e,r,t){if(null==this._resolveGradientTexture){const r=new n;r.wrapMode=a.CLAMP_TO_EDGE,this._resolveGradientTexture=new o(e,r),this._prevGradientHash=null}return this._prevGradientHash!==r&&(this._resolveGradientTexture.resize(t.length/4,1),this._resolveGradientTexture.setData(t),this._prevGradientHash=r),this._resolveGradientTexture}}export{f as HeatmapResources};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../../core/Error.js";import{getEffectiveFeatureReduction as t}from"./featureReductionUtils.js";import{getServiceGeometryType as r}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as o,getLayerDeconflictionEnabled as i,createLabelVVEvaluator as n}from"./labelingUtils.js";import{createFeatureSourceSchema as l}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as s}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as a}from"../support/rendererUtils.js";function u(t){if(!("openPorts"in t))throw new e("featurelayer","source-not-supported")}class p{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const r=this.layer,l=o(r,e)??i(r),s=t(r,e),a=[...r.labelingInfo||[],...s?.labelingInfo||[]];return[{vvEvaluators:{0:n(r.renderer)},deconflictionEnabled:l,labelingInfo:a}]}async createServiceOptions(e){const t=this.layer,{capabilities:o,objectIdField:i}=t,n=t.fieldsIndex.toJSON(),l=r(t),s=t.timeInfo?.toJSON(),a=t.spatialReference.toJSON();u(t.source);const p=await t.source.openPorts(),c=i,d=e.spatialReference.toJSON();return{type:"memory",source:p,orderByFields:c,outSpatialReference:d,metadata:{fieldsIndex:n,geometryType:l,objectIdField:i,timeInfo:s,spatialReference:a,outSpatialReference:d,subtypes:null,subtypeField:null,globalIdField:null,typeIdField:null,types:null,timeReferenceUnknownClient:"datesInUnknownTimezone"in t?t.datesInUnknownTimezone:null,dateFieldsTimeZone:"dateFieldsTimeZone"in t?t.dateFieldsTimeZone:null},queryMetadata:{maxRecordCount:o.query.maxRecordCount,supportsCompactGeometry:o.query.supportsCompactGeometry,supportsDefaultSpatialReference:o.query.supportsDefaultSpatialReference,supportsFormatPBF:o.query.supportsFormatPBF,supportsMaxRecordCountFactor:o.query.supportsMaxRecordCountFactor,supportsQuantization:o.query.supportsQuantization,lastEditDate:null,snapshotInfo:null}}}createSourceSchema(e,t){const{definitionExpression:r,timeExtent:o,displayFilterInfo:i}=this.layer;return l({customParameters:null,definitionExpression:r,displayFilterInfo:i,timeExtent:o},e,t,null)}createProcessorSchema(e,r,o){const{fields:i,renderer:n,geometryType:l,labelingInfo:a,labelsVisible:u,orderBy:p,objectIdField:c}=this.layer,d="trackInfo"in this.layer?this.layer.trackInfo:null,y={fields:i.map((e=>e.toJSON())),renderer:n?.clone(),layerId:this.layer.id,featureReduction:t(this.layer,r),geometryType:l,labelingInfo:a,labelsVisible:u,objectIdField:c,orderBy:p??"default",trackInfo:d};return s(e,r,y,o)}get hasRequiredSupport(){return a(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.definitionExpression,()=>this.layer.displayFilterInfo,()=>this.layer.orderBy,()=>"outFields"in this.layer?this.layer.outFields:null,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>t(this.layer,e),()=>"trackInfo"in this.layer?this.layer.trackInfo:null]}}export{p as InMemoryLayerAdapter};
5
+ import e from"../../../../../core/Error.js";import{getEffectiveFeatureReduction as t}from"./featureReductionUtils.js";import{getServiceGeometryType as r}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as o,getLayerDeconflictionEnabled as i,createLabelVVEvaluator as n}from"./labelingUtils.js";import{createFeatureSourceSchema as l}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as s}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as a}from"../support/rendererUtils.js";function u(t){if(!("openPorts"in t))throw new e("featurelayer:source-not-supported","source is not supported")}class p{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const r=this.layer,l=o(r,e)??i(r),s=t(r,e),a=[...r.labelingInfo||[],...s?.labelingInfo||[]];return[{vvEvaluators:{0:n(r.renderer)},deconflictionEnabled:l,labelingInfo:a}]}async createServiceOptions(e){const t=this.layer,{capabilities:o,objectIdField:i}=t,n=t.fieldsIndex.toJSON(),l=r(t),s=t.timeInfo?.toJSON(),a=t.spatialReference.toJSON();u(t.source);const p=await t.source.openPorts(),c=i,d=e.spatialReference.toJSON();return{type:"memory",source:p,orderByFields:c,outSpatialReference:d,metadata:{fieldsIndex:n,geometryType:l,objectIdField:i,timeInfo:s,spatialReference:a,outSpatialReference:d,subtypes:null,subtypeField:null,globalIdField:null,typeIdField:null,types:null,timeReferenceUnknownClient:"datesInUnknownTimezone"in t?t.datesInUnknownTimezone:null,dateFieldsTimeZone:"dateFieldsTimeZone"in t?t.dateFieldsTimeZone:null},queryMetadata:{maxRecordCount:o.query.maxRecordCount,supportsCompactGeometry:o.query.supportsCompactGeometry,supportsDefaultSpatialReference:o.query.supportsDefaultSpatialReference,supportsFormatPBF:o.query.supportsFormatPBF,supportsMaxRecordCountFactor:o.query.supportsMaxRecordCountFactor,supportsQuantization:o.query.supportsQuantization,lastEditDate:null,snapshotInfo:null}}}createSourceSchema(e,t){const{definitionExpression:r,timeExtent:o,displayFilterInfo:i}=this.layer;return l({customParameters:null,definitionExpression:r,displayFilterInfo:i,timeExtent:o},e,t,null)}createProcessorSchema(e,r,o){const{fields:i,renderer:n,geometryType:l,labelingInfo:a,labelsVisible:u,orderBy:p,objectIdField:c}=this.layer,d="trackInfo"in this.layer?this.layer.trackInfo:null,y={fields:i.map((e=>e.toJSON())),renderer:n?.clone(),layerId:this.layer.id,featureReduction:t(this.layer,r),geometryType:l,labelingInfo:a,labelsVisible:u,objectIdField:c,orderBy:p??"default",trackInfo:d};return s(e,r,y,o)}get hasRequiredSupport(){return a(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.definitionExpression,()=>this.layer.displayFilterInfo,()=>this.layer.orderBy,()=>"outFields"in this.layer?this.layer.outFields:null,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>t(this.layer,e),()=>"trackInfo"in this.layer?this.layer.trackInfo:null]}}export{p as InMemoryLayerAdapter};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../../core/Error.js";import t from"../../../../../layers/support/FieldsIndex.js";import{parseField as s,parseTransform as r}from"../../../../../rest/query/operations/pbfFeatureServiceParser.js";const n=268435455;class o{constructor(){this.hasFeatures=!1,this.exceededTransferLimit=!1,this.fieldCount=0,this.featureCount=0,this.objectIdFieldIndex=0,this.vertexCount=0,this.offsets={attributes:new Array,geometry:new Array},this.centroid=new Array}}function a(a,i,c=!1){const f=1,d=3,u=9,g=12,l=13,p=15,h=a.asUnsafe(),b=h.pos(),w=new o;let y=0,m=0;const k=1,x=2,I=4,L=3;let A=null,F=null,C=null,S=!1;const j=[];for(;h.next();)switch(h.tag()){case f:A=h.getString();break;case d:F=h.getString();break;case g:C=h.processMessage(r);break;case u:if(w.exceededTransferLimit=h.getBool(),w.exceededTransferLimit){w.offsets.geometry=c?new Float64Array(8e3):new Int32Array(8e3),w.centroid=c?new Float64Array(16e3):new Int32Array(16e3);for(let e=0;e<w.centroid.length;e++)w.centroid[e]=n}break;case l:{const e=h.processMessage(s);e.index=y++,j.push(e);break}case p:{const e=h.getLength(),t=h.pos()+e;if(!w.exceededTransferLimit){const e=w.offsets.geometry,t=w.centroid;e.push(0),t.push(n),t.push(n)}!S&&w.exceededTransferLimit&&(S=!0,w.offsets.attributes=c?new Float64Array(8e3*y):new Uint32Array(8e3*y));let s=m*y;for(;h.pos()<t&&h.next();)switch(h.tag()){case k:{if(S)w.offsets.attributes[s++]=h.pos();else{w.offsets.attributes.push(h.pos())}const e=h.getLength();h.skipLen(e);break}case x:if(i){const e=h.getLength(),t=h.pos()+e;for(;h.pos()<t&&h.next();)switch(h.tag()){case L:{h.getUInt32();const e=h.getSInt64(),t=h.getSInt64();w.centroid[2*m]=e,w.centroid[2*m+1]=t;break}default:h.skip()}}else{w.offsets.geometry[m]=h.pos();const e=h.getLength();w.vertexCount+=e,h.skipLen(e)}break;case I:{const e=h.getLength(),t=h.pos()+e;for(;h.pos()<t&&h.next();)switch(h.tag()){case L:{h.getUInt32();const e=h.getSInt64(),t=h.getSInt64();w.centroid[2*m]=e,w.centroid[2*m+1]=t;break}default:h.skip()}break}default:h.skip()}m++,w.hasFeatures=!0;break}default:h.skip()}const U=A||F;if(!U)throw new e("featurelayer","FeatureSet has no objectId or globalId field name");return w.fields=new t(j),w.featureCount=m,w.fieldCount=y,w.objectIdFieldIndex=w.fields.get(U)?.index,w.transform=C,w.displayIds=new Uint32Array(w.featureCount),w.groupIds=new Uint16Array(w.featureCount),h.move(b),w}export{o as FeatureSetHeader,a as parseHeader};
5
+ import e from"../../../../../core/Error.js";import t from"../../../../../layers/support/FieldsIndex.js";import{parseField as s,parseTransform as r}from"../../../../../rest/query/operations/pbfFeatureServiceParser.js";const n=268435455;class o{constructor(){this.hasFeatures=!1,this.exceededTransferLimit=!1,this.fieldCount=0,this.featureCount=0,this.objectIdFieldIndex=0,this.vertexCount=0,this.offsets={attributes:new Array,geometry:new Array},this.centroid=new Array}}function a(a,i,c=!1){const f=1,d=3,u=9,g=12,l=13,p=15,h=a.asUnsafe(),b=h.pos(),m=new o;let w=0,y=0;const I=1,k=2,x=4,L=3;let A=null,F=null,C=null,S=!1;const j=[];for(;h.next();)switch(h.tag()){case f:A=h.getString();break;case d:F=h.getString();break;case g:C=h.processMessage(r);break;case u:if(m.exceededTransferLimit=h.getBool(),m.exceededTransferLimit){m.offsets.geometry=c?new Float64Array(8e3):new Int32Array(8e3),m.centroid=c?new Float64Array(16e3):new Int32Array(16e3);for(let e=0;e<m.centroid.length;e++)m.centroid[e]=n}break;case l:{const e=h.processMessage(s);e.index=w++,j.push(e);break}case p:{const e=h.getLength(),t=h.pos()+e;if(!m.exceededTransferLimit){const e=m.offsets.geometry,t=m.centroid;e.push(0),t.push(n),t.push(n)}!S&&m.exceededTransferLimit&&(S=!0,m.offsets.attributes=c?new Float64Array(8e3*w):new Uint32Array(8e3*w));let s=y*w;for(;h.pos()<t&&h.next();)switch(h.tag()){case I:{if(S)m.offsets.attributes[s++]=h.pos();else{m.offsets.attributes.push(h.pos())}const e=h.getLength();h.skipLen(e);break}case k:if(i){const e=h.getLength(),t=h.pos()+e;for(;h.pos()<t&&h.next();)switch(h.tag()){case L:{h.getUInt32();const e=h.getSInt64(),t=h.getSInt64();m.centroid[2*y]=e,m.centroid[2*y+1]=t;break}default:h.skip()}}else{m.offsets.geometry[y]=h.pos();const e=h.getLength();m.vertexCount+=e,h.skipLen(e)}break;case x:{const e=h.getLength(),t=h.pos()+e;for(;h.pos()<t&&h.next();)switch(h.tag()){case L:{h.getUInt32();const e=h.getSInt64(),t=h.getSInt64();m.centroid[2*y]=e,m.centroid[2*y+1]=t;break}default:h.skip()}break}default:h.skip()}y++,m.hasFeatures=!0;break}default:h.skip()}const U=A||F;if(!U)throw new e("featurelayer:missing-objectId","FeatureSet has no objectId or globalId field name");return m.fields=new t(j),m.featureCount=y,m.fieldCount=w,m.objectIdFieldIndex=m.fields.get(U)?.index,m.transform=C,m.displayIds=new Uint32Array(m.featureCount),m.groupIds=new Uint16Array(m.featureCount),h.move(b),m}export{o as FeatureSetHeader,a as parseHeader};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../Color.js";import{result as t,createTask as r}from"../../../../core/asyncUtils.js";import i from"../../../../core/Error.js";import has from"../../../../core/has.js";import{clone as s}from"../../../../core/lang.js";import{abortMaybe as o,releaseMaybe as a}from"../../../../core/maybe.js";import{throwIfAbortError as n,throwIfAborted as l}from"../../../../core/promiseUtils.js";import{pt2px as c,px2pt as h}from"../../../../core/screenUtils.js";import{numericHash as u}from"../../../../core/string.js";import{dataComponents as m}from"../../../../core/urlUtils.js";import{fromValues as d,create as p}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{fromValues as _,create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as g,ZEROS as y,fromValues as x}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{projectPointToVector as b}from"../../../../geometry/projection/projectPointToVector.js";import{containsPoint as v}from"../../../../geometry/support/aaBoundingBox.js";import S from"../../../../layers/support/FieldsIndex.js";import{createRendererExpression as P}from"../../../../support/ArcadeExpression.js";import{CIMSymbolHelper as w}from"../../../../symbols/cim/CIMSymbolHelper.js";import{evaluateValueOrFunction as R}from"../../../../symbols/cim/utils.js";import{scaleCIMSymbol as z}from"../../../../symbols/support/cimSymbolUtils.js";import{defaultPrimitive as C}from"../../../../symbols/support/IconSymbol3DLayerResource.js";import{Symbol3DAnchorPosition2D as O}from"../../../../symbols/support/Symbol3DAnchorPosition2D.js";import{getIconHref as M}from"../../../../symbols/support/utils.js";import{focusAreaHUDColor as j}from"../../../FocusAreas.js";import{transparentUnit as I}from"./constants.js";import{perObjectElevationAligner as E}from"./ElevationAligners.js";import{SymbolUpdateType as T,elevationModeChangeUpdateType as F,needsElevationUpdates2D as A}from"./elevationAlignmentUtils.js";import{Graphics3DDrapedGraphicLayer as U}from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as D}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as L}from"./Graphics3DSymbolLayer.js";import{validateSymbolLayerSize as G}from"./graphicUtils.js";import{ApplyRendererDiffResult as V}from"./interfaces.js";import{namedAnchorToHUDMaterialAnchorPos as H}from"./placementUtils.js";import{placePointOnGeometry as k,updateStageObjectGeometry as B,getLocalOriginForPoint as N,extendPointGraphicElevationContext as $,createStageObject as W}from"./pointUtils.js";import{initFastSymbolUpdatesState as q,updateFastSymbolUpdatesState as J,evaluateModelTransformScale as Z,ConvertOptions as K}from"../support/FastSymbolUpdates.js";import{createTexture as Q,requiresHalfTexelOffset as X,defaultBoundingBox as Y,defaultSymbolSizeRatio as ee,defaultTexSize as te}from"../../support/engineContent/sdfPrimitives.js";import{drapedZ as re}from"../../terrain/OverlayRenderer.js";import{createPointGeometry as ie}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderGeometry as se}from"../../webgl-engine/lib/RenderGeometry.js";import{Texture as oe}from"../../webgl-engine/lib/Texture.js";import{HUDMaterial as ae}from"../../webgl-engine/materials/HUDMaterial.js";const ne=_(0,0,1),le=16,ce=1.5,he=[te*ee,te*ee];class ue extends L{static{this.PRIMITIVE_SIZE=he}getCachedSize(){return{size:this._getIconSize()}}static{this.elevationModeChangeTypes={definedChanged:T.UPDATE,staysOnTheGround:T.NONE,onTheGroundChanged:T.RECREATE}}constructor(e,t,r,i){super(e,t,r,i,ye(t)),this._cimData=null,this._overrideHelperClass=null,this._arcadeInfo=null,this._cimSymbolMaterials=new Map,this._cimSymbolTextures=new Map,this._cimMaterialParametersInfo=null,this._cimScaleFactorOrFunction=null,this._size=null,this._symbolTextureRatio=1,this._outlineSize=0,this._textureHandle=null,this._patchTask=null,this._elevationOptions={supportsOffsetAdjustment:!0,supportsOnTheGround:!0}}async doLoad(e){this._validateOrThrow();const t=this._prepareMaterialParameters(),r=this._getPrimitive();if(null!=r)this._prepareResourcesPrimitive(t,r);else{const r=M(this.symbolLayer),i=pe(r);null!=i?await this._prepareResourcesCIM(t,JSON.parse(i),e):await this._prepareResourcesHref(t,r,e)}}_validateOrThrow(){if(this._drivenProperties.size)return;const e=G(this._getIconSize());if(e)throw new i("graphics3diconsymbollayer:invalid-size",e)}_getIconSize(){const e=this.symbolLayer,t=Math.round(null!=e.size?c(e.size):le);return this._drivenProperties.size?Math.max(t,64):t}_generateTextureCIM(e,t){const r=this._overrideHelperClass;let i=this._cimData;if(r&&i&&i.symbol||this.logger.error("Can't create texture, CIM data is undefined"),i.primitiveOverrides){i=s(i);const o=i.primitiveOverrides;r.evaluateOverrides(o,e,this._arcadeInfo.geometryType,null,null,t.layer.fieldsIndex),r.applyOverrides(i.symbol,o)}const o=u(JSON.stringify(i));let a=this._cimSymbolTextures.get(o);if(a)return a;const n=this._context.sharedResources.cimSymbolRasterizer,l=this._context.renderer&&"dictionary"===this._context.renderer.type?this._context.renderer.fieldMap:null;l&&r.applyDictionaryTextOverrides(i.symbol,e,l,null);const c=null!=this._cimScaleFactorOrFunction?R(this._cimScaleFactorOrFunction,e):1;1!==c&&i.symbol&&z(i.symbol,c,!0);const h=w.getEnvelope(i,null,n.resourceManager);if(h?.width&&h.height){const e=h.x+h.width/2,t=h.y+h.height/2,r=n.rasterize({type:"cim",data:i},h.width,h.height,e,t,1,"esriGeometryPoint",0,null,this._context.graphicsCoreOwner.view.state.rasterPixelRatio),s=new O({x:-h.x/h.width-.5,y:(h.height+h.y)/h.height-.5});this._cimMaterialParametersInfo.anchorPosition=_e("relative",s),a=new oe(r,{width:r?.width??1,height:r?.height??1,reloadable:!0})}else a=new oe(new ImageData(1,1),{width:1,height:1,reloadable:!0});return this._cimSymbolTextures.set(o,a),this._context.stage.add(a),a}_prepareMaterialParameters(){const e={anchorPosition:_e(this.symbolLayer.anchor,this.symbolLayer.anchorPosition),rotation:this.symbolLayer.angle},t=this.symbol;if(me(t)){const{screenLength:r,minWorldLength:i,maxWorldLength:s}=t.verticalOffset;e.verticalOffset={screenLength:c(r),minWorldLength:i||0,maxWorldLength:null!=s?s:1/0}}this._context.screenSizePerspectiveEnabled&&(e.screenSizePerspective=this._context.sharedResources.screenSizePerspectiveSettings),(0!==e.rotation||this._drivenProperties.rotation)&&(e.hasRotation=!0);const r=!has("disable-feature:non-occluded-hud");return e.occlusionTest=!r,e.occludedFragmentFade=r,e.horizonCullingEnabled=r&&this._context.spherical,e.hasSlicePlane=this._context.slicePlaneEnabled,e}_prepareResourcesPrimitive(e,t){const r=this._getOutlineSize();if(de(t)&&0===r)throw new Error("Nothing to render");if(this._outlineSize=r,e.color=this._getFillColor(),e.outlineColor=this._getOutlineColor(),e.outlineSize=this._outlineSize,null!=this._context.sharedResources.textures){const r=this._context.sharedResources.textures.fromData(`${t}-icon`,(()=>Q(t)));this._textureHandle=r,e.textureId=r.texture.id}e.textureIsSignedDistanceField=!0,e.sampleSignedDistanceFieldTexelCenter=X(t),e.distanceFieldBoundingBox=Y;const i=this._getIconSize();this._size=[i,i],this._symbolTextureRatio=1/ee,this._createMaterialAndAddToStage(e,this._context.stage)}async _prepareResourcesHref(e,r,s){this._outlineSize=this._getOutlineSize(),e.color=this._getFillColor(),e.outlineColor=this._getOutlineColor(),e.outlineSize=this._outlineSize,e.textureIsSignedDistanceField=!1;const o=this._getIconSize(),a=o*this._context.graphicsCoreOwner.view.state.rasterPixelRatio;if(null!=this._context.sharedResources.textures){const l=await t(this._context.sharedResources.textures.fromUrl(r,a,{signal:s}));if(!1===l.ok){n(l.error);throw new i("graphics3diconsymbollayer:request-failed",`Failed to load (Request for icon resource failed: ${r})`)}this._textureHandle=l.value;const c=l.value.texture;this._size=fe(c,o),e.textureId=c.id}this._createMaterialAndAddToStage(e,this._context.stage)}async _prepareResourcesCIM(e,t,r){const{OverrideHelper:i}=await import("../../../../symbols/cim/OverrideHelper.js");if(this._overrideHelperClass=i,this._cimData=t,!this._context.sharedResources.cimSymbolRasterizer){const e=(await import("../../../../symbols/cim/CIMSymbolRasterizer.js")).CIMSymbolRasterizer;l(r),this._context.sharedResources.cimSymbolRasterizer||(this._context.sharedResources.cimSymbolRasterizer=new e(this._context.renderCoordsHelper.spatialReference))}const s=this._context.sharedResources.cimSymbolRasterizer,o=[],a=t,n=a?.symbol;w.fetchResources(n,s.resourceManager,o,r),w.fetchFonts(n,s.resourceManager,o);const c=this._context.layer.fields?this._context.layer.fields.map((e=>e.toJSON())):[],h=this._context.renderCoordsHelper.spatialReference;if(this._arcadeInfo={spatialReference:h,fields:c,geometryType:"esriGeometryPoint"},a?.primitiveOverrides&&o.push(i.createRenderExpressions(a.primitiveOverrides,this._arcadeInfo)),o.length>0&&(await Promise.all(o),l(r)),this._context.renderer&&"dictionary"===this._context.renderer.type&&this._context.renderer.scaleExpression){const e=this._context.renderer;if(e.scaleExpression){const t=e.scaleExpression,r=await P(t,this._context.layer.spatialReference),{default:i}=await import("../../../2d/arcade/callExpressionWithFeature.js"),s=new S(c);this._cimScaleFactorOrFunction=(e,t,o)=>{const a=i(r,e,{$view:o},"esriGeometryPoint",s,t);return null!==a?a:1}}}l(r),this._cimMaterialParametersInfo=e,this._cimMaterialParametersInfo.color=this._getFillColor(),this._cimMaterialParametersInfo.outlineColor=[0,0,0,0],this._cimMaterialParametersInfo.outlineSize=0,this._cimMaterialParametersInfo.textureIsSignedDistanceField=!1}_getPrimitive(){return ge(this.symbolLayer)}_getOutlineSize(){let e=0;const t=this.symbolLayer;if(null!=t.outline?.size)return Math.max(c(t.outline.size),0);return e=de(this._getPrimitive())?ce:0,Math.max(e,0)}_getOutlineColor(){const t=this._getLayerOpacity(),r=this.symbolLayer,i=r?.outline?.color;if(null!=i){const r=e.toUnitRGB(i),s=i.a*t;return[r[0],r[1],r[2],s]}return[0,0,0,0]}_getFillColor(){if(de(this._getPrimitive()))return I;const e=null==this._getPrimitive(),t=this.symbolLayer?.material?.color;return this._getCombinedOpacityAndColor(t,{hasIntrinsicColor:e})}_getFallbackOpacityAndColor(){const t=this.symbolLayer?.material?.color;if(null==t){return null==this._getPrimitive()?g:y}return e.toUnitRGBA(t)}_getFallbackSize(){const e=this._getIconSize(),{symbolLayer:{size:t}}=this;return(null!=t?Math.round(c(t)):le)/e}_createMaterialAndAddToStage(e,t){const r=this._context.spherical;if(this._cimData){this._fastUpdates=null;let i=e.textureId?this._cimSymbolMaterials.get(e.textureId):null;return i||(i=new ae(e,r),this._cimSymbolMaterials.set(e.textureId??0,i),t.add(i)),i}if(this._fastUpdates=q(this._context.renderer,this._fastVisualVariableConvertOptions()),this._fastUpdates&&(e={...e,...this._fastUpdates.materialParameters}),this._materials[0]=new ae(e,r),t.add(this._materials[0]),this._context.graphicsCoreOwner.view.focusAreas.activePolygons.length>0){e.isFocused=!1;const i=this._context.stage.view.focusAreas.style;e.color=j(e.color,i),e.outlineColor=j(e.outlineColor,i),this._materials[1]=new ae(e,r),t.add(this._materials[1])}return this._materials[0]}_setDrapingDependentMaterialParameters(){this.draped&&(this._forEachMaterial((e=>{e.setParameters({verticalOffset:null,screenSizePerspective:null,occlusionTest:!1,hasSlicePlane:!1,shaderPolygonOffset:0,draped:this.draped})})),this.layerOpacityChanged())}destroy(){super.destroy(),this._patchTask=o(this._patchTask),this._forEachMaterial((e=>this._context.stage.remove(e))),this._materials.length=0,this._cimSymbolMaterials.clear(),this._cimSymbolTextures.forEach((e=>this._context.stage.remove(e))),this._cimSymbolTextures.clear(),this._textureHandle=a(this._textureHandle)}_getScaleFactor({size:e},t){if(!this._drivenProperties.size)return 1;if(null==e)return this._getFallbackSize();const[r,i,s]=e;return"symbol-value"===r?1:"number"==typeof r&&isFinite(r)?c(r)/t:"number"==typeof s&&isFinite(s)?c(s)/t:1}_getDrivenRotation(e){return this._drivenProperties.rotation?e.heading??0:0}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry))return null;let r,i=[0,0];const s=k(t.geometry);if(null==s)return this.logger.warn(`unsupported geometry type for text symbol: ${t.geometry.type}`),null;const o=this._context.stage.view.focusAreas.containsGeometry(s);if(this._cimData){if(!this._cimData.symbol)return null;const s=this._generateTextureCIM(t,e),a={textureId:s.id,isFocused:o,...this._cimMaterialParametersInfo};r=this._createMaterialAndAddToStage(a,this._context.stage);const n=this._context.graphicsCoreOwner.view.state.rasterPixelRatio;i=[s.parameters.width/n,s.parameters.height/n]}else i=this._size,r=o||1===this._materials.length?this._materials[0]:this._materials[1];if(null==s)return this.logger.warn(`unsupported geometry type for icon symbol: ${t.geometry.type}`),null;const a=e.renderingInfo,n=this._getVertexOpacityAndColor(a,this._getFallbackOpacityAndColor()),l=this._getDrivenRotation(a);let c=1;if(!this._fastUpdates?.visualVariables.size){const e=i[0]>i[1]?i[0]:i[1];c=this._getScaleFactor(a,e)}c*=this._symbolTextureRatio;const h=d(i[0]*c,i[1]*c),u=this.setGraphicElevationContext(t);return this.ensureDrapedStatus("on-the-ground"===u.mode)&&this._setDrapingDependentMaterialParameters(),this.draped?this._createAsOverlay(t,s,r,n,l,h):this._createAs3DShape(t,s,r,n,l,h,u,t.uid)}layerOpacityChanged(){const e=this._getFillColor(),t=this._getOutlineColor();this._forEachMaterial((r=>{r.setParameters({color:e}),r.setParameters({outlineColor:t})}))}updateGeometry(e,t){if(this.draped||!this._validateGeometry(t))return!1;const{elevationContext:r,stageObject:i}=e;if(r.mode!==this.getGeometryElevationMode(t))return!1;const s=k(t);if(!s)return!1;const o=B(i,this._context,s,r);if(null==o)return!1;const a=N(this._context,s);return i.geometries[0].localOrigin===a&&(e.alignedSampledElevation=o,$(e,s,this._context.elevationProvider),!0)}layerElevationInfoChanged(e,t,r){const i=this._elevationContext.mode,s=F(ue.elevationModeChangeTypes,r,i);if(s!==T.UPDATE)return s;const o=A(i)||"absolute-height"===i;return this.updateGraphics3DGraphicElevationInfo(e,t,(()=>o))}slicePlaneEnabledChanged(){return this.draped||this._forEachMaterial((e=>{e.setParameters({hasSlicePlane:this._context.slicePlaneEnabled})})),!0}physicalBasedRenderingChanged(){return!0}get pixelRatioChanged(){return null!=this._getPrimitive()}applyRendererDiff(e,t){for(const r in e.diff){if("visualVariables"!==r)return V.RecreateSymbol;if(!J(this._fastUpdates,t,this._fastVisualVariableConvertOptions()))return V.RecreateSymbol;this._materials[0]?.setParameters(this._fastUpdates.materialParameters)}return V.FastUpdate}updateFocus(e,t){t.forEach((t=>{const r=this._context.stage.view.focusAreas.containsGeometry(t.graphic.geometry);t.layers.forEach((i=>{if(i?.graphics3DSymbolLayer===this){i.stageObject.geometries.some((e=>e.material.parameters.isFocused!==r))&&e(t)}}))}))}prepareSymbolLayerPatch(e){if(this._patchTask?.abort(),"partial"!==e.diff.type)return;const t=e.diff.diff;this._preparePatchResource(e,t),this._preparePatchRotation(e,t)}_preparePatchResource(e,s){if(!s.resource||"partial"!==s.resource.type)return;const c=s.resource.diff;if("complete"!==c?.href?.type)return;const h=c.href.newValue,{textures:u}=this._context.sharedResources;if(null==h||null==u||null!=pe(h))return;const m=this._getIconSize(),d=m*this._context.graphicsCoreOwner.view.state.pixelRatio;e.symbolLayerStatePatches.push((()=>{this._patchTask=o(this._patchTask),this._patchTask=r((e=>this._context.schedule((async(e,r)=>{const s=await t(u.fromUrl(h,d,{signal:r}));l(r);const o=!s.ok;if(o&&n(s.error),this._textureHandle=a(this._textureHandle),this._patchTask=null,o){this._forEachMaterial((e=>{e.visible=!1,e.setParameters({textureId:null})}));const e=`Failed to load (Request for icon resource failed: ${h})`;return void this.logger.error(new i("graphics3diconsymbollayer:request-failed",e))}this._textureHandle=s.value;const c=s.value.texture;this._size=fe(c,m),this._forEachMaterial((e=>{e.setParameters({textureId:c.id}),e.visible=!0}))}),e)))})),delete c.href}_preparePatchRotation(e,t){if(!t.angle||"complete"!==t.angle.type)return;const r=t.angle.newValue??0,i=0!==r||this._drivenProperties.rotation;e.symbolLayerStatePatches.push((()=>{this._forEachMaterial((e=>e.setParameters({rotation:r,hasRotation:i})))})),delete t.angle}_defaultElevationInfoNoZ(){return xe}_createAs3DShape(e,t,r,i,s,o,a,n){const l=this.getFastUpdateAttrValues(e),c=this._context.layerViewUid,h=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:n,layerViewUid:c}),u=ie(r,{normal:ne,color:i,rotation:s,size:o,centerOffsetAndDistance:be,featureAttribute:l,objectAndLayerIdColor:h}),m=W(this._context,t,u,a,n);if(null==m)return null;const d=new D(this,m.object,[u],null,null,E,a);return d.alignedSampledElevation=m.sampledElevation,d.needsElevationUpdates=A(a.mode)||"absolute-height"===a.mode,d.getScreenSize=this._createScreenSizeGetter(o,l),d.calculateRelativeScreenBounds=e=>r.calculateRelativeScreenBounds(d.getScreenSize(),1,e),$(d,t,this._context.elevationProvider),d}_createAsOverlay(e,t,r,i,s,o){r.renderPriority=this._renderPriority;const a=f();b(t,a,this._context.overlaySR),a[2]=re;const n=this._context.clippingExtent;if(null!=n&&!v(n,a))return null;const l=this.getFastUpdateAttrValues(e),c=e.uid,h=this._context.layerViewUid,u=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:c,layerViewUid:h}),m=ie(r,{normal:ne,position:a,color:i,rotation:s,size:o,featureAttribute:l,objectAndLayerIdColor:u}),d=new se(m,{layerViewUid:h,graphicUid:c}),p=new U(this,[d],null,this._context.drapeSourceRenderer);return p.getScreenSize=this._createScreenSizeGetter(o,l),p.calculateRelativeScreenBounds=e=>r.calculateRelativeScreenBounds(p.getScreenSize(),1,e),p}_createScreenSizeGetter(e,t){const r=this._outlineSize+2;if(this._fastUpdates&&t){const i=e[0]/this._symbolTextureRatio,s=e[1]/this._symbolTextureRatio;return(e=p())=>{const[o,a]=Z(ve,this._fastUpdates.materialParameters,t);return e[0]=o*i+r,e[1]=a*s+r,e}}const i=e[0]/this._symbolTextureRatio+r,s=e[1]/this._symbolTextureRatio+r;return(e=p())=>(e[0]=i,e[1]=s,e)}_fastVisualVariableConvertOptions(){const e=Math.max(this._size[0],this._size[1]),t=_(e,e,e),r=h(1),i=e*r,s=_(i,i,i),o=this._getFallbackSize();return new K({supports:{size:!0,color:!0,rotation:!0,opacity:!1},modelSize:t,symbolSize:s,unitInMeters:r,fallbackColor:this._getFallbackOpacityAndColor(),fallbackSize:_(o,o,o)})}_forEachMaterial(e){this._materials.forEach(e),this._cimSymbolMaterials.forEach(e)}test(){return{...super.test(),material:this._materials[0]}}}function me(e){return e&&"point-3d"===e.type&&e.hasVisibleVerticalOffset()}function de(e){return null!=e&&("cross"===e||"x"===e)}function pe(e){const t=m(e);return"application/json"===t?.mediaType?t.data:void 0}function _e(e,t){return"relative"===e?d((t.x||0)+.5,.5-(t.y||0)):e in H?H[e]:H.center}function fe({parameters:e},t){const r=(e.width??1)/(e.height??1);return r>1?[t,Math.round(t/r)]:[Math.round(t*r),t]}function ge(e){return e.resource?.href?null:e.resource?.primitive??C}function ye(e){return 1===(e.material?.color?.a??1)&&null!=ge(e)}const xe={mode:"relative-to-ground",offset:0},be=x(0,0,0,1),ve=f();export{ue as Graphics3DIconSymbolLayer};
5
+ import e from"../../../../Color.js";import{result as t,createTask as r}from"../../../../core/asyncUtils.js";import i from"../../../../core/Error.js";import has from"../../../../core/has.js";import{clone as s}from"../../../../core/lang.js";import{abortMaybe as o,releaseMaybe as a}from"../../../../core/maybe.js";import{throwIfAbortError as n,throwIfAborted as l}from"../../../../core/promiseUtils.js";import{pt2px as c,px2pt as h}from"../../../../core/screenUtils.js";import{numericHash as u}from"../../../../core/string.js";import{dataComponents as m}from"../../../../core/urlUtils.js";import{fromValues as d,create as p}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{fromValues as _,create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as y,ZEROS as g,fromValues as x}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{projectPointToVector as b}from"../../../../geometry/projection/projectPointToVector.js";import{containsPoint as v}from"../../../../geometry/support/aaBoundingBox.js";import S from"../../../../layers/support/FieldsIndex.js";import{createRendererExpression as P}from"../../../../support/ArcadeExpression.js";import{CIMSymbolHelper as R}from"../../../../symbols/cim/CIMSymbolHelper.js";import{evaluateValueOrFunction as w}from"../../../../symbols/cim/utils.js";import{scaleCIMSymbol as z}from"../../../../symbols/support/cimSymbolUtils.js";import{defaultPrimitive as C}from"../../../../symbols/support/IconSymbol3DLayerResource.js";import{Symbol3DAnchorPosition2D as O}from"../../../../symbols/support/Symbol3DAnchorPosition2D.js";import{getIconHref as M}from"../../../../symbols/support/utils.js";import{focusAreaHUDColor as j}from"../../../FocusAreas.js";import{transparentUnit as I}from"./constants.js";import{perObjectElevationAligner as E}from"./ElevationAligners.js";import{SymbolUpdateType as T,elevationModeChangeUpdateType as F,needsElevationUpdates2D as A}from"./elevationAlignmentUtils.js";import{Graphics3DDrapedGraphicLayer as U}from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as D}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as L}from"./Graphics3DSymbolLayer.js";import{validateSymbolLayerSize as G}from"./graphicUtils.js";import{ApplyRendererDiffResult as V}from"./interfaces.js";import{namedAnchorToHUDMaterialAnchorPos as H}from"./placementUtils.js";import{placePointOnGeometry as k,updateStageObjectGeometry as B,getLocalOriginForPoint as N,extendPointGraphicElevationContext as $,createStageObject as W}from"./pointUtils.js";import{initFastSymbolUpdatesState as q,updateFastSymbolUpdatesState as J,evaluateModelTransformScale as Z,ConvertOptions as K}from"../support/FastSymbolUpdates.js";import{createTexture as Q,requiresHalfTexelOffset as X,defaultBoundingBox as Y,defaultSymbolSizeRatio as ee,defaultTexSize as te}from"../../support/engineContent/sdfPrimitives.js";import{drapedZ as re}from"../../terrain/OverlayRenderer.js";import{createPointGeometry as ie}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderGeometry as se}from"../../webgl-engine/lib/RenderGeometry.js";import{Texture as oe}from"../../webgl-engine/lib/Texture.js";import{HUDMaterial as ae}from"../../webgl-engine/materials/HUDMaterial.js";const ne=_(0,0,1),le=16,ce=1.5,he=[te*ee,te*ee];class ue extends L{static{this.PRIMITIVE_SIZE=he}getCachedSize(){return{size:this._getIconSize()}}static{this.elevationModeChangeTypes={definedChanged:T.UPDATE,staysOnTheGround:T.NONE,onTheGroundChanged:T.RECREATE}}constructor(e,t,r,i){super(e,t,r,i,ge(t)),this._cimData=null,this._overrideHelperClass=null,this._arcadeInfo=null,this._cimSymbolMaterials=new Map,this._cimSymbolTextures=new Map,this._cimMaterialParametersInfo=null,this._cimScaleFactorOrFunction=null,this._size=null,this._symbolTextureRatio=1,this._outlineSize=0,this._textureHandle=null,this._patchTask=null,this._elevationOptions={supportsOffsetAdjustment:!0,supportsOnTheGround:!0}}async doLoad(e){this._validateOrThrow();const t=this._prepareMaterialParameters(),r=this._getPrimitive();if(null!=r)this._prepareResourcesPrimitive(t,r);else{const r=M(this.symbolLayer),i=pe(r);null!=i?await this._prepareResourcesCIM(t,JSON.parse(i),e):await this._prepareResourcesHref(t,r,e)}}_validateOrThrow(){if(this._drivenProperties.size)return;const e=G(this._getIconSize());if(e)throw new i("graphics3diconsymbollayer:invalid-size",e)}_getIconSize(){const e=this.symbolLayer,t=Math.round(null!=e.size?c(e.size):le);return this._drivenProperties.size?Math.max(t,64):t}_generateTextureCIM(e,t){const r=this._overrideHelperClass;let i=this._cimData;if(r&&i&&i.symbol||this.logger.error("Can't create texture, CIM data is undefined"),i.primitiveOverrides){i=s(i);const o=i.primitiveOverrides;r.evaluateOverrides(o,e,this._arcadeInfo.geometryType,null,null,t.layer.fieldsIndex),r.applyOverrides(i.symbol,o)}const o=u(JSON.stringify(i));let a=this._cimSymbolTextures.get(o);if(a)return a;const n=this._context.sharedResources.cimSymbolRasterizer,l=this._context.renderer&&"dictionary"===this._context.renderer.type?this._context.renderer.fieldMap:null;l&&r.applyDictionaryTextOverrides(i.symbol,e,l,null);const c=null!=this._cimScaleFactorOrFunction?w(this._cimScaleFactorOrFunction,e):1;1!==c&&i.symbol&&z(i.symbol,c,!0);const h=R.getEnvelope(i,null,n.resourceManager);if(h?.width&&h.height){const e=h.x+h.width/2,t=h.y+h.height/2,r=n.rasterize({type:"cim",data:i},h.width,h.height,e,t,1,"esriGeometryPoint",0,null,this._context.graphicsCoreOwner.view.state.rasterPixelRatio),s=new O({x:-h.x/h.width-.5,y:(h.height+h.y)/h.height-.5});this._cimMaterialParametersInfo.anchorPosition=_e("relative",s),a=new oe(r,{width:r?.width??1,height:r?.height??1,reloadable:!0})}else a=new oe(new ImageData(1,1),{width:1,height:1,reloadable:!0});return this._cimSymbolTextures.set(o,a),this._context.stage.add(a),a}_prepareMaterialParameters(){const e={anchorPosition:_e(this.symbolLayer.anchor,this.symbolLayer.anchorPosition),rotation:this.symbolLayer.angle},t=this.symbol;if(me(t)){const{screenLength:r,minWorldLength:i,maxWorldLength:s}=t.verticalOffset;e.verticalOffset={screenLength:c(r),minWorldLength:i||0,maxWorldLength:null!=s?s:1/0}}this._context.screenSizePerspectiveEnabled&&(e.screenSizePerspective=this._context.sharedResources.screenSizePerspectiveSettings),(0!==e.rotation||this._drivenProperties.rotation)&&(e.hasRotation=!0);const r=!has("disable-feature:non-occluded-hud");return e.occlusionTest=!r,e.occludedFragmentFade=r,e.horizonCullingEnabled=r&&this._context.spherical,e.hasSlicePlane=this._context.slicePlaneEnabled,e}_prepareResourcesPrimitive(e,t){const r=this._getOutlineSize();if(de(t)&&0===r)throw new Error("Nothing to render");if(this._outlineSize=r,e.color=this._getFillColor(),e.outlineColor=this._getOutlineColor(),e.outlineSize=this._outlineSize,null!=this._context.sharedResources.textures){const r=this._context.sharedResources.textures.fromData(`${t}-icon`,(()=>Q(t)));this._textureHandle=r,e.textureId=r.texture.id}e.textureIsSignedDistanceField=!0,e.sampleSignedDistanceFieldTexelCenter=X(t),e.distanceFieldBoundingBox=Y;const i=this._getIconSize();this._size=[i,i],this._symbolTextureRatio=1/ee,this._createMaterialAndAddToStage(e,this._context.stage)}async _prepareResourcesHref(e,r,s){this._outlineSize=this._getOutlineSize(),e.color=this._getFillColor(),e.outlineColor=this._getOutlineColor(),e.outlineSize=this._outlineSize,e.textureIsSignedDistanceField=!1;const o=this._getIconSize(),a=o*this._context.graphicsCoreOwner.view.state.rasterPixelRatio;if(null!=this._context.sharedResources.textures){const l=await t(this._context.sharedResources.textures.fromUrl(r,a,{signal:s}));if(!1===l.ok){n(l.error);throw new i("graphics3diconsymbollayer:request-failed",`Failed to load (Request for icon resource failed: ${r})`)}this._textureHandle=l.value;const c=l.value.texture;this._size=fe(c,o),e.textureId=c.id}this._createMaterialAndAddToStage(e,this._context.stage)}async _prepareResourcesCIM(e,t,r){const{OverrideHelper:i}=await import("../../../../symbols/cim/OverrideHelper.js");if(this._overrideHelperClass=i,this._cimData=t,!this._context.sharedResources.cimSymbolRasterizer){const e=(await import("../../../../symbols/cim/CIMSymbolRasterizer.js")).CIMSymbolRasterizer;l(r),this._context.sharedResources.cimSymbolRasterizer||(this._context.sharedResources.cimSymbolRasterizer=new e(this._context.renderCoordsHelper.spatialReference))}const s=this._context.sharedResources.cimSymbolRasterizer,o=[],a=t,n=a?.symbol;R.fetchResources(n,s.resourceManager,o,r),R.fetchFonts(n,s.resourceManager,o);const c=this._context.layer.fields?this._context.layer.fields.map((e=>e.toJSON())):[],h=this._context.renderCoordsHelper.spatialReference;if(this._arcadeInfo={spatialReference:h,fields:c,geometryType:"esriGeometryPoint"},a?.primitiveOverrides&&o.push(i.createRenderExpressions(a.primitiveOverrides,this._arcadeInfo)),o.length>0&&(await Promise.all(o),l(r)),this._context.renderer&&"dictionary"===this._context.renderer.type&&this._context.renderer.scaleExpression){const e=this._context.renderer;if(e.scaleExpression){const t=e.scaleExpression,r=await P(t,this._context.layer.spatialReference),{default:i}=await import("../../../2d/arcade/callExpressionWithFeature.js"),s=new S(c);this._cimScaleFactorOrFunction=(e,t,o)=>{const a=i(r,e,{$view:o},"esriGeometryPoint",s,t);return null!==a?a:1}}}l(r),this._cimMaterialParametersInfo=e,this._cimMaterialParametersInfo.color=this._getFillColor(),this._cimMaterialParametersInfo.outlineColor=[0,0,0,0],this._cimMaterialParametersInfo.outlineSize=0,this._cimMaterialParametersInfo.textureIsSignedDistanceField=!1}_getPrimitive(){return ye(this.symbolLayer)}_getOutlineSize(){let e=0;const t=this.symbolLayer;if(null!=t.outline?.size)return Math.max(c(t.outline.size),0);return e=de(this._getPrimitive())?ce:0,Math.max(e,0)}_getOutlineColor(){const t=this._getLayerOpacity(),r=this.symbolLayer,i=r?.outline?.color;if(null!=i){const r=e.toUnitRGB(i),s=i.a*t;return[r[0],r[1],r[2],s]}return[0,0,0,0]}_getFillColor(){if(de(this._getPrimitive()))return I;const e=null==this._getPrimitive(),t=this.symbolLayer?.material?.color;return this._getCombinedOpacityAndColor(t,{hasIntrinsicColor:e})}_getFallbackOpacityAndColor(){const t=this.symbolLayer?.material?.color;if(null==t){return null==this._getPrimitive()?y:g}return e.toUnitRGBA(t)}_getFallbackSize(){const e=this._getIconSize(),{symbolLayer:{size:t}}=this;return(null!=t?Math.round(c(t)):le)/e}_createMaterialAndAddToStage(e,t){const r=this._context.spherical;if(this._cimData){this._fastUpdates=null;let i=e.textureId?this._cimSymbolMaterials.get(e.textureId):null;return i||(i=new ae(e,r),this._cimSymbolMaterials.set(e.textureId??0,i),t.add(i)),i}this._fastUpdates=q(this._context.renderer,this._fastVisualVariableConvertOptions()),this._fastUpdates&&(e={...e,...this._fastUpdates.materialParameters}),this._materials[0]=new ae(e,r),t.add(this._materials[0]),e.isFocused=!1;const i=this._context.stage.view.focusAreas.style;return e.color=j(e.color,i),e.outlineColor=j(e.outlineColor,i),this._materials[1]=new ae(e,r),t.add(this._materials[1]),this._materials[0]}_setDrapingDependentMaterialParameters(){this.draped&&(this._forEachMaterial((e=>{e.setParameters({verticalOffset:null,screenSizePerspective:null,occlusionTest:!1,hasSlicePlane:!1,shaderPolygonOffset:0,draped:this.draped})})),this.layerOpacityChanged())}destroy(){super.destroy(),this._patchTask=o(this._patchTask),this._forEachMaterial((e=>this._context.stage.remove(e))),this._materials.length=0,this._cimSymbolMaterials.clear(),this._cimSymbolTextures.forEach((e=>this._context.stage.remove(e))),this._cimSymbolTextures.clear(),this._textureHandle=a(this._textureHandle)}_getScaleFactor({size:e},t){if(!this._drivenProperties.size)return 1;if(null==e)return this._getFallbackSize();const[r,i,s]=e;return"symbol-value"===r?1:"number"==typeof r&&isFinite(r)?c(r)/t:"number"==typeof s&&isFinite(s)?c(s)/t:1}_getDrivenRotation(e){return this._drivenProperties.rotation?e.heading??0:0}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry))return null;let r,i=[0,0];const s=k(t.geometry);if(null==s)return this.logger.warn(`unsupported geometry type for text symbol: ${t.geometry.type}`),null;const o=this._context.stage.view.focusAreas.containsGeometry(s);if(this._cimData){if(!this._cimData.symbol)return null;const s=this._generateTextureCIM(t,e),a={textureId:s.id,isFocused:o,...this._cimMaterialParametersInfo};r=this._createMaterialAndAddToStage(a,this._context.stage);const n=this._context.graphicsCoreOwner.view.state.rasterPixelRatio;i=[s.parameters.width/n,s.parameters.height/n]}else i=this._size,r=o?this._materials[0]:this._materials[1];if(null==s)return this.logger.warn(`unsupported geometry type for icon symbol: ${t.geometry.type}`),null;const a=e.renderingInfo,n=this._getVertexOpacityAndColor(a,this._getFallbackOpacityAndColor()),l=this._getDrivenRotation(a);let c=1;if(!this._fastUpdates?.visualVariables.size){const e=i[0]>i[1]?i[0]:i[1];c=this._getScaleFactor(a,e)}c*=this._symbolTextureRatio;const h=d(i[0]*c,i[1]*c),u=this.setGraphicElevationContext(t);return this.ensureDrapedStatus("on-the-ground"===u.mode)&&this._setDrapingDependentMaterialParameters(),this.draped?this._createAsOverlay(t,s,r,n,l,h):this._createAs3DShape(t,s,r,n,l,h,u,t.uid)}layerOpacityChanged(){const e=this._getFillColor(),t=this._getOutlineColor();this._forEachMaterial((r=>{r.setParameters({color:e}),r.setParameters({outlineColor:t})}))}updateGeometry(e,t){if(this.draped||!this._validateGeometry(t))return!1;const{elevationContext:r,stageObject:i}=e;if(r.mode!==this.getGeometryElevationMode(t))return!1;const s=k(t);if(!s)return!1;const o=B(i,this._context,s,r);if(null==o)return!1;const a=N(this._context,s);return i.geometries[0].localOrigin===a&&(e.alignedSampledElevation=o,$(e,s,this._context.elevationProvider),!0)}layerElevationInfoChanged(e,t,r){const i=this._elevationContext.mode,s=F(ue.elevationModeChangeTypes,r,i);if(s!==T.UPDATE)return s;const o=A(i)||"absolute-height"===i;return this.updateGraphics3DGraphicElevationInfo(e,t,(()=>o))}slicePlaneEnabledChanged(){return this.draped||this._forEachMaterial((e=>{e.setParameters({hasSlicePlane:this._context.slicePlaneEnabled})})),!0}physicalBasedRenderingChanged(){return!0}get pixelRatioChanged(){return null!=this._getPrimitive()}applyRendererDiff(e,t){for(const r in e.diff){if("visualVariables"!==r)return V.RecreateSymbol;if(!J(this._fastUpdates,t,this._fastVisualVariableConvertOptions()))return V.RecreateSymbol;this._materials[0]?.setParameters(this._fastUpdates.materialParameters)}return V.FastUpdate}updateFocus(e,t){t.forEach((t=>{const r=this._context.stage.view.focusAreas.containsGeometry(t.graphic.geometry);t.layers.forEach((i=>{if(i?.graphics3DSymbolLayer===this){i.stageObject.geometries.some((e=>e.material.parameters.isFocused!==r))&&e(t)}}))}))}prepareSymbolLayerPatch(e){if(this._patchTask?.abort(),"partial"!==e.diff.type)return;const t=e.diff.diff;this._preparePatchResource(e,t),this._preparePatchRotation(e,t)}_preparePatchResource(e,s){if(!s.resource||"partial"!==s.resource.type)return;const c=s.resource.diff;if("complete"!==c?.href?.type)return;const h=c.href.newValue,{textures:u}=this._context.sharedResources;if(null==h||null==u||null!=pe(h))return;const m=this._getIconSize(),d=m*this._context.graphicsCoreOwner.view.state.pixelRatio;e.symbolLayerStatePatches.push((()=>{this._patchTask=o(this._patchTask),this._patchTask=r((e=>this._context.schedule((async(e,r)=>{const s=await t(u.fromUrl(h,d,{signal:r}));l(r);const o=!s.ok;if(o&&n(s.error),this._textureHandle=a(this._textureHandle),this._patchTask=null,o){this._forEachMaterial((e=>{e.visible=!1,e.setParameters({textureId:null})}));const e=`Failed to load (Request for icon resource failed: ${h})`;return void this.logger.error(new i("graphics3diconsymbollayer:request-failed",e))}this._textureHandle=s.value;const c=s.value.texture;this._size=fe(c,m),this._forEachMaterial((e=>{e.setParameters({textureId:c.id}),e.visible=!0}))}),e)))})),delete c.href}_preparePatchRotation(e,t){if(!t.angle||"complete"!==t.angle.type)return;const r=t.angle.newValue??0,i=0!==r||this._drivenProperties.rotation;e.symbolLayerStatePatches.push((()=>{this._forEachMaterial((e=>e.setParameters({rotation:r,hasRotation:i})))})),delete t.angle}_defaultElevationInfoNoZ(){return xe}_createAs3DShape(e,t,r,i,s,o,a,n){const l=this.getFastUpdateAttrValues(e),c=this._context.layerViewUid,h=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:n,layerViewUid:c}),u=ie(r,{normal:ne,color:i,rotation:s,size:o,centerOffsetAndDistance:be,featureAttribute:l,objectAndLayerIdColor:h}),m=W(this._context,t,u,a,n);if(null==m)return null;const d=new D(this,m.object,[u],null,null,E,a);return d.alignedSampledElevation=m.sampledElevation,d.needsElevationUpdates=A(a.mode)||"absolute-height"===a.mode,d.getScreenSize=this._createScreenSizeGetter(o,l),d.calculateRelativeScreenBounds=e=>r.calculateRelativeScreenBounds(d.getScreenSize(),1,e),$(d,t,this._context.elevationProvider),d}_createAsOverlay(e,t,r,i,s,o){r.renderPriority=this._renderPriority;const a=f();b(t,a,this._context.overlaySR),a[2]=re;const n=this._context.clippingExtent;if(null!=n&&!v(n,a))return null;const l=this.getFastUpdateAttrValues(e),c=e.uid,h=this._context.layerViewUid,u=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:c,layerViewUid:h}),m=ie(r,{normal:ne,position:a,color:i,rotation:s,size:o,featureAttribute:l,objectAndLayerIdColor:u}),d=new se(m,{layerViewUid:h,graphicUid:c}),p=new U(this,[d],null,this._context.drapeSourceRenderer);return p.getScreenSize=this._createScreenSizeGetter(o,l),p.calculateRelativeScreenBounds=e=>r.calculateRelativeScreenBounds(p.getScreenSize(),1,e),p}_createScreenSizeGetter(e,t){const r=this._outlineSize+2;if(this._fastUpdates&&t){const i=e[0]/this._symbolTextureRatio,s=e[1]/this._symbolTextureRatio;return(e=p())=>{const[o,a]=Z(ve,this._fastUpdates.materialParameters,t);return e[0]=o*i+r,e[1]=a*s+r,e}}const i=e[0]/this._symbolTextureRatio+r,s=e[1]/this._symbolTextureRatio+r;return(e=p())=>(e[0]=i,e[1]=s,e)}_fastVisualVariableConvertOptions(){const e=Math.max(this._size[0],this._size[1]),t=_(e,e,e),r=h(1),i=e*r,s=_(i,i,i),o=this._getFallbackSize();return new K({supports:{size:!0,color:!0,rotation:!0,opacity:!1},modelSize:t,symbolSize:s,unitInMeters:r,fallbackColor:this._getFallbackOpacityAndColor(),fallbackSize:_(o,o,o)})}_forEachMaterial(e){this._materials.forEach(e),this._cimSymbolMaterials.forEach(e)}test(){return{...super.test(),material:this._materials[0]}}}function me(e){return e&&"point-3d"===e.type&&e.hasVisibleVerticalOffset()}function de(e){return null!=e&&("cross"===e||"x"===e)}function pe(e){const t=m(e);return"application/json"===t?.mediaType?t.data:void 0}function _e(e,t){return"relative"===e?d((t.x||0)+.5,.5-(t.y||0)):e in H?H[e]:H.center}function fe({parameters:e},t){const r=(e.width??1)/(e.height??1);return r>1?[t,Math.round(t/r)]:[Math.round(t*r),t]}function ye(e){return e.resource?.href?null:e.resource?.primitive??C}function ge(e){return 1===(e.material?.color?.a??1)&&null!=ye(e)}const xe={mode:"relative-to-ground",offset:0},be=x(0,0,0,1),ve=f();export{ue as Graphics3DIconSymbolLayer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../Color.js";import{getMetersPerUnitForSR as t}from"../../../../core/unitUtils.js";import{e as r}from"../../../../chunks/earcut.js";import{set as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as i,create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{b as s}from"../../../../chunks/vec42.js";import{toRadian as a}from"../../../../core/libs/gl-matrix-2/math/common.js";import{fromBuffer as l,intersectsClippingArea as c,empty as h,expandWithAABB as m,create as p}from"../../../../geometry/support/aaBoundingBox.js";import{empty as u,expandPointInPlace as d,create as g}from"../../../../geometry/support/aaBoundingRect.js";import{newDoubleArray as y,doubleSubArray as f}from"../../../../geometry/support/DoubleArray.js";import{perVertexElevationAligner as _}from"./ElevationAligners.js";import{SymbolUpdateType as x,elevationModeChangeUpdateType as v,needsElevationUpdates2D as b}from"./elevationAlignmentUtils.js";import{Graphics3DDrapedGraphicLayer as w}from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as C}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as D}from"./Graphics3DSymbolLayer.js";import{geometryAsPolygon as j,createWaterGeometry as S,PolygonCreationDataBase as G}from"./polygonUtils.js";import{geometryToRenderInfo as E,geometryToRenderInfoDraped as A}from"../../support/renderInfoUtils/polygon.js";import{Object3D as L}from"../../webgl-engine/lib/Object3D.js";import{RenderGeometry as O}from"../../webgl-engine/lib/RenderGeometry.js";import{Parameters as P,WaterMaterial as T}from"../../webgl-engine/materials/WaterMaterial.js";import{wavePresets as R}from"../../webgl-engine/materials/internal/waterMaterialUtils.js";const U=["polyline","polygon","extent"];class I extends D{static{this.unitSizeOfTexture=100}static{this.elevationModeChangeTypes={definedChanged:x.RECREATE,staysOnTheGround:x.NONE,onTheGroundChanged:x.RECREATE}}constructor(e,t,r,o){super(e,t,r,o)}async doLoad(){}destroy(){super.destroy(),this._context.stage.remove(this._materials[0]),this._materials.length=0}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,U,this.symbolLayer.type))return null;const r=this.setGraphicElevationContext(t);return this.ensureDrapedStatus("on-the-ground"===r.mode),this.ensureMaterial(),this.draped?this._createAsOverlay(t):this._createAs3DShape(t,r,t.uid)}ensureMaterial(){if(this._materials[0])return;const t=new P,r=this.symbolLayer.color;null!=r&&(t.color=e.toUnitRGBA(r));const o=this._getCombinedOpacity(r,{hasIntrinsicColor:!0});t.color=[t.color[0],t.color[1],t.color[2],o],t.transparent=o<1||this.needsDrivenTransparentPass,t.waveDirection=null!=this.symbolLayer.waveDirection?B(this.symbolLayer.waveDirection):i(0,0);const n=this.symbolLayer.waveStrength+"-"+this.symbolLayer.waterbodySize,s=R[n];t.waveStrength=s.waveStrength,t.waveTextureRepeat=s.textureRepeat,t.waveVelocity=s.waveVelocity,t.flowStrength=s.perturbationStrength,t.hasSlicePlane=this._context.slicePlaneEnabled,t.draped=this.draped,this._materials[0]=new T(t,this._context),this._context.stage.add(this._materials[0])}layerOpacityChanged(){if(null==this._materials[0])return;const e=this._materials[0].parameters.color,t=this._getCombinedOpacity(this.symbolLayer.color,{hasIntrinsicColor:!0}),r=t<1||this.needsDrivenTransparentPass;this._materials[0].setParameters({color:[e[0],e[1],e[2],t],transparent:r})}layerElevationInfoChanged(e,t,r){const o=this._elevationContext.mode,i=v(I.elevationModeChangeTypes,r,o);if(i!==x.UPDATE)return i;const n=b(o);return this.updateGraphics3DGraphicElevationInfo(e,t,(()=>n))}slicePlaneEnabledChanged(){return this._materials[0]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),!0}physicalBasedRenderingChanged(){return!0}_createAs3DShape(e,t,r){const o=j(e.geometry);if(null==o)return null;const i=E(o,this._context.elevationProvider,this._context.renderCoordsHelper,t),n=i.position.length/3,s=y(2*n);M(s,i.mapPositions,n,this._context.elevationProvider.spatialReference);const a=new N(i,s,this._context.layerViewUid,e.uid);if(a.objectAndLayerIdColor=this._context.stage.renderView?.getObjectAndLayerIdColor(a),this._create3DShapeGeometries(a),this._logGeometryCreationWarnings(a.renderData,o.rings,"rings","WaterSymbol3DLayer"),0===a.outGeometries.length)return null;const l=new L({geometries:a.outGeometries,castShadow:!1,layerViewUid:this._context.layerViewUid,graphicUid:r}),c=new C(this,l,a.outGeometries,null,null,_,t);return c.alignedSampledElevation=a.renderData.sampledElevation,c.needsElevationUpdates=b(t.mode),c}_create3DShapeGeometries(e){const t=e.renderData.polygons,o=e.uvCoords;for(const{count:i,index:n,position:s,mapPositions:a,holeIndices:h}of t){if(null!=this._context.clippingExtent&&(l(a,k),!c(k,this._context.clippingExtent)))continue;const t=r(a,h,3);if(0===t.length)continue;const m=f(o,2*n,2*i),p=S({material:this._materials[0],indices:t,mapPositions:a,attributeData:{position:s,uv0:m}},e.objectAndLayerIdColor);e.outGeometries.push(p)}}_createAsOverlay(e){const t=j(e.geometry);if(null==t)return null;this._materials[0].renderPriority=this._renderPriority;const r=A(t,this._context.overlaySR),o=r.position.length/3,i=y(2*o);M(i,r.position,o,this._context.overlaySR);const n=new H(r,i,this._context.layerViewUid,e.uid);return n.objectAndLayerIdColor=this._context.stage.renderView?.getObjectAndLayerIdColor(n),n.outBoundingBox=h(),this._createAsOverlayWater(n),this._logGeometryCreationWarnings(n.renderData,t.rings,"rings","WaterSymbol3DLayer"),0===n.outGeometries.length?null:new w(this,n.outGeometries,n.outBoundingBox,this._context.drapeSourceRenderer)}_createAsOverlayWater(e){const t=e.uvCoords,o=e.renderData.polygons;for(const{position:i,holeIndices:n,index:s,count:a}of o){if(l(i,k),!c(k,this._context.clippingExtent))continue;m(e.outBoundingBox,k);const o=r(i,n,3);if(0===o.length)continue;const h=f(t,2*s,2*a),p=S({material:this._materials[0],indices:o,attributeData:{position:i,uv0:h}},e.objectAndLayerIdColor);e.outGeometries.push(new O(p,e))}}test(){return{...super.test(),create3DShape:e=>this._createAs3DShape(e.graphic,e.elevationContext,e.graphicUid),ensureMaterial:()=>this.ensureMaterial()}}}function B(e){const t=n(),r=a(e);return t[0]=Math.sin(r),t[1]=Math.cos(r),t}function M(e,r,i,n){const a=t(n);u(W);for(let t=0;t<i;t++)o(z,r[3*t],r[3*t+1]),d(W,z);s(W,W,a);const l=W[0]%I.unitSizeOfTexture,c=W[1]%I.unitSizeOfTexture;V[0]=W[0]-l,V[1]=W[1]-c;for(let t=0;t<i;t++)e[2*t]=(r[3*t]*a-V[0])/I.unitSizeOfTexture,e[2*t+1]=(r[3*t+1]*a-V[1])/I.unitSizeOfTexture}const V=n(),W=g(),z=n(),k=p();class N extends G{constructor(e,t,r,o){super(e,r,o),this.uvCoords=t}}class H extends G{constructor(e,t,r,o){super(e,r,o),this.uvCoords=t}}export{I as Graphics3DWaterSymbolLayer,B as headingVectorFromAngle};
5
+ import e from"../../../../Color.js";import{getMetersPerUnitForSR as t}from"../../../../core/unitUtils.js";import{e as r}from"../../../../chunks/earcut.js";import{set as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as i,create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{b as s}from"../../../../chunks/vec42.js";import{toRadian as a}from"../../../../core/libs/gl-matrix-2/math/common.js";import{fromBuffer as l,intersectsClippingArea as c,empty as h,expandWithAABB as m,create as p}from"../../../../geometry/support/aaBoundingBox.js";import{empty as d,expandPointInPlace as u,create as g}from"../../../../geometry/support/aaBoundingRect.js";import{newHalfFloatArray as y,halfFloatSubArray as f}from"../../../../geometry/support/HalfFloatArray.js";import{perVertexElevationAligner as _}from"./ElevationAligners.js";import{SymbolUpdateType as x,elevationModeChangeUpdateType as v,needsElevationUpdates2D as b}from"./elevationAlignmentUtils.js";import{Graphics3DDrapedGraphicLayer as w}from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as C}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as D}from"./Graphics3DSymbolLayer.js";import{geometryAsPolygon as j,createWaterGeometry as S,PolygonCreationDataBase as G}from"./polygonUtils.js";import{geometryToRenderInfo as E,geometryToRenderInfoDraped as A}from"../../support/renderInfoUtils/polygon.js";import{Object3D as L}from"../../webgl-engine/lib/Object3D.js";import{RenderGeometry as O}from"../../webgl-engine/lib/RenderGeometry.js";import{Parameters as P,WaterMaterial as T}from"../../webgl-engine/materials/WaterMaterial.js";import{wavePresets as R}from"../../webgl-engine/materials/internal/waterMaterialUtils.js";const U=["polyline","polygon","extent"];class I extends D{static{this.unitSizeOfTexture=100}static{this.elevationModeChangeTypes={definedChanged:x.RECREATE,staysOnTheGround:x.NONE,onTheGroundChanged:x.RECREATE}}constructor(e,t,r,o){super(e,t,r,o)}async doLoad(){}destroy(){super.destroy(),this._context.stage.remove(this._materials[0]),this._materials.length=0}createGraphics3DGraphic(e){const t=e.graphic;if(!this._validateGeometry(t.geometry,U,this.symbolLayer.type))return null;const r=this.setGraphicElevationContext(t);return this.ensureDrapedStatus("on-the-ground"===r.mode),this.ensureMaterial(),this.draped?this._createAsOverlay(t):this._createAs3DShape(t,r,t.uid)}ensureMaterial(){if(this._materials[0])return;const t=new P,r=this.symbolLayer.color;null!=r&&(t.color=e.toUnitRGBA(r));const o=this._getCombinedOpacity(r,{hasIntrinsicColor:!0});t.color=[t.color[0],t.color[1],t.color[2],o],t.transparent=o<1||this.needsDrivenTransparentPass,t.waveDirection=null!=this.symbolLayer.waveDirection?B(this.symbolLayer.waveDirection):i(0,0);const n=this.symbolLayer.waveStrength+"-"+this.symbolLayer.waterbodySize,s=R[n];t.waveStrength=s.waveStrength,t.waveTextureRepeat=s.textureRepeat,t.waveVelocity=s.waveVelocity,t.flowStrength=s.perturbationStrength,t.hasSlicePlane=this._context.slicePlaneEnabled,t.draped=this.draped,this._materials[0]=new T(t,this._context),this._context.stage.add(this._materials[0])}layerOpacityChanged(){if(null==this._materials[0])return;const e=this._materials[0].parameters.color,t=this._getCombinedOpacity(this.symbolLayer.color,{hasIntrinsicColor:!0}),r=t<1||this.needsDrivenTransparentPass;this._materials[0].setParameters({color:[e[0],e[1],e[2],t],transparent:r})}layerElevationInfoChanged(e,t,r){const o=this._elevationContext.mode,i=v(I.elevationModeChangeTypes,r,o);if(i!==x.UPDATE)return i;const n=b(o);return this.updateGraphics3DGraphicElevationInfo(e,t,(()=>n))}slicePlaneEnabledChanged(){return this._materials[0]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),!0}physicalBasedRenderingChanged(){return!0}_createAs3DShape(e,t,r){const o=j(e.geometry);if(null==o)return null;const i=E(o,this._context.elevationProvider,this._context.renderCoordsHelper,t),n=i.position.length/3,s=y(2*n);M(s,i.mapPositions,n,this._context.elevationProvider.spatialReference);const a=new H(i,s,this._context.layerViewUid,e.uid);if(a.objectAndLayerIdColor=this._context.stage.renderView?.getObjectAndLayerIdColor(a),this._create3DShapeGeometries(a),this._logGeometryCreationWarnings(a.renderData,o.rings,"rings","WaterSymbol3DLayer"),0===a.outGeometries.length)return null;const l=new L({geometries:a.outGeometries,castShadow:!1,layerViewUid:this._context.layerViewUid,graphicUid:r}),c=new C(this,l,a.outGeometries,null,null,_,t);return c.alignedSampledElevation=a.renderData.sampledElevation,c.needsElevationUpdates=b(t.mode),c}_create3DShapeGeometries(e){const t=e.renderData.polygons,o=e.uvCoords;for(const{count:i,index:n,position:s,mapPositions:a,holeIndices:h}of t){if(null!=this._context.clippingExtent&&(l(a,k),!c(k,this._context.clippingExtent)))continue;const t=r(a,h,3);if(0===t.length)continue;const m=f(o,2*n,2*i),p=S({material:this._materials[0],indices:t,mapPositions:a,attributeData:{position:s,uv0:m}},e.objectAndLayerIdColor);e.outGeometries.push(p)}}_createAsOverlay(e){const t=j(e.geometry);if(null==t)return null;this._materials[0].renderPriority=this._renderPriority;const r=A(t,this._context.overlaySR),o=r.position.length/3,i=y(2*o);M(i,r.position,o,this._context.overlaySR);const n=new N(r,i,this._context.layerViewUid,e.uid);return n.objectAndLayerIdColor=this._context.stage.renderView?.getObjectAndLayerIdColor(n),n.outBoundingBox=h(),this._createAsOverlayWater(n),this._logGeometryCreationWarnings(n.renderData,t.rings,"rings","WaterSymbol3DLayer"),0===n.outGeometries.length?null:new w(this,n.outGeometries,n.outBoundingBox,this._context.drapeSourceRenderer)}_createAsOverlayWater(e){const t=e.uvCoords,o=e.renderData.polygons;for(const{position:i,holeIndices:n,index:s,count:a}of o){if(l(i,k),!c(k,this._context.clippingExtent))continue;m(e.outBoundingBox,k);const o=r(i,n,3);if(0===o.length)continue;const h=f(t,2*s,2*a),p=S({material:this._materials[0],indices:o,attributeData:{position:i,uv0:h}},e.objectAndLayerIdColor);e.outGeometries.push(new O(p,e))}}test(){return{...super.test(),create3DShape:e=>this._createAs3DShape(e.graphic,e.elevationContext,e.graphicUid),ensureMaterial:()=>this.ensureMaterial()}}}function B(e){const t=n(),r=a(e);return t[0]=Math.sin(r),t[1]=Math.cos(r),t}function M(e,r,i,n){const a=t(n);d(W);for(let t=0;t<i;t++)o(z,r[3*t],r[3*t+1]),u(W,z);s(W,W,a);const l=W[0]%I.unitSizeOfTexture,c=W[1]%I.unitSizeOfTexture;V[0]=W[0]-l,V[1]=W[1]-c;for(let t=0;t<i;t++)e[2*t]=(r[3*t]*a-V[0])/I.unitSizeOfTexture,e[2*t+1]=(r[3*t+1]*a-V[1])/I.unitSizeOfTexture}const V=n(),W=g(),z=n(),k=p();class H extends G{constructor(e,t,r,o){super(e,r,o),this.uvCoords=t}}class N extends G{constructor(e,t,r,o){super(e,r,o),this.uvCoords=t}}export{I as Graphics3DWaterSymbolLayer,B as headingVectorFromAngle};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{neverReached as e}from"../../../../core/compilerUtils.js";import{defaultPrimitive as r}from"../../../../symbols/support/ObjectSymbol3DLayerResource.js";import{pathNumRoundCapExtrusionSubdivisions as t,pathNumCircleProfileSubdivisions as a,pathNumRoundJoinSubdivisions as s}from"./Graphics3DPathSymbolLayerConstants.js";import{primitiveLodResources as u}from"./primitiveObjectSymbolUtils.js";import{EstimatedSymbolComplexity as o,EstimatedAggregateSymbolComplexity as b,AggregateSymbolComplexity as y,SymbolComplexity as i,SymbolComplexityMemory as c}from"./SymbolComplexity.js";import{hasEdges as n}from"../support/edgeUtils.js";import{DefaultMaterial as l}from"../../webgl-engine/materials/DefaultMaterial.js";const P=new o({});function m(e){if("web-style"===e.type)return P;return F(e.symbolLayers.toArray().map((r=>L(e,r))))}function F(e){let r=0,t=0,a=0,s=!1,u=0;const o=new c;for(const b of e)null!=b&&(r+=b.verticesPerFeature,t+=b.verticesPerCoordinate,a+=b.drawCallsPerFeature,o.bytesPerFeature+=b.memory.bytesPerFeature,o.bytesPerFeatureLabel+=b.memory.bytesPerFeatureLabel,o.resourceBytes+=b.memory.resourceBytes,o.draped.bytesPerFeature+=b.memory.bytesPerFeature,o.draped.bytesPerFeatureLabel+=b.memory.bytesPerFeatureLabel,s=s||b.estimated,++u);return s?new b(u,{verticesPerFeature:r,verticesPerCoordinate:t,drawCallsPerFeature:a,memory:o}):new y(u,{verticesPerFeature:r,verticesPerCoordinate:t,drawCallsPerFeature:a,memory:o})}function d(e){const r=F(e);return r.numComplexities>0&&(r.verticesPerFeature/=r.numComplexities,r.verticesPerCoordinate/=r.numComplexities,r.drawCallsPerFeature/=r.numComplexities,r.memory.bytesPerFeature/=r.numComplexities,r.memory.bytesPerFeatureLabel/=r.numComplexities,r.memory.resourceBytes/=r.numComplexities,r.memory.draped.bytesPerFeature/=r.numComplexities,r.memory.draped.bytesPerFeatureLabel/=r.numComplexities),r}const p={};function L(u,b){const y=C(u,b),c=n(b)?2:0;switch(b.type){case"extrude":return new i({verticesPerFeature:-12,verticesPerCoordinate:12,drawCallsPerFeature:c,memory:y});case"fill":if("mesh-3d"===u.type)return new i({drawCallsPerFeature:c,memory:y});if(null!=b.outline&&b.outline.size>0)return new i({verticesPerFeature:-12,verticesPerCoordinate:9,memory:y});case"water":return new i({verticesPerFeature:-6,verticesPerCoordinate:3,memory:y});case"line":return new i({verticesPerFeature:-6,verticesPerCoordinate:6,memory:y});case"object":return b.resource?.href?new o({verticesPerFeature:100,memory:y}):{...f(b.resource?.primitive??r),memory:y};case"path":{let r=0,u=0;switch(b.profile){case"circle":r=a;break;case"quad":r=4;break;default:return void e(b.profile)}switch(b.join){case"round":u=s;break;case"miter":case"bevel":u=1;break;default:return}const o=2*r,c=r*u*2,n=c+o;let l=-2*c-o;switch(b.cap){case"none":break;case"butt":case"square":l+=2*(r-1);break;case"round":l+=2*(r*(t-1)*2+r);break;default:return}return new i({verticesPerFeature:l,verticesPerCoordinate:n,memory:y})}case"text":{const e="label-3d"===u.type?0:2;return new i({verticesPerFeature:6,memory:y,drawCallsPerFeature:e})}case"icon":return new i({verticesPerFeature:6,memory:y});default:return}}function C(r,t){const a="point-3d"===r.type;switch(t.type){case"extrude":return t.edges&&t.edges.size>0?E.EXTRUDE_EDGES:E.EXTRUDE;case"fill":return null!=t.outline&&t.outline.size>0?E.FILL_OUTLINE:E.FILL;case"water":return E.FILL;case"line":return"round"===t.join?E.LINE_ROUND:E.LINE_MITER;case"path":switch(t.join){case"round":switch(t.profile){case"circle":return E.PATH_ROUND_CIRCLE;case"quad":return E.PATH_ROUND_QUAD;default:return void e(t.profile)}case"miter":case"bevel":switch(t.profile){case"circle":return E.PATH_MITER_CIRCLE;case"quad":return E.PATH_MITER_QUAD;default:return void e(t.profile)}default:return}case"object":return a?E.OBJECT_POINT:E.OBJECT_POLYGON;case"icon":case"text":return a?E.ICON_POINT:E.ICON_POLYGON;default:return}}function f(e){const r=p[e];if(r)return r;const t=w(u(e,new l({},{spherical:!0})).levels);return p[e]=new i({verticesPerFeature:t}),p[e]}function w(e){return e.reduce(((e,r,t)=>e+r.numVertices*(1/10**t)),0)/e.reduce(((e,r,t)=>e+1/10**t),0)}const E={ICON_POINT:{bytesPerFeature:2346.460896195398,bytesPerFeatureLabel:3484.7516349999996,resourceBytes:0,draped:{bytesPerFeature:2007.3528529826217,bytesPerFeatureLabel:3522.702025}},ICON_POLYGON:{bytesPerFeature:3677.214053765355,bytesPerFeatureLabel:3502.5355950000003,resourceBytes:0,draped:{bytesPerFeature:3030.3700096053935,bytesPerFeatureLabel:3550.247175}},OBJECT_POINT:{bytesPerFeature:569.2092700798497,bytesPerFeatureLabel:3183.0256999999992,resourceBytes:0,draped:{bytesPerFeature:569.2092700798497,bytesPerFeatureLabel:3183.0256999999992}},OBJECT_POLYGON:{bytesPerFeature:1252.202280530861,bytesPerFeatureLabel:3125.853350000001,resourceBytes:0,draped:{bytesPerFeature:1252.202280530861,bytesPerFeatureLabel:3125.853350000001}},LINE_MITER:{bytesPerFeature:3252.89170349711,bytesPerFeatureLabel:3554.3931949999997,resourceBytes:0,draped:{bytesPerFeature:2843.5793737736867,bytesPerFeatureLabel:3538.2547083333334}},LINE_ROUND:{bytesPerFeature:3384.080501909172,bytesPerFeatureLabel:3522.6055950000004,resourceBytes:0,draped:{bytesPerFeature:2833.1897218657587,bytesPerFeatureLabel:3532.0680950000005}},PATH_MITER_CIRCLE:{bytesPerFeature:38490.63544346431,bytesPerFeatureLabel:3660.7835999999998,resourceBytes:0,draped:{bytesPerFeature:38490.63544346431,bytesPerFeatureLabel:3660.7835999999998}},PATH_ROUND_CIRCLE:{bytesPerFeature:42934.88589895749,bytesPerFeatureLabel:3729.49955,resourceBytes:0,draped:{bytesPerFeature:42934.88589895749,bytesPerFeatureLabel:3729.49955}},PATH_MITER_QUAD:{bytesPerFeature:25392.923576583788,bytesPerFeatureLabel:3647.05925,resourceBytes:0,draped:{bytesPerFeature:25392.923576583788,bytesPerFeatureLabel:3647.05925}},PATH_ROUND_QUAD:{bytesPerFeature:40448.297252606244,bytesPerFeatureLabel:3646.8303499999997,resourceBytes:0,draped:{bytesPerFeature:40448.297252606244,bytesPerFeatureLabel:3646.8303499999997}},FILL:{bytesPerFeature:3419.9079008788176,bytesPerFeatureLabel:3564.2132483333335,resourceBytes:0,draped:{bytesPerFeature:2910.096178654882,bytesPerFeatureLabel:3554.8655816666665}},FILL_OUTLINE:{bytesPerFeature:5018.088812445781,bytesPerFeatureLabel:3524.8219616666665,resourceBytes:0,draped:{bytesPerFeature:4278.49006198517,bytesPerFeatureLabel:3532.068368333334}},EXTRUDE:{bytesPerFeature:7963.8889768932695,bytesPerFeatureLabel:3628.5106350000005,resourceBytes:0,draped:{bytesPerFeature:7963.8889768932695,bytesPerFeatureLabel:3628.5106350000005}},EXTRUDE_EDGES:{bytesPerFeature:3111.7648563053044,bytesPerFeatureLabel:2658.4350683333337,resourceBytes:0,draped:{bytesPerFeature:3111.7648563053044,bytesPerFeatureLabel:2658.4350683333337}}};export{d as averageSymbolComplexities,m as defaultSymbolComplexity,L as defaultSymbolLayerComplexity,C as defaultSymbolLayerMemoryComplexity,P as emptySymbolComplexity,w as estimateNumVerticesForLods,F as totalSymbolComplexities};
5
+ import{neverReached as e}from"../../../../core/compilerUtils.js";import{defaultPrimitive as r}from"../../../../symbols/support/ObjectSymbol3DLayerResource.js";import{pathNumRoundCapExtrusionSubdivisions as t,pathNumCircleProfileSubdivisions as a,pathNumRoundJoinSubdivisions as s}from"./Graphics3DPathSymbolLayerConstants.js";import{primitiveLodResources as u}from"./primitiveObjectSymbolUtils.js";import{EstimatedSymbolComplexity as o,EstimatedAggregateSymbolComplexity as b,AggregateSymbolComplexity as y,SymbolComplexity as i,SymbolComplexityMemory as c}from"./SymbolComplexity.js";import{hasEdges as n}from"../support/edgeUtils.js";import{DefaultMaterial as l}from"../../webgl-engine/materials/DefaultMaterial.js";const P=new o({});function m(e){if("web-style"===e.type)return P;return F(e.symbolLayers.toArray().map((r=>L(e,r))))}function F(e){let r=0,t=0,a=0,s=!1,u=0;const o=new c;for(const b of e)null!=b&&(r+=b.verticesPerFeature,t+=b.verticesPerCoordinate,a+=b.drawCallsPerFeature,o.bytesPerFeature+=b.memory.bytesPerFeature,o.bytesPerFeatureLabel+=b.memory.bytesPerFeatureLabel,o.resourceBytes+=b.memory.resourceBytes,o.draped.bytesPerFeature+=b.memory.bytesPerFeature,o.draped.bytesPerFeatureLabel+=b.memory.bytesPerFeatureLabel,s=s||b.estimated,++u);return s?new b(u,{verticesPerFeature:r,verticesPerCoordinate:t,drawCallsPerFeature:a,memory:o}):new y(u,{verticesPerFeature:r,verticesPerCoordinate:t,drawCallsPerFeature:a,memory:o})}function d(e){const r=F(e);return r.numComplexities>0&&(r.verticesPerFeature/=r.numComplexities,r.verticesPerCoordinate/=r.numComplexities,r.drawCallsPerFeature/=r.numComplexities,r.memory.bytesPerFeature/=r.numComplexities,r.memory.bytesPerFeatureLabel/=r.numComplexities,r.memory.resourceBytes/=r.numComplexities,r.memory.draped.bytesPerFeature/=r.numComplexities,r.memory.draped.bytesPerFeatureLabel/=r.numComplexities),r}const p={};function L(u,b){const y=C(u,b),c=n(b)?2:0;switch(b.type){case"extrude":return new i({verticesPerFeature:-12,verticesPerCoordinate:12,drawCallsPerFeature:c,memory:y});case"fill":if("mesh-3d"===u.type)return new i({drawCallsPerFeature:c,memory:y});if(null!=b.outline&&b.outline.size>0)return new i({verticesPerFeature:-12,verticesPerCoordinate:9,memory:y});case"water":return new i({verticesPerFeature:-6,verticesPerCoordinate:3,memory:y});case"line":return new i({verticesPerFeature:-6,verticesPerCoordinate:6,memory:y});case"object":return b.resource?.href?new o({verticesPerFeature:100,memory:y}):{...f(b.resource?.primitive??r),memory:y};case"path":{let r=0,u=0;switch(b.profile){case"circle":r=a;break;case"quad":r=4;break;default:return void e(b.profile)}switch(b.join){case"round":u=s;break;case"miter":case"bevel":u=1;break;default:return}const o=2*r,c=r*u*2,n=c+o;let l=-2*c-o;switch(b.cap){case"none":break;case"butt":case"square":l+=2*(r-1);break;case"round":l+=2*(r*(t-1)*2+r);break;default:return}return new i({verticesPerFeature:l,verticesPerCoordinate:n,memory:y})}case"text":{const e="label-3d"===u.type?0:2;return new i({verticesPerFeature:6,memory:y,drawCallsPerFeature:e})}case"icon":return new i({verticesPerFeature:6,memory:y});default:return}}function C(r,t){const a="point-3d"===r.type;switch(t.type){case"extrude":return t.edges&&t.edges.size>0?E.EXTRUDE_EDGES:E.EXTRUDE;case"fill":return null!=t.outline&&t.outline.size>0?E.FILL_OUTLINE:E.FILL;case"water":return E.FILL;case"line":return"round"===t.join?E.LINE_ROUND:E.LINE_MITER;case"path":switch(t.join){case"round":switch(t.profile){case"circle":return E.PATH_ROUND_CIRCLE;case"quad":return E.PATH_ROUND_QUAD;default:return void e(t.profile)}case"miter":case"bevel":switch(t.profile){case"circle":return E.PATH_MITER_CIRCLE;case"quad":return E.PATH_MITER_QUAD;default:return void e(t.profile)}default:return}case"object":return a?E.OBJECT_POINT:E.OBJECT_POLYGON;case"icon":case"text":return a?E.ICON_POINT:E.ICON_POLYGON;default:return}}function f(e){const r=p[e];if(r)return r;const t=w(u(e,new l({},{spherical:!0})).levels);return p[e]=new i({verticesPerFeature:t}),p[e]}function w(e){return e.reduce(((e,r,t)=>e+r.numVertices*(1/10**t)),0)/e.reduce(((e,r,t)=>e+1/10**t),0)}const E={ICON_POINT:{bytesPerFeature:3062.2534325974652,bytesPerFeatureLabel:3605.891255,resourceBytes:0,draped:{bytesPerFeature:2029.6324697040875,bytesPerFeatureLabel:3844.951315}},ICON_POLYGON:{bytesPerFeature:3379.2552364427283,bytesPerFeatureLabel:3144.1341316666667,resourceBytes:0,draped:{bytesPerFeature:2594.5439970589305,bytesPerFeatureLabel:3391.0192816666668}},OBJECT_POINT:{bytesPerFeature:755.5754513856272,bytesPerFeatureLabel:3229.7766,resourceBytes:0,draped:{bytesPerFeature:755.5754513856272,bytesPerFeatureLabel:3229.7766}},OBJECT_POLYGON:{bytesPerFeature:1235.9612556276838,bytesPerFeatureLabel:2710.5796950000004,resourceBytes:0,draped:{bytesPerFeature:1235.9612556276838,bytesPerFeatureLabel:2710.5796950000004}},LINE_MITER:{bytesPerFeature:2343.0098144295366,bytesPerFeatureLabel:2863.2415183333333,resourceBytes:0,draped:{bytesPerFeature:2118.062960542706,bytesPerFeatureLabel:2993.8707950000003}},LINE_ROUND:{bytesPerFeature:3180.281669156425,bytesPerFeatureLabel:2884.062711666667,resourceBytes:0,draped:{bytesPerFeature:2687.1048133674676,bytesPerFeatureLabel:2965.844025}},PATH_MITER_CIRCLE:{bytesPerFeature:26642.015762630304,bytesPerFeatureLabel:3147.8341749999995,resourceBytes:0,draped:{bytesPerFeature:26642.015762630304,bytesPerFeatureLabel:3147.8341749999995}},PATH_ROUND_CIRCLE:{bytesPerFeature:21137.659435445064,bytesPerFeatureLabel:2827.1294000000003,resourceBytes:0,draped:{bytesPerFeature:21137.659435445064,bytesPerFeatureLabel:2827.1294000000003}},PATH_MITER_QUAD:{bytesPerFeature:25592.283303929427,bytesPerFeatureLabel:3354.641775,resourceBytes:0,draped:{bytesPerFeature:25592.283303929427,bytesPerFeatureLabel:3354.641775}},PATH_ROUND_QUAD:{bytesPerFeature:23212.92773696872,bytesPerFeatureLabel:3173.6644499999998,resourceBytes:0,draped:{bytesPerFeature:23212.92773696872,bytesPerFeatureLabel:3173.6644499999998}},FILL:{bytesPerFeature:3069.6014181747005,bytesPerFeatureLabel:3050.617135,resourceBytes:0,draped:{bytesPerFeature:2547.9765396831167,bytesPerFeatureLabel:3166.2821483333337}},FILL_OUTLINE:{bytesPerFeature:3653.779598313774,bytesPerFeatureLabel:2787.5897050000003,resourceBytes:0,draped:{bytesPerFeature:2884.528596112384,bytesPerFeatureLabel:2907.420548333333}},EXTRUDE:{bytesPerFeature:5785.658350054202,bytesPerFeatureLabel:2787.498365,resourceBytes:0,draped:{bytesPerFeature:5785.658350054202,bytesPerFeatureLabel:2787.498365}},EXTRUDE_EDGES:{bytesPerFeature:3380.451670091342,bytesPerFeatureLabel:2245.881308333333,resourceBytes:0,draped:{bytesPerFeature:3380.451670091342,bytesPerFeatureLabel:2245.881308333333}}};export{d as averageSymbolComplexities,m as defaultSymbolComplexity,L as defaultSymbolLayerComplexity,C as defaultSymbolLayerMemoryComplexity,P as emptySymbolComplexity,w as estimateNumVerticesForLods,F as totalSymbolComplexities};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import r from"../../../../../core/Error.js";import{makeHandle as t}from"../../../../../core/handleUtils.js";import{destroyMaybe as o}from"../../../../../core/maybe.js";import i from"../../../../../core/Promise.js";import{on as n}from"../../../../../core/reactiveUtils.js";import{property as s}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as a}from"../../../../../core/accessorSupport/decorators/subclass.js";import{FeatureLayerViewPerformanceInfo as u}from"../../FeatureLayerViewPerformanceInfo.js";import{Feature3DPipelineWorkerHandle as l}from"./Feature3DPipelineWorkerHandle.js";import{FeaturePipelineRenderManager as d}from"./rendering/FeaturePipelineRenderManager.js";import{emptyHighlightHandle as p}from"../../support/highlightUtils.js";import{LayerViewPerformanceInfo as m}from"../../support/LayerViewPerformanceInfo.js";import{UpdatePolicy as c}from"../../../webgl-engine/lib/UpdatePolicy.js";let y=class extends i{constructor(e){super(e),this._renderer=null,this.graphicsQuery={queryForSymbologySnapping:(e,t)=>{throw new r("featurelayer","unsupported-symbology-snapping")},executeQuery:async(e,r)=>await this._workerHandle.executeQuery(e,r),executeQueryForIds:async(e,r)=>await this._workerHandle.executeQueryForIds(e,r),executeQueryForCount:async(e,r)=>await this._workerHandle.executeQueryForCount(e,r),executeQueryForExtent:async(e,r)=>await this._workerHandle.executeQueryForExtent(e,r),executeQueryForLatestObservations:async(e,r)=>await this._workerHandle.executeQueryForLatestObservations(e,r)},this.maximumNumberOfFeatures=1e3}initialize(){if("point"!==this.layerView.layer.geometryType)throw new r("unsupported-geometry-type",`${this.layerView.layer.geometryType} is not supported`);this.addResolvingPromise(this.setup())}destroy(){this.removeAllHandles(),this._workerHandle.destroy(),o(this._renderer)}async setup(){const{layer:e,view:r,uid:t}=this.layerView,{spatialReference:o,renderSpatialReference:i,resourceController:s,renderCoordsHelper:a,elevationProvider:u}=r,p=r.state.viewingMode;if(this._renderer=new d({view:r,layerViewUid:t}),"feature"!==e.type)throw new Error("Only FeatureLayer is supported");const m=new l({schedule:e=>s.immediate.schedule(e),layer:e,viewSpatialReference:o,renderSpatialReference:i,viewingMode:p,renderer:this._renderer,elevationProvider:u,renderCoordsHelper:a});this._workerHandle=await m.when(),this.addHandles([this.layerView.view.featureTiles.addClient(),n((()=>this.layerView.view.featureTiles.tiles),"change",(e=>{this._workerHandle.onTileTreeChange(e)}),{onListenerAdd:e=>this._workerHandle.onTileTreeChange({added:e.toArray(),removed:[]}),onListenerRemove:e=>this._workerHandle.onTileTreeChange({added:[],removed:e.toArray()})}),r.elevationProvider.on("elevation-change",(e=>this._workerHandle.onElevationChange(e)))])}get legendEnabled(){return!1}get hasAllFeatures(){return!1}get hasAllFeaturesInView(){return!1}get hasFullGeometries(){return!1}get symbologySnappingSupported(){return!1}get scaleVisibilitySuspended(){return!1}get suspendInfo(){return{}}get updating(){return this._workerHandle.updating}get dataUpdating(){return!1}get updatePolicy(){return c.ASYNC}get maximumNumberOfFeaturesExceeded(){return!1}get updatingProgressValue(){return 1}get usedMemory(){return this._renderer?.usedMemory??0}get unloadedMemory(){return 0}get ignoresMemoryFactor(){return!0}get totalFeatures(){return this._renderer?.totalFeatures??0}get performanceInfo(){const e=this.totalFeatures;return new u(new m(this.usedMemory,e,e,this.maximumNumberOfFeatures,0,null),e,e,this.maximumNumberOfFeaturesExceeded,"tiles","n/a")}get suspendResumeExtentMode(){return"computed"}forEachGraphic(e){}findGraphic(e){return null}highlight(e){return p}maskOccludee(e){return t()}async whenGraphicBounds(e,r){return null}computeAttachmentOrigin(e,r){return null}elevationAlignPointsInFeatures(e,t){throw new r("featurelayer","unsupported-elevation-alignment")}async doRefresh(e){}setVisibility(e,r){}getMissingAttributesForFeature(e){return null}getHydratedGeometry(e){return null}};e([s()],y.prototype,"layerView",void 0),e([s()],y.prototype,"updating",null),e([s()],y.prototype,"totalFeatures",null),y=e([a("esri.views.3d.layers.graphics.pipeline.Feature3DPipeline")],y);export{y as Feature3DPipeline};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import r from"../../../../../core/Error.js";import{makeHandle as t}from"../../../../../core/handleUtils.js";import{destroyMaybe as o}from"../../../../../core/maybe.js";import n from"../../../../../core/Promise.js";import{on as i}from"../../../../../core/reactiveUtils.js";import{property as a}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators/subclass.js";import{FeatureLayerViewPerformanceInfo as u}from"../../FeatureLayerViewPerformanceInfo.js";import{Feature3DPipelineWorkerHandle as l}from"./Feature3DPipelineWorkerHandle.js";import{FeaturePipelineRenderManager as d}from"./rendering/FeaturePipelineRenderManager.js";import{emptyHighlightHandle as p}from"../../support/highlightUtils.js";import{LayerViewPerformanceInfo as m}from"../../support/LayerViewPerformanceInfo.js";import{UpdatePolicy as y}from"../../../webgl-engine/lib/UpdatePolicy.js";let c=class extends n{constructor(e){super(e),this._renderer=null,this.graphicsQuery={queryForSymbologySnapping:(e,t)=>{throw new r("featurelayer:unsupported-symbology-snapping","Symbology snapping not supported")},executeQuery:async(e,r)=>await this._workerHandle.executeQuery(e,r),executeQueryForIds:async(e,r)=>await this._workerHandle.executeQueryForIds(e,r),executeQueryForCount:async(e,r)=>await this._workerHandle.executeQueryForCount(e,r),executeQueryForExtent:async(e,r)=>await this._workerHandle.executeQueryForExtent(e,r),executeQueryForLatestObservations:async(e,r)=>await this._workerHandle.executeQueryForLatestObservations(e,r)},this.maximumNumberOfFeatures=1e3}initialize(){if("point"!==this.layerView.layer.geometryType)throw new r("featurelayer:unsupported-geometry-type",`${this.layerView.layer.geometryType} is not supported`);this.addResolvingPromise(this.setup())}destroy(){this.removeAllHandles(),this._workerHandle.destroy(),o(this._renderer)}async setup(){const{layer:e,view:t,uid:o}=this.layerView,{spatialReference:n,renderSpatialReference:a,resourceController:s,renderCoordsHelper:u,elevationProvider:p}=t,m=t.state.viewingMode;if(this._renderer=new d({view:t,layerViewUid:o}),"feature"!==e.type)throw new r("featurelayer:unsupported-layertype","Only FeatureLayer is supported");const y=new l({schedule:e=>s.immediate.schedule(e),layer:e,viewSpatialReference:n,renderSpatialReference:a,viewingMode:m,renderer:this._renderer,elevationProvider:p,renderCoordsHelper:u});this._workerHandle=await y.when(),this.addHandles([this.layerView.view.featureTiles.addClient(),i((()=>this.layerView.view.featureTiles.tiles),"change",(e=>{this._workerHandle.onTileTreeChange(e)}),{onListenerAdd:e=>this._workerHandle.onTileTreeChange({added:e.toArray(),removed:[]}),onListenerRemove:e=>this._workerHandle.onTileTreeChange({added:[],removed:e.toArray()})}),t.elevationProvider.on("elevation-change",(e=>this._workerHandle.onElevationChange(e)))])}get legendEnabled(){return!1}get hasAllFeatures(){return!1}get hasAllFeaturesInView(){return!1}get hasFullGeometries(){return!1}get symbologySnappingSupported(){return!1}get scaleVisibilitySuspended(){return!1}get suspendInfo(){return{}}get updating(){return this._workerHandle.updating}get dataUpdating(){return!1}get updatePolicy(){return y.ASYNC}get maximumNumberOfFeaturesExceeded(){return!1}get updatingProgressValue(){return 1}get usedMemory(){return this._renderer?.usedMemory??0}get unloadedMemory(){return 0}get ignoresMemoryFactor(){return!0}get totalFeatures(){return this._renderer?.totalFeatures??0}get performanceInfo(){const e=this.totalFeatures;return new u(new m(this.usedMemory,e,e,this.maximumNumberOfFeatures,0,null),e,e,this.maximumNumberOfFeaturesExceeded,"tiles","n/a")}get suspendResumeExtentMode(){return"computed"}forEachGraphic(e){}findGraphic(e){return null}highlight(e){return p}maskOccludee(e){return t()}async whenGraphicBounds(e,r){return null}computeAttachmentOrigin(e,r){return null}elevationAlignPointsInFeatures(e,t){throw new r("featurelayer:unsupported-elevation-alignment","Elevation alignment not supported")}async doRefresh(e){}setVisibility(e,r){}getMissingAttributesForFeature(e){return null}getHydratedGeometry(e){return null}};e([a()],c.prototype,"layerView",void 0),e([a()],c.prototype,"updating",null),e([a()],c.prototype,"totalFeatures",null),c=e([s("esri.views.3d.layers.graphics.pipeline.Feature3DPipeline")],c);export{c as Feature3DPipeline};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{RenderbufferFormat as e}from"../../../webgl/enums.js";import{FramebufferObject as t}from"../../../webgl/FramebufferObject.js";import{RenderbufferDescriptor as r}from"../../../webgl/RenderbufferDescriptor.js";import{TextureDescriptor as s}from"../../../webgl/TextureDescriptor.js";class o{constructor(e){this._rctx=e,this._fbos=new Map}get(e){return this._getPool(e)}dispose(){this._fbos.forEach((e=>e.dispose())),this._fbos.clear()}_getPool(o){const i=this._fbos.get(o);if(i)return i;const f=new t(this._rctx,new s(o),new r(e.DEPTH24_STENCIL8,o));return this._fbos.set(o,f),f}}export{o as MultiSizeFramebuffer};
5
+ import{SizedDepthStencilFormat as e}from"../../../webgl/enums.js";import{FramebufferObject as t}from"../../../webgl/FramebufferObject.js";import{RenderbufferDescriptor as r}from"../../../webgl/RenderbufferDescriptor.js";import{TextureDescriptor as s}from"../../../webgl/TextureDescriptor.js";class o{constructor(e){this._rctx=e,this._fbos=new Map}get(e){return this._getPool(e)}dispose(){this._fbos.forEach((e=>e.dispose())),this._fbos.clear()}_getPool(o){const i=this._fbos.get(o);if(i)return i;const f=new t(this._rctx,new s(o),new r(e.DEPTH24_STENCIL8,o));return this._fbos.set(o,f),f}}export{o as MultiSizeFramebuffer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{RenderbufferFormat as R}from"../../webgl/enums.js";var G;!function(R){R[R.R8=33321]="R8",R[R.R8UI=33330]="R8UI",R[R.RG8=33323]="RG8",R[R.RG8UI=33336]="RG8UI",R[R.RGBA4=32854]="RGBA4",R[R.RGBA8=32856]="RGBA8",R[R.RGBA8_MIPMAP=42843]="RGBA8_MIPMAP",R[R.R16F=33325]="R16F",R[R.RGBA16F=34842]="RGBA16F"}(G||(G={}));const A=R.DEPTH_COMPONENT16;export{G as ColorFormat,A as DepthRenderbuffer16f};
5
+ import{SizedDepthFormat as R}from"../../webgl/enums.js";var G;!function(R){R[R.R8=33321]="R8",R[R.R8UI=33330]="R8UI",R[R.RG8=33323]="RG8",R[R.RG8UI=33336]="RG8UI",R[R.RGBA4=32854]="RGBA4",R[R.RGBA8=32856]="RGBA8",R[R.RGBA8_MIPMAP=42843]="RGBA8_MIPMAP",R[R.R16F=33325]="R16F",R[R.RGBA16F=34842]="RGBA16F"}(G||(G={}));const A=R.DEPTH_COMPONENT16;export{G as ColorFormat,A as DepthRenderbuffer16f};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Error.js";import{ColorFormat as t,DepthRenderbuffer16f as r}from"../../webgl/formats.js";import{ManagedColorAttachment as a}from"../../webgl/ManagedColorAttachment.js";import{ManagedDepthAttachment as o}from"../../webgl/ManagedDepthAttachment.js";import n from"../../webgl/ManagedFBO.js";import{AttachmentType as i}from"../../webgl/ManagedFBOResource.js";import{FBOPool as c}from"./FBOPool.js";import{PixelFormat as h,SizedPixelFormat as s,TextureWrapMode as m,TextureSamplingMode as l,PixelType as d,DepthStencilAttachment as _,RenderbufferFormat as p,ColorAttachment0 as u}from"../../../webgl/enums.js";import{FramebufferObject as f}from"../../../webgl/FramebufferObject.js";import{Renderbuffer as w}from"../../../webgl/Renderbuffer.js";import{RenderbufferDescriptor as E}from"../../../webgl/RenderbufferDescriptor.js";import{Texture as C}from"../../../webgl/Texture.js";import{TextureDescriptor as b}from"../../../webgl/TextureDescriptor.js";class A{constructor(e){this.rctx=e,this._acquired=new Set,this._cache=new c(e.newCache,"FBOCache"),this._depthCache=new c(e.newCache,"DepthAttachmentCache"),this._colorCache=new c(e.newCache,"ColorAttachmentCache")}destroy(){this._cache.destroy(),this._depthCache.destroy(),this._colorCache.destroy()}clean(){this._cache.clean(),this._colorCache.clean(),this._depthCache.clean()}frameStart(){this._cache.frame(),this._colorCache.frame(),this._depthCache.frame(),this.debugCallback?.()}frameEnd(){const e=this.debugCallback;e&&this._acquired.forEach((t=>t.type===i.FBO&&e(t.name,t.fbo,t.numberOfColorAttachments)))}get usedMemory(){return Array.from(this._acquired.values()).reduce(((e,t)=>e+("getTexture"in t?t.getTexture()?.usedMemory??0:t.cachedMemory)),this._cache.usedMemory+this._colorCache.usedMemory+this._depthCache.usedMemory)}set interactive(e){this._cache.interactive=this._colorCache.interactive=this._depthCache.interactive=e}acquire(r,a,o,i=t.RGBA8){const c=T(i,r,a);let h=this._cache.pop(c);if(h){h.retain(),h.setName(o);const t=this.rctx.getBoundFramebufferObject();if(this.rctx.bindFramebuffer(h.fbo),this.rctx.setDrawBuffers([u]),!h.fbo)throw new e("renderer","attempt to use a not existing framebuffer");this.rctx.unbindTexture(h.fbo.colorTexture),this.rctx.bindFramebuffer(t)}else h=new n(c,o,new f(this.rctx,{...P[i],width:r,height:a}),(e=>{e??=_;const t=this._acquireDepth(e,h.fbo.width,h.fbo.height,`${h.name} depth`);return h.attachDepth(t),t.release(),h}),((e,o,n)=>{o??=t.RGBA8;const i=this._acquireColor(o,r,a,n??`${h.name} color ${e}`);return this.rctx.unbindTexture(i.attachment),h.attachColor(i,e),i.release(),h}),(()=>{this.debugCallback?.(h.name,h.fbo,h.numberOfColorAttachments),h.fbo?.invalidateAttachments([u],!0),this._acquired.delete(h),h.detachAll(),this._cache.put(h)}));return this._trackHandle(h)}acquireDepth(e,t,r,a){return this._acquireDepth(e,t,r,a)}_acquireDepth(e,t,r,a){const n=T(e,t,r),i=this._depthCache.pop(n);if(i)return i.retain(),i.name=a,this._trackHandle(i);const c=new o(n,e===_?new C(this.rctx,{...j[e],width:t,height:r}):new w(this.rctx,{...j[e],width:t,height:r}),(()=>{this._acquired.delete(c),this._depthCache.put(c)}));return c.name=a,this._trackHandle(c)}_acquireColor(e,t,r,o){const n=T(e,t,r),i=this._colorCache.pop(n);if(i)return i.retain(),i.name=o,this._trackHandle(i);const c=new a(n,new C(this.rctx,{...P[e],width:t,height:r}),(()=>{this._acquired.delete(c),this._colorCache.put(c)}));return c.name=o,this._trackHandle(c)}_trackHandle(e){return this._acquired.add(e),e}}const M=new n("default","default",null,(()=>M),(()=>M),(()=>{}));function T(e,t,r){return`${e}x${t}x${r}`}M.release=()=>!1;const R=new b;R.pixelFormat=h.RED,R.internalFormat=s.R8,R.wrapMode=m.CLAMP_TO_EDGE;const g=new b;g.pixelFormat=h.RED_INTEGER,g.internalFormat=s.R8UI,g.wrapMode=m.CLAMP_TO_EDGE,g.samplingMode=l.NEAREST;const F=new b;F.pixelFormat=h.RG,F.internalFormat=s.RG8,F.wrapMode=m.CLAMP_TO_EDGE;const x=new b;x.pixelFormat=h.RG_INTEGER,x.internalFormat=s.RG8UI,x.wrapMode=m.CLAMP_TO_EDGE,x.samplingMode=l.NEAREST;const D=new b;D.internalFormat=s.RGBA4,D.dataType=d.UNSIGNED_SHORT_4_4_4_4,D.wrapMode=m.CLAMP_TO_EDGE;const G=new b;G.wrapMode=m.CLAMP_TO_EDGE;const O=new b;O.wrapMode=m.CLAMP_TO_EDGE,O.samplingMode=l.LINEAR_MIPMAP_LINEAR,O.hasMipmap=!0,O.maxAnisotropy=8;const N=new b;N.pixelFormat=h.RED,N.dataType=d.HALF_FLOAT,N.internalFormat=s.R16F,N.samplingMode=l.NEAREST;const y=new b;y.dataType=d.HALF_FLOAT,y.internalFormat=s.RGBA16F,y.samplingMode=l.NEAREST;const P={[t.R8]:R,[t.R8UI]:g,[t.RG8]:F,[t.RG8UI]:x,[t.RGBA4]:D,[t.RGBA8]:G,[t.RGBA8_MIPMAP]:O,[t.R16F]:N,[t.RGBA16F]:y},L=new b;L.pixelFormat=h.DEPTH_STENCIL,L.dataType=d.UNSIGNED_INT_24_8,L.samplingMode=l.NEAREST,L.wrapMode=m.CLAMP_TO_EDGE,L.internalFormat=h.DEPTH24_STENCIL8;const j={[_]:L,[r]:new E(p.DEPTH_COMPONENT16,4)};export{A as FBOCache,M as defaultWebGLFBO};
5
+ import e from"../../../../core/Error.js";import{ColorFormat as t,DepthRenderbuffer16f as r}from"../../webgl/formats.js";import{ManagedColorAttachment as a}from"../../webgl/ManagedColorAttachment.js";import{ManagedDepthAttachment as o}from"../../webgl/ManagedDepthAttachment.js";import n from"../../webgl/ManagedFBO.js";import{AttachmentType as i}from"../../webgl/ManagedFBOResource.js";import{FBOPool as c}from"./FBOPool.js";import{PixelFormat as h,SizedPixelFormat as s,TextureWrapMode as m,TextureSamplingMode as l,PixelType as d,UnsizedDepthFormat as _,SizedDepthStencilFormat as p,DepthStencilAttachment as u,SizedDepthFormat as f,ColorAttachment0 as w}from"../../../webgl/enums.js";import{FramebufferObject as E}from"../../../webgl/FramebufferObject.js";import{Renderbuffer as C}from"../../../webgl/Renderbuffer.js";import{RenderbufferDescriptor as b}from"../../../webgl/RenderbufferDescriptor.js";import{Texture as A}from"../../../webgl/Texture.js";import{TextureDescriptor as M}from"../../../webgl/TextureDescriptor.js";class T{constructor(e){this.rctx=e,this._acquired=new Set,this._cache=new c(e.newCache,"FBOCache"),this._depthCache=new c(e.newCache,"DepthAttachmentCache"),this._colorCache=new c(e.newCache,"ColorAttachmentCache")}destroy(){this._cache.destroy(),this._depthCache.destroy(),this._colorCache.destroy()}clean(){this._cache.clean(),this._colorCache.clean(),this._depthCache.clean()}frameStart(){this._cache.frame(),this._colorCache.frame(),this._depthCache.frame(),this.debugCallback?.()}frameEnd(){const e=this.debugCallback;e&&this._acquired.forEach((t=>t.type===i.FBO&&e(t.name,t.fbo,t.numberOfColorAttachments)))}get usedMemory(){return Array.from(this._acquired.values()).reduce(((e,t)=>e+("getTexture"in t?t.getTexture()?.usedMemory??0:t.cachedMemory)),this._cache.usedMemory+this._colorCache.usedMemory+this._depthCache.usedMemory)}set interactive(e){this._cache.interactive=this._colorCache.interactive=this._depthCache.interactive=e}acquire(r,a,o,i=t.RGBA8){const c=g(i,r,a);let h=this._cache.pop(c);if(h){h.retain(),h.setName(o);const t=this.rctx.getBoundFramebufferObject();if(this.rctx.bindFramebuffer(h.fbo),this.rctx.setDrawBuffers([w]),!h.fbo)throw new e("internal:renderer","attempt to use an empty framebuffer");this.rctx.unbindTexture(h.fbo.colorTexture),this.rctx.bindFramebuffer(t)}else h=new n(c,o,new E(this.rctx,{...j[i],width:r,height:a}),(e=>{e??=u;const t=this._acquireDepth(e,h.fbo.width,h.fbo.height,`${h.name} depth`);return h.attachDepth(t),t.release(),h}),((e,o,n)=>{o??=t.RGBA8;const i=this._acquireColor(o,r,a,n??`${h.name} color ${e}`);return this.rctx.unbindTexture(i.attachment),h.attachColor(i,e),i.release(),h}),(()=>{this.debugCallback?.(h.name,h.fbo,h.numberOfColorAttachments),h.fbo?.invalidateAttachments([w],!0),this._acquired.delete(h),h.detachAll(),this._cache.put(h)}));return this._trackHandle(h)}acquireDepth(e,t,r,a){return this._acquireDepth(e,t,r,a)}_acquireDepth(e,t,r,a){const n=g(e,t,r),i=this._depthCache.pop(n);if(i)return i.retain(),i.name=a,this._trackHandle(i);const c=new o(n,e===u?new A(this.rctx,{...I[e],width:t,height:r}):new C(this.rctx,{...I[e],width:t,height:r}),(()=>{this._acquired.delete(c),this._depthCache.put(c)}));return c.name=a,this._trackHandle(c)}_acquireColor(e,t,r,o){const n=g(e,t,r),i=this._colorCache.pop(n);if(i)return i.retain(),i.name=o,this._trackHandle(i);const c=new a(n,new A(this.rctx,{...j[e],width:t,height:r}),(()=>{this._acquired.delete(c),this._colorCache.put(c)}));return c.name=o,this._trackHandle(c)}_trackHandle(e){return this._acquired.add(e),e}}const R=new n("default","default",null,(()=>R),(()=>R),(()=>{}));function g(e,t,r){return`${e}x${t}x${r}`}R.release=()=>!1;const F=new M;F.pixelFormat=h.RED,F.internalFormat=s.R8,F.wrapMode=m.CLAMP_TO_EDGE;const x=new M;x.pixelFormat=h.RED_INTEGER,x.internalFormat=s.R8UI,x.wrapMode=m.CLAMP_TO_EDGE,x.samplingMode=l.NEAREST;const D=new M;D.pixelFormat=h.RG,D.internalFormat=s.RG8,D.wrapMode=m.CLAMP_TO_EDGE;const G=new M;G.pixelFormat=h.RG_INTEGER,G.internalFormat=s.RG8UI,G.wrapMode=m.CLAMP_TO_EDGE,G.samplingMode=l.NEAREST;const O=new M;O.internalFormat=s.RGBA4,O.dataType=d.UNSIGNED_SHORT_4_4_4_4,O.wrapMode=m.CLAMP_TO_EDGE;const N=new M;N.wrapMode=m.CLAMP_TO_EDGE;const y=new M;y.wrapMode=m.CLAMP_TO_EDGE,y.samplingMode=l.LINEAR_MIPMAP_LINEAR,y.hasMipmap=!0,y.maxAnisotropy=8;const P=new M;P.pixelFormat=h.RED,P.dataType=d.HALF_FLOAT,P.internalFormat=s.R16F,P.samplingMode=l.NEAREST;const L=new M;L.dataType=d.HALF_FLOAT,L.internalFormat=s.RGBA16F,L.samplingMode=l.NEAREST;const j={[t.R8]:F,[t.R8UI]:x,[t.RG8]:D,[t.RG8UI]:G,[t.RGBA4]:O,[t.RGBA8]:N,[t.RGBA8_MIPMAP]:y,[t.R16F]:P,[t.RGBA16F]:L},B=new M;B.pixelFormat=_.DEPTH_STENCIL,B.dataType=d.UNSIGNED_INT_24_8,B.samplingMode=l.NEAREST,B.wrapMode=m.CLAMP_TO_EDGE,B.internalFormat=p.DEPTH24_STENCIL8;const I={[u]:B,[r]:new b(f.DEPTH_COMPONENT16,4)};export{T as FBOCache,R as defaultWebGLFBO};