jQuery(document).ready(function(e){"use strict";function t(){var e=jQuery("#customize-preview iframe").contents().find("#mya_data").attr("data-page"),t=jQuery("#customize-preview iframe").contents().find("#mya_data").attr("data-id");setDefaultForLoadingScreen(),jQuery.ajax({type:"POST",dataType:"json",url:makeAnimationajax.ajaxurl,data:{action:"galoover_ae_get_loading_page_data_this_page",page:e,id:t},success:function(e,t,a){setValueForLoadingScreen(e.data)},error:function(e,t,a){}})}function a(){var e=jQuery("#customize-preview iframe").contents().find("#mya_data").attr("data-page-template"),t=jQuery("#customize-preview iframe").contents().find("#mya_data").attr("data-page"),a=jQuery("#customize-preview iframe").contents().find("#mya_data").attr("data-template-name"),r=jQuery("#customize-preview iframe").contents().find("#mya_data").attr("data-id");return""!=a&&void jQuery.ajax({type:"POST",dataType:"json",url:makeAnimationajax.ajaxurl,data:{action:"galoover_ae_get_animation_list",template:e,page:t,theme:a,id:r},success:function(e,t,a){var r=e.data;if(jQuery(".animations-manager ul li").remove(),jQuery("#animation_active_list .animation-box-view").remove(),!r)return jQuery("#manager-button .count").text("0"),!1;var o=r.length;K=[],jQuery("#manager-button .count").text(o);var s=jQuery("#customize-preview iframe").contents().find("body"),s=s[0];jQuery.each(r,function(e,t){var a=m(t.post_excerpt),r=jQuery("#customize-preview iframe").contents().find(a),r=r[0];if(r){var l=getFullPathFromElement(r,s);K.push(l),jQuery(".animations-manager ul").append("
  • '+t.post_title+'
  • '),addBoxView(t.ID,l)}else jQuery(".animations-manager ul").append("
  • '+t.post_title+'
  • ');o==e+1&&(jQuery(".animations-manager li").click(function(e){var t=jQuery(this).attr("data-id"),a=jQuery(this).attr("data-path");if(jQuery(e.target).hasClass("dashicons"))confirm("This animation will be devared.")&&n(t,a);else{V=[],V.push(a),B=a,N=t,jQuery(".animations-manager li").removeClass("active"),jQuery(this).addClass("active");var r=jQuery(this).children(".name").text();showEditStatus(),i(t,r)}}),jQuery("#animation_active_list .view-animation").click(function(){jQuery("#animation_active_list .view-animation").css({display:"block"});var e=jQuery("#display_rules_page").innerHeight();jQuery("#customize-footer-actions").css({bottom:e+"px"}),jQuery(this).css({display:"none"});var t=jQuery(this).parent().parent(),a=jQuery(t).attr("data-animation-id"),r=jQuery(".animations-manager ul").find("[data-id='"+a+"']"),r=r[0],o=jQuery(r).children(".name").text();jQuery(".animations-manager li").removeClass("active"),jQuery(r).addClass("active"),N=a,B=jQuery(t).attr("data-element"),V=[],V.push(B),jQuery("#layout-iframe").css({"z-index":"-1"}),jQuery("#layout-iframe-1").css({"z-index":"1"}),jQuery("#display_rules_page").is(":visible")||jQuery("#display_rules_page").fadeToggle("fast","linear"),showEditStatus(),i(a,o),jQuery("#animation_active_list .mya-block-active").removeClass("mya-show"),jQuery(".mya-block-hover").removeClass("mya-show"),jQuery(".tool-box").removeClass("mya-show").css({display:"none"}),jQuery(".tool-box").css({display:"none"}),jQuery(".dissable-event").css({"z-index":"-1"}),jQuery("#choose-another-element").css({display:"block"})}))})},error:function(e,t,a){}})}function i(e,t){e&&(jQuery("#loading").addClass("loading-show"),jQuery.ajax({type:"POST",dataType:"json",url:makeAnimationajax.ajaxurl,data:{action:"galoover_ae_get_animation_data",id:e},success:function(e,a,i){if(jQuery("#loading").removeClass("loading-show"),e){jQuery("input[name=animation_name]").val(t);var r=e.data,o=r.pageValue,r=r.animationList;jQuery(".nav-tabs .have-effect").css({display:"none"}),setDefaultToAllValue(),jQuery("select[name=animation_page] option[value="+o+"]").attr("selected","selected"),jQuery("#animation_element_choosed .mya-block-active").removeClass("mya-show"),jQuery(".mya-block-hover-active").removeClass("mya-show"),jQuery(".mya-block-click-active").removeClass("mya-show"),jQuery(".nav-tabs li a").removeClass("active"),jQuery(".nav-tabs li:first-child a").addClass("active"),jQuery(".tab-content div").removeClass("active"),jQuery(".tab-content div:first-child").addClass("active"),jQuery.each(r,function(e,t){var a=t.meta_value,i=a.firstData;switch(t.meta_key){case"load_effect":k(!0),jQuery("#animation_element_choosed .mya-block-active").addClass("mya-show"),jQuery(".nav-tabs .load-effect").css({display:"inline-block"}),jQuery("select[name=first-effect] option[value="+i.name+"]").attr("selected","selected");var r=returnTimingName(i.timing);if(jQuery("select[name=timing_first_effect] option:contains("+r+")").each(function(){return jQuery(this).text()!=r||(jQuery(this).attr("selected","selected"),!1)}),jQuery("input[name=time_load]").val(i.time),jQuery("input#time_load").attr("data-slider-value",i.time),jQuery("input[name=time_load_delay]").val(i.delay),jQuery("input#time_load_delay").attr("data-slider-value",i.delay),a.hasOwnProperty("seconData")){var o=a.seconData;jQuery("select[name=secon_effect] option[value="+o.name+"]").attr("selected","selected");var n=returnTimingName(o.timing);jQuery("select[name=timing_secon_effect] option:contains("+n+")").each(function(){return jQuery(this).text()!=n||(jQuery(this).attr("selected","selected"),!1)}),jQuery("input[name=time_secon_effect]").val(o.time),jQuery("input#time_secon_effect").attr("data-slider-value",o.time),jQuery("input[name=time_delay_secon_effect]").val(o.delay),jQuery("input#time_delay_secon_effect").attr("data-slider-value",o.delay)}jQuery("input[name=repeat-load_effect]").val(a.repeat),jQuery("input#repeat-load_effect").attr("data-slider-value",a.repeat),jQuery("input[name=repeat_delay-load_effect]").val(a.repeatDelay),jQuery("input#repeat_delay-load_effect").attr("data-slider-value",a.repeatDelay),jQuery("select[name=start_load_effect] option[value="+a.start+"]").attr("selected","selected"),jQuery("select[name=min_screen_load_effect] option[value="+a.minScreen+"]").attr("selected","selected"),jQuery("select[name=max_screen_load_effect] option[value="+a.maxScreen+"]").attr("selected","selected");break;case"hover_effect":H=a.eleTaget,F=[],F.push(H),jQuery("#animation_element_choosed .mya-block-active").addClass("mya-show"),k(!0),C(),jQuery(".nav-tabs .hover-effect").css({display:"inline-block"}),jQuery("select[name=first-hover_effect] option[value="+i.name+"]").attr("selected","selected");var r=returnTimingName(i.timing);if(jQuery("select[name=timing_first_hover_effect] option:contains("+r+")").each(function(){return jQuery(this).text()!=r||(jQuery(this).attr("selected","selected"),!1)}),jQuery("input[name=time_hover]").val(i.time),jQuery("input#time_hover").attr("data-slider-value",i.time),jQuery("input[name=time_hover_delay]").val(i.delay),jQuery("input#time_hover_delay").attr("data-slider-value",i.delay),a.hasOwnProperty("seconData")){var o=a.seconData;jQuery("select[name=secon_hover_effect] option[value="+o.name+"]").attr("selected","selected");var n=returnTimingName(o.timing);jQuery("select[name=timing_secon_hover_effect] option:contains("+n+")").each(function(){return jQuery(this).text()!=n||(jQuery(this).attr("selected","selected"),!1)}),jQuery("input[name=time_secon_hover_effect]").val(o.time),jQuery("input#time_secon_hover_effect").attr("data-slider-value",o.time),jQuery("input[name=time_delay_secon_hover_effect]").val(o.delay),jQuery("input#time_delay_secon_hover_effect").attr("data-slider-value",o.delay)}jQuery("input[name=repeat-hover_effect]").val(a.repeat),jQuery("input#repeat-hover_effect").attr("data-slider-value",a.repeat),jQuery("input[name=repeat_delay-hover_effect]").val(a.repeatDelay),jQuery("input#repeat_delay-hover_effect").attr("data-slider-value",a.repeatDelay),jQuery("select[name=min_screen_hover_effect] option[value="+a.minScreen+"]").attr("selected","selected"),jQuery("select[name=max_screen_hover_effect] option[value="+a.maxScreen+"]").attr("selected","selected"),H!==B&&(jQuery(".hover-on-itself").css({display:"none"}),jQuery(".hover-another-element").css({display:"inline-block"}));break;case"click_effect":L=a.eleTaget,G=[],G.push(L),jQuery("#animation_element_choosed .mya-block-active").addClass("mya-show"),k(!0),z(),jQuery(".nav-tabs .click-effect").css({display:"inline-block"}),jQuery("select[name=first-click_effect] option[value="+i.name+"]").attr("selected","selected");var r=returnTimingName(i.timing);if(jQuery("select[name=timing_first_click_effect] option:contains("+r+")").each(function(){return jQuery(this).text()!=r||(jQuery(this).attr("selected","selected"),!1)}),jQuery("input[name=time_hover]").val(i.time),jQuery("input#time_hover").attr("data-slider-value",i.time),jQuery("input[name=time_hover_delay]").val(i.delay),jQuery("input#time_hover_delay").attr("data-slider-value",i.delay),a.hasOwnProperty("seconData")){var o=a.seconData;jQuery("select[name=secon_click_effect] option[value="+o.name+"]").attr("selected","selected");var n=returnTimingName(o.timing);jQuery("select[name=timing_secon_click_effect] option:contains("+n+")").each(function(){return jQuery(this).text()!=n||(jQuery(this).attr("selected","selected"),!1)}),jQuery("input[name=time_secon_click_effect]").val(o.time),jQuery("input#time_secon_click_effect").attr("data-slider-value",o.time),jQuery("input[name=time_delay_secon_click_effect]").val(o.delay),jQuery("input#time_delay_secon_click_effect").attr("data-slider-value",o.delay)}jQuery("input[name=repeat-click_effect]").val(a.repeat),jQuery("input#repeat-click_effect").attr("data-slider-value",a.repeat),jQuery("input[name=repeat_delay-click_effect]").val(a.repeatDelay),jQuery("input#repeat_delay-click_effect").attr("data-slider-value",a.repeatDelay),jQuery("select[name=min_screen_click_effect] option[value="+a.minScreen+"]").attr("selected","selected"),jQuery("select[name=max_screen_click_effect] option[value="+a.maxScreen+"]").attr("selected","selected"),L!==B&&(jQuery(".click-on-itself").css({display:"none"}),jQuery(".click-another-element").css({display:"inline-block"}))}})}},error:function(e,t,a){}}))}function r(){jQuery("#animation_active_list .animation-box-view .view-animation").css({display:"block"}),jQuery("#animation_active_list .animation-box-view").each(function(){var e=jQuery(this).attr("data-element"),t=m(e),a=jQuery("#customize-preview iframe").contents().find(t);jQuery.inArray(e,K)!==-1&&o(this,a)})}function o(e,t){if(e&&t){var a=jQuery(t).innerWidth(),i=jQuery(t).innerHeight(),r=jQuery(t).offset(),o=jQuery("#customize-preview iframe").contents().find("html"),n=jQuery(o).scrollTop();jQuery(e).children(".active-top").css({width:a+1+"px",height:"2px",top:r.top-n+"px",left:r.left+"px"}).addClass("mya-show"),jQuery(e).children(".active-right").css({width:"2px",height:i+"px",top:r.top-n+"px",left:r.left+a+"px"}).addClass("mya-show"),jQuery(e).children(".active-bottom").css({width:a+1+"px",height:"2px",top:r.top-n+i+1+"px",left:r.left+"px"}).addClass("mya-show"),jQuery(e).children(".active-left").css({width:"2px",height:i+"px",top:r.top-n+"px",left:r.left+"px"}).addClass("mya-show")}}function n(e,t){e&&(jQuery("#loading").addClass("loading-show"),jQuery.ajax({type:"POST",dataType:"json",url:makeAnimationajax.ajaxurl,data:{action:"galoover_ae_remove_animation",id:e},success:function(a,i,r){jQuery("#loading").removeClass("loading-show"),e==N&&(N="");var o=jQuery("#manager-button .count").text(),n=+o-1;if(jQuery("#manager-button .count").text(n),jQuery(".animations-manager ul").find("[data-id='"+e+"']").fadeOut("slow"),jQuery("#animation_active_list").find("[data-animation-id='"+e+"']").empty(),t){var s=K.indexOf(t);s!==-1&&K.splice(s,1)}showMessage("success",a.data)},error:function(e,t,a){}}))}function s(e,t){jQuery(".animations-manager li").removeClass("active"),jQuery(".animations-manager ul").append("
  • '+t+'
  • ').fadeIn("slow"),jQuery(".animations-manager ul").find("[data-id='"+e+"']").click(function(e){var t=jQuery(this).attr("data-id"),a=jQuery(this).attr("data-path");if(jQuery(e.target).hasClass("dashicons"))confirm("This animation will be devared.")&&n(t,B);else{V=[],V.push(a),B=a,N=t,jQuery(".animations-manager li").removeClass("active"),jQuery(this).addClass("active");var r=jQuery(this).children(".name").text();showEditStatus(),i(t,r)}})}function l(e){for(var t=[],a=0,i=e.length;a0&&i.forEach(function(e){if(jQuery.inArray(e.tagName,["SCRIPT","STYLE"])===-1){var i=getComputedStyle(e).display;if("none"===i)return;var r=jQuery(e).innerWidth(),o=jQuery(e).innerHeight();if(0!==r&&0!==o){var n=jQuery(e).offset(),s=getFullPathFromElement(e,a),l=[n.top,n.left,n.top+o,n.left+r],y={};y[s]=l,u(t,y)}c(e,t,a)}},this),t}function u(e,t){if(t)for(var a in t)if(t.hasOwnProperty(a))for(var i=t[a],r=i[0],o=i[2],n=Math.floor(r/1e3),s=Math.floor(o/1e3),l=n;l<=s;l++)"undefined"==typeof e[l]&&(e[l]=[]),e[l].push(t)}function y(e,t){if(t){var a=t.top,i=Math.floor(a/1e3),r=e[i],o=jQuery.map(r,function(e){for(var a in e)if(e.hasOwnProperty(a)){var i=e[a],r=i[0],o=i[1],n=i[2],s=i[3];if(r<=t.top&&t.top<=n&&o<=t.left&&t.left<=s)return e}},this);return o}return"can get mouse'position"}function d(e){if(e){var t=e.length;if(t>1){for(var a=[],i={},r=0;r"),e.toLowerCase()}}function f(e,t){var a=jQuery(e).innerWidth(),i=jQuery(e).innerHeight(),r=jQuery(e).offset(),o=r.top,n=o+i,s=r.left,l=s+a;return o<=t.top&&t.top<=n&&s<=t.left&&t.left<=l}function p(e,t,a){var i=jQuery(e).css("overflow");if("scroll"==i||"hidden"==i||"auto"==i)return!1;var r=(jQuery(e).innerWidth(),jQuery(e).innerHeight()),o=jQuery(e).offset(),n=o.top,s=n+r;o.left;if(n<=t.top&&t.top<=s){var l=jQuery(e).css("overflow-x");if("scroll"==l||"hidden"==l||"auto"==l)return!1}else{var c=jQuery(e).css("overflow-y");if("scroll"==c||"hidden"==c||"auto"==c)return!1}return!0}function j(e,t,a){var i,r;for(var o in e)i=o;r=i.replace(t,"");var n=r.split("/");t+="/"+n[1],n.splice(0,2);for(var s,l=t,c=0,u=n.length;cm){y=e;var f=j(y,l,a);f===!1&&(y=t)}else{y=t;var f=j(y,l,a);f===!1&&(y=e)}return y}l+="/"+n[c]}}function Q(e,t){if("undefined"!=typeof e){if(jQuery(e).length>1){for(var a=e[0],i=1,r=e.length;i32?(jQuery(".click-tool-box").css({top:s.top-t-43+"px",left:s.left+"px"}).addClass("mya-show"),jQuery(".mya-toolbox-arrow").removeClass("top").addClass("bottom")):(jQuery(".click-tool-box").css({top:s.top-t+n+7+"px",left:s.left+"px"}).addClass("mya-show"),jQuery(".mya-toolbox-arrow").removeClass("bottom").addClass("top"))}}function x(e,t){if(e){var a=e[e.length-1],i=m(a),r=jQuery("#customize-preview iframe").contents().find(i),o=jQuery(r).innerWidth(),n=jQuery(r).innerHeight(),s=jQuery(r).offset();jQuery(".mya-block-hover").removeClass("mya-show"),jQuery(".active-hover-top").css({width:o+1+"px",height:"2px",top:s.top-t+"px",left:s.left+"px"}).addClass("mya-show"),jQuery(".active-hover-right").css({width:"2px",height:n+"px",top:s.top-t+"px",left:s.left+o+"px"}).addClass("mya-show"),jQuery(".active-hover-bottom").css({width:o+1+"px",height:"2px",top:s.top-t+n+1+"px",left:s.left+"px"}).addClass("mya-show"),jQuery(".active-hover-left").css({width:"2px",height:n+"px",top:s.top-t+"px",left:s.left+"px"}).addClass("mya-show"),s.top-t-43>32?(jQuery(".hover-tool-box").css({top:s.top-t-43+"px",left:s.left+"px"}).addClass("mya-show"),jQuery(".mya-toolbox-arrow").removeClass("top").addClass("bottom")):(jQuery(".hover-tool-box").css({top:s.top-t+n+7+"px",left:s.left+"px"}).addClass("mya-show"),jQuery(".mya-toolbox-arrow").removeClass("bottom").addClass("top"))}}function w(e,t){if(e){if(!t){var a=jQuery("#customize-preview iframe").contents().find("html"),i=a[0];t=jQuery(i).scrollTop()}jQuery.each(e,function(e,a){var i=m(a),r=jQuery("#customize-preview iframe").contents().find(i);if(r){var o=jQuery(r).innerWidth(),n=jQuery(r).innerHeight(),s=jQuery(r).offset(),l=jQuery("#animation_active_list").find("[data-element='"+a+"']"),l=l[0];jQuery(l).children(".active-top").css({width:o+1+"px",height:"2px",top:s.top-t+"px",left:s.left+"px"}),jQuery(l).children(".active-right").css({width:"2px",height:n+"px",top:s.top-t+"px",left:s.left+o+"px"}),jQuery(l).children(".active-bottom").css({width:o+1+"px",height:"2px",top:s.top-t+n+1+"px",left:s.left+"px"}),jQuery(l).children(".active-left").css({width:"2px",height:n+"px",top:s.top-t+"px",left:s.left+"px"})}})}}function b(e){B=V[V.length-1],B&&k(!1,e),H=F[F.length-1],H&&C(!1,e),L=G[G.length-1],L&&z(!1,e)}function k(e,t){if(!t)if(document.documentMode||/Edge/.test(navigator.userAgent))t=jQuery(document.getElementById("idIframe").contentWindow).scrollTop();else{var a=jQuery("#customize-preview iframe").contents().find("html"),i=a[0];t=jQuery(i).scrollTop()}var r=m(B),o=jQuery("#customize-preview iframe").contents().find(r);if(o[0]){jQuery(o).is(":visible")||jQuery(o).show("fast","linear");var n=jQuery(o).css("opacity");"0"===n&&jQuery(o).css({opacity:"1"});var s=jQuery(o).css("visibility");"hidden"===s&&jQuery(o).css({visibility:"visible"});var l=jQuery(o).innerWidth(),c=jQuery(o).innerHeight(),u=jQuery(o).offset();e&&jQuery("#customize-preview").animate({scrollTop:+u.top-64},"slow"),jQuery("#animation_element_choosed .active-top").css({width:l+1+"px",height:"2px",top:u.top-t+"px",left:u.left+"px"}),jQuery("#animation_element_choosed .active-right").css({width:"2px",height:c+"px",top:u.top-t+"px",left:u.left+l+"px"}),jQuery("#animation_element_choosed .active-bottom").css({width:l+1+"px",height:"2px",top:u.top-t+c+1+"px",left:u.left+"px"}),jQuery("#animation_element_choosed .active-left").css({width:"2px",height:c+"px",top:u.top-t+"px",left:u.left+"px"}),u.top-t-43>32?(jQuery(".tool-box").css({top:u.top-t-43+"px",left:u.left+"px"}),jQuery(".mya-toolbox-arrow").removeClass("top").addClass("bottom")):(jQuery(".tool-box").css({top:u.top-t+c+7+"px",left:u.left+"px"}),jQuery(".mya-toolbox-arrow").removeClass("bottom").addClass("top"))}}function C(e){if(H===B)return jQuery(".mya-block-hover-active").removeClass("mya-show"),!1;if(!e)if(document.documentMode||/Edge/.test(navigator.userAgent))e=jQuery(document.getElementById("idIframe").contentWindow).scrollTop();else{var t=jQuery("#customize-preview iframe").contents().find("html"),a=t[0];e=jQuery(a).scrollTop()}var i=m(H),r=jQuery("#customize-preview iframe").contents().find(i);if(r[0]){var o=jQuery(r).innerWidth(),n=jQuery(r).innerHeight(),s=jQuery(r).offset();jQuery(".active-hover-top").css({width:o+1+"px",height:"2px",top:s.top-e+"px",left:s.left+"px"}),jQuery(".active-hover-right").css({width:"2px",height:n+"px",top:s.top-e+"px",left:s.left+o+"px"}),jQuery(".active-hover-bottom").css({width:o+1+"px",height:"2px",top:s.top-e+n+1+"px",left:s.left+"px"}),jQuery(".active-hover-left").css({width:"2px",height:n+"px",top:s.top-e+"px",left:s.left+"px"}),s.top-e-43>32?(jQuery(".hover-tool-box").css({top:s.top-e-43+"px",left:s.left+"px"}),jQuery(".mya-toolbox-arrow").removeClass("top").addClass("bottom")):(jQuery(".hover-tool-box").css({top:s.top-e+n+7+"px",left:s.left+"px"}),jQuery(".mya-toolbox-arrow").removeClass("bottom").addClass("top"))}}function z(e){if(L===B)return jQuery(".mya-block-click-active").removeClass("mya-show"),!1;if(!e)if(document.documentMode||/Edge/.test(navigator.userAgent))e=jQuery(document.getElementById("idIframe").contentWindow).scrollTop();else{var t=jQuery("#customize-preview iframe").contents().find("html"),a=t[0];e=jQuery(a).scrollTop()}var i=m(L),r=jQuery("#customize-preview iframe").contents().find(i);if(r[0]){var o=jQuery(r).innerWidth(),n=jQuery(r).innerHeight(),s=jQuery(r).offset();jQuery(".active-click-top").css({width:o+1+"px",height:"2px",top:s.top-e+"px",left:s.left+"px"}),jQuery(".active-click-right").css({width:"2px",height:n+"px",top:s.top-e+"px",left:s.left+o+"px"}),jQuery(".active-click-bottom").css({width:o+1+"px",height:"2px",top:s.top-e+n+1+"px",left:s.left+"px"}),jQuery(".active-click-left").css({width:"2px",height:n+"px",top:s.top-e+"px",left:s.left+"px"}),s.top-e-43>32?(jQuery(".click-tool-box").css({top:s.top-e-43+"px",left:s.left+"px"}),jQuery(".mya-toolbox-arrow").removeClass("top").addClass("bottom")):(jQuery(".click-tool-box").css({top:s.top-e+n+7+"px",left:s.left+"px"}),jQuery(".mya-toolbox-arrow").removeClass("bottom").addClass("top"))}}function T(e,t){if(e){var a=e[e.length-1],i=m(a),r=jQuery("#customize-preview iframe").contents().find(i),o=jQuery(r).innerWidth(),n=jQuery(r).innerHeight(),s=jQuery(r).offset();if(!t)if(document.documentMode||/Edge/.test(navigator.userAgent))t=jQuery(document.getElementById("idIframe").contentWindow).scrollTop();else{var l=jQuery("#customize-preview iframe").contents().find("html"),c=l[0];t=jQuery(c).scrollTop()}jQuery(".mya-block-hover").removeClass("mya-show"),jQuery("#animation_element_choosed .active-top").css({width:o+1+"px",height:"2px",top:s.top-t+"px",left:s.left+"px"}).addClass("mya-show"),jQuery("#animation_element_choosed .active-right").css({width:"2px",height:n+"px",top:s.top-t+"px",left:s.left+o+"px"}).addClass("mya-show"),jQuery("#animation_element_choosed .active-bottom").css({width:o+1+"px",height:"2px",top:s.top-t+n+1+"px",left:s.left+"px"}).addClass("mya-show"),jQuery("#animation_element_choosed .active-left").css({width:"2px",height:n+"px",top:s.top-t+"px",left:s.left+"px"}).addClass("mya-show"),s.top-t-43>32?(jQuery(".tool-box").css({top:s.top-t-43+"px",left:s.left+"px"}).addClass("mya-show"),jQuery(".mya-toolbox-arrow").removeClass("top").addClass("bottom")):(jQuery(".tool-box").css({top:s.top-t+n+7+"px",left:s.left+"px"}).addClass("mya-show"),jQuery(".mya-toolbox-arrow").removeClass("bottom").addClass("top"))}}function D(e){if(e){var t=e.lastIndexOf("/"),a=e.slice(0,t);return a}}function S(e){B=e[e.length-1];var t=D(B);return"/HTML"!==t&&e.push(t),e}function E(e){return e.length>1&&e.pop(),e}function I(){var e=jQuery("#customize-preview iframe").contents().find("body"),e=e[0];if(jQuery("#layout-iframe").attr("data-action","animation"),jQuery("#choose-another-element").css("display","none"),N="",jQuery("#start-button").hasClass("active")){V=[],jQuery("#customize-footer-actions .devices, #collapse-sidebar-button, .loading-page-setting").fadeToggle("fast","linear"),jQuery("#customize-footer-actions .show-all-hide").fadeToggle("fast","linear"),jQuery("#start-button").removeClass("active"),jQuery(".mya-base").removeClass("mya-show"),jQuery("#display_rules_page").is(":visible")&&jQuery("#display_rules_page").fadeToggle("fast","linear"),jQuery("#customize-footer-actions").css({bottom:"0"}),jQuery("#layout-iframe").css({"z-index":"-1"}),jQuery("#layout-iframe-1").css({"z-index":"-1"}),e.parentNode.replaceChild(q,e);var t=jQuery("#customize-preview iframe").contents().find("html");jQuery(t).scrollTop(0),jQuery("#customize-preview").scrollTop(0);var a=document.getElementById("idIframe");jQuery(a).css({top:"0"})}else{fixSizeOfIframe(),r(),showAddStatus(),jQuery("#customize-footer-actions .devices, #collapse-sidebar-button, .loading-page-setting").fadeToggle("fast","linear"),jQuery("#customize-footer-actions .show-all-hide").fadeToggle("fast","linear"),jQuery("#start-button").addClass("active"),jQuery("#layout-iframe").css({"z-index":"1"});var t=jQuery("#customize-preview iframe").contents().find("html"),i=jQuery(t).scrollTop();jQuery("#customize-preview").scrollTop(i),jQuery(t).scrollTop(i);var o=[],n=jQuery("#customize-preview iframe").contents().find("body");e=q=n[0],Y=c(e,o,e);var s=e.cloneNode(!0);e.parentNode.replaceChild(s,e)}}function P(e){if(e){var t=jQuery("#layout-iframe").attr("data-action");t&&(X=t);for(var a in e)switch(X){case"animation":var i;if(jQuery.each(K,function(e,t){a===t&&(i=!1)}),i===!1)return!1}return!0}}function A(){jQuery("#display_loading_page_setting").is(":visible")||jQuery("#display_loading_page_setting").fadeToggle("fast","linear");var e=jQuery("#display_loading_page_setting").innerHeight();jQuery("#customize-footer-actions").css({bottom:e+"px"})}function O(){jQuery("#display_loading_page_setting").is(":visible")&&jQuery("#display_loading_page_setting").fadeToggle("fast","linear"),jQuery("#hide-loading-setting").removeClass("active");jQuery("#display_loading_page_setting").innerHeight();jQuery("#customize-footer-actions").css({bottom:"0px"})}function M(e){var t=jQuery("#customize-preview iframe").contents().find("html"),a=t[0],i=jQuery(a).scrollTop(),r={};r.top=e.detail.clientY+i,r.left=e.detail.clientX;var o=y(Y,r),n=d(o);W=Q(n,r);var s=P(W);s?(g(W,B,i),jQuery("#layout-iframe").unbind("click"),jQuery("#layout-iframe").on("click",function(){var e=jQuery("#layout-iframe").attr("data-action");switch(e&&(X=e),X){case"animation":V=[];for(var t in W)B=t,V.push(t);T(V,i);break;case"hover":F=[];for(var t in W)H=t,F.push(t);x(F,i),jQuery(".hover-on-itself").css({display:"none"}),jQuery(".hover-another-element").css({display:"inline-block"});break;case"click":G=[];for(var t in W)L=t,G.push(t);_(G,i),jQuery(".click-on-itself").css({display:"none"}),jQuery(".click-another-element").css({display:"inline-block"})}})):jQuery("#layout-iframe").unbind("click")}var W,B,H,L,N,V=[],F=[],G=[],K=[],X="animation";jQuery("#customize-preview iframe").load(function(){jQuery("#customize-footer-actions").css({bottom:"0"}),jQuery("#layout-iframe-1").css({"z-index":"1"}),jQuery("#idIframe").css({"z-index":"-1"}),jQuery("#layout-iframe-1").css({"z-index":"-1"}),jQuery("#idIframe").css({"z-index":"1"});var e=document.getElementById("idIframe").contentDocument.location.href;jQuery("#function span.dashicons-admin-home a").attr("href",e),setPageData(),t(),a(),K=[]}),jQuery("ul.nav-tabs li").click(function(){var e=jQuery(this).attr("data-effect");if(e)switch(e){case"load-effect":jQuery(".mya-block-hover-active").removeClass("mya-show"),jQuery(".mya-block-click-active").removeClass("mya-show");break;case"hover-effect":jQuery(".mya-block-click-active").removeClass("mya-show"),H&&(jQuery(".mya-block-hover-active").addClass("mya-show"),jQuery("#choose-another-hover-element").css({display:"inline-block"}));break;case"click-effect":jQuery(".mya-block-hover-active").removeClass("mya-show"),L&&(jQuery(".mya-block-click-active").addClass("mya-show"),jQuery("#choose-another-click-element").css({display:"inline-block"}))}}),jQuery("#add_another_animation").click(function(){N="",B="",V=[],H="",F=[],L="",G=[],jQuery(".hover-on-itself").css({display:"inline-block"}),jQuery(".hover-another-element").css({display:"none"}),jQuery(".click-on-itself").css({display:"inline-block"}),jQuery(".click-another-element").css({display:"none"}),jQuery("#display_rules_page").fadeToggle("fast","linear"),jQuery("#layout-iframe").css({"z-index":"1"}).attr("data-action","animation"),jQuery("#layout-iframe-1").css({"z-index":"-1"}),jQuery(".dissable-event").css({"z-index":"1"}),jQuery("#animation_element_choosed .mya-block-active").removeClass("mya-show"),jQuery(".mya-block-hover-active").removeClass("mya-show"),jQuery(".mya-block-click-active").removeClass("mya-show"),jQuery("#choose-another-element").css({display:"none"}),showAddStatus(),r()}),jQuery(".start-make-animation").click(function(){var e=jQuery(this).attr("data-action"),t=jQuery("#display_rules_page").innerHeight();switch(jQuery("#customize-footer-actions").css({bottom:t+"px"}),jQuery("#display_rules_page").fadeToggle("slow","linear"),jQuery("#layout-iframe").css({"z-index":"-1"}),jQuery(".mya-block-hover").removeClass("mya-show"),jQuery("#layout-iframe-1").css({"z-index":"1"}),jQuery(".dissable-event").css({"z-index":"-1"}),e){case"animation":N||jQuery(".nav-tabs .have-effect").css({display:"none"}),jQuery(".tool-box").removeClass("mya-show"),jQuery("#choose-another-element").css({display:"block"}),jQuery("#animation_active_list .mya-block-active").removeClass("mya-show"),k(!0);break;case"hover":jQuery(".hover-tool-box").removeClass("mya-show"),H=F[F.length-1],B=V[V.length-1],H===B?(jQuery(".hover-on-itself").css({display:"inline-block"}),jQuery(".hover-another-element").css({display:"none" })):jQuery("#choose-another-hover-element").css({display:"block"});break;case"click":jQuery(".click-tool-box").removeClass("mya-show"),L===B?(jQuery(".click-on-itself").css({display:"inline-block"}),jQuery(".click-another-element").css({display:"none"})):jQuery("#choose-another-click-element").css({display:"block"})}}),jQuery(".play-animation").click(function(){var e,t=jQuery(this).attr("data-effect");switch(t){case"loading_exit":e=jQuery("#customize-preview iframe").contents().find(".mya-lp-screen");break;case"page_entrance":e=jQuery("#customize-preview iframe").contents().find("body");break;default:var a=V[V.length-1],i=m(a);e=jQuery("#customize-preview iframe").contents().find(i)}var r=getDataAnimation(this);jQuery(e).animateCss([r])}),jQuery(".animated-it").click(function(){var e=jQuery(this).attr("data-action"),t=getDataAnimation(".first-"+e),a=getDataAnimation(".secon-"+e),i=jQuery("input[name=repeat-"+e+"]").val(),r=jQuery("input[name=repeat_delay-"+e+"]").val(),o=V[V.length-1],n=m(o),s=jQuery("#customize-preview iframe").contents().find(n);if(t===!1&&a===!1)return!1;if(t===!1){var l=[a,i,r];jQuery(s).animateCss(l)}else if(a===!1){var l=[t,i,r];jQuery(s).animateCss(l)}else{var l=[t,a,i,r];jQuery(s).playAnimation(l)}}),jQuery(".save-this-animation").click(function(){if(V.length<1)return showMessage("error","Choose Animation element."),!1;var e=jQuery("input[name=animation_name]").val(),t=jQuery("select[name=animation_page]").val(),a=getPageData(t);if(!e||""===e)return showMessage("error","Please enter a Animation name."),!1;var i=jQuery(this).attr("data-action"),r=getDataAnimation(".first-"+i),o=getDataAnimation(".secon-"+i),n=jQuery("input[name=repeat-"+i+"]").val(),l=jQuery("input[name=repeat_delay-"+i+"]").val(),c=jQuery("select[name=min_screen_"+i+"]").val(),u=jQuery("select[name=max_screen_"+i+"]").val(),y=jQuery("select[name=start_"+i+"]").val(),d={},f=V[V.length-1],p=m(f),j=jQuery("#customize-preview iframe").contents().find(p),j=j[0];if(r===!1&&o===!1&&!N)return showMessage("error","Choose Animation effect."),!1;switch(d.repeat=n,d.repeatDelay=l,d.minScreen=c,d.maxScreen=u,d.start=y,i){case"hover_effect":H=F[F.length-1],d.eleTaget=H;break;case"click_effect":L=G[G.length-1],d.eleTaget=L}var v=jQuery("#customize-preview iframe").contents().find("body"),h=v[0],Q=getPathFromElement(j,h);if(r===!1&&o===!1){if(!N)return showMessage("error","Please choose animation effect."),!1;d={}}else r===!1?d.firstData=o:o===!1?d.firstData=r:(d.firstData=r,d.seconData=o);jQuery("#loading").addClass("loading-show"),jQuery.ajax({type:"POST",dataType:"json",url:makeAnimationajax.ajaxurl,data:{action:"galoover_ae_save_animation",animationData:d,animationId:N,eleXPath:Q,animationName:e,animationType:i,animationPageValue:t,animationPageData:a},success:function(t,a,r){if(jQuery("#loading").removeClass("loading-show"),showEditStatus(),N){switch(i){case"hover_effect":jQuery(".nav-tabs .hover-effect").css({display:"inline-block"});break;case"click_effect":jQuery(".nav-tabs .click-effect").css({display:"inline-block"})}var o=jQuery(".animations-manager ul").find("[data-id='"+N+"']"),o=o[0];jQuery(o).children(".name").text(e);var n=jQuery(o).attr("data-path"),l=K.indexOf(n);l!==-1&&K.splice(l,1),jQuery(o).attr("data-path",f)}else{switch(i){case"load_effect":jQuery(".nav-tabs .load-effect").css({display:"inline-block"});break;case"hover_effect":jQuery(".nav-tabs .hover-effect").css({display:"inline-block"});break;case"click_effect":jQuery(".nav-tabs .click-effect").css({display:"inline-block"})}var c=jQuery("#manager-button .count").text(),u=+c+1;jQuery("#manager-button .count").text(u),s(t.data,e)}showMessage("success","Saved Successfully"),K.push(f),N=t.data,addBoxView(N,f)},error:function(e,t,a){}})}),jQuery("#manager-button").click(function(){jQuery(this).toggleClass("active"),jQuery(".animations-manager").fadeToggle("fast","linear"),jQuery(".animations-notice").is(":visible")&&(jQuery("#notice-button").toggleClass("active"),jQuery(".animations-notice").fadeToggle("fast","linear"))}),jQuery("#notice-button").click(function(){jQuery(this).toggleClass("active"),jQuery(".animations-notice").fadeToggle("fast","linear"),jQuery(".animations-manager").is(":visible")&&(jQuery("#manager-button").toggleClass("active"),jQuery(".animations-manager").fadeToggle("fast","linear"))});var Y=(jQuery("#customize-preview iframe").contents().find("body"),[]);jQuery("#go-parent-element").click(function(){S(V);var e=jQuery("#animation_active_list").find("[data-animation-id='"+N+"']"),e=e[0],t=V[V.length-1],a=m(t),i=jQuery("#customize-preview iframe").contents().find(a),i=i[0];o(e,i);var r=jQuery("#customize-preview iframe").contents().find("html"),n=r[0],s=jQuery(n).scrollTop();T(V,s)}),jQuery("#go-previous-element").click(function(){E(V);var e=jQuery("#animation_active_list").find("[data-animation-id='"+N+"']"),e=e[0],t=V[V.length-1],a=m(t),i=jQuery("#customize-preview iframe").contents().find(a),i=i[0];o(e,i);var r=jQuery("#customize-preview iframe").contents().find("html"),n=r[0],s=jQuery(n).scrollTop();T(V,s)}),jQuery("#show-all-element").click(function(){var e=V[V.length-1],t=m(e),a=jQuery("#customize-preview iframe").contents().find(t);if(a){var i=jQuery(a).find("*");jQuery.each(i,function(e,t){jQuery(t).is(":visible")||jQuery(t).show("fast","linear");var a=jQuery(t).css("opacity");"0"===a&&jQuery(t).css({opacity:"1"});var i=jQuery(t).css("visibility");"hidden"===i&&jQuery(t).css({visibility:"visible"})});var r=[],o=jQuery("#customize-preview iframe").contents().find("body"),n=o[0];Y=c(n,r,n)}}),jQuery("#show-all-element-hover").click(function(){var e=F[F.length-1],t=m(e),a=jQuery("#customize-preview iframe").contents().find(t);if(a){var i=jQuery(a).find("*");jQuery.each(i,function(e,t){jQuery(t).is(":visible")||jQuery(t).show("fast","linear");var a=jQuery(t).css("opacity");"0"===a&&jQuery(t).css({opacity:"1"});var i=jQuery(t).css("visibility");"hidden"===i&&jQuery(t).css({visibility:"visible"})});var r=[],o=jQuery("#customize-preview iframe").contents().find("body"),n=o[0];Y=c(n,r,n)}}),jQuery("#show-all-element-click").click(function(){var e=F[F.length-1],t=m(e),a=jQuery("#customize-preview iframe").contents().find(t);if(a){var i=jQuery(a).find("*");jQuery.each(i,function(e,t){jQuery(t).is(":visible")||jQuery(t).show("fast","linear");var a=jQuery(t).css("opacity");"0"===a&&jQuery(t).css({opacity:"1"});var i=jQuery(t).css("visibility");"hidden"===i&&jQuery(t).css({visibility:"visible"})});var r=[],o=jQuery("#customize-preview iframe").contents().find("body"),n=o[0];Y=c(n,r,n)}}),jQuery(".show-all-hide").click(function(){var e=[],t=jQuery("#customize-preview iframe").contents().find("body"),a=t[0],i=jQuery(a).find("*");jQuery.each(i,function(e,t){jQuery(t).is(":visible")||jQuery(t).show("fast","linear");var a=jQuery(t).css("opacity");"0"===a&&jQuery(t).css({opacity:"1"});var i=jQuery(t).css("visibility");"hidden"===i&&jQuery(t).css({visibility:"visible"})}),t=jQuery("#customize-preview iframe").contents().find("body"),a=t[0],Y=c(a,e,a)}),jQuery("#go-parent-hover-element").click(function(){S(F);var e=jQuery("#customize-preview iframe").contents().find("html"),t=e[0],a=jQuery(t).scrollTop();x(F,a)}),jQuery("#go-previous-hover-element").click(function(){E(F);var e=jQuery("#customize-preview iframe").contents().find("html"),t=e[0],a=jQuery(t).scrollTop();x(F,a)}),jQuery("#go-parent-click-element").click(function(){S(G);var e=jQuery("#customize-preview iframe").contents().find("html"),t=e[0],a=jQuery(t).scrollTop();_(G,a)}),jQuery("#go-previous-click-element").click(function(){E(G);var e=jQuery("#customize-preview iframe").contents().find("html"),t=e[0],a=jQuery(t).scrollTop();_(G,a)});var q;jQuery("#start-button").unbind("click.clickStartButton"),jQuery("#start-button").bind("click.clickStartButton",I),jQuery("#save_loading_setting").click(function(){var e=galooverGetLoadingSettingValue();jQuery("#loading-page-loading").addClass("loading-show"),jQuery.ajax({type:"POST",dataType:"json",url:makeAnimationajax.ajaxurl,data:{action:"galoover_ae_update_loading_page_settings",data:e},success:function(e,t,a){jQuery("#loading-page-loading").removeClass("loading-show"),showMessageLoadingPage("success","Saved Successfully")},error:function(e,t,a){}})}),jQuery("#save_loading_setting_this_page").click(function(){var e=galooverGetLoadingSettingValueThisPage(),t=getThisPageData();jQuery("#loading-page-loading").addClass("loading-show"),jQuery.ajax({type:"POST",dataType:"json",url:makeAnimationajax.ajaxurl,data:{action:"galoover_ae_update_loading_page_settings_this_page",data:e,pageData:t},success:function(e,t,a){jQuery("#loading-page-loading").removeClass("loading-show"),showMessageLoadingPage("success","Saved Successfully")},error:function(e,t,a){}})}),jQuery("#save-page-effect").click(function(){var e=getDataAnimation(jQuery("#get_page_entrance_data")),t=getDataAnimation(jQuery("#get_lds_effect_data")),a={};a.pageEntranceData=e,a.ldsEffectData=t,jQuery("#loading-page-loading").addClass("loading-show"),jQuery.ajax({type:"POST",dataType:"json",url:makeAnimationajax.ajaxurl,data:{action:"galoover_ae_update_loading_page_effects",data:a},success:function(e,t,a){jQuery("#loading-page-loading").removeClass("loading-show"),showMessageLoadingPage("success","Saved Successfully")},error:function(e,t,a){}})}),jQuery("#save-page-effect-this-page").click(function(){var e=getDataAnimation(jQuery("#get_page_entrance_data_this_page")),t=getDataAnimation(jQuery("#get_lds_effect_data_this_page")),a={},i=getThisPageData();a.pageEntranceData=e,a.ldsEffectData=t,jQuery("#loading-page-loading").addClass("loading-show"),jQuery.ajax({type:"POST",dataType:"json",url:makeAnimationajax.ajaxurl,data:{action:"galoover_ae_update_loading_page_effects_this_page",data:a,pageData:i},success:function(e,t,a){jQuery("#loading-page-loading").removeClass("loading-show"),showMessageLoadingPage("success","Saved Successfully")},error:function(e,t,a){}})}),jQuery("#loading-page").click(function(){jQuery("#loading-page").hasClass("active")?(jQuery("#loading-page").removeClass("active"),jQuery("#customize-footer-actions .devices, #collapse-sidebar-button, #start-button,#hide-loading-setting").fadeToggle("fast","linear"),O(),jQuery("#customize-preview iframe").contents().find(".mya-lp-screen").hide()):(jQuery("#loading-page").addClass("active"),getLoadingPageData(),A(),jQuery("#customize-preview iframe").contents().find(".mya-lp-screen").show(),jQuery("#customize-footer-actions .devices, #collapse-sidebar-button, #start-button, #hide-loading-setting").fadeToggle("fast","linear"))}),jQuery(".display-loading-screen").click(function(){jQuery("#customize-preview iframe").contents().find(".mya-lp-screen").is(":visible")?jQuery("#customize-preview iframe").contents().find(".mya-lp-screen").hide():jQuery("#customize-preview iframe").contents().find(".mya-lp-screen").show()}),jQuery("#hide-loading-setting").click(function(){jQuery("#hide-loading-setting").hasClass("active")?(jQuery("#hide-loading-setting").removeClass("active"),jQuery("#display_loading_page_setting").fadeToggle("fast","linear")):(jQuery("#hide-loading-setting").addClass("active"),jQuery("#display_loading_page_setting").fadeToggle("fast","linear"))}),jQuery("#choose_hover_element").click(function(){X="hover",jQuery("#layout-iframe").attr("data-action",X),jQuery("#customize-footer-actions").css({bottom:"0"}),jQuery("#choose-another-hover-element").css({display:"none"}),startChooseElement(X)}),jQuery("#choose_click_element").click(function(){X="click",jQuery("#layout-iframe").attr("data-action",X),jQuery("#customize-footer-actions").css({bottom:"0"}),jQuery("#choose-another-click-element").css({display:"none"}),startChooseElement(X)}),null!==document.getElementById("layout-iframe")&&document.getElementById("layout-iframe").addEventListener("mousestop",M),jQuery("#idIframe").on("mouseover",function(){jQuery(document).bind("keydown",function(e){var t=e.keyCode||e.which;if(e.ctrlKey)switch(t){case 67:I()}}),jQuery(document.getElementById("idIframe").contentWindow.document).bind("keydown",function(e){var t=e.keyCode||e.which;if(e.ctrlKey)switch(t){case 67:I()}})}).on("mouseout",function(){jQuery(document).unbind("keydown"),jQuery(document.getElementById("idIframe").contentWindow.document).unbind("keydown")}),jQuery("#customize-preview").scroll(function(){var e=jQuery("#customize-preview").scrollTop(),t=jQuery("#customize-preview iframe").contents().find("html"),a=t[0],i=document.getElementById("idIframe");if(jQuery(i).css({top:e+"px"}),jQuery(a).scrollTop(e),document.documentMode||/Edge/.test(navigator.userAgent)){var r=jQuery(document.getElementById("idIframe").contentWindow).scrollTop(),o=e-r;document.getElementById("idIframe").contentWindow.scrollBy(0,o)}var n=jQuery(a).scrollTop();(document.documentMode||/Edge/.test(navigator.userAgent))&&(n=jQuery(document.getElementById("idIframe").contentWindow).scrollTop()),b(n),K.length>0&&w(K,n),jQuery(".mya-block-hover").removeClass("mya-show");var s=jQuery("#layout-iframe").css("z-index");"1"===s&&(clearTimeout(jQuery.data(this,"scrollTimer")),jQuery.data(this,"scrollTimer",setTimeout(function(){var e=[],t=jQuery("#customize-preview iframe").contents().find("body"),a=t[0];Y=c(a,e,a)},250)))}),jQuery("#animate-div").click(function(){jQuery(event.target).is("#animate-form")||hideOnClickOutside("#animate-form")}),jQuery("#animate-div").bind("mousewheel DOMMouseScroll",function(e){var t=null;"mousewheel"==e.type?t=e.originalEvent.wheelDelta*-1:"DOMMouseScroll"==e.type&&(t=40*e.originalEvent.detail),t&&(e.preventDefault(),jQuery(this).scrollTop(t+jQuery(this).scrollTop()))})});