{"version":3,"sources":["components/controls/range-slider/_base/range-slider.js"],"names":["RangeSliderBase","Component","constructor","el","range1","$find","range2","indicator","eventValues","CustomEvent","detail","getMin","getMinValue","getMax","getMaxValue","addEventListeners","indicatorResize","Math","min","value","max","onElementInput","$el","dispatchEvent","onElementChange","type","event","Event","sliderType","diff","style","width","abs","left","addEventListener"],"mappings":"aAAA,KAAMA,CAAAA,eAAN,QAA8BC,CAAAA,SAAU,CACvCC,WAAW,CAACC,EAAD,CAAK,CACf,MAAMA,EAAN,EACA,KAAKC,MAAL,CAAc,KAAKC,KAAL,CAAW,gBAAX,CAAd,CACA,KAAKC,MAAL,CAAc,KAAKD,KAAL,CAAW,gBAAX,CAAd,CACA,KAAKE,SAAL,CAAiB,KAAKF,KAAL,CAAW,wBAAX,CAAjB,CACA,KAAKG,WAAL,CAAmB,GAAIC,CAAAA,WAAJ,CAAgB,cAAhB,CAAgC,CAClDC,MAAM,CAAE,CACPC,MAAM,CAAE,IAAM,KAAKC,WAAL,EADP,CAEPC,MAAM,CAAE,IAAM,KAAKC,WAAL,EAFP,CAD0C,CAAhC,CAAnB,CAMA,KAAKC,iBAAL,GACA,KAAKC,eAAL,EACA,CAEDJ,WAAW,EAAG,CACb,MAAOK,CAAAA,IAAI,CAACC,GAAL,CAAS,KAAKd,MAAL,CAAYe,KAArB,CAA4B,KAAKb,MAAL,CAAYa,KAAxC,CACP,CAEDL,WAAW,EAAG,CACb,MAAOG,CAAAA,IAAI,CAACG,GAAL,CAAS,KAAKhB,MAAL,CAAYe,KAArB,CAA4B,KAAKb,MAAL,CAAYa,KAAxC,CACP,CAEDE,cAAc,EAAG,CAChB,KAAKC,GAAL,CAASC,aAAT,CAAuB,KAAKf,WAA5B,EACA,KAAKQ,eAAL,EACA,CAEDQ,eAAe,CAACC,IAAD,CAAO,CACrB,KAAMC,CAAAA,KAAK,CAAG,GAAIC,CAAAA,KAAJ,CAAU,YAAV,CAAd,CACAD,KAAK,CAACE,UAAN,CAAmBH,IAAnB,CACA,KAAKH,GAAL,CAASC,aAAT,CAAuBG,KAAvB,CACA,CAEDV,eAAe,EAAG,CACjB,KAAMa,CAAAA,IAAI,CAAG,KAAKzB,MAAL,CAAYgB,GAAZ,CAAkB,KAAKhB,MAAL,CAAYc,GAA3C,CACA,KAAKX,SAAL,CAAeuB,KAAf,CAAqBC,KAArB,CAA6Bd,IAAI,CAACe,GAAL,CAAS,CAAC,KAAK5B,MAAL,CAAYe,KAAZ,CAAoB,KAAKb,MAAL,CAAYa,KAAjC,EAA0CU,IAA1C,CAAiD,GAA1D,EAAiE,GAA9F,CACA,KAAKtB,SAAL,CAAeuB,KAAf,CAAqBG,IAArB,CAA4BhB,IAAI,CAACe,GAAL,CAAS,CAAC,KAAKpB,WAAL,GAAqB,KAAKR,MAAL,CAAYc,GAAlC,EAAyCW,IAAzC,CAAgD,GAAzD,EAAgE,GAC5F,CAEDd,iBAAiB,EAAG,CACnB,KAAKX,MAAL,CAAY8B,gBAAZ,CAA6B,OAA7B,CAAsC,IAAM,KAAKb,cAAL,EAA5C,EACA,KAAKf,MAAL,CAAY4B,gBAAZ,CAA6B,OAA7B,CAAsC,IAAM,KAAKb,cAAL,EAA5C,EACA,KAAKjB,MAAL,CAAY8B,gBAAZ,CAA6B,QAA7B,CAAuC,IAAM,KAAKV,eAAL,CAAqB,KAArB,CAA7C,EACA,KAAKlB,MAAL,CAAY4B,gBAAZ,CAA6B,QAA7B,CAAuC,IAAM,KAAKV,eAAL,CAAqB,KAArB,CAA7C,CACA,CA9CsC","sourcesContent":["class RangeSliderBase extends Component {\r\n\tconstructor(el) {\r\n\t\tsuper(el);\r\n\t\tthis.range1 = this.$find('[data-range-1]');\r\n\t\tthis.range2 = this.$find('[data-range-2]');\r\n\t\tthis.indicator = this.$find('[data-range-indicator]');\r\n\t\tthis.eventValues = new CustomEvent('changeValues', {\r\n\t\t\tdetail: {\r\n\t\t\t\tgetMin: () => this.getMinValue(),\r\n\t\t\t\tgetMax: () => this.getMaxValue()\r\n\t\t\t}\r\n\t\t});\r\n\t\tthis.addEventListeners();\r\n\t\tthis.indicatorResize();\r\n\t}\r\n\r\n\tgetMinValue() {\r\n\t\treturn Math.min(this.range1.value, this.range2.value);\r\n\t}\r\n\r\n\tgetMaxValue() {\r\n\t\treturn Math.max(this.range1.value, this.range2.value);\r\n\t}\r\n\r\n\tonElementInput() {\r\n\t\tthis.$el.dispatchEvent(this.eventValues);\r\n\t\tthis.indicatorResize();\r\n\t}\r\n\r\n\tonElementChange(type) {\r\n\t\tconst event = new Event('dragFinish');\r\n\t\tevent.sliderType = type;\r\n\t\tthis.$el.dispatchEvent(event);\r\n\t}\r\n\r\n\tindicatorResize() {\r\n\t\tconst diff = this.range1.max - this.range1.min;\r\n\t\tthis.indicator.style.width = Math.abs((this.range1.value - this.range2.value) / diff * 100) + '%';\r\n\t\tthis.indicator.style.left = Math.abs((this.getMinValue() - this.range1.min) / diff * 100) + '%';\r\n\t}\r\n\r\n\taddEventListeners() {\r\n\t\tthis.range1.addEventListener('input', () => this.onElementInput());\r\n\t\tthis.range2.addEventListener('input', () => this.onElementInput());\r\n\t\tthis.range1.addEventListener('change', () => this.onElementChange('min'));\r\n\t\tthis.range2.addEventListener('change', () => this.onElementChange('max'));\r\n\t}\r\n}\r\n"],"file":"range-slider.min.js"}