jQuery(document).ready(function(e){e("#update-nav-menu").bind("click",function(t){t.target&&t.target.className&&-1!=t.target.className.indexOf("item-edit")&&e("input[value='#weglot_switcher'][type=text]").parents(".menu-item-settings").each(function(){const t=e(this).attr("id").substring(19);e(this).children("p:not( .field-move )").remove(),e(this).append(e("<input>").attr({type:"hidden",id:"edit-menu-item-title-"+t,name:"menu-item-title["+t+"]",value:weglot_data.title})),e(this).append(e("<input>").attr({type:"hidden",id:"edit-menu-item-url-"+t,name:"menu-item-url["+t+"]",value:"#weglot_switcher"})),e(this).append(e("<input>").attr({type:"hidden",id:"edit-menu-item-weglot-detect-"+t,name:"menu-item-weglot-detect["+t+"]",value:1})),e.each(weglot_data.list_options,(i,n)=>{const a=e("<p>").attr("class","description"),d=e("<label>").attr("for",`edit-menu-item-${n.key}-${t}`).text(` ${n.title}`);e(this).prepend(a),a.append(d);const m=e("<input>").attr({type:"checkbox",id:`edit-menu-item-${n.key}-${t}`,name:`menu-item-weglot-${n.key}[${t}]`,value:1});weglot_data.options&&weglot_data.options[`menu-item-${t}`]&&1===weglot_data.options[`menu-item-${t}`][n.key]&&m.prop("checked",!0),d.prepend(m)})})})});