!function(t){"use strict";function e(){ t.querySelector("body").insertAdjacentHTML("afterbegin",'') }function i(t,e){var e=e||{},i=e.size?"icon--"+e.size:"",o="icon icon--"+t+" "+i+" "+(e.class||"");return"
"+c("",o)+"
"}function c(t,e){return e.indexOf("spinner")>-1?"
"+t+"
":t}function o(){for(var e=t.querySelectorAll("[data-icon]"),c=0;c0},t.prototype.next=function(){return!!this.hasNext()&&this.run(this.context.nextUrl)},t.prototype.run=function(e){var i,c,o;if("string"!=typeof this.options.clientId&&"string"!=typeof this.options.accessToken)throw new Error("Missing clientId or accessToken.");if("string"!=typeof this.options.accessToken&&"string"!=typeof this.options.clientId)throw new Error("Missing clientId or accessToken.");return null!=this.options.before&&"function"==typeof this.options.before&&this.options.before.call(this),"undefined"!=typeof document&&null!==document&&(o=document.createElement("script"),o.id="instafeed-fetcher",o.src=e||this._buildUrl(),i=document.getElementsByTagName("head"),i[0].appendChild(o),c="instafeedCache"+this.unique,window[c]=new t(this.options,this),window[c].unique=this.unique),!0},t.prototype.parse=function(t){var e,i,c,o,a,h,s,n,l,p,r,d,v,m,u,f,z,y,M,b,w,g,x,B,k,_,H,C,L,V,j;if("object"!=typeof t){if(null!=this.options.error&&"function"==typeof this.options.error)return this.options.error.call(this,"Invalid JSON data"),!1;throw new Error("Invalid JSON response")}if(200!==t.meta.code){if(null!=this.options.error&&"function"==typeof this.options.error)return this.options.error.call(this,t.meta.error_message),!1;throw new Error("Error from Instagram: "+t.meta.error_message)}if(0===t.data.length){if(null!=this.options.error&&"function"==typeof this.options.error)return this.options.error.call(this,"No images were returned from Instagram"),!1;throw new Error("No images were returned from Instagram")}if(null!=this.options.success&&"function"==typeof this.options.success&&this.options.success.call(this,t),this.context.nextUrl="",null!=t.pagination&&(this.context.nextUrl=t.pagination.next_url),"none"!==this.options.sortBy)switch(L="random"===this.options.sortBy?["","random"]:this.options.sortBy.split("-"),C="least"===L[0],L[1]){case"random":t.data.sort(function(){return.5-Math.random()});break;case"recent":t.data=this._sortBy(t.data,"created_time",C);break;case"liked":t.data=this._sortBy(t.data,"likes.count",C);break;case"commented":t.data=this._sortBy(t.data,"comments.count",C);break;default:throw new Error("Invalid option for sortBy: '"+this.options.sortBy+"'.")}if("undefined"!=typeof document&&null!==document&&!1===this.options.mock){if(u=t.data,H=parseInt(this.options.limit,10),null!=this.options.limit&&u.length>H&&(u=u.slice(0,H)),h=document.createDocumentFragment(),null!=this.options.filter&&"function"==typeof this.options.filter&&(u=this._filter(u,this.options.filter)),null!=this.options.template&&"string"==typeof this.options.template){for(n="",v="","",j=document.createElement("div"),p=0,x=u.length;pz&&(y="landscape"),M=0,l&&!this.options.useHttp&&(m=m.replace(/https?:\/\//,"//")),v=this._makeTemplate(this.options.template,{model:r,id:r.id,link:r.link,type:r.type,image:m,width:M,height:z,orientation:y,caption:this._getObjectProperty(r,"caption.text"),likes:r.likes.count,comments:r.comments.count,location:this._getObjectProperty(r,"location.name")}),n+=v}for(j.innerHTML=n,o=[],c=0,i=j.childNodes.length;c=0,l&&!this.options.useHttp&&(m=m.replace(/https?:\/\//,"//")),f.src=m,!0===this.options.links?(e=document.createElement("a"),e.href=r.link,e.appendChild(f),h.appendChild(e)):h.appendChild(f)}if(V=this.options.target,"string"==typeof V&&(V=document.getElementById(V)),null==V)throw a='No element with id="'+this.options.target+'" on page.',new Error(a);V.appendChild(h),s=document.getElementsByTagName("head")[0],s.removeChild(document.getElementById("instafeed-fetcher")),b="instafeedCache"+this.unique,window[b]=void 0;try{delete window[b]}catch(t){t}}return null!=this.options.after&&"function"==typeof this.options.after&&this.options.after.call(this),!0},t.prototype._buildUrl=function(){var t,e,i;switch(t="https://api.instagram.com/v1",this.options.get){case"popular":e="media/popular";break;case"tagged":if(!this.options.tagName)throw new Error("No tag name specified. Use the 'tagName' option.");e="tags/"+this.options.tagName+"/media/recent";break;case"location":if(!this.options.locationId)throw new Error("No location specified. Use the 'locationId' option.");e="locations/"+this.options.locationId+"/media/recent";break;case"user":if(!this.options.userId)throw new Error("No user specified. Use the 'userId' option.");e="users/"+this.options.userId+"/media/recent";break;default:throw new Error("Invalid option for get: '"+this.options.get+"'.")}return i=t+"/"+e,null!=this.options.accessToken?i+="?access_token="+this.options.accessToken:i+="?client_id="+this.options.clientId,null!=this.options.limit&&(i+="&count="+this.options.limit),i+="&callback=instafeedCache"+this.unique+".parse"},t.prototype._genKey=function(){var t;return""+(t=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)})()+t()+t()+t()},t.prototype._makeTemplate=function(t,e){var i,c,o,a,h;for(c=/(?:\{{2})([\w\[\]\.]+)(?:\}{2})/,i=t;c.test(i);)a=i.match(c)[1],h=null!=(o=this._getObjectProperty(e,a))?o:"",i=i.replace(c,function(){return""+h});return i},t.prototype._getObjectProperty=function(t,e){var i,c;for(e=e.replace(/\[(\w+)\]/g,".$1"),c=e.split(".");c.length;){if(i=c.shift(),!(null!=t&&i in t))return null;t=t[i]}return t},t.prototype._sortBy=function(t,e,i){var c;return c=function(t,c){var o,a;return o=this._getObjectProperty(t,e),a=this._getObjectProperty(c,e),i?o>a?1:-1:ox

',c.appendChild(o.childNodes[1])}return e&&t.extend(i,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"];i.customSelector&&e.push(i.customSelector);var c=".fitvidsignore";i.ignore&&(c=c+", "+i.ignore);var o=t(this).find(e.join(","));o=o.not("object object"),o=o.not(c),o.each(function(){var e=t(this);if(!(e.parents(c).length>0||"embed"===this.tagName.toLowerCase()&&e.parent("object").length||e.parent(".fluid-width-video-wrapper").length)){e.css("height")||e.css("width")||!isNaN(e.attr("height"))&&!isNaN(e.attr("width"))||(e.attr("height",9),e.attr("width",16));var i="object"===this.tagName.toLowerCase()||e.attr("height")&&!isNaN(parseInt(e.attr("height"),10))?parseInt(e.attr("height"),10):e.height(),o=isNaN(parseInt(e.attr("width"),10))?e.width():parseInt(e.attr("width"),10),a=i/o;if(!e.attr("name")){var h="fitvid"+t.fn.fitVids._count;e.attr("name",h),t.fn.fitVids._count++}e.wrap('
').parent(".fluid-width-video-wrapper").css("padding-top",100*a+"%"),e.removeAttr("height").removeAttr("width")}})})},t.fn.fitVids._count=0}(window.jQuery||window.Zepto),function(t){t.fn.viewportChecker=function(e){var i={classToAdd:"visible",classToRemove:"invisible",classToAddForFullView:"full-visible",removeClassAfterAnimation:!1,offset:100,repeat:!1,invertBottomOffset:!0,callbackFunction:function(t,e){},scrollHorizontal:!1,scrollBox:window};t.extend(i,e);var c=this,o={height:t(i.scrollBox).height(),width:t(i.scrollBox).width()};return this.checkElements=function(){var e,a;i.scrollHorizontal?(e=Math.max(t("html").scrollLeft(),t("body").scrollLeft(),t(window).scrollLeft()),a=e+o.width):(e=Math.max(t("html").scrollTop(),t("body").scrollTop(),t(window).scrollTop()),a=e+o.height),c.each(function(){var c=t(this),h={},s={};if(c.data("vp-add-class")&&(s.classToAdd=c.data("vp-add-class")),c.data("vp-remove-class")&&(s.classToRemove=c.data("vp-remove-class")),c.data("vp-add-class-full-view")&&(s.classToAddForFullView=c.data("vp-add-class-full-view")),c.data("vp-keep-add-class")&&(s.removeClassAfterAnimation=c.data("vp-remove-after-animation")),c.data("vp-offset")&&(s.offset=c.data("vp-offset")),c.data("vp-repeat")&&(s.repeat=c.data("vp-repeat")),c.data("vp-scrollHorizontal")&&(s.scrollHorizontal=c.data("vp-scrollHorizontal")),c.data("vp-invertBottomOffset")&&(s.scrollHorizontal=c.data("vp-invertBottomOffset")),t.extend(h,i),t.extend(h,s),!c.data("vp-animated")||h.repeat){String(h.offset).indexOf("%")>0&&(h.offset=parseInt(h.offset)/100*o.height);var n=h.scrollHorizontal?c.offset().left:c.offset().top,l=h.scrollHorizontal?n+c.width():n+c.height(),p=Math.round(n)+h.offset,r=h.scrollHorizontal?p+c.width():p+c.height();h.invertBottomOffset&&(r-=2*h.offset),pe?(c.removeClass(h.classToRemove),c.addClass(h.classToAdd),h.callbackFunction(c,"add"),l<=a&&n>=e?c.addClass(h.classToAddForFullView):c.removeClass(h.classToAddForFullView),c.data("vp-animated",!0),h.removeClassAfterAnimation&&c.one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",function(){c.removeClass(h.classToAdd)})):c.hasClass(h.classToAdd)&&h.repeat&&(c.removeClass(h.classToAdd+" "+h.classToAddForFullView),h.callbackFunction(c,"remove"),c.data("vp-animated",!1))}})},("ontouchstart"in window||"onmsgesturechange"in window)&&t(document).bind("touchmove MSPointerMove pointermove",this.checkElements),t(i.scrollBox).bind("load scroll",this.checkElements),t(window).resize(function(e){o={height:t(i.scrollBox).height(),width:t(i.scrollBox).width()},c.checkElements()}),this.checkElements(),this}}(jQuery),function(){var t=navigator.userAgent.toLowerCase().indexOf("webkit")>-1,e=navigator.userAgent.toLowerCase().indexOf("opera")>-1,i=navigator.userAgent.toLowerCase().indexOf("msie")>-1;(t||e||i)&&document.getElementById&&window.addEventListener&&window.addEventListener("hashchange",function(){var t,e=location.hash.substring(1);/^[A-z0-9_-]+$/.test(e)&&(t=document.getElementById(e))&&(/^(?:a|select|input|button|textarea)$/i.test(t.tagName)||(t.tabIndex=-1),t.focus())},!1)}(),function(t){"use strict";t(".js-fadein, .wp-post-image").viewportChecker({classToAdd:"is-inview",offset:100,removeClassAfterAnimation:!0}),t(".c-content, .comment-content").fitVids({customSelector:['iframe[src*="ted.com"]','[src*="videopress.com"]','iframe[src*="facebook.com"]','iframe[src*="player.twitch.tv"]','iframe[src*="dailymotion.com"]']}),t(".js-off-canvas-toggle").click(function(e){e.preventDefault(),t(".js-off-canvas-content, .js-off-canvas-container").toggleClass("is-active")});var e=t(".js-search-input");(t(".js-search-toggle").click(function(i){i.preventDefault(),t(".js-search").addClass("is-active"),t(".js-off-canvas-container").removeClass("is-active"),setTimeout(function(){e.focus()},500)}),t(".c-search, .js-search-close, .js-search-close .icon").on("click keyup",function(e){(e.target==this||e.target.classList.contains("js-search-close")||e.target.classList.contains("icon")||27==e.keyCode)&&t(".c-search").removeClass("is-active")}),t("#instafeed-post").length)&&new Instafeed({get:"user",target:"instafeed-post",limit:bisonno_instagram_widget_config.limit,resolution:"thumbnail",userId:bisonno_instagram_widget_config.userId,accessToken:bisonno_instagram_widget_config.accessToken,template:'
{{caption}}
'}).run();if(t("#instafeed-footer").length){new Instafeed({get:"user",target:"instafeed-footer",limit:bisonno_instagram_widget_config.limit,resolution:"thumbnail",userId:bisonno_instagram_widget_config.userId,accessToken:bisonno_instagram_widget_config.accessToken,template:'
{{caption}}
'}).run()}var i=t(".js-load-posts"),c=bisonno_config.bisonno_page_number_next,o=bisonno_config.bisonno_page_link_next;i.click(function(e){e.preventDefault();var a=o.replace("9999999999",c);t.ajax({url:a,beforeSend:function(){i.text(bisonno_config.bisonno_loading),i.addClass("c-btn--loading")}}).done(function(e){var o=t(".js-post-card-wrap",e);i.text(bisonno_config.bisonno_load_more),i.removeClass("c-btn--loading"),t(".js-grid").append(o),t(".js-fadein").viewportChecker({classToAdd:"is-inview",offset:100,removeClassAfterAnimation:!0}),++c>bisonno_config.bisonno_page_number_max&&i.addClass("c-btn--disabled").attr("disabled",!0)})})}(jQuery);