/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{d as i}from"./DPJE33GY.js";import{c as g,g as p}from"./UG7LOBJE.js";import a from"./AD6GOUND.js";import{n as o}from"./4B3QBH5T.js";import"./FUPYXGG6.js";import"./NKG4FLLR.js";import{F as c,g as n,h as t,z as h}from"./RPU6VCJ4.js";import"./OR4HXHSY.js";export default $arcgis.t(([,,,,,,,,,,,,,,,{Kc:m,Mc:d}])=>{var f=n`:host{overflow-y:auto;overflow-x:hidden;margin-bottom:var(--arcgis-charts-intra-section-margin);margin-top:var(--arcgis-charts-intra-section-margin);height:100%}`,r=class extends h{constructor(){super(...arguments),this.onModelConfigChange=async a=>{let e=a?.detail.config??this.model.config;this.layer===void 0&&await this.updateFetchLayerFieldsInfo(e)}}static{this.properties={layerFieldsInfo:16,model:0,chartData:0,seriesColor:0,calculatedMinMaxBounds:0,page:1,layer:0,usePopupTemplateFieldsInfo:5}}static{this.styles=f}async load(){this.seriesColor!==void 0&&this.seriesColorChange(this.seriesColor),await this.updateFetchLayerFieldsInfo(this.model?.config),this.modelChange(this.model)}willUpdate(a){let e=!1;a.has("model")&&this.modelChange(this.model,a.get("model")),a.has("layer")&&this.layer!==void 0&&!o(a.get("layer"),this.layer)&&(e=!0),a.has("usePopupTemplateFieldsInfo")&&this.usePopupTemplateFieldsInfo!==a.get("usePopupTemplateFieldsInfo")&&(e=!0),a.has("seriesColor")&&this.seriesColorChange(this.seriesColor),this.layerFieldsInfo===void 0&&(e=!0),e&&this.updateFetchLayerFieldsInfo()}disconnectedCallback(){super.disconnectedCallback(),this.model.removeEventListener("arcgisChartsModelConfigChange",this.onModelConfigChange)}modelChange(a,e){e?.removeEventListener("arcgisChartsModelConfigChange",this.onModelConfigChange),a?.addEventListener("arcgisChartsModelConfigChange",this.onModelConfigChange)}seriesColorChange(a){this.model.colorMatch&&a?.forEach(e=>{g(e)&&a?.get(0)!==void 0&&!o(this.model.binSymbol,e)&&(this.model.binSymbol=e)})}async updateFetchLayerFieldsInfo(a){let e=a??this.model.config,s=this.layer;if(!s){let l=p(e)?e.iLayer:void 0;l&&(s=await m(l))}s&&(this.layerFieldsInfo=await d(s,this.usePopupTemplateFieldsInfo))}render(){let a;switch(this.page){case i.Data:a=t`<arcgis-charts-config-histogram-data .model=${this.model} .meanValue=${this.chartData?.mean} .medianValue=${this.chartData?.median} .standardDevValue=${this.chartData?.stddev} .minValue=${this.chartData?.min} .maxValue=${this.chartData?.max} .sumValue=${this.chartData?.sum} .nullsValue=${this.chartData?.nulls} .countValue=${this.chartData?.count} .layerFieldsInfo=${this.layerFieldsInfo}></arcgis-charts-config-histogram-data>`;break;case i.Axes:a=t`<arcgis-charts-config-axes .model=${this.model} show-max-y-bound-option .calculatedMinMaxBounds=${this.calculatedMinMaxBounds}></arcgis-charts-config-axes>`;break;case i.Guides:a=t`<arcgis-charts-config-guides .model=${this.model} enable-y-axis-guide></arcgis-charts-config-guides>`;break;case i.Format:a=t`<arcgis-charts-config-format .model=${this.model}></arcgis-charts-config-format>`;break;case i.General:a=t`<arcgis-charts-config-general .model=${this.model}></arcgis-charts-config-general>`;break;default:a="";break}return a}};c("arcgis-charts-config-histogram",r);return r},"Graphic","renderers/support/jsonUtils","symbols/support/symbolUtils","intl","layers/support/FeatureFilter","smartMapping/statistics/histogram","smartMapping/statistics/summaryStatistics","request","core/sql","AttributeBinsGraphic","geometry/support/jsonUtils","rest/support/AttributeBinsQuery","rest/support/StatisticDefinition","time/TimeExtent","core/promiseUtils",a)