var FPF_Colorpicker=function(){function e(){this.colorPickerClass=".fpf-field-control.color:not(.no-render)",this.init()}var r=e.prototype;return r.init=function(){this.colorPickersExist()&&this.initColorPickers()},r.initColorPickers=function(){document.querySelectorAll(this.colorPickerClass).forEach(function(e){e.classList.add("no-render");var o=e.querySelector(".fpf-colorpicker-item"),t=e.querySelector(".color-preview"),c=e.querySelector(".color-preview-value");jQuery(o).wpColorPicker({change:function(e,r){jQuery(this);var o=r.color.toCSS();t.style.backgroundColor=o,c.value=o}});var i,r=e.querySelector(".wp-picker-container").querySelector(".wp-color-result");e.querySelector(".fpf-colorpicker-opener").addEventListener("click",function(e){r.click(),e.preventDefault(),e.stopPropagation()});c.addEventListener("input",function(e){clearTimeout(i);var r=e.target.value;r&&(t.style.backgroundColor=r,o.value=r,i=setTimeout(function(){jQuery(o).trigger("change")},300))})})},r.colorPickersExist=function(){return!!document.querySelectorAll(this.colorPickerClass).length},e}();document.addEventListener("DOMContentLoaded",function(e){new FPF_Colorpicker});

