@arcgis/core 4.33.0-next.20250225 → 4.33.0-next.20250227

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 (97) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/4253438dd3045566892d.js +1 -0
  3. package/assets/esri/core/workers/chunks/823bf95f42cc42f20e22.js +1 -0
  4. package/assets/esri/core/workers/chunks/ae25c6108918d37e61bf.js +1 -0
  5. package/assets/esri/core/workers/chunks/{feb656f172ec9fe64752.js → af005704f23088db3ded.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{dea40706ca4e37d5c6e2.js → d4d011eea16a89a5aad9.js} +1 -1
  7. package/core/sql/StandardizedFunctions.js +1 -1
  8. package/core/sql/WhereClause.js +1 -1
  9. package/core/sql/sqlCompareUtils.js +1 -1
  10. package/geometry/SpatialReference.js +1 -1
  11. package/layers/SubtypeGroupLayer.js +1 -1
  12. package/package.json +1 -1
  13. package/support/popupUtils.js +1 -1
  14. package/support/revision.js +1 -1
  15. package/symbols/cim/animationUtils.js +1 -1
  16. package/views/2d/engine/webgl/animations/utils.js +1 -1
  17. package/views/2d/engine/webgl/shaderGraph/GraphShaderModule.js +1 -1
  18. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerShader.js +1 -1
  19. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityPointShader.js +1 -1
  20. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityPolygonShader.js +1 -1
  21. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerShader.js +1 -1
  22. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BitmapShader.js +1 -1
  23. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BlendShader.js +1 -1
  24. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ComplexFillShader.js +1 -1
  25. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ComplexOutlineFillShader.js +1 -1
  26. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/FillShader.js +1 -1
  27. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/GradientFillShader.js +1 -1
  28. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/GradientStrokeShader.js +1 -1
  29. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/GridShader.js +1 -1
  30. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/HeatmapAccumulateShader.js +1 -1
  31. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/HeatmapResolveShader.js +1 -1
  32. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
  33. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js +1 -1
  34. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/OpacityShader.js +1 -1
  35. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/OutlineFillShader.js +1 -1
  36. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/OverlayShader.js +1 -1
  37. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/PatternFillShader.js +1 -1
  38. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/PatternOutlineFillShader.js +1 -1
  39. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TestShader.js +1 -1
  40. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TexturedLineShader.js +1 -1
  41. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/RasterColorizerLUTShader.js +1 -1
  42. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/RasterColorizerShadedReliefShader.js +1 -1
  43. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/RasterColorizerStretchShader.js +1 -1
  44. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/AspectShader.js +1 -1
  45. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/BandArithmeticShader.js +1 -1
  46. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ColormapToRGBShader.js +1 -1
  47. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/CompositeBandShader.js +1 -1
  48. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ComputeChangeShader.js +1 -1
  49. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ContrastBrightnessShader.js +1 -1
  50. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ConvolutionShader.js +1 -1
  51. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/CurvatureShader.js +1 -1
  52. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ExtractBandShader.js +1 -1
  53. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/FocalStatisticsShader.js +1 -1
  54. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/GrayscaleShader.js +1 -1
  55. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/HillshadeShader.js +1 -1
  56. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/LocalShader.js +1 -1
  57. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/MaskShader.js +1 -1
  58. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/NDVIShader.js +1 -1
  59. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/RemapShader.js +1 -1
  60. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ReprojectShader.js +1 -1
  61. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ShadedReliefShader.js +1 -1
  62. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/SlopeShader.js +1 -1
  63. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/StretchShader.js +1 -1
  64. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
  65. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  66. package/views/3d/layers/support/FeatureTile.js +1 -1
  67. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  68. package/views/3d/layers/support/FeatureTileFetcher3DContext.js +1 -1
  69. package/views/3d/layers/support/FeatureTileTree3D.js +1 -1
  70. package/views/3d/webgl-engine/lib/ComponentUtils.js +1 -1
  71. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  72. package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
  73. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  74. package/views/View.js +1 -1
  75. package/views/support/TileTreeDebugger.js +1 -1
  76. package/views/webgl/capabilities/Capabilities.js +1 -1
  77. package/views/webgl/capabilities/DebugRendererInfo.js +1 -1
  78. package/views/webgl/capabilities.js +1 -1
  79. package/widgets/Feature/FeatureRelationship.js +1 -1
  80. package/widgets/Feature/FeatureUtilityNetworkAssociationList.js +1 -1
  81. package/widgets/Feature/FeatureUtilityNetworkAssociations.js +1 -1
  82. package/widgets/Feature.js +1 -1
  83. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
  84. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  85. package/widgets/FeatureTable.js +1 -1
  86. package/widgets/Features/FeaturesDrillIn.js +1 -1
  87. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  88. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  89. package/widgets/OrientedImageryViewer/adapters/sketch/DataCaptureAdapter.js +1 -1
  90. package/widgets/OrientedImageryViewer/components/ImageOverlays.js +1 -1
  91. package/widgets/OrientedImageryViewer/dataCaptureUtils.js +1 -1
  92. package/widgets/OrientedImageryViewer/symbols.js +1 -1
  93. package/widgets/OrientedImageryViewer.js +1 -1
  94. package/widgets/support/UtilityNetworkAssociations/utilityNetworkUtils.js +1 -1
  95. package/assets/esri/core/workers/chunks/66338f008ff0992ffca2.js +0 -1
  96. package/assets/esri/core/workers/chunks/69c13ca7b572ad2ca3ce.js +0 -1
  97. package/assets/esri/core/workers/chunks/d5ebe6b7cd9c8e40b386.js +0 -1
@@ -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 s from"../../Color.js";import o from"../../Graphic.js";import t from"../../core/Accessor.js";import l from"../../core/Collection.js";import{lerp as r}from"../../core/mathUtils.js";import{property as i}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 n from"../../symbols/PointSymbol3D.js";import m from"../../symbols/SimpleFillSymbol.js";import h from"../../symbols/TextSymbol.js";import c from"../../symbols/TextSymbol3DLayer.js";import p from"../../symbols/callouts/LineCallout3D.js";import y from"../../symbols/callouts/LineCallout3DBorder.js";import b from"../../symbols/support/Symbol3DVerticalOffset.js";const u=[[0,179,255],[117,62,128],[0,104,255],[215,189,166],[32,0,193],[98,162,206],[102,112,129],[52,125,0],[142,118,246],[138,83,0],[92,122,255],[122,55,83],[0,142,255],[81,40,179],[0,200,244],[13,24,127],[0,170,147],[19,58,241],[22,44,35]];let d=class extends t{constructor(e){super(e),this.updating=!1,this.enablePolygons=!0,this.enableLabels=!0,this._polygons=new Map,this._labels=new Map,this._enabled=!0}initialize(){this._symbols=u.map((e=>new m({color:[e[0],e[1],e[2],.6],outline:{color:"black",width:1}}))),this.update()}destroy(){this._enabled=!1,this.clear()}get enabled(){return this._enabled}set enabled(e){this._enabled!==e&&(this._enabled=e,this.update())}update(){if(!this._enabled)return void this.clear();const e=e=>{if(null!=e.label)return e.label;let s=e.lij.toString();return null!=e.loadPriority&&(s+=` (${e.loadPriority})`),e.measures&&(s+=`[${e.measures.lodLevel}]`),s},t=this.getTiles(),i=new Array,a=new Set((this._labels.size,this._labels.keys()));t.forEach(((m,u)=>{const d=m.lij.toString();a.delete(d);const g=m.measures?.lodLevel??m.level,f=m.geometry;if(this.enablePolygons&&!this._polygons.has(d)){const e=new o({geometry:f,symbol:this._symbols[g%this._symbols.length]});this._polygons.set(d,e),i.push(e)}if(this.enableLabels){const a=e(m),g=u/(t.length-1),w=r(0,200,g),_=r(20,6,g)/.75,j=null!=m.loadPriority&&m.loadPriority>=t.length,v=new s([w,j?0:w,j?0:w]),S="3d"===this.view.type?()=>new n({verticalOffset:new b({screenLength:40/.75}),callout:new p({color:new s("white"),border:new y({color:new s("black")})}),symbolLayers:new l([new c({text:a,halo:{color:"white",size:1/.75},material:{color:v},size:_})])}):()=>new h({text:a,haloColor:"white",haloSize:1/.75,color:v,size:_}),L=this._labels.get(d);if(L){const e=S();null!=L.symbol&&JSON.stringify(e)===JSON.stringify(L.symbol)||(L.symbol=e)}else{const e=new o({geometry:f.extent.center,symbol:S()});this._labels.set(d,e),i.push(e)}}}));const m=new Array;a.forEach((e=>{const s=this._polygons.get(e);null!=s&&(m.push(s),this._polygons.delete(e));const o=this._labels.get(e);null!=o&&(m.push(o),this._labels.delete(e))})),this.view.graphics.removeMany(m),this.view.graphics.addMany(i)}clear(){this.view.graphics.removeMany(Array.from(this._polygons.values())),this.view.graphics.removeMany(Array.from(this._labels.values())),this._polygons.clear(),this._labels.clear()}};e([i({constructOnly:!0})],d.prototype,"view",void 0),e([i({readOnly:!0})],d.prototype,"updating",void 0),e([i()],d.prototype,"enabled",null),d=e([a("esri.views.support.TileTreeDebugger")],d);export{d as TileTreeDebugger};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import s from"../../Color.js";import o from"../../Graphic.js";import t from"../../core/Accessor.js";import l from"../../core/Collection.js";import{lerp as r}from"../../core/mathUtils.js";import{property as i}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 n from"../../symbols/PointSymbol3D.js";import m from"../../symbols/SimpleFillSymbol.js";import h from"../../symbols/TextSymbol.js";import c from"../../symbols/TextSymbol3DLayer.js";import p from"../../symbols/callouts/LineCallout3D.js";import y from"../../symbols/callouts/LineCallout3DBorder.js";import b from"../../symbols/support/Symbol3DVerticalOffset.js";const u=[[0,179,255],[117,62,128],[0,104,255],[215,189,166],[32,0,193],[98,162,206],[102,112,129],[52,125,0],[142,118,246],[138,83,0],[92,122,255],[122,55,83],[0,142,255],[81,40,179],[0,200,244],[13,24,127],[0,170,147],[19,58,241],[22,44,35]];let d=class extends t{constructor(e){super(e),this.updating=!1,this.enablePolygons=!0,this.enableLabels=!0,this._polygons=new Map,this._labels=new Map,this._symbols=u.map((e=>new m({color:[e[0],e[1],e[2],.6],outline:{color:"black",width:1}}))),this._enabled=!0}initialize(){this.update()}destroy(){this._enabled=!1,this.clear()}get enabled(){return this._enabled}set enabled(e){this._enabled!==e&&(this._enabled=e,this.update())}update(){if(!this._enabled)return void this.clear();const e=e=>{if(null!=e.label)return e.label;let s=e.lij.toString();return null!=e.loadPriority&&(s+=` (${e.loadPriority})`),e.measures&&(s+=`[${e.measures.lodLevel}]`),s},t=this.getTiles(),i=new Array,a=new Set((this._labels.size,this._labels.keys()));t.forEach(((m,u)=>{const d=m.lij.toString();a.delete(d);const g=m.measures?.lodLevel??m.level,f=m.geometry;if(this.enablePolygons&&!this._polygons.has(d)){const e=new o({geometry:f,symbol:this._symbols[g%this._symbols.length]});this._polygons.set(d,e),i.push(e)}if(this.enableLabels){const a=e(m),g=u/(t.length-1),w=r(0,200,g),_=r(20,6,g)/.75,j=null!=m.loadPriority&&m.loadPriority>=t.length,v=new s([w,j?0:w,j?0:w]),S="3d"===this.view.type?()=>new n({verticalOffset:new b({screenLength:40/.75}),callout:new p({color:new s("white"),border:new y({color:new s("black")})}),symbolLayers:new l([new c({text:a,halo:{color:"white",size:1/.75},material:{color:v},size:_})])}):()=>new h({text:a,haloColor:"white",haloSize:1/.75,color:v,size:_}),L=this._labels.get(d);if(L){const e=S();null!=L.symbol&&JSON.stringify(e)===JSON.stringify(L.symbol)||(L.symbol=e)}else{const e=new o({geometry:f.extent.center,symbol:S()});this._labels.set(d,e),i.push(e)}}}));const m=new Array;a.forEach((e=>{const s=this._polygons.get(e);null!=s&&(m.push(s),this._polygons.delete(e));const o=this._labels.get(e);null!=o&&(m.push(o),this._labels.delete(e))})),this.view.graphics.removeMany(m),this.view.graphics.addMany(i)}clear(){this.view.graphics.removeMany(Array.from(this._polygons.values())),this.view.graphics.removeMany(Array.from(this._labels.values())),this._polygons.clear(),this._labels.clear()}};e([i({constructOnly:!0})],d.prototype,"view",void 0),e([i({readOnly:!0})],d.prototype,"updating",void 0),e([i()],d.prototype,"enabled",null),d=e([a("esri.views.support.TileTreeDebugger")],d);export{d as TileTreeDebugger};
@@ -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{loadDebugRendererInfo as e}from"./DebugRendererInfo.js";import{createDisjointTimerQuery as t}from"./DisjointTimerQuery.js";import{loadCompressedTextureETC as s,loadCompressedTextureS3TC as r,loadTextureFilterAnisotropicCapability as i,loadColorBufferFloat as o,loadTextureNorm16 as n,loadBooleanExtension as l}from"./load.js";import{load as u}from"./LoseContext.js";class _{constructor(e,t){this._gl=e,this._compressedTextureETC=null,this._compressedTextureS3TC=null,this._textureFilterAnisotropic=null,this._colorBufferFloat=null,this._loseContext=null,this._textureNorm16=null,this._textureFloatLinear=null,this._debugRendererInfo=null,this._disabledExtensions=t.disabledExtensions||{},this._debugWebGLExtensions=t.debugWebGLExtensions||{}}get compressedTextureETC(){return this._compressedTextureETC??=s(this._gl,this._disabledExtensions),this._compressedTextureETC}get compressedTextureS3TC(){return this._compressedTextureS3TC??=r(this._gl,this._disabledExtensions),this._compressedTextureS3TC}get textureFilterAnisotropic(){return this._textureFilterAnisotropic??=i(this._gl,this._disabledExtensions),this._textureFilterAnisotropic}get disjointTimerQuery(){return this._disjointTimerQuery??=t(this._gl,this._disabledExtensions),this._disjointTimerQuery}get colorBufferFloat(){return this._colorBufferFloat??=o(this._gl,this._disabledExtensions),this._colorBufferFloat}get textureNorm16(){return this._textureNorm16??=n(this._gl,this._disabledExtensions),this._textureNorm16}get textureFloatLinear(){return this._textureFloatLinear??=l(this._gl,this._disabledExtensions,"textureFloatLinear",!1,["OES_texture_float_linear"]),this._textureFloatLinear}get loseContext(){return this._loseContext??=u(this._gl,this._debugWebGLExtensions),this._loseContext}get debugRendererInfo(){return this._debugRendererInfo??=e(this._gl,this._debugWebGLExtensions),this._debugRendererInfo}enable(e){return this[e]}}export{_ as Capabilities};
5
+ import{loadRendererInfo as e}from"./DebugRendererInfo.js";import{createDisjointTimerQuery as t}from"./DisjointTimerQuery.js";import{loadCompressedTextureETC as s,loadCompressedTextureS3TC as r,loadTextureFilterAnisotropicCapability as i,loadColorBufferFloat as o,loadTextureNorm16 as n,loadBooleanExtension as l}from"./load.js";import{load as u}from"./LoseContext.js";class _{constructor(e,t){this._gl=e,this._compressedTextureETC=null,this._compressedTextureS3TC=null,this._textureFilterAnisotropic=null,this._colorBufferFloat=null,this._loseContext=null,this._textureNorm16=null,this._textureFloatLinear=null,this._rendererInfo=null,this._disabledExtensions=t.disabledExtensions||{},this._debugWebGLExtensions=t.debugWebGLExtensions||{}}get compressedTextureETC(){return this._compressedTextureETC??=s(this._gl,this._disabledExtensions),this._compressedTextureETC}get compressedTextureS3TC(){return this._compressedTextureS3TC??=r(this._gl,this._disabledExtensions),this._compressedTextureS3TC}get textureFilterAnisotropic(){return this._textureFilterAnisotropic??=i(this._gl,this._disabledExtensions),this._textureFilterAnisotropic}get disjointTimerQuery(){return this._disjointTimerQuery??=t(this._gl,this._disabledExtensions),this._disjointTimerQuery}get colorBufferFloat(){return this._colorBufferFloat??=o(this._gl,this._disabledExtensions),this._colorBufferFloat}get textureNorm16(){return this._textureNorm16??=n(this._gl,this._disabledExtensions),this._textureNorm16}get textureFloatLinear(){return this._textureFloatLinear??=l(this._gl,this._disabledExtensions,"textureFloatLinear",!1,["OES_texture_float_linear"]),this._textureFloatLinear}get loseContext(){return this._loseContext??=u(this._gl,this._debugWebGLExtensions),this._loseContext}get rendererInfo(){return this._rendererInfo??=e(this._gl),this._rendererInfo}enable(e){return this[e]}}export{_ as Capabilities};
@@ -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
- function e(e,n){const r=n.debugRendererInfo&&e.getExtension("WEBGL_debug_renderer_info");return r?{getUnmaskedRendererWebGL:()=>e.getParameter(r.UNMASKED_RENDERER_WEBGL)}:null}export{e as loadDebugRendererInfo};
5
+ class e{constructor(e){this.getUnmaskedRenderer=e}}function n(n){const r=n.getExtension("WEBGL_debug_renderer_info");return r?new e((()=>n.getParameter(r.UNMASKED_RENDERER_WEBGL))):null}export{e as RendererInfo,n as loadRendererInfo};
@@ -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{loadDebugRendererInfo as e}from"./capabilities/DebugRendererInfo.js";let r;function t(){return r??=l(),r}class o{constructor(){this.available=!1,this.majorPerformanceCaveat=!1,this.maxTextureSize=0,this.supportsVertexShaderSamplers=!1,this.supportsHighPrecisionFragment=!1,this.supportsColorBufferFloat=!1,this.supportsColorBufferFloatBlend=!1,this.supportsColorBufferHalfFloat=!1,this.unmaskedRenderer="unloaded"}}function n(e){if("undefined"==typeof WebGL2RenderingContext)return null;const r=document.createElement("canvas");if(!r)return null;let t=r.getContext("webgl2",{failIfMajorPerformanceCaveat:!0});if(null==t&&(t=r.getContext("webgl2"),null!=t&&(e.majorPerformanceCaveat=!0)),null==t)return t;e.available=!0,e.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE),e.supportsVertexShaderSamplers=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0;const o=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT);return o&&(e.supportsHighPrecisionFragment=o.precision>0),t}function l(){const r=new o,t=n(r);return null==t||(r.supportsColorBufferFloat=null!==t.getExtension("EXT_color_buffer_float"),r.supportsColorBufferFloatBlend=null!==t.getExtension("EXT_float_blend"),r.supportsColorBufferHalfFloat=r.supportsColorBufferFloat||null!==t.getExtension("EXT_color_buffer_half_float"),r.unmaskedRenderer=e(t,{debugRendererInfo:!0})?.getUnmaskedRendererWebGL()??"unknown"),r}export{t as getWebGLCapabilities};
5
+ import{loadRendererInfo as e}from"./capabilities/DebugRendererInfo.js";let r;function t(){return r??=l(),r}class o{constructor(){this.available=!1,this.majorPerformanceCaveat=!1,this.maxTextureSize=0,this.supportsVertexShaderSamplers=!1,this.supportsHighPrecisionFragment=!1,this.supportsColorBufferFloat=!1,this.supportsColorBufferFloatBlend=!1,this.supportsColorBufferHalfFloat=!1,this.unmaskedRenderer="unloaded"}}function n(r){if("undefined"==typeof WebGL2RenderingContext)return null;const t=document.createElement("canvas");if(!t)return null;let o=t.getContext("webgl2",{failIfMajorPerformanceCaveat:!0});if(null==o&&(o=t.getContext("webgl2"),null!=o&&(r.majorPerformanceCaveat=!0,r.unmaskedRenderer=e(o)?.getUnmaskedRenderer()??"unknown")),null==o)return o;r.available=!0,r.maxTextureSize=o.getParameter(o.MAX_TEXTURE_SIZE),r.supportsVertexShaderSamplers=o.getParameter(o.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0;const n=o.getShaderPrecisionFormat(o.FRAGMENT_SHADER,o.HIGH_FLOAT);return n&&(r.supportsHighPrecisionFragment=n.precision>0),o}function l(){const e=new o,r=n(e);return null==r||(e.supportsColorBufferFloat=null!==r.getExtension("EXT_color_buffer_float"),e.supportsColorBufferFloatBlend=null!==r.getExtension("EXT_float_blend"),e.supportsColorBufferHalfFloat=e.supportsColorBufferFloat||null!==r.getExtension("EXT_color_buffer_half_float")),e}export{t as getWebGLCapabilities};
@@ -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"../../intl.js";import{destroyMaybe as t}from"../../core/maybe.js";import{after as s}from"../../core/promiseUtils.js";import{watch as i,initial as r,on as o}from"../../core/reactiveUtils.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import{cast as l}from"../../core/accessorSupport/decorators/cast.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import d from"../Widget.js";import c from"./FeatureRelationship/FeatureRelationshipViewModel.js";import u from"./support/FeatureElementInfo.js";import{loadCalciteComponents as h}from"../support/componentsUtils.js";import{globalCss as p}from"../support/globalCss.js";import{isRTL as m}from"../support/widgetUtils.js";import{messageBundle as v}from"../support/decorators/messageBundle.js";import{tsx as w}from"../support/jsxFactory.js";import{substitute as f}from"../../intl/substitute.js";var _;const b="esri-feature",g=`${b}-relationship`,y={base:g,listContainer:`${g}__list`,listItem:`${g}__list-item`,listItemHidden:`${g}__list-item--hidden`,listContainerQuerying:`${g}__list--querying`,featureObserver:`${b}__feature-observer`,stickySpinnerContainer:`${b}__sticky-loading-container`,loadingSpinnerContainer:`${b}__loading-container`},F={title:!0,description:!0};let I=_=class extends d{constructor(e,t){super(e,t),this._featureElementInfo=null,this._relatedFeatureIntersectionObserverNode=null,this._relatedFeatureIntersectionObserver=new IntersectionObserver((([e])=>{e?.isIntersecting&&this._increaseFeaturePage()}),{root:window.document}),this.flowItems=null,this.flowType="feature-relationship",this.headingLevel=2,this.viewModel=new c,this.messages=null,this.messagesCommon=null,this.visibleElements={...F},this._increaseFeaturePage=()=>{const{state:e,showAllEnabled:t,relatedFeatures:s,featuresPerPage:i,featurePage:r}=this.viewModel;"ready"===e&&t&&s.length>=i*r&&this.viewModel.featurePage++}}initialize(){this._featureElementInfo=new u,this.addHandles([i((()=>[this.viewModel.description,this.viewModel.title,this.headingLevel]),(()=>this._setupFeatureElementInfo()),r),i((()=>[this.viewModel.state,this.viewModel.showAllEnabled,this._relatedFeatureIntersectionObserverNode]),(()=>this._handleRelatedFeatureObserverChange())),o((()=>this.viewModel.relatedFeatureViewModels),"change",(()=>this._setupRelatedFeatureViewModels()))])}loadDependencies(){return h({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")})}destroy(){this._unobserveRelatedFeatureObserver(),this._featureElementInfo=t(this._featureElementInfo)}get displayShowAllButton(){const{showAllEnabled:e,featureCount:t,displayCount:s,state:i}=this.viewModel;return!e&&!!t&&"ready"===i&&(t>s||0===s)}get displayListItems(){return this.displayShowAllButton||this.viewModel.relatedFeatureViewModels.length>0}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get featureCountDescription(){const{messages:e}=this,{featureCount:t}=this.viewModel;return f(e?.numberRecords,{number:t})}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}castVisibleElements(e){return{...F,...e}}render(){const{state:e}=this.viewModel;return w("div",{class:this.classes(y.base,p.widget)},this._featureElementInfo?.render(),"loading"===e?this._renderLoading():"disabled"===e?this._renderRelationshipNotFound():this._renderRelatedFeatures())}async _selectRecord(e){const{flowItems:t,featureVisibleElements:s}=this;if(!t)return;e.abilities={relationshipContent:!0};const{default:i}=await import("../Feature.js");t.push(new i({flowItems:t,flowType:this.flowType,viewModel:e,visibleElements:s}))}_showAllRecords(){const{flowItems:e}=this;if(!e)return;const{viewModel:t,featureVisibleElements:s}=this;t.showAllEnabled=!0;const i=new _({flowItems:e,featureVisibleElements:s,visibleElements:{title:!1,description:!1},viewModel:t});e.push(i)}_renderStickyLoading(){return"querying"===this.viewModel.state?w("div",{class:y.stickySpinnerContainer,key:"sticky-loader"},this._renderLoadingIcon()):null}_renderLoadingIcon(){return w("calcite-loader",{inline:!0,label:""})}_renderLoading(){return w("div",{class:y.loadingSpinnerContainer,key:"loading-container"},this._renderLoadingIcon())}_renderShowAllIconNode(){return w("calcite-icon",{icon:"list",scale:"s",slot:"content-end"})}_renderChevronIconNode(){const e=m(this.container)?"chevron-left":"chevron-right";return w("calcite-icon",{icon:e,scale:"s",slot:"content-end"})}_renderRelatedFeature(e){const{itemDescriptionFieldName:t}=this.viewModel,s=e.title;e.description=t&&e.formattedAttributes?.global[t];const i="loading"===e.state;return w("calcite-list-item",{class:this.classes(y.listItem,{[y.listItemHidden]:i}),description:e.description??"",key:e.uid,label:s,onCalciteListItemSelect:()=>this._selectRecord(e)},this._renderChevronIconNode())}_renderShowAllListItem(){return this.displayShowAllButton?w("calcite-list-item",{description:this.featureCountDescription,key:"show-all-item",label:this.messages?.showAll,onCalciteListItemSelect:()=>this._showAllRecords()},this._renderShowAllIconNode()):null}_renderNoRelatedFeaturesMessage(){return w("calcite-notice",{icon:"information",key:"no-related-features-message",kind:"brand",open:!0,scale:"s",width:"full"},w("div",{slot:"message"},this.messages?.noRelatedFeatures))}_renderFeatureObserver(){return w("div",{afterCreate:this._relatedFeatureIntersectionObserverCreated,bind:this,class:y.featureObserver,key:"feature-observer"})}_renderList(){const{relatedFeatureViewModels:e}=this.viewModel;return w("calcite-list",{displayMode:"flat",label:this.messages?.relatedFeaturesList},e.toArray().map((e=>this._renderRelatedFeature(e))),this._renderShowAllListItem())}_renderRelatedFeatures(){const{displayListItems:e}=this,{state:t}=this.viewModel;return w("div",{class:this.classes(y.listContainer,{[y.listContainerQuerying]:"querying"===t}),key:"list-container"},e?this._renderList():"ready"===t?this._renderNoRelatedFeaturesMessage():null,this._renderStickyLoading(),this._renderFeatureObserver())}_renderRelationshipNotFound(){return w("calcite-notice",{icon:"exclamation-mark-triangle",key:"relationship-not-found",kind:"danger",open:!0,scale:"s",width:"full"},w("div",{slot:"message"},this.messages?.relationshipNotFound))}_setupRelatedFeatureViewModels(){const{relatedFeatureViewModels:e}=this.viewModel,t="related-feature-viewmodels";this.removeHandles(t),e?.forEach((e=>{this.addHandles(i((()=>[e.title,e.state]),(()=>this.scheduleRender()),r),t)})),this.scheduleRender()}_setupFeatureElementInfo(){const{headingLevel:e,visibleElements:t}=this,s=t.description&&this.description,i=t.title&&this.title;this._featureElementInfo?.set({description:s,title:i,headingLevel:e})}async _handleRelatedFeatureObserverChange(){this._unobserveRelatedFeatureObserver();const{state:e,showAllEnabled:t}=this.viewModel;await s(0),this._relatedFeatureIntersectionObserverNode&&"ready"===e&&t&&this._relatedFeatureIntersectionObserver.observe(this._relatedFeatureIntersectionObserverNode)}_relatedFeatureIntersectionObserverCreated(e){this._relatedFeatureIntersectionObserverNode=e}_unobserveRelatedFeatureObserver(){this._relatedFeatureIntersectionObserverNode&&this._relatedFeatureIntersectionObserver.unobserve(this._relatedFeatureIntersectionObserverNode)}};e([n()],I.prototype,"_relatedFeatureIntersectionObserverNode",void 0),e([n({readOnly:!0})],I.prototype,"displayShowAllButton",null),e([n({readOnly:!0})],I.prototype,"displayListItems",null),e([n()],I.prototype,"description",null),e([n({readOnly:!0})],I.prototype,"featureCountDescription",null),e([n()],I.prototype,"featureVisibleElements",void 0),e([n()],I.prototype,"flowItems",void 0),e([n()],I.prototype,"flowType",void 0),e([n()],I.prototype,"headingLevel",void 0),e([n()],I.prototype,"title",null),e([n({type:c})],I.prototype,"viewModel",void 0),e([n(),v("esri/widgets/Feature/t9n/Feature")],I.prototype,"messages",void 0),e([n(),v("esri/t9n/common")],I.prototype,"messagesCommon",void 0),e([n()],I.prototype,"visibleElements",void 0),e([l("visibleElements")],I.prototype,"castVisibleElements",null),I=_=e([a("esri.widgets.Feature.FeatureRelationship")],I);const M=I;export{M as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import"../../intl.js";import{destroyMaybe as t}from"../../core/maybe.js";import{after as s}from"../../core/promiseUtils.js";import{watch as i,initial as r,on as o}from"../../core/reactiveUtils.js";import{stripHTML as n}from"../../core/string.js";import{property as l}from"../../core/accessorSupport/decorators/property.js";import{cast as a}from"../../core/accessorSupport/decorators/cast.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import c from"../Widget.js";import u from"./FeatureRelationship/FeatureRelationshipViewModel.js";import h from"./support/FeatureElementInfo.js";import{loadCalciteComponents as p}from"../support/componentsUtils.js";import{globalCss as m}from"../support/globalCss.js";import{isRTL as v}from"../support/widgetUtils.js";import{messageBundle as w}from"../support/decorators/messageBundle.js";import{tsx as f}from"../support/jsxFactory.js";import{substitute as _}from"../../intl/substitute.js";var b;const g="esri-feature",y=`${g}-relationship`,F={base:y,listContainer:`${y}__list`,listItem:`${y}__list-item`,listItemHidden:`${y}__list-item--hidden`,listContainerQuerying:`${y}__list--querying`,featureObserver:`${g}__feature-observer`,stickySpinnerContainer:`${g}__sticky-loading-container`,loadingSpinnerContainer:`${g}__loading-container`},I={title:!0,description:!0};let M=b=class extends c{constructor(e,t){super(e,t),this._featureElementInfo=null,this._relatedFeatureIntersectionObserverNode=null,this._relatedFeatureIntersectionObserver=new IntersectionObserver((([e])=>{e?.isIntersecting&&this._increaseFeaturePage()}),{root:window.document}),this.flowItems=null,this.flowType="feature-relationship",this.headingLevel=2,this.viewModel=new u,this.messages=null,this.messagesCommon=null,this.visibleElements={...I},this._increaseFeaturePage=()=>{const{state:e,showAllEnabled:t,relatedFeatures:s,featuresPerPage:i,featurePage:r}=this.viewModel;"ready"===e&&t&&s.length>=i*r&&this.viewModel.featurePage++}}initialize(){this._featureElementInfo=new h,this.addHandles([i((()=>[this.viewModel.description,this.viewModel.title,this.headingLevel]),(()=>this._setupFeatureElementInfo()),r),i((()=>[this.viewModel.state,this.viewModel.showAllEnabled,this._relatedFeatureIntersectionObserverNode]),(()=>this._handleRelatedFeatureObserverChange())),o((()=>this.viewModel.relatedFeatureViewModels),"change",(()=>this._setupRelatedFeatureViewModels()))])}loadDependencies(){return p({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")})}destroy(){this._unobserveRelatedFeatureObserver(),this._featureElementInfo=t(this._featureElementInfo)}get displayShowAllButton(){const{showAllEnabled:e,featureCount:t,displayCount:s,state:i}=this.viewModel;return!e&&!!t&&"ready"===i&&(t>s||0===s)}get displayListItems(){return this.displayShowAllButton||this.viewModel.relatedFeatureViewModels.length>0}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get featureCountDescription(){const{messages:e}=this,{featureCount:t}=this.viewModel;return _(e?.numberRecords,{number:t})}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}castVisibleElements(e){return{...I,...e}}render(){const{state:e}=this.viewModel;return f("div",{class:this.classes(F.base,m.widget)},this._featureElementInfo?.render(),"loading"===e?this._renderLoading():"disabled"===e?this._renderRelationshipNotFound():this._renderRelatedFeatures())}async _selectRecord(e){const{flowItems:t,featureVisibleElements:s}=this;if(!t)return;e.abilities={relationshipContent:!0};const{default:i}=await import("../Feature.js");t.push(new i({flowItems:t,flowType:this.flowType,viewModel:e,visibleElements:s}))}_showAllRecords(){const{flowItems:e}=this;if(!e)return;const{viewModel:t,featureVisibleElements:s}=this;t.showAllEnabled=!0;const i=new b({flowItems:e,featureVisibleElements:s,visibleElements:{title:!1,description:!1},viewModel:t});e.push(i)}_renderStickyLoading(){return"querying"===this.viewModel.state?f("div",{class:F.stickySpinnerContainer,key:"sticky-loader"},this._renderLoadingIcon()):null}_renderLoadingIcon(){return f("calcite-loader",{inline:!0,label:""})}_renderLoading(){return f("div",{class:F.loadingSpinnerContainer,key:"loading-container"},this._renderLoadingIcon())}_renderShowAllIconNode(){return f("calcite-icon",{icon:"list",scale:"s",slot:"content-end"})}_renderChevronIconNode(){const e=v(this.container)?"chevron-left":"chevron-right";return f("calcite-icon",{icon:e,scale:"s",slot:"content-end"})}_renderRelatedFeature(e){const{itemDescriptionFieldName:t}=this.viewModel,s=e.title;e.description=t&&e.formattedAttributes?.global[t];const i="loading"===e.state;return f("calcite-list-item",{class:this.classes(F.listItem,{[F.listItemHidden]:i}),description:n(e.description??""),key:e.uid,label:n(s),onCalciteListItemSelect:()=>this._selectRecord(e)},this._renderChevronIconNode())}_renderShowAllListItem(){return this.displayShowAllButton?f("calcite-list-item",{description:this.featureCountDescription,key:"show-all-item",label:this.messages?.showAll,onCalciteListItemSelect:()=>this._showAllRecords()},this._renderShowAllIconNode()):null}_renderNoRelatedFeaturesMessage(){return f("calcite-notice",{icon:"information",key:"no-related-features-message",kind:"brand",open:!0,scale:"s",width:"full"},f("div",{slot:"message"},this.messages?.noRelatedFeatures))}_renderFeatureObserver(){return f("div",{afterCreate:this._relatedFeatureIntersectionObserverCreated,bind:this,class:F.featureObserver,key:"feature-observer"})}_renderList(){const{relatedFeatureViewModels:e}=this.viewModel;return f("calcite-list",{displayMode:"flat",label:this.messages?.relatedFeaturesList},e.toArray().map((e=>this._renderRelatedFeature(e))),this._renderShowAllListItem())}_renderRelatedFeatures(){const{displayListItems:e}=this,{state:t}=this.viewModel;return f("div",{class:this.classes(F.listContainer,{[F.listContainerQuerying]:"querying"===t}),key:"list-container"},e?this._renderList():"ready"===t?this._renderNoRelatedFeaturesMessage():null,this._renderStickyLoading(),this._renderFeatureObserver())}_renderRelationshipNotFound(){return f("calcite-notice",{icon:"exclamation-mark-triangle",key:"relationship-not-found",kind:"danger",open:!0,scale:"s",width:"full"},f("div",{slot:"message"},this.messages?.relationshipNotFound))}_setupRelatedFeatureViewModels(){const{relatedFeatureViewModels:e}=this.viewModel,t="related-feature-viewmodels";this.removeHandles(t),e?.forEach((e=>{this.addHandles(i((()=>[e.title,e.state]),(()=>this.scheduleRender()),r),t)})),this.scheduleRender()}_setupFeatureElementInfo(){const{headingLevel:e,visibleElements:t}=this,s=t.description&&this.description,i=t.title&&this.title;this._featureElementInfo?.set({description:s,title:i,headingLevel:e})}async _handleRelatedFeatureObserverChange(){this._unobserveRelatedFeatureObserver();const{state:e,showAllEnabled:t}=this.viewModel;await s(0),this._relatedFeatureIntersectionObserverNode&&"ready"===e&&t&&this._relatedFeatureIntersectionObserver.observe(this._relatedFeatureIntersectionObserverNode)}_relatedFeatureIntersectionObserverCreated(e){this._relatedFeatureIntersectionObserverNode=e}_unobserveRelatedFeatureObserver(){this._relatedFeatureIntersectionObserverNode&&this._relatedFeatureIntersectionObserver.unobserve(this._relatedFeatureIntersectionObserverNode)}};e([l()],M.prototype,"_relatedFeatureIntersectionObserverNode",void 0),e([l({readOnly:!0})],M.prototype,"displayShowAllButton",null),e([l({readOnly:!0})],M.prototype,"displayListItems",null),e([l()],M.prototype,"description",null),e([l({readOnly:!0})],M.prototype,"featureCountDescription",null),e([l()],M.prototype,"featureVisibleElements",void 0),e([l()],M.prototype,"flowItems",void 0),e([l()],M.prototype,"flowType",void 0),e([l()],M.prototype,"headingLevel",void 0),e([l()],M.prototype,"title",null),e([l({type:u})],M.prototype,"viewModel",void 0),e([l(),w("esri/widgets/Feature/t9n/Feature")],M.prototype,"messages",void 0),e([l(),w("esri/t9n/common")],M.prototype,"messagesCommon",void 0),e([l()],M.prototype,"visibleElements",void 0),e([a("visibleElements")],M.prototype,"castVisibleElements",null),M=b=e([d("esri.widgets.Feature.FeatureRelationship")],M);const C=M;export{C 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{_ as e}from"../../chunks/tslib.es6.js";import"../../intl.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{getFeaturePopupTitle as s}from"../../support/popupUtils.js";import o from"./FeatureUtilityNetworkAssociations/VisibleElements.js";import{loadCalciteComponents as l}from"../support/componentsUtils.js";import{globalCss as r}from"../support/globalCss.js";import"../support/widgetUtils.js";import{tsx as n,tsxFragment as a}from"../support/jsxFactory.js";import c from"../support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js";import d from"../support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js";import{isConnectivity as p,isConnectivityMidspan as u,formatPercentAlong as m}from"../support/UtilityNetworkAssociations/utilityNetworkUtils.js";import{substitute as h}from"../../intl/substitute.js";var w;const y="esri-feature-utility-network-associations",f={base:y,listItemHidden:`${y}__list-item--hidden`},b="nested";let v=w=class extends d{constructor(e,t){super(e,t),this.description=null,this.flowItems=null,this.flowType="feature-utility-network-association-type",this.listType=null,this.parentFeatureViewModel=null,this.title=null,this.viewModel=new c,this.visibleElements=new o}initialize(){this.setUpObserver()}loadDependencies(){return l({chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}destroy(){this.tooltipReferenceMap.clear()}render(){const e=this.viewModel.associationViewModels,{state:t,showAllEnabled:i}=this.viewModel,{state:s}=this.parentFeatureViewModel??{};return n("div",{class:this.classes(f.base,r.widget)},"loading"===t||"querying"===t||"loading"===s?this.renderLoading():n("calcite-list",{displayMode:b,label:this.selectedLayer?.title??this.messagesCommon.untitled},i&&this.selectedLayer?n(a,null,this.renderFilter(),this.renderFeatureCountWarning(),this._renderAssociatedFeatureListPage(),this.renderFeatureObserver()):Array.from(e.keys(),(t=>this._renderTypeList(t,e.get(t))))))}_showAllAssociations(e){const{flowItems:t,viewModel:i,description:s}=this;if(!t||!e)return;i.showAllEnabled=!0;const l=new w({selectedLayer:e,title:e?.title,flowItems:t,parentFeatureViewModel:this.parentFeatureViewModel,featureVisibleElements:this.featureVisibleElements,description:s,visibleElements:new o({title:!1,description:!1}),viewModel:i});t.push(l)}_renderAssociatedFeatureListPage(){const e=this.viewModel.associationViewModels.get(this.selectedLayer).filter((e=>s(e.featureViewModel).toLowerCase().includes(this.filterText))).slice(0,this.endIndex);return[...this._renderTooltips(e),...this._renderAssociatedFeatureList(e)]}_renderItemTooltip(e){const{tooltipReferenceMap:t}=this;return p(e.association)?n("calcite-tooltip",{key:`tooltip-${e.featureViewModel.uid}`,overlayPositioning:"fixed",referenceElement:t.get(e.featureViewModel.uid)},this.getConnectivityTooltip(e.association.associationType)):null}_renderAssociatedFeature(e){const{featureViewModel:t}=e,i=s(t),o="loading"===t.state,l=this._findFlowItem(t),r=l<0&&this._isParentFeature(t),a=r||l>=0;return n("calcite-list-item",{class:o?f.listItemHidden:void 0,description:e.terminalName??"",key:`associated-feature-type-${t.uid}`,label:i,onCalciteListItemSelect:()=>this._handleFeatureClick(r,l,t)},p(e.association)?this.renderConnectivityIcon(e.association.associationType,e.featureViewModel.uid):null,u(e.association)?n("calcite-chip",{label:m(e.association),scale:"s",slot:"content-end"},m(e.association)):null,this._renderChevronIconNode(a))}async _selectAssociation(e){const{flowItems:t,featureVisibleElements:i}=this;if(!t)return;e.abilities={utilityNetworkAssociationsContent:!0};const{default:s}=await import("../Feature.js");t.push(new s({flowItems:t,flowType:"feature-association",viewModel:e,visibleElements:i}))}_handleFeatureClick(e,t,i){if(e)this.flowItems.drain((e=>{"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e.viewModel=null,e.destroy()}));else if(t<0||!this.flowItems)this._selectAssociation(i);else for(;this.flowItems.length>t+1;){const e=this.flowItems.pop();e&&("showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e.viewModel=null,e.destroy())}}_featureViewModelMatch(e,t){const i=e.graphic,s=i?.layer;let o=null;"subtype-sublayer"===s?.type&&s.parent?o=s.parent.globalIdField??null:s&&"globalIdField"in s&&(o=s.globalIdField);const l=o?i?.attributes[o]:null,r=t.graphic,n=r?.layer;let a=null;"subtype-sublayer"===n?.type&&n.parent?a=n.parent.globalIdField??null:n&&"globalIdField"in n&&(a=n.globalIdField);const c=a?r?.attributes[a]:null;return l&&c&&l===c}_isParentFeature(e){const t=this.flowItems?.getItemAt(0);if(!t)return!1;const i=t.parentFeatureViewModel;return this._featureViewModelMatch(i,e)}_findFlowItem(e){return this.flowItems?.findIndex((t=>{if("feature-association"!==t.flowType)return!1;const i=t.viewModel;return this._featureViewModelMatch(i,e)}))??-1}_renderTooltips(e){return e.toArray().map((e=>this._renderItemTooltip(e)))}_renderAssociatedFeatureList(e){return e.toArray().map((e=>this._renderAssociatedFeature(e)))}_renderChevronIconNode(e){return n("calcite-icon",{flipRtl:!0,icon:e?"move-up":"chevron-right",scale:"s",slot:"content-end"})}_renderTypeList(e,t){const{messagesFeature:i}=this,{displayCount:s}=this.viewModel,o=t.slice(0,s),l=o.length<t.length;return n("calcite-list-item",{key:"show-all",label:e.title,open:!0,value:e.id},n("calcite-chip",{label:String(t.length),scale:"s",slot:"actions-end"},t.length),n("calcite-list",{group:e.id,label:e.title??""},[this._renderTooltips(o),this._renderAssociatedFeatureList(o)],l?n("calcite-list-item",{description:h(i?.numberRecords,{number:t.length.toString()}),key:"show-all-item",label:i.showAll,onCalciteListItemSelect:()=>this._showAllAssociations(e)},n("calcite-icon",{icon:"list",scale:"s",slot:"content-end"})):null))}};e([t()],v.prototype,"description",void 0),e([t()],v.prototype,"featureVisibleElements",void 0),e([t()],v.prototype,"flowItems",void 0),e([t()],v.prototype,"flowType",void 0),e([t()],v.prototype,"listType",void 0),e([t()],v.prototype,"parentFeatureViewModel",void 0),e([t()],v.prototype,"title",void 0),e([t({type:c})],v.prototype,"viewModel",void 0),e([t({type:o,nonNullable:!0})],v.prototype,"visibleElements",void 0),v=w=e([i("esri.widgets.Feature.FeatureUtilityNetworkAssociationList")],v);const g=v;export{g as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import"../../intl.js";import{stripHTML as t}from"../../core/string.js";import{property as i}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{getFeaturePopupTitle as o}from"../../support/popupUtils.js";import l from"./FeatureUtilityNetworkAssociations/VisibleElements.js";import{loadCalciteComponents as r}from"../support/componentsUtils.js";import{globalCss as n}from"../support/globalCss.js";import"../support/widgetUtils.js";import{tsx as a,tsxFragment as c}from"../support/jsxFactory.js";import d from"../support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js";import p from"../support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js";import{isConnectivity as u,isConnectivityMidspan as m,formatPercentAlong as h}from"../support/UtilityNetworkAssociations/utilityNetworkUtils.js";import{substitute as w}from"../../intl/substitute.js";var f;const y="esri-feature-utility-network-associations",b={base:y,listItemHidden:`${y}__list-item--hidden`},v="nested";let g=f=class extends p{constructor(e,t){super(e,t),this.description=null,this.flowItems=null,this.flowType="feature-utility-network-association-type",this.listType=null,this.parentFeatureViewModel=null,this.title=null,this.viewModel=new d,this.visibleElements=new l}initialize(){this.setUpObserver()}loadDependencies(){return r({chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}destroy(){this.tooltipReferenceMap.clear()}render(){const e=this.viewModel.associationViewModels,{state:t,showAllEnabled:i}=this.viewModel,{state:s}=this.parentFeatureViewModel??{};return a("div",{class:this.classes(b.base,n.widget)},"loading"===t||"querying"===t||"loading"===s?this.renderLoading():a("calcite-list",{displayMode:v,label:this.selectedLayer?.title??this.messagesCommon.untitled},i&&this.selectedLayer?a(c,null,this.renderFilter(),this.renderFeatureCountWarning(),this._renderAssociatedFeatureListPage(),this.renderFeatureObserver()):Array.from(e.keys(),(t=>this._renderTypeList(t,e.get(t))))))}_showAllAssociations(e){const{flowItems:t,viewModel:i,description:s}=this;if(!t||!e)return;i.showAllEnabled=!0;const o=new f({selectedLayer:e,title:e?.title,flowItems:t,parentFeatureViewModel:this.parentFeatureViewModel,featureVisibleElements:this.featureVisibleElements,description:s,visibleElements:new l({title:!1,description:!1}),viewModel:i});t.push(o)}_renderAssociatedFeatureListPage(){const e=this.viewModel.associationViewModels.get(this.selectedLayer).filter((e=>o(e.featureViewModel).toLowerCase().includes(this.filterText))).slice(0,this.endIndex);return[...this._renderTooltips(e),...this._renderAssociatedFeatureList(e)]}_renderItemTooltip(e){const{tooltipReferenceMap:t}=this;return u(e.association)?a("calcite-tooltip",{key:`tooltip-${e.featureViewModel.uid}`,overlayPositioning:"fixed",referenceElement:t.get(e.featureViewModel.uid)},this.getConnectivityTooltip(e.association.associationType)):null}_renderAssociatedFeature(e){const{featureViewModel:i}=e,s=o(i),l="loading"===i.state,r=this._findFlowItem(i),n=r<0&&this._isParentFeature(i),c=n||r>=0;return a("calcite-list-item",{class:l?b.listItemHidden:void 0,description:t(e.terminalName??""),key:`associated-feature-type-${i.uid}`,label:t(s),onCalciteListItemSelect:()=>this._handleFeatureClick(n,r,i)},u(e.association)?this.renderConnectivityIcon(e.association.associationType,e.featureViewModel.uid):null,m(e.association)?a("calcite-chip",{label:h(e.association),scale:"s",slot:"content-end"},h(e.association)):null,this._renderChevronIconNode(c))}async _selectAssociation(e){const{flowItems:t,featureVisibleElements:i}=this;if(!t)return;e.abilities={utilityNetworkAssociationsContent:!0};const{default:s}=await import("../Feature.js");t.push(new s({flowItems:t,flowType:"feature-association",viewModel:e,visibleElements:i}))}_handleFeatureClick(e,t,i){if(e)this.flowItems.drain((e=>{"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e.viewModel=null,e.destroy()}));else if(t<0||!this.flowItems)this._selectAssociation(i);else for(;this.flowItems.length>t+1;){const e=this.flowItems.pop();e&&("showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e.viewModel=null,e.destroy())}}_featureViewModelMatch(e,t){const i=e.graphic,s=i?.layer;let o=null;"subtype-sublayer"===s?.type&&s.parent?o=s.parent.globalIdField??null:s&&"globalIdField"in s&&(o=s.globalIdField);const l=o?i?.attributes[o]:null,r=t.graphic,n=r?.layer;let a=null;"subtype-sublayer"===n?.type&&n.parent?a=n.parent.globalIdField??null:n&&"globalIdField"in n&&(a=n.globalIdField);const c=a?r?.attributes[a]:null;return l&&c&&l===c}_isParentFeature(e){const t=this.flowItems?.getItemAt(0);if(!t)return!1;const i=t.parentFeatureViewModel;return this._featureViewModelMatch(i,e)}_findFlowItem(e){return this.flowItems?.findIndex((t=>{if("feature-association"!==t.flowType)return!1;const i=t.viewModel;return this._featureViewModelMatch(i,e)}))??-1}_renderTooltips(e){return e.toArray().map((e=>this._renderItemTooltip(e)))}_renderAssociatedFeatureList(e){return e.toArray().map((e=>this._renderAssociatedFeature(e)))}_renderChevronIconNode(e){return a("calcite-icon",{flipRtl:!0,icon:e?"move-up":"chevron-right",scale:"s",slot:"content-end"})}_renderTypeList(e,t){const{messagesFeature:i}=this,{displayCount:s}=this.viewModel,o=t.slice(0,s),l=o.length<t.length;return a("calcite-list-item",{key:"show-all",label:e.title,open:!0,value:e.id},a("calcite-chip",{label:String(t.length),scale:"s",slot:"actions-end"},t.length),a("calcite-list",{group:e.id,label:e.title??""},[this._renderTooltips(o),this._renderAssociatedFeatureList(o)],l?a("calcite-list-item",{description:w(i?.numberRecords,{number:t.length.toString()}),key:"show-all-item",label:i.showAll,onCalciteListItemSelect:()=>this._showAllAssociations(e)},a("calcite-icon",{icon:"list",scale:"s",slot:"content-end"})):null))}};e([i()],g.prototype,"description",void 0),e([i()],g.prototype,"featureVisibleElements",void 0),e([i()],g.prototype,"flowItems",void 0),e([i()],g.prototype,"flowType",void 0),e([i()],g.prototype,"listType",void 0),e([i()],g.prototype,"parentFeatureViewModel",void 0),e([i()],g.prototype,"title",void 0),e([i({type:d})],g.prototype,"viewModel",void 0),e([i({type:l,nonNullable:!0})],g.prototype,"visibleElements",void 0),g=f=e([s("esri.widgets.Feature.FeatureUtilityNetworkAssociationList")],g);const M=g;export{M 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{_ as e}from"../../chunks/tslib.es6.js";import{destroyMaybe as t}from"../../core/maybe.js";import{watch as i,initial as o}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 n}from"../../core/accessorSupport/decorators/subclass.js";import r from"../Widget.js";import a from"./FeatureUtilityNetworkAssociations/VisibleElements.js";import l from"./support/FeatureElementInfo.js";import{loadCalciteComponents as c}from"../support/componentsUtils.js";import{globalCss as d}from"../support/globalCss.js";import"../support/widgetUtils.js";import{messageBundle as p}from"../support/decorators/messageBundle.js";import{tsx as m}from"../support/jsxFactory.js";import u from"../support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js";const h="esri-feature-utility-network-associations",y=`${h}__loading-container`,g={base:h,listContainer:`${h}__list`,loadingContainer:y,loadingContainerSticky:`${y}--sticky`};let v=class extends r{constructor(e,t){super(e,t),this._featureElementInfo=null,this.onSelectAssociationType=()=>{},this.flowType="feature-utility-network-associations",this.flowItems=null,this.parentFeatureViewModel=null,this.headingLevel=5,this.viewModel=new u,this.messages=null,this.messagesCommon=null,this.visibleElements=new a}initialize(){this._featureElementInfo=new l,this.addHandles([i((()=>[this.viewModel.description,this.viewModel.title,this.headingLevel]),(()=>this._setupFeatureElementInfo()),o)])}loadDependencies(){return c({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")})}destroy(){this._featureElementInfo=t(this._featureElementInfo)}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){const{state:e}=this.viewModel;return m("div",{class:this.classes(g.base,d.widget)},this._featureElementInfo?.render(),"loading"===e?this._renderLoading():"disabled"===e?this._renderAssociationNotFound():this._renderContent())}_renderStickyLoading(){return"querying"===this.viewModel.state?m("div",{class:g.loadingContainerSticky,key:"sticky-loader"},this._renderLoadingIcon()):null}_renderLoadingIcon(){return m("calcite-loader",{inline:!0,label:this.messagesCommon.loading})}_renderLoading(){return m("div",{class:g.loadingContainer,key:"loading-container"},this._renderLoadingIcon())}_renderAssociationNotFound(){return m("calcite-notice",{icon:"exclamation-mark-triangle",key:"association-not-found",kind:"danger",open:!0,scale:"s",width:"full"},m("div",{slot:"message"},this.messages?.noAssociations))}_renderAssociationType(e){const{viewModel:t}=this,i=this._getAssociationTypeTitle(e);return m("calcite-list-item",{description:e.description,key:`association-type-${e.type}`,label:i,value:e.type,onCalciteListItemSelect:()=>this.onSelectAssociationType({viewModel:t,listType:e,title:i})},m("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderAssociations(e){const{viewModel:t}=this;return"featureForm"===t.source||t.getFeatureCountForAssociationType(e.type)>0?this._renderAssociationType(e):void 0}_renderContent(){const{messages:e,viewModel:t}=this,{state:i,associationTypes:o}=t;return m("div",{class:g.listContainer,key:"list-container"},"ready"===i?m("div",null,m("calcite-list",{displayMode:"flat",label:e?.associationsList},o.map((e=>this._renderAssociations(e))))):null,this._renderStickyLoading())}_getAssociationTypeTitle(e){const{messages:t}=this;if(e.title)return e.title;switch(e.type){case"attachment":return t.associationsAttachments;case"connectivity":return t.associationsConnectivity;case"structure":return t.associationsStructure;case"content":return t.associationsContents;case"container":return t.associationsContainer}}_setupFeatureElementInfo(){const{headingLevel:e,visibleElements:t}=this,i=t.description&&this.description,o=t.title&&this.title;this._featureElementInfo?.set({description:i,title:o,headingLevel:e})}};e([s({constructOnly:!0})],v.prototype,"onSelectAssociationType",void 0),e([s()],v.prototype,"flowType",void 0),e([s()],v.prototype,"flowItems",void 0),e([s()],v.prototype,"parentFeatureViewModel",void 0),e([s()],v.prototype,"featureVisibleElements",void 0),e([s()],v.prototype,"description",null),e([s()],v.prototype,"headingLevel",void 0),e([s()],v.prototype,"title",null),e([s({type:u})],v.prototype,"viewModel",void 0),e([s(),p("esri/widgets/Feature/t9n/Feature")],v.prototype,"messages",void 0),e([s(),p("esri/t9n/common")],v.prototype,"messagesCommon",void 0),e([s({type:a,nonNullable:!0})],v.prototype,"visibleElements",void 0),v=e([n("esri.widgets.Feature.FeatureUtilityNetworkAssociations")],v);const f=v;export{f as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import{destroyMaybe as t}from"../../core/maybe.js";import{watch as i,initial as o}from"../../core/reactiveUtils.js";import{stripHTML as s}from"../../core/string.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";import a from"../Widget.js";import l from"./FeatureUtilityNetworkAssociations/VisibleElements.js";import c from"./support/FeatureElementInfo.js";import{loadCalciteComponents as d}from"../support/componentsUtils.js";import{globalCss as p}from"../support/globalCss.js";import"../support/widgetUtils.js";import{messageBundle as m}from"../support/decorators/messageBundle.js";import{tsx as u}from"../support/jsxFactory.js";import h from"../support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js";const y="esri-feature-utility-network-associations",g=`${y}__loading-container`,v={base:y,listContainer:`${y}__list`,loadingContainer:g,loadingContainerSticky:`${g}--sticky`};let f=class extends a{constructor(e,t){super(e,t),this._featureElementInfo=null,this.onSelectAssociationType=()=>{},this.flowType="feature-utility-network-associations",this.flowItems=null,this.parentFeatureViewModel=null,this.headingLevel=5,this.viewModel=new h,this.messages=null,this.messagesCommon=null,this.visibleElements=new l}initialize(){this._featureElementInfo=new c,this.addHandles([i((()=>[this.viewModel.description,this.viewModel.title,this.headingLevel]),(()=>this._setupFeatureElementInfo()),o)])}loadDependencies(){return d({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")})}destroy(){this._featureElementInfo=t(this._featureElementInfo)}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){const{state:e}=this.viewModel;return u("div",{class:this.classes(v.base,p.widget)},this._featureElementInfo?.render(),"loading"===e?this._renderLoading():"disabled"===e?this._renderAssociationNotFound():this._renderContent())}_renderStickyLoading(){return"querying"===this.viewModel.state?u("div",{class:v.loadingContainerSticky,key:"sticky-loader"},this._renderLoadingIcon()):null}_renderLoadingIcon(){return u("calcite-loader",{inline:!0,label:this.messagesCommon.loading})}_renderLoading(){return u("div",{class:v.loadingContainer,key:"loading-container"},this._renderLoadingIcon())}_renderAssociationNotFound(){return u("calcite-notice",{icon:"exclamation-mark-triangle",key:"association-not-found",kind:"danger",open:!0,scale:"s",width:"full"},u("div",{slot:"message"},this.messages?.noAssociations))}_renderAssociationType(e){const{viewModel:t}=this,i=this._getAssociationTypeTitle(e);return u("calcite-list-item",{description:s(e.description),key:`association-type-${e.type}`,label:s(i),value:e.type,onCalciteListItemSelect:()=>this.onSelectAssociationType({viewModel:t,listType:e,title:i})},u("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderAssociations(e){const{viewModel:t}=this;return"featureForm"===t.source||t.getFeatureCountForAssociationType(e.type)>0?this._renderAssociationType(e):void 0}_renderContent(){const{messages:e,viewModel:t}=this,{state:i,associationTypes:o}=t;return u("div",{class:v.listContainer,key:"list-container"},"ready"===i?u("div",null,u("calcite-list",{displayMode:"flat",label:e?.associationsList},o.map((e=>this._renderAssociations(e))))):null,this._renderStickyLoading())}_getAssociationTypeTitle(e){const{messages:t}=this;if(e.title)return e.title;switch(e.type){case"attachment":return t.associationsAttachments;case"connectivity":return t.associationsConnectivity;case"structure":return t.associationsStructure;case"content":return t.associationsContents;case"container":return t.associationsContainer}}_setupFeatureElementInfo(){const{headingLevel:e,visibleElements:t}=this,i=t.description&&this.description,o=t.title&&this.title;this._featureElementInfo?.set({description:i,title:o,headingLevel:e})}};e([n({constructOnly:!0})],f.prototype,"onSelectAssociationType",void 0),e([n()],f.prototype,"flowType",void 0),e([n()],f.prototype,"flowItems",void 0),e([n()],f.prototype,"parentFeatureViewModel",void 0),e([n()],f.prototype,"featureVisibleElements",void 0),e([n()],f.prototype,"description",null),e([n()],f.prototype,"headingLevel",void 0),e([n()],f.prototype,"title",null),e([n({type:h})],f.prototype,"viewModel",void 0),e([n(),m("esri/widgets/Feature/t9n/Feature")],f.prototype,"messages",void 0),e([n(),m("esri/t9n/common")],f.prototype,"messagesCommon",void 0),e([n({type:l,nonNullable:!0})],f.prototype,"visibleElements",void 0),f=e([r("esri.widgets.Feature.FeatureUtilityNetworkAssociations")],f);const w=f;export{w 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{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{watch as t,initial as s}from"../core/reactiveUtils.js";import{property as i}from"../core/accessorSupport/decorators/property.js";import{cast as n}from"../core/accessorSupport/decorators/cast.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as o}from"../core/accessorSupport/decorators/subclass.js";import r from"./Widget.js";import l from"./Feature/FeatureAttachments.js";import d from"./Feature/FeatureContent.js";import a from"./Feature/FeatureExpression.js";import c from"./Feature/FeatureFields.js";import p from"./Feature/FeatureMedia.js";import u from"./Feature/FeatureRelationship.js";import m from"./Feature/FeatureUtilityNetworkAssociationList.js";import h from"./Feature/FeatureUtilityNetworkAssociations.js";import y from"./Feature/FeatureViewModel.js";import{css as v}from"./Feature/resources.js";import{FeatureContentMixin as w}from"./Feature/support/FeatureContentMixin.js";import{loadCalciteComponents as g}from"./support/componentsUtils.js";import{globalCss as f}from"./support/globalCss.js";import{Heading as _}from"./support/Heading.js";import"./support/widgetUtils.js";import{messageBundle as M}from"./support/decorators/messageBundle.js";import{tsx as E}from"./support/jsxFactory.js";import{substitute as b}from"../intl/substitute.js";const F={title:!0,content:!0,lastEditedInfo:!0};let j=class extends(w(r)){constructor(e,t){super(e,t),this._contentWidgets=[],this.flowType="feature",this.flowItems=null,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.visibleElements={...F},this.viewModel=new y}initialize(){this.addHandles(t((()=>this.viewModel?.contentViewModels),(()=>this._setupContentWidgets()),s))}loadDependencies(){return g({notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})}destroy(){this._destroyContentWidgets()}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(e){this.viewModel.defaultPopupTemplateEnabled=e}get isTable(){return this.viewModel.isTable}get icon(){return"polygon"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get title(){return this.viewModel.title}castVisibleElements(e){return{...F,...e}}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}setActiveMedia(e,t){return this.viewModel.setActiveMedia(e,t)}nextMedia(e){return this.viewModel.nextMedia(e)}previousMedia(e){return this.viewModel.previousMedia(e)}render(){const{state:e}=this.viewModel,t=E("div",{class:v.container,key:"container"},this._renderTitle(),"error"===e?this._renderError():"loading"===e?this._renderLoading():this._renderContentContainer());return E("div",{class:this.classes(v.base,f.widget)},t)}_renderError(){const{messagesCommon:e,messages:t,visibleElements:s}=this;return E("calcite-notice",{icon:"exclamation-mark-circle",kind:"danger",open:!0,scale:"s"},s.title?E("div",{key:"error-title",slot:"title"},e.errorMessage):null,E("div",{key:"error-message",slot:"message"},t.loadingError))}_renderLoading(){return E("div",{class:v.loadingSpinnerContainer,key:"loading-container"},E("calcite-loader",{inline:!0,label:""}))}_renderContentContainer(){const{visibleElements:e}=this;return e.content?E("div",{class:v.main},[this._renderContent(),this._renderLastEditInfo()]):null}_renderTitle(){const{visibleElements:e,title:t}=this;return e.title?E(_,{class:v.title,innerHTML:t,level:this.headingLevel}):null}_renderContent(){const e=this.viewModel.content,t="content";if(!e)return null;if(Array.isArray(e))return e.length?E("div",{class:v.contentNode,key:`${t}-content-elements`},e.map(this._renderContentElement,this)):null;if("string"==typeof e){const e=this._contentWidgets[0];return!e||e.destroyed?null:E("div",{class:this.classes(v.contentNode,v.contentNodeText),key:`${t}-content`},e.render())}return this.renderNodeContent(e)}_renderContentElement(e,t){const{visibleElements:s}=this;if("boolean"!=typeof s.content&&!s.content?.[e.type])return null;switch(e.type){case"attachments":return this._renderAttachments(t);case"custom":return this._renderCustom(e,t);case"fields":return this._renderFields(t);case"media":return this._renderMedia(t);case"text":return this._renderText(e,t);case"expression":return this._renderExpression(t);case"relationship":return this._renderRelationship(t);case"utility-network-associations":return this._renderAssociation(t);default:return null}}_renderAttachments(e){const t=this._contentWidgets[e];if(!t||t.destroyed)return null;const{state:s,attachmentInfos:i}=t.viewModel;return"loading"===s||i.length>0?E("div",{class:this.classes(v.contentElement),key:this._buildKey("attachments-element",e)},t.render()):null}_renderRelationship(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&this.flowItems?E("div",{class:v.contentElement,key:this._buildKey("relationship-element",e)},t.render()):null}_renderAssociation(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&this.flowItems?E("div",{class:v.contentElement,key:this._buildKey("utility-network-association-element",e)},t.render()):null}_renderExpression(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&t.viewModel.contentElement?E("div",{class:v.contentElement,key:this._buildKey("expression-element",e)},t.render()):null}_renderCustom(e,t){const{creator:s}=e,i=this._contentWidgets[t];return!i||i.destroyed?null:s?E("div",{class:v.contentElement,key:this._buildKey("custom-element",t)},i.render()):null}_renderFields(e){const t=this._contentWidgets[e];return!t||t.destroyed?null:E("div",{class:v.contentElement,key:this._buildKey("fields-element",e)},t.render())}_renderMedia(e){const t=this._contentWidgets[e];return!t||t.destroyed?null:E("div",{class:v.contentElement,key:this._buildKey("media-element",e)},t.render())}_renderLastEditInfo(){const{visibleElements:e,messages:t}=this,{lastEditInfo:s}=this.viewModel;if(!s||!e.lastEditedInfo)return null;const{date:i,user:n}=s,o="edit"===s.type?n?t.lastEditedByUser:t.lastEdited:n?t.lastCreatedByUser:t.lastCreated,r=b(o,{date:i,user:n});return E("div",{class:this.classes(v.lastEditedInfo,v.contentElement),key:"edit-info-element"},r)}_renderText(e,t){const s=e.text,i=this._contentWidgets[t];return!i||i.destroyed?null:s?E("div",{class:this.classes(v.contentElement,v.text),key:this._buildKey("text-element",t)},i.render()):null}_buildKey(e,...t){return`${e}__${this.viewModel?.graphic?.uid||"0"}-${t.join("-")}`}_destroyContentWidget(e){e&&(e.viewModel=null,!e.destroyed&&e.destroy())}_destroyContentWidgets(){this._contentWidgets.forEach((e=>this._destroyContentWidget(e))),this._contentWidgets=[]}_setupContentWidgets(){this._destroyContentWidgets();const{headingLevel:e,visibleElements:t,flowItems:s,viewModel:i}=this,n=i?.content,{contentViewModels:o}=i;if(Array.isArray(n))n.forEach(((n,r)=>{if("attachments"===n.type&&(this._contentWidgets[r]=new l({displayType:n.displayType,headingLevel:t.title&&e<6?e+1:e,viewModel:o[r]})),"fields"===n.type&&(this._contentWidgets[r]=new c({viewModel:o[r]})),"media"===n.type&&(this._contentWidgets[r]=new p({viewModel:o[r]})),"text"===n.type&&(this._contentWidgets[r]=new d({viewModel:o[r]})),"custom"===n.type&&(this._contentWidgets[r]=new d({viewModel:o[r]})),"expression"===n.type&&(this._contentWidgets[r]=new a({viewModel:o[r]})),"relationship"===n.type){const e=new u({flowItems:s,featureVisibleElements:t,viewModel:o[r]});this._contentWidgets[r]=e}if("utility-network-associations"===n.type){const e=e=>{const{viewModel:n,listType:o,title:r}=e;if(!s)return;n.activeAssociationType=o;const l=new m({viewModel:n,parentFeatureViewModel:i,listType:o,title:r,featureVisibleElements:t,description:i.title,flowItems:s});s.push(l)},n=new h({flowItems:s,onSelectAssociationType:e,parentFeatureViewModel:i,featureVisibleElements:t,viewModel:o[r]});this._contentWidgets[r]=n}}),this);else{const e=o[0];e&&!e.destroyed&&(this._contentWidgets[0]=new d({viewModel:e}))}this.scheduleRender()}};e([i()],j.prototype,"flowType",void 0),e([i()],j.prototype,"graphic",null),e([i()],j.prototype,"defaultPopupTemplateEnabled",null),e([i()],j.prototype,"flowItems",void 0),e([i()],j.prototype,"headingLevel",void 0),e([i({readOnly:!0})],j.prototype,"isTable",null),e([i()],j.prototype,"icon",null),e([i()],j.prototype,"label",null),e([i()],j.prototype,"location",null),e([i(),M("esri/widgets/Feature/t9n/Feature")],j.prototype,"messages",void 0),e([i(),M("esri/t9n/common")],j.prototype,"messagesCommon",void 0),e([i()],j.prototype,"spatialReference",null),e([i()],j.prototype,"timeZone",null),e([i({readOnly:!0})],j.prototype,"title",null),e([i()],j.prototype,"visibleElements",void 0),e([n("visibleElements")],j.prototype,"castVisibleElements",null),e([i()],j.prototype,"map",null),e([i()],j.prototype,"view",null),e([i({type:y})],j.prototype,"viewModel",void 0),j=e([o("esri.widgets.Feature")],j);const W=j;export{W as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{watch as t,initial as s}from"../core/reactiveUtils.js";import{property as i}from"../core/accessorSupport/decorators/property.js";import{cast as n}from"../core/accessorSupport/decorators/cast.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as o}from"../core/accessorSupport/decorators/subclass.js";import r from"./Widget.js";import l from"./Feature/FeatureAttachments.js";import d from"./Feature/FeatureContent.js";import a from"./Feature/FeatureExpression.js";import c from"./Feature/FeatureFields.js";import p from"./Feature/FeatureMedia.js";import u from"./Feature/FeatureRelationship.js";import m from"./Feature/FeatureUtilityNetworkAssociations.js";import h from"./Feature/FeatureViewModel.js";import{css as y}from"./Feature/resources.js";import{FeatureContentMixin as v}from"./Feature/support/FeatureContentMixin.js";import{loadCalciteComponents as w}from"./support/componentsUtils.js";import{globalCss as g}from"./support/globalCss.js";import{Heading as f}from"./support/Heading.js";import"./support/widgetUtils.js";import{messageBundle as _}from"./support/decorators/messageBundle.js";import{tsx as M}from"./support/jsxFactory.js";import{substitute as E}from"../intl/substitute.js";const b={title:!0,content:!0,lastEditedInfo:!0};let F=class extends(v(r)){constructor(e,t){super(e,t),this._contentWidgets=[],this.flowType="feature",this.flowItems=null,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.visibleElements={...b},this.viewModel=new h}initialize(){this.addHandles(t((()=>this.viewModel?.contentViewModels),(()=>this._setupContentWidgets()),s))}loadDependencies(){return w({notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})}destroy(){this._destroyContentWidgets()}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(e){this.viewModel.defaultPopupTemplateEnabled=e}get isTable(){return this.viewModel.isTable}get icon(){return"polygon"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get title(){return this.viewModel.title}castVisibleElements(e){return{...b,...e}}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}setActiveMedia(e,t){return this.viewModel.setActiveMedia(e,t)}nextMedia(e){return this.viewModel.nextMedia(e)}previousMedia(e){return this.viewModel.previousMedia(e)}render(){const{state:e}=this.viewModel,t=M("div",{class:y.container,key:"container"},this._renderTitle(),"error"===e?this._renderError():"loading"===e?this._renderLoading():this._renderContentContainer());return M("div",{class:this.classes(y.base,g.widget)},t)}_renderError(){const{messagesCommon:e,messages:t,visibleElements:s}=this;return M("calcite-notice",{icon:"exclamation-mark-circle",kind:"danger",open:!0,scale:"s"},s.title?M("div",{key:"error-title",slot:"title"},e.errorMessage):null,M("div",{key:"error-message",slot:"message"},t.loadingError))}_renderLoading(){return M("div",{class:y.loadingSpinnerContainer,key:"loading-container"},M("calcite-loader",{inline:!0,label:""}))}_renderContentContainer(){const{visibleElements:e}=this;return e.content?M("div",{class:y.main},[this._renderContent(),this._renderLastEditInfo()]):null}_renderTitle(){const{visibleElements:e,title:t}=this;return e.title?M(f,{class:y.title,innerHTML:t,level:this.headingLevel}):null}_renderContent(){const e=this.viewModel.content,t="content";if(!e)return null;if(Array.isArray(e))return e.length?M("div",{class:y.contentNode,key:`${t}-content-elements`},e.map(this._renderContentElement,this)):null;if("string"==typeof e){const e=this._contentWidgets[0];return!e||e.destroyed?null:M("div",{class:this.classes(y.contentNode,y.contentNodeText),key:`${t}-content`},e.render())}return this.renderNodeContent(e)}_renderContentElement(e,t){const{visibleElements:s}=this;if("boolean"!=typeof s.content&&!s.content?.[e.type])return null;switch(e.type){case"attachments":return this._renderAttachments(t);case"custom":return this._renderCustom(e,t);case"fields":return this._renderFields(t);case"media":return this._renderMedia(t);case"text":return this._renderText(e,t);case"expression":return this._renderExpression(t);case"relationship":return this._renderRelationship(t);case"utility-network-associations":return this._renderAssociation(t);default:return null}}_renderAttachments(e){const t=this._contentWidgets[e];if(!t||t.destroyed)return null;const{state:s,attachmentInfos:i}=t.viewModel;return"loading"===s||i.length>0?M("div",{class:this.classes(y.contentElement),key:this._buildKey("attachments-element",e)},t.render()):null}_renderRelationship(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&this.flowItems?M("div",{class:y.contentElement,key:this._buildKey("relationship-element",e)},t.render()):null}_renderAssociation(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&this.flowItems?M("div",{class:y.contentElement,key:this._buildKey("utility-network-association-element",e)},t.render()):null}_renderExpression(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&t.viewModel.contentElement?M("div",{class:y.contentElement,key:this._buildKey("expression-element",e)},t.render()):null}_renderCustom(e,t){const{creator:s}=e,i=this._contentWidgets[t];return!i||i.destroyed?null:s?M("div",{class:y.contentElement,key:this._buildKey("custom-element",t)},i.render()):null}_renderFields(e){const t=this._contentWidgets[e];return!t||t.destroyed?null:M("div",{class:y.contentElement,key:this._buildKey("fields-element",e)},t.render())}_renderMedia(e){const t=this._contentWidgets[e];return!t||t.destroyed?null:M("div",{class:y.contentElement,key:this._buildKey("media-element",e)},t.render())}_renderLastEditInfo(){const{visibleElements:e,messages:t}=this,{lastEditInfo:s}=this.viewModel;if(!s||!e.lastEditedInfo)return null;const{date:i,user:n}=s,o="edit"===s.type?n?t.lastEditedByUser:t.lastEdited:n?t.lastCreatedByUser:t.lastCreated,r=E(o,{date:i,user:n});return M("div",{class:this.classes(y.lastEditedInfo,y.contentElement),key:"edit-info-element"},r)}_renderText(e,t){const s=e.text,i=this._contentWidgets[t];return!i||i.destroyed?null:s?M("div",{class:this.classes(y.contentElement,y.text),key:this._buildKey("text-element",t)},i.render()):null}_buildKey(e,...t){return`${e}__${this.viewModel?.graphic?.uid||"0"}-${t.join("-")}`}_destroyContentWidget(e){e&&(e.viewModel=null,!e.destroyed&&e.destroy())}_destroyContentWidgets(){this._contentWidgets.forEach((e=>this._destroyContentWidget(e))),this._contentWidgets=[]}_setupContentWidgets(){this._destroyContentWidgets();const{headingLevel:e,visibleElements:t,flowItems:s,viewModel:i}=this,n=i?.content,{contentViewModels:o}=i;if(Array.isArray(n))n.forEach(((n,r)=>{if("attachments"===n.type&&(this._contentWidgets[r]=new l({displayType:n.displayType,headingLevel:t.title&&e<6?e+1:e,viewModel:o[r]})),"fields"===n.type&&(this._contentWidgets[r]=new c({viewModel:o[r]})),"media"===n.type&&(this._contentWidgets[r]=new p({viewModel:o[r]})),"text"===n.type&&(this._contentWidgets[r]=new d({viewModel:o[r]})),"custom"===n.type&&(this._contentWidgets[r]=new d({viewModel:o[r]})),"expression"===n.type&&(this._contentWidgets[r]=new a({viewModel:o[r]})),"relationship"===n.type){const e=new u({flowItems:s,featureVisibleElements:t,viewModel:o[r]});this._contentWidgets[r]=e}if("utility-network-associations"===n.type){const e=async e=>{const{viewModel:n,listType:o,title:r}=e;if(!s)return;n.activeAssociationType=o;const{default:l}=await import("./Feature/FeatureUtilityNetworkAssociationList.js"),d=new l({viewModel:n,parentFeatureViewModel:i,listType:o,title:r,featureVisibleElements:t,description:i.title,flowItems:s});s.push(d)},n=new m({flowItems:s,onSelectAssociationType:e,parentFeatureViewModel:i,featureVisibleElements:t,viewModel:o[r]});this._contentWidgets[r]=n}}),this);else{const e=o[0];e&&!e.destroyed&&(this._contentWidgets[0]=new d({viewModel:e}))}this.scheduleRender()}};e([i()],F.prototype,"flowType",void 0),e([i()],F.prototype,"graphic",null),e([i()],F.prototype,"defaultPopupTemplateEnabled",null),e([i()],F.prototype,"flowItems",void 0),e([i()],F.prototype,"headingLevel",void 0),e([i({readOnly:!0})],F.prototype,"isTable",null),e([i()],F.prototype,"icon",null),e([i()],F.prototype,"label",null),e([i()],F.prototype,"location",null),e([i(),_("esri/widgets/Feature/t9n/Feature")],F.prototype,"messages",void 0),e([i(),_("esri/t9n/common")],F.prototype,"messagesCommon",void 0),e([i()],F.prototype,"spatialReference",null),e([i()],F.prototype,"timeZone",null),e([i({readOnly:!0})],F.prototype,"title",null),e([i()],F.prototype,"visibleElements",void 0),e([n("visibleElements")],F.prototype,"castVisibleElements",null),e([i()],F.prototype,"map",null),e([i()],F.prototype,"view",null),e([i({type:h})],F.prototype,"viewModel",void 0),F=e([o("esri.widgets.Feature")],F);const j=F;export{j 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{_ as e}from"../../../chunks/tslib.es6.js";import"../../../intl.js";import{property as t}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{getFeatureFormTitle as i}from"../featureFormUtils.js";import o from"../UtilityNetworkAssociationInput.js";import{AssociationDetails as r}from"./AssociationDetails.js";import a from"./VisibleElements.js";import{loadCalciteComponents as n}from"../../support/componentsUtils.js";import{globalCss as c}from"../../support/globalCss.js";import{Heading as l}from"../../support/Heading.js";import"../../support/widgetUtils.js";import{messageBundle as d}from"../../support/decorators/messageBundle.js";import{tsx as p,tsxFragment as u}from"../../support/jsxFactory.js";import m from"../../support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js";import h from"../../support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js";import{isConnectivity as y,isConnectivityMidspan as g,formatPercentAlong as f}from"../../support/UtilityNetworkAssociations/utilityNetworkUtils.js";import{substitute as F}from"../../../intl/substitute.js";const _="esri-feature-form-utility-network-association-list",v={base:_,header:`${_}__header`,headingContent:`${_}__heading-content`,listContainer:`${_}__list-container`};let L=class extends h{constructor(e,t){super(e,t),this._isLoadingSelectFeature=!1,this.associationInput=null,this.headingLevel=5,this.messagesFeatureForm=null,this.onSelectLayer=()=>{},this.onSelectFeature=async()=>{},this.onAddAssociation=()=>{},this.viewModel=new m,this.visibleElements=new a}initialize(){this.setUpObserver()}loadDependencies(){return n({chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),fab:()=>import("@esri/calcite-components/dist/components/calcite-fab"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}get associatedFeatureCount(){const{associationInput:e}=this;if(!e)return 0;const{associatedFeatureInfos:t,associatedLayer:s}=e,i=s?t.get(s):null;return i?i.length:0}render(){const{associationInput:e}=this;if(!e)return p("div",{class:this.classes(v.base,c.widget)});const{associatedLayer:t}=e,{state:s}=this.viewModel;return p("div",{class:this.classes(v.base,c.widget)},"loading"===s||"querying"===s?this.renderLoading():t?this._renderFeatureList(e,t):this._renderLayerList(e))}_renderLayerList(e){const{associatedFeatureInfos:t,editable:s}=e;return p("div",{class:v.listContainer},p("calcite-list",{label:this.messagesFeatureForm?.associations.associatedLayers},Array.from(t.keys(),(t=>this._renderLayerItem(e,t)))),s?p("calcite-fab",{appearance:"outline-fill",icon:"plus",key:`${e.uid}-add-button`,kind:"neutral",onclick:()=>this.onAddAssociation({feature:e.feature,associationType:e.activeAssociationType,utilityNetwork:e.utilityNetwork}),text:this.messagesCommon.add,textEnabled:!0}):null)}_renderFeatureList(e,t){return p(u,null,this._renderHeader(e,t),p("div",{class:v.listContainer},this.renderFeatureCountWarning(),p("calcite-list",{label:this.messagesFeatureForm?.associations.associatedFeatures},this._renderAssociatedFeatureListPage(e,t),this.renderFeatureObserver())))}_renderLayerTitle(e){return e.title?p(l,{key:"title",level:this.headingLevel},p("div",{class:v.headingContent},p("calcite-icon",{icon:"layer"}),e.title)):null}_renderTotal(e,t){const{messagesFeature:s}=this,{associatedFeatureInfos:i}=e,o=i.get(t),r=F(s?.numberRecords,{number:o?.length??"0"});return p("div",{key:t.id},r)}_renderHeader(e,t){const{messagesFeatureForm:s}=this,{activeAssociationType:i,featureItem:o,feature:a}=e;return p("div",{class:v.header,key:"filter"},this.visibleElements.associationDetails?p(r,{associationType:i?.type,feature:a,heading:o?.label,messages:s.associations}):void 0,this._renderLayerTitle(t),this.renderFilter(),this._renderTotal(e,t))}_renderAssociatedFeatureListPage(e,t){const{filterText:s,endIndex:o}=this,r=this.messagesCommon.untitled,a=e.associatedFeatureInfos.get(t)?.filter((e=>i(e,r).toLowerCase().includes(s)??!1)).slice(0,o).toArray()??[];return[...this._renderTooltips(a),...this._renderAssociatedFeatureList(a)]}_renderItemTooltip(e){const{tooltipReferenceMap:t}=this,s=e.feature.uid.toString();return y(e.association)?p("calcite-tooltip",{key:`tooltip-${s}`,overlayPositioning:"fixed",referenceElement:t.get(s)},this.getConnectivityTooltip(e.association.associationType)):null}_renderAssociatedFeature(e){const t=this.messagesCommon.untitled,s=i(e,t),o=e.feature.uid.toString();return p("calcite-list-item",{description:e.terminalName??"",key:`associated-feature-type-${o}`,label:s,onCalciteListItemSelect:()=>this._selectAssociation(e)},y(e.association)?this.renderConnectivityIcon(e.association.associationType,o):null,g(e.association)?p("calcite-chip",{label:f(e.association),scale:"s",slot:"content-end"},f(e.association)):null,p("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderTooltips(e){return e.map((e=>this._renderItemTooltip(e)))}_renderAssociatedFeatureList(e){return e.map((e=>this._renderAssociatedFeature(e)))}_renderLayerItem(e,t){const{associatedFeatureInfos:s}=e,i=s.get(t)?.length??0;return p("calcite-list-item",{key:`${t.id}-show-all`,label:t.title??this.messagesCommon.untitled,open:!0,value:t.id,onCalciteListItemSelect:()=>this._showAllAssociations(t)},p("calcite-chip",{label:i.toString(),scale:"s",slot:"content-end"},i),p("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}async _selectAssociation(e){this._isLoadingSelectFeature||(this._isLoadingSelectFeature=!0,await this.onSelectFeature({feature:e.feature,association:e.association}),this._isLoadingSelectFeature=!1)}_showAllAssociations(e){this.onSelectLayer({layer:e,associationInput:this.associationInput})}};e([t()],L.prototype,"associatedFeatureCount",null),e([t({type:o})],L.prototype,"associationInput",void 0),e([t()],L.prototype,"headingLevel",void 0),e([t(),d("esri/widgets/FeatureForm/t9n/FeatureForm")],L.prototype,"messagesFeatureForm",void 0),e([t({constructOnly:!0})],L.prototype,"onSelectLayer",void 0),e([t({constructOnly:!0})],L.prototype,"onSelectFeature",void 0),e([t({constructOnly:!0})],L.prototype,"onAddAssociation",void 0),e([t({type:m})],L.prototype,"viewModel",void 0),e([t({type:a,nonNullable:!0})],L.prototype,"visibleElements",void 0),L=e([s("esri.widgets.FeatureForm.FeatureFormUtilityNetworkAssociations.FeatureFormUtilityNetworkAssociationList")],L);const A=L;export{A as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../intl.js";import{stripHTML as t}from"../../../core/string.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 i}from"../../../core/accessorSupport/decorators/subclass.js";import{getFeatureFormTitle as o}from"../featureFormUtils.js";import r from"../UtilityNetworkAssociationInput.js";import{AssociationDetails as a}from"./AssociationDetails.js";import n from"./VisibleElements.js";import{loadCalciteComponents as c}from"../../support/componentsUtils.js";import{globalCss as l}from"../../support/globalCss.js";import{Heading as d}from"../../support/Heading.js";import"../../support/widgetUtils.js";import{messageBundle as p}from"../../support/decorators/messageBundle.js";import{tsx as u,tsxFragment as m}from"../../support/jsxFactory.js";import h from"../../support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js";import y from"../../support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js";import{isConnectivity as g,isConnectivityMidspan as f,formatPercentAlong as F}from"../../support/UtilityNetworkAssociations/utilityNetworkUtils.js";import{substitute as _}from"../../../intl/substitute.js";const v="esri-feature-form-utility-network-association-list",L={base:v,header:`${v}__header`,headingContent:`${v}__heading-content`,listContainer:`${v}__list-container`};let A=class extends y{constructor(e,t){super(e,t),this._isLoadingSelectFeature=!1,this.associationInput=null,this.headingLevel=5,this.messagesFeatureForm=null,this.onSelectLayer=()=>{},this.onSelectFeature=async()=>{},this.onAddAssociation=()=>{},this.viewModel=new h,this.visibleElements=new n}initialize(){this.setUpObserver()}loadDependencies(){return c({chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),fab:()=>import("@esri/calcite-components/dist/components/calcite-fab"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}get associatedFeatureCount(){const{associationInput:e}=this;if(!e)return 0;const{associatedFeatureInfos:t,associatedLayer:s}=e,i=s?t.get(s):null;return i?i.length:0}render(){const{associationInput:e}=this;if(!e)return u("div",{class:this.classes(L.base,l.widget)});const{associatedLayer:t}=e,{state:s}=this.viewModel;return u("div",{class:this.classes(L.base,l.widget)},"loading"===s||"querying"===s?this.renderLoading():t?this._renderFeatureList(e,t):this._renderLayerList(e))}_renderLayerList(e){const{associatedFeatureInfos:t,editable:s}=e;return u("div",{class:L.listContainer},u("calcite-list",{label:this.messagesFeatureForm?.associations.associatedLayers},Array.from(t.keys(),(t=>this._renderLayerItem(e,t)))),s?u("calcite-fab",{appearance:"outline-fill",icon:"plus",key:`${e.uid}-add-button`,kind:"neutral",onclick:()=>this.onAddAssociation({feature:e.feature,associationType:e.activeAssociationType,utilityNetwork:e.utilityNetwork}),text:this.messagesCommon.add,textEnabled:!0}):null)}_renderFeatureList(e,t){return u(m,null,this._renderHeader(e,t),u("div",{class:L.listContainer},this.renderFeatureCountWarning(),u("calcite-list",{label:this.messagesFeatureForm?.associations.associatedFeatures},this._renderAssociatedFeatureListPage(e,t),this.renderFeatureObserver())))}_renderLayerTitle(e){return e.title?u(d,{key:"title",level:this.headingLevel},u("div",{class:L.headingContent},u("calcite-icon",{icon:"layer"}),e.title)):null}_renderTotal(e,t){const{messagesFeature:s}=this,{associatedFeatureInfos:i}=e,o=i.get(t),r=_(s?.numberRecords,{number:o?.length??"0"});return u("div",{key:t.id},r)}_renderHeader(e,t){const{messagesFeatureForm:s}=this,{activeAssociationType:i,featureItem:o,feature:r}=e;return u("div",{class:L.header,key:"filter"},this.visibleElements.associationDetails?u(a,{associationType:i?.type,feature:r,heading:o?.label,messages:s.associations}):void 0,this._renderLayerTitle(t),this.renderFilter(),this._renderTotal(e,t))}_renderAssociatedFeatureListPage(e,t){const{filterText:s,endIndex:i}=this,r=this.messagesCommon.untitled,a=e.associatedFeatureInfos.get(t)?.filter((e=>o(e,r).toLowerCase().includes(s)??!1)).slice(0,i).toArray()??[];return[...this._renderTooltips(a),...this._renderAssociatedFeatureList(a)]}_renderItemTooltip(e){const{tooltipReferenceMap:t}=this,s=e.feature.uid.toString();return g(e.association)?u("calcite-tooltip",{key:`tooltip-${s}`,overlayPositioning:"fixed",referenceElement:t.get(s)},this.getConnectivityTooltip(e.association.associationType)):null}_renderAssociatedFeature(e){const s=this.messagesCommon.untitled,i=o(e,s),r=e.feature.uid.toString();return u("calcite-list-item",{description:t(e.terminalName??""),key:`associated-feature-type-${r}`,label:t(i),onCalciteListItemSelect:()=>this._selectAssociation(e)},g(e.association)?this.renderConnectivityIcon(e.association.associationType,r):null,f(e.association)?u("calcite-chip",{label:F(e.association),scale:"s",slot:"content-end"},F(e.association)):null,u("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderTooltips(e){return e.map((e=>this._renderItemTooltip(e)))}_renderAssociatedFeatureList(e){return e.map((e=>this._renderAssociatedFeature(e)))}_renderLayerItem(e,t){const{associatedFeatureInfos:s}=e,i=s.get(t)?.length??0;return u("calcite-list-item",{key:`${t.id}-show-all`,label:t.title??this.messagesCommon.untitled,open:!0,value:t.id,onCalciteListItemSelect:()=>this._showAllAssociations(t)},u("calcite-chip",{label:i.toString(),scale:"s",slot:"content-end"},i),u("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}async _selectAssociation(e){this._isLoadingSelectFeature||(this._isLoadingSelectFeature=!0,await this.onSelectFeature({feature:e.feature,association:e.association}),this._isLoadingSelectFeature=!1)}_showAllAssociations(e){this.onSelectLayer({layer:e,associationInput:this.associationInput})}};e([s()],A.prototype,"associatedFeatureCount",null),e([s({type:r})],A.prototype,"associationInput",void 0),e([s()],A.prototype,"headingLevel",void 0),e([s(),p("esri/widgets/FeatureForm/t9n/FeatureForm")],A.prototype,"messagesFeatureForm",void 0),e([s({constructOnly:!0})],A.prototype,"onSelectLayer",void 0),e([s({constructOnly:!0})],A.prototype,"onSelectFeature",void 0),e([s({constructOnly:!0})],A.prototype,"onAddAssociation",void 0),e([s({type:h})],A.prototype,"viewModel",void 0),e([s({type:n,nonNullable:!0})],A.prototype,"visibleElements",void 0),A=e([i("esri.widgets.FeatureForm.FeatureFormUtilityNetworkAssociations.FeatureFormUtilityNetworkAssociationList")],A);const b=A;export{b 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{_ as e}from"../../../chunks/tslib.es6.js";import"../../../intl.js";import{watch as t}from"../../../core/reactiveUtils.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import s from"../../Widget.js";import o from"../UtilityNetworkAssociationAddAssociationViewModel.js";import{loadCalciteComponents as l}from"../../support/componentsUtils.js";import a from"../../support/FilterBuilder.js";import{globalCss as n}from"../../support/globalCss.js";import{Heading as d}from"../../support/Heading.js";import"../../support/widgetUtils.js";import{messageBundle as c}from"../../support/decorators/messageBundle.js";import{tsx as u}from"../../support/jsxFactory.js";import{substitute as p}from"../../../intl/substitute.js";const h="esri-feature-form-utility-network-association-layers",m={base:h,header:`${h}__header`,headingContent:`${h}__heading-content`,featureObserver:`${h}__feature-observer`,filterContainer:`${h}__filter-container`,filterOptionsContainer:`${h}__filter-options-container`,filterOptionsHeader:`${h}__filter-options-header`,listContainer:`${h}__list-container`,stickySpinnerContainer:`${h}__sticky-loading-container`,loadingContainer:`${h}__loading-container`};let _=class extends s{constructor(e,t){super(e,t),this.headingLevel=5,this.messagesCommon=null,this.messagesFeature=null,this.messagesFeatureForm=null,this.messagesFilterBuilder=null,this.viewModel=new o,this._filterBuilder=new a,this._featureFilterText="",this._layerFilterText="",this._observer=new IntersectionObserver((([e])=>{e?.isIntersecting&&this._increaseFeaturePage()}),{root:window.document}),this._observerNode=null}initialize(){this.addHandles([t((()=>this.viewModel),(()=>this.reset())),t((()=>[this.viewModel.state,this._observerNode]),(()=>this._onObserverChange())),t((()=>this.selectedLayer),(e=>{this._filterBuilder.layer=e,e||(this.filterOptionsVisible=!1,this._featureFilterText="")}))])}loadDependencies(){return l({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})}get filterOptionsVisible(){return this.viewModel.filterOptionsVisible}set filterOptionsVisible(e){this.viewModel.filterOptionsVisible=e}get selectedLayer(){return this.viewModel.selectedLayer}set selectedLayer(e){this.viewModel.selectedLayer=e}get selectedFeature(){return this.viewModel.selectedFeature}set selectedFeature(e){this.viewModel.selectedFeature=e}get filterWhereClause(){return this.viewModel.filterWhereClause}set filterWhereClause(e){this.viewModel.filterWhereClause=e,e||this._filterBuilder.reset()}get _filteredFeatureItems(){const{_featureFilterText:e}=this;return this.viewModel.featureItems.map((e=>({label:e.label,graphic:e.feature,layer:e.feature.sourceLayer}))).filter((t=>t.label?.toLowerCase().includes(e)??!1))}render(){const{state:e,filterOptionsVisible:t}=this.viewModel;return u("div",{class:this.classes(m.base,n.widget)},"loading"===e?this._renderLoading():t?this._renderFilterOptions():this.selectedLayer?this._renderFeatures():this._renderLayers())}applyFilterOptions(){const{selectedLayer:e}=this;this.filterOptionsVisible=!1,e&&(this.filterWhereClause=this._filterBuilder.whereClause)}reset(){this.filterWhereClause=null,this._featureFilterText="",this._layerFilterText="",this.filterOptionsVisible=!1,this._filterBuilder.reset()}async _onObserverChange(){this._observerNode&&this._observer.unobserve(this._observerNode);const{state:e}=this.viewModel;this._observerNode&&"ready"===e&&this._observer.observe(this._observerNode)}_increaseFeaturePage(){const{featureCount:e,featurePage:t,state:r}=this.viewModel;e||1===t?"ready"===r&&this.viewModel.featurePage++:this.viewModel.featurePage=1}_renderStickyLoading(){return"querying"===this.viewModel.state?u("div",{class:m.stickySpinnerContainer,key:"sticky-loader"},this._renderLoadingIcon()):null}_renderLoading(){return u("div",{class:m.loadingContainer,key:"loading-container"},this._renderLoadingIcon())}_renderLoadingIcon(){return u("calcite-loader",{inline:!0,label:this.messagesCommon.loading})}_renderFilterOptions(){return u("div",{class:m.filterOptionsContainer},u("div",{class:m.filterOptionsHeader},u("span",null,this.messagesFilterBuilder.widgetLabel),u("calcite-button",{appearance:"transparent",onclick:()=>this._filterBuilder.reset()},this.messagesCommon.clear)),this._filterBuilder.render())}_renderLayers(){const e=this.messagesFeatureForm.associations,t=e.availableLayers,r=e.filterLayers;return u("div",null,this._renderHeader({heading:t,placeholder:r,renderFilterOptions:!1,renderTotal:!1}),u("div",{class:m.listContainer},u("calcite-list",{label:e.associatedFeatures},this._renderLayerItems(),this._renderStickyLoading())))}_renderLayerItems(){const{_layerFilterText:e,viewModel:t,messagesCommon:r}=this,{layerItems:i}=t;return i.map((e=>({label:e.title??r.untitled,layer:e}))).filter((t=>t.label?.toLowerCase().includes(e)??!1)).toArray().map((e=>this._renderLayerItem(e)))}_renderLayerItem(e){const{label:t,layer:r}=e;return u("calcite-list-item",{key:`layer-item-${r.id}`,label:t,onCalciteListItemSelect:()=>{this.selectedLayer=r,this._filterBuilder.reset()}},u("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderFeatures(){const{selectedLayer:e}=this;if(!e)return;const t=this.messagesFeatureForm.associations,r=e.title??this.messagesCommon.untitled,i=t.filterFeatures;return u("div",null,this._renderHeader({heading:r,placeholder:i,renderFilterOptions:!0,renderTotal:!0}),u("div",{class:m.listContainer},u("calcite-list",{label:t.associatedFeatures},this._renderFeatureItems(),this._renderStickyLoading(),this._renderFeatureObserver())))}_renderFeatureItems(){return this._filteredFeatureItems.toArray().map((e=>this._renderFeatureItem(e)))}_renderFeatureItem(e){const{label:t,graphic:r}=e;return u("calcite-list-item",{key:`feature-item-${r.uid}`,label:t,onCalciteListItemSelect:()=>{this.selectedFeature={feature:r,label:t}}},u("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_onObserverCreate(e){this._observerNode=e}_renderFeatureObserver(){return u("div",{afterCreate:this._onObserverCreate,bind:this,class:m.featureObserver,key:"feature-observer"})}_renderHeader(e){return u("div",{class:m.header,key:"filter"},this._renderHeading(e.heading),this._renderFilter(e.placeholder,e.renderFilterOptions),e.renderTotal?this._renderTotal():null)}_renderHeading(e){return e?u(d,{key:"title",level:this.headingLevel},u("div",{class:m.headingContent},u("calcite-icon",{icon:"layer"}),e)):null}_renderFilter(e,t){const r=!this.selectedLayer,i=r?this._layerFilterText:this._featureFilterText;return u("div",{class:m.filterContainer,key:"filter"},u("calcite-input",{icon:"search",placeholder:e,type:"search",value:i,onCalciteInputInput:e=>{r?this._layerFilterText=e.currentTarget.value.trim().toLowerCase():this._featureFilterText=e.currentTarget.value.trim().toLowerCase()}},t?this._renderFilterOptionsAction():null))}_renderFilterOptionsAction(){const e=this.messagesFeatureForm.associations.filterOptions;return u("calcite-action",{appearance:"transparent",icon:"sliders",indicator:!!this._filterBuilder.whereClause,onclick:()=>{this.viewModel.filterOptionsVisible=!this.viewModel.filterOptionsVisible},scale:"s",slot:"action",text:e,title:e})}_renderTotal(){const{messagesFeature:e,viewModel:t}=this,r=p(e.numberRecords,{number:t.featureCount});return u("div",{key:"total"},r)}};e([r()],_.prototype,"filterOptionsVisible",null),e([r()],_.prototype,"headingLevel",void 0),e([r(),c("esri/t9n/common")],_.prototype,"messagesCommon",void 0),e([r(),c("esri/widgets/Feature/t9n/Feature")],_.prototype,"messagesFeature",void 0),e([r(),c("esri/widgets/FeatureForm/t9n/FeatureForm")],_.prototype,"messagesFeatureForm",void 0),e([r(),c("esri/widgets/support/FilterBuilder/t9n/FilterBuilder")],_.prototype,"messagesFilterBuilder",void 0),e([r()],_.prototype,"selectedLayer",null),e([r({type:o})],_.prototype,"viewModel",void 0),e([r()],_.prototype,"selectedFeature",null),e([r()],_.prototype,"filterWhereClause",null),e([r()],_.prototype,"_filterBuilder",void 0),e([r()],_.prototype,"_featureFilterText",void 0),e([r()],_.prototype,"_layerFilterText",void 0),e([r()],_.prototype,"_observer",void 0),e([r()],_.prototype,"_filteredFeatureItems",null),e([r()],_.prototype,"_observerNode",void 0),_=e([i("esri.widgets.FeatureForm.FeatureFormUtilityNetworkAssociations.UtilityNetworkAssociationItemList")],_);const f=_;export{f as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../intl.js";import{watch as t}from"../../../core/reactiveUtils.js";import{stripHTML as r}from"../../../core/string.js";import{property as i}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 o from"../../Widget.js";import l from"../UtilityNetworkAssociationAddAssociationViewModel.js";import{loadCalciteComponents as a}from"../../support/componentsUtils.js";import n from"../../support/FilterBuilder.js";import{globalCss as d}from"../../support/globalCss.js";import{Heading as c}from"../../support/Heading.js";import"../../support/widgetUtils.js";import{messageBundle as u}from"../../support/decorators/messageBundle.js";import{tsx as p}from"../../support/jsxFactory.js";import{substitute as h}from"../../../intl/substitute.js";const m="esri-feature-form-utility-network-association-layers",_={base:m,header:`${m}__header`,headingContent:`${m}__heading-content`,featureObserver:`${m}__feature-observer`,filterContainer:`${m}__filter-container`,filterOptionsContainer:`${m}__filter-options-container`,filterOptionsHeader:`${m}__filter-options-header`,listContainer:`${m}__list-container`,stickySpinnerContainer:`${m}__sticky-loading-container`,loadingContainer:`${m}__loading-container`};let f=class extends o{constructor(e,t){super(e,t),this.headingLevel=5,this.messagesCommon=null,this.messagesFeature=null,this.messagesFeatureForm=null,this.messagesFilterBuilder=null,this.viewModel=new l,this._filterBuilder=new n,this._featureFilterText="",this._layerFilterText="",this._observer=new IntersectionObserver((([e])=>{e?.isIntersecting&&this._increaseFeaturePage()}),{root:window.document}),this._observerNode=null}initialize(){this.addHandles([t((()=>this.viewModel),(()=>this.reset())),t((()=>[this.viewModel.state,this._observerNode]),(()=>this._onObserverChange())),t((()=>this.selectedLayer),(e=>{this._filterBuilder.layer=e,e||(this.filterOptionsVisible=!1,this._featureFilterText="")}))])}loadDependencies(){return a({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})}get filterOptionsVisible(){return this.viewModel.filterOptionsVisible}set filterOptionsVisible(e){this.viewModel.filterOptionsVisible=e}get selectedLayer(){return this.viewModel.selectedLayer}set selectedLayer(e){this.viewModel.selectedLayer=e}get selectedFeature(){return this.viewModel.selectedFeature}set selectedFeature(e){this.viewModel.selectedFeature=e}get filterWhereClause(){return this.viewModel.filterWhereClause}set filterWhereClause(e){this.viewModel.filterWhereClause=e,e||this._filterBuilder.reset()}get _filteredFeatureItems(){const{_featureFilterText:e}=this;return this.viewModel.featureItems.map((e=>({label:e.label,graphic:e.feature,layer:e.feature.sourceLayer}))).filter((t=>t.label?.toLowerCase().includes(e)??!1))}render(){const{state:e,filterOptionsVisible:t}=this.viewModel;return p("div",{class:this.classes(_.base,d.widget)},"loading"===e?this._renderLoading():t?this._renderFilterOptions():this.selectedLayer?this._renderFeatures():this._renderLayers())}applyFilterOptions(){const{selectedLayer:e}=this;this.filterOptionsVisible=!1,e&&(this.filterWhereClause=this._filterBuilder.whereClause)}reset(){this.filterWhereClause=null,this._featureFilterText="",this._layerFilterText="",this.filterOptionsVisible=!1,this._filterBuilder.reset()}async _onObserverChange(){this._observerNode&&this._observer.unobserve(this._observerNode);const{state:e}=this.viewModel;this._observerNode&&"ready"===e&&this._observer.observe(this._observerNode)}_increaseFeaturePage(){const{featureCount:e,featurePage:t,state:r}=this.viewModel;e||1===t?"ready"===r&&this.viewModel.featurePage++:this.viewModel.featurePage=1}_renderStickyLoading(){return"querying"===this.viewModel.state?p("div",{class:_.stickySpinnerContainer,key:"sticky-loader"},this._renderLoadingIcon()):null}_renderLoading(){return p("div",{class:_.loadingContainer,key:"loading-container"},this._renderLoadingIcon())}_renderLoadingIcon(){return p("calcite-loader",{inline:!0,label:this.messagesCommon.loading})}_renderFilterOptions(){return p("div",{class:_.filterOptionsContainer},p("div",{class:_.filterOptionsHeader},p("span",null,this.messagesFilterBuilder.widgetLabel),p("calcite-button",{appearance:"transparent",onclick:()=>this._filterBuilder.reset()},this.messagesCommon.clear)),this._filterBuilder.render())}_renderLayers(){const e=this.messagesFeatureForm.associations,t=e.availableLayers,r=e.filterLayers;return p("div",null,this._renderHeader({heading:t,placeholder:r,renderFilterOptions:!1,renderTotal:!1}),p("div",{class:_.listContainer},p("calcite-list",{label:e.associatedFeatures},this._renderLayerItems(),this._renderStickyLoading())))}_renderLayerItems(){const{_layerFilterText:e,viewModel:t,messagesCommon:r}=this,{layerItems:i}=t;return i.map((e=>({label:e.title??r.untitled,layer:e}))).filter((t=>t.label?.toLowerCase().includes(e)??!1)).toArray().map((e=>this._renderLayerItem(e)))}_renderLayerItem(e){const{label:t,layer:i}=e;return p("calcite-list-item",{key:`layer-item-${i.id}`,label:r(t),onCalciteListItemSelect:()=>{this.selectedLayer=i,this._filterBuilder.reset()}},p("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderFeatures(){const{selectedLayer:e}=this;if(!e)return;const t=this.messagesFeatureForm.associations,r=e.title??this.messagesCommon.untitled,i=t.filterFeatures;return p("div",null,this._renderHeader({heading:r,placeholder:i,renderFilterOptions:!0,renderTotal:!0}),p("div",{class:_.listContainer},p("calcite-list",{label:t.associatedFeatures},this._renderFeatureItems(),this._renderStickyLoading(),this._renderFeatureObserver())))}_renderFeatureItems(){return this._filteredFeatureItems.toArray().map((e=>this._renderFeatureItem(e)))}_renderFeatureItem(e){const{label:t,graphic:i}=e;return p("calcite-list-item",{key:`feature-item-${i.uid}`,label:r(t),onCalciteListItemSelect:()=>{this.selectedFeature={feature:i,label:t}}},p("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_onObserverCreate(e){this._observerNode=e}_renderFeatureObserver(){return p("div",{afterCreate:this._onObserverCreate,bind:this,class:_.featureObserver,key:"feature-observer"})}_renderHeader(e){return p("div",{class:_.header,key:"filter"},this._renderHeading(e.heading),this._renderFilter(e.placeholder,e.renderFilterOptions),e.renderTotal?this._renderTotal():null)}_renderHeading(e){return e?p(c,{key:"title",level:this.headingLevel},p("div",{class:_.headingContent},p("calcite-icon",{icon:"layer"}),e)):null}_renderFilter(e,t){const r=!this.selectedLayer,i=r?this._layerFilterText:this._featureFilterText;return p("div",{class:_.filterContainer,key:"filter"},p("calcite-input",{icon:"search",placeholder:e,type:"search",value:i,onCalciteInputInput:e=>{r?this._layerFilterText=e.currentTarget.value.trim().toLowerCase():this._featureFilterText=e.currentTarget.value.trim().toLowerCase()}},t?this._renderFilterOptionsAction():null))}_renderFilterOptionsAction(){const e=this.messagesFeatureForm.associations.filterOptions;return p("calcite-action",{appearance:"transparent",icon:"sliders",indicator:!!this._filterBuilder.whereClause,onclick:()=>{this.viewModel.filterOptionsVisible=!this.viewModel.filterOptionsVisible},scale:"s",slot:"action",text:e,title:e})}_renderTotal(){const{messagesFeature:e,viewModel:t}=this,r=h(e.numberRecords,{number:t.featureCount});return p("div",{key:"total"},r)}};e([i()],f.prototype,"filterOptionsVisible",null),e([i()],f.prototype,"headingLevel",void 0),e([i(),u("esri/t9n/common")],f.prototype,"messagesCommon",void 0),e([i(),u("esri/widgets/Feature/t9n/Feature")],f.prototype,"messagesFeature",void 0),e([i(),u("esri/widgets/FeatureForm/t9n/FeatureForm")],f.prototype,"messagesFeatureForm",void 0),e([i(),u("esri/widgets/support/FilterBuilder/t9n/FilterBuilder")],f.prototype,"messagesFilterBuilder",void 0),e([i()],f.prototype,"selectedLayer",null),e([i({type:l})],f.prototype,"viewModel",void 0),e([i()],f.prototype,"selectedFeature",null),e([i()],f.prototype,"filterWhereClause",null),e([i()],f.prototype,"_filterBuilder",void 0),e([i()],f.prototype,"_featureFilterText",void 0),e([i()],f.prototype,"_layerFilterText",void 0),e([i()],f.prototype,"_observer",void 0),e([i()],f.prototype,"_filteredFeatureItems",null),e([i()],f.prototype,"_observerNode",void 0),f=e([s("esri.widgets.FeatureForm.FeatureFormUtilityNetworkAssociations.UtilityNetworkAssociationItemList")],f);const v=f;export{v as default};