jQuery(function(e){if(e("#html_search_replace").length>0){e("#html_search_replace").html("");var r,t={name:"html.replace",mode:"code",modes:["code","tree"],onError:function(e){console.error("JSON",e.toString()),alert("JSON error. Please verify your input.\n\nSee console for details.")},onChange:function(){var t=c.getText();if(""===e.trim(t))return r&&clearTimeout(r),void(r=setTimeout(function(){r=!1;var t=c.getText();""===e.trim(t)&&(c.set([]),jQuery("#html_search_replace_src").val("[]"))},25));try{var a=c.get()}catch(e){return}jQuery("#html_search_replace_src").val(JSON.stringify(a))},onModeChange:function(r,t){var a=c.getText();""===e.trim(a)&&c.set([]),"tree"===r&&c.expandAll()},search:!1,schema:{title:"HTML search and replace",type:"array",items:{oneOf:[{title:"String Match",type:"object",properties:{search:{type:"string"},replace:{type:"string"}},required:["search","replace"],additionalProperties:!1},{title:"Regular Expression Match",type:"object",properties:{search:{type:"string"},replace:{type:"string"},regex:{title:"Regular expression",type:"boolean",enum:[!0]}},required:["search","replace","regex"],additionalProperties:!1}]},uniqueItems:!0}},a=[];if(""!==jQuery("#html_search_replace_src").val()){if("object"!=typeof(a=jQuery("#html_search_replace_src").val()))try{a=JSON.parse(a)}catch(e){a=[]}a&&"object"==typeof a||(a=[])}var c=new JSONEditor(e("#html_search_replace")[0],t,a);c.compact(),e("#html_search_replace_src").data("json-editor",c)}});