/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../chunks/languageUtils"],(function(e,t){"use strict";function r(e){let t=0;for(let r=0;r<e.length;r++)t+=e[r];return t/e.length}function n(e){const t=r(e);let n=0;for(let r=0;r<e.length;r++)n+=(t-e[r])**2;return n/e.length}function a(e){let t=0;for(let r=0;r<e.length;r++)t+=e[r];return t}function u(e,r){const n=[],a={},u=[];for(let s=0;s<e.length;s++){if(void 0!==e[s]&&null!==e[s]&&e[s]!==t.voidOperation){const r=e[s];if(t.isNumber(r)||t.isString(r))void 0===a[r]&&(n.push(r),a[r]=1);else{let e=!1;for(let n=0;n<u.length;n++)!0===t.equalityTest(u[n],r)&&(e=!0);!1===e&&(u.push(r),n.push(r))}}if(n.length>=r&&-1!==r)return n}return n}function s(e){switch(e.toLowerCase()){case"distinct":return"distinct";case"avg":case"mean":return"avg";case"min":return"min";case"sum":return"sum";case"max":return"max";case"stdev":case"stddev":return"stddev";case"var":case"variance":return"var";case"count":return"count"}return""}function c(e,s,c=1e3){switch(e.toLowerCase()){case"distinct":return u(s,c);case"avg":case"mean":return r(t.toNumberArray(s));case"min":return Math.min.apply(Math,t.toNumberArray(s));case"sum":return a(t.toNumberArray(s));case"max":return Math.max.apply(Math,t.toNumberArray(s));case"stdev":case"stddev":return Math.sqrt(n(t.toNumberArray(s)));case"var":case"variance":return n(t.toNumberArray(s));case"count":return s.length}return 0}e.calculateStat=c,e.decodeStatType=s,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
