/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/LICENSE.txt */
import{__decorate as e}from"tslib";import{property as t,subclass as r}from"../../core/accessorSupport/decorators.js";import a from"../Slider/SliderViewModel.js";import{formatDateLabel as s,formatNumberLabel as o}from"../smartMapping/support/utils.js";let n=class extends a{constructor(e){super(e),this.average=null,this.bins=null,this.hasTimeData=!1,this.labelFormatFunction=e=>{if(this.hasTimeData)return s(e);const{max:t,min:r,precision:a}=this,n=t-r>10?2:a;return o(parseFloat(e.toFixed(n)))},this.rangeType="equal",this.standardDeviation=null}generateWhereClause(e){const{rangeType:t,state:r,values:a}=this;if("ready"!==r||!a?.length||null==e)return null;const s=a[0],o=a.length>1?a[a.length-1]:null;switch(t){case"equal":return`${e} = ${s}`;case"not-equal":return`${e} <> ${s}`;case"less-than":return`${e} < ${s}`;case"greater-than":return`${e} > ${s}`;case"at-least":return`${e} >= ${s}`;case"at-most":return`${e} <= ${s}`;case"between":return`${e} BETWEEN ${s} AND ${o}`;case"not-between":return`${e} NOT BETWEEN ${s} AND ${o}`;default:return null}}};e([t()],n.prototype,"average",void 0),e([t()],n.prototype,"bins",void 0),e([t()],n.prototype,"hasTimeData",void 0),e([t()],n.prototype,"labelFormatFunction",void 0),e([t()],n.prototype,"rangeType",void 0),e([t()],n.prototype,"standardDeviation",void 0),n=e([r("esri.widgets.HistogramRangeSlider.HistogramRangeSliderViewModel")],n);const i=n;export{i as default};
