(()=>{"use strict";function e(e,n){const r=e.querySelector(".nv-repeater--toggle"),i=e.querySelector(".nv-repeater--item-title"),c=e.querySelector(".reorder-btn.down"),o=e.querySelector(".reorder-btn.up"),a=e.querySelector(".nv-repeater--remove-item"),s=e.querySelector('input[data-key="title"]'),l=e.querySelector(".nv-repeater--title-text"),u=e.querySelectorAll(".color-picker-hex"),d=e.querySelectorAll(".has-value"),p=e.querySelectorAll(".nv--icon-field-wrap");r.addEventListener("click",(function(){this.parentNode.classList.toggle("visibility-hidden"),this.setAttribute("data-value","yes"===this.getAttribute("data-value")?"no":"yes"),t(n)})),i.addEventListener("click",(function(){this.parentNode.parentNode.classList.toggle("expanded")})),a.addEventListener("click",(function(){e.parentNode.removeChild(e),t(n)})),c.addEventListener("click",(function(r){r.stopPropagation();const i=e.nextSibling;if(!i)return!1;i.parentNode.insertBefore(e,i.nextSibling),t(n)})),o.addEventListener("click",(function(r){if(r.stopPropagation(),!e.previousSibling)return!1;e.parentNode.insertBefore(e,e.previousSibling),t(n)})),s.addEventListener("input",(function(){l.innerHTML=""!==this.value?this.value:l.dataset.default,t(n)})),_.each(u,(function(e){jQuery(e).wpColorPicker({change(){setTimeout((function(){t(n)}),1)},clear(){t(n)}})})),_.each(p,(function(e){const r=e.querySelector(".nv--icon-selector"),i=e.querySelector("input"),c=e.querySelector(".nv--remove-icon"),o=e.querySelectorAll(".nv--icons-container > a"),a=e.querySelector(".nv--icons-search > input");r.addEventListener("click",(function(t){t.preventDefault(),e.classList.toggle("nv--iconpicker-expanded"),a.value="",a.dispatchEvent(new Event("input")),a.focus()})),c.addEventListener("click",(function(c){c.preventDefault(),i.value="",r.innerHTML='<span class="dashicons dashicons-plus"></span>';const o=e.querySelector("a.selected");null!==o&&o.classList.remove("selected"),t(n)})),_.each(o,(function(c){c.addEventListener("click",(function(o){o.preventDefault(),r.innerHTML=c.innerHTML,i.value=c.dataset.icon;const a=e.querySelector("a.selected");null!==a&&a.classList.remove("selected"),c.classList.add("selected"),e.classList.remove("nv--iconpicker-expanded"),t(n)}))})),a.addEventListener("input",(function(e){const t=e.target.value.toLowerCase().replace(/\s+/g,"");_.each(o,(function(e){e.dataset.icon.toLowerCase().indexOf(t)>-1?e.style.display="":e.style.display="none"}))}))})),_.each(d,(function(e){e.addEventListener("change",(function(){t(n)}))}))}function t(e){const t=e.querySelector(".nv-repeater--collector"),n=e.querySelectorAll(".nv-repeater--items-wrap .nv-repeater--item"),r=[];_.each(n,(function(e){const t=e.querySelectorAll(".has-value"),n={};_.each(t,(function(e){const t=e.dataset.key;let r;r="checkbox"===e.getAttribute("type")?e.checked:e.dataset.value?e.dataset.value:e.value,n[t]=r})),r.push(n)})),t.value=JSON.stringify(r),jQuery(t).trigger("change")}wp.customize.bind("ready",(function(){!function(){const n=document.querySelectorAll(".nv-repeater--wrap");_.each(n,(function(n){const r=n.querySelector(".nv-repeater--reorder"),i=n.querySelector(".nv-repeater--add-new"),c=n.querySelectorAll(".nv-repeater--items-wrap .nv-repeater--item"),o=n.querySelector(".nv-repeater--items-wrap"),a=n.querySelector(".nv-repeater--hidden-item .nv-repeater--item");_.each(c,(function(t){e(t,n)})),i.addEventListener("click",(function(){const r=a.cloneNode(!0);e(r,n),o.appendChild(r),t(n)})),r.addEventListener("click",(function(e){e.preventDefault(),n.classList.toggle("reordering"),t(n)}))}))}(),wp.customize.section("neve_scroll_to_top",(e=>{e.expanded.bind((e=>{const t=function(){const e=document.querySelector("#customize-preview iframe");if(e)return e.contentWindow.document.querySelector("#scroll-to-top")}();t&&(e?(wp.customize.previewer.bind("ready",(()=>{wp.customize.previewer.send("nv-opened-stt",!0)})),t.style.visibility="visible",t.style.opacity="1"):(t.style.visibility="hidden",t.style.opacity="0"))}))})),wp.customize.section("neve_edd_archive",(e=>{e.expanded.bind((e=>{e&&wp.customize.previewer.previewUrl.set("/index.php?post_type=download")}))})),wp.customize.section("neve_edd_typography",(e=>{e.expanded.bind((e=>{e&&wp.customize.previewer.previewUrl.set("/index.php?post_type=download")}))}))}))})();