"undefined"===typeof window.tdcPostSettings&&(window.tdcPostSettings={tdbTemplateType:"all"});if(window.tdbVue&&"undefined"!==typeof window.tdbVue.router){var eventHub=new CloudLibraryVue;CloudLibraryVue.component("image-links",{template:'\n {{text}} \n ',props:{classes:[],link:"",text:""}});new CloudLibraryVue({el:"#tdb-modal",router:window.tdbVue.router})}
window.tdbVueManager&&"undefined"!==typeof window.tdbVueManager.router&&new CloudLibraryVue({el:"#tdb-modal-website-manager",router:window.tdbVueManager.router});
(function(){function m(a,b,c,d,f,g,h){var e=jQuery(".tdb-"+a+"-templates");e.length&&"undefined"===typeof e.data("tdb-templates")&&("undefined"!==typeof g&&g.call(),tdbGetMobileTemplates(a,b,e),g="","undefined"!==typeof tdcState&&(g=tdcState.isMobileComposer()?"1":""),g={action:"tdb_get_"+a+"_templates",mobile_templates:g,_nonce:window.tdb_globals.wpRestNonce},"cpt_tax"===a?g.data_id=b:g[a+"_id"]=b,jQuery.ajax({type:"POST",url:td_ajax_url,data:g,success:function(g,k,p){e.html("");g=jQuery.parseJSON(g);
k='
';var l=p="",m=!1;_.isArray(g)&&g.length?(_.each(g,
function(e,g,h){h="";"true"===e.is_current.toString()&&(h=" tdb-current",m=!0);var k="";g="";switch(a){case "single":k=e.template_title+" - Set template for this post";break;case "category":k=e.template_title+" - Set template for this category";break;case "author":k=e.template_title+" - Set template for this author";break;case "tag":k=e.template_title+" - Set template for this tag";break;case "search":""!==e.cpt?(k=e.template_title+" - Set this template for the "+e.cpt.label+" custom post type",g=
' data-cpt="'+e.cpt.name+'"'):k=e.template_title+" - Set this template for post search results";break;case "woo_product":k=e.template_title+" - Set template for this product";break;case "woo_archive":k=e.template_title+" - Set template for this product archive";break;case "cpt":k=e.template_title+" - Set template for this custom post type";break;case "cpt_tax":""!==e.cpt?(k=e.template_title+" - Set this template for the "+e.cpt.label+" custom post type archive",g=' data-cpt="'+e.cpt.name+'"'):k=e.template_title+
" - Set template for this taxonomy"}h=''+e.template_id+'
"+e.template_title+'
';
"undefined"!==typeof d&&!0===d&&(k="","undefined"!==typeof f&&""!==f&&(k='data-global-action="'+f+'"'),h+='
Global
');
h+='
'+(""===e.mobile_template_title?"-":'Yes ')+' ';l+=h+"
"}),"undefined"!==typeof d&&!0===d&&(p+='No cloud templates. Please import one or more templates from Cloud Library .
'));e.data("tdb-templates",!0);"undefined"!==typeof h&&h.call()},error:function(a,b,c){}}))}function n(a,b,c){var d=jQuery(window);d.resize(function(){var f=d.width();a.offset().left+b.width()>f?b.hasClass(c)||b.addClass(c):
b.hasClass(c)&&b.removeClass(c)});d.resize()}jQuery(document).ready(function(){jQuery("#wp-admin-bar-tdb_template_builder_disabled a").click(function(a){a.preventDefault();alert("Please select tagDiv Builder Template from the theme panel or set a default template. The current page/post uses a template that is not editable.")});jQuery("#wp-admin-bar-new-tdb_templates").hide()});jQuery("body").on("click","#wp-admin-bar-tdb_template_load, .tdb-load-mobile-template",function(a){a.preventDefault();var b=
jQuery(this),c=b.attr("class");a="";var d=!1;b.hasClass("tdb-load-mobile-template")&&(d=!0);"undefined"!==typeof c&&(0===c.indexOf("singleid-")?(a={wp_type:"single",templateType:"Single"},b=c.split(" ")[0].replace("singleid-",""),d?a.assign_mobile_to_template=b:a.assign_to_post=b):0===c.indexOf("categoryid-")?(a={wp_type:"category",templateType:"Category"},b=c.split(" ")[0].replace("categoryid-",""),d?a.assign_mobile_to_template=b:a.assign_to_category=b):0===c.indexOf("404")?(a={wp_type:"404",templateType:"404"},
b=btoa(window.location.href),d?a.assign_mobile_to_template=b:a.assign_to_404=b):0===c.indexOf("date")?(a={wp_type:"date",templateType:"Date"},b=btoa(window.location.href),d?a.assign_mobile_to_template=b:a.assign_to_archive=b):0===c.indexOf("search")?(a={wp_type:"search",templateType:"Search"},b=btoa(window.location.href),d?a.assign_mobile_to_template=b:a.assign_to_search=b,-1!==c.indexOf("cpt-")&&(c=c.split(" ")[1].replace("cpt-",""),a.assign_to_search_cpt=c)):0===c.indexOf("attachment")?(a={wp_type:"attachment",
templateType:"Attachment"},b=btoa(window.location.href),d?a.assign_mobile_to_template=b:a.assign_to_attachment=b):0===c.indexOf("authorid")?(a={wp_type:"author",templateType:"Author"},b=c.split(" ")[0].replace("authorid-",""),d?a.assign_mobile_to_template=b:a.assign_to_author=b):0===c.indexOf("tagid")?(a={wp_type:"tag",templateType:"Tag"},b=c.split(" ")[0].replace("tagid-",""),d?a.assign_mobile_to_template=b:a.assign_to_tag=b):0===c.indexOf("pageid")?(a={wp_type:"page",templateType:"Pages"},b=c.split(" ")[0].replace("pageid-",
""),d&&(a.assign_mobile_to_template=b)):0===c.indexOf("woo_productid-")?(a={wp_type:"woo_product",templateType:"Woo Product"},b=c.split(" ")[0].replace("woo_productid-",""),d?a.assign_mobile_to_template=b:a.assign_to_woo_product=b):0===c.indexOf("woo_archiveid-")?(a={wp_type:"woo_archive",templateType:"Woo Archive"},b=c.split(" ")[0].replace("woo_archiveid-",""),d?a.assign_mobile_to_template=b:a.assign_to_woo_archive=b):0===c.indexOf("woo_search_archive")?(a={wp_type:"woo_search_archive",templateType:"Woo Search"},
b=btoa(window.location.href),d?a.assign_mobile_to_template=b:a.assign_to_woo_search_archive=b):0===c.indexOf("woo_shop_base")?(a={wp_type:"woo_shop_base",templateType:"Woo Shop Base"},b=btoa(window.location.href),d?a.assign_mobile_to_template=b:a.assign_to_woo_shop_base=b):0===c.indexOf("cpt_tax")?(a={wp_type:"cpt_tax",templateType:"Custom Taxonomy"},b=c.split(" ")[0].replace("cpt_taxid-",""),d?a.assign_mobile_to_template=b:a.assign_to_cpt_tax=b):0===c.indexOf("cpt")&&(a={wp_type:"cpt",templateType:"Custom Post Type"},
b=c.split(" ")[0].replace("cptid-",""),d?a.assign_mobile_to_template=b:a.assign_to_cpt=b),""!==a&&(a.hide_mobile_selector="hide",window.tdbVue.router.push({name:"loadRoute",params:a})))}).on("click",".tdb-create-mobile-template",function(a){var b=jQuery(this),c=b.data("template-id"),d=b.data("type");tdConfirm.modal({caption:"Create Mobile "+("page"===d?"Page":"Template"),objectContext:window,callbackYes:function(){var a=jQuery("#tdb-new-template-name"),g=jQuery("#tdb-copy-content");jQuery.ajax({type:"POST",
url:td_ajax_url,data:{action:"tdb_create_mobile_template",template_id:c,template_title:a.val(),template_type:d,copyContent:g.is(":checked")?"1":"0",_nonce:window.tdb_globals.wpRestNonce},success:function(a,e,f){a=jQuery.parseJSON(a);"undefined"!==typeof a.mobile_template_id&&(tdConfirm.close(),e=b.closest(".tdb-template-el"),e.length&&(f=e.find(".tdb-template-el-mobile:first"),e.find(".tdb-template-el-mobile-btns:first").data("mobile-template-id",a.mobile_template_id),f.html('