jQuery(document).ready(function(t){t(".oxy-ajax-lightbox").each(function(){var e,o=t(this),a=o.find(".lb-atts"),n=a.attr("data-oulb-selector"),i=a.attr("data-lb-close-icon"),d=a.attr("data-lbtpl-css"),l=t(window),c=t(document).height()>t(window).height(),s="ontouchstart"in document.documentElement;t(document.body).on("click",n,function(n){n.preventDefault();var r=t(this);t('<section class="ou-lb-content-wrap"><div class="lb-back-drop"></div><div class="lb-spinner"></div><div class="ou-lb-content"></div></section>').appendTo(o);var b=o.find(".lb-spinner"),p=o.find(".ou-lb-content");t.ajax({type:"POST",url:OULB.AJAX_URL,data:{action:"ou_do_ajax_lightbox",postID:"repeater"==a.attr("data-cnt-source")?r.attr("data-post-id"):"builderprv",template:a.attr("data-lb-tpl"),security:OULB.nonce},beforeSend:function(n){o.find("#lb-css-file"+o.attr("id")).length<=0&&t("<link>",{rel:"stylesheet",type:"text/css",href:OULB.cssdir+"/"+d,id:"lb-css-file"+o.attr("id")}).prependTo(o),c&&(s||t("head").append('<style type="text/css">body.lb-remove-scroll{margin-right: '+(window.innerWidth-document.body.clientWidth)+"px!important;}</style>"),t("body").addClass("lb-remove-scroll")),t("#wpadminbar").length>0&&t("#wpadminbar").hide(),"offcanvas"==a.attr("data-lb-type")&&p.addClass("lb-off-canvas lb-ofc"),o.find(".ou-lb-content-wrap").addClass("lb-enabled"),o.find(".lb-back-drop").length>0&&o.find(".lb-back-drop").animate({opacity:1},150),b.addClass("show"),void 0!==e&&clearTimeout(e)},complete:function(e){"no"==a.attr("data-cb-disable")&&t('<div class="close-lightbox"><svg id="lb-close-icon"><use xlink:href="#'+i+'"></use></svg></div>').appendTo(p),b.removeClass("show")},success:function(t){p.append(t),p.imagesLoaded(function(){e=setTimeout(function(){l.trigger("resize"),p.addClass("lb-box-fadein")},200)})},dataType:"json"}),l.on("resize",function(){!function(e){var o=t(window);e.removeAttr("style"),e.find("> .oxy-dynamic-list, > .ct-section, > .ct-div-block").removeAttr("style"),o.width()>768?e.height()>o.height()&&e.css("height",o.height()-60+"px"):e.find("> .oxy-dynamic-list, > .ct-section, > .ct-div-block").height()>o.height()&&e.css("height",o.height()-24+"px")}(p)})})});var e=function(e){t("body").removeClass("lb-remove-scroll"),e.remove(),t("#wpadminbar").length>0&&t("#wpadminbar").show()};t(document.body).on("click",".lb-back-drop, .close-lightbox",function(o){o.preventDefault();var a,n=t(this).closest(".ou-lb-content-wrap"),i=n.find(".ou-lb-content"),d=t(this).closest(".oxy-ajax-lightbox").find(".lb-atts");void 0!==a&&clearTimeout(a),"offcanvas"==d.attr("data-lb-type")?(i.removeClass("lb-box-fadein"),n.find(".lb-back-drop").length>0?n.find(".lb-back-drop").animate({opacity:0},700,function(){e(n)}):a=setTimeout(function(){e(n)},500)):i.animate({opacity:0},50,function(){n.find(".lb-back-drop").length>0?n.find(".lb-back-drop").animate({opacity:0},700,function(){e(n)}):e(n)})})});