var aiInstance,aiEnableCookie="undefined"!=typeof x&&aiEnableCookie,aiId="",aiExtraSpace=void 0===aiExtraSpace?0:aiExtraSpace,aiAccTime=0,aiRealFullscreen=void 0!==aiRealFullscreen&&aiRealFullscreen,aiInFullscreen=!1,aiOnloadEventsCounter=0,aiOverflowHtml=jQuery("html").css("overflow")??"visible",aiOverflowBody=jQuery("body").css("overflow")??"visible",aiCallbackExists=void 0!==aiReadyCallbacks&&aiReadyCallbacks instanceof Array,aiReadyCallbacks=aiCallbackExists?aiReadyCallbacks:[];function aiDebugExtended(a){"undefined"!=typeof aiShowDebug&&aiShowDebug&&console&&console.log&&console.log("Advanced iframe: "+a)}function aiResizeIframe(a,i,t){aiDebugExtended("aiResizeIframe");try{if("about:blank"===a.contentWindow.location.href)return;if(null!=a.contentWindow.document.body){var o=jQuery(window).scrollTop();a.style.marginTop=0,a.style.marginBottom=0,a.height=Number(t),a.style.height=Number(t)+"px";var r=aiGetIframeHeight(a);if(aiDebugExtended("aiResizeIframe - newheight: "+r),a.height=r,a.style.height=r+"px",0!==jQuery("#ai-zoom-div-"+a.id).length){var n=window["zoom_"+a.id];jQuery("#ai-zoom-div-"+a.id).css("height",r*n)}aiEnableCookie&&0===aiExtraSpace&&aiWriteCookie(r);var l=aiGetIframeHash(a.contentWindow.location.href);if(-1!==l){var s="#"+a.id;try{var d=jQuery(s).contents().find("#"+l);if(0!==d.length){var c=d.offset().top;o=Math.round(jQuery(s).offset().top+c)}}catch(h){}}if(setTimeout(function(){jQuery("html,body").scrollTop(o)},50),"true"===i){var f=aiGetIframeWidth(a);a.width=f,a.style.width=f+"px"}(0,window["resizeCallback"+a.id])(),null!=window.frameElement&&parent.jQuery("iframe").trigger("onload")}else setTimeout(function(){aiResizeIframe(a,i)},100)}catch(u){console&&console.error&&(console.error("Advanced iframe configuration error: You have enabled the resize of the iframe for pages on the same domain. But you use an iframe page on a different domain. You need to use the external workaround like described in the settings. Also check the next log. There the browser message for this error is displayed."),console.log(u))}}function aiGetIframeHash(a){var i;return a.split("#")[1]||"-1"}function aiGetIframeHeight(a){var i;return Math.max(a.contentWindow.document.body.scrollHeight,a.contentWindow.document.body.offsetHeight,a.contentWindow.document.documentElement.scrollHeight,a.contentWindow.document.documentElement.offsetHeight)+aiExtraSpace}function aiGetIframeWidth(a){var i=a.width;a.width=1,a.style.width="1px";var t=Math.max(a.contentWindow.document.body.scrollWidth,a.contentWindow.document.body.offsetWidth,a.contentWindow.document.documentElement.scrollWidth,a.contentWindow.document.documentElement.offsetWidth);return 1!==t?(a.width=t,a.style.width=t+"px"):(a.width=i,a.style.width=i+"px"),t}function aiGetParentIframeWidth(a){return null!=a&&0!==jQuery("#"+a.id).length?jQuery("#"+a.id).width():-1}function aiResizeIframeHeightById(a,i){aiDebugExtended("aiResizeIframeHeightById - id: "+a+", nHeight: "+i);try{(0,window["resizeCallback"+a])();var t=parseInt(i,10)+aiExtraSpace,o=document.getElementById(a);if(null===o&&console&&console.error){console.error("Advanced iframe configuration error: The iframe to resize could not be found. The id of the iframe and the one defined for ai_external.js ("+a+") are most likely different! Check your settings."),console.log(e);return}var r=jQuery(document).scrollTop();o.height=t,o.style.height=t+"px",jQuery("html,body").scrollTop(r),aiEnableCookie&&0===aiExtraSpace&&aiWriteCookie(t);var n=window["aiExecuteWorkaround_"+a];null!=n&&n()}catch(l){console&&console.error&&(console.error("Advanced iframe configuration error: The id of the parent and the external workaround are different! Check your settings."),console.log(l))}}function aiScrollToTop(a,i){if(aiDebugExtended("aiScrollToTop - id: "+a+", position: "+i),aiOnloadEventsCounter>0){var t=0;"iframe"===i&&(t=jQuery("#"+a).offset().top),setTimeout(function(){aiDebugExtended("aiScrollToTop - posTop: "+t),window.scrollTo(0,t)},100)}setTimeout(function(){aiOnloadEventsCounter++},1e3)}function aiWriteCookie(a){var i="ai-last-height";""!==aiId&&(i=i+"-"+aiId);var t=i+"="+a;document.cookie=t}function aiUseCookie(){var a="ai-last-height";""!==aiId&&(a=a+"-"+aiId);for(var i=document.cookie.split(";"),t=0;t1)||-1!==t.id.toLowerCase().indexOf(n[1].toLowerCase())))return!0}return!1}function aiOpenSelectorWindow(a){aiDebugExtended("aiOpenSelectorWindow");var i=jQuery("#width").val(),t=jQuery("#ai-height-0").val();(i.indexOf("%")>=0||900>Number(i))&&(i=900),(i=Number(i)+40)>screen.width&&(i=screen.width),(t=t.indexOf("%")>=0?screen.height:Number(t)+480)>screen.height-50&&(t=screen.height-50);var o="width="+i+",height="+t+",left=0,top=0,resizable=1,scrollbars=1";window.open(a,"",o).focus()}function aiDisableAiResizeOptions(a){jQuery("#onload_resize_delay").prop("readonly",a),jQuery("input[id=store_height_in_cookie1]:radio, input[id=store_height_in_cookie2]:radio").attr("disabled",a),jQuery("#additional_height").prop("readonly",a),jQuery("input[id=onload_resize_width1]:radio, input[id=onload_resize_width2]:radio").attr("disabled",a),jQuery("#resize_on_click").prop("readonly",a),jQuery("#resize_on_click_elements").prop("readonly",a),jQuery("#resize_on_ajax").prop("readonly",a),jQuery("input[id=resize_on_ajax_jquery1]:radio, input[id=resize_on_ajax_jquery2]:radio").attr("disabled",a);var i="#onload_resize_delay, #store_height_in_cookie1, #additional_height, #onload_resize_width1, ";aiDisableTextSection(a,i+="#resize_on_click, #resize_on_click_elements, #resize_on_ajax, #resize_on_ajax_jquery1")}function aiDisablePartOfIframeOptions(a){jQuery("#show_part_of_iframe_x").prop("readonly",a),jQuery("#show_part_of_iframe_y").prop("readonly",a),jQuery("#show_part_of_iframe_height").prop("readonly",a),jQuery("#show_part_of_iframe_width").prop("readonly",a),jQuery("input[id=show_part_of_iframe_allow_scrollbar_horizontal1]:radio, input[id=show_part_of_iframe_allow_scrollbar_horizontal2]:radio").attr("disabled",a),jQuery("input[id=show_part_of_iframe_allow_scrollbar_vertical1]:radio, input[id=show_part_of_iframe_allow_scrollbar_vertical2]:radio").attr("disabled",a),jQuery("#show_part_of_iframe_next_viewports").prop("readonly",a),jQuery("input[id=show_part_of_iframe_next_viewports_loop1]:radio, input[id=show_part_of_iframe_next_viewports_loop2]:radio").attr("disabled",a),jQuery("#show_part_of_iframe_new_window").prop("readonly",a),jQuery("#show_part_of_iframe_new_url").prop("readonly",a),jQuery("input[id=show_part_of_iframe_next_viewports_hide1]:radio, input[id=show_part_of_iframe_next_viewports_hide2]:radio").attr("disabled",a),jQuery("#show_part_of_iframe_style").prop("readonly",a),jQuery("input[id=show_part_of_iframe_zoom1]:radio, input[id=show_part_of_iframe_zoom2]:radio, input[id=show_part_of_iframe_zoom3]:radio").attr("disabled",a),jQuery(".media-query-input").prop("readonly",a);var i="#show_part_of_iframe_x, #show_part_of_iframe_y, #show_part_of_iframe_height, #show_part_of_iframe_width, ";i+="#show_part_of_iframe_allow_scrollbar_horizontal1, #show_part_of_iframe_next_viewports, #show_part_of_iframe_next_viewports_loop1, ",i+="#show_part_of_iframe_new_window, #show_part_of_iframe_new_url, #show_part_of_iframe_next_viewports_hide1, #show_part_of_iframe_style, ",aiDisableTextSection(a,i+="#show_part_of_iframe_zoom1, #show_part_of_iframe_allow_scrollbar_vertical1, #add-media-query-show_part_of_iframe_media_query"),a?(jQuery("#add-media-query-show_part_of_iframe_media_query").hide(),jQuery(".ai-delete").hide()):(jQuery("#add-media-query-show_part_of_iframe_media_query").show(),jQuery(".ai-delete").show())}function aiDisableLazyLoadOptions(a){jQuery("#enable_lazy_load_threshold").prop("readonly",a),jQuery("#enable_lazy_load_fadetime").prop("readonly",a),jQuery("input[id=enable_lazy_load_reserve_space1]:radio, input[id=enable_lazy_load_reserve_space2]:radio").attr("disabled",a),jQuery("input[id=enable_lazy_load_manual1]:radio, input[id=enable_lazy_load_manual2]:radio, input[id=enable_lazy_load_manual3]:radio").attr("disabled",a),aiDisableTextSection(a,"#enable_lazy_load_threshold, #enable_lazy_load_fadetime, #enable_lazy_load_reserve_space1, #enable_lazy_load_manual1")}function aiDisableIframeAsLayerOptions(a){jQuery("input[id=show_iframe_as_layer_full]:radio").attr("disabled",a),jQuery("#show_iframe_as_layer_header_file").prop("readonly",a),jQuery("#show_iframe_as_layer_header_height").prop("readonly",a),jQuery("#show_iframe_as_layer_autoclick_delay").prop("readonly",a),jQuery("#show_iframe_as_layer_autoclick_hide_time").prop("readonly",a),jQuery("input[id=show_iframe_as_layer_header_position1]:radio, input[id=show_iframe_as_layer_header_position2]:radio").attr("disabled",a),jQuery("input[id=show_iframe_as_layer_full1]:radio, input[id=show_iframe_as_layer_full2]:radio, input[id=show_iframe_as_layer_full3]:radio").attr("disabled",a),jQuery("input[id=show_iframe_as_layer_keep_content1]:radio, input[id=show_iframe_as_layer_keep_content2]:radio").attr("disabled",a);var i="#show_iframe_as_layer_full, #show_iframe_as_layer_header_file, #show_iframe_as_layer_header_height, ";i+="#show_iframe_as_layer_header_position1, #show_iframe_as_layer_full1, #show_iframe_as_layer_keep_content1, ",aiDisableTextSection(a,i+="#show_iframe_as_layer_autoclick_delay, #show_iframe_as_layer_autoclick_hide_time")}function aiDisableAddParamOptions(a){jQuery("input[id=add_iframe_url_as_param_direct1]:radio, input[id=add_iframe_url_as_param_direct2]:radio").attr("disabled",a),jQuery("#add_iframe_url_as_param_prefix").prop("readonly",a),aiDisableTextSection(a,"#add_iframe_url_as_param_prefix, #add_iframe_url_as_param_direct1")}function aiDisableTextSection(a,i){a?jQuery(i).closest("tr").addClass("disabled"):jQuery(i).closest("tr").removeClass("disabled")}function aiInitAdminConfiguration(a,i){"false"===jQuery("input[type=radio][name=onload_resize]:checked").val()&&aiDisableAiResizeOptions(!0),jQuery("input[type=radio][name=onload_resize]").click(function(){"true"===jQuery(this).val()?(jQuery("input:radio[name=enable_external_height_workaround]")[1].checked=!0,aiDisableAiResizeOptions(!1)):(jQuery("#onload_resize_delay").val(""),aiDisableAiResizeOptions(!0))}),jQuery("input[type=radio][name=enable_external_height_workaround]").click(function(){"true"===jQuery(this).val()&&(jQuery("input:radio[name=onload_resize]")[1].checked=!0,jQuery("#onload_resize_delay").val(""),aiDisableAiResizeOptions(!0))}),"false"===jQuery("input[type=radio][name=show_part_of_iframe]:checked").val()&&aiDisablePartOfIframeOptions(!0),jQuery("input[type=radio][name=show_part_of_iframe]").click(function(){"false"===jQuery(this).val()?aiDisablePartOfIframeOptions(!0):aiDisablePartOfIframeOptions(!1)}),"false"===jQuery("input[type=radio][name=show_iframe_as_layer]:checked").val()&&aiDisableIframeAsLayerOptions(!0),jQuery("input[type=radio][name=show_iframe_as_layer]").click(function(){"false"===jQuery(this).val()?aiDisableIframeAsLayerOptions(!0):aiDisableIframeAsLayerOptions(!1)}),"true"===jQuery("input[type=radio][name=expert_mode]:checked").val()&&(jQuery(".description").css("display","none"),jQuery("table.form-table th").css("cursor","pointer"),jQuery("table.form-table th").css("padding-top","8px").css("padding-bottom","2px"),jQuery("table.form-table td").css("padding-top","5px").css("padding-bottom","5px"),jQuery("table.form-table th").click(function(){jQuery(".description").css("display","none"),jQuery(".description",jQuery(this).parent()).css("display","block")})),jQuery("input[type=radio][name=expert_mode]").click(function(){"false"===jQuery(this).val()?(jQuery(".description").css("display","block"),jQuery("table.form-table th").css("cursor","auto"),jQuery("table.form-table th").off("click"),jQuery("table.form-table th").css("padding-top","20px").css("padding-bottom","20px"),jQuery("table.form-table td").css("padding-top","15px").css("padding-bottom","15px")):(jQuery(".description").css("display","none"),jQuery("table.form-table th").css("cursor","pointer"),jQuery("table.form-table th").css("padding-top","8px").css("padding-bottom","2px"),jQuery("table.form-table td").css("padding-top","5px").css("padding-bottom","5px"),jQuery("table.form-table th").click(function(){jQuery(".description").css("display","none"),jQuery(".description",jQuery(this).parent()).css("display","block")}))}),jQuery("#accordion").find("h1").click(function(){jQuery(this).next().slideToggle(aiAccTime)}).next().hide(),jQuery("#accordion").find("a").click(function(){var a="#h1-"+jQuery(this).prop("hash").substring(1);jQuery(a).next().show(),location.hash=a}),"false"===jQuery("input[type=radio][name=enable_lazy_load_manual]:checked").val()&&jQuery("#enable_lazy_load_manual_element").prop("readonly",!0),jQuery("input[type=radio][name=enable_lazy_load_manual]").click(function(){"false"===jQuery(this).val()||"auto"===jQuery(this).val()?jQuery("#enable_lazy_load_manual_element").prop("readonly",!0):jQuery("#enable_lazy_load_manual_element").prop("readonly",!1)}),"false"===jQuery("input[type=radio][name=add_iframe_url_as_param]:checked").val()&&aiDisableAddParamOptions(!0),jQuery("input[type=radio][name=add_iframe_url_as_param]").click(function(){aiDisableAddParamOptions("false"===jQuery(this).val())}),"false"===jQuery("input[type=radio][name=enable_lazy_load]:checked").val()&&(aiDisableLazyLoadOptions(!0),jQuery("#enable_lazy_load_manual_element").prop("readonly",!0)),jQuery("input[type=radio][name=enable_lazy_load]").click(function(){"false"===jQuery(this).val()?(aiDisableLazyLoadOptions(!0),jQuery("#enable_lazy_load_manual_element").prop("readonly",!0)):(aiDisableLazyLoadOptions(!1),"false"===jQuery("input[type=radio][name=enable_lazy_load_manual]:checked").val()||"auto"===jQuery("input[type=radio][name=enable_lazy_load_manual]:checked").val()?jQuery("#enable_lazy_load_manual_element").prop("readonly",!0):jQuery("#enable_lazy_load_manual_element").prop("readonly",!1))}),jQuery(".confirmation").on("click",function(){return confirm("Are you sure? Selecting OK will set all settings to the default.")}),jQuery(".confirmation-file").on("click",function(){return confirm("Do you really want to delete the file?")}),jQuery(".confirmation-hash").on("click",function(){return confirm("Do you really want to delete the hash/URL cache?")}),jQuery("a.post").click(function(a){a.stopPropagation(),a.preventDefault();var i,t=this.href.split("?"),o=t[0],r=t[1].split("&"),n="";o+="?"+r[0];for(var l=1,s=r.length;l';var d=jQuery("#twg-options").val();n+='',jQuery("body").append('
'+n+"
"),jQuery("#poster").submit()}),jQuery(".ai-input-search").keyup(function(a){var t=jQuery("input.ai-input-search").val().toLowerCase();aiSettingsSearch(t,i)}),jQuery(".ai-input-search").on("click",function(a){setTimeout(function(){var a=jQuery("input.ai-input-search").val().toLowerCase();aiSettingsSearch(a,i)},100)}),jQuery(document).on("click",".nav-tab-wrapper a",function(){var a=jQuery(this).attr("id");return jQuery("section").hide(),jQuery("section."+a).show(),jQuery("#current_tab").val(a.substr(4,1)),jQuery(".nav-tab").removeClass("nav-tab-active"),jQuery(this).addClass("nav-tab-active"),jQuery(this).blur(),!1}),jQuery(document).on("click","a#external-workaround-link",function(){return jQuery(".external-workaround").click(),location.hash="tab_3",aiShowHeader("tab_3"),!1}),jQuery(document).on("click","a#resize-same-link",function(){return jQuery(".advanced-settings-tab").click(),jQuery("#id-advanced-resize").removeClass("closed"),location.hash="id-advanced-resize",aiShowHeader("id-advanced-resize"),!1}),jQuery(document).on("click","a.jquery-help-link",function(){return jQuery(".help-tab").click(),jQuery("#id-help-jquery").removeClass("closed"),jQuery("#jquery-help").show(),location.hash="id-help-jquery",aiShowHeader("id-help-jquery"),!1}),jQuery(document).on("click","a#browser-detection-link",function(){return jQuery(".help-tab").click(),jQuery("#id-help-browser").removeClass("closed"),jQuery("#browser-help").show(),location.hash="id-help-browser",aiShowHeader("id-help-browser"),!1}),jQuery(document).on("click","a.howto-id-link",function(){return jQuery(".help-tab").click(),jQuery("#id-help-id").removeClass("closed"),location.hash="id-help-id",aiShowHeader("id-help-id"),!1}),jQuery(document).on("click",".modifycontent-link",function(){return jQuery(".advanced-settings-tab").click(),jQuery("#id-advanced-modify-iframe").removeClass("closed"),location.hash="id-advanced-modify-iframe",aiShowHeader("id-advanced-modify-iframe","tr-"+jQuery(this).data("detail")),!1}),jQuery(document).on("click",".id-modify-css-iframe-link",function(){return jQuery(".advanced-settings-tab").click(),jQuery("#id-advanced-modify-iframe").removeClass("closed"),location.hash="id-modify-css-iframe",aiShowHeader("id-advanced-modify-iframe","tr-"+jQuery(this).data("detail")),!1}),jQuery(document).on("click",".modify-target",function(){return jQuery(".advanced-settings-tab").click(),jQuery("#id-advanced-modify-iframe").removeClass("closed"),location.hash="id-modify-target",aiShowHeader("id-advanced-modify-iframe","tr-"+jQuery(this).data("detail")),!1}),jQuery(document).on("click","a.link-external-domain",function(){return jQuery("#id-external-different").removeClass("closed"),location.hash="#id-external-different",aiShowHeader("id-external-different"),!1}),jQuery(document).on("click","a.link-id-external-ai-config-post",function(){return jQuery("#id-external-ai-config-post").removeClass("closed"),location.hash="#id-external-ai-config-post",aiShowHeader("id-external-ai-config-post","tr-use_post_message"),!1}),jQuery(document).on("click","a.link-id-external-ai-overview",function(){return jQuery("#id-external-ai-overview").removeClass("closed"),location.hash="#id-external-ai-overview",aiShowHeader("id-external-ai-overview","id-external-ai-overview"),!1}),jQuery(document).on("click","a.post-message-help-link",function(){return jQuery(".help-tab").click(),jQuery("#id-help-communication").removeClass("closed"),location.hash="#id-help-communication",aiShowHeader("id-help-communication","id-help-communication"),!1}),jQuery(document).on("click","a.enable-admin",function(){return jQuery(".options-tab").click(),jQuery("#id-options-display").removeClass("closed"),location.hash="#id-options-display",aiShowHeader("id-options-display","tr-demo"),!1}),jQuery(document).on("click","a.enter-registration",function(){return jQuery(".options-tab").click(),jQuery("#id-options-registration").removeClass("closed"),location.hash="#id-options-registration",aiShowHeader("id-options-registration","tr-demo"),!1}),jQuery(document).on("click","a#user-help-link",function(){return jQuery("#user-help").css("display","block"),!1}),jQuery(document).on("click","a#user-meta-link",function(){return jQuery("#meta-help").css("display","block"),!1}),jQuery(document).on("click","#ai-selector-help-link",function(){return jQuery("#ai-selector-help").slideDown(1e3),!1}),jQuery(document).on("click",".ai-selector-help-link-move",function(){return jQuery("#ai-selector-help").show("slow"),location.hash="#ai-selector-help-link",aiShowHeader("ai-selector-help-link"),!1}),jQuery("#ai_form").submit(function(){aiSetScrollposition()}),jQuery(".if-js-closed").removeClass("if-js-closed").addClass("closed"),"undefined"!=typeof postboxes&&postboxes.add_postbox_toggles("toplevel_page_advanced-iframe"),jQuery(".ai-spinner").css("display","none"),jQuery("#"+i).next().show(),jQuery(document).on("click","#test-pro-admin.is-permanent-closable button",function(){closeInfoPermanent("test-pro-admin")}),jQuery(document).on("click","#show-registration-message.is-permanent-closable button",function(){closeInfoPermanent("show-registration-message")}),jQuery(document).on("click","#show-version-message.is-permanent-closable button",function(){closeInfoPermanent("show-version-message")}),jQuery(document).on("click",".mq-breakpoint-height a",function(a){return jQuery(this).parent().remove(),aiUpdateHeightHiddenField("height"),a.preventDefault(),!1}),jQuery(document).on("click","a#add-media-query-height",function(a){var i=jQuery(".mq-breakpoint-height").length+1;return jQuery(this).parent().append('
 Breakpoint: Delete'),a.preventDefault(),!1}),jQuery(document).on("click",".mq-breakpoint-show_part_of_iframe_media_query a",function(a){return jQuery(this).parent().remove(),aiUpdateHeightHiddenFieldMediaQuery("show_part_of_iframe_media_query"),a.preventDefault(),!1}),jQuery(document).on("click","a#add-media-query-show_part_of_iframe_media_query",function(a){var i=jQuery(".mq-breakpoint-show_part_of_iframe_media_query").length+1;return jQuery(this).parent().append('
x:  y:  w:  h:  iframe width:  Breakpoint: Delete'),a.preventDefault(),!1})}function aiCheckHeightNumber(a,i){aiCheckInputNumber(a),aiUpdateHeightHiddenField(i)}function aiCheckHeightNumberMediaQuery(a,i){aiCheckInputNumber(a),aiUpdateHeightHiddenFieldMediaQuery(i)}function aiUpdateHeightHiddenField(a){var i=jQuery("#ai-"+a+"-0").val(),t=[];jQuery(".mq-breakpoint-"+a).each(function(a){var i=jQuery(this).children().eq(0).val(),o=jQuery(this).children().eq(1).val();""!==i&&""!==o&&t.push({heightChild:i,breakpointChild:o})}),t.sort(function(a,i){return i.breakpointChild-a.breakpointChild});let o=i;t.forEach(function(a){o+=","+a.heightChild+"|"+a.breakpointChild}),jQuery("#"+a).val(o);let r=jQuery("#description-"+a).html().split("Shortcode attribute: ")[0];jQuery("#description-"+a).html(r+"Shortcode attribute: "+a+'="'+o+'"')}function aiUpdateHeightHiddenFieldMediaQuery(a){var i=[];jQuery(".mq-breakpoint-"+a).each(function(a){var t=jQuery(this).children().eq(0).val(),o=jQuery(this).children().eq(1).val(),r=jQuery(this).children().eq(2).val(),n=jQuery(this).children().eq(3).val(),l=jQuery(this).children().eq(4).val(),s=jQuery(this).children().eq(5).val();(""!==t||""!==o||""!==r||""!==n||""!==l)&&""!==s&&i.push({mediaX:t,mediaY:o,mediaW:r,mediaH:n,mediaIW:l,breakpointChild:s})}),i.sort(function(a,i){return i.breakpointChild-a.breakpointChild});let t="";i.forEach(function(a){t+=","+a.mediaX+"|"+a.mediaY+"|"+a.mediaW+"|"+a.mediaH+"|"+a.mediaIW+"|"+a.breakpointChild}),t=t.replace(/(^,)|(,$)/g,""),jQuery("#"+a).val(t);let o=jQuery("#description-"+a).html().split("Shortcode attribute: ")[0];jQuery("#description-"+a).html(o+"Shortcode attribute: "+a+'="'+t+'"')}function aiSettingsSearch(a,i){var t=0;""!==a?(jQuery("#ai p").not(".form-table p").hide(),jQuery("#ai ul").not(".form-table ul").hide(),jQuery("#ai ol").not(".form-table ol").hide(),"false"!==i&&(jQuery("#ai h1").not(".show-always").hide(),jQuery("#ai #accordion").attr("id","acc"),jQuery("#ai #acc > div").show(),jQuery("#ai #spacer-div").show()),jQuery("#ai h2,#ai .icon_ai,#ai h3,#ai h4").not(".show-always").hide(),jQuery("#ai .form-table").addClass("ai-remove-margin"),jQuery("#ai hr, .signup_account_container, .config-file-block").hide(),jQuery("#ai .hide-always").hide(),jQuery("#ai .hide-search").hide(),jQuery("#ai .postbox-container").not(".show-always").hide(),jQuery("#ai .show-always p").show(),jQuery("#ai .show-always ul").show(),jQuery("#ai .show-always ol").show(),jQuery("#ai .show-always h2,#ai .show-always .icon_ai,#ai .show-always h3,#ai .show-always h4").show()):(jQuery("#ai p").not(".form-table p").show(),jQuery("#ai section .ai-anchor").show(),jQuery("#ai ul").not(".form-table ul").show(),jQuery("#ai ol").not(".form-table ol").show(),"false"!==i&&(jQuery("#ai h1").not(".show-always").show(),jQuery("#ai #acc").attr("id","accordion"),jQuery("#ai #accordion > div").hide(),jQuery("#ai #spacer-div").hide()),jQuery("#ai h2,#ai .icon_ai,#ai h3,#ai h4").not(".show-always").show(),jQuery("#ai .form-table").removeClass("ai-remove-margin"),jQuery("#ai hr, .signup_account_container, .config-file-block").show(),jQuery("#ai .sub-domain-container").show(),jQuery("#ai .hide-search").show(),jQuery("#ai .hide-always").hide(),jQuery("#ai .postbox-container").show(),setTimeout(function(){jQuery("#ai .postbox-container .closed .inside").css("display","")},5)),jQuery("#ai .mark-tab-header").removeClass("mark-tab-header");var o="";if(jQuery("#ai tr").each(function(){var i=jQuery(this),r=i.find("th").text(),n=i.find("p.description").text();if(r=void 0!==r?r.toLowerCase():"XXXXXXX",n=void 0!==n?n.toLowerCase():"XXXXXXX",-1===r.indexOf(a)&&-1===n.indexOf(a))0==i.parents(".show-always").length&&i.addClass("hide-setting");else{if(i.closest("table").prevAll("h2:first").show(),i.closest(".postbox-container").show(),i.closest(".postbox-container").find("h2, .inside").show(),i.closest("table").prevAll("#ai .icon_ai:first").show(),i.closest("table").nextAll("p.button-submit:first").show(),i.removeClass("hide-setting"),i.closest(".hide-search").show(),a.length>2){var l=i.closest("section").attr("class");void 0!==l&&(jQuery("#"+l).addClass("mark-tab-header"),""===o&&(o=l))}t++}}),0===t)jQuery("#ai-input-search-result").show(),jQuery("#ai .mark-tab-header").removeClass("mark-tab-header");else{if(jQuery("#ai-input-search-result").hide(),aiInstance&&aiInstance.revert(),""!==a&&a.length>2){var r=RegExp(a,"gi");aiInstance=findAndReplaceDOMText(document.getElementById("tab_wrapper"),{find:r,wrap:"em"})}jQuery("#"+o).click()}}function aiResizeIframeRatio(a,i){aiDebugExtended("aiResizeIframeRatio");var t,o=Math.ceil(jQuery("#"+a.id).width()*parseFloat(i.replace(",",".")));a.height=o,a.style.height=o+"px"}function aiGenerateShortcode(a){var i="[advanced_iframe ";""!==jQuery("#securitykey").val()&&(i+='securitykey="'+jQuery("#securitykey").val()+'" '),i+='use_shortcode_attributes_only="true" ';var t=jQuery("#include_html").val(),o=jQuery("#include_url").val(),r=jQuery("#document_domain_add").val();if(void 0===t||""===t&&""===o){var n=jQuery("#src").val();""===n?alert("Required url is missing."):i+='src="'+n+'" ',i+=aiGenerateTextShortcode("src_hide"),i+=aiGenerateTextShortcode("width"),i+=aiGenerateTextShortcode("height"),i+=aiGenerateRadioShortcode("scrolling","none"),i+=aiGenerateRadioShortcode("add_surrounding_p","false"),i+=aiGenerateRadioShortcode("enable_ios_mobile_scolling","false"),i+=aiGenerateTextShortcode("marginwidth"),i+=aiGenerateTextShortcode("marginheight"),i+=aiGenerateTextShortcode("frameborder"),i+=aiGenerateRadioShortcode("transparency","true"),i+=aiGenerateTextShortcode("class"),i+=aiGenerateTextShortcode("style"),i+=aiGenerateTextShortcodeWithDefault("id","advanced_iframe"),i+=aiGenerateTextShortcode("name"),i+=aiGenerateRadioShortcode("allowfullscreen","false"),i+=aiGenerateTextShortcode("safari_fix_url"),i+=aiGenerateTextShortcode("sandbox"),i+=aiGenerateTextShortcode("title"),i+=aiGenerateTextShortcode("allow"),i+=aiGenerateRadioShortcode("loading","lazy"),i+=aiGenerateTextShortcode("referrerpolicy"),i+=aiGenerateTextShortcode("custom"),i+=aiGenerateTextShortcode("url_forward_parameter"),i+=aiGenerateTextShortcode("map_parameter_to_url"),i+=aiGenerateRadioShortcode("add_iframe_url_as_param","false"),i+=aiGenerateTextShortcode("add_iframe_url_as_param_prefix"),i+=aiGenerateRadioShortcode("add_iframe_url_as_param_direct","false"),i+=aiGenerateRadioShortcode("use_iframe_title_for_parent","false"),i+=aiGenerateRadioShortcode("onload_scroll_top","false"),i+=aiGenerateRadioShortcode("hide_page_until_loaded","false"),i+=aiGenerateRadioShortcode("show_iframe_loader","false"),i+=aiGenerateTextShortcode("hide_content_until_iframe_color"),i+=aiGenerateTextShortcode("iframe_zoom"),i+=aiGenerateRadioShortcode("iframe_zoom_ie8","false"),i+=aiGenerateRadioShortcode("use_zoom_absolute_fix","false"),i+=aiGenerateRadioShortcode("auto_zoom","false"),i+=aiGenerateTextShortcode("auto_zoom_by_ratio"),i+=aiGenerateRadioShortcode("enable_responsive_iframe","false"),i+=aiGenerateTextShortcode("iframe_height_ratio"),i+=aiGenerateRadioShortcode("enable_lazy_load","false"),i+=aiGenerateTextShortcodeWithDefault("enable_lazy_load_threshold","3000"),i+=aiGenerateRadioShortcode("enable_lazy_load_reserve_space","true"),i+=aiGenerateTextShortcode("enable_lazy_load_fadetime"),i+=aiGenerateRadioShortcode("enable_lazy_load_manual","false"),i+=aiGenerateRadioShortcode("enable_lazy_load_manual_element","false"),i+=aiGenerateTextShortcode("reload_interval"),i+=aiGenerateTextShortcode("hide_elements"),i+=aiGenerateTextShortcode("content_id"),i+=aiGenerateTextShortcode("content_styles"),i+=aiGenerateTextShortcode("parent_content_css"),i+=aiGenerateRadioShortcode("add_css_class_parent","false"),i+=aiGenerateTextShortcode("change_parent_links_target"),i+=aiGenerateRadioShortcode("show_iframe_as_layer","false"),i+=aiGenerateRadioShortcode("show_iframe_as_layer_full","false"),i+=aiGenerateTextShortcode("show_iframe_as_layer_autoclick_delay"),i+=aiGenerateTextShortcode("show_iframe_as_layer_autoclick_hide_time"),i+=aiGenerateTextShortcode("show_iframe_as_layer_header_file"),i+=aiGenerateTextShortcodeWithDefault("show_iframe_as_layer_header_height","100"),i+=aiGenerateRadioShortcode("show_iframe_as_layer_header_position","top"),i+=aiGenerateRadioShortcode("show_iframe_as_layer_keep_content","true");var l=aiGenerateRadioShortcode("show_part_of_iframe","false");i+=l,""!==l&&(i+=aiGenerateTextShortcodeWithDefault("show_part_of_iframe_x",-1),i+=aiGenerateTextShortcodeWithDefault("show_part_of_iframe_y",-1),i+=aiGenerateTextShortcode("show_part_of_iframe_width"),i+=aiGenerateTextShortcode("show_part_of_iframe_height"),i+=aiGenerateTextShortcode("show_part_of_iframe_media_query"),i+=aiGenerateRadioShortcode("show_part_of_iframe_allow_scrollbar_horizontal","false"),i+=aiGenerateRadioShortcode("show_part_of_iframe_allow_scrollbar_vertical","false"),i+=aiGenerateTextShortcode("show_part_of_iframe_style"),i+=aiGenerateRadioShortcode("show_part_of_iframe_zoom","false"),i+=aiGenerateTextShortcode("show_part_of_iframe_next_viewports"),i+=aiGenerateRadioShortcode("show_part_of_iframe_next_viewports_loop","false"),i+=aiGenerateTextShortcode("show_part_of_iframe_new_window"),i+=aiGenerateTextShortcode("show_part_of_iframe_new_url"),i+=aiGenerateRadioShortcode("show_part_of_iframe_next_viewports_hide","false")),i+=aiGenerateTextShortcode("hide_part_of_iframe"),i+=aiGenerateRadioShortcode("fullscreen_button","false"),i+=aiGenerateTextShortcode("fullscreen_button_hide_elements"),i+=aiGenerateRadioShortcode("fullscreen_button_full","false"),i+=aiGenerateRadioShortcode("fullscreen_button_style","black"),i+=aiGenerateRadioShortcode("add_css_class_iframe","false"),i+=aiGenerateTextShortcode("iframe_hide_elements"),i+=aiGenerateTextShortcode("onload_show_element_only"),i+=aiGenerateTextShortcode("iframe_content_id"),i+=aiGenerateTextShortcode("iframe_content_styles"),i+=aiGenerateTextShortcode("iframe_content_css"),i+=aiGenerateTextShortcode("change_iframe_links"),i+=aiGenerateTextShortcode("change_iframe_links_target"),i+=aiGenerateTextShortcode("change_iframe_links_href"),i+=aiGenerateTextShortcode("onload"),i+=aiGenerateRadioShortcode("onload_resize","false"),i+=aiGenerateTextShortcode("onload_resize_delay"),i+=aiGenerateRadioShortcode("store_height_in_cookie","false"),i+=aiGenerateTextShortcode("additional_height"),i+=aiGenerateRadioShortcode("onload_resize_width","false"),i+=aiGenerateTextShortcode("resize_on_ajax"),i+=aiGenerateRadioShortcode("resize_on_ajax_jquery","true"),i+=aiGenerateTextShortcode("resize_on_click"),i+=aiGenerateTextShortcodeWithDefault("resize_on_click_elements","a"),i+=aiGenerateTextShortcode("resize_on_element_resize"),i+=aiGenerateTextShortcodeWithDefault("resize_on_element_resize_delay","250"),i+=aiGenerateTextShortcode("tab_hidden"),i+=aiGenerateTextShortcode("tab_visible"),i+=aiGenerateRadioShortcode("add_document_domain","false"),"true"===r&&(i+=aiGenerateTextShortcode("document_domain")),i+=aiGenerateRadioShortcode("enable_external_height_workaround","external"),i+=aiGenerateRadioShortcode("hide_page_until_loaded_external","false"),i+=aiGenerateTextShortcode("pass_id_by_url"),i+=aiGenerateRadioShortcode("multi_domain_enabled","true"),"true"===a?i+=aiGenerateRadioShortcode("use_post_message","true"):i+=aiGenerateRadioShortcode("use_post_message","false"),i+=aiGenerateTextShortcode("additional_css"),i+=aiGenerateTextShortcode("additional_js"),i+=aiGenerateTextShortcode("additional_js_file_iframe"),i+=aiGenerateTextShortcode("additional_css_file_iframe")}else""===t?(i+=aiGenerateTextShortcode("include_url"),i+=aiGenerateTextShortcode("include_content"),i+=aiGenerateTextShortcode("include_height"),i+=aiGenerateTextShortcode("include_fade"),i+=aiGenerateRadioShortcode("include_hide_page_until_loaded","false")):i+=aiGenerateTextShortcode("include_html");i+=aiGenerateRadioShortcode("debug_js","false"),i=i.slice(0,-1),i+="]",jQuery("#gen-shortcode").html(i)}function aiGenerateTextShortcodeWithDefault(a,i){var t="",o=jQuery("#"+a),r=o.val();return o.length>0&&""!==r&&r!==i&&(t=a+'="'+r+'" '),t}function aiGenerateTextShortcode(a){var i="",t=jQuery("#"+a),o=t.val();return t.length>0&&""!==o&&"0"!==o&&(i=a+'="'+o+'" '),i}function aiGenerateRadioShortcode(a,i){var t="",o=jQuery("input:radio[name="+a+"]:checked"),r=o.val();return"enable_ios_mobile_scolling"===a&&(a="enable_ios_mobile_scrolling"),o.length>0&&r!==i&&(t+=a+'="'+r+'" '),t}function aiAddCssClassAllParents(a){for(var i=jQuery(a).parentsUntil("html"),t="ai-class-",o=0;o1&&(d=1),aiSetZoom(a,d),window["zoom_"+a]=d,n.width(l).css("max-width","none"),s}function aiAutoZoom(a,i,t){aiDebugExtended("aiAutoZoom");var o,r=t.split("|");t=r[0];var n=-1;1!==r.length&&(n=r[1]);var l=document.getElementById(a);-1===n?(l.width=1,l.style.width="1px",o=aiGetIframeWidth(l),l.width=o,l.style.width=o+"px"):o=n;var s=aiAutoZoomExternal(a,o,i);if(""===t)aiResizeIframe(l,!1);else{var d=Math.ceil(o*t);if(l.height=d,l.style.height=d+"px",0!==jQuery("#ai-zoom-div-"+l.id).length){var c=window["zoom_"+l.id];jQuery("#ai-zoom-div-"+l.id).css("height",Math.ceil(d*c))}}return s}function aiSetZoom(a,i){var t=jQuery("#"+a);!0===aiIsIe8&&t.css("-ms-zoom",i),t.css({"-ms-transform":"scale("+i+")","-moz-transform":"scale("+i+")","-o-transform":"scale("+i+")","-webkit-transform":"scale("+i+")",transform:"scale("+i+")"})}function aiAutoZoomViewport(a,i){for(var t=jQuery(a),o=t.parent(),r=0;o.is("p")||void 0!==o.attr("id")&&0===o.attr("id").indexOf("ai-");)if(o=o.parent(),r++>10){alert("Unexpected div structure. Please disable the zoom.");break}var n=t.width(),l=o.width(),s=t.height(),d=l/n;"true"===i&&d>1&&(d=1),aiSetZoom(t.attr("id"),d);var c=-Math.round((n-n*d)/2),h=-Math.round((s-s*d)/2);t.css({"margin-left":c+"px","margin-right":c+"px","margin-top":h+"px","margin-bottom":h+"px"})}function aiResetAiSettings(){jQuery("#action").val("reset")}function aiCheckInputNumber(a){a.value=a.value.split(" ").join("");var i=a.value;""!==a.value&&(i.match(/^(\-){0,1}([\d.])+(px|%|em|pt|vh|vw|rem|ch)?(\-|\+){0,1}([\d.]){0,7}(px|%|em|pt|vh|vw|rem|ch)?$/)||(alert("Please check the value you have entered. Only numbers with a dot or with an optional px, %, em or pt are allowed."),setTimeout(function(){a.focus()},10)))}function aiCheckInputPurchaseCode(a){a.value=a.value.split(" ").join("");var i=a.value;""!==a.value&&(i.match(/^([a-f0-9]{8})-(([a-f0-9]{4})-){3}([a-f0-9]{12})$/i)||(alert("Please check the value you have entered. Your input seems not to be a valid purchase code."),a.value="",setTimeout(function(){a.focus()},10)))}function aiCheckInputNumberOnly(a){a.value=a.value.split(" ").join("");var i=a.value;if(""===a.value){a.value="0";return}i.match(/^(\-){0,1}([\d.])+$/)||(alert("Please check the value you have entered. Only numbers without a dot or optional px, %, em or pt are allowed."),setTimeout(function(){a.focus()},10))}function aiShowHeader(a,i){var t=jQuery(window).scrollTop();jQuery(window).scrollTop(t-40),void 0!==i&&aiFlashElement(i)}function aiFlashElement(a){setTimeout(function(){jQuery("#"+a).css("background-color","#eee")},500),setTimeout(function(){jQuery("#"+a).css("background-color","#fff")},900),setTimeout(function(){jQuery("#"+a).css("background-color","#eee")},1300),setTimeout(function(){jQuery("#"+a).css("background-color","#fff")},1700)}function aiSetScrollposition(){var a=jQuery(document).scrollTop();jQuery("#scrollposition").val(a)}function aiResetShowPartOfAnIframe(a){jQuery("#"+a).css("top","0px").css("left","0px").css("position","static"),jQuery("#ai-div-"+a).css("width","auto").css("height","auto").css("overflow","auto").css("position","static")}function aiShowLayerIframe(a,i,t,o,r,n,l){aiDebugExtended("aiShowLayerIframe"),n=void 0!==n&&n,l=void 0===l||l;var s="#"+i;jQuery("#ai-zoom-div-"+i).show(),l&&"true"===o&&jQuery(s).css("visibility","hidden"),jQuery(s).show(),jQuery("#ai-layer-div-"+i).length&&jQuery(s="#ai-layer-div-"+i).show(),jQuery("body").css("overflow","hidden"),jQuery("html").css("overflow-y","visible"),jQuery("body").append('');var d="";l&&"true"===r&&(d='
Loading
'),0===jQuery("#ai_backlayer").length&&jQuery(s).parent().append('
'+d),jQuery("#ai_backlink, #ai_backlayer").click(function(){aiHideLayerIframe(i,n)}),l||(a.preventDefault(),a.stopPropagation())}function aiHideLayerIframe(a,i){aiDebugExtended("aiHideLayerIframe"),jQuery("#"+a).hide(),i||(jQuery("#"+a).attr("src","about:blank"),aiLayerIframeHrefs[a]="about:blank"),jQuery("#ai-zoom-div-"+a).hide(),jQuery("#ai-layer-div-"+a).hide(),jQuery("#ai_backlink").remove(),jQuery("#ai_backlayer").remove(),jQuery("#ai-div-loader-global").remove(),jQuery("body").css("overflow","auto"),jQuery("html").css("overflow-y","scroll")}var aiLayerIframeHrefs=[];function aiCheckReload(a,i){t=void 0===aiLayerIframeHrefs[i]?jQuery("#"+i).attr("src"):aiLayerIframeHrefs[i];var t,o=jQuery(a).attr("href");return aiLayerIframeHrefs[i]=o,t!==o}function aiChangeTitle(a){aiDebugExtended("aiChangeTitle");try{var i=document.getElementById(a).contentDocument.title;null!==i&&"undefined"!==i&&""!==i&&(document.title=i)}catch(t){console&&console.error&&(console.error("Advanced iframe configuration error: You have enabled to add the title if the iframe to the parent on the same domain. But you use an iframe page on a different domain. You need to use the pro version of the external workaround like described in the settings. Also check the next log. There the browser message for this error is displayed."),console.log(t))}}function aiChangeUrlParam(a,i,t,o,r){aiDebugExtended("aiChangeUrlParam");var n,l=!1;if(-1!==t.lastIndexOf("//",0)&&(t=location.protocol+t),a!==encodeURIComponent(t)){n=aiSetGetParameter(i,a);var s=!0;if(o.startsWith("hash"))return aiGetUrlMapping(a,i,o);if(o){var d=n.replace(o,"");d===n&&(s=!1),n=d}if(s&&(n=n.replace("http%3A%2F%2F",""),n=-1!==window.location.href.toLowerCase().lastIndexOf("http:",0)?n.replace("https%3A%2F%2F","s|"):n.replace("https%3A%2F%2F","")),r){var n=aiRemoveQueryString(window.location.href),c=decodeURIComponent(a),h=c.indexOf("?");-1!==h&&(n+="?"+c.slice(h+1),l=!0)}aiEndsWidth(n,i+"=")&&(n=aiRemoveURLParameter(n,i))}else{var f=window.location.href;n=aiRemoveURLParameter(f=f.split("/"+i+"/",1)[0],i)}aiSetBrowserUrl(n,l)}function aiGetUrlMappingUrl(a,i,t){var o,r=aiRemoveURLParameter(window.location.href,a=a.replace(":short",""));if(i.startsWith("hashrewrite")){var n="";if(r.indexOf("?")>=0){var l=r.split("?");r=l[0],n="?"+l[1]}var s=r.split("/"+a+"/",1)[0];aiEndsWidth(s,"/")||(s+="/"),r=s+(a+"/")+t+n}else{var d=r.indexOf("?")>=0?"&":"?";r+=d+a+"="+t}return r}function aiSetBrowserUrl(a,i){aiSupportsHistoryApi()&&(i||(a=a.replace(/%2F/g,"/")),window.history.pushState({},"",a),window.onpopstate=function(a){a&&a.state&&window.history.back()})}function aiRemoveQueryString(a){return a.indexOf("%3F")>=0?a.split("%3F")[0]:a.indexOf("?")>=0?a.split("?")[0]:a}function aiGetUrlMapping(a,i,t){var o={action:"aip_map_url_action",security:MyAjax.security,url:a};jQuery.post(MyAjax.ajaxurl,o,function(a){aiSetBrowserUrl(aiGetUrlMappingUrl(i,t,a),!1)})}function closeInfoPermanent(a){var i={action:"aip_close_message_permanent",security:MyAjax.security,id:a},t="The message before will only appear again when you reset the advanced iframe settings.";"show-discount-message"===a?t="The message of advanced iframe shown before will only appear again when you reset the advanced iframe settings or a new discount is available.":"show-registration-message"===a&&(t="The message will appear again until have entered your purchase code."),jQuery.post(MyAjax.ajaxurl,i,function(a){jQuery("h1").after('

'+t+"

")}),setTimeout(function(){jQuery(".message-notice").fadeOut()},4e3)}function aiSupportsHistoryApi(){return!!(window.history&&history.pushState)}function aigetIframeLocation(a){try{var i=document.getElementById(a).contentWindow.location;return encodeURIComponent(i)}catch(t){console&&console.error&&(console.error("Advanced iframe configuration error: You have enabled to add the url to the url on the same domain. But you use an iframe page on a different domain. You need to use the pro version of the external workaround like described in the settings. Also check the next log. There the browser message for this error is displayed."),console.log(t))}}function aiSetGetParameter(a,i){var t=window.location.href,o=t.split("#");t=o[0];var r=void 0===o[1]?"":"#"+o[1];if(t.indexOf(a+"=")>=0){var n=t.substring(0,t.indexOf(a+"=")),l=t.substring(t.indexOf(a+"="));t=n+a+"="+i+(l=(l=l.substring(l.indexOf("=")+1)).indexOf("&")>=0?l.substring(l.indexOf("&")):"")}else 0>t.indexOf("?")?t+="?"+a+"="+i:t+="&"+a+"="+i;return t+r}function aiRemoveURLParameter(a,i){var t=a.split("?");if(!(t.length>=2))return a;for(var o=encodeURIComponent(i)+"=",r=t[1].split(/[&;]/g),n=r.length;n-- >0;)-1!==r[n].lastIndexOf(o,0)&&r.splice(n,1);return a=0!==r.length?t[0]+"?"+r.join("&"):t[0]}function aiEndsWidth(a,i){return a.substr(-i.length)===i}function aiAddCss(a,i){i=decodeURIComponent(i.replace(/\+/g,"%20"));var t=jQuery(a).contents().find("body"),o=document.createElement("style");o.setAttribute("type","text/css"),o.styleSheet?o.styleSheet.cssText=i:o.appendChild(document.createTextNode(i)),t.append(o)}function aiAddCssFile(a,i){var t=jQuery(a).contents().find("body"),o=document.createElement("link");o.rel="stylesheet",o.type="text/css",o.href=i,t.append(o)}function aiAddJsFile(a,i){jQuery.ajaxSetup({cache:!0});var t=jQuery(a).contents().find("body"),o=document.createElement("script");o.type="text/javascript",o.src=i,t.append(o)}function aiPresetFullscreen(){jQuery("#style").val("position:fixed;z-index:9000;top:0px;left:0px;margin:0px"),jQuery("#width").val("100%"),jQuery("#ai-height-0").val("100%"),jQuery("#content_id").val("html,body"),jQuery("#content_styles").val("overflow:hidden"),jQuery("#hide_content_until_iframe_color").val("#ffffff")}function aiDisableCheckIframes(){var a=jQuery("").attr("type","hidden").attr("name","checkIframes").val("true");jQuery("#ai_form").append(a),jQuery("#ai_form").submit(),jQuery("#checkIframes").prop("disabled","disabled")}function aiProcessMessage(a,i,t){var o;try{var o=JSON.parse(a.data)}catch(r){"debug"===t&&console&&console.log&&(console.log("Advanced iframe: The received message cannot be parsed and seems not to belong to advanced iframe pro. Please disable the postMessage debug mode if this o.k. and that this message is not shown anymore."),console.log("Advanced iframe: Unknown event: ",a));var o=a.data}try{if(o.hasOwnProperty("aitype")&&i===o.id){var n=o.aitype;if("debug"===n)aiProcessDebug(o);else if("scrollToTop"===n)aiProcessScrollToTop(o);else for(var l in"height"===n?aiProcessHeight(o):"show"===n&&aiProcessShow(o),o.data)o.data.hasOwnProperty(l)&&jQuery(l).html(o.data[l])}}catch(s){"debug"===t&&console&&console.log&&(console.log("Advanced iframe: The received message do not belong to advanced iframe pro. Please disable the postMessage debug mode if this o.k. and that this message is not shown anymore."),console.log(s))}}function aiProcessDebug(a){var i=a.data;0!==jQuery("#aiDebugDiv").length&&(i=(i=i.replace(/&/g,"&").replace(//g,">")).replace('"','"').replace(/\\/g,""),jQuery("#aiDebugDiv").append('

r: '+i+"

"))}function aiProcessScrollToTop(a){aiScrollToTop(a.id,aiOnloadScrollTop)}function aiProcessHeight(a){var i=a.height,t=a.width,o=parseInt(a.anchor,10),r=a.id;if(null!=i)try{var n=a.loc;null==n||n.includes("send_console_log")||"function"!=typeof aiChangeUrl||aiChangeUrl(n);var l=a.title;if(null!=l&&"undefined"!=l&&""!=l&&(document.title=decodeURIComponent(l)),null!=r){var s=parseInt(i,10),d=parseInt(t,10);if(aiResizeIframeHeightId(s,d,r),!isNaN(o)&&o>-1){var c=jQuery("#"+r).offset().top;setTimeout(function(){jQuery("html,body").scrollTop(Math.round(c+o)),aiShowIframeId(r)},100)}else aiShowIframeId(r)}else alert("Please update the ai_external.js to the current version.")}catch(h){console&&console.log&&console.log(h)}}function aiProcessShow(a){var i=a.id;try{aiShowIframeId(i)}catch(t){console&&console.log&&console.log(t)}}function aiDisableRightClick(a){try{window.frames[a].document.oncontextmenu=function(){return!1}}catch(i){}}function aiRemoveElementsFromHeight(a,i,t){for(var o=jQuery("#"+a),r=t.split(","),n=0,l=0;l"300"?t.height("0px"):t.height("400px")}}),"undefined"!=typeof ai_show_id_only){if(0===jQuery("#"+ai_show_id_only).length)alert('The element with the id "'+ai_show_id_only+'" cannot be found. Please check your configuration.');else{var i=jQuery("#"+ai_show_id_only);i.siblings().hide();var t=i.parents();if(t.siblings().hide(),t.css("padding","0px").css("margin","0px").css("overflow","hidden"),parent===top){var o=i[0];o.style.marginTop=o.style.marginBottom=0,o.style.overflow="hidden";var r=JSON.stringify({aitype:"height",height:parseInt(Math.max(o.scrollHeight,o.offsetHeight),10),id:ai_show_id_only});window.parent.postMessage(r,"*")}}}jQuery("#ai #checkIframes").on("click",function(){jQuery(".ai-spinner").css("display","inline-table"),jQuery(this).addClass("disabled"),setTimeout(aiDisableCheckIframes,200)})}),String.prototype.includes||(String.prototype.includes=function(a,i){return"number"!=typeof i&&(i=0),!(i+a.length>this.length)&&-1!==this.indexOf(a,i)}),String.prototype.startsWith||(String.prototype.startsWith=function(a,i){return i=i||0,this.indexOf(a,i)===i});var elem=document.documentElement;function aiOpenFullscreen(){aiRealFullscreen&&(elem.requestFullscreen?elem.requestFullscreen():elem.webkitRequestFullscreen?elem.webkitRequestFullscreen():elem.msRequestFullscreen&&elem.msRequestFullscreen())}function aiCloseFullscreen(){aiRealFullscreen&&(document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen())}function aiExitHandler(){document.fullscreenElement||document.webkitIsFullScreen||document.mozFullScreen||document.msFullscreenElement||(aiInFullscreen=!1,jQuery(".ai-fullscreen-close").trigger("click"))}document.addEventListener("fullscreenchange",aiExitHandler),document.addEventListener("webkitfullscreenchange",aiExitHandler),document.addEventListener("mozfullscreenchange",aiExitHandler),document.addEventListener("MSFullscreenChange",aiExitHandler); var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(a){var c=0;return function(){return c":">",'"':""","'":"'","/":"/"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})};c.__cache={};var p=0;return c.GetUniqueElementId=function(a){var b=a.getAttribute("data-select2-id");return null!=b||(b=a.id?"select2-data-"+a.id:"select2-data-"+(++p).toString()+"-"+c.generateChars(4),a.setAttribute("data-select2-id",b)),b},c.StoreData=function(a,b,d){a=c.GetUniqueElementId(a); c.__cache[a]||(c.__cache[a]={});c.__cache[a][b]=d},c.GetData=function(b,d){var g=c.GetUniqueElementId(b);return d?c.__cache[g]&&null!=c.__cache[g][d]?c.__cache[g][d]:a(b).data(d):c.__cache[g]},c.RemoveData=function(a){var b=c.GetUniqueElementId(a);null!=c.__cache[b]&&delete c.__cache[b];a.removeAttribute("data-select2-id")},c.copyNonInternalCssClasses=function(a,b){var c=(c=a.getAttribute("class").trim().split(/\s+/)).filter(function(a){return 0===a.indexOf("select2-")});b=(b=b.getAttribute("class").trim().split(/\s+/)).filter(function(a){return 0!==a.indexOf("select2-")});b=c.concat(b);a.setAttribute("class",b.join(" "))},c}),r.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a;this.data=d;this.options=b;c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('
    ');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b},c.prototype.clear=function(){this.$results.empty()}, c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear();this.hideLoading();var d=a(''),e=this.options.get("translations").get(b.message);d.append(c(e(b.args)));d[0].className+=" select2-results__message";this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null!=a.results&&0!==a.results.length){a.results=this.sort(a.results);for(var c=0;c",{class:"select2-results__options select2-results__options--nested", role:"none"});e.append(f);w.append(g);w.append(e)}else this.template(c,d);return b.StoreData(d,"data",c),d},c.prototype.bind=function(c,d){var g=this;this.$results.attr("id",c.id+"-results");c.on("results:all",function(a){g.clear();g.append(a.data);c.isOpen()&&(g.setClasses(),g.highlightFirstItem())});c.on("results:append",function(a){g.append(a.data);c.isOpen()&&g.setClasses()});c.on("query",function(a){g.hideMessages();g.showLoading(a)});c.on("select",function(){c.isOpen()&&(g.setClasses(),g.options.get("scrollAfterSelect")&& g.highlightFirstItem())});c.on("unselect",function(){c.isOpen()&&(g.setClasses(),g.options.get("scrollAfterSelect")&&g.highlightFirstItem())});c.on("open",function(){g.$results.attr("aria-expanded","true");g.$results.attr("aria-hidden","false");g.setClasses();g.ensureHighlightVisible()});c.on("close",function(){g.$results.attr("aria-expanded","false");g.$results.attr("aria-hidden","true");g.$results.removeAttr("aria-activedescendant")});c.on("results:toggle",function(){var a=g.getHighlightedResults(); 0!==a.length&&a.trigger("mouseup")});c.on("results:select",function(){var a,c=g.getHighlightedResults();0!==c.length&&(a=b.GetData(c[0],"data"),c.hasClass("select2-results__option--selected")?g.trigger("close",{}):g.trigger("select",{data:a}))});c.on("results:previous",function(){var a,b=g.getHighlightedResults(),c=g.$results.find(".select2-results__option--selectable"),d=c.index(b);0>=d||(a=d-1,0===b.length&&(a=0),(d=c.eq(a)).trigger("mouseenter"),b=g.$results.offset().top,c=d.offset().top,d=g.$results.scrollTop()+ (c-b),0===a?g.$results.scrollTop(0):0>c-b&&g.$results.scrollTop(d))});c.on("results:next",function(){var a,b=g.getHighlightedResults(),c=g.$results.find(".select2-results__option--selectable"),d=c.index(b)+1;d>=c.length||((a=c.eq(d)).trigger("mouseenter"),b=g.$results.offset().top+g.$results.outerHeight(!1),c=a.offset().top+a.outerHeight(!1),a=g.$results.scrollTop()+c-b,0===d?g.$results.scrollTop(0):b=b-a.deltaY;c=0>a.deltaY&&c<=g.$results.height();b?(g.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):c&&(g.$results.scrollTop(g.$results.get(0).scrollHeight-g.$results.height()),a.preventDefault(),a.stopPropagation())});this.$results.on("mouseup", ".select2-results__option--selectable",function(c){var d=a(this),e=b.GetData(this,"data");d.hasClass("select2-results__option--selected")?g.options.get("multiple")?g.trigger("unselect",{originalEvent:c,data:e}):g.trigger("close",{}):g.trigger("select",{originalEvent:c,data:e})});this.$results.on("mouseenter",".select2-results__option--selectable",function(c){c=b.GetData(this,"data");g.getHighlightedResults().removeClass("select2-results__option--highlighted").attr("aria-selected","false");g.trigger("results:focus", {data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a,b,c,d,e=this.getHighlightedResults();0!==e.length&&(a=this.$results.find(".select2-results__option--selectable").index(e),d=this.$results.offset().top,b=e.offset().top,c=this.$results.scrollTop()+(b-d),d=b-d,c-=2*e.outerHeight(!1),2>=a?this.$results.scrollTop(0): (d>this.$results.outerHeight()||0>d)&&this.$results.scrollTop(c))},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup");b=d(b,c);null==b?c.style.display="none":"string"==typeof b?c.innerHTML=e(b):a(c).append(b)},c}),r.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),r.define("select2/selection/base", ["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a;this.options=b;d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var c=a('');return this._tabindex=0,null!=b.GetData(this.$element[0],"old-tabindex")?this._tabindex=b.GetData(this.$element[0],"old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")), c.attr("title",this.$element.attr("title")),c.attr("tabindex",this._tabindex),c.attr("aria-disabled","false"),this.$selection=c},d.prototype.bind=function(a,b){var d=this,g=a.id+"-results";this.container=a;this.$selection.on("focus",function(a){d.trigger("focus",a)});this.$selection.on("blur",function(a){d._handleBlur(a)});this.$selection.on("keydown",function(a){d.trigger("keypress",a);a.which===c.SPACE&&a.preventDefault()});a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant", a.data._resultId)});a.on("selection:update",function(a){d.update(a.data)});a.on("open",function(){d.$selection.attr("aria-expanded","true");d.$selection.attr("aria-owns",g);d._attachCloseHandler(a)});a.on("close",function(){d.$selection.attr("aria-expanded","false");d.$selection.removeAttr("aria-activedescendant");d.$selection.removeAttr("aria-owns");d.$selection.trigger("focus");d._detachCloseHandler(a)});a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex);d.$selection.attr("aria-disabled", "false")});a.on("disable",function(){d.$selection.attr("tabindex","-1");d.$selection.attr("aria-disabled","true")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(c){a(document.body).on("mousedown.select2."+c.id,function(c){var d=a(c.target).closest(".select2");a(".select2.select2-container--open").each(function(){this!=d[0]&&b.GetData(this,"element").select2("close")})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){b.find(".selection").append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw Error("The `update` method must be defined in child classes.");},d.prototype.isEnabled=function(){return!this.isDisabled()},d.prototype.isDisabled=function(){return this.options.get("disabled")}, d}),r.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a[0].classList.add("select2-selection--single"),a.html(''),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this, arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d).attr("role","textbox").attr("aria-readonly","true");this.$selection.attr("aria-labelledby",d);this.$selection.attr("aria-controls",d);this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})});this.$selection.on("focus",function(a){});this.$selection.on("blur",function(a){});a.on("focus",function(b){a.isOpen()||c.$selection.trigger("focus")})},e.prototype.clear= function(){var a=this.$selection.find(".select2-selection__rendered");a.empty();a.removeAttr("title")},e.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},e.prototype.selectionContainer=function(){return a("")},e.prototype.update=function(a){var b,c;0!==a.length?(c=a[0],b=this.$selection.find(".select2-selection__rendered"),a=this.display(c,b),b.empty().append(a),(c=c.title||c.text)?b.attr("title",c):b.removeAttr("title")): this.clear()},e}),r.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a[0].classList.add("select2-selection--multiple"),a.html('
      '),a},d.prototype.bind=function(b,e){var g=this;d.__super__.bind.apply(this,arguments);var p=b.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id", p);this.$selection.on("click",function(a){g.trigger("toggle",{originalEvent:a})});this.$selection.on("click",".select2-selection__choice__remove",function(b){var d;g.isDisabled()||(d=a(this).parent(),d=c.GetData(d[0],"data"),g.trigger("unselect",{originalEvent:b,data:d}))});this.$selection.on("keydown",".select2-selection__choice__remove",function(a){g.isDisabled()||a.stopPropagation()})},d.prototype.clear=function(){var a=this.$selection.find(".select2-selection__rendered");a.empty();a.removeAttr("title")}, d.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},d.prototype.selectionContainer=function(){return a('
    • ')},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=this.$selection.find(".select2-selection__rendered").attr("id")+ "-choice-",e=0;e')).attr("title",g()),b.attr("aria-label",g()),b.attr("aria-describedby",e),c.StoreData(b[0],"data",d),this.$selection.prepend(b), this.$selection[0].classList.add("select2-selection--clearable"))},d}),r.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=this.options.get("translations").get("search"),d=a(''); this.$searchContainer=d;this.$search=d.find("textarea");this.$search.prop("autocomplete",this.options.get("autocomplete"));this.$search.attr("aria-label",c());b=b.call(this);return this._transferTabIndex(),b.append(this.$searchContainer),b},d.prototype.bind=function(a,d,e){var g=this,p=d.id+"-results",f=d.id+"-container";a.call(this,d,e);g.$search.attr("aria-describedby",f);d.on("open",function(){g.$search.attr("aria-controls",p);g.$search.trigger("focus")});d.on("close",function(){g.$search.val(""); g.resizeSearch();g.$search.removeAttr("aria-controls");g.$search.removeAttr("aria-activedescendant");g.$search.trigger("focus")});d.on("enable",function(){g.$search.prop("disabled",!1);g._transferTabIndex()});d.on("disable",function(){g.$search.prop("disabled",!0)});d.on("focus",function(a){g.$search.trigger("focus")});d.on("results:focus",function(a){a.data._resultId?g.$search.attr("aria-activedescendant",a.data._resultId):g.$search.removeAttr("aria-activedescendant")});this.$selection.on("focusin", ".select2-search--inline",function(a){g.trigger("focus",a)});this.$selection.on("focusout",".select2-search--inline",function(a){g._handleBlur(a)});this.$selection.on("keydown",".select2-search--inline",function(a){var d;a.stopPropagation();g.trigger("keypress",a);g._keyUpPrevented=a.isDefaultPrevented();a.which!==c.BACKSPACE||""!==g.$search.val()||0<(d=g.$selection.find(".select2-selection__choice").last()).length&&(d=b.GetData(d[0],"data"),g.searchRemoveChoice(d),a.preventDefault())});this.$selection.on("click", ".select2-search--inline",function(a){g.$search.val()&&a.stopPropagation()});var h=(d=document.documentMode)&&11>=d;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){h?g.$selection.off("input.search input.searchcheck"):g.$selection.off("keyup.search")});this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){var b;h&&"input"===a.type?g.$selection.off("input.search input.searchcheck"):(b=a.which)!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&g.handleSearch(a)})}, d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex"));this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder","");a.call(this,b);this.resizeSearch();c&&this.$search.trigger("focus")},d.prototype.handleSearch=function(){var a;this.resizeSearch();this._keyUpPrevented||(a=this.$search.val(), this.trigger("query",{term:a}));this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b});this.$search.val(b.text);this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="100%";""===this.$search.attr("placeholder")&&(a=.75*(this.$search.val().length+1)+"em");this.$search.css("width",a)},d}),r.define("select2/selection/selectionCss",["../utils"],function(a){function b(){}return b.prototype.render=function(b){var c= b.call(this);b=this.options.get("selectionCssClass")||"";return-1!==b.indexOf(":all:")&&(b=b.replace(":all:",""),a.copyNonInternalCssClasses(c[0],this.$element[0])),c.addClass(b),c},b}),r.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,p="open opening close closing select selecting unselect unselecting clear clearing".split(" "),f=["opening","closing","selecting","unselecting","clearing"];b.call(this,c,d);c.on("*",function(b, c){var d;-1!==p.indexOf(b)&&(c=c||{},d=a.Event("select2:"+b,{params:c}),e.$element.trigger(d),-1!==f.indexOf(b)&&(c.prevented=d.isDefaultPrevented()))})},b}),r.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){var d;return a in c._cache||(d=b(a),c._cache[a]= d),new c(c._cache[a])},c}),r.define("select2/diacritics",[],function(){return{"\u24b6":"A","\uff21":"A","\u00c0":"A","\u00c1":"A","\u00c2":"A","\u1ea6":"A","\u1ea4":"A","\u1eaa":"A","\u1ea8":"A","\u00c3":"A","\u0100":"A","\u0102":"A","\u1eb0":"A","\u1eae":"A","\u1eb4":"A","\u1eb2":"A","\u0226":"A","\u01e0":"A","\u00c4":"A","\u01de":"A","\u1ea2":"A","\u00c5":"A","\u01fa":"A","\u01cd":"A","\u0200":"A","\u0202":"A","\u1ea0":"A","\u1eac":"A","\u1eb6":"A","\u1e00":"A","\u0104":"A","\u023a":"A","\u2c6f":"A", "\ua732":"AA","\u00c6":"AE","\u01fc":"AE","\u01e2":"AE","\ua734":"AO","\ua736":"AU","\ua738":"AV","\ua73a":"AV","\ua73c":"AY","\u24b7":"B","\uff22":"B","\u1e02":"B","\u1e04":"B","\u1e06":"B","\u0243":"B","\u0182":"B","\u0181":"B","\u24b8":"C","\uff23":"C","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u00c7":"C","\u1e08":"C","\u0187":"C","\u023b":"C","\ua73e":"C","\u24b9":"D","\uff24":"D","\u1e0a":"D","\u010e":"D","\u1e0c":"D","\u1e10":"D","\u1e12":"D","\u1e0e":"D","\u0110":"D","\u018b":"D", "\u018a":"D","\u0189":"D","\ua779":"D","\u01f1":"DZ","\u01c4":"DZ","\u01f2":"Dz","\u01c5":"Dz","\u24ba":"E","\uff25":"E","\u00c8":"E","\u00c9":"E","\u00ca":"E","\u1ec0":"E","\u1ebe":"E","\u1ec4":"E","\u1ec2":"E","\u1ebc":"E","\u0112":"E","\u1e14":"E","\u1e16":"E","\u0114":"E","\u0116":"E","\u00cb":"E","\u1eba":"E","\u011a":"E","\u0204":"E","\u0206":"E","\u1eb8":"E","\u1ec6":"E","\u0228":"E","\u1e1c":"E","\u0118":"E","\u1e18":"E","\u1e1a":"E","\u0190":"E","\u018e":"E","\u24bb":"F","\uff26":"F","\u1e1e":"F", "\u0191":"F","\ua77b":"F","\u24bc":"G","\uff27":"G","\u01f4":"G","\u011c":"G","\u1e20":"G","\u011e":"G","\u0120":"G","\u01e6":"G","\u0122":"G","\u01e4":"G","\u0193":"G","\ua7a0":"G","\ua77d":"G","\ua77e":"G","\u24bd":"H","\uff28":"H","\u0124":"H","\u1e22":"H","\u1e26":"H","\u021e":"H","\u1e24":"H","\u1e28":"H","\u1e2a":"H","\u0126":"H","\u2c67":"H","\u2c75":"H","\ua78d":"H","\u24be":"I","\uff29":"I","\u00cc":"I","\u00cd":"I","\u00ce":"I","\u0128":"I","\u012a":"I","\u012c":"I","\u0130":"I","\u00cf":"I", "\u1e2e":"I","\u1ec8":"I","\u01cf":"I","\u0208":"I","\u020a":"I","\u1eca":"I","\u012e":"I","\u1e2c":"I","\u0197":"I","\u24bf":"J","\uff2a":"J","\u0134":"J","\u0248":"J","\u24c0":"K","\uff2b":"K","\u1e30":"K","\u01e8":"K","\u1e32":"K","\u0136":"K","\u1e34":"K","\u0198":"K","\u2c69":"K","\ua740":"K","\ua742":"K","\ua744":"K","\ua7a2":"K","\u24c1":"L","\uff2c":"L","\u013f":"L","\u0139":"L","\u013d":"L","\u1e36":"L","\u1e38":"L","\u013b":"L","\u1e3c":"L","\u1e3a":"L","\u0141":"L","\u023d":"L","\u2c62":"L", "\u2c60":"L","\ua748":"L","\ua746":"L","\ua780":"L","\u01c7":"LJ","\u01c8":"Lj","\u24c2":"M","\uff2d":"M","\u1e3e":"M","\u1e40":"M","\u1e42":"M","\u2c6e":"M","\u019c":"M","\u24c3":"N","\uff2e":"N","\u01f8":"N","\u0143":"N","\u00d1":"N","\u1e44":"N","\u0147":"N","\u1e46":"N","\u0145":"N","\u1e4a":"N","\u1e48":"N","\u0220":"N","\u019d":"N","\ua790":"N","\ua7a4":"N","\u01ca":"NJ","\u01cb":"Nj","\u24c4":"O","\uff2f":"O","\u00d2":"O","\u00d3":"O","\u00d4":"O","\u1ed2":"O","\u1ed0":"O","\u1ed6":"O","\u1ed4":"O", "\u00d5":"O","\u1e4c":"O","\u022c":"O","\u1e4e":"O","\u014c":"O","\u1e50":"O","\u1e52":"O","\u014e":"O","\u022e":"O","\u0230":"O","\u00d6":"O","\u022a":"O","\u1ece":"O","\u0150":"O","\u01d1":"O","\u020c":"O","\u020e":"O","\u01a0":"O","\u1edc":"O","\u1eda":"O","\u1ee0":"O","\u1ede":"O","\u1ee2":"O","\u1ecc":"O","\u1ed8":"O","\u01ea":"O","\u01ec":"O","\u00d8":"O","\u01fe":"O","\u0186":"O","\u019f":"O","\ua74a":"O","\ua74c":"O","\u0152":"OE","\u01a2":"OI","\ua74e":"OO","\u0222":"OU","\u24c5":"P","\uff30":"P", "\u1e54":"P","\u1e56":"P","\u01a4":"P","\u2c63":"P","\ua750":"P","\ua752":"P","\ua754":"P","\u24c6":"Q","\uff31":"Q","\ua756":"Q","\ua758":"Q","\u024a":"Q","\u24c7":"R","\uff32":"R","\u0154":"R","\u1e58":"R","\u0158":"R","\u0210":"R","\u0212":"R","\u1e5a":"R","\u1e5c":"R","\u0156":"R","\u1e5e":"R","\u024c":"R","\u2c64":"R","\ua75a":"R","\ua7a6":"R","\ua782":"R","\u24c8":"S","\uff33":"S","\u1e9e":"S","\u015a":"S","\u1e64":"S","\u015c":"S","\u1e60":"S","\u0160":"S","\u1e66":"S","\u1e62":"S","\u1e68":"S", "\u0218":"S","\u015e":"S","\u2c7e":"S","\ua7a8":"S","\ua784":"S","\u24c9":"T","\uff34":"T","\u1e6a":"T","\u0164":"T","\u1e6c":"T","\u021a":"T","\u0162":"T","\u1e70":"T","\u1e6e":"T","\u0166":"T","\u01ac":"T","\u01ae":"T","\u023e":"T","\ua786":"T","\ua728":"TZ","\u24ca":"U","\uff35":"U","\u00d9":"U","\u00da":"U","\u00db":"U","\u0168":"U","\u1e78":"U","\u016a":"U","\u1e7a":"U","\u016c":"U","\u00dc":"U","\u01db":"U","\u01d7":"U","\u01d5":"U","\u01d9":"U","\u1ee6":"U","\u016e":"U","\u0170":"U","\u01d3":"U", "\u0214":"U","\u0216":"U","\u01af":"U","\u1eea":"U","\u1ee8":"U","\u1eee":"U","\u1eec":"U","\u1ef0":"U","\u1ee4":"U","\u1e72":"U","\u0172":"U","\u1e76":"U","\u1e74":"U","\u0244":"U","\u24cb":"V","\uff36":"V","\u1e7c":"V","\u1e7e":"V","\u01b2":"V","\ua75e":"V","\u0245":"V","\ua760":"VY","\u24cc":"W","\uff37":"W","\u1e80":"W","\u1e82":"W","\u0174":"W","\u1e86":"W","\u1e84":"W","\u1e88":"W","\u2c72":"W","\u24cd":"X","\uff38":"X","\u1e8a":"X","\u1e8c":"X","\u24ce":"Y","\uff39":"Y","\u1ef2":"Y","\u00dd":"Y", "\u0176":"Y","\u1ef8":"Y","\u0232":"Y","\u1e8e":"Y","\u0178":"Y","\u1ef6":"Y","\u1ef4":"Y","\u01b3":"Y","\u024e":"Y","\u1efe":"Y","\u24cf":"Z","\uff3a":"Z","\u0179":"Z","\u1e90":"Z","\u017b":"Z","\u017d":"Z","\u1e92":"Z","\u1e94":"Z","\u01b5":"Z","\u0224":"Z","\u2c7f":"Z","\u2c6b":"Z","\ua762":"Z","\u24d0":"a","\uff41":"a","\u1e9a":"a","\u00e0":"a","\u00e1":"a","\u00e2":"a","\u1ea7":"a","\u1ea5":"a","\u1eab":"a","\u1ea9":"a","\u00e3":"a","\u0101":"a","\u0103":"a","\u1eb1":"a","\u1eaf":"a","\u1eb5":"a", "\u1eb3":"a","\u0227":"a","\u01e1":"a","\u00e4":"a","\u01df":"a","\u1ea3":"a","\u00e5":"a","\u01fb":"a","\u01ce":"a","\u0201":"a","\u0203":"a","\u1ea1":"a","\u1ead":"a","\u1eb7":"a","\u1e01":"a","\u0105":"a","\u2c65":"a","\u0250":"a","\ua733":"aa","\u00e6":"ae","\u01fd":"ae","\u01e3":"ae","\ua735":"ao","\ua737":"au","\ua739":"av","\ua73b":"av","\ua73d":"ay","\u24d1":"b","\uff42":"b","\u1e03":"b","\u1e05":"b","\u1e07":"b","\u0180":"b","\u0183":"b","\u0253":"b","\u24d2":"c","\uff43":"c","\u0107":"c", "\u0109":"c","\u010b":"c","\u010d":"c","\u00e7":"c","\u1e09":"c","\u0188":"c","\u023c":"c","\ua73f":"c","\u2184":"c","\u24d3":"d","\uff44":"d","\u1e0b":"d","\u010f":"d","\u1e0d":"d","\u1e11":"d","\u1e13":"d","\u1e0f":"d","\u0111":"d","\u018c":"d","\u0256":"d","\u0257":"d","\ua77a":"d","\u01f3":"dz","\u01c6":"dz","\u24d4":"e","\uff45":"e","\u00e8":"e","\u00e9":"e","\u00ea":"e","\u1ec1":"e","\u1ebf":"e","\u1ec5":"e","\u1ec3":"e","\u1ebd":"e","\u0113":"e","\u1e15":"e","\u1e17":"e","\u0115":"e","\u0117":"e", "\u00eb":"e","\u1ebb":"e","\u011b":"e","\u0205":"e","\u0207":"e","\u1eb9":"e","\u1ec7":"e","\u0229":"e","\u1e1d":"e","\u0119":"e","\u1e19":"e","\u1e1b":"e","\u0247":"e","\u025b":"e","\u01dd":"e","\u24d5":"f","\uff46":"f","\u1e1f":"f","\u0192":"f","\ua77c":"f","\u24d6":"g","\uff47":"g","\u01f5":"g","\u011d":"g","\u1e21":"g","\u011f":"g","\u0121":"g","\u01e7":"g","\u0123":"g","\u01e5":"g","\u0260":"g","\ua7a1":"g","\u1d79":"g","\ua77f":"g","\u24d7":"h","\uff48":"h","\u0125":"h","\u1e23":"h","\u1e27":"h", "\u021f":"h","\u1e25":"h","\u1e29":"h","\u1e2b":"h","\u1e96":"h","\u0127":"h","\u2c68":"h","\u2c76":"h","\u0265":"h","\u0195":"hv","\u24d8":"i","\uff49":"i","\u00ec":"i","\u00ed":"i","\u00ee":"i","\u0129":"i","\u012b":"i","\u012d":"i","\u00ef":"i","\u1e2f":"i","\u1ec9":"i","\u01d0":"i","\u0209":"i","\u020b":"i","\u1ecb":"i","\u012f":"i","\u1e2d":"i","\u0268":"i","\u0131":"i","\u24d9":"j","\uff4a":"j","\u0135":"j","\u01f0":"j","\u0249":"j","\u24da":"k","\uff4b":"k","\u1e31":"k","\u01e9":"k","\u1e33":"k", "\u0137":"k","\u1e35":"k","\u0199":"k","\u2c6a":"k","\ua741":"k","\ua743":"k","\ua745":"k","\ua7a3":"k","\u24db":"l","\uff4c":"l","\u0140":"l","\u013a":"l","\u013e":"l","\u1e37":"l","\u1e39":"l","\u013c":"l","\u1e3d":"l","\u1e3b":"l","\u017f":"l","\u0142":"l","\u019a":"l","\u026b":"l","\u2c61":"l","\ua749":"l","\ua781":"l","\ua747":"l","\u01c9":"lj","\u24dc":"m","\uff4d":"m","\u1e3f":"m","\u1e41":"m","\u1e43":"m","\u0271":"m","\u026f":"m","\u24dd":"n","\uff4e":"n","\u01f9":"n","\u0144":"n","\u00f1":"n", "\u1e45":"n","\u0148":"n","\u1e47":"n","\u0146":"n","\u1e4b":"n","\u1e49":"n","\u019e":"n","\u0272":"n","\u0149":"n","\ua791":"n","\ua7a5":"n","\u01cc":"nj","\u24de":"o","\uff4f":"o","\u00f2":"o","\u00f3":"o","\u00f4":"o","\u1ed3":"o","\u1ed1":"o","\u1ed7":"o","\u1ed5":"o","\u00f5":"o","\u1e4d":"o","\u022d":"o","\u1e4f":"o","\u014d":"o","\u1e51":"o","\u1e53":"o","\u014f":"o","\u022f":"o","\u0231":"o","\u00f6":"o","\u022b":"o","\u1ecf":"o","\u0151":"o","\u01d2":"o","\u020d":"o","\u020f":"o","\u01a1":"o", "\u1edd":"o","\u1edb":"o","\u1ee1":"o","\u1edf":"o","\u1ee3":"o","\u1ecd":"o","\u1ed9":"o","\u01eb":"o","\u01ed":"o","\u00f8":"o","\u01ff":"o","\u0254":"o","\ua74b":"o","\ua74d":"o","\u0275":"o","\u0153":"oe","\u01a3":"oi","\u0223":"ou","\ua74f":"oo","\u24df":"p","\uff50":"p","\u1e55":"p","\u1e57":"p","\u01a5":"p","\u1d7d":"p","\ua751":"p","\ua753":"p","\ua755":"p","\u24e0":"q","\uff51":"q","\u024b":"q","\ua757":"q","\ua759":"q","\u24e1":"r","\uff52":"r","\u0155":"r","\u1e59":"r","\u0159":"r","\u0211":"r", "\u0213":"r","\u1e5b":"r","\u1e5d":"r","\u0157":"r","\u1e5f":"r","\u024d":"r","\u027d":"r","\ua75b":"r","\ua7a7":"r","\ua783":"r","\u24e2":"s","\uff53":"s","\u00df":"s","\u015b":"s","\u1e65":"s","\u015d":"s","\u1e61":"s","\u0161":"s","\u1e67":"s","\u1e63":"s","\u1e69":"s","\u0219":"s","\u015f":"s","\u023f":"s","\ua7a9":"s","\ua785":"s","\u1e9b":"s","\u24e3":"t","\uff54":"t","\u1e6b":"t","\u1e97":"t","\u0165":"t","\u1e6d":"t","\u021b":"t","\u0163":"t","\u1e71":"t","\u1e6f":"t","\u0167":"t","\u01ad":"t", "\u0288":"t","\u2c66":"t","\ua787":"t","\ua729":"tz","\u24e4":"u","\uff55":"u","\u00f9":"u","\u00fa":"u","\u00fb":"u","\u0169":"u","\u1e79":"u","\u016b":"u","\u1e7b":"u","\u016d":"u","\u00fc":"u","\u01dc":"u","\u01d8":"u","\u01d6":"u","\u01da":"u","\u1ee7":"u","\u016f":"u","\u0171":"u","\u01d4":"u","\u0215":"u","\u0217":"u","\u01b0":"u","\u1eeb":"u","\u1ee9":"u","\u1eef":"u","\u1eed":"u","\u1ef1":"u","\u1ee5":"u","\u1e73":"u","\u0173":"u","\u1e77":"u","\u1e75":"u","\u0289":"u","\u24e5":"v","\uff56":"v", "\u1e7d":"v","\u1e7f":"v","\u028b":"v","\ua75f":"v","\u028c":"v","\ua761":"vy","\u24e6":"w","\uff57":"w","\u1e81":"w","\u1e83":"w","\u0175":"w","\u1e87":"w","\u1e85":"w","\u1e98":"w","\u1e89":"w","\u2c73":"w","\u24e7":"x","\uff58":"x","\u1e8b":"x","\u1e8d":"x","\u24e8":"y","\uff59":"y","\u1ef3":"y","\u00fd":"y","\u0177":"y","\u1ef9":"y","\u0233":"y","\u1e8f":"y","\u00ff":"y","\u1ef7":"y","\u1e99":"y","\u1ef5":"y","\u01b4":"y","\u024f":"y","\u1eff":"y","\u24e9":"z","\uff5a":"z","\u017a":"z","\u1e91":"z", "\u017c":"z","\u017e":"z","\u1e93":"z","\u1e95":"z","\u01b6":"z","\u0225":"z","\u0240":"z","\u2c6c":"z","\ua763":"z","\u0386":"\u0391","\u0388":"\u0395","\u0389":"\u0397","\u038a":"\u0399","\u03aa":"\u0399","\u038c":"\u039f","\u038e":"\u03a5","\u03ab":"\u03a5","\u038f":"\u03a9","\u03ac":"\u03b1","\u03ad":"\u03b5","\u03ae":"\u03b7","\u03af":"\u03b9","\u03ca":"\u03b9","\u0390":"\u03b9","\u03cc":"\u03bf","\u03cd":"\u03c5","\u03cb":"\u03c5","\u03b0":"\u03c5","\u03ce":"\u03c9","\u03c2":"\u03c3","\u2019":"'"}}), r.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw Error("The `current` method must be defined in child classes.");},b.prototype.query=function(a,b){throw Error("The `query` method must be defined in child classes.");},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){b=b.id+"-result-";return b+=a.generateChars(4),null!=c.id?b+="-"+c.id.toString():b+="-"+a.generateChars(4),b},b}),r.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a;this.options=b;d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=this;a(Array.prototype.map.call(this.$element[0].querySelectorAll(":checked"),function(a){return b.item(c(a))}))},d.prototype.select=function(a){var b,c=this;if(a.selected=!0,null!=a.element&&"option"===a.element.tagName.toLowerCase())return a.element.selected= !0,void this.$element.trigger("input").trigger("change");this.$element.prop("multiple")?this.current(function(b){var d=[];(a=[a]).push.apply(a,b);for(b=0;bthis.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}}):a.call(this,b,c)},a}),r.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength");a.call(this,b,c)}return a.prototype.bind= function(a,b,c){var d=this;a.call(this,b,c);b.on("select",function(){d._checkIfMaximumSelected()})},a.prototype.query=function(a,b,c){var d=this;this._checkIfMaximumSelected(function(){a.call(d,b,c)})},a.prototype._checkIfMaximumSelected=function(a,b){var c=this;this.current(function(a){a=null!=a?a.length:0;0=c.maximumSelectionLength?c.trigger("results:message",{message:"maximumSelected",args:{maximum:c.maximumSelectionLength}}):b&&b()})},a}),r.define("select2/dropdown", ["jquery","./utils"],function(a,b){function c(a,b){this.$element=a;this.options=b;c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('');return b.attr("dir",this.options.get("dir")),this.$dropdown=b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),r.define("select2/dropdown/search",["jquery"], function(a){function b(){}return b.prototype.render=function(b){var c=b.call(this),d=this.options.get("translations").get("search");b=a('');return this.$searchContainer=b,this.$search=b.find("input"),this.$search.prop("autocomplete",this.options.get("autocomplete")),this.$search.attr("aria-label", d()),c.prepend(b),c},b.prototype.bind=function(b,c,d){var e=this,f=c.id+"-results";b.call(this,c,d);this.$search.on("keydown",function(a){e.trigger("keypress",a);e._keyUpPrevented=a.isDefaultPrevented()});this.$search.on("input",function(b){a(this).off("keyup")});this.$search.on("keyup input",function(a){e.handleSearch(a)});c.on("open",function(){e.$search.attr("tabindex",0);e.$search.attr("aria-controls",f);e.$search.trigger("focus");window.setTimeout(function(){e.$search.trigger("focus")},0)}); c.on("close",function(){e.$search.attr("tabindex",-1);e.$search.removeAttr("aria-controls");e.$search.removeAttr("aria-activedescendant");e.$search.val("");e.$search.trigger("blur")});c.on("focus",function(){c.isOpen()||e.$search.trigger("focus")});c.on("results:all",function(a){null!=a.query.term&&""!==a.query.term||(e.showSearch(a)?e.$searchContainer[0].classList.remove("select2-search--hide"):e.$searchContainer[0].classList.add("select2-search--hide"))});c.on("results:focus",function(a){a.data._resultId? e.$search.attr("aria-activedescendant",a.data._resultId):e.$search.removeAttr("aria-activedescendant")})},b.prototype.handleSearch=function(a){var b;this._keyUpPrevented||(b=this.$search.val(),this.trigger("query",{term:b}));this._keyUpPrevented=!1},b.prototype.showSearch=function(a,b){return!0},b}),r.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder"));a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results= this.removePlaceholder(b.results);a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){a=b.slice(0);for(var c=b.length-1;0<=c;c--)this.placeholder.id===b[c].id&&a.splice(c,1);return a},a}),r.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={};a.call(this,b,c,d);this.$loadingMore=this.createLoadingMore();this.loading=!1}return b.prototype.append=function(a, b){this.$loadingMore.remove();this.loading=!1;a.call(this,b);this.showLoadingMore(b)&&(this.$results.append(this.$loadingMore),this.loadMoreIfNeeded())},b.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c);b.on("query",function(a){d.lastParams=a;d.loading=!0});b.on("query:append",function(a){d.lastParams=a;d.loading=!0});this.$results.on("scroll",this.loadMoreIfNeeded.bind(this))},b.prototype.loadMoreIfNeeded=function(){var b=a.contains(document.documentElement,this.$loadingMore[0]);!this.loading&& b&&(b=this.$results.offset().top+this.$results.outerHeight(!1),this.$loadingMore.offset().top+this.$loadingMore.outerHeight(!1)<=b+50&&this.loadMore())},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++;this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('
    • '), c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),r.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=a(d.get("dropdownParent")||document.body);b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c);b.on("open",function(){d._showDropdown();d._attachPositioningHandler(b);d._bindContainerResultHandlers(b)});b.on("close",function(){d._hideDropdown();d._detachPositioningHandler(b)}); this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this);this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class"));b[0].classList.remove("select2");b[0].classList.add("select2-container--open");b.css({position:"absolute",top:-999999});this.$container=c},c.prototype.render=function(b){var c=a("");b=b.call(this);return c.append(b),this.$dropdownContainer=c},c.prototype._hideDropdown= function(a){this.$dropdownContainer.detach()},c.prototype._bindContainerResultHandlers=function(a,b){var c;this._containerResultsHandlersBound||(c=this,b.on("results:all",function(){c._positionDropdown();c._resizeDropdown()}),b.on("results:append",function(){c._positionDropdown();c._resizeDropdown()}),b.on("results:message",function(){c._positionDropdown();c._resizeDropdown()}),b.on("select",function(){c._positionDropdown();c._resizeDropdown()}),b.on("unselect",function(){c._positionDropdown();c._resizeDropdown()}), this._containerResultsHandlersBound=!0)},c.prototype._attachPositioningHandler=function(c,d){var e=this;c="scroll.select2."+d.id;var f="resize.select2."+d.id,h="orientationchange.select2."+d.id;d=this.$container.parents().filter(b.hasScroll);d.each(function(){b.StoreData(this,"select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})});d.on(c,function(c){c=b.GetData(this,"select2-scroll-position");a(this).scrollTop(c.y)});a(window).on(c+" "+f+" "+h,function(a){e._positionDropdown(); e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){c="scroll.select2."+d.id;var e="resize.select2."+d.id;d="orientationchange.select2."+d.id;this.$container.parents().filter(b.hasScroll).off(c);a(window).off(c+" "+e+" "+d)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown[0].classList.contains("select2-dropdown--above"),d=this.$dropdown[0].classList.contains("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1); var h=this.$container.outerHeight(!1);var l=f.top;h=f.top+h;var m=this.$dropdown.outerHeight(!1),k=b.scrollTop(),t=b.scrollTop()+b.height(),n=kf.bottom+m;k={left:f.left,top:h};t=this.$dropdownParent;"static"===t.css("position")&&(t=t.offsetParent());f={top:0,left:0};(a.contains(document.body,t[0])||t[0].isConnected)&&(f=t.offset());k.top-=f.top;k.left-=f.left;c||d||(e="below");b||!n||c?!n&&b&&c&&(e="below"):e="above";("above"==e||c&&"below"!==e)&&(k.top=l-f.top-m);null!=e&&(this.$dropdown[0].classList.remove("select2-dropdown--below"), this.$dropdown[0].classList.remove("select2-dropdown--above"),this.$dropdown[0].classList.add("select2-dropdown--"+e),this.$container[0].classList.remove("select2-container--below"),this.$container[0].classList.remove("select2-container--above"),this.$container[0].classList.add("select2-container--"+e));this.$dropdownContainer.css(k)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative", a.width="auto");this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent);this._positionDropdown();this._resizeDropdown()},c}),r.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(a,b,c,d){this.minimumResultsForSearch=c.get("minimumResultsForSearch");0>this.minimumResultsForSearch&&(this.minimumResultsForSearch=1/0);a.call(this,b,c,d)}return a.prototype.showSearch=function(a,b){return!(function g(a){for(var b=0,c=0;c< a.length;c++){var d=a[c];d.children?b+=g(d.children):b++}return b}(b.data.results)b.length||null!=(b=a.GetData(b[0],"data")).element&&b.element.selected||null==b.element&&b.selected||this.trigger("select",{data:b})},b}),r.define("select2/dropdown/closeOnSelect",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c);b.on("select",function(a){d._selectTriggered(a)});b.on("unselect",function(a){d._selectTriggered(a)})},a.prototype._selectTriggered=function(a,b){(a=b.originalEvent)&&(a.ctrlKey||a.metaKey)||this.trigger("close",{originalEvent:a, originalSelect2Event:b})},a}),r.define("select2/dropdown/dropdownCss",["../utils"],function(a){function b(){}return b.prototype.render=function(b){var c=b.call(this);b=this.options.get("dropdownCssClass")||"";return-1!==b.indexOf(":all:")&&(b=b.replace(":all:",""),a.copyNonInternalCssClasses(c[0],this.$element[0])),c.addClass(b),c},b}),r.define("select2/dropdown/tagsSearchHighlight",["../utils"],function(a){function b(){}return b.prototype.highlightFirstItem=function(b){var c=this.$results.find(".select2-results__option--selectable:not(.select2-results__option--selected)"); if(0=c?"auto":c+"px"; if("style"!=b)return"computedstyle"!=b?b:window.getComputedStyle(a[0]).width;a=a.attr("style");if("string"!=typeof a)return null;a=a.split(";");b=0;for(var d=a.length;b');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container[0].classList.add("select2-container--"+this.options.get("theme")),c.StoreData(b[0],"element",this.$element),b},e}),r.define("select2/dropdown/attachContainer",[],function(){function a(a,b,c){a.call(this,b,c)}return a.prototype.position=function(a, b,c){c.find(".dropdown-wrapper").append(b);b[0].classList.add("select2-dropdown--below");c[0].classList.add("select2-container--below")},a}),r.define("select2/dropdown/stopPropagation",[],function(){function a(){}return a.prototype.bind=function(a,b,c){a.call(this,b,c);this.$dropdown.on("blur change click dblclick focus focusin focusout input keydown keyup keypress mousedown mouseenter mouseleave mousemove mouseover mouseup search touchend touchstart",function(a){a.stopPropagation()})},a}),r.define("select2/selection/stopPropagation", [],function(){function a(){}return a.prototype.bind=function(a,b,c){a.call(this,b,c);this.$selection.on("blur change click dblclick focus focusin focusout input keydown keyup keypress mousedown mouseenter mouseleave mousemove mouseover mouseup search touchend touchstart",function(a){a.stopPropagation()})},a}),A=function(a){function b(b){var h,g=b||window.event,l=k.call(arguments,1),m,u=0,q=0,p=0,r=0,t=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(q=-1*g.detail),"wheelDelta"in g&&(q=g.wheelDelta), "wheelDeltaY"in g&&(q=g.wheelDeltaY),"wheelDeltaX"in g&&(u=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(u=-1*q,q=0),m=0===q?u:q,"deltaY"in g&&(m=q=-1*g.deltaY),"deltaX"in g&&(u=g.deltaX,0===q&&(m=-1*u)),0!==q||0!==u)return 1===g.deltaMode?(m*=h=a.data(this,"mousewheel-line-height"),q*=h,u*=h):2===g.deltaMode&&(m*=h=a.data(this,"mousewheel-page-height"),q*=h,u*=h),p=Math.max(Math.abs(q),Math.abs(u)),(!f||p{{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 a(a,c,e,f,h,l,k){var b=jQuery(".tdb-"+a+"-templates");b.length&&"undefined"===typeof b.data("tdb-templates")&&("undefined"!==typeof l&&l.call(),tdbGetMobileTemplates(a,c,b),l="","undefined"!==typeof tdcState&&(l=tdcState.isMobileComposer()?"1":""),l={action:"tdb_get_"+a+"_templates",mobile_templates:l,_nonce:window.tdb_globals.wpRestNonce},l[a+"_id"]=c,jQuery.ajax({type:"POST",url:td_ajax_url,data:l,success:function(d,l,m){b.html("");d=jQuery.parseJSON(d);l='
      Cloud Templates
      '+ ("undefined"!==typeof f&&!0===f?'
      Global
      ':"")+'
      Mobile Template
      ';var n=m="",u=!1;_.isArray(d)&&d.length?(_.each(d,function(b,d,l){d="";"true"===b.is_current.toString()&&(d=" tdb-current",u=!0);d='
      '+b.template_id+'
      '+b.template_title+'
      Rename
      Duplicate
      Delete
      '; "undefined"!==typeof f&&!0===f&&(l="","undefined"!==typeof h&&""!==h&&(l='data-global-action="'+h+'"'),d+='
      Global
      '); d+='
      '+(""===b.mobile_template_title?"-":'Yes')+'
      ';n+=d+"
      "}),"undefined"!==typeof f&&!0===f&&(m+='
      Global Template
      '),b.append(m+l+n)):(b.append(l),b.append('
      No cloud templates. Please import one or more templates from Cloud Library.
      '));b.data("tdb-templates",!0);"undefined"!==typeof k&&k.call()},error:function(a,b,c){}}))}function c(a,c,e){var b=jQuery(window);b.resize(function(){var d=b.width();a.offset().left+c.width()>d?c.hasClass(e)||c.addClass(e): c.hasClass(e)&&c.removeClass(e)});b.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 f=!1;b.hasClass("tdb-load-mobile-template")&&(f=!0);"undefined"!==typeof c&&(0===c.indexOf("singleid-")?(a={wp_type:"single",templateType:"Single"},b=c.split(" ")[0].replace("singleid-",""),f?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-",""),f?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),f?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),f?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),f?a.assign_mobile_to_template=b:a.assign_to_search=b):0===c.indexOf("attachment")?(a={wp_type:"attachment",templateType:"Attachment"},b=btoa(window.location.href),f?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-",""),f?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-",""),f?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-",""),f&&(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-",""),f?a.assign_mobile_to_template=b:a.assign_to_woo_product=b):0===c.indexOf("woo_archive")?(a={wp_type:"woo_archive",templateType:"Woo Archive"},b=btoa(window.location.href),f?a.assign_mobile_to_template=b:a.assign_to_search=b):0===c.indexOf("woo_search_archive")?(a={wp_type:"woo_search_archive",templateType:"Woo Search"},b=btoa(window.location.href),f?a.assign_mobile_to_template=b:a.assign_to_search= b):0===c.indexOf("woo_shop_base")?(a={wp_type:"woo_shop_base",templateType:"Woo Shop Base"},b=btoa(window.location.href),f?a.assign_mobile_to_template=b:a.assign_to_search=b):0===c.indexOf("cpt_tax")?(a={wp_type:"cpt_tax",templateType:"Custom Taxonomy"},b=c.split(" ")[0].replace("templateid-",""),f?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-",""),f?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"),f=b.data("type");tdConfirm.modal({caption:"Create Mobile "+("page"===f?"Page":"Template"),objectContext:window,callbackYes:function(){var a=jQuery("#tdb-new-template-name"),d=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:f,copyContent:d.is(":checked")?"1":"0",_nonce:window.tdb_globals.wpRestNonce},success:function(a,d,e){a=jQuery.parseJSON(a);"undefined"!==typeof a.mobile_template_id&&(tdConfirm.close(),d=b.closest(".tdb-template-el"),d.length&&(e=d.find(".tdb-template-el-mobile:first"),d.find(".tdb-template-el-mobile-btns:first").data("mobile-template-id",a.mobile_template_id),e.html('Yes')),tdbGetMobileTemplates(f,c))},error:function(a,b,c){}})},htmlInfoContent:"Enter the mobile "+ ("page"===f?"page":"template")+' name:
      ',textYes:"Create",textNo:"Cancel"})}).on("click", "#wp-admin-bar-tdb_template_single > a, #wp-admin-bar-tdb_template_category > a, #wp-admin-bar-tdb_template_404 > a, #wp-admin-bar-tdb_template_date > a, #wp-admin-bar-tdb_template_search > a, #wp-admin-bar-tdb_template_attachment > a, #wp-admin-bar-tdb_template_author > a, #wp-admin-bar-tdb_template_tag > a, #wp-admin-bar-tdb_template_woo_product > a, #wp-admin-bar-tdb_template_woo_archive > a, #wp-admin-bar-tdb_template_woo_shop_base > a, #wp-admin-bar-tdb_template_woo_search_archive > a, #wp-admin-bar-tdb_template_cpt > a, #wp-admin-bar-tdb_template_cpt_tax > a", function(b){b.preventDefault();var d=jQuery(this),e=d.parent(),f=e.attr("class"),h="",l="",k="",m="";switch(e.attr("id")){case "wp-admin-bar-tdb_template_single":h="single";l="tdb_assign_single_template_to_post";k="tdb_assign_single_template_global";m=f.replace(h+"id-","");break;case "wp-admin-bar-tdb_template_category":h="category";l="tdb_assign_cat_template_to_cat";k="tdb_assign_cat_template_global";m=f.replace(h+"id-","");break;case "wp-admin-bar-tdb_template_404":h="404";l="tdb_assign_404_template_global"; k="";m=f.replace("templateid-","");break;case "wp-admin-bar-tdb_template_date":h="date";l="tdb_assign_date_template_global";k="";m=f.replace("templateid-","");break;case "wp-admin-bar-tdb_template_search":h="search";l="tdb_assign_search_template_global";k="";m=f.replace("templateid-","");break;case "wp-admin-bar-tdb_template_attachment":h="attachment";l="tdb_assign_attachment_template_global";k="";m=f.replace("templateid-","");break;case "wp-admin-bar-tdb_template_author":h="author";l="tdb_assign_author_template_to_author"; k="tdb_assign_author_template_global";m=f.replace(h+"id-","");break;case "wp-admin-bar-tdb_template_tag":h="tag";l="tdb_assign_tag_template_to_tag";k="tdb_assign_tag_template_global";m=f.replace(h+"id-","");break;case "wp-admin-bar-tdb_template_woo_product":h="woo_product";l="tdb_assign_woo_product_template_to_product";k="tdb_assign_woo_product_template_global";m=f.replace(h+"id-","");break;case "wp-admin-bar-tdb_template_woo_archive":h="woo_archive";l="tdb_assign_woo_archive_template_to_tax";k="tdb_assign_woo_archive_template_global"; m=f.replace(h+"id-","");break;case "wp-admin-bar-tdb_template_woo_search_archive":h="woo_search_archive";l="tdb_assign_woo_search_archive_template_global";k="";m=f.replace("templateid-","");break;case "wp-admin-bar-tdb_template_woo_shop_base":h="woo_shop_base";l="tdb_assign_woo_shop_base_template_global";k="";m=f.replace("templateid-","");break;case "wp-admin-bar-tdb_template_cpt":h="cpt";l="tdb_assign_cpt_template_to_cpt";k="tdb_assign_cpt_template_global";m=f.replace(h+"id-","");break;case "wp-admin-bar-tdb_template_cpt_tax":h= "cpt_tax",l="tdb_assign_cpt_tax_template_to_tax",k="tdb_assign_cpt_tax_template_global",m=f.replace("templateid-","")}var n=jQuery(".tdb-"+h+"-templates");n.length?b.currentTarget===this&&jQuery(b.target).parent().attr("id")==="wp-admin-bar-tdb_template_"+h&&(n.toggle(),d.toggleClass("tdb-templates-open"),d.toggleClass("tdb-templates-close")):(d.addClass("tdb-templates-loading"),n=jQuery('
      '),n.insertAfter(d),n.show());a(h,m,l, ""===k?!1:!0,k,void 0,function(){d.removeClass("tdb-templates-loading");d.addClass("tdb-templates-open");c(d,n,"tdb-templates-align-right")})}).on("click","#wp-admin-bar-tdc_page_mobile_template > a",function(a){a.preventDefault();var b=jQuery(this);a=b.parent().attr("class").replace("pageid-","");var e=jQuery("#tdb-mobile-templates");e.length?(e.toggle(),b.toggleClass("tdb-templates-open"),b.toggleClass("tdb-templates-close")):(b.addClass("tdb-templates-loading"),b.addClass("tdb-templates-open"), tdbGetMobileTemplates("page",a,b,void 0,function(){b.removeClass("tdb-templates-loading");jQuery("#tdb-mobile-templates").show();c(b,jQuery("#tdb-mobile-templates"),"tdb-mobile-templates-align-right")}))}).on("click","#wp-admin-bar-tdc_create_mobile_page",function(a){var b=jQuery(this).attr("class").split(" ")[0].replace("pageid-","");tdConfirm.modal({caption:"Create Mobile Page",objectContext:window,callbackYes:function(){var a=jQuery("#tdb-new-template-name"),c=jQuery("#tdb-copy-content");jQuery.ajax({type:"POST", url:td_ajax_url,data:{action:"tdb_create_mobile_template",template_id:b,template_title:a.val(),template_type:"page",copyContent:c.is(":checked")?"1":"0",_nonce:window.tdb_globals.wpRestNonce},success:function(c,d,e){"undefined"!==typeof jQuery.parseJSON(c).mobile_template_id&&(tdConfirm.close(),c=jQuery("#wp-admin-bar-tdc_page_mobile_template"),c.length&&c.find("a:first").html('Mobile page'+a.val()),tdbGetMobileTemplates("page",b))},error:function(a,b,c){}})}, htmlInfoContent:'Enter the mobile page name:
      ',textYes:"Create",textNo:"Cancel"})}).on("click", ".tdb-single-template-global label, .tdb-category-template-global label, .tdb-author-template-global label, .tdb-tag-template-global label, .tdb-woo_product-template-global label, .tdb-woo_archive-template-global label, .tdb-cpt-template-global label, .tdb-cpt_tax-template-global label ",function(a){a.preventDefault();a=jQuery(this);var b=a.closest(".tdb-template-el-global"),c=b.data("type"),f=b.data("global-action");b=a.parent().data(c+"-id");var h=a.parent().data("template-id"),l=jQuery(".tdb-templates"); a={action:f,template_id:h,_nonce:window.tdb_globals.wpRestNonce};switch(c){case "single":a.single_id=b;break;case "category":a.category_id=b;break;case "tag":a.tag_id=b;break;case "author":a.author_id=b;break;case "woo_product":a.woo_product_id=b;break;case "woo_archive":a.woo_term_id=b;break;case "cpt":a.cpt_id=b;break;case "cpt_tax":a.cpt_tax_id=b}jQuery.ajax({type:"POST",url:td_ajax_url,data:a,success:function(a,b,d){a=jQuery.parseJSON(a);"undefined"!==typeof a.reload&&window.location.reload(); "undefined"!==typeof a.global_template_id&&(l.find(".tdb-"+c+'-template-global > input[type="checkbox"]').removeAttr("checked"),l.find(".tdb-"+c+'-template-global[data-template-id="'+h+'"] > input[type="checkbox"]').attr("checked",!0))},error:function(a,b,c){}});return!1}).on("click",".tdb-template-el-title",function(a){a.preventDefault();if(a.target===a.currentTarget){a=jQuery(this);var b=a.data("action"),c=a.data("type"),f=a.data(c+"-id"),h=a.data("template-id");b={action:b,template_id:h,_nonce:window.tdb_globals.wpRestNonce}; "cpt"===c?b.cpt=a.data("cpt-id"):"cpt_tax"===c&&(b.cpt_tax=a.data("cpt_tax-id"));switch(c){case "single":b.single_id=f;break;case "category":b.category_id=f;break;case "author":b.author_id=f;break;case "tag":b.tag_id=f;break;case "woo_product":b.woo_product_id=f;break;case "woo_archive":b.woo_term_id=f;break;case "cpt":b.cpt_id=f;break;case "cpt_tax":b.cpt_tax_id=f}jQuery.ajax({type:"POST",url:td_ajax_url,data:b,success:function(a,b,d){"undefined"===typeof jQuery.parseJSON(a).reload&&"cpt"!==c&&"cpt_tax"!==c||window.location.reload()},error:function(a,b,c){}});return!1}}).on("change",".tdb-template-el-title-input",function(a){a.preventDefault();a=jQuery(this);var b=a.closest(".tdb-templates"),c=a.closest(".tdb-template-el"),f=c.find(".tdb-template-el-title:first");b.data("type");b=c.data("template-id");f.html();jQuery.ajax({type:"POST",url:td_ajax_url,data:{action:"tdb_change_template_name",template_id:b,template_title:a.val(),_nonce:window.tdb_globals.wpRestNonce},success:function(a,b,c){a=jQuery.parseJSON(a); "undefined"!==typeof a.template_id&&(f.html(a.template_title),f.removeData("title"))},error:function(a,b,c){}})}).on("click",".tdb-template-el-edit",function(a){a.preventDefault();var b=jQuery(this);a=b.closest(".tdb-templates");var c=b.closest(".tdb-template-el");b=c.find(".tdb-template-el-title:first");a.data("type");c.data("template-id");c=b.html();"undefined"===typeof b.data("title")&&(a.find(".tdb-template-el-title").each(function(a,b){a=jQuery(b);b=a.data("title");"undefined"!==typeof b&&(a.html(b), a.removeData("title"))}),b.data("title",b.html()),b.html(''),b.find("input").focus().select())}).on("click",".tdb-template-el-duplicate",function(b){b.preventDefault();b=jQuery(this);var c=b.closest(".tdb-templates"),e=b.closest(".tdb-template-el"),f=e.find(".tdb-template-el-title:first"),h=c.data("type");b=e.data("template-id");var l=f.html(),k=f.data(h+"-id"),m=f.data("action"),n="";0<="single category tag author woo_product woo_archive".split(" ").indexOf(h)&& (e=e.find(".tdb-template-el-global:first"),e.length&&(n=e.data("global-action")));tdbApi.run({wpNonce:window.tdb_globals.wpRestNonce,cloudEndPoint:"td-cloud-library/new_template",post:{postId:b,templateType:h,templateName:l,duplicateTemplate:!0},done:function(b){c.removeData("tdb-templates");a(h,0<="single category tag author woo_product woo_archive cpt".split(" ").indexOf(h)?k:"",m,""===n?!1:!0,n)},error:function(a){console.log("td-cloud-library/new_template(duplicate template) - ERROR",a)}}); jQuery(".tdb-template-el-title-input").trigger("change")}).on("keyup",".tdb-template-el-title-input",function(a){27===a.keyCode&&jQuery(this).trigger("change")}).on("click",".tdb-template-el-delete",function(a){a=jQuery(this);a.closest(".tdb-templates");var b=a.closest(".tdb-template-el");a=b.data("template-id");jQuery.ajax({type:"POST",url:td_ajax_url,data:{action:"tdb_delete_template",template_id:a,_nonce:window.tdb_globals.wpRestNonce},success:function(a,c,d){a=jQuery.parseJSON(a);"undefined"!==typeof a.reload&&window.location.reload();"undefined"!==typeof a.template_id&&b.remove()},error:function(a,b,c){}});jQuery(".tdb-template-el-title-input").trigger("change")}).on("click",function(a){a=jQuery(a.target);a.closest("#wp-admin-bar-tdb_template_single").length||a.closest("#wp-admin-bar-tdb_template_category").length||a.closest("#wp-admin-bar-tdb_template_404").length||a.closest("#wp-admin-bar-tdb_template_date").length||a.closest("#wp-admin-bar-tdb_template_search").length||a.closest("#wp-admin-bar-tdb_template_attachment").length|| a.closest("#wp-admin-bar-tdb_template_author").length||a.closest("#wp-admin-bar-tdb_template_tag").length||a.closest("#wp-admin-bar-tdb_template_woo_product").length||a.closest("#wp-admin-bar-tdb_template_woo_archive").length||a.closest("#wp-admin-bar-tdb_template_woo_search_archive").length||a.closest("#wp-admin-bar-tdb_template_woo_shop_base").length||a.closest("#wp-admin-bar-tdb_template_cpt").length||a.closest("#wp-admin-bar-tdb_template_cpt_tax").length||a.closest("#wp-admin-bar-tdc_page_mobile_template").length|| (a=jQuery(".tdb-templates"),a.length&&(a.hide(),a.prev("a").removeClass("tdb-templates-open").addClass("tdb-templates-close"),jQuery(".tdb-template-el-title-input").trigger("change")),a=jQuery("#tdb-mobile-templates"),a.length&&(a.hide(),a.prev("a").removeClass("tdb-templates-open").addClass("tdb-templates-close")))}).on("click","#tdb-mobile-templates .tdb-template-el-mobile-list-el",function(a){var b=jQuery(this),c=jQuery("#tdb-mobile-templates");a=b.data("template-id");var f=b.data("mobile-template-id"), h=c.closest(".tdb-template-el-mobile-btns"),l=b.closest(".tdb-template-el-mobile-wrap"),k=b.closest("#wp-admin-bar-tdc_page_mobile_template");jQuery.ajax({type:"POST",url:td_ajax_url,data:{action:"tdb_set_mobile_template",template_id:a,mobile_template_id:f,_nonce:window.tdb_globals.wpRestNonce},success:function(a,d,e){a=jQuery.parseJSON(a);_.isObject(a)&&!_.isUndefined(a.result)&&1===a.result&&(h.data("mobile-template-id",f),c.find(".tdb-template-el-mobile-list-el").removeClass("tdb-current"),c.find('.tdb-template-el-mobile-list-el[data-mobile-template-id="'+ f+'"]').addClass("tdb-current"),l.length&&(a=l.find(".tdb-template-el-mobile:first"),""===f?a.html("-"):a.html('Yes')),k.length&&(k.find("a:first").html('Mobile page'+b.find(".tdb-template-el-mobile-list-title:first").html()),"No mobile page"===b.find(".tdb-template-el-mobile-list-title:first").html()&&k.find("a:first").html('Mobile page')))}})}).on("click", "#tdb-mobile-templates .tdb-template-el-mobile-list-edit",function(a){a.stopPropagation()}).on("click","#tdb-mobile-templates .tdb-template-el-mobile-list-delete",function(a){a.stopPropagation();a=jQuery(this);var b=a.data("type"),c=a.closest(".tdb-template-el-mobile-list-el"),f=c.data("template-id");a=c.data("mobile-template-id");var h=c.hasClass("tdb-current"),l=jQuery("#tdb-mobile-templates").closest(".tdb-template-el");jQuery.ajax({type:"POST",url:td_ajax_url,data:{action:"tdb_delete_template", template_id:a,_nonce:window.tdb_globals.wpRestNonce},success:function(a,d,e){"undefined"!==typeof jQuery.parseJSON(a).template_id&&tdbGetMobileTemplates(b,f,void 0,function(){jQuery("#tdb-mobile-templates").addClass("loading")},function(){jQuery("#tdb-mobile-templates").removeClass("loading");if(h)if("page"===b){var a=jQuery("#wp-admin-bar-tdc_page_mobile_template");a.length&&a.find("a:first").html('Mobile pageNo mobile page')}else c.remove(),l.length&&l.find(".tdb-template-el-mobile:first").html("-")})}, error:function(a,b,c){}})}).on("mouseenter",".tdb-template-el-mobile-btns",function(a){a=jQuery(this);var b=a.data("mobile-template-id"),c=a.data("template-id"),f=jQuery("#tdb-mobile-templates");f.find(".tdb-template-el-mobile-list-inner").is(":empty")||(f.appendTo(a).show(),f.find(".tdb-template-el-mobile-list-el").removeClass("tdb-current"),f.find(".tdb-template-el-mobile-list-el").data("template-id",c),f.find('.tdb-template-el-mobile-list-el[data-mobile-template-id="'+b+'"]').addClass("tdb-current"))}).on("mouseleave", ".tdb-template-el-mobile-btns",function(a){a=jQuery(".tdb-templates");var b=jQuery("#tdb-mobile-templates");b.hide();b.insertBefore(a);b.find(".tdb-template-el-mobile-list-el").removeClass("tdb-current")});jQuery(".tdb-templates");window.tdbGetMobileTemplates=function(a,c,e,f,h,l,k){var b=jQuery("#tdb-mobile-templates",l);b.length||(b=jQuery(''), b.hide());"undefined"!==typeof e&&b.insertAfter(e);e={action:"tdb_get_"+a+"_mobile_templates",_nonce:window.tdb_globals.wpRestNonce};e[a+"_id"]=c;"undefined"!==typeof f&&f.call();jQuery.ajax({type:"POST",url:td_ajax_url,data:e,success:function(d,e,f){var l="";f=jQuery.parseJSON(d);d='
    • Load mobile page from Cloud Library
    • Create blank mobile page
    • ';if(_.isArray(f)&&f.length){var m=!1,n="template";e="";"page"===a&&(n="page",e=d);_.each(f,function(b,d,e){d="";_.isUndefined(b.is_current)||(d="tdb-current",m=!0);l+='
      '+b.template_title+'
      '});""!==l&&(f="",m||(f="tdb-current",m=!0),l=e+'
      No mobile '+n+"
      "+l);""!==l&&(b.html('
      '+l+'
      Documentation »'), e=b.parent(".tdb-template-el-mobile-btns"),!_.isUndefined(k)&&e.length&&(b.find(".tdb-template-el-mobile-list-el").removeClass("tdb-current"),b.find(".tdb-template-el-mobile-list-el").data("template-id",c),b.find('.tdb-template-el-mobile-list-el[data-mobile-template-id="'+k+'"]').addClass("tdb-current")),b.is(":visible")&&e.length?b.show():b.hide())}""===l&&("page"===a?b.html(d+'
      No mobile page, please import or create a new mobile page.
      Documentation »
      '): b.html(""));"undefined"!==typeof h&&h.call()}})}})(); jQuery(window).on("load",function(){var a=!1;window.parent===window.top&&"undefined"!==typeof window.name&&"tdc-live-iframe"===window.name&&"undefined"!==typeof window.parent.tdcSidebar&&(a=!0);if(window.self===window.top||a)jQuery(".tdb_single_reading_progress").each(function(){var c=jQuery(this),b=c.data("td-block-uid");c=c.data("bar-position");var d=new tdReadingProgressBar.item;d.blockUid=b;d.barPosition=c;tdReadingProgressBar.addItem(d);a&&tdReadingProgressBar.createFixedBar(d,0,30)}),a||tdReadingProgressBar.calculateBarsFill()}); var tdbMenu={}; (function(){tdbMenu={ui_events:"mouseover click keydown wheel touchmove touchstart".split(" "),items:[],item:function(){this.blockUid="";this._outsideClickArea=this._mainMenu=this._itemsWithSubmenu=null;this._outsideClickExcludedAreas="";this._openMenuClass="tdb-hover";this._openMenuBodyClass="tdb-open-menu";this.isMegaMenuParentPos=this.isMegaMenuFull=this.inComposer=!1;this.megaMenuLoadType="";this._is_initialized=!1},init:function(){tdbMenu.items=[]},_initialize_item:function(a){if(!0!==a._is_initialized){tdbMenu._setHover(a); var c=0 ul");h.show();h.each(function(){jQuery(this).css("left","");l=jQuery(this).offset();k=l.left;0>k?jQuery(this).offset({left:0}):(m=jQuery(window).width()-(k+jQuery(this).outerWidth()),0>m&&jQuery(this).offset({left:jQuery(window).width()-jQuery(this).outerWidth()}))});n||(d.find(".tdb-mega-menu-inactive").removeClass("tdb-mega-menu-inactive"),n=!0);h.hide()}var d=a.jqueryObj,e,f,h,l,k,m,n=!1; setTimeout(function(){jQuery(window).resize(function(){e=d.offset();f=e.left;b();c&&setInterval(function(){e=d.offset();e.left!==f&&(b(),f=e.left)},1E3)});jQuery(window).resize()},60)},pageMegaMenuHeight:function(a,c){function b(){f.show();f.each(function(){var a=jQuery(this),b=a.find("> li"),c=e.offset().top+e.outerHeight();b=b.outerHeight();var f=d.scrollTop(),n=d.height();c+b>n+f?a.css({height:n+f-c,"overflow-y":"auto"}):a.css({height:"auto","overflow-y":"visible"})});f.hide()}var d=jQuery(window), e=a.jqueryObj,f=e.find(".tdb-menu .tdb-mega-menu-page > ul");setTimeout(function(){d.on("resize scroll",function(){b();c&&setInterval(function(){b()},1E3)});d.resize().scroll()},1500)},_getSubmenuPosition:function(a){var c=jQuery(window).width();a=a.children(".sub-menu").first();if(0c&&(a.parent().parent().hasClass("tdb-menu")?a.css("left","-"+(b-c)+"px"):a.addClass("reversed").css("left","-"+(a.width()+0)+"px"))}},_getMouseAngleDirection:function(a,c, b,d){return Math.atan2(b-a,d-c)/Math.PI*180},_setHover:function(a){var c=a.jqueryObj.find(".tdb-menu");c.supersubs({minWidth:10,maxWidth:20,extraWidth:1,applyMin:!0});var b=c.find(".menu-item-has-children > a, .tdb-mega-menu > a");b.parent().find(".sub-menu").first().css("display","none");if(tdDetect.isTouchDevice)jQuery(document).on("touchstart","body",function(c){var d=b.parent(),e=jQuery("body");e.hasClass(a._openMenuBodyClass)&&!d.is(c.target)&&0===d.has(c.target).length&&(d.removeClass(a._openMenuClass), d.children(".sub-menu").hide(),e.removeClass(a._openMenuBodyClass))}),b.on("touchstart",function(c){c.preventDefault();c.stopPropagation();var d=jQuery(this);c=d.parent();var e=jQuery("body");c.hasClass(a._openMenuClass)?null!==d.attr("href")&&"#"!==d.attr("href")?window.location.href=d.attr("href"):((c.parent().hasClass("tdb-menu")||c.parent().hasClass("top-header-menu"))&&e.removeClass(a._openMenuBodyClass),c.removeClass(a._openMenuClass),c.find(".sub-menu").hide(),c.find("li").removeClass(a._openMenuClass)): (c.parent().hasClass("tdb-menu")||c.parent().hasClass("top-header-menu")?(b.parent().removeClass(a._openMenuClass),b.parent().children(".sub-menu").hide()):(d=c.siblings(),d.removeClass(a._openMenuClass),d.find(".sub-menu").hide(),d.find("li").removeClass(a._openMenuClass)),c.addClass(a._openMenuClass),c.children(".sub-menu").show(),tdbMenu._getSubmenuPosition(c),e.addClass(a._openMenuBodyClass))});else{var d={},e,f=!0;c.on("mouseleave",function(){b.parent().removeClass(a._openMenuClass);b.parent().children(".sub-menu").hide(); d={}});c.find(".menu-item").hover(function(){var c=jQuery(this),l="",k,m;if(c.hasClass("menu-item-has-children")||c.hasClass("tdb-mega-menu"))if(c.parent().hasClass("tdb-menu"))if(jQuery.isEmptyObject(d))c.addClass(a._openMenuClass),c.children(".sub-menu").show(),d=c;else{if(c[0]!==d[0]){var n=m=k=0;var q=null;!0===f&&(f=!1,e=setTimeout(function(){b.parent().removeClass(a._openMenuClass);b.parent().children(".sub-menu").hide();c.addClass(a._openMenuClass);c.children(".sub-menu").show();d=c},400)); c.on("mousemove",function(h){5<=k?(k=0,q=tdbMenu._getMouseAngleDirection(m,n,h.pageX,h.pageY),m=h.pageX,n=h.pageY):(k++,0===m&&0===n&&(m=h.pageX,n=h.pageY));null!==q&&(85q)&&(b.parent().removeClass(a._openMenuClass),b.parent().children(".sub-menu").hide(),c.addClass(a._openMenuClass),c.children(".sub-menu").show(),c.off("mousemove"),clearTimeout(e),f=!0,d=c)})}}else l=c.siblings(),l.removeClass(a._openMenuClass),l.find(".sub-menu").hide(),l.find("li").removeClass(a._openMenuClass),c.addClass(a._openMenuClass), c.children(".sub-menu").show(),tdbMenu._getSubmenuPosition(c);else c.parent().hasClass("tdb-menu")?jQuery.isEmptyObject(d)||(n=m=k=0,q=null,!0===f&&(f=!1,e=setTimeout(function(){b.parent().removeClass(a._openMenuClass);b.parent().children(".sub-menu").hide();d={}},400)),c.on("mousemove",function(h){5<=k?(k=0,q=tdbMenu._getMouseAngleDirection(m,n,h.pageX,h.pageY),m=h.pageX,n=h.pageY):(k++,0===m&&0===n&&(m=h.pageX,n=h.pageY));null!==q&&(85q)&&(b.parent().removeClass(a._openMenuClass),b.parent().children(".sub-menu").hide(), c.off("mousemove"),clearTimeout(e),f=!0,d={})})):(d=c.parent(),l=c.siblings(),l.removeClass(a._openMenuClass),l.find(".sub-menu").hide(),l.find("li").removeClass(a._openMenuClass))},function(){var a=jQuery(this);!1===f&&(clearTimeout(e),f=!0);a.off("mousemove")})}},unsetHover:function(a){null!==a._itemsWithSubmenu&&a._itemsWithSubmenu.off();null!==a._outsideClickArea&&a._outsideClickArea.off()}}})();var tdbMenuItemPullDown={}; (function(){tdbMenuItemPullDown={init:function(){setTimeout(function(){jQuery(".tdb-menu-items-pulldown").each(function(a,c){var b=jQuery(c),d=b.parent().attr("id");c=jQuery("."+d);var e="";"none"!==c.css("max-width")&&(e=c.css("max-width"));if(c.hasClass("tdb-menu-items-in-more")){var f=b.find(".tdb-menu:first"),h=f.parents(".tdb-menu-items-pulldown:first"),l=[];a=new tdPullDown.item;if(void 0!==c.css("display")&&"inline-block"===c.css("display")){var k=c.closest(".vc_column_container");h=k;var m= "";m=0!==k.find(".tdc-elements").length?".tdc-elements":".wpb_wrapper";k.find(m+" > .td_block_wrap").each(function(){var a=.9*k.outerWidth(!0),b=jQuery(this).outerWidth(!0);if(jQuery(this).data("td-block-uid")!==d)if(ba._last_request_results_count-1?(a.jqueryObj.find(".tdb-search-form").fadeTo(100,1),a.jqueryObj.find(".tdb-head-search-form-input").removeClass("tdb-head-search-nofocus")):(tdbSearch.remove_input_focus(a),a.jqueryObj.find(".td_module_wrap").eq(a._current_selection_index).addClass("tdb-aj-cur-element"))}, do_ajax_call:function(a){var c=a.jqueryObj.find(".tdb-head-search-form-input").val();""===c?tdbSearch.set_input_focus(a):tdLocalCache.exist("tdb-"+c)?tdbSearch.process_ajax_response(tdLocalCache.get("tdb-"+c),a):jQuery.ajax({type:"POST",url:td_ajax_url,data:{action:"td_ajax_search",module:"tdb_module_search",atts:a.blockAtts,td_string:c,limit:a._resultsLimit},success:function(b,d,e){tdLocalCache.set("tdb-"+c,b);tdbSearch.process_ajax_response(b,a)},error:function(a,c,e){window.console.log(e)}})}, process_ajax_response:function(a,c){var b=c.jqueryObj.find(".tdb-head-search-form-input").val(),d=c.jqueryObj.find(".tdb-aj-search");""===b?d.empty():(a=jQuery.parseJSON(a),a.td_search_query===b&&(c._current_selection_index=0,c._last_request_results_count=a.td_total_in_list,c._first_down_up=!0,d.html(a.td_data),"undefined"!==typeof window.tdAnimationStack&&!0===window.tdAnimationStack.activated&&(window.tdAnimationStack.check_for_new_items(".tdb-aj-search .td-animation-stack",window.tdAnimationStack.SORTED_METHOD.sort_left_to_right, !0,!1),window.tdAnimationStack.compute_items(!1))))},hideAllItems:function(){tdbSearch.items.forEach(function(a){tdbSearch.hide_search_box(a)})}}})();jQuery().ready(function(){tdbSearch.init();setTimeout(function(){jQuery(window).resize()},500)});var tdbLocationFinder={};jQuery().ready(function(){tdbLocationFinder.init()}); (function(){tdbLocationFinder={items:[],item:function(){this.blockObj=this.uid="";this.mapMarker=this.map=void 0;this.defLong=this.defLat=0;this.defZoom=3;this.defAddress="";this.errorContainer=void 0;this._is_initialized=this._in_composer=!1},init:function(){tdbLocationFinder.items=[];this._is_running=!1},_initialize_item:function(a){!0!==a._is_initialized&&(a.errorContainer=a.blockObj.find(".tdb-s-notif"),tdbLocationFinder.initMap(a),a._in_composer||(""!==a.defAddress&&tdbLocationFinder.displayLocationByAddress(a, a.defAddress),tdbLocationFinder.locationSearch(a),tdbLocationFinder.currentLocation(a)),a._is_initialized=!0)},addItem:function(a){if("undefined"===typeof a.uid)throw"item.uid is not defined";tdbLocationFinder.items.push(a);tdbLocationFinder._initialize_item(a)},locationSearch:function(a){var c=document.querySelector("#tdb-lf-search-"+a.uid),b=new google.maps.places.Autocomplete(c,{types:["address"],fields:["address_components","geometry"]});b.addListener("place_changed",function(){var d=b.getPlace(); c.classList.add("loading");c.disabled=!0;tdbLocationFinder.updateError(a,"",!1);if(d.geometry){var e=d.address_components,f="",h="",l="",k="",m="",n="",q=d.geometry.location;console.log(e);for(d=0;d
      '; a.termIsHerarchical&&(c+='
      '); c+='
      ';var f=new tdbModal.item;f.customClasses="tdb-ft-create-term-modal tdb-ft-create-term-modal-"+a.uid;f.title="Create new term";f.body=c;f.validateFormInputs=[{id:"tdb-ft-new-term-name",rules:"required"}];tdbModal.addItem(f); tdbModal.openModal(f);if(a.termIsHerarchical){var h=f.modalObj.find("#tdb-ft-new-term-parent-id");jQuery.ajax({type:"POST",url:td_ajax_url,data:{action:"tdb_ft_get_terms",_nonce:a._nonce,parentTermID:-1,termType:a.termType,depth:2,orderBy:a.orderBy,order:a.order},success:function(b){b=jQuery.parseJSON(b);Object.keys(b).length&&h.append(tdbFormTaxonomies.render_dropdown_options(b,0,[d.toString()]));h.select2({dropdownCssClass:"tdb-s-select2 tdb-s-select2-"+a.uid});h.closest(".tdb-s-form-select-wrap").removeClass("tdb-s-content-loading")}})}f.modalObj.on("tdbModal.confirming", function(){var b=f.modalObj.find(".tdb-s-fc-inner"),c=b.find("#tdb-ft-new-term-name"),d=b.find("#tdb-ft-new-term-parent-id"),h=b.find("#tdb-ft-new-term-descr");c=c.val();var q=d.length?d.val():0;d=h.val();b.find(".tdb-s-notif").remove();!0===tdbModal._validate_form_inputs(f)?jQuery.ajax({type:"POST",url:td_ajax_url,data:{action:"tdb_create_term",_nonce:a._nonce,termName:c,termType:a.termType,termDescr:d,parentTermID:q},success:function(c){c=jQuery.parseJSON(c);if(c.errors.length){var d='
      '; d+='
        ';jQuery.each(c.errors,function(a,b){d+="
      • "+b+"
      • "});d+="
      ";d+="
      ";b.append(d);f.modalObj.trigger("tdbModal.confirmingReset")}else{f.modalObj.trigger("tdbModal.confirmed");c=0==q||a.showAllTerms?e.find('.tdb-s-form-group[data-term-hierarchy="parent"]'):e.find('.tdb-s-form-group[data-parent-id="'+q+'"]');var h=c.data("display");if(c.length){var l=[];if("dropdown"===h){var k=c.find("select option:selected");k.length&&l.push(k.val())}else"checkbox"===h? (k=c.find(".tdb-s-form-check input:checked"),jQuery.each(k,function(a,b){l.push(jQuery(this).val())})):"radio"===h&&(k=c.find(".tdb-s-form-check input:checked"),k.length&&l.push(k.val()));tdbFormTaxonomies.refreshTerms(a,c,q,l,h)}else c=e.find('[value="'+q+'"]'),c.length&&(k=c.closest(".tdb-s-form-group"),h=k.data("term-hierarchy"),k=k.data("display"),"sub-child"!==h&&("dropdown"===k?c.is(":selected")&&(c=c.closest("select"),tdbFormTaxonomies.renderTermChildrenFromDropdown(a,c)):"checkbox"===k?c.is(":checked")&& (c=c.closest(".tdb-s-fc-label"),tdbFormTaxonomies.renderTermChildrenFromCheckbox(a,c,!0)):"radio"===k&&c.is(":checked")&&(c=c.closest(".tdb-s-fc-label"),tdbFormTaxonomies.renderTermChildrenFromRadio(a,c,!0))))}}}):f.modalObj.trigger("tdbModal.confirmingReset")})});a._is_initialized=!0}},addItem:function(a){if("undefined"===typeof a.uid)throw"item.uid is not defined";tdbFormTaxonomies.items.push(a);tdbFormTaxonomies._initialize_item(a)},renderTermChildrenFromDropdown:function(a,c){var b=c.closest(".tdb-s-form-group").data("term-hierarchy"), d=c.val(),e=c.find("option:selected").text().replace(/ *\([^)]*\) */g,""),f="",h="",l=c.attr("data-old-term-id");""===c.val()?tdbFormTaxonomies.removeChildTerms(a,l,b):(c.attr("data-old-term-id",d),"parent"===b?f="child":"child"===b&&(f="sub-child"),"child"===f?h=a.childDisplay:"sub-child"===f&&(h=a.subChildDisplay),tdbFormTaxonomies.removeChildTerms(a,l,b),tdbFormTaxonomies.renderTermChildren(a,d,e,b,f,h))},renderTermChildrenFromCheckbox:function(a,c,b){b=void 0===b?!1:b;var d=c.find('input[type="checkbox"]'), e=c.closest(".tdb-s-form-group").data("term-hierarchy"),f=d.val();c=c.find(".tdb-s-fc-title").text();var h="",l="",k=a.blockObj.find(".tdb-s-form");d.prop("disabled")||("parent"===e?h="child":"child"===e?h="sub-child":"sub-child"===e&&(h="last-level"),"child"===h?l=a.childDisplay:"sub-child"===h&&(l=a.subChildDisplay),d.prop("checked")&&!b?(d.prop("checked",!1),a.showAllTerms?tdbFormTaxonomies.manageLimits(a):tdbFormTaxonomies.removeChildTerms(a,f,e)):(d.prop("checked",!0),a.showAllTerms?tdbFormTaxonomies.manageLimits(a): "last-level"===h?(k.addClass("tdb-s-content-loading"),setTimeout(function(){tdbFormTaxonomies.manageLimits(a);k.removeClass("tdb-s-content-loading")},400)):tdbFormTaxonomies.renderTermChildren(a,f,c,e,h,l)))},renderTermChildrenFromRadio:function(a,c,b){b=void 0===b?!1:b;var d=c.find('input[type="radio"]'),e=c.closest(".tdb-s-form-group"),f=e.find(".tdb-ft-checkboxes");e=e.data("term-hierarchy");var h=d.val();c=c.find(".tdb-s-fc-title").text();var l="",k="",m=f.attr("data-old-term-id");f.attr("data-old-term-id", h);"parent"===e?l="child":"child"===e&&(l="sub-child");"child"===l?k=a.childDisplay:"sub-child"===l&&(k=a.subChildDisplay);d.prop("checked")?b&&(tdbFormTaxonomies.removeChildTerms(a,m,e),tdbFormTaxonomies.renderTermChildren(a,h,c,e,l,k)):(f.find('input[value="'+m+'"]').prop("checked",!1),d.prop("checked",!0),tdbFormTaxonomies.removeChildTerms(a,m,e),tdbFormTaxonomies.renderTermChildren(a,h,c,e,l,k))},renderTermChildren:function(a,c,b,d,e,f){var h=a.blockObj.find(".tdb-s-content"),l=h.find(".tdb-s-fc-inner"); h.addClass("tdb-s-content-loading");jQuery.ajax({type:"POST",url:td_ajax_url,data:{action:"tdb_ft_get_terms",_nonce:a._nonce,parentTermID:c,termType:a.termType,orderBy:a.orderBy,order:a.order},success:function(d){d=jQuery.parseJSON(d);var k="";Object.keys(d).length&&(k='
      ',k+='","dropdown"===f?(k+='
      ',k+='",k+='', k+="
      "):"checkbox"===f?(k+='
      ',k+='
      ',k+=tdbFormTaxonomies.render_checkboxes(a,d,0,[]),k+="
      ",k+="
      "):"radio"===f&&(k+='
      ',k+='
      ',k+=tdbFormTaxonomies.render_radios(a,d,0,[]),k+="
      ",k+="
      "),k+="
      ",k=jQuery(k),"dropdown"===f&&k.find("select").select2({dropdownCssClass:"tdb-s-select2 tdb-s-select2-"+a.uid}));setTimeout(function(){l.append(k); tdbFormTaxonomies.manageLimits(a);h.removeClass("tdb-s-content-loading")},200)}})},refreshTerms:function(a,c,b,d,e){var f=a.blockObj.find(".tdb-s-content");f.addClass("tdb-s-content-loading");jQuery.ajax({type:"POST",url:td_ajax_url,data:{action:"tdb_ft_get_terms",_nonce:a._nonce,parentTermID:a.showAllTerms?-1:b,termType:a.termType,orderBy:a.orderBy,order:a.order},success:function(b){var h=jQuery.parseJSON(b);setTimeout(function(){Object.keys(h).length&&("dropdown"===e?(c.find("select option:not(:first-child)").remove(), c.find("select").append(tdbFormTaxonomies.render_dropdown_options(h,0,d))):"checkbox"===e?c.find(".tdb-s-form-checkboxes-wrap").html(tdbFormTaxonomies.render_checkboxes(a,h,0,d)):"radio"===e&&c.find(".tdb-s-form-checkboxes-wrap").html(tdbFormTaxonomies.render_radios(a,h,0,d)));tdbFormTaxonomies.manageLimits(a);f.removeClass("tdb-s-content-loading")},200)}})},render_dropdown_options:function(a,c,b){var d="",e="-".repeat(c);""!==e&&(e+=" ");c++;jQuery.each(a,function(a,h){var f=-1!==jQuery.inArray(h.id.toString(), b);d+='";0';e+='";e+="
      ";0'; f+='";f+="";0=a.parentLimit;m=-1=a.childLimit;a=-1=a.subChildLimit; k&&b.length||m&&d.length||a&&e.length?c.show():c.hide();k?(f.find('input[type="checkbox"]:not(:checked)').prop("disabled",!0),b.show()):(f.find('input[type="checkbox"]:not(:checked)').prop("disabled",!1),b.hide());m?(h.find('input[type="checkbox"]:not(:checked)').prop("disabled",!0),d.show()):(h.find('input[type="checkbox"]:not(:checked)').prop("disabled",!1),d.hide());a?(l.find('input[type="checkbox"]:not(:checked)').prop("disabled",!0),e.show()):(l.find('input[type="checkbox"]:not(:checked)').prop("disabled", !1),e.hide())},deleteItem:function(a){for(var c=0;ca.maxUploadSize?(tdbFormFileUpload.manageNotif(a,!0,"Sorry, the "+a.fileType+" exceeds the maximum upload file size limit."),c.val("")):tdbFormFileUpload.addPreview(a, b)});a.blockObj.on("click",".tdb-s-ffp-remove",function(b){b.preventDefault();tdbFormFileUpload.removePreview(a)});a._is_initialized=!0}},addItem:function(a){if("undefined"===typeof a.uid)throw"item.uid is not defined";tdbFormFileUpload.items.push(a);tdbFormFileUpload._initialize_item(a)},manageNotif:function(a,c,b){b=void 0===b?"":b;a=a.blockObj.find(".tdb-s-notif");c?a.show().text(b):a.hide().text(b)},addPreview:function(a,c){a.blockObj.find(".tdb-s-form");var b=a.blockObj.find(".tdb-s-form-file"); b.addClass("tdb-s-content-loading");setTimeout(function(){switch(a.fileType){case "image":var d=new FileReader;d.onload=function(){b.prepend('
      ')}; d.readAsDataURL(c);break;case "document":b.prepend('
      '+ c.name+'
      '); break;case "audio":var e=new FileReader;e.onload=function(){b.prepend('
      ')}; e.readAsDataURL(c);break;case "video":var f=new FileReader;f.onload=function(){b.prepend('
      ')}; f.readAsDataURL(c)}b.addClass("tdb-s-form-file-previewing");b.removeClass("tdb-s-content-loading")},600)},removePreview:function(a){var c=a.blockObj.find(".tdb-s-form-file"),b=c.find(".tdb-s-form-file-input");c.addClass("tdb-s-content-loading");setTimeout(function(){a.blockObj.attr("data-no-save","false");c.find(".tdb-s-form-file-preview").remove();b.val("");c.removeClass("tdb-s-form-file-previewing");c.removeClass("tdb-s-content-loading")},400)},deleteItem:function(a){for(var c=0;c'+tdbPostsList._stringFromBinary(a.confirmModals.publish.body).replace("%POST_TITLE%",b)+"";e.cancelBtnTxt=window.tdb_modal_cancel_alt;e.confirmBtnTxt=window.tdb_modal_confirm_alt;tdbModal.addItem(e);tdbModal.openModal(e);e.modalObj.on("tdbModal.confirming", function(){e.modalObj.trigger("tdbModal.confirmed")});e.modalObj.on("tdbModal.confirmed",function(){a.blockObj.trigger("postsList.rendering");jQuery.ajax({method:"POST",url:td_ajax_url,data:{action:"tdb_posts_list_update_post_status",_ajax_nonce:a.blockObj.find("#tdb_posts_list_nonce").val(),postID:c,newStatus:d},success:function(b){b=jQuery.parseJSON(b);if(""!==b.success){a.topNotifications.push({message:b.success,type:"success"});var d=a.blockObj.find('.tdb-plist-post[data-post-id="'+c+'"]'),e= d.find(".tdb-plist-publish-post");d.find(".tdb-s-table-col-title .tdb-plist-title-status").remove();e.prev().remove();e.remove()}""!==b.error&&a.topNotifications.push({message:b.error,type:"error"});a.blockObj.trigger("postsList.rendered")}})})},onDeletePost:function(a,c,b){var d=a.blockObj.find(".tdb-block-inner"),e=new tdbModal.item;e.customClasses="tdb-plist-confirm-modal tdb-plist-confirm-modal-"+a.uid;e.title=tdbPostsList._stringFromBinary(a.confirmModals.delete.title);e.body='
      '+ tdbPostsList._stringFromBinary(a.confirmModals.delete.body).replace("%POST_TITLE%",b)+"
      ";e.cancelBtnTxt=window.tdb_modal_cancel_alt;e.confirmBtnTxt=window.tdb_modal_confirm_alt;tdbModal.addItem(e);tdbModal.openModal(e);e.modalObj.on("tdbModal.confirming",function(){e.modalObj.trigger("tdbModal.confirmed")});e.modalObj.on("tdbModal.confirmed",function(){a.blockObj.trigger("postsList.rendering");jQuery.ajax({type:"POST",url:td_ajax_url,data:{action:"tdb_posts_list_delete_post",_ajax_nonce:a.blockObj.find("#tdb_posts_list_nonce").val(), postID:c},success:function(b){b=jQuery.parseJSON(b);""!==b.success&&(a.topNotifications.push({message:b.success,type:"success"}),1===d.find(".tdb-plist-post").length&&a.renderOptions.currentPage--,tdbPostsList.renderPosts(a));""!==b.error&&(a.topNotifications.push({message:b.error,type:"error"}),a.blockObj.trigger("postsList.rendered"))}})})},topNotifications:function(a){var c=a.blockObj.find(".tdb-block-inner"),b=c.find(".tdb-plist-notifs-top");b.length||(c.prepend('
      '), b=c.find(".tdb-plist-notifs-top"));jQuery.each(a.topNotifications,function(a,c){b.prepend('
      '+c.message+"
      ")});a.topNotifications=[];setTimeout(function(){b.remove()},5E3)},_initialize_item:function(a){if(!0!==a._is_initialized){var c=a.blockObj.find(".tdb-block-inner");a.blockObj.on("postsList.rendering",function(){c.hasClass("tdb-s-content-loading")||c.addClass("tdb-s-content-loading")});a.blockObj.on("postsList.rendered", function(){tdbPostsList.topNotifications(a);c.hasClass("tdb-s-content-loading")&&c.removeClass("tdb-s-content-loading")});a.blockObj.on("keydown",".tdb-plist-search .tdb-plist-search-keyword",function(a){13===a.keyCode&&jQuery(this).closest(".tdb-plist-search").find("button").click()});a.blockObj.on("click",".tdb-plist-search button",function(b){b.preventDefault();var c=jQuery(this).closest(".tdb-plist-search");b=c.find(".tdb-plist-search-keyword").val();c=c.find(".tdb-plist-search-in").val();tdbPostsList.onSearch(a, b,c)});a.blockObj.on("click",".tdb-s-table-header th",function(){var b=jQuery(this).data("column");tdbPostsList.onSortByColumn(a,b)});a.blockObj.on("click",".tdb-plist-publish-post",function(b){b.preventDefault();var c=jQuery(this);b=c.data("post-id");c=c.data("post-title");tdbPostsList.onChangePostStatus(a,b,c,"publish")});a.blockObj.on("click",".tdb-plist-delete-post",function(b){b.preventDefault();var c=jQuery(this);b=c.data("post-id");c=c.data("post-title");tdbPostsList.onDeletePost(a,b,c)}); a.blockObj.on("click",".tdb-s-pagination-item",function(b){b.preventDefault();b=jQuery(this).data("page");tdbPostsList.onPagination(a,b)});a._is_initialized=!0}},_stringToBinary:function(a){for(var c=new Uint16Array(a.length),b=0;b

      '+ a.title+'

      '+a.body+'
      ");c=jQuery("#tdb_modal_"+b);a.uid=b;a.modalObj=c},openModal:function(a){if(!a._is_modal_open){var c=jQuery("body");setTimeout(function(){a.modalObj.addClass("tdb-s-modal-open");a._is_modal_open=!0;c.addClass("tdb-s-modal-prevent-scroll");a.modalObj.trigger("tdbModal.open")},1)}},closeModal:function(a){if(a._is_modal_open){var c=jQuery("body");a.modalObj.removeClass("tdb-s-modal-open"); a._is_modal_open=!1;c.removeClass("tdb-s-modal-prevent-scroll");a.modalObj.trigger("tdbModal.close");setTimeout(function(){tdbModal.deleteItem(a.uid)},300)}},_initialize_item:function(a){!0!==a._is_initialized&&(tdbModal.buildModal(a),a.modalObj.on("click",".tdb-s-modal-close, .tdb-s-modal-bg",function(c){c.preventDefault();a.modalObj.trigger("tdbModal.cancel");tdbModal.closeModal(a)}),a.modalObj.on("click",".tdb-s-modal-confirm",function(c){c.preventDefault();a.modalObj.trigger("tdbModal.confirming")}), a.modalObj.on("tdbModal.confirming",function(){var c=a.modalObj.find(".tdb-s-modal-confirm"),b=a.modalObj.find(".tdb-s-modal-cancel");c.addClass("tdb-s-btn-saving");c.prop("disabled",!0);b.prop("disabled",!0)}),a.modalObj.on("tdbModal.confirmingReset",function(){var c=a.modalObj.find(".tdb-s-modal-confirm"),b=a.modalObj.find(".tdb-s-modal-cancel");c.removeClass("tdb-s-btn-saving");c.prop("disabled",!1);b.prop("disabled",!1)}),a.modalObj.on("tdbModal.confirmed",function(){tdbModal.closeModal(a)}), a._is_initialized=!0)},_stringToBinary:function(a){for(var c=new Uint16Array(a.length),b=0;b'+f+""),c=!1)}});if(!c)return!1}return!0}}})();var tdbFilters={}; (function(){tdbFilters={items:[],init:function(){tdbFilters.items=[]},item:function(){this.jqueryObj=this.blockAtts=this.blockUid=void 0;this._is_initialized=this.enabled_on_mobiles=this.inComposer=!1},_initialize_item:function(a){if(!0!==a._is_initialized){if(!0===a.enabled_on_mobiles){a.jqueryObj.closest(".vc_column_container").addClass("tdb-filters-mobile");jQuery("body").addClass("tdb-filters");var c=jQuery(".tdb-filters-button-mobile"),b=c.get(0);b=jQuery._data(b,"events");if(void 0===b||void 0===b.click)c.on("click",function(){jQuery("body").toggleClass("tdb-filters-open")})}else a.jqueryObj.closest(".vc_column_container").removeClass("tdb-filters-mobile"),jQuery("body").removeClass("tdb-filters");!0!==a.inComposer&&(window.onpopstate=function(a){null!==a.state&&window.location.reload()},a.jqueryObj.on("click",".tdb-filters-clear-all",function(a){a.preventDefault();a.stopPropagation();a=new URLSearchParams(window.location.search);var b=window.location.href;a.forEach(function(a,c){-1!==c.indexOf("tdb_")&& (b=tdbFilters.removeQueryParam(b,c))});window.history.pushState({},"",b);window.location.reload()}),a.jqueryObj.on("click",".tdb-filter-item",function(a){var b=jQuery(this),c=b.parents("ul").data("taxonomy"),d=b.data("term-slug");b.data("term-name");b.hasClass("selected")||b.hasClass("tdb-filter-link")?(b.hasClass("selected")&&b.hasClass("tdb-filter-link")&&a.preventDefault(),window.location.href=tdbFilters.removeQueryParamValue(window.location.href,c,d)):-1!==c.indexOf("tdb_")?(a=tdbFilters.removeQueryParam(window.location.href, "tdb-loop-page"),window.location.href=tdbFilters.updateQuery(a,c,d)):console.log("invalid filter: "+c)}),a.jqueryObj.on("select2:select",".tdb-filter-item-dropdown",function(a){var b=jQuery(this),c=b.hasClass("multiple");b=b.data("taxonomy");var d=a.params.data,l="";"undefined"!==typeof d.element?(a=jQuery(d.element).data("term-slug"),l=jQuery(d.element).data("filter-link")):a=d.slug;-1!==b.indexOf("tdb_")?(d=tdbFilters.removeQueryParam(window.location.href,"tdb-loop-page"),window.location.href=c|| ""===l?"undefined"!==typeof a?tdbFilters.updateQuery(d,b,a):d:l):console.log("invalid filter: "+b)}),a.jqueryObj.on("select2:unselect",".tdb-filter-item-dropdown",function(a){var b=jQuery(this).data("taxonomy");a=a.params.data;a="undefined"!==typeof a.element?jQuery(a.element).data("term-slug"):a.slug;if(-1!==b.indexOf("tdb_")){var c=tdbFilters.removeQueryParam(window.location.href,"tdb-loop-page");window.location.href=a?tdbFilters.removeQueryParamValue(c,b,a):c}else console.log("invalid filter: "+ b)}),jQuery(document).on("tdb_filters_remove_filter",function(b,c){b=c.term;a.jqueryObj.find('[data-taxonomy="'+c.tax+'"]').find("li[data-term-slug="+b+"]").removeClass("selected")}),a._is_initialized=!0)}},addItem:function(a){if("undefined"===typeof a.blockUid)throw"item.blockUid is not defined";tdbFilters.items.push(a);tdbFilters._initialize_item(a)},deleteItem:function(a){for(var c=0;c .tdb-surl-review-right").append('
      "),c=d.find(".tdb-surl-review-reply-form"),jQuery("html, body").animate({scrollTop:c.offset().top-c.height()},200)):"cancel"===b&&(c.text(a.replyTxt),c.attr("data-action","reply"),d.find(".tdb-surl-review-reply-form").remove())}),a.blockObj.on("click",".tdb-surl-review-reply-cancel",function(c){var b=jQuery(this);c=b.closest(".tdb-surl-review").find(".tdb-surl-review-leave-reply"); b=b.closest(".tdb-surl-review-reply-form");c.text(a.replyTxt);c.attr("data-action","reply");b.remove()}),a.blockObj.on("click",".tdb-surl-review-reply-submit",function(c){c.preventDefault();var b=jQuery(this),d=b.closest(".tdb-surl-review");c=d.data("review-id");var e=d.find(".tdb-surl-review-leave-reply"),f=b.closest(".tdb-surl-review-reply-form"),h=f.find('[name="content"]'),l=f.find('[name="name"]'),k=f.find('[name="email"]'),m=0;f.find(".tdb-s-fg-error").removeClass(".tdb-s-fg-error");""===h.val()? (h.closest(".tdb-s-form-group").addClass("tdb-s-fg-error"),h.closest(".tdb-s-form-group").append(''+a.requiredTxt+""),m++):(h.closest(".tdb-s-form-group").removeClass("tdb-s-fg-error"),h.closest(".tdb-s-form-group").find(".tdb-s-fg-error-msg").remove());""!==l.val()||l.prop("disabled")?(l.closest(".tdb-s-form-group").removeClass("tdb-s-fg-error"),l.closest(".tdb-s-form-group").find(".tdb-s-fg-error-msg").remove()):(l.closest(".tdb-s-form-group").addClass("tdb-s-fg-error"), l.closest(".tdb-s-form-group").append(''+a.requiredTxt+""),m++);""!==k.val()||k.prop("disabled")?(k.closest(".tdb-s-form-group").removeClass("tdb-s-fg-error"),k.closest(".tdb-s-form-group").find(".tdb-s-fg-error-msg").remove()):(k.closest(".tdb-s-form-group").addClass("tdb-s-fg-error"),k.closest(".tdb-s-form-group").append(''+a.requiredTxt+""),k++);0===m&&(f.addClass("tdb-s-content-disabled"),b.addClass("tdb-s-btn-saving"), jQuery.ajax({type:"POST",url:td_ajax_url,data:{action:"tdb_review_reply_on_submit",_nonce:a._nonce,content:h.val(),name:l.val(),email:k.val(),reviewID:c,userID:a.currentUserID},success:function(c){c=jQuery.parseJSON(c);if(""!==c.reply_id){var k=d.find(".tdb-surl-review-replies"),m="",n=a.currentUserID==a.articleAuthorID,x="";n&&(x="tdb-surl-review-reply-article-author");b.addClass("tdb-s-btn-saved");m+='
      ';m+='
      ';m+="<"+a.titleTag+' class="tdb-surl-review-title" '+(n?'title="Article author"':"")+">";m+=l.val();n&&(m+=a.articleAuthorBadge);m+="";m+='
      '+h.val()+"
      ";0!=a.currentUserID&&(m+='
      ',m+=''+a.deleteTxt+"",m+="
      ");m+="
      ";m+="
      ";setTimeout(function(){k.length?k.append(m):d.find("> .tdb-surl-review-right").append('
      '+ m+"
      ");f.remove();e.text(a.replyTxt);e.attr("data-action","reply")},200)}}}))}),a.blockObj.on("click",".tdb-surl-review-reply-delete",function(c){c.preventDefault();var b=jQuery(this),d=b.closest(".tdb-surl-review:not(.tdb-surl-review-reply)");c=d.data("review-id");var e=b.closest(".tdb-surl-review-reply");b=e.data("review-reply-id");e.addClass("tdb-s-content-disabled");jQuery.ajax({type:"POST",url:td_ajax_url,data:{action:"tdb_review_reply_on_delete",_nonce:a._nonce,reviewID:c,reviewReplyID:b}, success:function(a){jQuery.parseJSON(a).success&&setTimeout(function(){e.remove();var a=d.find(".tdb-surl-review-replies");a.find(".tdb-surl-review-reply").length||a.remove()},200)}})}),a._is_initialized=!0)},addItem:function(a){if("undefined"===typeof a.uid)throw"item.uid is not defined";tdbReviewsList.items.push(a);tdbReviewsList._initialize_item(a)},deleteItem:function(a){for(var c=0;c
      '+a.blank_fields_msg+"
      ");else if(a.formData.append("formElements",JSON.stringify(d)), a.formData.append("enctype","multipart/form-data"),a.formData.append("_nonce",a._nonce),"user"===a.formType)a.formData.append("action","tdb_user_form_on_submit"),tdbCustomForms.userFormAjaxCall(a);else if("post"===a.formType)if(a.formData.append("action","tdb_posts_form_on_submit"),a.formData.append("enablePostCreate",a.enablePostCreate),a.formData.append("postID",a.postID),a.formData.append("authorID",a.currentUserID),a.formData.append("postType",a.postType),a.formData.append("postFormat",a.postFormat), a.formData.append("postStatus",a.postStatus),a.formData.append("linkToPostID",a.linkToPostID),a.formData.append("cfInputEmailList",a.cfInputEmailList),a.formData.append("emailList",a.emailList),a.formData.append("enableEmailSubmit",a.enableEmailSubmit),a.formData.append("sendEmailToAdmin",a.sendEmailToAdmin),a.formData.append("sendEmailToAuthor",a.sendEmailToAuthor),a.formData.append("sendEmailToCustomAddr",a.sendEmailToCustomAddr),a.formData.append("sendEmailToEmailFromField",a.sendEmailToEmailFromField), a.formData.append("emailSubject",a.emailSubject),a.formData.append("tpl_id",a.tpl_id),c=a.blockObj.find("#g-recaptcha"),c.length){var h=c.attr("data-sitekey"),l="";grecaptcha.ready(function(){grecaptcha.execute(h,{action:"submit"}).then(function(b){l=b;a.formData.append("captcha",l);tdbCustomForms.postFormAjaxCall(a)})})}else tdbCustomForms.postFormAjaxCall(a)}),a._is_initialized=!0)},getFormContentElements:function(a){var c=[],b=!1;jQuery(a.formGroupClass+".tdb_form_content").each(function(){var d= jQuery(this),e=d.data("required"),f=d.data("custom-field"),h=d.data("form-type"),l=d.find(".tdb-s-form-group"),k=d.find(".tdb-s-form-label").text().replace(" *",""),m=d.find("textarea");d=d.find(".wp-editor-wrap");var n="";h===a.formType&&(n=d.hasClass("tmce-active")?tinymce.get(m.attr("id")).getContent():m.val(),c.filter(function(a){return a.name===f}).length||(1===e&&""===n?(l.addClass("tdb-s-fg-error"),l.append(''+a.required_field_error+""),b=!0):(e=encodeURIComponent(n).replace(/%([0-9A-F]{2})/g, function(a,b){return String.fromCharCode("0x"+b)}),k={name:f,value:btoa(e),label:k},c.push(k))))});return{elements:c,hasErrors:b}},getFormFileElements:function(a){var c=[],b=!1;jQuery(a.formGroupClass+".tdb_form_file_upload").each(function(){var d=jQuery(this),e=d.data("form-type"),f=d.data("required"),h=d.data("no-save"),l=d.data("custom-field"),k=d.find(".tdb-s-form-group");d=d.find("input");var m=d.val();e===a.formType&&""!==l&&!1===h&&(1===f&&""===m?(k.addClass("tdb-s-fg-error"),k.append(''+ a.required_field_error+""),b=!0):(a.formData.append(l,d.prop("files")[0]),""===m&&c.push(l)))});return{deleteElements:c,hasErrors:b}},getFormACFElements:function(a){var c=[],b="",d=!1;jQuery(a.formGroupClass+".tdb-posts-form-acf-input").each(function(){var e=jQuery(this),f=e.data("form-type"),h=e.data("type"),l=e.data("required"),k=e.data("name"),m=e.find(".tdb-s-form-label").text().replace(" *",""),n=void 0;if(f===a.formType&&!c.filter(function(a){return a.name===k}).length)switch(h){case "text":case "textarea":case "url":case "select":n= e.find(".tdb-s-form-input");var q=n.val();1===l&&""===n.val()?(e.addClass("tdb-s-fg-error"),e.append(''+a.required_field_error+""),d=!0):(m={name:k,value:q,label:m,type:h},"select"===h?(jQuery.isArray(q)?(q.forEach(function(a,b){q[b]={value:a,label:n.find('option[value="'+a+'"]').text()}}),m.type=h+"_multiple"):(q={value:q,label:n.find('option[value="'+q+'"]').text()},"post"===a.formType&&k===a.customPostTitleField&&(b=q)),m.value=q):("textarea"===h&&(m.value= encodeURI(q)),"post"===a.formType&&k===a.customPostTitleField&&(b=q)),c.push(m));break;case "email":f=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;n=e.find(".tdb-s-form-input");1===l&&""===n.val()?(e.addClass("tdb-s-fg-error"),e.append(''+a.required_field_error+""),d=!0):n.val().match(f)||""===n.val()?(h={name:k,value:n.val(),label:m,type:h},c.push(h),"post"===a.formType&&k===a.customPostTitleField&&(b=n.val())):(e.addClass("tdb-s-fg-error"),e.append(''+ a.valid_email_msg+""),d=!0);break;case "number":n=e.find(".tdb-s-form-input");f=n.attr("min");var u=n.attr("max");1===l&&""===n.val()?(e.addClass("tdb-s-fg-error"),e.append(''+a.required_field_error+""),d=!0):n.val()'+a.lower_msg+f+"."),d=!0):n.val()>u&&""!==n.val()?(e.addClass("tdb-s-fg-error"),e.append(''+a.higher_msg+u+ "."),d=!0):(h={name:k,value:n.val(),label:m,type:h},c.push(h),"post"===a.formType&&k===a.customPostTitleField&&(b=n.val()));break;case "checkbox":if(1!==l||e.find("input:checked").length){var v=[];e.find("input:checked").each(function(){var a=jQuery(this);v.push({value:a.val(),label:a.siblings(".tdb-fi-check-label").text()})});c.push({name:k,value:v,label:m,type:h})}else e.addClass("tdb-s-fg-error"),e.append(''+a.required_field_error+""),d=!0;break;case "radio":case "button_group":1!==l||e.find("input:checked").length?(e=e.find("input:checked"),l={value:e.val(),label:e.siblings(".tdb-fi-check-label").text()},c.push({name:k,value:l,label:m,type:h}),"post"===a.formType&&k===a.customPostTitleField&&(b=e.siblings(".tdb-fi-check-label").text())):(e.addClass("tdb-s-fg-error"),e.append(''+a.required_field_error+""),d=!0)}});return{elements:c,postTitle:b,hasErrors:d}},getFormTaxonomyElements:function(a){var c=[],b=!1;jQuery(a.formGroupClass+".tdb_form_taxonomies").each(function(){var d= jQuery(this),e=d.data("tax-type"),f=d.data("required"),h=d.find('[data-term-hierarchy="parent"]'),l=h.data("display");d=d.find('[data-term-hierarchy="child"], [data-term-hierarchy="sub-child"]');var k=[];c.filter(function(a){return a.taxType===e}).length||("dropdown"===l?(l=h.find("select"),1===f&&""===l.val()?(h.addClass("tdb-s-fg-error"),h.append(''+a.required_field_error+""),b=!0):""!==l.val()&&k.push(parseInt(l.val()))):(l=h.find("input:checked"),1!==f|| l.length?l.each(function(){k.push(parseInt(jQuery(this).val()))}):(h.addClass("tdb-s-fg-error"),h.append(''+a.required_field_error+""),b=!0)),d.each(function(){var a=jQuery(this);"dropdown"===a.data("display")?(a=a.find("select"),""!==a.val()&&k.push(parseInt(a.val()))):a.find("input:checked").each(function(){k.push(parseInt(jQuery(this).val()))})}),k.length&&c.push({terms:k,taxType:e}))});return{elements:c,hasErrors:b}},getFormLocationElement:function(a){var c= jQuery(a.formGroupClass+".tdb_location_finder").first(),b={},d=!1;if(c.length){var e=c.data("tax-type"),f=c.data("required"),h=c.find(".tdb-s-form-group-lf-search input"),l=h.closest(".tdb-s-form-group"),k=c.find(".tdb-s-form-group-lf-address input"),m=c.find(".tdb-s-form-group-lf-postal-code input"),n=c.find(".tdb-s-form-group-lf-city input"),q=c.find(".tdb-s-form-group-lf-state input");c=c.find(".tdb-s-form-group-lf-country input");1===f&&""===h.val()?(l.addClass("tdb-s-fg-error"),l.append(''+ a.required_field_error+""),d=!0):""!==n.val()&&""!==q.val()&&""!==c.val()&&(b={address:k.val(),postalCode:m.val(),city:n.val(),state:q.val(),country:c.val(),taxType:e})}return{element:b,hasErrors:d}},getFormTitleElement:function(a){var c=jQuery(a.formGroupClass+".tdb_form_title input").first(),b="",d=!1;if(c.length){c=c.first();var e=c.closest(".tdb-s-form-group");""===c.val()?(e.addClass("tdb-s-fg-error"),e.append(''+a.required_field_error+""),d=!0): b=c.val()}return{postTitle:b,hasErrors:d}},getLinkToPostElement:function(a){var c=jQuery(a.formGroupClass+".tdb_form_link_post").first(),b="",d=!1;if(c.length){var e=c.find("select"),f=c.find(".tdb-s-form-group");1===c.data("required")&&""===e.val()?(f.addClass("tdb-s-fg-error"),f.append(''+a.required_field_error+""),d=!0):b=e.val()}return{linkToPostID:b,hasErrors:d}},userFormAjaxCall:function(a){var c=a.blockObj.find(".tdb-s-form"),b=jQuery(a.formGroupClass+ ".tdb-s-form-group"),d=a.blockObj.find(".tdb-s-btn");b.addClass("tdb-s-content-disabled");c.addClass("tdb-s-content-disabled");d.addClass("tdb-s-btn-saving");jQuery.ajax({method:"POST",url:td_ajax_url,data:a.formData,contentType:!1,processData:!1,success:function(e){e=jQuery.parseJSON(e);""!==e.success&&c.prepend('
      '+e.success+"
      ");if(e.errors.length){var f='
      '; f+='
        ';jQuery.each(e.errors,function(a,b){f+="
      • "+b+"
      • "});f+="
      ";f+="
      ";c.prepend(f)}d.addClass("tdb-s-btn-saved");c.removeClass("tdb-s-content-disabled");setTimeout(function(){b.removeClass("tdb-s-content-disabled");d.removeClass("tdb-s-btn-saving").removeClass("tdb-s-btn-saved");setTimeout(function(){a.blockObj.find(".tdb-s-notif-success").remove();a.blockObj.find(".tdb-s-notif-error").remove()},4E3)},200)}})},postFormAjaxCall:function(a){var c=a.blockObj.find(".tdb-s-form"), b=jQuery(a.formGroupClass+".tdb-s-form-group"),d=a.blockObj.find(".tdb-s-btn");b.addClass("tdb-s-content-disabled");c.addClass("tdb-s-content-disabled");d.addClass("tdb-s-btn-saving");jQuery.ajax({method:"POST",url:td_ajax_url,data:a.formData,contentType:!1,processData:!1,success:function(e){e=jQuery.parseJSON(e);if(""!==a.successURL&&""!==e.success.create_post&&""===a.postID)window.location.replace(a.successURL);else{if(""!==e.success.create_post||""!==e.success.email){var f='
        '; ""!==e.success.create_post&&(f+="
      • "+e.success.create_post+"
      • ");""!==e.success.email&&(f+="
      • "+e.success.email+"
      • ");c.prepend(f+"
      ")}if(""!==e.errors.create_post||""!==e.errors.email||""!==e.errors.permission)f='
        ',""!==e.errors.create_post&&(f+="
      • "+e.errors.create_post+"
      • "),""!==e.errors.email&&(f+="
      • "+e.errors.email+"
      • "),""!==e.errors.permission&&(f+="
      • "+e.errors.permission+ "
      • "),c.prepend(f+"
      ");d.addClass("tdb-s-btn-saved");c.removeClass("tdb-s-content-disabled");""!==e.success.create_post&&""===a.postID?setTimeout(function(){window.location.replace(window.location.pathname+window.location.search+window.location.hash)},1E3):setTimeout(function(){b.removeClass("tdb-s-content-disabled");d.removeClass("tdb-s-btn-saving").removeClass("tdb-s-btn-saved");setTimeout(function(){a.blockObj.find(".tdb-s-notif-success").remove();a.blockObj.find(".tdb-s-notif-error").remove()}, 4E3)},200)}}})},addItem:function(a){if("undefined"===typeof a.uid)throw"item.uid is not defined";tdbCustomForms.items.push(a);tdbCustomForms._initialize_item(a)},deleteItem:function(a){for(var c=0;c