window.TastyFramework=window.TastyFramework||{},window.TastyFramework.adminmenu={init(){this._open_not_active_admin_menu_item_in_new_tab()},_open_not_active_admin_menu_item_in_new_tab(){var e=document.querySelectorAll(".tasty-not-active a");if(e&&!(e.length<=0))for(var t of e)t.setAttribute("target","_blank"),t.setAttribute("rel","noopener")}},(e=>{"loading"!==document.readyState?e():document.addEventListener("DOMContentLoaded",e)})(()=>{window.TastyFramework.adminmenu.init()}),window.TastyFramework=window.TastyFramework||{},window.TastyFramework.modal={replacements:{},init(){this._generic_modal()},_generic_modal(){this._generic_modal_open(".tasty-show-modal"),this._generic_modal_close(".tasty-hide-modal, .tasty-framework-modal",!1)},_generic_modal_open(e){e=document.querySelectorAll(e);if(e&&!(e.length<=0))for(let a of e){var n=a.dataset.modal_id;if(n){let t=document.getElementById(n);if(t){let e=a;n=a.dataset.modal_parent;(e=n?a.closest(n)||a:e).addEventListener("click",e=>{e.preventDefault(),this.replacements=JSON.parse(a.dataset.replacements),this._apply_replacements(t),t.classList.add("tasty-open")})}}}},_generic_modal_close(e){e=document.querySelectorAll(e);if(!(e.length<=0))for(let t of e)t.addEventListener("click",e=>{e.target===t&&(e.preventDefault(),e=document.querySelectorAll(".tasty-framework-modal.tasty-open"))&&e.forEach(e=>{this._apply_replacements(e,!0),e.classList.remove("tasty-open")})})},_apply_replacements(e,n=!1){if(this.replacements){let t=e.querySelector(".tasty-framework-modal-header"),a=e.querySelector(".tasty-framework-modal-body");Object.keys(this.replacements).forEach(e=>{n?(t.innerHTML=t.innerHTML.replace(this.replacements[e],`__${e}__`),a.innerHTML=a.innerHTML.replace(this.replacements[e],`__${e}__`)):(t.innerHTML=t.innerHTML.replace(`__${e}__`,this.replacements[e]),a.innerHTML=a.innerHTML.replace(`__${e}__`,this.replacements[e]))})}}},(e=>{"loading"!==document.readyState?e():document.addEventListener("DOMContentLoaded",e)})(()=>{window.TastyFramework.modal.init()});let handleSubmit=()=>{var e=document.getElementById("tasty-nav-submit");e&&e.addEventListener("click",e=>{e.preventDefault(),document.querySelector("form.tasty-tab-content").requestSubmit()})};document.addEventListener("DOMContentLoaded",()=>{handleSubmit()});