jQuery(document).ready(function(e){var a=e(".wpsr-album-cover-photo-wrapper-inner"),r=[];a.each(function(a,t){t.addEventListener("click",function(a){a.preventDefault();var t=e(a.target).closest(".wpsr-album-cover-photo-wrapper-inner");t.hasClass("active")||t.addClass("active");var p=e(t).attr("id"),o=e(t).attr("data-template-id");e(".wpsr-album-cover-photo , .wpsr-fb-albums-feed-info").hide(),e(".wpsr-album-cover-photo-wrapper").each(function(a,r){0===e(r).find("div.wpsr-album-cover-photo-wrapper-inner.active").length&&e(r).parent().hide()}),e("#wpsr-album-".concat(p)).css("display","block");var s=e(a.target).closest(".wpsr-album-cover-photo-wrapper");s.length>0&&(r=s.parent().attr("class").split(" "),s.parent().removeClass(),s.parent().removeAttr("class"),s.parent().css("width","100%")),document.getElementById("wpsr-album-feed-".concat(p)).childElementCount<1&&jQuery.get(wpsr_ajax_params.ajax_url,{action:"wpsr_facebook_album_photo",template_id:o,feed_id:p,security:wpsr_ajax_params.wpsr_nonce}).then(a=>{a&&(e("#wpsr-album-feed-".concat(p))[0].innerHTML=a)}).catch(e=>{console.error(e)}).always(()=>{})})}),e(".wpsr-album-cover-photo-wrapper").each(function(a,r){e(r).on("click",".wpsr-fb-feed-bread-crumbs-album",function(e){t(e)})});var t=a=>{a.preventDefault(),e(".wpsr-fb-feed-image , .wpsr-fb-albums-feed-info").show(),e(".wpsr-fb-feed-album-wrapper").css("display","none"),e(".wpsr-album-cover-photo-wrapper-inner.active").each(function(a,r){e(r).removeClass("active")}),e(".wpsr-album-cover-photo-wrapper").each(function(a,r){e(r).parent().show()});var t=e(a.target).closest(".wpsr-album-cover-photo-wrapper");t.length>0&&(t.parent().removeClass(),t.parent().addClass(r.join(" ")))}});