elementor.hooks.addAction("panel/open_editor/widget",(function(e,t){let n=t.get("widgetType");if(n.split("-").includes("mf")){let t=jQuery(e.el).find("[data-setting=mf_input_name]"),o=Math.floor(9e5*Math.random())+1e5;t.on("input",(function(){let e=jQuery(this).val().replace(/[^a-zA-Z0-9_-]/g,"_");jQuery(this).val(e)})),t.blur((()=>{t.val()||(jQuery(t).val(n.concat("_",o)),t.trigger("input"))}));const i=jQuery(e.el).find('[data-setting="mf_input_option_text"]'),r=jQuery(e.el).find('[data-setting="mf_input_option_value"]');["mf-checkbox","mf-multi-select","mf-radio","mf-image-select","mf-toggle-select","mf-select"].includes(n)&&(i.on("input",(function(){let e=jQuery(this).val().replace(/["]/g,"''");jQuery(this).val(e)})),r.on("input",(function(){let e=jQuery(this).val().replace(/["]/g,"''");jQuery(this).val(e)})))}}));const uniqueId=()=>Date.now().toString(36)+Math.random().toString(36).substring(2);elementor.hooks.addAction("panel/open_editor/widget",(function(e,t,n){"mf-simple-repeater"==t.get("widgetType")&&jQuery(e.el).find(".elementor-repeater-add").length>0&&jQuery(e.el).find(".elementor-repeater-add").on("click",(function(){setTimeout((()=>{jQuery(this).closest(".elementor-button").parent().prev().find(".elementor-repeater-fields").last().find('[data-setting="mf_input_repeater_name"]').prop("value","repeater-input-name-"+(Date.now().toString(36)+Math.random().toString(36).substring(2))).trigger("input")}),50)}))})),parent.document.addEventListener("mousedown",(function(e){let t=parent.document.querySelectorAll(".elementor-element--promotion");if(t.length>0)for(let n=0;n<t.length;n++)if(t[n].contains(e.target)){let o=parent.document.querySelector("#elementor-element--promotion__dialog"),i=t[n].querySelector(".icon > i").classList.toString();if(o.querySelectorAll(".metform-dialog-buttons-action").forEach((e=>e.remove())),i.indexOf("metform")>=0){o.querySelector(".dialog-buttons-action").style.display="none",e.stopImmediatePropagation();let t=document.createElement("a"),n=document.createTextNode("Upgrade MetForm");t.setAttribute("href","https://wpmet.com/plugin/metform/pricing/"),t.setAttribute("target","_blank"),t.classList.add("dialog-button","dialog-action","dialog-buttons-action","elementor-button","go-pro","elementor-button-success","metform-dialog-buttons-action"),t.appendChild(n),o.querySelector(".dialog-buttons-action").insertAdjacentElement("afterend",t)}else{o.querySelector(".dialog-buttons-action").style.display="";let e=o.querySelector(".metform-dialog-buttons-action");e&&e.remove()}break}}));