Ghost_Ruby_Theme/assets/built/main.min.js
2020-09-24 10:33:22 +08:00

2 lines
78 KiB
JavaScript

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