jQuery(function(t){var e={};if(t("#http2_push").length>0){t("#http2_push").html("");var r,o={name:"http2.push",mode:"code",modes:["code","tree"],onError:function(t){console.error("JSON",t.toString()),alert("JSON error. Please verify your input.\n\nSee console for details.")},onChange:function(){var o=e.http2push.getText();if(console.log(o),""===t.trim(o))return r&&clearTimeout(r),void(r=setTimeout(function(){r=!1;var o=e.http2push.getText();""===t.trim(o)&&(e.http2push.set([]),jQuery("#http2_push_config_src").val("[]"))},25));try{var s=e.http2push.get()}catch(t){return}jQuery("#http2_push_config_src").val(JSON.stringify(s))},onModeChange:function(r,o){var s=e.http2push.getText();""===t.trim(s)&&e.http2push.set([]),"tree"===r||t("#http2_push_config_src").data("json-editor").editor.setOptions({maxLines:50})},search:!1,schema:{title:"HTTP/2 Push",type:"array",items:{oneOf:[{title:"WordPress enqueued stylesheets or scripts.",type:"object",properties:{type:{type:"string",enum:["style","script","image"]},match:{oneOf:[{type:"string",enum:["all"]},{title:"Match the URL of a stylesheet of script.",type:"object",properties:{pattern:{type:"string",minLength:1},regex:{type:"boolean"},exclude:{type:"boolean"}},required:["pattern"],additionalProperties:!1}]},meta:{title:"Add meta rel=preload to header.",type:"boolean"}},additionalProperties:!1,required:["type","match"]},{title:"Custom resources.",type:"object",properties:{type:{type:"string",enum:["custom"]},resources:{title:"Resources to push.",type:"array",items:{type:"object",properties:{file:{type:"string"},type:{type:"string",enum:["audio","video","track","script","style","image","font","fetch","worker","embed","object","document"]},mime:{type:"string"}},additionalProperties:!1,required:["file","type"]},uniqueItems:!0},meta:{title:"Add meta rel=preload to header.",type:"boolean"}},additionalProperties:!1,required:["type","resources"]}]},uniqueItems:!0}},s=[];if(""!==jQuery("#http2_push_config_src").val()){if("object"!=typeof(s=jQuery("#http2_push_config_src").val()))try{s=JSON.parse(s)}catch(t){s=[]}s&&"object"==typeof s||(s=[])}s instanceof Array&&0===s.length&&(s=[]);var i=!1;"[]"===JSON.stringify(s)&&(i=!0),e.http2push=new JSONEditor(t("#http2_push")[0],o,s),"code"===o.mode&&(i||e.http2push.editor.setOptions({maxLines:50})),t("#http2_push_config_src").data("json-editor",e.http2push),t("[data-http2-insert]").on("click",function(r){r.stopPropagation();try{var o=e.http2push.get()}catch(r){return}if(o instanceof Array){var s=t(this).data("http2-insert");"string"==typeof s&&(s=JSON.parse(s)),s instanceof Array||(s=[s]);for(var i=0;i