(()=>{"use strict";function t(n){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(n)}function n(t,n){for(var e=0;e<n.length;e++){var o=n[e];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,r(o.key),o)}}function r(n){var r=function(n){if("object"!=t(n)||!n)return n;var r=n[Symbol.toPrimitive];if(void 0!==r){var e=r.call(n,"string");if("object"!=t(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}(n);return"symbol"==t(r)?r:r+""}function e(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(e=function(){return!!t})()}function o(t){return o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},o(t)}function i(t,n){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},i(t,n)}const c=function(){function r(){return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,r),function(n,r,i){return r=o(r),function(n,r){if(r&&("object"==t(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(n)}(n,e()?Reflect.construct(r,i||[],o(n).constructor):r.apply(n,i))}(this,r,arguments)}return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),n&&i(t,n)}(r,DragwybBuilder.DragwybFormFrontendBase),c=r,(u=[{key:"bindElements",value:function(){this.elements.$form=this.$container.is("form")?this.$container:this.$container.find("form.dragwyb-form")}},{key:"init",value:function(){var t=this;this.$container.find(".dragwyb-custom-range-container").each(function(n,r){t.initSlider(jQuery(r))})}},{key:"initSlider",value:function(t){var n=t.find('input[type="range"]'),r=t.find(".dragwyb-range-progress"),e=t.find(".dragwyb-range-thumb");if(n.length){var o=function(){var t=parseFloat(n.attr("min"))||0,o=parseFloat(n.attr("max"))||100,i=((parseFloat(n.val())||0)-t)/(o-t)*100;i<0&&(i=0),i>100&&(i=100),r.css("width","".concat(i,"%")),e.css("left","".concat(i,"%"))};o(),n.on("input",function(){o()}),n.on("focus",function(){t.addClass("dragwyb-range-focused")}).on("blur",function(){t.removeClass("dragwyb-range-focused")})}}}])&&n(c.prototype,u),Object.defineProperty(c,"prototype",{writable:!1}),c;var c,u}();jQuery(document).on("Dragwyb:frontendInit",function(){DragwybBuilder.Hooks.addAction("dragwyb/frontend/form_ready",function(t,n){new c(t)})})})();