!function(){"use strict";var supportsMultiple=self.HTMLInputElement&&"valueLow"in HTMLInputElement.prototype,descriptor=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),wcpt__multirange=function(input){if(!supportsMultiple&&!input.classList.contains("wcpt__multirange")){var value=input.getAttribute("value"),values=null===value?[]:value.split(","),min=+(input.min||0),max=+(input.max||100),ghost=input.cloneNode();input.classList.add("wcpt__multirange","original"),ghost.classList.add("wcpt__multirange","ghost"),input.value=values[0]||min+(max-min)/2,ghost.value=values[1]||min+(max-min)/2,input.parentNode.insertBefore(ghost,input.nextSibling),Object.defineProperty(input,"originalValue",descriptor.get?descriptor:{get:function(){return this.value},set:function(v){this.value=v}}),Object.defineProperties(input,{valueLow:{get:function(){return Math.min(this.originalValue,ghost.value)},set:function(v){this.originalValue=v},enumerable:!0},valueHigh:{get:function(){return Math.max(this.originalValue,ghost.value)},set:function(v){ghost.value=v},enumerable:!0}}),descriptor.get&&Object.defineProperty(input,"value",{get:function(){return this.valueLow+","+this.valueHigh},set:function(v){var values=v.split(",");this.valueLow=values[0],this.valueHigh=values[1],update()},enumerable:!0}),"function"==typeof input.oninput&&(ghost.oninput=input.oninput.bind(input)),ghost.addEventListener("mousedown",(function passClick(evt){let clickValue=min+(max-min)*evt.offsetX/this.offsetWidth,middleValue=(input.valueHigh+input.valueLow)/2;input.valueLow==ghost.value==clickValue>middleValue&&(input.value=ghost.value)})),input.addEventListener("input",update),ghost.addEventListener("input",update),update()}function update(){var range=max-min;0===range?(ghost.style.setProperty("--low","0%"),ghost.style.setProperty("--high","100%")):(ghost.style.setProperty("--low",(input.valueLow-min)/range*100+1+"%"),ghost.style.setProperty("--high",(input.valueHigh-min)/range*100-1+"%"))}};wcpt__multirange.init=function(){[].slice.call(document.querySelectorAll("input.wcpt-range-slider[type=range][multiple]:not(.wcpt__multirange)")).forEach(wcpt__multirange)},"undefined"==typeof module?(self.wcpt__multirange=wcpt__multirange,"loading"==document.readyState?document.addEventListener("DOMContentLoaded",wcpt__multirange.init):wcpt__multirange.init()):module.exports=wcpt__multirange}();