import{DEFAULT_CURRENCY}from"./numberFormatter.js";import{isNumeric}from"./utils.js";const DEFAULT_SLIDER_LOWER_BOUND=0,DEFAULT_SLIDER_UPPER_BOUND=100,DEFAULT_SLIDER_STEP=0,DEFAULT_SLIDER_DECIMALS=0,SLIDER_MIN_DECIMALS=0,SLIDER_MAX_DECIMALS=20;function getProcessedNumberFormat(E){var D=E||{};let r=D.precision,_=D.step,L=D.lowerBound,e=D.upperBound;L=isNumeric(L)?L:DEFAULT_SLIDER_LOWER_BOUND,e=isNumeric(e)?e:DEFAULT_SLIDER_UPPER_BOUND,e<=L&&(L=DEFAULT_SLIDER_LOWER_BOUND,e=DEFAULT_SLIDER_UPPER_BOUND),r=isNumeric(r)?r:DEFAULT_SLIDER_DECIMALS,(r<SLIDER_MIN_DECIMALS||r>SLIDER_MAX_DECIMALS)&&(r=DEFAULT_SLIDER_DECIMALS),_=isNumeric(_)&&_<=e-L&&0<_?_:DEFAULT_SLIDER_STEP;var i=D.displayFormat,E=D.customDisplayFormat;return{currency:D.currency||DEFAULT_CURRENCY,customDisplayFormat:E,displayFormat:i,precision:r,step:_,lowerBound:L,upperBound:e}}function getInitialNumberSliderValues(E,D){const r=isNumeric(D.lowerBound)?D.lowerBound:DEFAULT_SLIDER_LOWER_BOUND,_=isNumeric(D.upperBound)?D.upperBound:DEFAULT_SLIDER_UPPER_BOUND;var L=E=>{E=(E||"").trim();E=isNumeric(E)?parseFloat(E):NaN;return isNaN(E)?E:E<r?r:E>_?_:E};let e=[];return"string"==typeof E&&(E=L((D=E.split("\n").filter(E=>""!==E))[0]),D=L(D[1]),isNaN(E)||isNaN(D)||e.push(E,D)),e=e.sort((E,D)=>E-D),e.length?e:[r,_]}export{DEFAULT_SLIDER_LOWER_BOUND,DEFAULT_SLIDER_UPPER_BOUND,DEFAULT_SLIDER_STEP,DEFAULT_SLIDER_DECIMALS,SLIDER_MIN_DECIMALS,SLIDER_MAX_DECIMALS,getProcessedNumberFormat,getInitialNumberSliderValues};