mirror of
https://github.com/TryGhost/Ruby.git
synced 2024-10-30 04:48:33 +02:00
2 lines
80 KiB
JavaScript
Executable File
2 lines
80 KiB
JavaScript
Executable File
!function(t,i){"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],function(e){return i(t,e)}):"object"==typeof module&&module.exports?module.exports=i(t,require("jquery")):t.jQueryBridget=i(t,t.jQuery)}(window,function(e,t){"use strict";function i(l,c,u){(u=u||t||e.jQuery)&&(c.prototype.option||(c.prototype.option=function(e){u.isPlainObject(e)&&(this.options=u.extend(!0,this.options,e))}),u.fn[l]=function(e){if("string"!=typeof e)return a=e,this.each(function(e,t){var i=u.data(t,l);i?(i.option(a),i._init()):(i=new c(t,a),u.data(t,l,i))}),this;var n,o,r,s,a,t=d.call(arguments,1);return o=t,s="$()."+l+'("'+(n=e)+'")',(e=this).each(function(e,t){var i=u.data(t,l);i?(t=i[n])&&"_"!=n.charAt(0)?(i=t.apply(i,o),r=void 0===r?i:r):p(s+" is not a valid method"):p(l+" not initialized. Cannot call methods, i.e. "+s)}),void 0!==r?r:e},n(u))}function n(e){!e||e&&e.bridget||(e.bridget=i)}var d=Array.prototype.slice,o=e.console,p=void 0===o?function(){}:function(e){o.error(e)};return n(t||e.jQuery),i}),function(e,t){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",t):"object"==typeof module&&module.exports?module.exports=t():e.EvEmitter=t()}("undefined"!=typeof window?window:this,function(){function e(){}var t=e.prototype;return t.on=function(e,t){if(e&&t){var i=this._events=this._events||{},e=i[e]=i[e]||[];return-1==e.indexOf(t)&&e.push(t),this}},t.once=function(e,t){if(e&&t){this.on(e,t);var i=this._onceEvents=this._onceEvents||{};return(i[e]=i[e]||{})[t]=!0,this}},t.off=function(e,t){e=this._events&&this._events[e];if(e&&e.length){t=e.indexOf(t);return-1!=t&&e.splice(t,1),this}},t.emitEvent=function(e,t){var i=this._events&&this._events[e];if(i&&i.length){i=i.slice(0),t=t||[];for(var n=this._onceEvents&&this._onceEvents[e],o=0;o<i.length;o++){var r=i[o];n&&n[r]&&(this.off(e,r),delete n[r]),r.apply(this,t)}return this}},t.allOff=function(){delete this._events,delete this._onceEvents},e}),function(e,t){"use strict";"function"==typeof define&&define.amd?define("desandro-matches-selector/matches-selector",t):"object"==typeof module&&module.exports?module.exports=t():e.matchesSelector=t()}(window,function(){"use strict";var i=function(){var e=window.Element.prototype;if(e.matches)return"matches";if(e.matchesSelector)return"matchesSelector";for(var t=["webkit","moz","ms","o"],i=0;i<t.length;i++){var n=t[i]+"MatchesSelector";if(e[n])return n}}();return function(e,t){return e[i](t)}}),function(t,i){"function"==typeof define&&define.amd?define("fizzy-ui-utils/utils",["desandro-matches-selector/matches-selector"],function(e){return i(t,e)}):"object"==typeof module&&module.exports?module.exports=i(t,require("desandro-matches-selector")):t.fizzyUIUtils=i(t,t.matchesSelector)}(window,function(i,r){var c={extend:function(e,t){for(var i in t)e[i]=t[i];return e},modulo:function(e,t){return(e%t+t)%t}},t=Array.prototype.slice;c.makeArray=function(e){return Array.isArray(e)?e:null==e?[]:"object"==typeof e&&"number"==typeof e.length?t.call(e):[e]},c.removeFrom=function(e,t){t=e.indexOf(t);-1!=t&&e.splice(t,1)},c.getParent=function(e,t){for(;e.parentNode&&e!=document.body;)if(e=e.parentNode,r(e,t))return e},c.getQueryElement=function(e){return"string"==typeof e?document.querySelector(e):e},c.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},c.filterFindElements=function(e,n){e=c.makeArray(e);var o=[];return e.forEach(function(e){if(e instanceof HTMLElement)if(n){r(e,n)&&o.push(e);for(var t=e.querySelectorAll(n),i=0;i<t.length;i++)o.push(t[i])}else o.push(e)}),o},c.debounceMethod=function(e,t,n){n=n||100;var o=e.prototype[t],r=t+"Timeout";e.prototype[t]=function(){var e=this[r];clearTimeout(e);var t=arguments,i=this;this[r]=setTimeout(function(){o.apply(i,t),delete i[r]},n)}},c.docReady=function(e){var t=document.readyState;"complete"==t||"interactive"==t?setTimeout(e):document.addEventListener("DOMContentLoaded",e)},c.toDashed=function(e){return e.replace(/(.)([A-Z])/g,function(e,t,i){return t+"-"+i}).toLowerCase()};var u=i.console;return c.htmlInit=function(a,l){c.docReady(function(){var e=c.toDashed(l),o="data-"+e,t=document.querySelectorAll("["+o+"]"),e=document.querySelectorAll(".js-"+e),e=c.makeArray(t).concat(c.makeArray(e)),r=o+"-options",s=i.jQuery;e.forEach(function(t){var e,i=t.getAttribute(o)||t.getAttribute(r);try{e=i&&JSON.parse(i)}catch(e){return void(u&&u.error("Error parsing "+o+" on "+t.className+": "+e))}var n=new a(t,e);s&&s.data(t,l,n)})})},c}),function(i,n){"function"==typeof define&&define.amd?define("infinite-scroll/js/core",["ev-emitter/ev-emitter","fizzy-ui-utils/utils"],function(e,t){return n(i,e,t)}):"object"==typeof module&&module.exports?module.exports=n(i,require("ev-emitter"),require("fizzy-ui-utils")):i.InfiniteScroll=n(i,i.EvEmitter,i.fizzyUIUtils)}(window,function(t,e,o){function r(e,t){var i=o.getQueryElement(e);if(i){if((e=i).infiniteScrollGUID){var n=a[e.infiniteScrollGUID];return n.option(t),n}this.element=e,this.options=o.extend({},r.defaults),this.option(t),s&&(this.$element=s(this.element)),this.create()}else console.error("Bad element for InfiniteScroll: "+(i||e))}var s=t.jQuery,a={};r.defaults={},r.create={},r.destroy={};var i=r.prototype;o.extend(i,e.prototype);var n=0;i.create=function(){var e=this.guid=++n;if(this.element.infiniteScrollGUID=e,(a[e]=this).pageIndex=1,this.loadCount=0,this.updateGetPath(),this.getPath&&this.getPath())for(var t in this.updateGetAbsolutePath(),this.log("initialized",[this.element.className]),this.callOnInit(),r.create)r.create[t].call(this);else console.error("Disabling InfiniteScroll")},i.option=function(e){o.extend(this.options,e)},i.callOnInit=function(){var e=this.options.onInit;e&&e.call(this,this)},i.dispatchEvent=function(e,t,i){this.log(e,i);var n=t?[t].concat(i):i;this.emitEvent(e,n),s&&this.$element&&(n=e+=".infiniteScroll",t&&((t=s.Event(t)).type=e,n=t),this.$element.trigger(n,i))};var l={initialized:function(e){return"on "+e},request:function(e){return"URL: "+e},load:function(e,t){return(e.title||"")+". URL: "+t},error:function(e,t){return e+". URL: "+t},append:function(e,t,i){return i.length+" items. URL: "+t},last:function(e,t){return"URL: "+t},history:function(e,t){return"URL: "+t},pageIndex:function(e,t){return"current page determined to be: "+e+" from "+t}};i.log=function(e,t){var i;this.options.debug&&(i="[InfiniteScroll] "+e,(e=l[e])&&(i+=". "+e.apply(this,t)),console.log(i))},i.updateMeasurements=function(){this.windowHeight=t.innerHeight;var e=this.element.getBoundingClientRect();this.top=e.top+t.pageYOffset},i.updateScroller=function(){var e=this.options.elementScroll;if(e){if(this.scroller=!0===e?this.element:o.getQueryElement(e),!this.scroller)throw"Unable to find elementScroll: "+e}else this.scroller=t},i.updateGetPath=function(){var e=this.options.path;if(e){var t=typeof e;if("function"!=t)return"string"==t&&e.match("{{#}}")?void this.updateGetPathTemplate(e):void this.updateGetPathSelector(e);this.getPath=e}else console.error("InfiniteScroll path option required. Set as: "+e)},i.updateGetPathTemplate=function(t){this.getPath=function(){var e=this.pageIndex+1;return t.replace("{{#}}",e)}.bind(this);var e=t.replace(/(\\\?|\?)/,"\\?").replace("{{#}}","(\\d\\d?\\d?)"),e=new RegExp(e),e=location.href.match(e);e&&(this.pageIndex=parseInt(e[1],10),this.log("pageIndex",[this.pageIndex,"template string"]))};var c=[/^(.*?\/?page\/?)(\d\d?\d?)(.*?$)/,/^(.*?\/?\?page=)(\d\d?\d?)(.*?$)/,/(.*?)(\d\d?\d?)(?!.*\d)(.*?$)/];return i.updateGetPathSelector=function(e){var t=document.querySelector(e);if(t){for(var i,n=t.getAttribute("href"),o=0;n&&o<c.length;o++){var r=c[o],r=n.match(r);if(r){i=r.slice(1);break}}return i?(this.isPathSelector=!0,this.getPath=function(){var e=this.pageIndex+1;return i[0]+e+i[2]}.bind(this),this.pageIndex=parseInt(i[1],10)-1,void this.log("pageIndex",[this.pageIndex,"next link"])):void console.error("InfiniteScroll unable to parse next link href: "+n)}console.error("Bad InfiniteScroll path option. Next link not found: "+e)},i.updateGetAbsolutePath=function(){var e,t,i=this.getPath();i.match(/^http/)||i.match(/^\//)?this.getAbsolutePath=this.getPath:(e=location.pathname,i.match(/^\?/)?this.getAbsolutePath=function(){return e+this.getPath()}:(t=e.substring(0,e.lastIndexOf("/")),this.getAbsolutePath=function(){return t+"/"+this.getPath()}))},r.create.hideNav=function(){var e=o.getQueryElement(this.options.hideNav);e&&(e.style.display="none",this.nav=e)},r.destroy.hideNav=function(){this.nav&&(this.nav.style.display="")},i.destroy=function(){for(var e in this.allOff(),r.destroy)r.destroy[e].call(this);delete this.element.infiniteScrollGUID,delete a[this.guid],s&&this.$element&&s.removeData(this.element,"infiniteScroll")},r.throttle=function(n,o){var r,s;return o=o||200,function(){var e=+new Date,t=arguments,i=function(){r=e,n.apply(this,t)}.bind(this);r&&e<r+o?(clearTimeout(s),s=setTimeout(i,o)):i()}},r.data=function(e){e=(e=o.getQueryElement(e))&&e.infiniteScrollGUID;return e&&a[e]},r.setJQuery=function(e){s=e},o.htmlInit(r,"infinite-scroll"),i._init=function(){},s&&s.bridget&&s.bridget("infiniteScroll",r),r}),function(t,i){"function"==typeof define&&define.amd?define("infinite-scroll/js/page-load",["./core"],function(e){return i(t,e)}):"object"==typeof module&&module.exports?module.exports=i(t,require("./core")):i(t,t.InfiniteScroll)}(window,function(n,o){function r(e){for(var t=document.createDocumentFragment(),i=0;e&&i<e.length;i++)t.appendChild(e[i]);return t}function i(e){for(var t=e.querySelectorAll("script"),i=0;i<t.length;i++){var o=t[i],n=document.createElement("script");(function(e){for(var t=o.attributes,i=0;i<t.length;i++){var n=t[i];e.setAttribute(n.name,n.value)}})(n),n.innerHTML=o.innerHTML,o.parentNode.replaceChild(n,o)}}var e=o.prototype;return o.defaults.loadOnScroll=!0,o.defaults.checkLastPage=!0,o.defaults.responseType="document",o.create.pageLoad=function(){this.canLoad=!0,this.on("scrollThreshold",this.onScrollThresholdLoad),this.on("load",this.checkLastPage),this.options.outlayer&&this.on("append",this.onAppendOutlayer)},e.onScrollThresholdLoad=function(){this.options.loadOnScroll&&this.loadNextPage()},e.loadNextPage=function(){var t,e,i,n,o,r,s,a,l,c;!this.isLoading&&this.canLoad&&(t=this.getAbsolutePath(),this.isLoading=!0,e=function(e){this.onPageLoad(e,t)}.bind(this),i=function(e){this.onPageError(e,t)}.bind(this),n=function(e){this.lastPageReached(e,t)}.bind(this),o=t,r=this.options.responseType,s=e,a=i,l=n,(c=new XMLHttpRequest).open("GET",o,!0),c.responseType=r||"",c.setRequestHeader("X-Requested-With","XMLHttpRequest"),c.onload=function(){var e;200==c.status?s(c.response):204==c.status?l(c.response):(e=new Error(c.statusText),a(e))},c.onerror=function(){var e=new Error("Network error requesting "+o);a(e)},c.send(),this.dispatchEvent("request",null,[t]))},e.onPageLoad=function(e,t){return this.options.append||(this.isLoading=!1),this.pageIndex++,this.loadCount++,this.dispatchEvent("load",null,[e,t]),this.appendNextPage(e,t),e},e.appendNextPage=function(e,t){var i,n,o=this.options.append;"document"==this.options.responseType&&o&&(i=e.querySelectorAll(o),n=r(i),o=function(){this.appendItems(i,n),this.isLoading=!1,this.dispatchEvent("append",null,[e,t,i])}.bind(this),this.options.outlayer?this.appendOutlayerItems(n,o):o())},e.appendItems=function(e,t){e&&e.length&&(i(t=t||r(e)),this.element.appendChild(t))},e.appendOutlayerItems=function(e,t){var i=o.imagesLoaded||n.imagesLoaded;return i?void i(e,t):(console.error("[InfiniteScroll] imagesLoaded required for outlayer option"),void(this.isLoading=!1))},e.onAppendOutlayer=function(e,t,i){this.options.outlayer.appended(i)},e.checkLastPage=function(e,t){var i=this.options.checkLastPage;if(i){var n,o=this.options.path;if("function"==typeof o)if(!this.getPath())return void this.lastPageReached(e,t);"string"==typeof i?n=i:this.isPathSelector&&(n=o),n&&e.querySelector&&(e.querySelector(n)||this.lastPageReached(e,t))}},e.lastPageReached=function(e,t){this.canLoad=!1,this.dispatchEvent("last",null,[e,t])},e.onPageError=function(e,t){return this.isLoading=!1,this.canLoad=!1,this.dispatchEvent("error",null,[e,t]),e},o.create.prefill=function(){var e;this.options.prefill&&((e=this.options.append)?(this.updateMeasurements(),this.updateScroller(),this.isPrefilling=!0,this.on("append",this.prefill),this.once("error",this.stopPrefill),this.once("last",this.stopPrefill),this.prefill()):console.error("append option required for prefill. Set as :"+e))},e.prefill=function(){var e=this.getPrefillDistance();this.isPrefilling=0<=e,this.isPrefilling?(this.log("prefill"),this.loadNextPage()):this.stopPrefill()},e.getPrefillDistance=function(){return this.options.elementScroll?this.scroller.clientHeight-this.scroller.scrollHeight:this.windowHeight-this.element.clientHeight},e.stopPrefill=function(){this.log("stopPrefill"),this.off("append",this.prefill)},o}),function(i,n){"function"==typeof define&&define.amd?define("infinite-scroll/js/scroll-watch",["./core","fizzy-ui-utils/utils"],function(e,t){return n(i,e,t)}):"object"==typeof module&&module.exports?module.exports=n(i,require("./core"),require("fizzy-ui-utils")):n(i,i.InfiniteScroll,i.fizzyUIUtils)}(window,function(t,e,i){var n=e.prototype;return e.defaults.scrollThreshold=400,e.create.scrollWatch=function(){this.pageScrollHandler=this.onPageScroll.bind(this),this.resizeHandler=this.onResize.bind(this);var e=this.options.scrollThreshold;!e&&0!==e||this.enableScrollWatch()},e.destroy.scrollWatch=function(){this.disableScrollWatch()},n.enableScrollWatch=function(){this.isScrollWatching||(this.isScrollWatching=!0,this.updateMeasurements(),this.updateScroller(),this.on("last",this.disableScrollWatch),this.bindScrollWatchEvents(!0))},n.disableScrollWatch=function(){this.isScrollWatching&&(this.bindScrollWatchEvents(!1),delete this.isScrollWatching)},n.bindScrollWatchEvents=function(e){e=e?"addEventListener":"removeEventListener";this.scroller[e]("scroll",this.pageScrollHandler),t[e]("resize",this.resizeHandler)},n.onPageScroll=e.throttle(function(){this.getBottomDistance()<=this.options.scrollThreshold&&this.dispatchEvent("scrollThreshold")}),n.getBottomDistance=function(){return this.options.elementScroll?this.getElementBottomDistance():this.getWindowBottomDistance()},n.getWindowBottomDistance=function(){return this.top+this.element.clientHeight-(t.pageYOffset+this.windowHeight)},n.getElementBottomDistance=function(){return this.scroller.scrollHeight-(this.scroller.scrollTop+this.scroller.clientHeight)},n.onResize=function(){this.updateMeasurements()},i.debounceMethod(e,"onResize",150),e}),function(i,n){"function"==typeof define&&define.amd?define("infinite-scroll/js/history",["./core","fizzy-ui-utils/utils"],function(e,t){return n(i,e,t)}):"object"==typeof module&&module.exports?module.exports=n(i,require("./core"),require("fizzy-ui-utils")):n(i,i.InfiniteScroll,i.fizzyUIUtils)}(window,function(t,e,i){var n=e.prototype;e.defaults.history="replace";var o=document.createElement("a");return e.create.history=function(){if(this.options.history)return o.href=this.getAbsolutePath(),(o.origin||o.protocol+"//"+o.host)==location.origin?void(this.options.append?this.createHistoryAppend():this.createHistoryPageLoad()):void console.error("[InfiniteScroll] cannot set history with different origin: "+o.origin+" on "+location.origin+" . History behavior disabled.")},n.createHistoryAppend=function(){this.updateMeasurements(),this.updateScroller(),this.scrollPages=[{top:0,path:location.href,title:document.title}],this.scrollPageIndex=0,this.scrollHistoryHandler=this.onScrollHistory.bind(this),this.unloadHandler=this.onUnload.bind(this),this.scroller.addEventListener("scroll",this.scrollHistoryHandler),this.on("append",this.onAppendHistory),this.bindHistoryAppendEvents(!0)},n.bindHistoryAppendEvents=function(e){e=e?"addEventListener":"removeEventListener";this.scroller[e]("scroll",this.scrollHistoryHandler),t[e]("unload",this.unloadHandler)},n.createHistoryPageLoad=function(){this.on("load",this.onPageLoadHistory)},e.destroy.history=n.destroyHistory=function(){this.options.history&&this.options.append&&this.bindHistoryAppendEvents(!1)},n.onAppendHistory=function(e,t,i){i&&i.length&&(i=i[0],i=this.getElementScrollY(i),o.href=t,this.scrollPages.push({top:i,path:o.href,title:e.title}))},n.getElementScrollY=function(e){return this.options.elementScroll?this.getElementElementScrollY(e):this.getElementWindowScrollY(e)},n.getElementWindowScrollY=function(e){return e.getBoundingClientRect().top+t.pageYOffset},n.getElementElementScrollY=function(e){return e.offsetTop-this.top},n.onScrollHistory=function(){for(var e,t,i=this.getScrollViewY(),n=0;n<this.scrollPages.length;n++){var o=this.scrollPages[n];if(o.top>=i)break;e=n,t=o}e!=this.scrollPageIndex&&(this.scrollPageIndex=e,this.setHistory(t.title,t.path))},i.debounceMethod(e,"onScrollHistory",150),n.getScrollViewY=function(){return this.options.elementScroll?this.scroller.scrollTop+this.scroller.clientHeight/2:t.pageYOffset+this.windowHeight/2},n.setHistory=function(e,t){var i=this.options.history;i&&history[i+"State"]&&(history[i+"State"](null,e,t),this.options.historyTitle&&(document.title=e),this.dispatchEvent("history",null,[e,t]))},n.onUnload=function(){var e=this.scrollPageIndex;0!==e&&(e=this.scrollPages[e],e=t.pageYOffset-e.top+this.top,this.destroyHistory(),scrollTo(0,e))},n.onPageLoadHistory=function(e,t){this.setHistory(e.title,t)},e}),function(e,i){"function"==typeof define&&define.amd?define("infinite-scroll/js/button",["./core","fizzy-ui-utils/utils"],function(e,t){return i(0,e,t)}):"object"==typeof module&&module.exports?module.exports=i(0,require("./core"),require("fizzy-ui-utils")):i(0,e.InfiniteScroll,e.fizzyUIUtils)}(window,function(e,t,i){function n(e,t){this.element=e,this.infScroll=t,this.clickHandler=this.onClick.bind(this),this.element.addEventListener("click",this.clickHandler),t.on("request",this.disable.bind(this)),t.on("load",this.enable.bind(this)),t.on("error",this.hide.bind(this)),t.on("last",this.hide.bind(this))}return t.create.button=function(){var e=i.getQueryElement(this.options.button);e&&(this.button=new n(e,this))},t.destroy.button=function(){this.button&&this.button.destroy()},n.prototype.onClick=function(e){e.preventDefault(),this.infScroll.loadNextPage()},n.prototype.enable=function(){this.element.removeAttribute("disabled")},n.prototype.disable=function(){this.element.disabled="disabled"},n.prototype.hide=function(){this.element.style.display="none"},n.prototype.destroy=function(){this.element.removeEventListener("click",this.clickHandler)},t.Button=n,t}),function(e,i){"function"==typeof define&&define.amd?define("infinite-scroll/js/status",["./core","fizzy-ui-utils/utils"],function(e,t){return i(0,e,t)}):"object"==typeof module&&module.exports?module.exports=i(0,require("./core"),require("fizzy-ui-utils")):i(0,e.InfiniteScroll,e.fizzyUIUtils)}(window,function(e,t,i){function n(e){r(e,"none")}function o(e){r(e,"block")}function r(e,t){e&&(e.style.display=t)}var s=t.prototype;return t.create.status=function(){var e=i.getQueryElement(this.options.status);e&&(this.statusElement=e,this.statusEventElements={request:e.querySelector(".infinite-scroll-request"),error:e.querySelector(".infinite-scroll-error"),last:e.querySelector(".infinite-scroll-last")},this.on("request",this.showRequestStatus),this.on("error",this.showErrorStatus),this.on("last",this.showLastStatus),this.bindHideStatus("on"))},s.bindHideStatus=function(e){var t=this.options.append?"append":"load";this[e](t,this.hideAllStatus)},s.showRequestStatus=function(){this.showStatus("request")},s.showErrorStatus=function(){this.showStatus("error")},s.showLastStatus=function(){this.showStatus("last"),this.bindHideStatus("off")},s.showStatus=function(e){o(this.statusElement),this.hideStatusEventElements(),o(this.statusEventElements[e])},s.hideAllStatus=function(){n(this.statusElement),this.hideStatusEventElements()},s.hideStatusEventElements=function(){for(var e in this.statusEventElements)n(this.statusEventElements[e])},t}),function(e){"function"==typeof define&&define.amd?define(["infinite-scroll/js/core","infinite-scroll/js/page-load","infinite-scroll/js/scroll-watch","infinite-scroll/js/history","infinite-scroll/js/button","infinite-scroll/js/status"],e):"object"==typeof module&&module.exports&&(module.exports=e(require("./core"),require("./page-load"),require("./scroll-watch"),require("./history"),require("./button"),require("./status")))}((window,function(e){return e})),function(t,i){"use strict";"function"==typeof define&&define.amd?define("imagesloaded/imagesloaded",["ev-emitter/ev-emitter"],function(e){return i(t,e)}):"object"==typeof module&&module.exports?module.exports=i(t,require("ev-emitter")):t.imagesLoaded=i(t,t.EvEmitter)}("undefined"!=typeof window?window:this,function(t,e){function r(e,t){for(var i in t)e[i]=t[i];return e}function s(e,t,i){if(!(this instanceof s))return new s(e,t,i);var n,o=e;return(o="string"==typeof e?document.querySelectorAll(e):o)?(this.elements=(n=o,Array.isArray(n)?n:"object"==typeof n&&"number"==typeof n.length?c.call(n):[n]),this.options=r({},this.options),"function"==typeof t?i=t:r(this.options,t),i&&this.on("always",i),this.getImages(),a&&(this.jqDeferred=new a.Deferred),void setTimeout(this.check.bind(this))):void l.error("Bad element for imagesLoaded "+(o||e))}function i(e){this.img=e}function n(e,t){this.url=e,this.element=t,this.img=new Image}var a=t.jQuery,l=t.console,c=Array.prototype.slice;(s.prototype=Object.create(e.prototype)).options={},s.prototype.getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)},s.prototype.addElementImages=function(e){"IMG"==e.nodeName&&this.addImage(e),!0===this.options.background&&this.addElementBackgroundImages(e);var t=e.nodeType;if(t&&u[t]){for(var i=e.querySelectorAll("img"),n=0;n<i.length;n++){var o=i[n];this.addImage(o)}if("string"==typeof this.options.background)for(var r=e.querySelectorAll(this.options.background),n=0;n<r.length;n++){var s=r[n];this.addElementBackgroundImages(s)}}};var u={1:!0,9:!0,11:!0};return s.prototype.addElementBackgroundImages=function(e){var t=getComputedStyle(e);if(t)for(var i=/url\((['"])?(.*?)\1\)/gi,n=i.exec(t.backgroundImage);null!==n;){var o=n&&n[2];o&&this.addBackground(o,e),n=i.exec(t.backgroundImage)}},s.prototype.addImage=function(e){e=new i(e);this.images.push(e)},s.prototype.addBackground=function(e,t){t=new n(e,t);this.images.push(t)},s.prototype.check=function(){function t(e,t,i){setTimeout(function(){n.progress(e,t,i)})}var n=this;return this.progressedCount=0,this.hasAnyBroken=!1,this.images.length?void this.images.forEach(function(e){e.once("progress",t),e.check()}):void this.complete()},s.prototype.progress=function(e,t,i){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded,this.emitEvent("progress",[this,e,t]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,e),this.progressedCount==this.images.length&&this.complete(),this.options.debug&&l&&l.log("progress: "+i,e,t)},s.prototype.complete=function(){var e=this.hasAnyBroken?"fail":"done";this.isComplete=!0,this.emitEvent(e,[this]),this.emitEvent("always",[this]),this.jqDeferred&&(e=this.hasAnyBroken?"reject":"resolve",this.jqDeferred[e](this))},(i.prototype=Object.create(e.prototype)).check=function(){return this.getIsImageComplete()?void this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),void(this.proxyImage.src=this.img.src))},i.prototype.getIsImageComplete=function(){return this.img.complete&&this.img.naturalWidth},i.prototype.confirm=function(e,t){this.isLoaded=e,this.emitEvent("progress",[this,this.img,t])},i.prototype.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},i.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},i.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},i.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},(n.prototype=Object.create(i.prototype)).check=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.url,this.getIsImageComplete()&&(this.confirm(0!==this.img.naturalWidth,"naturalWidth"),this.unbindEvents())},n.prototype.unbindEvents=function(){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},n.prototype.confirm=function(e,t){this.isLoaded=e,this.emitEvent("progress",[this,this.element,t])},(s.makeJQueryPlugin=function(e){(e=e||t.jQuery)&&((a=e).fn.imagesLoaded=function(e,t){return new s(this,e,t).jqDeferred.promise(a(this))})})(),s}),function(r){"use strict";r.fn.fitVids=function(e){var t,i,o={customSelector:null,ignore:null};return document.getElementById("fit-vids-style")||(t=document.head||document.getElementsByTagName("head")[0],(i=document.createElement("div")).innerHTML='<p>x</p><style id="fit-vids-style">.fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}</style>',t.appendChild(i.childNodes[1])),e&&r.extend(o,e),this.each(function(){var e=['iframe[src*="player.vimeo.com"]','iframe[src*="youtube.com"]','iframe[src*="youtube-nocookie.com"]','iframe[src*="kickstarter.com"][src*="video.html"]',"object","embed"];o.customSelector&&e.push(o.customSelector);var n=".fitvidsignore";o.ignore&&(n=n+", "+o.ignore);e=r(this).find(e.join(","));(e=(e=e.not("object object")).not(n)).each(function(){var e,t,i=r(this);0<i.parents(n).length||"embed"===this.tagName.toLowerCase()&&i.parent("object").length||i.parent(".fluid-width-video-wrapper").length||(i.css("height")||i.css("width")||!isNaN(i.attr("height"))&&!isNaN(i.attr("width"))||(i.attr("height",9),i.attr("width",16)),e=("object"===this.tagName.toLowerCase()||i.attr("height")&&!isNaN(parseInt(i.attr("height"),10))?parseInt(i.attr("height"),10):i.height())/(isNaN(parseInt(i.attr("width"),10))?i.width():parseInt(i.attr("width"),10)),i.attr("name")||(t="fitvid"+r.fn.fitVids._count,i.attr("name",t),r.fn.fitVids._count++),i.wrap('<div class="fluid-width-video-wrapper"></div>').parent(".fluid-width-video-wrapper").css("padding-top",100*e+"%"),i.removeAttr("height").removeAttr("width"))})})},r.fn.fitVids._count=0}(window.jQuery||window.Zepto),function(e){var t=function(a,R){"use strict";if(R.getElementsByClassName){var H,F,N=R.documentElement,l=a.Date,n=a.HTMLPictureElement,c="addEventListener",q="getAttribute",u=a[c],B=a.setTimeout,d=a.requestAnimationFrame||B,p=a.requestIdleCallback,j=/^picture$/i,o=["load","error","lazyincluded","_lazyloaded"],i={},W=Array.prototype.forEach,U=function(e,t){return i[t]||(i[t]=new RegExp("(\\s|^)"+t+"(\\s|$)")),i[t].test(e[q]("class")||"")&&i[t]},Z=function(e,t){U(e,t)||e.setAttribute("class",(e[q]("class")||"").trim()+" "+t)},Y=function(e,t){var i;(i=U(e,t))&&e.setAttribute("class",(e[q]("class")||"").replace(i," "))},$=function(t,i,e){var n=e?c:"removeEventListener";e&&$(t,i),o.forEach(function(e){t[n](e,i)})},G=function(e,t,i,n,o){var r=R.createEvent("Event");return i||(i={}),i.instance=H,r.initEvent(t,!n,!o),r.detail=i,e.dispatchEvent(r),r},K=function(e,t){var i;!n&&(i=a.picturefill||F.pf)?(t&&t.src&&!e[q]("srcset")&&e.setAttribute("srcset",t.src),i({reevaluate:!0,elements:[e]})):t&&t.src&&(e.src=t.src)},Q=function(e,t){return(getComputedStyle(e,null)||{})[t]},s=function(e,t,i){for(i=i||e.offsetWidth;i<F.minSize&&t&&!e._lazysizesWidth;)i=t.offsetWidth,t=t.parentNode;return i},V=function(){var i,n,t=[],o=[],r=t,s=function(){var e=r;for(r=t.length?o:t,i=!0,n=!1;e.length;)e.shift()();i=!1},e=function(e,t){i&&!t?e.apply(this,arguments):(r.push(e),n||(n=!0,(R.hidden?B:d)(s)))};return e._lsFlush=s,e}(),X=function(i,e){return e?function(){V(i)}:function(){var e=this,t=arguments;V(function(){i.apply(e,t)})}},J=function(e){var i,n=0,o=F.throttleDelay,r=F.ricTimeout,t=function(){i=!1,n=l.now(),e()},s=p&&r>49?function(){p(t,{timeout:r}),r!==F.ricTimeout&&(r=F.ricTimeout)}:X(function(){B(t)},!0);return function(e){var t;(e=!0===e)&&(r=33),i||(i=!0,t=o-(l.now()-n),t<0&&(t=0),e||t<9?s():B(s,t))}},ee=function(e){var t,i,n=99,o=function(){t=null,e()},r=function(){var e=l.now()-i;e<n?B(r,n-e):(p||o)(o)};return function(){i=l.now(),t||(t=B(r,n))}};!function(){var e,t={lazyClass:"lazyload",loadedClass:"lazyloaded",loadingClass:"lazyloading",preloadClass:"lazypreload",errorClass:"lazyerror",autosizesClass:"lazyautosizes",srcAttr:"data-src",srcsetAttr:"data-srcset",sizesAttr:"data-sizes",minSize:40,customMedia:{},init:!0,expFactor:1.5,hFac:.8,loadMode:2,loadHidden:!0,ricTimeout:0,throttleDelay:125};F=a.lazySizesConfig||a.lazysizesConfig||{};for(e in t)e in F||(F[e]=t[e]);a.lazySizesConfig=F,B(function(){F.init&&r()})}();var e=function(){var h,f,d,m,t,g,y,v,b,w,x,S,r=/^img$/i,p=/^iframe$/i,E="onscroll"in a&&!/(gle|ing)bot/.test(navigator.userAgent),I=0,C=0,T=0,k=-1,A=function(e){T--,e&&e.target&&$(e.target,A),(!e||T<0||!e.target)&&(T=0)},z=function(e){return null==S&&(S="hidden"==Q(R.body,"visibility")),S||"hidden"!=Q(e.parentNode,"visibility")&&"hidden"!=Q(e,"visibility")},L=function(e,t){var i,n=e,o=z(e);for(v-=t,x+=t,b-=t,w+=t;o&&(n=n.offsetParent)&&n!=R.body&&n!=N;)(o=(Q(n,"opacity")||1)>0)&&"visible"!=Q(n,"overflow")&&(i=n.getBoundingClientRect(),o=w>i.left&&b<i.right&&x>i.top-1&&v<i.bottom+1);return o},e=function(){var e,t,i,n,o,r,s,a,l,c,u,d,p=H.elements;if((m=F.loadMode)&&T<8&&(e=p.length)){for(t=0,k++,c=!F.expand||F.expand<1?N.clientHeight>500&&N.clientWidth>500?500:370:F.expand,u=c*F.expFactor,d=F.hFac,S=null,C<u&&T<1&&k>2&&m>2&&!R.hidden?(C=u,k=0):C=m>1&&k>1&&T<6?c:I;t<e;t++)if(p[t]&&!p[t]._lazyRace)if(E)if((a=p[t][q]("data-expand"))&&(r=1*a)||(r=C),l!==r&&(g=innerWidth+r*d,y=innerHeight+r,s=-1*r,l=r),i=p[t].getBoundingClientRect(),(x=i.bottom)>=s&&(v=i.top)<=y&&(w=i.right)>=s*d&&(b=i.left)<=g&&(x||w||b||v)&&(F.loadHidden||z(p[t]))&&(f&&T<3&&!a&&(m<3||k<4)||L(p[t],r))){if(O(p[t]),o=!0,T>9)break}else!o&&f&&!n&&T<4&&k<4&&m>2&&(h[0]||F.preloadAfterLoad)&&(h[0]||!a&&(x||w||b||v||"auto"!=p[t][q](F.sizesAttr)))&&(n=h[0]||p[t]);else O(p[t]);n&&!o&&O(n)}},i=J(e),P=function(e){Z(e.target,F.loadedClass),Y(e.target,F.loadingClass),$(e.target,M),G(e.target,"lazyloaded")},n=X(P),M=function(e){n({target:e.target})},D=function(t,i){try{t.contentWindow.location.replace(i)}catch(e){t.src=i}},_=function(e){var t,i=e[q](F.srcsetAttr);(t=F.customMedia[e[q]("data-media")||e[q]("media")])&&e.setAttribute("media",t),i&&e.setAttribute("srcset",i)},s=X(function(e,t,i,n,o){var r,s,a,l,c,u;(c=G(e,"lazybeforeunveil",t)).defaultPrevented||(n&&(i?Z(e,F.autosizesClass):e.setAttribute("sizes",n)),s=e[q](F.srcsetAttr),r=e[q](F.srcAttr),o&&(a=e.parentNode,l=a&&j.test(a.nodeName||"")),u=t.firesLoad||"src"in e&&(s||r||l),c={target:e},u&&($(e,A,!0),clearTimeout(d),d=B(A,2500),Z(e,F.loadingClass),$(e,M,!0)),l&&W.call(a.getElementsByTagName("source"),_),s?e.setAttribute("srcset",s):r&&!l&&(p.test(e.nodeName)?D(e,r):e.src=r),o&&(s||l)&&K(e,{src:r})),e._lazyRace&&delete e._lazyRace,Y(e,F.lazyClass),V(function(){(!u||e.complete&&e.naturalWidth>1)&&(u?A(c):T--,P(c))},!0)}),O=function(e){var t,i=r.test(e.nodeName),n=i&&(e[q](F.sizesAttr)||e[q]("sizes")),o="auto"==n;(!o&&f||!i||!e[q]("src")&&!e.srcset||e.complete||U(e,F.errorClass)||!U(e,F.lazyClass))&&(t=G(e,"lazyunveilread").detail,o&&te.updateElem(e,!0,e.offsetWidth),e._lazyRace=!0,T++,s(e,t,o,n,i))},o=function(){if(!f){if(l.now()-t<999)return void B(o,999);var e=ee(function(){F.loadMode=3,i()});f=!0,F.loadMode=3,i(),u("scroll",function(){3==F.loadMode&&(F.loadMode=2),e()},!0)}};return{_:function(){t=l.now(),H.elements=R.getElementsByClassName(F.lazyClass),h=R.getElementsByClassName(F.lazyClass+" "+F.preloadClass),u("scroll",i,!0),u("resize",i,!0),a.MutationObserver?new MutationObserver(i).observe(N,{childList:!0,subtree:!0,attributes:!0}):(N[c]("DOMNodeInserted",i,!0),N[c]("DOMAttrModified",i,!0),setInterval(i,999)),u("hashchange",i,!0),["focus","mouseover","click","load","transitionend","animationend","webkitAnimationEnd"].forEach(function(e){R[c](e,i,!0)}),/d$|^c/.test(R.readyState)?o():(u("load",o),R[c]("DOMContentLoaded",i),B(o,2e4)),H.elements.length?(e(),V._lsFlush()):i()},checkElems:i,unveil:O}}(),te=function(){var i,r=X(function(e,t,i,n){var o,r,s;if(e._lazysizesWidth=n,n+="px",e.setAttribute("sizes",n),j.test(t.nodeName||""))for(o=t.getElementsByTagName("source"),r=0,s=o.length;r<s;r++)o[r].setAttribute("sizes",n);i.detail.dataAttr||K(e,i.detail)}),n=function(e,t,i){var n,o=e.parentNode;o&&(i=s(e,o,i),n=G(e,"lazybeforesizes",{width:i,dataAttr:!!t}),n.defaultPrevented||(i=n.detail.width)&&i!==e._lazysizesWidth&&r(e,o,n,i))},e=function(){var e,t=i.length;if(t)for(e=0;e<t;e++)n(i[e])},t=ee(e);return{_:function(){i=R.getElementsByClassName(F.autosizesClass),u("resize",t)},checkElems:t,updateElem:n}}(),r=function(){r.i||(r.i=!0,te._(),e._())};return H={cfg:F,autoSizer:te,loader:e,init:r,uP:K,aC:Z,rC:Y,hC:U,fire:G,gW:s,rAF:V}}}(e,e.document);e.lazySizes=t,"object"==typeof module&&module.exports&&(module.exports=t)}(window),function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.PhotoSwipeUI_Default=t()}(this,function(){"use strict";return function(n,a){function e(e){if(k)return!0;e=e||window.event,T.timeToIdle&&T.mouseUsed&&!w&&H();for(var t,i,n=(e.target||e.srcElement).getAttribute("class")||"",o=0;o<N.length;o++)(t=N[o]).onTap&&-1<n.indexOf("pswp__"+t.name)&&(t.onTap(),i=!0);i&&(e.stopPropagation&&e.stopPropagation(),k=!0,e=a.features.isOldAndroid?600:30,setTimeout(function(){k=!1},e))}function t(e,t,i){a[(i?"add":"remove")+"Class"](e,"pswp__"+t)}function i(){var e=1===T.getNumItemsFn();e!==C&&(t(h,"ui--one-slide",e),C=e)}function o(){t(v,"share-modal--hidden",D)}function r(){return(D=!D)?(a.removeClass(v,"pswp__share-modal--fade-in"),setTimeout(function(){D&&o()},300)):(o(),setTimeout(function(){D||a.addClass(v,"pswp__share-modal--fade-in")},30)),D||O(),0}function s(e){var t=(e=e||window.event).target||e.srcElement;return n.shout("shareLinkClick",e,t),!(!t.href||!t.hasAttribute("download")&&(window.open(t.href,"pswp_share","scrollbars=yes,resizable=yes,toolbar=no,location=yes,width=550,height=420,top=100,left="+(window.screen?Math.round(screen.width/2-275):100)),D||r(),1))}function l(e){for(var t=0;t<T.closeElClasses.length;t++)if(a.hasClass(e,"pswp__"+T.closeElClasses[t]))return!0}function c(e){(e=(e=e||window.event).relatedTarget||e.toElement)&&"HTML"!==e.nodeName||(clearTimeout(z),z=setTimeout(function(){L.setIdle(!0)},T.timeToIdleOutside))}function u(e){var t,i=e.vGap;!n.likelyTouchDevice||T.mouseUsed||screen.width>T.fitControlsWidth?(t=T.barsSize,T.captionEl&&"auto"===t.bottom?(m||((m=a.createEl("pswp__caption pswp__caption--fake")).appendChild(a.createEl("pswp__caption__center")),h.insertBefore(m,f),a.addClass(h,"pswp__ui--fit")),T.addCaptionHTMLFn(e,m,!0)?(e=m.clientHeight,i.bottom=parseInt(e,10)||44):i.bottom=t.top):i.bottom="auto"===t.bottom?0:t.bottom,i.top=t.top):i.top=i.bottom=0}function d(){function e(e){if(e)for(var t=e.length,i=0;i<t;i++){o=e[i],r=o.className;for(var n=0;n<N.length;n++)s=N[n],-1<r.indexOf("pswp__"+s.name)&&(T[s.option]?(a.removeClass(o,"pswp__element--disabled"),s.onInit&&s.onInit(o)):a.addClass(o,"pswp__element--disabled"))}}var o,r,s;e(h.children);var t=a.getChildByClass(h,"pswp__top-bar");t&&e(t.children)}var p,h,f,m,g,y,v,b,w,x,S,E,I,C,T,k,A,z,L=this,P=!1,M=!0,D=!0,_={barsSize:{top:44,bottom:"auto"},closeElClasses:["item","caption","zoom-wrap","ui","top-bar"],timeToIdle:4e3,timeToIdleOutside:1e3,loadingIndicatorDelay:1e3,addCaptionHTMLFn:function(e,t){return e.title?(t.children[0].innerHTML=e.title,!0):(t.children[0].innerHTML="",!1)},closeEl:!0,captionEl:!0,fullscreenEl:!0,zoomEl:!0,shareEl:!0,counterEl:!0,arrowEl:!0,preloaderEl:!0,tapToClose:!1,tapToToggleControls:!0,clickToCloseNonZoomable:!0,shareButtons:[{id:"facebook",label:"Share on Facebook",url:"https://www.facebook.com/sharer/sharer.php?u={{url}}"},{id:"twitter",label:"Tweet",url:"https://twitter.com/intent/tweet?text={{text}}&url={{url}}"},{id:"pinterest",label:"Pin it",url:"http://www.pinterest.com/pin/create/button/?url={{url}}&media={{image_url}}&description={{text}}"},{id:"download",label:"Download image",url:"{{raw_image_url}}",download:!0}],getImageURLForShare:function(){return n.currItem.src||""},getPageURLForShare:function(){return window.location.href},getTextForShare:function(){return n.currItem.title||""},indexIndicatorSep:" / ",fitControlsWidth:1200},O=function(){for(var e,t,i,n,o="",r=0;r<T.shareButtons.length;r++)e=T.shareButtons[r],t=T.getImageURLForShare(e),i=T.getPageURLForShare(e),n=T.getTextForShare(e),o+='<a href="'+e.url.replace("{{url}}",encodeURIComponent(i)).replace("{{image_url}}",encodeURIComponent(t)).replace("{{raw_image_url}}",t).replace("{{text}}",encodeURIComponent(n))+'" target="_blank" class="pswp__share--'+e.id+'"'+(e.download?"download":"")+">"+e.label+"</a>",T.parseShareButtonOut&&(o=T.parseShareButtonOut(e,o));v.children[0].innerHTML=o,v.children[0].onclick=s},R=0,H=function(){clearTimeout(z),R=0,w&&L.setIdle(!1)},F=function(e){E!==e&&(t(S,"preloader--active",!e),E=e)},N=[{name:"caption",option:"captionEl",onInit:function(e){f=e}},{name:"share-modal",option:"shareEl",onInit:function(e){v=e},onTap:function(){r()}},{name:"button--share",option:"shareEl",onInit:function(e){y=e},onTap:function(){r()}},{name:"button--zoom",option:"zoomEl",onTap:n.toggleDesktopZoom},{name:"counter",option:"counterEl",onInit:function(e){g=e}},{name:"button--close",option:"closeEl",onTap:n.close},{name:"button--arrow--left",option:"arrowEl",onTap:n.prev},{name:"button--arrow--right",option:"arrowEl",onTap:n.next},{name:"button--fs",option:"fullscreenEl",onTap:function(){p.isFullscreen()?p.exit():p.enter()}},{name:"preloader",option:"preloaderEl",onInit:function(e){S=e}}];L.init=function(){var t;a.extend(n.options,_,!0),T=n.options,h=a.getChildByClass(n.scrollWrap,"pswp__ui"),(x=n.listen)("onVerticalDrag",function(e){M&&e<.95?L.hideControls():!M&&.95<=e&&L.showControls()}),x("onPinchClose",function(e){M&&e<.9?(L.hideControls(),t=!0):t&&!M&&.9<e&&L.showControls()}),x("zoomGestureEnded",function(){(t=!1)&&!M&&L.showControls()}),x("beforeChange",L.update),x("doubleTap",function(e){var t=n.currItem.initialZoomLevel;n.getZoomLevel()!==t?n.zoomTo(t,e,333):n.zoomTo(T.getDoubleTapZoom(!1,n.currItem),e,333)}),x("preventDragEvent",function(e,t,i){var n=e.target||e.srcElement;n&&n.getAttribute("class")&&-1<e.type.indexOf("mouse")&&(0<n.getAttribute("class").indexOf("__caption")||/(SMALL|STRONG|EM)/i.test(n.tagName))&&(i.prevent=!1)}),x("bindEvents",function(){a.bind(h,"pswpTap click",e),a.bind(n.scrollWrap,"pswpTap",L.onGlobalTap),n.likelyTouchDevice||a.bind(n.scrollWrap,"mouseover",L.onMouseOver)}),x("unbindEvents",function(){D||r(),A&&clearInterval(A),a.unbind(document,"mouseout",c),a.unbind(document,"mousemove",H),a.unbind(h,"pswpTap click",e),a.unbind(n.scrollWrap,"pswpTap",L.onGlobalTap),a.unbind(n.scrollWrap,"mouseover",L.onMouseOver),p&&(a.unbind(document,p.eventK,L.updateFullscreen),p.isFullscreen()&&(T.hideAnimationDuration=0,p.exit()),p=null)}),x("destroy",function(){T.captionEl&&(m&&h.removeChild(m),a.removeClass(f,"pswp__caption--empty")),v&&(v.children[0].onclick=null),a.removeClass(h,"pswp__ui--over-close"),a.addClass(h,"pswp__ui--hidden"),L.setIdle(!1)}),T.showAnimationDuration||a.removeClass(h,"pswp__ui--hidden"),x("initialZoomIn",function(){T.showAnimationDuration&&a.removeClass(h,"pswp__ui--hidden")}),x("initialZoomOut",function(){a.addClass(h,"pswp__ui--hidden")}),x("parseVerticalMargin",u),d(),T.shareEl&&y&&v&&(D=!0),i(),T.timeToIdle&&x("mouseUsed",function(){a.bind(document,"mousemove",H),a.bind(document,"mouseout",c),A=setInterval(function(){2===++R&&L.setIdle(!0)},T.timeToIdle/2)}),T.fullscreenEl&&!a.features.isOldAndroid&&((p=p||L.getFullscreenAPI())?(a.bind(document,p.eventK,L.updateFullscreen),L.updateFullscreen(),a.addClass(n.template,"pswp--supports-fs")):a.removeClass(n.template,"pswp--supports-fs")),T.preloaderEl&&(F(!0),x("beforeChange",function(){clearTimeout(I),I=setTimeout(function(){n.currItem&&n.currItem.loading?n.allowProgressiveImg()&&(!n.currItem.img||n.currItem.img.naturalWidth)||F(!1):F(!0)},T.loadingIndicatorDelay)}),x("imageLoadComplete",function(e,t){n.currItem===t&&F(!0)}))},L.setIdle=function(e){t(h,"ui--idle",w=e)},L.update=function(){P=!(!M||!n.currItem)&&(L.updateIndexIndicator(),T.captionEl&&(T.addCaptionHTMLFn(n.currItem,f),t(f,"caption--empty",!n.currItem.title)),!0),D||r(),i()},L.updateFullscreen=function(e){e&&setTimeout(function(){n.setScrollOffset(0,a.getScrollY())},50),a[(p.isFullscreen()?"add":"remove")+"Class"](n.template,"pswp--fs")},L.updateIndexIndicator=function(){T.counterEl&&(g.innerHTML=n.getCurrentIndex()+1+T.indexIndicatorSep+T.getNumItemsFn())},L.onGlobalTap=function(e){var t=(e=e||window.event).target||e.srcElement;if(!k)if(e.detail&&"mouse"===e.detail.pointerType)l(t)?n.close():a.hasClass(t,"pswp__img")&&(1===n.getZoomLevel()&&n.getZoomLevel()<=n.currItem.fitRatio?T.clickToCloseNonZoomable&&n.close():n.toggleDesktopZoom(e.detail.releasePoint));else if(T.tapToToggleControls&&(M?L.hideControls():L.showControls()),T.tapToClose&&(a.hasClass(t,"pswp__img")||l(t)))return void n.close()},L.onMouseOver=function(e){e=(e=e||window.event).target||e.srcElement;t(h,"ui--over-close",l(e))},L.hideControls=function(){a.addClass(h,"pswp__ui--hidden"),M=!1},L.showControls=function(){M=!0,P||L.update(),a.removeClass(h,"pswp__ui--hidden")},L.supportsFullscreen=function(){var e=document;return!!(e.exitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen||e.msExitFullscreen)},L.getFullscreenAPI=function(){var e,t=document.documentElement,i="fullscreenchange";return t.requestFullscreen?e={enterK:"requestFullscreen",exitK:"exitFullscreen",elementK:"fullscreenElement",eventK:i}:t.mozRequestFullScreen?e={enterK:"mozRequestFullScreen",exitK:"mozCancelFullScreen",elementK:"mozFullScreenElement",eventK:"moz"+i}:t.webkitRequestFullscreen?e={enterK:"webkitRequestFullscreen",exitK:"webkitExitFullscreen",elementK:"webkitFullscreenElement",eventK:"webkit"+i}:t.msRequestFullscreen&&(e={enterK:"msRequestFullscreen",exitK:"msExitFullscreen",elementK:"msFullscreenElement",eventK:"MSFullscreenChange"}),e&&(e.enter=function(){return b=T.closeOnScroll,T.closeOnScroll=!1,"webkitRequestFullscreen"!==this.enterK?n.template[this.enterK]():void n.template[this.enterK](Element.ALLOW_KEYBOARD_INPUT)},e.exit=function(){return T.closeOnScroll=b,document[this.exitK]()},e.isFullscreen=function(){return document[this.elementK]}),e}}}),function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.PhotoSwipe=t()}(this,function(){"use strict";return function(h,i,e,t){var f={features:null,bind:function(e,t,i,n){var o=(n?"remove":"add")+"EventListener";t=t.split(" ");for(var r=0;r<t.length;r++)t[r]&&e[o](t[r],i,!1)},isArray:function(e){return e instanceof Array},createEl:function(e,t){t=document.createElement(t||"div");return e&&(t.className=e),t},getScrollY:function(){var e=window.pageYOffset;return void 0!==e?e:document.documentElement.scrollTop},unbind:function(e,t,i){f.bind(e,t,i,!0)},removeClass:function(e,t){t=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className=e.className.replace(t," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")},addClass:function(e,t){f.hasClass(e,t)||(e.className+=(e.className?" ":"")+t)},hasClass:function(e,t){return e.className&&new RegExp("(^|\\s)"+t+"(\\s|$)").test(e.className)},getChildByClass:function(e,t){for(var i=e.firstChild;i;){if(f.hasClass(i,t))return i;i=i.nextSibling}},arraySearch:function(e,t,i){for(var n=e.length;n--;)if(e[n][i]===t)return n;return-1},extend:function(e,t,i){for(var n in t)if(t.hasOwnProperty(n)){if(i&&e.hasOwnProperty(n))continue;e[n]=t[n]}},easing:{sine:{out:function(e){return Math.sin(e*(Math.PI/2))},inOut:function(e){return-(Math.cos(Math.PI*e)-1)/2}},cubic:{out:function(e){return--e*e*e+1}}},detectFeatures:function(){if(f.features)return f.features;var e,t,i=f.createEl().style,n="",o={};o.oldIE=document.all&&!document.addEventListener,o.touch="ontouchstart"in window,window.requestAnimationFrame&&(o.raf=window.requestAnimationFrame,o.caf=window.cancelAnimationFrame),o.pointerEvent=!!window.PointerEvent||navigator.msPointerEnabled,o.pointerEvent||(e=navigator.userAgent,!/iP(hone|od)/.test(navigator.platform)||(t=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/))&&0<t.length&&(1<=(t=parseInt(t[1],10))&&t<8&&(o.isOldIOSPhone=!0)),t=(t=e.match(/Android\s([0-9\.]*)/))?t[1]:0,1<=(t=parseFloat(t))&&(t<4.4&&(o.isOldAndroid=!0),o.androidVersion=t),o.isMobileOpera=/opera mini|opera mobi/i.test(e));for(var r,s,a,l=["transform","perspective","animationName"],c=["","webkit","Moz","ms","O"],u=0;u<4;u++){for(var n=c[u],d=0;d<3;d++)r=l[d],s=n+(n?r.charAt(0).toUpperCase()+r.slice(1):r),!o[r]&&s in i&&(o[r]=s);n&&!o.raf&&(n=n.toLowerCase(),o.raf=window[n+"RequestAnimationFrame"],o.raf&&(o.caf=window[n+"CancelAnimationFrame"]||window[n+"CancelRequestAnimationFrame"]))}return o.raf||(a=0,o.raf=function(e){var t=(new Date).getTime(),i=Math.max(0,16-(t-a)),n=window.setTimeout(function(){e(t+i)},i);return a=t+i,n},o.caf=function(e){clearTimeout(e)}),o.svg=!!document.createElementNS&&!!document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,f.features=o}};f.detectFeatures(),f.features.oldIE&&(f.bind=function(e,t,i,n){t=t.split(" ");for(var o,r=(n?"detach":"attach")+"Event",s=function(){i.handleEvent.call(i)},a=0;a<t.length;a++)if(o=t[a])if("object"==typeof i&&i.handleEvent){if(n){if(!i["oldIE"+o])return!1}else i["oldIE"+o]=s;e[r]("on"+o,i["oldIE"+o])}else e[r]("on"+o,i)});var m=this,g={allowPanToNext:!0,spacing:.12,bgOpacity:1,mouseUsed:!1,loop:!0,pinchToClose:!0,closeOnScroll:!0,closeOnVerticalDrag:!0,verticalDragRange:.75,hideAnimationDuration:333,showAnimationDuration:333,showHideOpacity:!1,focus:!0,escKey:!0,arrowKeys:!0,mainScrollEndFriction:.35,panEndFriction:.35,isClickableElement:function(e){return"A"===e.tagName},getDoubleTapZoom:function(e,t){return e||t.initialZoomLevel<.7?1:1.33},maxSpreadZoom:1.33,modal:!0,scaleMode:"fit"};f.extend(g,t);function n(){return{x:0,y:0}}function o(e,t){f.extend(m,t.publicMethods),Ve.push(e)}function s(e){var t=Yt();return t-1<e?e-t:e<0?t+e:e}function r(e,t){return et[e]||(et[e]=[]),et[e].push(t)}function y(e){var t=et[e];if(t){var i=Array.prototype.slice.call(arguments);i.shift();for(var n=0;n<t.length;n++)t[n].apply(m,i)}}function u(){return(new Date).getTime()}function v(e){Ne=e,m.bg.style.opacity=e*g.bgOpacity}function a(e,t,i,n,o){(!Je||o&&o!==m.currItem)&&(n/=(o||m.currItem).fitRatio),e[ae]=V+t+"px, "+i+"px"+X+" scale("+n+")"}function d(e,t){var i;!g.loop&&t&&(i=W+(Ge.x*Ye-e)/Ge.x,t=Math.round(e-wt.x),(i<0&&0<t||i>=Yt()-1&&t<0)&&(e=wt.x+t*g.mainScrollEndFriction)),wt.x=e,nt(e,U)}function l(e,t){var i=xt[e]-$e[e];return We[e]+je[e]+i-t/Q*i}function b(e,t){e.x=t.x,e.y=t.y,t.id&&(e.id=t.id)}function c(e){e.x=Math.round(e.x),e.y=Math.round(e.y)}function p(e,t){return e=Vt(m.currItem,Ze,e),t&&(De=e),e}function w(e){return(e=e||m.currItem).initialZoomLevel}function x(e){return 0<(e=e||m.currItem).w?g.maxSpreadZoom:1}function S(e,t,i,n){return n===m.currItem.initialZoomLevel?(i[e]=m.currItem.initialPosition[e],!0):(i[e]=l(e,n),i[e]>t.min[e]?(i[e]=t.min[e],!0):i[e]<t.max[e]&&(i[e]=t.max[e],!0))}function E(e){var t="";g.escKey&&27===e.keyCode?t="close":g.arrowKeys&&(37===e.keyCode?t="prev":39===e.keyCode&&(t="next")),t&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey||(e.preventDefault?e.preventDefault():e.returnValue=!1,m[t]()))}function I(e){e&&(ke||Te||Oe||Se)&&(e.preventDefault(),e.stopPropagation())}function C(){m.setScrollOffset(0,f.getScrollY())}function T(e){st[e]&&(st[e].raf&&de(st[e].raf),at--,delete st[e])}function k(e){st[e]&&T(e),st[e]||(at++,st[e]={})}function A(){for(var e in st)st.hasOwnProperty(e)&&T(e)}function z(e,t,i,n,o,r,s){var a,l=u();k(e);var c=function(){if(st[e]){if(a=u()-l,n<=a)return T(e),r(i),void(s&&s());r((i-t)*o(a/n)+t),st[e].raf=ue(c)}};c()}function L(e,t){return gt.x=Math.abs(e.x-t.x),gt.y=Math.abs(e.y-t.y),Math.sqrt(gt.x*gt.x+gt.y*gt.y)}function P(e,t){return Tt.prevent=!Ct(e.target,g.isClickableElement),y("preventDragEvent",e,t,Tt),Tt.prevent}function M(e,t){return t.x=e.pageX,t.y=e.pageY,t.id=e.identifier,t}function D(e,t,i){i.x=.5*(e.x+t.x),i.y=.5*(e.y+t.y)}function _(){var e=Ue.y-m.currItem.initialPosition.y;return 1-Math.abs(e/(Ze.y/2))}function O(e){for(;0<zt.length;)zt.pop();return le?(Be=0,ht.forEach(function(e){0===Be?zt[0]=e:1===Be&&(zt[1]=e),Be++})):-1<e.type.indexOf("touch")?e.touches&&0<e.touches.length&&(zt[0]=M(e.touches[0],kt),1<e.touches.length&&(zt[1]=M(e.touches[1],At))):(kt.x=e.pageX,kt.y=e.pageY,kt.id="",zt[0]=kt),zt}function R(e,t){var i,n,o,r=Ue[e]+t[e],s=0<t[e],a=wt.x+t.x,l=wt.x-ft.x,c=r>De.min[e]||r<De.max[e]?g.panEndFriction:1,r=Ue[e]+t[e]*c;return!g.allowPanToNext&&K!==m.currItem.initialZoomLevel||(_e?"h"!==Re||"x"!==e||Te||(s?(r>De.min[e]&&(c=g.panEndFriction,De.min[e],i=De.min[e]-We[e]),(i<=0||l<0)&&1<Yt()?(o=a,l<0&&a>ft.x&&(o=ft.x)):De.min.x!==De.max.x&&(n=r)):(r<De.max[e]&&(c=g.panEndFriction,De.max[e],i=We[e]-De.max[e]),(i<=0||0<l)&&1<Yt()?(o=a,0<l&&a<ft.x&&(o=ft.x)):De.min.x!==De.max.x&&(n=r))):o=a,"x"!==e)?void(Oe||ze||K>m.currItem.fitRatio&&(Ue[e]+=t[e]*c)):(void 0!==o&&(d(o,!0),ze=o!==ft.x),De.min.x!==De.max.x&&(void 0!==n?Ue.x=n:ze||(Ue.x+=t.x*c)),void 0!==o)}function H(e){var t;"mousedown"===e.type&&0<e.button||(Ut?e.preventDefault():Ee&&"mousedown"===e.type||(P(e,!0)&&e.preventDefault(),y("pointerDown"),le&&((t=f.arraySearch(ht,e.pointerId,"id"))<0&&(t=ht.length),ht[t]={x:e.pageX,y:e.pageY,id:e.pointerId}),e=(t=O(e)).length,Le=null,A(),Ie&&1!==e||(Ie=He=!0,f.bind(window,Y,m),xe=qe=Fe=Se=ze=ke=Ce=Te=!1,Re=null,y("firstTouchStart",t),b(We,Ue),je.x=je.y=0,b(dt,t[0]),b(pt,dt),ft.x=Ge.x*Ye,mt=[{x:dt.x,y:dt.y}],be=ve=u(),p(K,!0),Et(),It()),!Pe&&1<e&&!Oe&&!ze&&(Q=K,Pe=Ce=!(Te=!1),je.y=je.x=0,b(We,Ue),b(lt,t[0]),b(ct,t[1]),D(lt,ct,St),xt.x=Math.abs(St.x)-Ue.x,xt.y=Math.abs(St.y)-Ue.y,Me=L(lt,ct))))}function F(e){var t,i;e.preventDefault(),le&&-1<(t=f.arraySearch(ht,e.pointerId,"id"))&&((i=ht[t]).x=e.pageX,i.y=e.pageY),Ie&&(i=O(e),Re||ke||Pe?Le=i:wt.x!==Ge.x*Ye?Re="h":(e=Math.abs(i[0].x-dt.x)-Math.abs(i[0].y-dt.y),10<=Math.abs(e)&&(Re=0<e?"h":"v",Le=i)))}function N(e){if(ge.isOldAndroid){if(Ee&&"mouseup"===e.type)return;-1<e.type.indexOf("touch")&&(clearTimeout(Ee),Ee=setTimeout(function(){Ee=0},600))}y("pointerUp"),P(e,!1)&&e.preventDefault(),!le||-1<(i=f.arraySearch(ht,e.pointerId,"id"))&&(r=ht.splice(i,1)[0],navigator.msPointerEnabled?(r.type={4:"mouse",2:"touch",3:"pen"}[e.pointerType],r.type||(r.type=e.pointerType||"mouse")):r.type=e.pointerType||"mouse");var t=O(e),i=t.length;if(2===(i="mouseup"===e.type?0:i))return!(Le=null);1===i&&b(pt,t[0]),0!==i||Re||Oe||(r||("mouseup"===e.type?r={x:e.pageX,y:e.pageY,type:"mouse"}:e.changedTouches&&e.changedTouches[0]&&(r={x:e.changedTouches[0].pageX,y:e.changedTouches[0].pageY,type:"touch"})),y("touchRelease",e,r));var n,o,r=-1;if(0===i&&(Ie=!1,f.unbind(window,Y,m),Et(),Pe?r=0:-1!==bt&&(r=u()-bt)),bt=1===i?u():-1,r=-1!==r&&r<150?"zoom":"swipe",Pe&&i<2&&(Pe=!1,1===i&&(r="zoomPointerUp"),y("zoomGestureEnded")),Le=null,ke||Te||Oe||Se)if(A(),(we=we||Pt()).calculateSwipeSpeed("x"),Se)_()<g.verticalDragRange?m.close():(n=Ue.y,o=Ne,z("verticalDrag",0,1,300,f.easing.cubic.out,function(e){Ue.y=(m.currItem.initialPosition.y-n)*e+n,v((1-o)*e+o),tt()}),y("onVerticalDrag",1));else{if((ze||Oe)&&0===i){if(Dt(r,we))return;r="zoomPointerUp"}if(!Oe)return"swipe"!==r?void Ot():void(!ze&&K>m.currItem.fitRatio&&Mt(we))}}var q,B,j,W,U,Z,Y,$,G,K,Q,V,X,J,ee,te,ie,ne,oe,re,se,ae,le,ce,ue,de,pe,he,fe,me,ge,ye,ve,be,we,xe,Se,Ee,Ie,Ce,Te,ke,Ae,ze,Le,Pe,Me,De,_e,Oe,Re,He,Fe,Ne,qe,Be,je=n(),We=n(),Ue=n(),Ze={},Ye=0,$e={},Ge=n(),Ke=0,Qe=!0,Ve=[],Xe={},Je=!1,et={},tt=function(e){_e&&(e&&(K>m.currItem.fitRatio?Je||(Xt(m.currItem,!1,!0),Je=!0):Je&&(Xt(m.currItem),Je=!1)),a(_e,Ue.x,Ue.y,K))},it=function(e){e.container&&a(e.container.style,e.initialPosition.x,e.initialPosition.y,e.initialZoomLevel,e)},nt=function(e,t){t[ae]=V+e+"px, 0px"+X},ot=null,rt=function(){ot&&(f.unbind(document,"mousemove",rt),f.addClass(h,"pswp--has_mouse"),g.mouseUsed=!0,y("mouseUsed")),ot=setTimeout(function(){ot=null},100)},st={},at=0,t={shout:y,listen:r,viewportSize:Ze,options:g,isMainScrollAnimating:function(){return Oe},getZoomLevel:function(){return K},getCurrentIndex:function(){return W},isDragging:function(){return Ie},isZooming:function(){return Pe},setScrollOffset:function(e,t){$e.x=e,me=$e.y=t,y("updateScrollOffset",$e)},applyZoomPan:function(e,t,i,n){Ue.x=t,Ue.y=i,K=e,tt(n)},init:function(){if(!q&&!B){var e;m.framework=f,m.template=h,m.bg=f.getChildByClass(h,"pswp__bg"),pe=h.className,q=!0,ge=f.detectFeatures(),ue=ge.raf,de=ge.caf,ae=ge.transform,fe=ge.oldIE,m.scrollWrap=f.getChildByClass(h,"pswp__scroll-wrap"),m.container=f.getChildByClass(m.scrollWrap,"pswp__container"),U=m.container.style,m.itemHolders=te=[{el:m.container.children[0],wrap:0,index:-1},{el:m.container.children[1],wrap:0,index:-1},{el:m.container.children[2],wrap:0,index:-1}],te[0].el.style.display=te[2].el.style.display="none",function(){if(ae){var e=ge.perspective&&!ce;return V="translate"+(e?"3d(":"("),X=ge.perspective?", 0px)":")"}ae="left",f.addClass(h,"pswp--ie"),nt=function(e,t){t.left=e+"px"},it=function(e){var t=1<e.fitRatio?1:e.fitRatio,i=e.container.style,n=t*e.w,t=t*e.h;i.width=n+"px",i.height=t+"px",i.left=e.initialPosition.x+"px",i.top=e.initialPosition.y+"px"},tt=function(){var e,t,i,n;_e&&(e=_e,i=(t=1<(n=m.currItem).fitRatio?1:n.fitRatio)*n.w,n=t*n.h,e.width=i+"px",e.height=n+"px",e.left=Ue.x+"px",e.top=Ue.y+"px")}}(),G={resize:m.updateSize,orientationchange:function(){clearTimeout(ye),ye=setTimeout(function(){Ze.x!==m.scrollWrap.clientWidth&&m.updateSize()},500)},scroll:C,keydown:E,click:I};var t=ge.isOldIOSPhone||ge.isOldAndroid||ge.isMobileOpera;for(ge.animationName&&ge.transform&&!t||(g.showAnimationDuration=g.hideAnimationDuration=0),e=0;e<Ve.length;e++)m["init"+Ve[e]]();i&&(m.ui=new i(m,f)).init(),y("firstUpdate"),W=W||g.index||0,(isNaN(W)||W<0||W>=Yt())&&(W=0),m.currItem=Zt(W),(ge.isOldIOSPhone||ge.isOldAndroid)&&(Qe=!1),h.setAttribute("aria-hidden","false"),g.modal&&(Qe?h.style.position="fixed":(h.style.position="absolute",h.style.top=f.getScrollY()+"px")),void 0===me&&(y("initialLayout"),me=he=f.getScrollY());t="pswp--open ";for(g.mainClass&&(t+=g.mainClass+" "),g.showHideOpacity&&(t+="pswp--animate_opacity "),t+=ce?"pswp--touch":"pswp--notouch",t+=ge.animationName?" pswp--css_animation":"",t+=ge.svg?" pswp--svg":"",f.addClass(h,t),m.updateSize(),Z=-1,Ke=null,e=0;e<3;e++)nt((e+Z)*Ge.x,te[e].el.style);fe||f.bind(m.scrollWrap,$,m),r("initialZoomInEnd",function(){m.setContent(te[0],W-1),m.setContent(te[2],W+1),te[0].el.style.display=te[2].el.style.display="block",g.focus&&h.focus(),f.bind(document,"keydown",m),ge.transform&&f.bind(m.scrollWrap,"click",m),g.mouseUsed||f.bind(document,"mousemove",rt),f.bind(window,"resize scroll orientationchange",m),y("bindEvents")}),m.setContent(te[1],W),m.updateCurrItem(),y("afterInit"),Qe||(J=setInterval(function(){at||Ie||Pe||K!==m.currItem.initialZoomLevel||m.updateSize()},1e3)),f.addClass(h,"pswp--visible")}},close:function(){q&&(B=!(q=!1),y("close"),f.unbind(window,"resize scroll orientationchange",m),f.unbind(window,"scroll",G.scroll),f.unbind(document,"keydown",m),f.unbind(document,"mousemove",rt),ge.transform&&f.unbind(m.scrollWrap,"click",m),Ie&&f.unbind(window,Y,m),clearTimeout(ye),y("unbindEvents"),$t(m.currItem,null,!0,m.destroy))},destroy:function(){y("destroy"),Bt&&clearTimeout(Bt),h.setAttribute("aria-hidden","true"),h.className=pe,J&&clearInterval(J),f.unbind(m.scrollWrap,$,m),f.unbind(window,"scroll",m),Et(),A(),et=null},panTo:function(e,t,i){i||(e>De.min.x?e=De.min.x:e<De.max.x&&(e=De.max.x),t>De.min.y?t=De.min.y:t<De.max.y&&(t=De.max.y)),Ue.x=e,Ue.y=t,tt()},handleEvent:function(e){e=e||window.event,G[e.type]&&G[e.type](e)},goTo:function(e){var t=(e=s(e))-W;Ke=t,W=e,m.currItem=Zt(W),Ye-=t,d(Ge.x*Ye),A(),Oe=!1,m.updateCurrItem()},next:function(){m.goTo(W+1)},prev:function(){m.goTo(W-1)},updateCurrZoomItem:function(e){var t;e&&y("beforeChange",0),_e=te[1].el.children.length?(t=te[1].el.children[0],f.hasClass(t,"pswp__zoom-wrap")?t.style:null):null,De=m.currItem.bounds,Q=K=m.currItem.initialZoomLevel,Ue.x=De.center.x,Ue.y=De.center.y,e&&y("afterChange")},invalidateCurrItems:function(){ee=!0;for(var e=0;e<3;e++)te[e].item&&(te[e].item.needsUpdate=!0)},updateCurrItem:function(e){if(0!==Ke){var t,i=Math.abs(Ke);if(!(e&&i<2)){m.currItem=Zt(W),Je=!1,y("beforeChange",Ke),3<=i&&(Z+=Ke+(0<Ke?-3:3),i=3);for(var n=0;n<i;n++)0<Ke?(t=te.shift(),te[2]=t,nt((++Z+2)*Ge.x,t.el.style),m.setContent(t,W-i+n+1+1)):(t=te.pop(),te.unshift(t),nt(--Z*Ge.x,t.el.style),m.setContent(t,W+i-n-1-1));!_e||1!==Math.abs(Ke)||(e=Zt(ie)).initialZoomLevel!==K&&(Vt(e,Ze),Xt(e),it(e)),Ke=0,m.updateCurrZoomItem(),ie=W,y("afterChange")}}},updateSize:function(e){if(!Qe&&g.modal){var t=f.getScrollY();if(me!==t&&(h.style.top=t+"px",me=t),!e&&Xe.x===window.innerWidth&&Xe.y===window.innerHeight)return;Xe.x=window.innerWidth,Xe.y=window.innerHeight,h.style.height=Xe.y+"px"}if(Ze.x=m.scrollWrap.clientWidth,Ze.y=m.scrollWrap.clientHeight,C(),Ge.x=Ze.x+Math.round(Ze.x*g.spacing),Ge.y=Ze.y,d(Ge.x*Ye),y("beforeResize"),void 0!==Z){for(var i,n,o,r=0;r<3;r++)i=te[r],nt((r+Z)*Ge.x,i.el.style),o=W+r-1,g.loop&&2<Yt()&&(o=s(o)),(n=Zt(o))&&(ee||n.needsUpdate||!n.bounds)?(m.cleanSlide(n),m.setContent(i,o),1===r&&(m.currItem=n,m.updateCurrZoomItem(!0)),n.needsUpdate=!1):-1===i.index&&0<=o&&m.setContent(i,o),n&&n.container&&(Vt(n,Ze),Xt(n),it(n));ee=!1}Q=K=m.currItem.initialZoomLevel,(De=m.currItem.bounds)&&(Ue.x=De.center.x,Ue.y=De.center.y,tt(!0)),y("resize")},zoomTo:function(t,e,i,n,o){e&&(Q=K,xt.x=Math.abs(e.x)-Ue.x,xt.y=Math.abs(e.y)-Ue.y,b(We,Ue));var e=p(t,!1),r={};S("x",e,r,t),S("y",e,r,t);var s=K,a=Ue.x,l=Ue.y;c(r);e=function(e){1===e?(K=t,Ue.x=r.x,Ue.y=r.y):(K=(t-s)*e+s,Ue.x=(r.x-a)*e+a,Ue.y=(r.y-l)*e+l),o&&o(e),tt(1===e)};i?z("customZoomTo",0,1,i,n||f.easing.sine.inOut,e):e(1)}},lt={},ct={},ut={},dt={},pt={},ht=[],ft={},mt=[],gt={},yt=0,vt=n(),bt=0,wt=n(),xt=n(),St=n(),Et=function(){Ae&&(de(Ae),Ae=null)},It=function(){Ie&&(Ae=ue(It),Lt())},Ct=function(e,t){return!(!e||e===document)&&!(e.getAttribute("class")&&-1<e.getAttribute("class").indexOf("pswp__scroll-wrap"))&&(t(e)?e:Ct(e.parentNode,t))},Tt={},kt={},At={},zt=[],Lt=function(){if(Le){var e=Le.length;if(0!==e)if(b(lt,Le[0]),ut.x=lt.x-dt.x,ut.y=lt.y-dt.y,Pe&&1<e)dt.x=lt.x,dt.y=lt.y,(ut.x||ut.y||(r=Le[1],s=ct,r.x!==s.x||r.y!==s.y))&&(b(ct,Le[1]),Te||(Te=!0,y("zoomGestureStarted")),n=L(lt,ct),(o=_t(n))>m.currItem.initialZoomLevel+m.currItem.initialZoomLevel/15&&(qe=!0),i=1,e=w(),r=x(),o<e?g.pinchToClose&&!qe&&Q<=m.currItem.initialZoomLevel?(v(s=1-(e-o)/(e/1.2)),y("onPinchClose",s),Fe=!0):o=e-(i=1<(i=(e-o)/e)?1:i)*(e/3):r<o&&(o=r+(i=1<(i=(o-r)/(6*e))?1:i)*e),i<0&&(i=0),D(lt,ct,vt),je.x+=vt.x-St.x,je.y+=vt.y-St.y,b(St,vt),Ue.x=l("x",o),Ue.y=l("y",o),xe=K<o,K=o,tt());else if(Re&&(He&&(He=!1,10<=Math.abs(ut.x)&&(ut.x-=Le[0].x-pt.x),10<=Math.abs(ut.y)&&(ut.y-=Le[0].y-pt.y)),dt.x=lt.x,dt.y=lt.y,0!==ut.x||0!==ut.y)){if("v"===Re&&g.closeOnVerticalDrag&&"fit"===g.scaleMode&&K===m.currItem.initialZoomLevel){je.y+=ut.y,Ue.y+=ut.y;var t=_();return Se=!0,y("onVerticalDrag",t),v(t),void tt()}i=u(),n=lt.x,o=lt.y,50<i-be&&((t=2<mt.length?mt.shift():{}).x=n,t.y=o,mt.push(t),be=i),ke=!0,De=m.currItem.bounds,R("x",ut)||(R("y",ut),c(Ue),tt())}}var i,n,o,r,s},Pt=function(){var t,i,n={lastFlickOffset:{},lastFlickDist:{},lastFlickSpeed:{},slowDownRatio:{},slowDownRatioReverse:{},speedDecelerationRatio:{},speedDecelerationRatioAbs:{},distanceOffset:{},backAnimDestination:{},backAnimStarted:{},calculateSwipeSpeed:function(e){i=1<mt.length?(t=u()-be+50,mt[mt.length-2][e]):(t=u()-ve,pt[e]),n.lastFlickOffset[e]=dt[e]-i,n.lastFlickDist[e]=Math.abs(n.lastFlickOffset[e]),20<n.lastFlickDist[e]?n.lastFlickSpeed[e]=n.lastFlickOffset[e]/t:n.lastFlickSpeed[e]=0,Math.abs(n.lastFlickSpeed[e])<.1&&(n.lastFlickSpeed[e]=0),n.slowDownRatio[e]=.95,n.slowDownRatioReverse[e]=1-n.slowDownRatio[e],n.speedDecelerationRatio[e]=1},calculateOverBoundsAnimOffset:function(t,e){n.backAnimStarted[t]||(Ue[t]>De.min[t]?n.backAnimDestination[t]=De.min[t]:Ue[t]<De.max[t]&&(n.backAnimDestination[t]=De.max[t]),void 0!==n.backAnimDestination[t]&&(n.slowDownRatio[t]=.7,n.slowDownRatioReverse[t]=1-n.slowDownRatio[t],n.speedDecelerationRatioAbs[t]<.05&&(n.lastFlickSpeed[t]=0,n.backAnimStarted[t]=!0,z("bounceZoomPan"+t,Ue[t],n.backAnimDestination[t],e||300,f.easing.sine.out,function(e){Ue[t]=e,tt()}))))},calculateAnimOffset:function(e){n.backAnimStarted[e]||(n.speedDecelerationRatio[e]=n.speedDecelerationRatio[e]*(n.slowDownRatio[e]+n.slowDownRatioReverse[e]-n.slowDownRatioReverse[e]*n.timeDiff/10),n.speedDecelerationRatioAbs[e]=Math.abs(n.lastFlickSpeed[e]*n.speedDecelerationRatio[e]),n.distanceOffset[e]=n.lastFlickSpeed[e]*n.speedDecelerationRatio[e]*n.timeDiff,Ue[e]+=n.distanceOffset[e])},panAnimLoop:function(){if(st.zoomPan&&(st.zoomPan.raf=ue(n.panAnimLoop),n.now=u(),n.timeDiff=n.now-n.lastNow,n.lastNow=n.now,n.calculateAnimOffset("x"),n.calculateAnimOffset("y"),tt(),n.calculateOverBoundsAnimOffset("x"),n.calculateOverBoundsAnimOffset("y"),n.speedDecelerationRatioAbs.x<.05&&n.speedDecelerationRatioAbs.y<.05))return Ue.x=Math.round(Ue.x),Ue.y=Math.round(Ue.y),tt(),void T("zoomPan")}};return n},Mt=function(e){return e.calculateSwipeSpeed("y"),De=m.currItem.bounds,e.backAnimDestination={},e.backAnimStarted={},Math.abs(e.lastFlickSpeed.x)<=.05&&Math.abs(e.lastFlickSpeed.y)<=.05?(e.speedDecelerationRatioAbs.x=e.speedDecelerationRatioAbs.y=0,e.calculateOverBoundsAnimOffset("x"),e.calculateOverBoundsAnimOffset("y"),!0):(k("zoomPan"),e.lastNow=u(),void e.panAnimLoop())},Dt=function(e,t){var i,n;Oe||(yt=W),"swipe"===e&&(n=dt.x-pt.x,e=t.lastFlickDist.x<10,30<n&&(e||20<t.lastFlickOffset.x)?r=-1:n<-30&&(e||t.lastFlickOffset.x<-20)&&(r=1)),r&&((W+=r)<0?(W=g.loop?Yt()-1:0,o=!0):W>=Yt()&&(W=g.loop?0:Yt()-1,o=!0),o&&!g.loop||(Ke+=r,Ye-=r,i=!0));var o=Ge.x*Ye,r=Math.abs(o-wt.x),s=i||o>wt.x==0<t.lastFlickSpeed.x?(s=0<Math.abs(t.lastFlickSpeed.x)?r/Math.abs(t.lastFlickSpeed.x):333,s=Math.min(s,400),Math.max(s,250)):333;return yt===W&&(i=!1),Oe=!0,y("mainScrollAnimStart"),z("mainScroll",wt.x,o,s,f.easing.cubic.out,d,function(){A(),Oe=!1,yt=-1,!i&&yt===W||m.updateCurrItem(),y("mainScrollAnimComplete")}),i&&m.updateCurrItem(!0),i},_t=function(e){return 1/Me*e*Q},Ot=function(){var e=K,t=w(),i=x();K<t?e=t:i<K&&(e=i);var n,o=Ne;return Fe&&!xe&&!qe&&K<t?m.close():(Fe&&(n=function(e){v((1-o)*e+o)}),m.zoomTo(e,0,200,f.easing.cubic.out,n)),!0};o("Gestures",{publicMethods:{initGestures:function(){function e(e,t,i,n,o){ne=e+t,oe=e+i,re=e+n,se=o?e+o:""}(le=ge.pointerEvent)&&ge.touch&&(ge.touch=!1),le?navigator.msPointerEnabled?e("MSPointer","Down","Move","Up","Cancel"):e("pointer","down","move","up","cancel"):ge.touch?(e("touch","start","move","end","cancel"),ce=!0):e("mouse","down","move","up"),Y=oe+" "+re+" "+se,$=ne,le&&!ce&&(ce=1<navigator.maxTouchPoints||1<navigator.msMaxTouchPoints),m.likelyTouchDevice=ce,G[ne]=H,G[oe]=F,G[re]=N,se&&(G[se]=G[re]),ge.touch&&($+=" mousedown",Y+=" mousemove mouseup",G.mousedown=G[ne],G.mousemove=G[oe],G.mouseup=G[re]),ce||(g.allowPanToNext=!1)}}});function Rt(){return{center:{x:0,y:0},max:{x:0,y:0},min:{x:0,y:0}}}function Ht(e,t,i,n,o,r){t.loadError||n&&(t.imageAppended=!0,Xt(t,n,t===m.currItem&&Je),i.appendChild(n),r&&setTimeout(function(){t&&t.loaded&&t.placeholder&&(t.placeholder.style.display="none",t.placeholder=null)},500))}function Ft(e){function t(){e.loading=!1,e.loaded=!0,e.loadComplete?e.loadComplete(e):e.img=null,i.onload=i.onerror=null,i=null}e.loading=!0,e.loaded=!1;var i=e.img=f.createEl("pswp__img","img");return i.onload=t,i.onerror=function(){e.loadError=!0,t()},i.src=e.src,i}function Nt(e,t){return e.src&&e.loadError&&e.container&&(t&&(e.container.innerHTML=""),e.container.innerHTML=g.errorMsg.replace("%url%",e.src),1)}function qt(){if(Kt.length){for(var e,t=0;t<Kt.length;t++)(e=Kt[t]).holder.index===e.index&&Ht(e.index,e.item,e.baseDiv,e.img,0,e.clearPlaceholder);Kt=[]}}var Bt,jt,Wt,Ut,Zt,Yt,$t=function(s,e,a,t){var l;Bt&&clearTimeout(Bt),Wt=Ut=!0,s.initialLayout?(l=s.initialLayout,s.initialLayout=null):l=g.getThumbBoundsFn&&g.getThumbBoundsFn(W);function c(){T("initialZoom"),a?(m.template.removeAttribute("style"),m.bg.removeAttribute("style")):(v(1),e&&(e.style.display="block"),f.addClass(h,"pswp--animated-in"),y("initialZoom"+(a?"OutEnd":"InEnd"))),t&&t(),Ut=!1}var u=a?g.hideAnimationDuration:g.showAnimationDuration;if(!u||!l||void 0===l.x)return y("initialZoom"+(a?"Out":"In")),K=s.initialZoomLevel,b(Ue,s.initialPosition),tt(),h.style.opacity=a?0:1,v(1),void(u?setTimeout(function(){c()},u):c());var d,p;d=j,p=!m.currItem.src||m.currItem.loadError||g.showHideOpacity,s.miniImg&&(s.miniImg.style.webkitBackfaceVisibility="hidden"),a||(K=l.w/s.w,Ue.x=l.x,Ue.y=l.y-he,m[p?"template":"bg"].style.opacity=.001,tt()),k("initialZoom"),a&&!d&&f.removeClass(h,"pswp--animated-in"),p&&(a?f[(d?"remove":"add")+"Class"](h,"pswp--animate_opacity"):setTimeout(function(){f.addClass(h,"pswp--animate_opacity")},30)),Bt=setTimeout(function(){var t,i,n,o,r,e;y("initialZoom"+(a?"Out":"In")),a?(t=l.w/s.w,i=Ue.x,n=Ue.y,o=K,r=Ne,e=function(e){1===e?(K=t,Ue.x=l.x,Ue.y=l.y-me):(K=(t-o)*e+o,Ue.x=(l.x-i)*e+i,Ue.y=(l.y-me-n)*e+n),tt(),p?h.style.opacity=1-e:v(r-e*r)},d?z("initialZoom",0,1,u,f.easing.cubic.out,e,c):(e(1),Bt=setTimeout(c,u+20))):(K=s.initialZoomLevel,b(Ue,s.initialPosition),tt(),v(1),p?h.style.opacity=1:v(1),Bt=setTimeout(c,u+20))},a?25:90)},Gt={},Kt=[],Qt={index:0,errorMsg:'<div class="pswp__error-msg"><a href="%url%" target="_blank">The image</a> could not be loaded.</div>',forceProgressiveLoading:!1,preload:[1,1],getNumItemsFn:function(){return jt.length}},Vt=function(e,t,i){if(!e.src||e.loadError)return e.w=e.h=0,e.initialZoomLevel=e.fitRatio=1,e.bounds=Rt(),e.initialPosition=e.bounds.center,e.bounds;var n,o,r,s=!i;return s&&(e.vGap||(e.vGap={top:0,bottom:0}),y("parseVerticalMargin",e)),Gt.x=t.x,Gt.y=t.y-e.vGap.top-e.vGap.bottom,s&&(n=Gt.x/e.w,o=Gt.y/e.h,e.fitRatio=n<o?n:o,"orig"===(r=g.scaleMode)?i=1:"fit"===r&&(i=e.fitRatio),1<i&&(i=1),e.initialZoomLevel=i,e.bounds||(e.bounds=Rt())),i?(n=(t=e).w*i,o=e.h*i,(r=t.bounds).center.x=Math.round((Gt.x-n)/2),r.center.y=Math.round((Gt.y-o)/2)+t.vGap.top,r.max.x=n>Gt.x?Math.round(Gt.x-n):r.center.x,r.max.y=o>Gt.y?Math.round(Gt.y-o)+t.vGap.top:r.center.y,r.min.x=n>Gt.x?0:r.center.x,r.min.y=o>Gt.y?t.vGap.top:r.center.y,s&&i===e.initialZoomLevel&&(e.initialPosition=e.bounds.center),e.bounds):void 0},Xt=function(e,t,i){var n;e.src&&(t=t||e.container.lastChild,n=i?e.w:Math.round(e.w*e.fitRatio),i=i?e.h:Math.round(e.h*e.fitRatio),e.placeholder&&!e.loaded&&(e.placeholder.style.width=n+"px",e.placeholder.style.height=i+"px"),t.style.width=n+"px",t.style.height=i+"px")};o("Controller",{publicMethods:{lazyLoadItem:function(e){e=s(e);var t=Zt(e);t&&(!t.loaded&&!t.loading||ee)&&(y("gettingData",e,t),t.src&&Ft(t))},initController:function(){f.extend(g,Qt,!0),m.items=jt=e,Zt=m.getItemAt,Yt=g.getNumItemsFn,g.loop,Yt()<3&&(g.loop=!1),r("beforeChange",function(e){for(var t=g.preload,i=null===e||0<=e,n=Math.min(t[0],Yt()),o=Math.min(t[1],Yt()),r=1;r<=(i?o:n);r++)m.lazyLoadItem(W+r);for(r=1;r<=(i?n:o);r++)m.lazyLoadItem(W-r)}),r("initialLayout",function(){m.currItem.initialLayout=g.getThumbBoundsFn&&g.getThumbBoundsFn(W)}),r("mainScrollAnimComplete",qt),r("initialZoomInEnd",qt),r("destroy",function(){for(var e,t=0;t<jt.length;t++)(e=jt[t]).container&&(e.container=null),e.placeholder&&(e.placeholder=null),e.img&&(e.img=null),e.preloader&&(e.preloader=null),e.loadError&&(e.loaded=e.loadError=!1);Kt=null})},getItemAt:function(e){return 0<=e&&void 0!==jt[e]&&jt[e]},allowProgressiveImg:function(){return g.forceProgressiveLoading||!ce||g.mouseUsed||1200<screen.width},setContent:function(t,i){g.loop&&(i=s(i));var e=m.getItemAt(t.index);e&&(e.container=null);var n,o,r=m.getItemAt(i);r?(y("gettingData",i,r),t.index=i,o=(t.item=r).container=f.createEl("pswp__zoom-wrap"),!r.src&&r.html&&(r.html.tagName?o.appendChild(r.html):o.innerHTML=r.html),Nt(r),Vt(r,Ze),!r.src||r.loadError||r.loaded?r.src&&!r.loadError&&((n=f.createEl("pswp__img","img")).style.opacity=1,n.src=r.src,Xt(r,n),Ht(0,r,o,n)):(r.loadComplete=function(e){if(q){if(t&&t.index===i){if(Nt(e,!0))return e.loadComplete=e.img=null,Vt(e,Ze),it(e),void(t.index===W&&m.updateCurrZoomItem());e.imageAppended?!Ut&&e.placeholder&&(e.placeholder.style.display="none",e.placeholder=null):ge.transform&&(Oe||Ut)?Kt.push({item:e,baseDiv:o,img:e.img,index:i,holder:t,clearPlaceholder:!0}):Ht(0,e,o,e.img,0,!0)}e.loadComplete=null,e.img=null,y("imageLoadComplete",i,e)}},f.features.transform&&(e="pswp__img pswp__img--placeholder",e+=r.msrc?"":" pswp__img--placeholder--blank",e=f.createEl(e,r.msrc?"img":""),r.msrc&&(e.src=r.msrc),Xt(r,e),o.appendChild(e),r.placeholder=e),r.loading||Ft(r),m.allowProgressiveImg()&&(!Wt&&ge.transform?Kt.push({item:r,baseDiv:o,img:r.img,index:i,holder:t}):Ht(0,r,o,r.img,0,!0))),Wt||i!==W?it(r):(_e=o.style,$t(r,n||r.img)),t.el.innerHTML="",t.el.appendChild(o)):t.el.innerHTML=""},cleanSlide:function(e){e.img&&(e.img.onload=e.img.onerror=null),e.loaded=e.loading=e.img=e.imageAppended=!1}}});function Jt(e,t,i){var n=document.createEvent("CustomEvent"),i={origEvent:e,target:e.target,releasePoint:t,pointerType:i||"touch"};n.initCustomEvent("pswpTap",!0,!0,i),e.target.dispatchEvent(n)}var ei,ti,ii={};o("Tap",{publicMethods:{initTap:function(){r("firstTouchStart",m.onTapStart),r("touchRelease",m.onTapRelease),r("destroy",function(){ii={},ei=null})},onTapStart:function(e){1<e.length&&(clearTimeout(ei),ei=null)},onTapRelease:function(e,t){var i,n,o;!t||ke||Ce||at||(i=t,ei&&(clearTimeout(ei),ei=null,n=i,o=ii,Math.abs(n.x-o.x)<25&&Math.abs(n.y-o.y)<25)?y("doubleTap",i):"mouse"!==t.type?"BUTTON"===e.target.tagName.toUpperCase()||f.hasClass(e.target,"pswp__single-tap")?Jt(e,t):(b(ii,i),ei=setTimeout(function(){Jt(e,t),ei=null},300)):Jt(e,t,"mouse"))}}}),o("DesktopZoom",{publicMethods:{initDesktopZoom:function(){fe||(ce?r("mouseUsed",function(){m.setupDesktopZoom()}):m.setupDesktopZoom(!0))},setupDesktopZoom:function(e){ti={};var t="wheel mousewheel DOMMouseScroll";r("bindEvents",function(){f.bind(h,t,m.handleMouseWheel)}),r("unbindEvents",function(){ti&&f.unbind(h,t,m.handleMouseWheel)}),m.mouseZoomedIn=!1;function i(){m.mouseZoomedIn&&(f.removeClass(h,"pswp--zoomed-in"),m.mouseZoomedIn=!1),K<1?f.addClass(h,"pswp--zoom-allowed"):f.removeClass(h,"pswp--zoom-allowed"),o()}var n,o=function(){n&&(f.removeClass(h,"pswp--dragging"),n=!1)};r("resize",i),r("afterChange",i),r("pointerDown",function(){m.mouseZoomedIn&&(n=!0,f.addClass(h,"pswp--dragging"))}),r("pointerUp",o),e||i()},handleMouseWheel:function(e){if(K<=m.currItem.fitRatio)return g.modal&&(!g.closeOnScroll||at||Ie?e.preventDefault():ae&&2<Math.abs(e.deltaY)&&(j=!0,m.close())),!0;if(e.stopPropagation(),ti.x=0,"deltaX"in e)1===e.deltaMode?(ti.x=18*e.deltaX,ti.y=18*e.deltaY):(ti.x=e.deltaX,ti.y=e.deltaY);else if("wheelDelta"in e)e.wheelDeltaX&&(ti.x=-.16*e.wheelDeltaX),e.wheelDeltaY?ti.y=-.16*e.wheelDeltaY:ti.y=-.16*e.wheelDelta;else{if(!("detail"in e))return;ti.y=e.detail}p(K,!0);var t=Ue.x-ti.x,i=Ue.y-ti.y;(g.modal||t<=De.min.x&&t>=De.max.x&&i<=De.min.y&&i>=De.max.y)&&e.preventDefault(),m.panTo(t,i)},toggleDesktopZoom:function(e){e=e||{x:Ze.x/2+$e.x,y:Ze.y/2+$e.y};var t=g.getDoubleTapZoom(!0,m.currItem),i=K===t;m.mouseZoomedIn=!i,m.zoomTo(i?m.currItem.initialZoomLevel:t,e,333),f[(i?"remove":"add")+"Class"](h,"pswp--zoomed-in")}}});function ni(){return gi.hash.substring(1)}function oi(){si&&clearTimeout(si),li&&clearTimeout(li)}function ri(){var e=ni(),t={};if(e.length<5)return t;var i,n=e.split("&");for(r=0;r<n.length;r++)n[r]&&((i=n[r].split("=")).length<2||(t[i[0]]=i[1]));if(g.galleryPIDs){for(var o=t.pid,r=t.pid=0;r<jt.length;r++)if(jt[r].pid===o){t.pid=r;break}}else t.pid=parseInt(t.pid,10)-1;return t.pid<0&&(t.pid=0),t}var si,ai,li,ci,ui,di,pi,hi,fi,mi,gi,yi,vi={history:!0,galleryUID:1},bi=function(){var e,t;li&&clearTimeout(li),at||Ie?li=setTimeout(bi,500):(ci?clearTimeout(ai):ci=!0,t=W+1,(e=Zt(W)).hasOwnProperty("pid")&&(t=e.pid),e=pi+"&gid="+g.galleryUID+"&pid="+t,hi||-1===gi.hash.indexOf(e)&&(mi=!0),t=gi.href.split("#")[0]+"#"+e,yi?"#"+e!==window.location.hash&&history[hi?"replaceState":"pushState"]("",document.title,t):hi?gi.replace(t):gi.hash=e,hi=!0,ai=setTimeout(function(){ci=!1},60))};o("History",{publicMethods:{initHistory:function(){var e,t;f.extend(g,vi,!0),g.history&&(gi=window.location,hi=fi=mi=!1,pi=ni(),yi="pushState"in history,-1<pi.indexOf("gid=")&&(pi=(pi=pi.split("&gid=")[0]).split("?gid=")[0]),r("afterChange",m.updateURL),r("unbindEvents",function(){f.unbind(window,"hashchange",m.onHashChange)}),e=function(){di=!0,fi||(mi?history.back():pi?gi.hash=pi:yi?history.pushState("",document.title,gi.pathname+gi.search):gi.hash=""),oi()},r("unbindEvents",function(){j&&e()}),r("destroy",function(){di||e()}),r("firstUpdate",function(){W=ri().pid}),-1<(t=pi.indexOf("pid="))&&("&"===(pi=pi.substring(0,t)).slice(-1)&&(pi=pi.slice(0,-1))),setTimeout(function(){q&&f.bind(window,"hashchange",m.onHashChange)},40))},onHashChange:function(){return ni()===pi?(fi=!0,void m.close()):void(ci||(ui=!0,m.goTo(ri().pid),ui=!1))},updateURL:function(){oi(),ui||(hi?si=setTimeout(bi,800):bi())}}}),f.extend(m,t)}}),function(f){f.fn.theiaStickySidebar=function(e){var t,i;function n(e,t){return!0===e.initialized||!(f("body").width()<e.minWidth)&&(t=t,(p=e).initialized=!0,f("head").append(f('<style>.theiaStickySidebar:after {content: ""; display: table; clear: both;}</style>')),t.each(function(){var i,e={};e.sidebar=f(this),e.options=p||{},e.container=f(e.options.containerSelector),0==e.container.length&&(e.container=e.sidebar.parent()),e.sidebar.parents().css("-webkit-transform","none"),e.sidebar.css({position:"relative",overflow:"visible","-webkit-box-sizing":"border-box","-moz-box-sizing":"border-box","box-sizing":"border-box"}),e.stickySidebar=e.sidebar.find(".theiaStickySidebar"),0==e.stickySidebar.length&&(i=/(?:text|application)\/(?:x-)?(?:javascript|ecmascript)/i,e.sidebar.find("script").filter(function(e,t){return 0===t.type.length||t.type.match(i)}).remove(),e.stickySidebar=f("<div>").addClass("theiaStickySidebar").append(e.sidebar.children()),e.sidebar.append(e.stickySidebar)),e.marginBottom=parseInt(e.sidebar.css("margin-bottom")),e.paddingTop=parseInt(e.sidebar.css("padding-top")),e.paddingBottom=parseInt(e.sidebar.css("padding-bottom"));var t,n,o=e.stickySidebar.offset().top,r=e.stickySidebar.outerHeight();function d(){e.fixedScrollTop=0,e.sidebar.css({"min-height":"1px"}),e.stickySidebar.css({position:"static",width:"",transform:"none"})}e.stickySidebar.css("padding-top",1),e.stickySidebar.css("padding-bottom",1),o-=e.stickySidebar.offset().top,r=e.stickySidebar.outerHeight()-r-o,0==o?(e.stickySidebar.css("padding-top",0),e.stickySidebarPaddingTop=0):e.stickySidebarPaddingTop=1,0==r?(e.stickySidebar.css("padding-bottom",0),e.stickySidebarPaddingBottom=0):e.stickySidebarPaddingBottom=1,e.previousScrollTop=null,e.fixedScrollTop=0,d(),e.onScroll=function(e){if(e.stickySidebar.is(":visible"))if(f("body").width()<e.options.minWidth)d();else{if(e.options.disableOnResponsiveLayouts)if(e.sidebar.outerWidth("none"==e.sidebar.css("float"))+50>e.container.width())return void d();var t,i,n,o,r,s,a,l,c=f(document).scrollTop(),u="static";c>=e.sidebar.offset().top+(e.paddingTop-e.options.additionalMarginTop)&&(i=e.paddingTop+p.additionalMarginTop,r=e.paddingBottom+e.marginBottom+p.additionalMarginBottom,o=e.sidebar.offset().top,n=e.sidebar.offset().top+(s=e.container,a=s.height(),s.children().each(function(){a=Math.max(a,f(this).height())}),a),t=0+p.additionalMarginTop,s=e.stickySidebar.outerHeight()+i+r<f(window).height()?t+e.stickySidebar.outerHeight():f(window).height()-e.marginBottom-e.paddingBottom-p.additionalMarginBottom,i=o-c+e.paddingTop,r=n-c-e.paddingBottom-e.marginBottom,o=e.stickySidebar.offset().top-c,n=e.previousScrollTop-c,"fixed"==e.stickySidebar.css("position")&&"modern"==e.options.sidebarBehavior&&(o+=n),"stick-to-top"==e.options.sidebarBehavior&&(o=p.additionalMarginTop),"stick-to-bottom"==e.options.sidebarBehavior&&(o=s-e.stickySidebar.outerHeight()),o=0<n?Math.min(o,t):Math.max(o,s-e.stickySidebar.outerHeight()),o=Math.max(o,i),o=Math.min(o,r-e.stickySidebar.outerHeight()),u=((r=e.container.height()==e.stickySidebar.outerHeight())||o!=t)&&(r||o!=s-e.stickySidebar.outerHeight())?c+o-e.sidebar.offset().top-e.paddingTop<=p.additionalMarginTop?"static":"absolute":"fixed"),"fixed"==u?(l=f(document).scrollLeft(),e.stickySidebar.css({position:"fixed",width:h(e.stickySidebar)+"px",transform:"translateY("+o+"px)",left:e.sidebar.offset().left+parseInt(e.sidebar.css("padding-left"))-l+"px",top:"0px"})):"absolute"==u?(l={},"absolute"!=e.stickySidebar.css("position")&&(l.position="absolute",l.transform="translateY("+(c+o-e.sidebar.offset().top-e.stickySidebarPaddingTop-e.stickySidebarPaddingBottom)+"px)",l.top="0px"),l.width=h(e.stickySidebar)+"px",l.left="",e.stickySidebar.css(l)):"static"==u&&d(),"static"!=u&&1==e.options.updateSidebarHeight&&e.sidebar.css({"min-height":e.stickySidebar.outerHeight()+e.stickySidebar.offset().top-e.sidebar.offset().top+e.paddingBottom}),e.previousScrollTop=c}},e.onScroll(e),f(document).scroll((t=e,function(){t.onScroll(t)})),f(window).resize((n=e,function(){n.stickySidebar.css({position:"static"}),n.onScroll(n)}))}),!0);var p}function h(e){var t;try{t=e[0].getBoundingClientRect().width}catch(e){}return t=void 0===t?e.width():t}(e=f.extend({containerSelector:"",additionalMarginTop:0,additionalMarginBottom:0,updateSidebarHeight:!0,minWidth:0,disableOnResponsiveLayouts:!0,sidebarBehavior:"modern"},e)).additionalMarginTop=parseInt(e.additionalMarginTop)||0,e.additionalMarginBottom=parseInt(e.additionalMarginBottom)||0,n(t=e,i=this)||(console.log("TSS: Body width smaller than options.minWidth. Init is delayed."),f(document).scroll(function(t,i){return function(e){n(t,i)&&f(this).unbind(e)}}(t,i)),f(window).resize(function(t,i){return function(e){n(t,i)&&f(this).unbind(e)}}(t,i)))}}(jQuery);var body=$("body");function author(){"use strict";$(".author-name").on("click",function(){$(this).next(".author-social").toggleClass("enabled")})}function stickySidebar(){"use strict";jQuery(".sidebar-column, .related-column").theiaStickySidebar({additionalMarginTop:30,additionalMarginBottom:30})}function pagination(){"use strict";var e=$(".post-feed .row"),n=$(".infinite-scroll-button");body.hasClass("paged-next")&&(e.on("request.infiniteScroll",function(e,t){n.hide()}),e.on("load.infiniteScroll",function(e,t,i){$(t).find("body").hasClass("paged-next")&&n.show()}),e.infiniteScroll({append:".post-column",button:".infinite-scroll-button",debug:!1,hideNav:".pagination",history:!1,path:".pagination .older-posts",scrollThreshold:!1,status:".infinite-scroll-status"}))}function facebook(){"use strict";var e=$(".widget-facebook");"__YOUR_FACEBOOK_PAGE_URL__"==e.find(".fb-page").attr("data-href")&&e.remove()}function video(){"use strict";$(".post-content").fitVids()}function gallery(){"use strict";document.querySelectorAll(".kg-gallery-image img").forEach(function(e){var t=e.closest(".kg-gallery-image"),e=e.attributes.width.value/e.attributes.height.value;t.style.flex=e+" 1 0%"}),pswp(".kg-gallery-container",".kg-gallery-image",".kg-gallery-image",!1,!0),pswp(".kg-image-card",".kg-image",".kg-image",!1,!1)}function offCanvas(){"use strict";$(".burger:not(.burger.close)").on("click",function(){body.addClass("canvas-visible canvas-opened"),dimmer("open","medium")}),$(".burger-close").on("click",function(){body.hasClass("canvas-opened")&&(body.removeClass("canvas-opened"),dimmer("close","medium"))}),$(".dimmer").on("click",function(){body.hasClass("canvas-opened")&&(body.removeClass("canvas-opened"),dimmer("close","medium"))})}function pswp(i,a,l,c,u){function n(e,t){var n,i,o,r,s=document.querySelectorAll(".pswp")[0];r=[],$(t).find(a).each(function(e,t){i=$(t),i.find(l),o={src:(u?i.find("img"):i).attr("src"),w:0,h:0},c&&i.find(c).length&&(o.title=i.find(c).html()),r.push(o)}),(n=new PhotoSwipe(s,PhotoSwipeUI_Default,r,{closeOnScroll:!1,history:!1,index:e,shareEl:!1,showAnimationDuration:0,showHideOpacity:!0})).listen("gettingData",function(e,t){var i;(t.w<1||t.h<1)&&((i=new Image).onload=function(){t.w=this.width,t.h=this.height,n.updateSize(!0)},i.src=t.src)}),n.init()}$(i).on("click",l,function(e){!function(e){e.preventDefault();var t=$(e.target).closest(i).find(a).index($(e.target).closest(a)),e=$(e.target).closest(i);n(t,e[0])}(e)})}function dimmer(e,t){"use strict";var i=$(".dimmer");switch(e){case"open":i.fadeIn(t);break;case"close":i.fadeOut(t)}}window.lazySizesConfig=window.lazySizesConfig||{},window.lazySizesConfig.loadHidden=!1,$(function(){"use strict";author(),stickySidebar(),pagination(),facebook(),video(),gallery(),offCanvas()});
|
|
//# sourceMappingURL=main.min.js.map
|