Current File : /home/digitaw/www/wp-content/plugins/responsive-lightbox/js/front.js
(e=>{const t=(e,t)=>{const a=new RegExp("[?&]"+e.replace(/[\[\]]/g,"\\$&")+"(=([^&#]*)|&|#|$)").exec("&"+t);return a&&a[2]?decodeURIComponent(a[2].replace(/\+/g," ")):""},a=(e,t,a)=>{if("undefined"!=typeof MutationObserver){new MutationObserver((e,l)=>{t?e[0].addedNodes.length&&a():(e[0].addedNodes.length||e[0].removedNodes.length)&&a()}).observe(e,{childList:!0,subtree:!0})}};e(()=>{l()}),e(document).on(rlArgs.customEvents,()=>{l()});const l=()=>{const t=[];if(e(".rl-gallery-container").each((a,l)=>{const r=e(l);r.hasClass("rl-pagination-infinite")?t.push(r):r.removeClass("rl-loading")}),t.length>0){const a=[];for(let l=0;l<t.length;l++){const r=t[l],i=r.find(".rl-gallery"),o=parseInt(r.data("gallery_id")),n=r.find(".rl-pagination-bottom").data("button"),s=void 0!==n&&"manually"===n;a[l]={container:r,gallery:i,galleryId:o,galleryButton:s},a[l].gallery.infiniteScroll({path:`.rl-gallery-container[data-gallery_id="${a[l].galleryId}"] .rl-pagination-bottom .next`,append:`.rl-gallery-container[data-gallery_id="${a[l].galleryId}"] .rl-gallery-item`,status:!1,hideNav:`.rl-gallery-container[data-gallery_id="${a[l].galleryId}"] .rl-pagination-bottom`,prefill:!a[l].galleryButton,loadOnScroll:!0,scrollThreshold:!a[l].galleryButton&&400,button:!!a[l].galleryButton&&`.rl-gallery-container[data-gallery_id="${a[l].galleryId}"] .rl-load-more`,debug:!1,history:!1,responseBody:"text",onInit(){const t=a[l];t.container.hasClass("rl-pagination-infinite")&&t.galleryButton&&t.container.removeClass("rl-loading"),this.on("request",()=>{t.container.addClass("rl-loading")}),this.on("append",(a,l,r,i)=>{t.container.removeClass("rl-loading"),e.event.trigger({type:"doResponsiveLightbox",script:rlArgs.script,selector:rlArgs.selector,args:rlArgs,pagination_type:"infinite",gallery_id:t.galleryId,masonry:t.gallery.hasClass("rl-masonry-gallery")||t.gallery.hasClass("rl-basicmasonry-gallery"),delayLightbox:t.gallery.hasClass("rl-expander-gallery"),infinite:{gallery:t.gallery,body:a,items:r,response:i}})})}})}}e.event.trigger({type:"doResponsiveLightbox",script:rlArgs.script,selector:rlArgs.selector,args:rlArgs})};e(document).on("click",".rl-pagination a.page-numbers",a=>{const l=e(a.currentTarget),r=l.closest(".rl-gallery-container");if(r.hasClass("rl-pagination-ajax")){a.preventDefault(),a.stopPropagation();const i=r.data("gallery_id"),o=r.find(".rl-gallery").data("gallery_no");return r.addClass("rl-loading"),e.post(rlArgs.ajaxurl,{action:"rl-get-gallery-page-content",gallery_id:i,gallery_no:o,post_id:rlArgs.postId,page:t("rl_page",l.prop("href")),nonce:rlArgs.nonce,preview:rlArgs.preview?"true":"false",lightbox:rlArgs.script}).done(t=>{r.replaceWith(e(t).removeClass("rl-loading")),e.event.trigger({type:"doResponsiveLightbox",script:rlArgs.script,selector:rlArgs.selector,args:rlArgs,pagination_type:"ajax",gallery_id:i,gallery_no:o})}).always(()=>{r.removeClass("rl-loading")}),!1}}),e(document).on("doResponsiveLightbox",t=>{if(void 0!==t.masonry&&!0===t.masonry)return!1;const a=t.script,l=t.selector;if(void 0===a||void 0===l)return!1;const i=t.args;let o=!1;void 0!==t.delayLightbox&&!0===t.delayLightbox&&(o=!0),rl_view_image=(t,a)=>{e.event.trigger({type:"doLightboxViewImage",script:t,url:a})},rl_hide_image=(t,a)=>{e.event.trigger({type:"doLightboxHideImage",script:t,url:a})},setTimeout(()=>{const t=e(".flex-viewport");if(i.woocommerce_gallery){const l=e(".woocommerce-product-gallery");0===l.find(".woocommerce-product-gallery__trigger").length&&(l.prepend('<a href="#" class="woocommerce-product-gallery__trigger">🔍</a>'),l.on("click",".woocommerce-product-gallery__trigger",e=>{if(e.preventDefault(),e.stopPropagation(),"lightgallery"===a)if(t.length){const e=t.find(".flex-active-slide a[data-rel] img"),a=t.find(".flex-active-slide a[data-rel]").data("lg-id");e.trigger("click.lgcustom-item-"+a)}else{const e=l.find("a[data-rel]").first();e.find("img").trigger("click.lgcustom-item-"+e.data("lg-id"))}else if("fancybox_pro"===a)if(t.length){const e=t.find(".flex-active-slide").index(),a=t.find(".flex-active-slide a[data-rel]").data("fancybox");Fancybox.fromOpener(`[data-fancybox="${a}"]`,{startIndex:e})}else{const e=l.find("a[data-rel]").first();Fancybox.fromOpener(`[data-fancybox="${e.data("fancybox")}"]`,{startIndex:0})}else t.length?t.find(".flex-active-slide a[data-rel]").trigger("click"):l.find("a[data-rel]").first().trigger("click")}))}},10),o?setTimeout(()=>{r(t)},0):r(t)});const r=t=>{const l=t.script,r=t.selector,i=t.args;switch(l){case"swipebox":let o=e("#swipebox-overlay").find(".slide.current"),n="",s=!1,d=!1;e(`a[rel*="${r}"], a[data-rel*="${r}"]`).swipebox({useCSS:i.animation,useSVG:i.useSVG,hideCloseButtonOnMobile:i.hideCloseButtonOnMobile,removeBarsOnMobile:i.removeBarsOnMobile,hideBarsDelay:i.hideBars?parseInt(i.hideBarsDelay):0,videoMaxWidth:parseInt(i.videoMaxWidth),loopAtEnd:i.loopAtEnd,afterOpen:()=>{d=!1,o=e("#swipebox-overlay").find(".slide.current");const t=o.find("img").attr("src");void 0!==t?(n=t,rl_view_image(l,n)):n="",a(document.getElementById("swipebox-slider"),!1,()=>{if(""===n){const e=o.find("img").attr("src");void 0!==e?(n=e,rl_view_image(l,n)):n=""}})},nextSlide:()=>{o=e("#swipebox-overlay").find(".slide.current");const t=o.find("img").attr("src");void 0!==t?(n=t,rl_view_image(l,n)):n=""},prevSlide:()=>{o=e("#swipebox-overlay").find(".slide.current");const t=o.find("img").attr("src");void 0!==t?(n=t,rl_view_image(l,n)):n=""},afterClose:()=>{d=!0,s&&(rl_hide_image(l,n),s=!1)}}),e(window).on("resize",()=>{d||(s=!0)});break;case"prettyphoto":let c=!1,g="";e(`a[rel*="${r}"], a[data-rel*="${r}"]`).each((t,a)=>{const l=e(a);let r=l.data("rl_title"),i=l.data("rl_caption");r=r?r.replace(/[^]/g,e=>"&#"+e.charCodeAt(0)+";"):"",i=i?i.replace(/[^]/g,e=>"&#"+e.charCodeAt(0)+";"):"",l.attr("title",i),l.find("img").attr("alt",r)}),e(`a[rel*="${r}"], a[data-rel*="${r}"]`).prettyPhoto({hook:"data-rel",animation_speed:i.animationSpeed,slideshow:!!i.slideshow&&parseInt(i.slideshowDelay),autoplay_slideshow:i.slideshowAutoplay,opacity:i.opacity,show_title:i.showTitle,allow_resize:i.allowResize,allow_expand:i.allowExpand,default_width:parseInt(i.width),default_height:parseInt(i.height),counter_separator_label:i.separator,theme:i.theme,horizontal_padding:parseInt(i.horizontalPadding),hideflash:i.hideFlash,wmode:i.wmode,autoplay:i.videoAutoplay,modal:i.modal,deeplinking:i.deeplinking,overlay_gallery:i.overlayGallery,keyboard_shortcuts:i.keyboardShortcuts,social_tools:i.social?`<div class="pp_social"><div class="twitter"><a href="//twitter.com/share" class="twitter-share-button" data-count="none">Tweet</a><script type="text/javascript" src="//platform.twitter.com/widgets.js"><\/script></div><div class="facebook"><iframe src="//www.facebook.com/plugins/like.php?locale=en_US&href=${location.href}&amp;layout=button_count&amp;show_faces=true&amp;width=500&amp;action=like&amp;font&amp;colorscheme=light&amp;height=23" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:500px; height:23px;" allowTransparency="true"></iframe></div></div>`:"",ie6_fallback:!0,changepicturecallback:()=>{c?c=!1:(g=e("#pp_full_res").find("img").attr("src"),rl_view_image(l,g),i.allowExpand&&e("a.pp_expand").on("click",()=>{c=!0}))},callback:()=>{rl_hide_image(l,g)}});break;case"nivo":e.each(e(`a[rel*="${r}"], a[data-rel*="${r}"]`),(t,a)=>{const l=e(a);let i=l.attr("data-rel");void 0!==i&&0!=i||(i=l.attr("rel")),void 0!==i&&!1!==i&&i.startsWith(r+"-gallery-")&&l.attr("data-lightbox-gallery",i)});let p=!1,h=!0,m="";e(`a[rel*="${r}"], a[data-rel*="${r}"]`).nivoLightbox({effect:i.effect,clickOverlayToClose:i.clickOverlayToClose,keyboardNav:i.keyboardNav,errorMessage:i.errorMessage,afterShowLightbox:t=>{const r=e(t)[0].find(".nivo-lightbox-content");p||(p=!0,a(document.getElementsByClassName("nivo-lightbox-content")[0],!0,()=>{h&&(m=r.find(".nivo-lightbox-image img").attr("src"),rl_view_image(l,m),h=!1)}))},afterHideLightbox:()=>{h=!0,rl_hide_image(l,m)},onPrev:e=>{h=!1,m=e[0].attr("href"),rl_view_image(l,m)},onNext:e=>{h=!1,m=e[0].attr("href"),rl_view_image(l,m)}});break;case"imagelightbox":let f=[],y="";e(`a[rel*="${r}"], a[data-rel*="${r}"]`).each((t,a)=>{let l=e(a).attr("data-rel");void 0!==l&&!1!==l&&"norl"!==l?f.push(l):(l=e(a).attr("rel"),void 0!==l&&!1!==l&&"norl"!==l&&f.push(l))}),f.length>0&&(f=_.uniq(f),e(f).each((a,r)=>{void 0!==t.pagination_type&&e(`a[data-rel="${r}"], a[rel="${r}"]`).each((t,a)=>{e(a).off("click.imageLightbox")}),e(`a[data-rel="${r}"], a[rel="${r}"]`).imageLightbox({animationSpeed:parseInt(i.animationSpeed),preloadNext:i.preloadNext,enableKeyboard:i.enableKeyboard,quitOnEnd:i.quitOnEnd,quitOnImgClick:i.quitOnImageClick,quitOnDocClick:i.quitOnDocumentClick,onLoadEnd:()=>{y=e("#imagelightbox").attr("src"),rl_view_image(l,y)},onEnd:()=>{rl_hide_image(l,y)}})}));break;case"tosrus":let u=[],w="";e(`a[rel*="${r}"], a[data-rel*="${r}"]`).each((t,a)=>{let l=e(a).attr("data-rel");void 0!==l&&!1!==l&&"norl"!==l?u.push(l):(l=e(a).attr("rel"),void 0!==l&&!1!==l&&"norl"!==l&&u.push(l))}),u.length>0&&(u=_.uniq(u),e(u).each((a,r)=>{void 0!==t.pagination_type&&(e("body").find(".tosrus-"+r).remove(),e(`a[data-rel="${r}"], a[rel="${r}"]`).each((t,a)=>{e(a).off("click.tos")}));const o=e(`a[data-rel="${r}"], a[rel="${r}"]`).tosrus({drag:!0,infinite:i.infinite,autoplay:{play:i.autoplay,pauseOnHover:i.pauseOnHover,timeout:i.timeout},effect:i.effect,keys:{prev:i.keys,next:i.keys,close:i.keys},pagination:{add:i.pagination,type:i.paginationType},show:!1,buttons:!0,caption:{add:!0,attributes:["title"]},wrapper:{classes:"tosrus-"+r,onClick:i.closeOnClick?"close":"toggleUI"}});o.on("sliding.tos",(t,a)=>{w=e(e(t.target).find(".tos-slider .tos-slide")[a]).find("img").attr("src"),rl_view_image(l,w)}),o.on("closing.tos",()=>{rl_hide_image(l,w)})}));break;case"featherlight":{delete e.featherlight.contentFilters.jquery,e.extend(e.featherlight.contentFilters,{html:{regex:/[^]/,process:t=>e("<div>",{text:t})}}),e.featherlight.contentFilters.ajax.process=function(t){var a=e("<div/>");return e.get(t).done(function(e){a.html(window.RLG&&window.RLG.sanitizeHtml?window.RLG.sanitizeHtml(e):e)}).fail(function(){a.html("No content found.")}).promise(a)},e.featherlight.contentFilters.iframe.process=function(t){var a;return window.RLG&&window.RLG.isAllowedEmbedUrl&&!window.RLG.isAllowedEmbedUrl(t)?((a=e("<div/>")).html("Iframe not allowed."),a.contents()):((a=e("<div/>")).html('<iframe src="'+t+'" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe>'),a.contents())},e.featherlight.contentFilters.image.process=function(t){if(window.RLG&&window.RLG.sanitizeConfig&&window.RLG.sanitizeConfig.ALLOWED_URI_REGEXP&&!window.RLG.sanitizeConfig.ALLOWED_URI_REGEXP.test(t))return(a=e("<div/>")).html("Image not allowed."),a.contents();var a,l=e('<img src="'+t+'" alt="" />');return(a=e("<div/>").append(l)).contents()},e.featherlight.readElementConfig=function(e,t){return{}};let a=[],o="";e('a[rel*="'+r+'"], a[data-rel*="'+r+'"]').each((t,l)=>{let r=e(l).attr("data-rel");void 0!==r&&!1!==r&&"norl"!==r?a.push(r):(r=e(l).attr("rel"),void 0!==r&&!1!==r&&"norl"!==r&&a.push(r))}),a.length>0&&(a=_.uniq(a),e.extend(e.featherlight.defaults,{contentFilters:["image","html","ajax","iframe","text"],openSpeed:parseInt(i.openSpeed),closeSpeed:parseInt(i.closeSpeed),closeOnClick:i.closeOnClick,closeOnEsc:i.closeOnEsc,afterOpen:e=>{o=e.currentTarget.href,rl_view_image(l,o)},afterClose:()=>{rl_hide_image(l,o)}}),e(a).each((a,l)=>{void 0!==t.pagination_type&&e('a[data-rel="'+l+'"], a[rel="'+l+'"]').each((t,a)=>{e(a).off("click.featherlight")}),/-gallery-/.test(l)?e('a[data-rel="'+l+'"], a[rel="'+l+'"]').featherlightGallery({galleryFadeIn:parseInt(i.galleryFadeIn),galleryFadeOut:parseInt(i.galleryFadeOut),previousIcon:"&#10094;",nextIcon:"&#10095;"}):(/-video-/.test(l),e('a[data-rel="'+l+'"], a[rel="'+l+'"]').featherlight())}));break}case"magnific":{let t=[];e('a[rel*="'+r+'"], a[data-rel*="'+r+'"]').each((a,l)=>{let r=e(l).attr("data-rel");void 0!==r&&!1!==r&&"norl"!==r?t.push(r):(r=e(l).attr("rel"),void 0!==r&&!1!==r&&"norl"!==r&&t.push(r))}),t.length>0&&(t=_.uniq(t),e(t).each((t,a)=>{const r=e('a[data-rel="'+a+'"], a[rel="'+a+'"]'),o=e(r[0]);let n=o.data("magnific_type");const s=o.data("rl_content");void 0!==s&&(n=s),void 0===n&&(n="image");let d="auto",c="auto";"true"===i.fixedContentPos?d=!0:"false"===i.fixedContentPos&&(d=!1),"true"===i.fixedBgPos?c=!0:"false"===i.fixedBgPos&&(c=!1),r.magnificPopup({allowHTMLInStatusIndicator:!1,allowHTMLInTemplate:!0,type:"gallery"===n?"image":"video"===n?"iframe":n,disableOn:i.disableOn,midClick:i.midClick,preloader:i.preloader,closeOnContentClick:i.closeOnContentClick,closeOnBgClick:i.closeOnBgClick,closeBtnInside:i.closeBtnInside,showCloseBtn:i.showCloseBtn,enableEscapeKey:i.enableEscapeKey,alignTop:i.alignTop,autoFocusLast:i.autoFocusLast,fixedContentPos:d,fixedBgPos:c,image:{titleSrc:e=>{let t=e.el.data("rl_title"),a=e.el.data("rl_caption");return t=t?t.replace(/[^]/g,e=>"&#"+e.charCodeAt(0)+";"):"",a=a?a.replace(/[^]/g,e=>"&#"+e.charCodeAt(0)+";"):"",t+"<small>"+a+"</small>"}},gallery:{enabled:r.length>1&&"gallery"===n,navigateByImgClick:!0,preload:[0,1]},callbacks:{close(){rl_hide_image(l,this.currItem.src)},imageLoadComplete(){rl_view_image(l,this.currItem.src)},elementParse:e=>{e.src.trim().includes("<")&&("inline"===e.type?e.src="<div>HTML is disallowed.</div>":"iframe"!==e.type&&"ajax"!==e.type||(e.src=""))}}})}));break}case"glightbox":{void 0!==window.rl_glightbox&&null!==window.rl_glightbox&&window.rl_glightbox.destroy();const t=`a[rel*="${r}"]:not([rel*="-video-"]), a[data-rel*="${r}"]:not([data-rel*="-video-"])`;e(t).each((t,a)=>{const l=e(a),r=l.data("rl_title"),i=l.data("rl_caption");r&&l.attr("data-title",window.RLG&&window.RLG.sanitizeHtml?window.RLG.sanitizeHtml(r):r),i&&l.attr("data-description",window.RLG&&window.RLG.sanitizeHtml?window.RLG.sanitizeHtml(i):i);const o=l.attr("data-rel")||l.attr("rel");o&&l.attr("data-gallery",o)}),window.rl_glightbox=GLightbox({selector:t,slideEffect:i.slideEffect,closeButton:i.closeButton,touchNavigation:i.touchNavigation,keyboardNavigation:i.keyboardNavigation,closeOnOutsideClick:i.closeOnOutsideClick,loop:i.loop,zoomable:i.zoomable,preload:!1}),window.rl_glightbox.on("slide_after_load",e=>{rl_view_image(l,e.slideConfig.href)}),window.rl_glightbox.on("close",()=>{const e=window.rl_glightbox.index,t=window.rl_glightbox.elements[e];t&&t.href&&rl_hide_image(l,t.href)});break}}}})(jQuery);