1!function(i){"use strict";"function"==typeof define&&define.amd?define(["jquery"],i):"undefined"!=typeof exports?module.exports=i(require("jquery")):i(jQuery)}(function(i){"use strict";var e=window.Slick||{};(e=function(){var e=0;return function(t,o){var s,n=this;n.defaults={accessibility:!0,adaptiveHeight:!1,appendArrows:i(t),appendDots:i(t),arrows:!0,asNavFor:null,prevArrow:'<button class="slick-prev" aria-label="Previous" type="button">Previous</button>',nextArrow:'<button class="slick-next" aria-label="Next" type="button">Next</button>',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(e,t){return i('<button type="button" />').text(t+1)},dots:!1,dotsClass:"slick-dots",draggable:!0,easing:"linear",edgeFriction:.35,fade:!1,focusOnSelect:!1,focusOnChange:!1,infinite:!0,initialSlide:0,lazyLoad:"ondemand",mobileFirst:!1,pauseOnHover:!0,pauseOnFocus:!0,pauseOnDotsHover:!1,respondTo:"window",responsive:null,rows:1,rtl:!1,slide:"",slidesPerRow:1,slidesToShow:1,slidesToScroll:1,speed:500,swipe:!0,swipeToSlide:!1,touchMove:!0,touchThreshold:5,useCSS:!0,useTransform:!0,variableWidth:!1,vertical:!1,verticalSwiping:!1,waitForAnimate:!0,zIndex:1e3},n.initials={animating:!1,dragging:!1,autoPlayTimer:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,$dots:null,listWidth:null,listHeight:null,loadIndex:0,$nextArrow:null,$prevArrow:null,scrolling:!1,slideCount:null,slideWidth:null,$slideTrack:null,$slides:null,sliding:!1,slideOffset:0,swipeLeft:null,swiping:!1,$list:null,touchObject:{},transformsEnabled:!1,unslicked:!1},i.extend(n,n.initials),n.activeBreakpoint=null,n.animType=null,n.animProp=null,n.breakpoints=[],n.breakpointSettings=[],n.cssTransitions=!1,n.focussed=!1,n.interrupted=!1,n.hidden="hidden",n.paused=!0,n.positionProp=null,n.respondTo=null,n.rowCount=1,n.shouldClick=!0,n.$slider=i(t),n.$slidesCache=null,n.transformType=null,n.transitionType=null,n.visibilityChange="visibilitychange",n.windowWidth=0,n.windowTimer=null,s=i(t).data("slick")||{},n.options=i.extend({},n.defaults,o,s),n.currentSlide=n.options.initialSlide,n.originalSettings=n.options,void 0!==document.mozHidden?(n.hidden="mozHidden",n.visibilityChange="mozvisibilitychange"):void 0!==document.webkitHidden&&(n.hidden="webkitHidden",n.visibilityChange="webkitvisibilitychange"),n.autoPlay=i.proxy(n.autoPlay,n),n.autoPlayClear=i.proxy(n.autoPlayClear,n),n.autoPlayIterator=i.proxy(n.autoPlayIterator,n),n.changeSlide=i.proxy(n.changeSlide,n),n.clickHandler=i.proxy(n.clickHandler,n),n.selectHandler=i.proxy(n.selectHandler,n),n.setPosition=i.proxy(n.setPosition,n),n.swipeHandler=i.proxy(n.swipeHandler,n),n.dragHandler=i.proxy(n.dragHandler,n),n.keyHandler=i.proxy(n.keyHandler,n),n.instanceUid=e++,n.htmlExpr=/^(?:\s*(<[\w\W]+>)[^>]*)$/,n.registerBreakpoints(),n.init(!0)}}()).prototype.activateADA=function(){this.$slideTrack.find(".slick-active").attr({"aria-hidden":"false"}).find("a, input, button, select").attr({tabindex:"0"})},e.prototype.addSlide=e.prototype.slickAdd=function(e,t,o){var s=this;if("boolean"==typeof t)o=t,t=null;else if(t<0||t>=s.slideCount)return!1;s.unload(),"number"==typeof t?0===t&&0===s.$slides.length?i(e).appendTo(s.$slideTrack):o?i(e).insertBefore(s.$slides.eq(t)):i(e).insertAfter(s.$slides.eq(t)):!0===o?i(e).prependTo(s.$slideTrack):i(e).appendTo(s.$slideTrack),s.$slides=s.$slideTrack.children(this.options.slide),s.$slideTrack.children(this.options.slide).detach(),s.$slideTrack.append(s.$slides),s.$slides.each(function(e,t){i(t).attr("data-slick-index",e)}),s.$slidesCache=s.$slides,s.reinit()},e.prototype.animateHeight=function(){var i=this;if(1===i.options.slidesToShow&&!0===i.options.adaptiveHeight&&!1===i.options.vertical){var e=i.$slides.eq(i.currentSlide).outerHeight(!0);i.$list.animate({height:e},i.options.speed)}},e.prototype.animateSlide=function(e,t){var o={},s=this;s.animateHeight(),!0===s.options.rtl&&!1===s.options.vertical&&(e=-e),!1===s.transformsEnabled?!1===s.options.vertical?s.$slideTrack.animate({left:e},s.options.speed,s.options.easing,t):s.$slideTrack.animate({top:e},s.options.speed,s.options.easing,t):!1===s.cssTransitions?(!0===s.options.rtl&&(s.currentLeft=-s.currentLeft),i({animStart:s.currentLeft}).animate({animStart:e},{duration:s.options.speed,easing:s.options.easing,step:function(i){i=Math.ceil(i),!1===s.options.vertical?(o[s.animType]="translate("+i+"px, 0px)",s.$slideTrack.css(o)):(o[s.animType]="translate(0px,"+i+"px)",s.$slideTrack.css(o))},complete:function(){t&&t.call()}})):(s.applyTransition(),e=Math.ceil(e),!1===s.options.vertical?o[s.animType]="translate3d("+e+"px, 0px, 0px)":o[s.animType]="translate3d(0px,"+e+"px, 0px)",s.$slideTrack.css(o),t&&setTimeout(function(){s.disableTransition(),t.call()},s.options.speed))},e.prototype.getNavTarget=function(){var e=this,t=e.options.asNavFor;return t&&null!==t&&(t=i(t).not(e.$slider)),t},e.prototype.asNavFor=function(e){var t=this.getNavTarget();null!==t&&"object"==typeof t&&t.each(function(){var t=i(this).slick("getSlick");t.unslicked||t.slideHandler(e,!0)})},e.prototype.applyTransition=function(i){var e=this,t={};!1===e.options.fade?t[e.transitionType]=e.transformType+" "+e.options.speed+"ms "+e.options.cssEase:t[e.transitionType]="opacity "+e.options.speed+"ms "+e.options.cssEase,!1===e.options.fade?e.$slideTrack.css(t):e.$slides.eq(i).css(t)},e.prototype.autoPlay=function(){var i=this;i.autoPlayClear(),i.slideCount>i.options.slidesToShow&&(i.autoPlayTimer=setInterval(i.autoPlayIterator,i.options.autoplaySpeed))},e.prototype.autoPlayClear=function(){var i=this;i.autoPlayTimer&&clearInterval(i.autoPlayTimer)},e.prototype.autoPlayIterator=function(){var i=this,e=i.currentSlide+i.options.slidesToScroll;i.paused||i.interrupted||i.focussed||(!1===i.options.infinite&&(1===i.direction&&i.currentSlide+1===i.slideCount-1?i.direction=0:0===i.direction&&(e=i.currentSlide-i.options.slidesToScroll,i.currentSlide-1==0&&(i.direction=1))),i.slideHandler(e))},e.prototype.buildArrows=function(){var e=this;!0===e.options.arrows&&(e.$prevArrow=i(e.options.prevArrow).addClass("slick-arrow"),e.$nextArrow=i(e.options.nextArrow).addClass("slick-arrow"),e.slideCount>e.options.slidesToShow?(e.$prevArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),e.$nextArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),e.htmlExpr.test(e.options.prevArrow)&&e.$prevArrow.prependTo(e.options.appendArrows),e.htmlExpr.test(e.options.nextArrow)&&e.$nextArrow.appendTo(e.options.appendArrows),!0!==e.options.infinite&&e.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true")):e.$prevArrow.add(e.$nextArrow).addClass("slick-hidden").attr({"aria-disabled":"true",tabindex:"-1"}))},e.prototype.buildDots=function(){var e,t,o=this;if(!0===o.options.dots){for(o.$slider.addClass("slick-dotted"),t=i("<ul />").addClass(o.options.dotsClass),e=0;e<=o.getDotCount();e+=1)t.append(i("<li />").append(o.options.customPaging.call(this,o,e)));o.$dots=t.appendTo(o.options.appendDots),o.$dots.find("li").first().addClass("slick-active")}},e.prototype.buildOut=function(){var e=this;e.$slides=e.$slider.children(e.options.slide+":not(.slick-cloned)").addClass("slick-slide"),e.slideCount=e.$slides.length,e.$slides.each(function(e,t){i(t).attr("data-slick-index",e).data("originalStyling",i(t).attr("style")||"")}),e.$slider.addClass("slick-slider"),e.$slideTrack=0===e.slideCount?i('<div class="slick-track"/>').appendTo(e.$slider):e.$slides.wrapAll('<div class="slick-track"/>').parent(),e.$list=e.$slideTrack.wrap('<div class="slick-list"/>').parent(),e.$slideTrack.css("opacity",0),!0!==e.options.centerMode&&!0!==e.options.swipeToSlide||(e.options.slidesToScroll=1),i("img[data-lazy]",e.$slider).not("[src]").addClass("slick-loading"),e.setupInfinite(),e.buildArrows(),e.buildDots(),e.updateDots(),e.setSlideClasses("number"==typeof e.currentSlide?e.currentSlide:0),!0===e.options.draggable&&e.$list.addClass("draggable")},e.prototype.buildRows=function(){var i,e,t,o,s,n,r,l=this;if(o=document.createDocumentFragment(),n=l.$slider.children(),l.o
1ptions.rows>1){for(r=l.options.slidesPerRow*l.options.rows,s=Math.ceil(n.length/r),i=0;i<s;i++){var d=document.createElement("div");for(e=0;e<l.options.rows;e++){var a=document.createElement("div");for(t=0;t<l.options.slidesPerRow;t++){var c=i*r+(e*l.options.slidesPerRow+t);n.get(c)&&a.appendChild(n.get(c))}d.appendChild(a)}o.appendChild(d)}l.$slider.empty().append(o),l.$slider.children().children().children().css({width:100/l.options.slidesPerRow+"%",display:"inline-block"})}},e.prototype.checkResponsive=function(e,t){var o,s,n,r=this,l=!1,d=r.$slider.width(),a=window.innerWidth||i(window).width();if("window"===r.respondTo?n=a:"slider"===r.respondTo?n=d:"min"===r.respondTo&&(n=Math.min(a,d)),r.options.responsive&&r.options.responsive.length&&null!==r.options.responsive){s=null;for(o in r.breakpoints)r.breakpoints.hasOwnProperty(o)&&(!1===r.originalSettings.mobileFirst?n<r.breakpoints[o]&&(s=r.breakpoints[o]):n>r.breakpoints[o]&&(s=r.breakpoints[o]));null!==s?null!==r.activeBreakpoint?(s!==r.activeBreakpoint||t)&&(r.activeBreakpoint=s,"unslick"===r.breakpointSettings[s]?r.unslick(s):(r.options=i.extend({},r.originalSettings,r.breakpointSettings[s]),!0===e&&(r.currentSlide=r.options.initialSlide),r.refresh(e)),l=s):(r.activeBreakpoint=s,"unslick"===r.breakpointSettings[s]?r.unslick(s):(r.options=i.extend({},r.originalSettings,r.breakpointSettings[s]),!0===e&&(r.currentSlide=r.options.initialSlide),r.refresh(e)),l=s):null!==r.activeBreakpoint&&(r.activeBreakpoint=null,r.options=r.originalSettings,!0===e&&(r.currentSlide=r.options.initialSlide),r.refresh(e),l=s),e||!1===l||r.$slider.trigger("breakpoint",[r,l])}},e.prototype.changeSlide=function(e,t){var o,s,n,r=this,l=i(e.currentTarget);switch(l.is("a")&&e.preventDefault(),l.is("li")||(l=l.closest("li")),n=r.slideCount%r.options.slidesToScroll!=0,o=n?0:(r.slideCount-r.currentSlide)%r.options.slidesToScroll,e.data.message){case"previous":s=0===o?r.options.slidesToScroll:r.options.slidesToShow-o,r.slideCount>r.options.slidesToShow&&r.slideHandler(r.currentSlide-s,!1,t);break;case"next":s=0===o?r.options.slidesToScroll:o,r.slideCount>r.options.slidesToShow&&r.slideHandler(r.currentSlide+s,!1,t);break;case"index":var d=0===e.data.index?0:e.data.index||l.index()*r.options.slidesToScroll;r.slideHandler(r.checkNavigable(d),!1,t),l.children().trigger("focus");break;default:return}},e.prototype.checkNavigable=function(i){var e,t;if(e=this.getNavigableIndexes(),t=0,i>e[e.length-1])i=e[e.length-1];else for(var o in e){if(i<e[o]){i=t;break}t=e[o]}return i},e.prototype.cleanUpEvents=function(){var e=this;e.options.dots&&null!==e.$dots&&(i("li",e.$dots).off("click.slick",e.changeSlide).off("mouseenter.slick",i.proxy(e.interrupt,e,!0)).off("mouseleave.slick",i.proxy(e.interrupt,e,!1)),!0===e.options.accessibility&&e.$dots.off("keydown.slick",e.keyHandler)),e.$slider.off("focus.slick blur.slick"),!0===e.options.arrows&&e.slideCount>e.options.slidesToShow&&(e.$prevArrow&&e.$prevArrow.off("click.slick",e.changeSlide),e.$nextArrow&&e.$nextArrow.off("click.slick",e.changeSlide),!0===e.options.accessibility&&(e.$prevArrow&&e.$prevArrow.off("keydown.slick",e.keyHandler),e.$nextArrow&&e.$nextArrow.off("keydown.slick",e.keyHandler))),e.$list.off("touchstart.slick mousedown.slick",e.swipeHandler),e.$list.off("touchmove.slick mousemove.slick",e.swipeHandler),e.$list.off("touchend.slick mouseup.slick",e.swipeHandler),e.$list.off("touchcancel.slick mouseleave.
1slick",e.swipeHandler),e.$list.off("click.slick",e.clickHandler),i(document).off(e.visibilityChange,e.visibility),e.cleanUpSlideEvents(),!0===e.options.accessibility&&e.$list.off("keydown.slick",e.keyHandler),!0===e.options.focusOnSelect&&i(e.$slideTrack).children().off("click.slick",e.selectHandler),i(window).off("orientationchange.slick.slick-"+e.instanceUid,e.orientationChange),i(window).off("resize.slick.slick-"+e.instanceUid,e.resize),i("[draggable!=true]",e.$slideTrack).off("dragstart",e.preventDefault),i(window).off("load.slick.slick-"+e.instanceUid,e.setPosition)},e.prototype.cleanUpSlideEvents=function(){var e=this;e.$list.off("mouseenter.slick",i.proxy(e.interrupt,e,!0)),e.$list.off("mouseleave.slick",i.proxy(e.interrupt,e,!1))},e.prototype.cleanUpRows=function(){var i,e=this;e.options.rows>1&&((i=e.$slides.children().children()).removeAttr("style"),e.$slider.empty().append(i))},e.prototype.clickHandler=function(i){!1===this.shouldClick&&(i.stopImmediatePropagation(),i.stopPropagation(),i.preventDefault())},e.prototype.destroy=function(e){var t=this;t.autoPlayClear(),t.touchObject={},t.cleanUpEvents(),i(".slick-cloned",t.$slider).detach(),t.$dots&&t.$dots.remove(),t.$prevArrow&&t.$prevArrow.length&&(t.$prevArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),t.htmlExpr.test(t.options.prevArrow)&&t.$prevArrow.remove()),t.$nextArrow&&t.$nextArrow.length&&(t.$nextArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),t.htmlExpr.test(t.options.nextArrow)&&t.$nextArrow.remove()),t.$slides&&(t.$slides.removeClass("slick-slide slick-active slick-center slick-visible slick-current").removeAttr("aria-hidden").removeAttr("data-slick-index").each(function(){i(this).attr("style",i(this).data("originalStyling"))}),t.$slideTrack.children(this.options.slide).detach(),t.$slideTrack.detach(),t.$list.detach(),t.$slider.append(t.$slides)),t.cleanUpRows(),t.$slider.removeClass("slick-slider"),t.$slider.removeClass("slick-initialized"),t.$slider.removeClass("slick-dotted"),t.unslicked=!0,e||t.$slider.trigger("destroy",[t])},e.prototype.disableTransition=function(i){var e=this,t={};t[e.transitionType]="",!1===e.options.fade?e.$slideTrack.css(t):e.$slides.eq(i).css(t)},e.prototype.fadeSlide=function(i,e){var t=this;!1===t.cssTransitions?(t.$slides.eq(i).css({zIndex:t.options.zIndex}),t.$slides.eq(i).animate({opacity:1},t.options.speed,t.options.easing,e)):(t.applyTransition(i),t.$slides.eq(i).css({opacity:1,zIndex:t.options.zIndex}),e&&setTimeout(function(){t.disableTransition(i),e.call()},t.options.speed))},e.prototype.fadeSlideOut=function(i){var e=this;!1===e.cssTransitions?e.$slides.eq(i).animate({opacity:0,zIndex:e.options.zIndex-2},e.options.speed,e.options.easing):(e.applyTransition(i),e.$slides.eq(i).css({opacity:0,zIndex:e.options.zIndex-2}))},e.prototype.filterSlides=e.prototype.slickFilter=function(i){var e=this;null!==i&&(e.$slidesCache=e.$slides,e.unload(),e.$slideTrack.children(this.options.slide).detach(),e.$slidesCache.filter(i).appendTo(e.$slideTrack),e.reinit())},e.prototype.focusHandler=function(){var e=this;e.$slider.off("focus.slick blur.slick").on("focus.slick blur.slick","*",function(t){t.stopImmediatePropagation();var o=i(this);setTimeout(function(){e.options.pauseOnFocus&&(e.focussed=o.is(":focus"),e.autoPlay())},0)})},e.prototype.getCurrent=e.prototype.slickCurrentSlide=function(){return this.currentSlide},e.prototype.getDotCount=function(){var i=this,e=0,t=0,o=0;if(!0===i.options.infinite)if(i.slideCount<=i.options.slidesToShow)++o;else for(;e<i.slideCount;)++o,e=t+i.options.slidesToScroll,t+=i.options.slidesToScroll<=i.options.slidesToShow?i.options.slidesToScroll:i.options.slidesToShow;else if(!0===i.options.centerMode)o=i.slideCount;else if(i.options.asNavFor)for(;e<i.slideCount;)++o,e=t+i.options.slidesToScroll,t+=i.options.slidesToScroll<=i.options.slidesToShow?i.options.slidesToScroll:i.options.slidesToShow;else o=1+Math.ceil((i.slideCount-i.options.slidesToShow)/i.options.slidesToScroll);return o-1},e.prototype.getLeft=function(i){var e,t,o,s,n=this,r=0;return n.slideOffset=0,t=n.$slides.first().outerHeight(!0),!0===n.options.infinite?(n.slideCount>n.options.slidesToShow&&(n.slideOffset=n.slideWidth*n.options.slidesToShow*-1,s=-1,!0===n.options.vertical&&!0===n.options.centerMode&&(2===n.options.slidesToShow?s=-1.5:1===n.options.slidesToShow&&(s=-2)),r=t*n.options.slidesToShow*s),n.slideCount%n.options.slidesToScroll!=0&&i+n.options.slidesToScroll>n.slideCount&&n.slideCount>n.options.slidesToShow&&(i>n.slideCount?(n.slideOffset=(n.options.slidesToShow-(i-n.slideCount))*n.slideWidth*-1,r=(n.options.slidesToShow-(i-n.slideCount))*t*-1):(n.slideOffset=n.slideCount%n.options.slidesToScroll*n.slideWidth*-1,r=n.slideCount%n.options.slidesToScroll*t*-1))):i+n.options.slidesToShow>n.slideCount&&(n.slideOffset=(i+n.options.slidesToShow-n.slideCount)*n.slideWidth,r=(i+n.options.slidesToShow-n.slideCount)*t),n.slideCount<=n.options.slidesToShow&&(n.slideOffset=0,r=0),!0===n.options.centerMode&&n.slideCount<=n.options.slidesToShow?n.slideOffset=n.slideWidth*Math.floor(n.options.slidesToShow)/2-n.slideWidth*n.slideCount/2:!0===n.options.centerMode&&!0===n.options.infinite?n.slideOffset+=n.slideWidth*Math.floor(n.options.slidesToShow/2)-n.slideWidth:!0===n.options.centerMode&&(n.slideOffset=0,n.slideOffset+=n.slideWidth*Math.floor(n.options.slidesToShow/2)),e=!1===n.options.vertical?i*n.slideWidth*-1+n.slideOffset:i*t*-1+r,!0===n.options.variableWidth&&(o=n.slideCount<=n.options.slidesToShow||!1===n.options.infinite?n.$slideTrack.children(".slick-slide").eq(i):n.$slideTrack.children(".slick-slide").eq(i+n.options.slidesToShow),e=!0===n.options.rtl?o[0]?-1*(n.$slideTrack.width()-o[0].offsetLeft-o.width()):0:o[0]?-1*o[0].offsetLeft:0,!0===n.options.centerMode&&(o=n.slideCount<=n.options.slidesToShow||!1===n.options.infinite?n.$slideTrack.children(".slick-slide").eq(i):n.$slideTrack.children(".slick-slide").eq(i+n.options.slidesToShow+1),e=!0===n.options.rtl?o[0]?-1*(n.$slideTrack.width()-o[0].offsetLeft-o.width()):0:o[0]?-1*o[0].offsetLeft:0,e+=(n.$list.width()-o.outerWidth())/2)),e},e.prototype.getOption=e.prototype.slickGetOption=function(i){return this.options[i]},e.prototype.getNavigableIndexes=function(){var i,e=this,t=0,o=0,s=[];for(!1===e.options.infinite?i=e.slideCount:(t=-1*e.options.slidesToScroll,o=-1*e.options.slidesToScroll,i=2*e.slideCount);t<i;)s.push(t),t=o+e.options.slidesToScroll,o+=e.options.slidesToScroll<=e.options.slidesToShow?e.options.slidesToScroll:e.options.slidesToShow;return s},e.prototype.getSlick=function(){return this},e.prototype.getSlideCount=function(){var e,t,o=this;return t=!0===o.options.centerMode?o.slideWidth*Math.floor(o.options.slidesToShow/2):0,!0===o.options.swipeToSlide?(o.$slideTrack.find(".slick-slide").each(function(s,n){if(n.offsetLeft-t+i(n).outerWidth()/2>-1*o.swipeLeft)return e=n,!1}),Math.abs(i(e).attr("data-slick-index")-o.currentSlide)||1):o.options.slidesToScroll},e.prototype.goTo=e.prototype.slickGoTo=function(i,e){this.changeSlide({data:{message:"index",index:
1parseInt(i)}},e)},e.prototype.init=function(e){var t=this;i(t.$slider).hasClass("slick-initialized")||(i(t.$slider).addClass("slick-initialized"),t.buildRows(),t.buildOut(),t.setProps(),t.startLoad(),t.loadSlider(),t.initializeEvents(),t.updateArrows(),t.updateDots(),t.checkResponsive(!0),t.focusHandler()),e&&t.$slider.trigger("init",[t]),!0===t.options.accessibility&&t.initADA(),t.options.autoplay&&(t.paused=!1,t.autoPlay())},e.prototype.initADA=function(){var e=this,t=Math.ceil(e.slideCount/e.options.slidesToShow),o=e.getNavigableIndexes().filter(function(i){return i>=0&&i<e.slideCount});e.$slides.add(e.$slideTrack.find(".slick-cloned")).attr({"aria-hidden":"true",tabindex:"-1"}).find("a, input, button, select").attr({tabindex:"-1"}),null!==e.$dots&&(e.$slides.not(e.$slideTrack.find(".slick-cloned")).each(function(t){var s=o.indexOf(t);i(this).attr({role:"tabpanel",id:"slick-slide"+e.instanceUid+t,tabindex:-1}),-1!==s&&i(this).attr({"aria-describedby":"slick-slide-control"+e.instanceUid+s})}),e.$dots.attr("role","tablist").find("li").each(function(s){var n=o[s];i(this).attr({role:"presentation"}),i(this).find("button").first().attr({role:"tab",id:"slick-slide-control"+e.instanceUid+s,"aria-controls":"slick-slide"+e.instanceUid+n,"aria-label":s+1+" of "+t,"aria-selected":null,tabindex:"-1"})}).eq(e.currentSlide).find("button").attr({"aria-selected":"true",tabindex:"0"}).end());for(var s=e.currentSlide,n=s+e.options.slidesToShow;s<n;s++)e.$slides.eq(s).attr("tabindex",0);e.activateADA()},e.prototype.initArrowEvents=function(){var i=this;!0===i.options.arrows&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.off("click.slick").on("click.slick",{message:"previous"},i.changeSlide),i.$nextArrow.off("click.slick").on("click.slick",{message:"next"},i.changeSlide),!0===i.options.accessibility&&(i.$prevArrow.on("keydown.slick",i.keyHandler),i.$nextArrow.on("keydown.slick",i.keyHandler)))},e.prototype.initDotEvents=function(){var e=this;!0===e.options.dots&&(i("li",e.$dots).on("click.slick",{message:"index"},e.changeSlide),!0===e.options.accessibility&&e.$dots.on("keydown.slick",e.keyHandler)),!0===e.options.dots&&!0===e.options.pauseOnDotsHover&&i("li",e.$dots).on("mouseenter.slick",i.proxy(e.interrupt,e,!0)).on("mouseleave.slick",i.proxy(e.interrupt,e,!1))},e.prototype.initSlideEvents=function(){var e=this;e.options.pauseOnHover&&(e.$list.on("mouseenter.slick",i.proxy(e.interrupt,e,!0)),e.$list.on("mouseleave.slick",i.proxy(e.interrupt,e,!1)))},e.prototype.initializeEvents=function(){var e=this;e.initArrowEvents(),e.initDotEvents(),e.initSlideEvents(),e.$list.on("touchstart.slick mousedown.slick",{action:"start"},e.swipeHandler),e.$list.on("touchmove.slick mousemove.slick",{action:"move"},e.swipeHandler),e.$list.on("touchend.slick mouseup.slick",{action:"end"}
1,e.swipeHandler),e.$list.on("touchcancel.slick mouseleave.slick",{action:"end"},e.swipeHandler),e.$list.on("click.slick",e.clickHandler),i(document).on(e.visibilityChange,i.proxy(e.visibility,e)),!0===e.options.accessibility&&e.$list.on("keydown.slick",e.keyHandler),!0===e.options.focusOnSelect&&i(e.$slideTrack).children().on("click.slick",e.selectHandler),i(window).on("orientationchange.slick.slick-"+e.instanceUid,i.proxy(e.orientationChange,e)),i(window).on("resize.slick.slick-"+e.instanceUid,i.proxy(e.resize,e)),i("[draggable!=true]",e.$slideTrack).on("dragstart",e.preventDefault),i(window).on("load.slick.slick-"+e.instanceUid,e.setPosition),i(e.setPosition)},e.prototype.initUI=function(){var i=this;!0===i.options.arrows&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.show(),i.$nextArrow.show()),!0===i.options.dots&&i.slideCount>i.options.slidesToShow&&i.$dots.show()},e.prototype.keyHandler=function(i){var e=this;i.target.tagName.match("TEXTAREA|INPUT|SELECT")||(37===i.keyCode&&!0===e.options.accessibility?e.changeSlide({data:{message:!0===e.options.rtl?"next":"previous"}}):39===i.keyCode&&!0===e.options.accessibility&&e.changeSlide({data:{message:!0===e.options.rtl?"previous":"next"}}))},e.prototype.lazyLoad=function(){function e(e){i("img[data-lazy]",e).each(function(){var e=i(this),t=i(this).attr("data-lazy"),o=i(this).attr("data-srcset"),s=i(this).attr("data-sizes")||n.$slider.attr("data-sizes"),r=document.createElement("img");r.onload=function(){e.animate({opacity:0}
vendor: 5,619 bytes, line 1
1,100,function(){o&&(e.attr("srcset",o),s&&e.attr("sizes",s)),e.attr("src",t).animate({opacity:1},200,function(){e.removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading")}),n.$slider.trigger("lazyLoaded",[n,e,t])})},r.onerror=function(){e.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),n.$slider.trigger("lazyLoadError",[n,e,t])},r.src=t})}var t,o,s,n=this;if(!0===n.options.centerMode?!0===n.options.infinite?s=(o=n.currentSlide+(n.options.slidesToShow/2+1))+n.options.slidesToShow+2:(o=Math.max(0,n.currentSlide-(n.options.slidesToShow/2+1)),s=n.options.slidesToShow/2+1+2+n.currentSlide):(o=n.options.infinite?n.options.slidesToShow+n.currentSlide:n.currentSlide,s=Math.ceil(o+n.options.slidesToShow),!0===n.options.fade&&(o>0&&o--,s<=n.slideCount&&s++)),t=n.$slider.find(".slick-slide").slice(o,s),"anticipated"===n.options.lazyLoad)for(var r=o-1,l=s,d=n.$slider.find(".slick-slide"),a=0;a<n.options.slidesToScroll;a++)r<0&&(r=n.slideCount-1),t=(t=t.add(d.eq(r))).add(d.eq(l)),r--,l++;e(t),n.slideCount<=n.options.slidesToShow?e(n.$slider.find(".slick-slide")):n.currentSlide>=n.slideCount-n.options.slidesToShow?e(n.$slider.find(".slick-cloned").slice(0,n.options.slidesToShow)):0===n.currentSlide&&e(n.$slider.find(".slick-cloned").slice(-1*n.options.slidesToShow))},e.prototype.loadSlider=function(){var i=this;i.setPosition(),i.$slideTrack.css({opacity:1}),i.$slider.removeClass("slick-loading"),i.initUI(),"progressive"===i.options.lazyLoad&&i.progressiveLazyLoad()},e.prototype.next=e.prototype.slickNext=function(){this.changeSlide({data:{message:"next"}})},e.prototype.orientationChange=function(){var i=this;i.checkResponsive(),i.setPosition()},e.prototype.pause=e.prototype.slickPause=function(){var i=this;i.autoPlayClear(),i.paused=!0},e.prototype.play=e.prototype.slickPlay=function(){var i=this;i.autoPlay(),i.options.autoplay=!0,i.paused=!1,i.focussed=!1,i.interrupted=!1},e.prototype.postSlide=function(e){var t=this;t.unslicked||(t.$slider.trigger("afterChange",[t,e]),t.animating=!1,t.slideCount>t.options.slidesToShow&&t.setPosition(),t.swipeLeft=null,t.options.autoplay&&t.autoPlay(),!0===t.options.accessibility&&(t.initADA(),t.options.focusOnChange&&i(t.$slides.get(t.currentSlide)).attr("tabindex",0).focus()))},e.prototype.prev=e.prototype.slickPrev=function(){this.changeSlide({data:{message:"previous"}})},e.prototype.preventDefault=function(i){i.preventDefault()},e.prototype.progressiveLazyLoad=function(e){e=e||1;var t,o,s,n,r,l=this,d=i("img[data-lazy]",l.$slider);d.length?(t=d.first(),o=t.attr("data-lazy"),s=t.attr("data-srcset"),n=t.attr("data-sizes")||l.$slider.attr("data-sizes"),(r=document.createElement("img")).onload=function(){s&&(t.attr("srcset",s),n&&t.attr("sizes",n)),t.attr("src",o).removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading"),!0===l.options.adaptiveHeight&&l.setPosition(),l.$slider.trigger("lazyLoaded",[l,t,o]),l.progressiveLazyLoad()},r.onerror=function(){e<3?setTimeout(function(){l.progressiveLazyLoad(e+1)},500):(t.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),l.$slider.trigger("lazyLoadError",[l,t,o]),l.progressiveLazyLoad())},r.src=o):l.$slider.trigger("allImagesLoaded",[l])},e.prototype.refresh=function(e){var t,o,s=this;o=s.slideCount-s.options.slidesToShow,!s.options.infinite&&s.currentSlide>o&&(s.currentSlide=o),s.slideCount<=s.options.slidesToShow&&(s.currentSlide=0),t=s.currentSlide,s.destroy(!0),i.extend(s,s.initials,{currentSlide:t}),s.init(),e||s.changeSlide({data:{message:"index",index:t}},!1)},e.prototype.registerBreakpoints=function(){var e,t,o,s=this,n=s.options.responsive||null;if("array"===i.type(n)&&n.length){s.respondTo=s.options.respondTo||"window";for(e in n)if(o=s.breakpoints.length-1,n.hasOwnProperty(e)){for(t=n[e].breakpoint;o>=0;)s.breakpoints[o]&&s.breakpoints[o]===t&&s.breakpoints.splice(o,1),o--;s.breakpoints.push(t),s.breakpointSettings[t]=n[e].settings}s.breakpoints.sort(function(i,e){return s.options.mobileFirst?i-e:e-i})}},e.prototype.reinit=function(){var e=this;e.$slides=e.$slideTrack.children(e.options.slide).addClass("slick-slide"),e.slideCount=e.$slides.length,e.currentSlide>=e.slideCount&&0!==e.currentSlide&&(e.currentSlide=e.currentSlide-e.options.slidesToScroll),e.slideCount<=e.options.slidesToShow&&(e.currentSlide=0),e.registerBreakpoints(),e.setProps(),e.setupInfinite(),e.buildArrows(),e.updateArrows(),e.initArrowEvents(),e.buildDots(),e.updateDots(),e.initDotEvents(),e.cleanUpSlideEvents(),e.initSlideEvents(),e.checkResponsive(!1,!0),!0===e.options.focusOnSelect&&i(e.$slideTrack).children().on("click.slick",e.selectHandler),e.setSlideClasses("number"==typeof e.currentSlide?e.currentSlide:0),e.setPosition(),e.focusHandler(),e.paused=!e.options.autoplay,e.autoPlay(),e.$slider.trigger("reInit",[e])},e.prototype.resize=function(){var e=this;i(window).width()!==e.windowWidth&&(clearTimeout(e.windowDelay),e.windowDelay=window.setTimeout(function(){e.windowWidth=i(window).width(),e.checkResponsive(),e.unslicked||e.setPosition()},50))},e.prototype.removeSlide=e.prototype.slickRemove=function(i,e,t){var o=this;if(i="boolean"==typeof i?!0===(e=i)?0:o.slideCount-1:!0===e?--i:i,o.slideCount<1||i<0||i>o.slideCount-1)return!1;o.unload(),!0===t?o.$slideTrack.children().remove():o.$slideTrack.children(this.options.slide).eq(i).remove(),o.$slides=o.$slideTrack.children(this.options.slide),o.$slideTrack.children(this.options.slide).detach(),o.$slideTrack.append(o.$slides),o.$slidesCache=o.$slides,o.reinit()},e.prototype.setCSS=function(i){var e,t,o=this,s={};
1!0===o.options.rtl&&(i=-i),e="left"==o.positionProp?Math.ceil(i)+"px":"0px",t="top"==o.positionProp?Math.ceil(i)+"px":"0px",s[o.positionProp]=i,!1===o.transformsEnabled?o.$slideTrack.css(s):(s={},!1===o.cssTransitions?(s[o.animType]="translate("+e+", "+t+")",o.$slideTrack.css(s)):(s[o.animType]="translate3d("+e+", "+t+", 0px)",o.$slideTrack.css(s)))},e.prototype.setDimensions=function(){var i=this;!1===i.options.vertical?!0===i.options.centerMode&&i.$list.css({padding:"0px "+i.options.centerPadding}):(i.$list.height(i.$slides.first().outerHeight(!0)*i.options.slidesToShow),!0===i.options.centerMode&&i.$list.css({padding:i.options.centerPadding+" 0px"})),i.listWidth=i.$list.width(),i.listHeight=i.$list.height(),!1===i.options.vertical&&!1===i.options.variableWidth?(i.slideWidth=Math.ceil(i.listWidth/i.options.slidesToShow),i.$slideTrack.width(Math.ceil(i.slideWidth*i.$slideTrack.children(".slick-slide").length))):!0===i.options.variableWidth?i.$slideTrack.width(5e3*i.slideCount):(i.slideWidth=Math.ceil(i.listWidth),i.$slideTrack.height(Math.ceil(i.$slides.first().outerHeight(!0)*i.$slideTrack.children(".slick-slide").length)));var e=i.$slides.first().outerWidth(!0)-i.$slides.first().width();!1===i.options.variableWidth&&i.$slideTrack.children(".slick-slide").width(i.slideWidth-e)},e.prototype.setFade=function(){var e,t=this;t.$slides.each(function(o,s){e=t.slideWidth*o*-1,!0===t.options.rtl?i(s).css({position:"relative",right:e,top:0,zIndex:t.options.zIndex-2,opacity:0}
1):i(s).css({position:"relative",left:e,top:0,zIndex:t.options.zIndex-2,opacity:0})}),t.$slides.eq(t.currentSlide).css({zIndex:t.options.zIndex-1,opacity:1})},e.prototype.setHeight=function(){var i=this;if(1===i.options.slidesToShow&&!0===i.options.adaptiveHeight&&!1===i.options.vertical){var e=i.$slides.eq(i.currentSlide).outerHeight(!0);i.$list.css("height",e)}},e.prototype.setOption=e.prototype.slickSetOption=function(){var e,t,o,s,n,r=this,l=!1;if("object"===i.type(arguments[0])?(o=arguments[0],l=arguments[1],n="multiple"):"string"===i.type(arguments[0])&&(o=arguments[0],s=arguments[1],l=arguments[2],"responsive"===arguments[0]&&"array"===i.type(arguments[1])?n="responsive":void 0!==arguments[1]&&(n="single")),"single"===n)r.options[o]=s;else if("multiple"===n)i.each(o,function(i,e){r.options[i]=e});else if("responsive"===n)for(t in s)if("array"!==i.type(r.options.responsive))r.options.responsive=[s[t]];else{for(e=r.options.responsive.length-1;e>=0;)r.options.responsive[e].breakpoint===s[t].breakpoint&&r.options.responsive.splice(e,1),e--;r.options.responsive.push(s[t])}l&&(r.unload(),r.reinit())},e.prototype.setPosition=function(){var i=this;i.setDimensions(),i.setHeight(),!1===i.options.fade?i.setCSS(i.getLeft(i.currentSlide)):i.setFade(),i.$slider.trigger("setPosition",[i])},e.prototype.setProps=function(){var i=this,e=document.body.style;i.positionProp=!0===i.options.vertical?"top":"left","top"===i.positionProp?i.$slider.addClass("slick-vertical"):i.$slider.removeClass("slick-vertical"),void 0===e.WebkitTransition&&void 0===e.MozTransition&&void 0===e.msTransition||!0===i.options.useCSS&&(i.cssTransitions=!0),i.options.fade&&("number"==typeof i.options.zIndex?i.options.zIndex<3&&(i.options.zIndex=3):i.options.zIndex=i.defaults.zIndex),void 0!==e.OTransform&&(i.animType="OTransform",i.transformType="-o-transform",i.transitionType="OTransition",void 0===e.perspectiveProperty&&void 0===e.webkitPerspective&&(i.animType=!1)),void 0!==e.MozTransform&&(i.animType="MozTransform",i.transformType="-moz-transform",i.transitionType="MozTransition",void 0===e.perspectiveProperty&&void 0===e.MozPerspective&&(i.animType=!1)),void 0!==e.webkitTransform&&(i.animType="webkitTransform",i.transformType="-webkit-transform",i.transitionType="webkitTransition",void 0===e.perspectiveProperty&&void 0===e.webkitPerspective&&(i.animType=!1)),void 0!==e.msTransform&&(i.animType="msTransform",i.transformType="-ms-transform",i.transitionType="msTransition",void 0===e.msTransform&&(i.animType=!1)),void 0!==e.transform&&!1!==i.animType&&(i.animType="transform",i.transformType="transform",i.transitionType="transition"),i.transformsEnabled=i.options.useTransform&&null!==i.animType&&!1!==i.animType},e.prototype.setSlideClasses=function(i){var e,t,o,s,n=this;if(t=n.$slider.find(".slick-slide").removeClass("slick-active slick-center slick-current").attr("aria-hidden","true"),n.$slides.eq(i).addClass("slick-current"),!0===n.options.centerMode){var r=n.options.slidesToShow%2==0?1:0;e=Math.floor(n.options.slidesToShow/2),!0===n.options.infinite&&(i>=e&&i<=n.slideCount-1-e?n.$slides.slice(i-e+r,i+e+1).addClass("slick-active").attr("aria-hidden","false"):(o=n.options.slidesToShow+i,t.slice(o-e+1+r,o+e+2).addClass("slick-active").attr("aria-hidden","false")),0===i?t.eq(t.length-1-n.options.slidesToShow).addClass("slick-center"):i===n.slideCount-1&&t.eq(n.options.slidesToShow).addClass("slick-center")),n.$slides.eq(i).addClass("slick-center")}else i>=0&&i<=n.slideCount-n.options.slidesToShow?n.$slides.slice(i,i+n.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"):t.length<=n.options.slidesToShow?t.addClass("slick-active").attr("aria-hidden","false"):(s=n.slideCount%n.options.slidesToShow,o=!0===n.options.infinite?n.options.slidesToShow+i:i,n.options.slidesToShow==n.options.slidesToScroll&&n.slideCount-i<n.options.slidesToShow?t.slice(o-(n.options.slidesToShow-s),o+s).addClass("slick-active").attr("aria-hidden","false"):t.slice(o,o+n.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"));"ondemand"!==n.options.lazyLoad&&"anticipated"!==n.options.lazyLoad||n.lazyLoad()},e.prototype.setupInfinite=function(){var e,t,o,s=this;if(!0===s.options.fade&&(s.options.centerMode=!1),!0===s.options.infinite&&!1===s.options.fade&&(t=null,s.slideCount>s.options.slidesToShow)){for(o=!0===s.options.centerMode?s.options.slidesToShow+1:s.options.slidesToShow,e=s.slideCount;e>s.slideCount-o;e-=1)t=e-1,i(s.$slides[t]).clone(!0).attr("id","").attr("data-slick-index",t-s.slideCount).prependTo(s.$slideTrack).addClass("slick-cloned");for(e=0;e<o+s.slideCount;e+=1)t=e,i(s.$slides[t]).clone(!0).attr("id","").attr("data-slick-index",t+s.slideCount).appendTo(s.$slideTrack).addClass("slick-cloned");s.$slideTrack.find(".slick-cloned").find("[id]").each(function(){i(this).attr("id","")})}},e.prototype.interrupt=function(i){var e=this;i||e.autoPlay(),e.interrupted=i},e.prototype.selectHandler=function(e){var t=this,o=i(e.target).is(".slick-slide")?i(e.target):i(e.target).parents(".slick-slide"),s=parseInt(o.attr("data-slick-index"));s||(s=0),t.slideCount<=t.options.slidesToShow?t.slideHandler(s,!1,!0):t.slideHandler(s)},e.prototype.slideHandler=function(i,e,t){var o,s,n,r,l,d=null,a=this;if(e=e||!1,!(!0===a.animating&&!0===a.options.waitForAnimate||!0===a.options.fade&&a.currentSlide===i))if(!1===e&&a.asNavFor(i),o=i,d=a.getLeft(o),r=a.getLeft(a.currentSlide),a.currentLeft=null===a.swipeLeft?r:a.swipeLeft,!1===a.options.infinite&&!1===a.options.centerMode&&(i<0||i>a.getDotCount()*a.options.slidesToScroll))!1===a.options.fade&&(o=a.currentSlide,!0!==t?a.animateSlide(r,function(){a.postSlide(o)}):a.postSlide(o));else if(!1===a.options.infinite&&!0===a.options.centerMode&&(i<0||i>a.slideCount-a.options.slidesToScroll))!1===a.options.fade&&(o=a.currentSlide,!0!==t?a.animateSlide(r,function(){a.postSlide(o)}):a.postSlide(o));else{if(a.options.autoplay&&clearInterval(a.autoPlayTimer),s=o<0?a.slideCount%a.options.slidesToScroll!=0?a.slideCount-a.slideCount%a.options.slidesToScroll:a.slideCount+
1o:o>=a.slideCount?a.slideCount%a.options.slidesToScroll!=0?0:o-a.slideCount:o,a.animating=!0,a.$slider.trigger("beforeChange",[a,a.currentSlide,s]),n=a.currentSlide,a.currentSlide=s,a.setSlideClasses(a.currentSlide),a.options.asNavFor&&(l=(l=a.getNavTarget()).slick("getSlick")).slideCount<=l.options.slidesToShow&&l.setSlideClasses(a.currentSlide),a.updateDots(),a.updateArrows(),!0===a.options.fade)return!0!==t?(a.fadeSlideOut(n),a.fadeSlide(s,function(){a.postSlide(s)})):a.postSlide(s),void a.animateHeight();!0!==t?a.animateSlide(d,function(){a.postSlide(s)}):a.postSlide(s)}},e.prototype.startLoad=function(){var i=this;!0===i.options.arrows&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.hide(),i.$nextArrow.hide()),!0===i.options.dots&&i.slideCount>i.options.slidesToShow&&i.$dots.hide(),i.$slider.addClass("slick-loading")},e.prototype.swipeDirection=function(){var i,e,t,o,s=this;return i=s.touchObject.startX-s.touchObject.curX,e=s.touchObject.startY-s.touchObject.curY,t=Math.atan2(e,i),(o=Math.round(180*t/Math.PI))<0&&(o=360-Math.abs(o)),o<=45&&o>=0?!1===s.options.rtl?"left":"right":o<=360&&o>=315?!1===s.options.rtl?"left":"right":o>=135&&o<=225?!1===s.options.rtl?"right":"left":!0===s.options.verticalSwiping?o>=35&&o<=135?"down":"up":"vertical"},e.prototype.swipeEnd=function(i){var e,t,o=this;if(o.dragging=!1,o.swiping=!1,o.scrolling)return o.scrolling=!1,!1;if(o.interrupted=!1,o.shouldClick=!(o.touchObject.swipeLength>10),void 0===o.touchObject.curX)return!1;if(!0===o.touchObject.edgeHit&&o.$slider.trigger("edge",[o,o.swipeDirection()]),o.touchObject.swipeLength>=o.touchObject.minSwipe){switch(t=o.swipeDirection()){case"left":case"down":e=o.options.swipeToSlide?o.checkNavigable(o.currentSlide+o.getSlideCount()):o.currentSlide+o.getSlideCount(),o.currentDirection=0;break;case"right":case"up":e=o.options.swipeToSlide?o.checkNavigable(o.currentSlide-o.getSlideCount()):o.currentSlide-o.getSlideCount(),o.currentDirection=1}"vertical"!=t&&(o.slideHandler(e),o.touchObject={},o.$slider.trigger("swipe",[o,t]))}else o.touchObject.startX!==o.touchObject.curX&&(o.slideHandler(o.currentSlide),o.touchObject={})},e.prototype.swipeHandler=function(i){var e=this;if(!(!1===e.options.swipe||"ontouchend"in document&&!1===e.options.swipe||!1===e.options.draggable&&-1!==i.type.indexOf("mouse")))switch(e.touchObject.fingerCount=i.originalEvent&&void 0!==i.originalEvent.touches?i.originalEvent.touches.length:1,e.touchObject.minSwipe=e.listWidth/e.options.touchThreshold,!0===e.options.verticalSwiping&&(e.touchObject.minSwipe=e.listHeight/e.options.touchThreshold),i.data.action){case"start":e.swipeStart(i);break;case"move":e.swipeMove(i);break;case"end":e.swipeEnd(i)}},e.prototype.swipeMove=function(i){var e,t,o,s,n,r,l=this;return n=void 0!==i.originalEvent?i.originalEvent.touches:null,!(!l.dragging||l.scrolling||n&&1!==n.length)&&(e=l.getLeft(l.currentSlide),l.touchObject.curX=void 0!==n?n[0].pageX:i.clientX,l.touchObject.curY=void 0!==n?n[0].pageY:i.clientY,l.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(l.touchObject.curX-l.touchObject.startX,2))),r=Math.round(Math.sqrt(Math.pow(l.touchObject.curY-l.touchObject.startY,2))),!l.options.verticalSwiping&&!l.swiping&&r>4?(l.scrolling=!0,!1):(!0===l.options.verticalSwiping&&(l.touchObject.swipeLength=r),t=l.swipeDirection(),void 0!==i.originalEvent&&l.touchObject.swipeLength>4&&(l.swiping=!0,i.preventDefault()),s=(!1===l.options.rtl?1:-1)*(l.touchObject.curX>l.touchObject.startX?1:-1),!0===l.options.verticalSwiping&&(s=l.touchObject.curY>l.touchObject.startY?1:-1),o=l.touchObject.swipeLength,l.touchObject.edgeHit=!1,!1===l.options.infinite&&(0===l.currentSlide&&"right"===t||l.currentSlide>=l.getDotCount()&&"left"===t)&&(o=l.touchObject.swipeLength*l.options.edgeFriction,l.touchObject.edgeHit=!0),!1===l.options.vertical?l.swipeLeft=e+o*s:l.swipeLeft=e+o*(l.$list.height()/l.listWidth)*s,!0===l.options.verticalSwiping&&(l.swipeLeft=e+o*s),!0!==l.options.fade&&!1!==l.options.touchMove&&(!0===l.animating?(l.swipeLeft=null,!1):void l.setCSS(l.swipeLeft))))},e.prototype.swipeStart=function(i){var e,t=this;if(t.interrupted=!0,1!==t.touchObject.fingerCount||t.slideCount<=t.options.slidesToShow)return t.touchObject={},!1;void 0!==i.originalEvent&&void 0!==i.originalEvent.touches&&(e=i.originalEvent.touches[0]),t.touchObject.startX=t.touchObject.curX=void 0!==e?e.pageX:i.clientX,t.touchObject.startY=t.touchObject.curY=void 0!==e?e.pageY:i.clientY,t.dragging=!0},e.prototype.unfilterSlides=e.prototype.slickUnfilter=function(){var i=this;null!==i.$slidesCache&&(i.unload(),i.$slideTrack.children(this.options.slide).detach(),i.$slidesCache.appendTo(i.$slideTrack),i.reinit())},e.prototype.unload=function(){var e=this;i(".slick-cloned",e.$slider).remove(),e.$dots&&e.$dots.remove(),e.$prevArrow&&e.htmlExpr.test(e.options.prevArrow)&&e.$prevArrow.remove(),e.$nextArrow&&e.htmlExpr.test(e.options.nextArrow)&&e.$nextArrow.remove(),e.$slides.removeClass("slick-slide slick-active slick-visible slick-current").attr("aria-hidden","true").css("width","")}
1,e.prototype.unslick=function(i){var e=this;e.$slider.trigger("unslick",[e,i]),e.destroy()},e.prototype.updateArrows=function(){var i=this;Math.floor(i.options.slidesToShow/2),!0===i.options.arrows&&i.slideCount>i.options.slidesToShow&&!i.options.infinite&&(i.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false"),i.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false"),0===i.currentSlide?(i.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true"),i.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false")):i.currentSlide>=i.slideCount-i.options.slidesToShow&&!1===i.options.centerMode?(i.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),i.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")):i.currentSlide>=i.slideCount-1&&!0===i.options.centerMode&&(i.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),i.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")))},e.prototype.updateDots=function(){var i=this;null!==i.$dots&&(i.$dots.find("li").removeClass("slick-active").end(),i.$dots.find("li").eq(Math.floor(i.currentSlide/i.options.slidesToScroll)).addClass("slick-active"))},e.prototype.visibility=function(){var i=this;i.options.autoplay&&(document[i.hidden]?i.interrupted=!0:i.interrupted=!1)},i.fn.slick=function(){var i,t,o=this,s=arguments[0],n=Array.prototype.slice.call(arguments,1),r=o.length;for(i=0;i<r;i++)if("object"==typeof s||void 0===s?o[i].slick=new e(o[i],s):t=o[i].slick[s].apply(o[i].slick,n),void 0!==t)return t;return o}}); 2
vendor: 24,103 bytes, lines 3-11
3/*! 4 * Masonry PACKAGED v4.2.2 5 * Cascading grid layout library 6 * https://masonry.desandro.com 7 * MIT License 8 * by David DeSandro 9 */ 10 11!function(t,e){"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("jquery")):t.jQueryBridget=e(t,t.jQuery)}(window,function(t,e){"use strict";function i(i,r,a){function h(t,e,n){var o,r="$()."+i+'("'+e+'")';return t.each(function(t,h){var u=a.data(h,i);if(!u)return void s(i+" not initialized. Cannot call methods, i.e. "+r);var d=u[e];if(!d||"_"==e.charAt(0))return void s(r+" is not a valid method");var l=d.apply(u,n);o=void 0===o?l:o}),void 0!==o?o:t}function u(t,e){t.each(function(t,n){var o=a.data(n,i);o?(o.option(e),o._init()):(o=new r(n,e),a.data(n,i,o))})}a=a||e||t.jQuery,a&&(r.prototype.option||(r.prototype.option=function(t){a.isPlainObject(t)&&(this.options=a.extend(!0,this.options,t))}),a.fn[i]=function(t){if("string"==typeof t){var e=o.call(arguments,1);return h(this,t,e)}return u(this,t),this},n(a))}function n(t){!t||t&&t.bridget||(t.bridget=i)}var o=Array.prototype.slice,r=t.console,s="undefined"==typeof r?function(){}:function(t){r.error(t)};return n(e||t.jQuery),i}),function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},n=i[t]=i[t]||[];return-1==n.indexOf(e)&&n.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{},n=i[t]=i[t]||{};return n[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=i.indexOf(e);return-1!=n&&i.splice(n,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){i=i.slice(0),e=e||[];for(var n=this._onceEvents&&this._onceEvents[t],o=0;o<i.length;o++){var r=i[o],s=n&&n[r];s&&(this.off(t,r),delete n[r]),r.apply(this,e)}return this}},e.allOff=function(){delete this._events,delete this._onceEvents},t}),function(t,e){"function"==typeof define&&define.amd?define("get-size/get-size",e):"object"==typeof module&&module.exports?module.exports=e():t.getSize=e()}(window,function(){"use strict";function t(t){var e=parseFloat(t),i=-1==t.indexOf("%")&&!isNaN(e);return i&&e}function e(){}function i(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0;u>e;e++){var i=h[e];t[i]=0}return t}function n(t){var e=getComputedStyle(t);return e||a("Style returned "+e+". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1"),e}function o(){if(!d){d=!0;var e=document.createElement("div");e.style.width="200px",e.style.padding="1px 2px 3px 4px",e.style.borderStyle="solid",e.style.borderWidth="1px 2px 3px 4px",e.style.boxSizing="border-box";var i=document.body||document.documentElement;i.appendChild(e);var o=n(e);s=200==Math.round(t(o.width)),r.isBoxSizeOuter=s,i.removeChild(e)}}function r(e){if(o(),"string"==typeof e&&(e=document.querySelector(e)),e&&"object"==typeof e&&e.nodeType){var r=n(e);if("none"==r.display)return i();var a={};a.width=e.offsetWidth,a.height=e.offsetHeight;for(var d=a.isBorderBox="border-box"==r.boxSizing,l=0;u>l;l++){var c=h[l],f=r[c],m=parseFloat(f);a[c]=isNaN(m)?0:m}var p=a.paddingLeft+a.paddingRight,g=a.paddingTop+a.paddingBottom,y=a.marginLeft+a.marginRight,v=a.marginTop+a.marginBottom,_=a.borderLeftWidth+a.borderRightWidth,z=a.borderTopWidth+a.borderBottomWidth,E=d&&s,b=t(r.width);b!==!1&&(a.width=b+(E?0:p+_));var x=t(r.height);return x!==!1&&(a.height=x+(E?0:g+z)),a.innerWidth=a.width-(p+_),a.innerHeight=a.height-(g+z),a.outerWidth=a.width+y,a.outerHeight=a.height+v,a}}var s,a="undefined"==typeof console?e:function(t){console.error(t)},h=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],u=h.length,d=!1;return r}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("desandro-matches-selector/matches-selector",e):"object"==typeof module&&module.exports?module.exports=e():t.matchesSelector=e()}(window,function(){"use strict";var t=function(){var t=window.Element.prototype;if(t.matches)return"matches";if(t.matchesSelector)return"matchesSelector";for(var e=["webkit","moz","ms","o"],i=0;i<e.length;i++){var n=e[i],o=n+"MatchesSelector";if(t[o])return o}}();return function(e,i){return e[t](i)}}),function(t,e){"function"==typeof define&&define.amd?define("fizzy-ui-utils/utils",["desandro-matches-selector/matches-selector"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("desandro-matches-selector")):t.fizzyUIUtils=e(t,t.matchesSelector)}(window,function(t,e){var i={};i.extend=function(t,e){for(var i in e)t[i]=e[i];return t},i.modulo=function(t,e){return(t%e+e)%e};var n=Array.prototype.slice;i.makeArray=function(t){if(Array.isArray(t))return t;if(null===t||void 0===t)return[];var e="object"==typeof t&&"number"==typeof t.length;return e?n.call(t):[t]},i.removeFrom=function(t,e){var i=t.indexOf(e);-1!=i&&t.splice(i,1)},i.getParent=function(t,i){for(;t.parentNode&&t!=document.body;)if(t=t.parentNode,e(t,i))return t},i.getQueryElement=function(t){return"string"==typeof t?document.querySelector(t):t},i.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},i.filterFindElements=function(t,n){t=i.makeArray(t);var o=[];return t.forEach(function(t){if(t instanceof HTMLElement){if(!n)return void o.push(t);e(t,n)&&o.push(t);for(var i=t.querySelectorAll(n),r=0;r<i.length;r++)o.push(i[r])}}),o},i.debounceMethod=function(t,e,i){i=i||100;var n=t.prototype[e],o=e+"Timeout";t.prototype[e]=function(){var t=this[o];clearTimeout(t);var e=arguments,r=this;this[o]=setTimeout(function(){n.apply(r,e),delete r[o]},i)}},i.docReady=function(t){var e=document.readyState;"complete"==e||"interactive"==e?setTimeout(t):document.addEventListener("DOMContentLoaded",t)},i.toDashed=function(t){return t.replace(/(.)([A-Z])/g,function(t,e,i){return e+"-"+i}).toLowerCase()};var o=t.console;return i.htmlInit=function(e,n){i.docReady(function(){var r=i.toDashed(n),s="data-"+r,a=document.querySelectorAll("["+s+"]"),h=document.querySelectorAll(".js-"+r),u=i.makeArray(a).concat(i.makeArray(h)),d=s+"-options",l=t.jQuery;u.forEach(function(t){var i,r=t.getAttribute(s)||t.getAttribute(d);try{i=r&&JSON.parse(r)}catch(a){return void(o&&o.error("Error parsing "+s+" on "+t.className+": "+a))}var h=new e(t,i);l&&l.data(t,n,h)})})},i}),function(t,e){"function"==typeof define&&define.amd?define("outlayer/item",["ev-emitter/ev-emitter","get-size/get-size"],e):"object"==typeof module&&module.exports?module.exports=e(require("ev-emitter"),require("get-size")):(t.Outlayer={},t.Outlayer.Item=e(t.EvEmitter,t.getSize))}(window,function(t,e){"use strict";function i(t){for(var e in t)return!1;return e=null,!0}function n(t,e){t&&(this.element=t,this.layout=e,this.position={x:0,y:0},this._create())}function o(t){return t.replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()})}var r=document.documentElement.style,s="string"==typeof r.transition?"transition":"WebkitTransition",a="string"==typeof r.transform?"transform":"WebkitTransform",h={WebkitTransition:"webkitTransitionEnd",transition:"transitionend"}[s],u={transform:a,transition:s,transitionDuration:s+"Duration",transitionProperty:s+"Property",transitionDelay:s+"Delay"},d=n.prototype=Object.create(t.prototype);d.constructor=n,d._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},d.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},d.getSize=function(){this.size=e(this.element)},d.css=function(t){var e=this.element.style;for(var i in t){var n=u[i]||i;e[n]=t[i]}},d.getPosition=function(){var t=getComputedStyle(this.element),e=this.layout._getOption("originLeft"),i=this.layout._getOption("originTop"),n=t[e?"left":"right"],o=t[i?"top":"bottom"],r=parseFloat(n),s=parseFloat(o),a=this.layout.size;-1!=n.indexOf("%")&&(r=r/100*a.width),-1!=o.indexOf("%")&&(s=s/100*a.height),r=isNaN(r)?0:r,s=isNaN(s)?0:s,r-=e?a.paddingLeft:a.paddingRight,s-=i?a.paddingTop:a.paddingBottom,this.position.x=r,this.position.y=s},d.layoutPosition=function(){var t=this.layout.size,e={},i=this.layout._getOption("originLeft"),n=this.layout._getOption("originTop"),o=i?"paddingLeft":"paddingRight",r=i?"left":"right",s=i?"right":"left",a=this.position.x+t[o];e[r]=this.getXValue(a),e[s]="";var h=n?"paddingTop":"paddingBottom",u=n?"top":"bottom",d=n?"bottom":"top",l=this.position.y+t[h];e[u]=this.getYValue(l),e[d]="",this.css(e),this.emitEvent("layout",[this])},d.getXValue=function(t){var e=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&!e?t/this.layout.size.width*100+"%":t+"px"},d.getYValue=function(t){var e=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&e?t/this.layout.size.height*100+"%":t+"px"},d._transitionTo=function(t,e){this.getPosition();var i=this.position.x,n=this.position.y,o=t==this.position.x&&e==this.position.y;if(this.setPosition(t,e),o&&!this.isTransitioning)return void this.layoutPosition();var r=t-i,s=e-n,a={};a.transform=this.getTranslate(r,s),this.transition({to:a,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})},d.getTranslate=function(t,e){var i=this.layout._getOption("originLeft"),n=this.layout._getOption("originTop");return t=i?t:-t,e=n?e:-e,"translate3d("+t+"px, "+e+"px, 0)"},d.goTo=function(t,e){this.setPosition(t,e),this.layoutPosition()},d.moveTo=d._transitionTo,d.setPosition=function(t,e){this.position.x=parseFloat(t),this.position.y=parseFloat(e)},d._nonTransition=function(t){this.css(t.to),t.isCleaning&&this._removeStyles(t.to);for(var e in t.onTransitionEnd)t.onTransitionEnd[e].call(this)},d.transition=function(t){if(!parseFloat(this.layout.options.transitionDuration))return void this._nonTransition(t);var e=this._transn;for(var i in t.onTransitionEnd)e.onEnd[i]=t.onTransitionEnd[i];for(i in t.to)e.ingProperties[i]=!0,t.isCleaning&&(e.clean[i]=!0);if(t.from){this.css(t.from);var n=this.element.offsetHeight;n=null}this.enableTransition(t.to),this.css(t.to),this.isTransitioning=!0};var l="opacity,"+o(a);d.enableTransition=function(){if(!this.isTransitioning){var t=this.layout.options.transitionDuration;t="number"==typeof t?t+"ms":t,this.css({transitionProperty:l,transitionDuration:t,transitionDelay:this.staggerDelay||0}),this.element.addEventListener(h,this,!1)}},d.onwebkitTransitionEnd=function(t){this.ontransitionend(t)},d.onotransitionend=function(t){this.ontransitionend(t)};var c={"-webkit-transform":"transform"};d.ontransitionend=function(t){if(t.target===this.element){var e=this._transn,n=c[t.propertyName]||t.propertyName;if(delete e.ingProperties[n],i(e.ingProperties)&&this.disableTransition(),n in e.clean&&(this.element.style[t.propertyName]="",delete e.clean[n]),n in e.onEnd){var o=e.onEnd[n];o.call(this),delete e.onEnd[n]}this.emitEvent("transitionEnd",[this])}},d.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(h,this,!1),this.isTransitioning=!1},d._removeStyles=function(t){var e={};for(var i in t)e[i]="";this.css(e)};var f={transitionProperty:"",transitionDuration:"",transitionDelay:""};return d.removeTransitionStyles=function(){this.css(f)},d.stagger=function(t){t=isNaN(t)?0:t,this.staggerDelay=t+"ms"},d.removeElem=function(){this.element.parentNode.removeChild(this.element),this.css({display:""}),this.emitEvent("remove",[this])},d.remove=function(){return s&&parseFloat(this.layout.options.transitionDuration)?(this.once("transitionEnd",function(){this.removeElem()}),void this.hide()):void this.removeElem()},d.reveal=function(){delete this.isHidden,this.css({display:""});var t=this.layout.options,e={},i=this.getHideRevealTransitionEndProperty("visibleStyle");e[i]=this.onRevealTransitionEnd,this.transition({from:t.hiddenStyle,to:t.visibleStyle,isCleaning:!0,onTransitionEnd:e})},d.onRevealTransitionEnd=function(){this.isHidden||this.emitEvent("reveal")},d.getHideRevealTransitionEndProperty=function(t){var e=this.layout.options[t];if(e.opacity)return"opacity";for(var i in e)return i},d.hide=function(){this.isHidden=!0,this.css({display:""});var t=this.layout.options,e={},i=this.getHideRevealTransitionEndProperty("hiddenStyle");e[i]=this.onHideTransitionEnd,this.transition({from:t.visibleStyle,to:t.hiddenStyle,isCleaning:!0,onTransitionEnd:e})},d.onHideTransitionEnd=function(){this.isHidden&&(this.css({display:"none"}),this.emitEvent("hide"))},d.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},n}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("outlayer/outlayer",["ev-emitter/ev-emitter","get-size/get-size","fizzy-ui-utils/utils","./item"],function(i,n,o,r){return e(t,i,n,o,r)}):"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter"),require("get-size"),require("fizzy-ui-utils"),require("./item")):t.Outlayer=e(t,t.EvEmitter,t.getSize,t.fizzyUIUtils,t.Outlayer.Item)}(window,function(t,e,i,n,o){"use strict";function r(t,e){var i=n.getQueryElement(t);if(!i)return void(h&&h.error("Bad element for "+this.constructor.namespace+": "+(i||t)));this.element=i,u&&(this.$element=u(this.element)),this.options=n.extend({},this.constructor.defaults),this.option(e);var o=++l;this.element.outlayerGUID=o,c[o]=this,this._create();var r=this._getOption("initLayout");r&&this.layout()}function s(t){function e(){t.apply(this,arguments)}return e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e}function a(t){if("number"==typeof t)return t;var e=t.match(/(^\d*\.?\d*)(\w*)/),i=e&&e[1],n=e&&e[2];if(!i.length)return 0;i=parseFloat(i);var o=m[n]||1;return i*o}var h=t.console,u=t.jQuery,d=function(){},l=0,c={};r.namespace="outlayer",r.Item=o,r.defaults={containerStyle:{position:"relative"},initLayout:!0,originLeft:!0,originTop:!0,resize:!0,resizeContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}};var f=r.prototype;n.extend(f,e.prototype),f.option=function(t){n.extend(this.options,t)},f._getOption=function(t){var e=this.constructor.compatOptions[t];return e&&void 0!==this.options[e]?this.options[e]:this.options[t]},r.compatOptions={initLayout:"isInitLayout",horizontal:"isHorizontal",layoutInstant:"isLayoutInstant",originLeft:"isOriginLeft",originTop:"isOriginTop",resize:"isResizeBound",resizeContainer:"isResizingContainer"},f._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),n.extend(this.element.style,this.options.containerStyle);var t=this._getOption("resize");t&&this.bindResize()},f.reloadItems=function(){this.items=this._itemize(this.element.children)},f._itemize=function(t){for(var e=this._filterFindItemElements(t),i=this.constructor.Item,n=[],o=0;o<e.length;o++){var r=e[o],s=new i(r,this);n.push(s)}return n},f._filterFindItemElements=function(t){return n.filterFindElements(t,this.options.itemSelector)},f.getItemElements=function(){return this.items.map(function(t){return t.element})},f.layout=function(){this._resetLayout(),this._manageStamps();var t=this._getOption("layoutInstant"),e=void 0!==t?t:!this._isLayoutInited;this.layoutItems(this.items,e),this._isLayoutInited=!0},f._init=f.layout,f._resetLayout=function(){this.getSize()},f.getSize=function(){this.size=i(this.element)},f._getMeasurement=function(t,e){var n,o=this.options[t];o?("string"==typeof o?n=this.element.querySelector(o):o instanceof HTMLElement&&(n=o),this[t]=n?i(n)[e]:o):this[t]=0},f.layoutItems=function(t,e){t=this._getItemsForLayout(t),this._layoutItems(t,e),this._postLayout()},f._getItemsForLayout=function(t){return t.filter(function(t){return!t.isIgnored})},f._layoutItems=function(t,e){if(this._emitCompleteOnItems("layout",t),t&&t.length){var i=[];t.forEach(function(t){var n=this._getItemLayoutPosition(t);n.item=t,n.isInstant=e||t.isLayoutInstant,i.push(n)},this),this._processLayoutQueue(i)}},f._getItemLayoutPosition=function(){return{x:0,y:0}},f._processLayoutQueue=function(t){this.updateStagger(),t.forEach(function(t,e){this._positionItem(t.item,t.x,t.y,t.isInstant,e)},this)},f.updateStagger=function(){var t=this.options.stagger;return null===t||void 0===t?void(this.stagger=0):(this.stagger=a(t),this.stagger)},f._positionItem=function(t,e,i,n,o){n?t.goTo(e,i):(t.stagger(o*this.stagger),t.moveTo(e,i))},f._postLayout=function(){this.resizeContainer()},f.resizeContainer=function(){var t=this._getOption("resizeContainer");if(t){var e=this._getContainerSize();e&&(this._setContainerMeasure(e.width,!0),this._setContainerMeasure(e.height,!1))}},f._getContainerSize=d,f._setContainerMeasure=function(t,e){if(void 0!==t){var i=this.size;i.isBorderBox&&(t+=e?i.paddingLeft+i.paddingRight+i.borderLeftWidth+i.borderRightWidth:i.paddingBottom+i.paddingTop+i.borderTopWidth+i.borderBottomWidth),t=Math.max(t,0),this.element.style[e?"width":"height"]=t+"px"}},f._emitCompleteOnItems=function(t,e){function i(){o.dispatchEvent(t+"Complete",null,[e])}function n(){s++,s==r&&i()}var o=this,r=e.length;if(!e||!r)return void i();var s=0;e.forEach(function(e){e.once(t,n)})},f.dispatchEvent=function(t,e,i){var n=e?[e].concat(i):i;if(this.emitEvent(t,n),u)if(this.$element=this.$element||u(this.element),e){var o=u.Event(e);o.type=t,this.$element.trigger(o,i)}else this.$element.trigger(t,i)},f.ignore=function(t){var e=this.getItem(t);e&&(e.isIgnored=!0)},f.unignore=function(t){var e=this.getItem(t);e&&delete e.isIgnored},f.stamp=function(t){t=this._find(t),t&&(this.stamps=this.stamps.concat(t),t.forEach(this.ignore,this))},f.unstamp=function(t){t=this._find(t),t&&t.forEach(function(t){n.removeFrom(this.stamps,t),this.unignore(t)},this)},f._find=function(t){return t?("string"==typeof t&&(t=this.element.querySelectorAll(t)),t=n.makeArray(t)):void 0},f._manageStamps=function(){this.stamps&&this.stamps.length&&(this._getBoundingRect(),this.stamps.forEach(this._manageStamp,this))},f._getBoundingRect=function(){var t=this.element.getBoundingClientRect(),e=this.size;this._boundingRect={left:t.left+e.paddingLeft+e.borderLeftWidth,top:t.top+e.paddingTop+e.borderTopWidth,right:t.right-(e.paddingRight+e.borderRightWidth),bottom:t.bottom-(e.paddingBottom+e.borderBottomWidth)}},f._manageStamp=d,f._getElementOffset=function(t){var e=t.getBoundingClientRect(),n=this._boundingRect,o=i(t),r={left:e.left-n.left-o.marginLeft,top:e.top-n.top-o.marginTop,right:n.right-e.right-o.marginRight,bottom:n.bottom-e.bottom-o.marginBottom};return r},f.handleEvent=n.handleEvent,f.bindResize=function(){t.addEventListener("resize",this),this.isResizeBound=!0},f.unbindResize=function(){t.removeEventListener("resize",this),this.isResizeBound=!1},f.onresize=function(){this.resize()},n.debounceMethod(r,"onresize",100),f.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&this.layout()},f.needsResizeLayout=function(){var t=i(this.element),e=this.size&&t;return e&&t.innerWidth!==this.size.innerWidth},f.addItems=function(t){var e=this._itemize(t);return e.length&&(this.items=this.items.concat(e)),e},f.appended=function(t){var e=this.addItems(t);e.length&&(this.layoutItems(e,!0),this.reveal(e))},f.prepended=function(t){var e=this._itemize(t);if(e.length){var i=this.items.slice(0);this.items=e.concat(i),this._resetLayout(),this._manageStamps(),this.layoutItems(e,!0),this.reveal(e),this.layoutItems(i)}},f.reveal=function(t){if(this._emitCompleteOnItems("reveal",t),t&&t.length){var e=this.updateStagger();t.forEach(function(t,i){t.stagger(i*e),t.reveal()})}},f.hide=function(t){if(this._emitCompleteOnItems("hide",t),t&&t.length){var e=this.updateStagger();t.forEach(function(t,i){t.stagger(i*e),t.hide()})}},f.revealItemElements=function(t){var e=this.getItems(t);this.reveal(e)},f.hideItemElements=function(t){var e=this.getItems(t);this.hide(e)},f.getItem=function(t){for(var e=0;e<this.items.length;e++){var i=this.items[e];if(i.element==t)return i}},f.getItems=function(t){t=n.makeArray(t);var e=[];return t.forEach(function(t){var i=this.getItem(t);i&&e.push(i)},this),e},f.remove=function(t){var e=this.getItems(t);this._emitCompleteOnItems("remove",e),e&&e.length&&e.forEach(function(t){t.remove(),n.removeFrom(this.items,t)},this)},f.destroy=function(){var t=this.element.style;t.height="",t.position="",t.width="",this.items.forEach(function(t){t.destroy()}),this.unbindResize();var e=this.element.outlayerGUID;delete c[e],delete this.element.outlayerGUID,u&&u.removeData(this.element,this.constructor.namespace)},r.data=function(t){t=n.getQueryElement(t);var e=t&&t.outlayerGUID;return e&&c[e]},r.create=function(t,e){var i=s(r);return i.defaults=n.extend({},r.defaults),n.extend(i.defaults,e),i.compatOptions=n.extend({},r.compatOptions),i.namespace=t,i.data=r.data,i.Item=s(o),n.htmlInit(i,t),u&&u.bridget&&u.bridget(t,i),i};var m={ms:1,s:1e3};return r.Item=o,r}),function(t,e){"function"==typeof define&&define.amd?define(["outlayer/outlayer","get-size/get-size"],e):"object"==typeof module&&module.exports?module.exports=e(require("outlayer"),require("get-size")):t.Masonry=e(t.Outlayer,t.getSize)}(window,function(t,e){var i=t.create("masonry");i.compatOptions.fitWidth="isFitWidth";var n=i.prototype;return n._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns(),this.colYs=[];for(var t=0;t<this.cols;t++)this.colYs.push(0);this.maxY=0,this.horizontalColIndex=0},n.measureColumns=function(){if(this.getContainerWidth(),!this.columnWidth){var t=this.items[0],i=t&&t.element;this.columnWidth=i&&e(i).outerWidth||this.containerWidth}var n=this.columnWidth+=this.gutter,o=this.containerWidth+this.gutter,r=o/n,s=n-o%n,a=s&&1>s?"round":"floor";r=Math[a](r),this.cols=Math.max(r,1)},n.getContainerWidth=function(){var t=this._getOption("fitWidth"),i=t?this.element.parentNode:this.element,n=e(i);this.containerWidth=n&&n.innerWidth},n._getItemLayoutPosition=function(t){t.getSize();var e=t.size.outerWidth%this.columnWidth,i=e&&1>e?"round":"ceil",n=Math[i](t.size.outerWidth/this.columnWidth);n=Math.min(n,this.cols);for(var o=this.options.horizontalOrder?"_getHorizontalColPosition":"_getTopColPosition",r=this[o](n,t),s={x:this.columnWidth*r.col,y:r.y},a=r.y+t.size.outerHeight,h=n+r.col,u=r.col;h>u;u++)this.colYs[u]=a;return s},n._getTopColPosition=function(t){var e=this._getTopColGroup(t),i=Math.min.apply(Math,e);return{col:e.indexOf(i),y:i}},n._getTopColGroup=function(t){if(2>t)return this.colYs;for(var e=[],i=this.cols+1-t,n=0;i>n;n++)e[n]=this._getColGroupY(n,t);return e},n._getColGroupY=function(t,e){if(2>e)return this.colYs[t];var i=this.colYs.slice(t,t+e);return Math.max.apply(Math,i)},n._getHorizontalColPosition=function(t,e){var i=this.horizontalColIndex%this.cols,n=t>1&&i+t>this.cols;i=n?0:i;var o=e.size.outerWidth&&e.size.outerHeight;return this.horizontalColIndex=o?i+t:this.horizontalColIndex,{col:i,y:this._getColGroupY(i,t)}},n._manageStamp=function(t){var i=e(t),n=this._getElementOffset(t),o=this._getOption("originLeft"),r=o?n.left:n.right,s=r+i.outerWidth,a=Math.floor(r/this.columnWidth);a=Math.max(0,a);var h=Math.floor(s/this.columnWidth);h-=s%this.columnWidth?0:1,h=Math.min(this.cols-1,h);for(var u=this._getOption("originTop"),d=(u?n.top:n.bottom)+i.outerHeight,l=a;h>=l;l++)this.colYs[l]=Math.max(d,this.colYs[l])},n._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var t={height:this.maxY};return this._getOption("fitWidth")&&(t.width=this._getContainerFitWidth()),t},n._getContainerFitWidth=function(){for(var t=0,e=this.cols;--e&&0===this.colYs[e];)t++;return(this.cols-t)*this.columnWidth-this.gutter},n.needsResizeLayout=function(){var t=this.containerWidth;return this.getContainerWidth(),t!=this.containerWidth},i});
11 12/** 13 * A Twitter library in JavaScript 14 * 15 * @package codebird 16 * @version 2.5.0 17 * @author Jublo Solutions <[email protected]> 18 * @copyright 2010-2014 Jublo Solutions <[email protected]> 19 * @license http://opensource.org/licenses/GPL-3.0 GNU Public License 3.0 20 * @link https://github.com/jublonet/codebird-php 21 */ 22 23/* jshint curly: true, 24 eqeqeq: true, 25 latedef: true, 26 quotmark: double, 27 undef: true, 28 unused: true, 29 trailing: true, 30 laxbreak: true */ 31/* global window, 32 document, 33 navigator, 34 console, 35 Ti, 36 ActiveXObject, 37 module, 38 define, 39 require */ 40(function (undefined) { 41"use strict"; 42 43/** 44 * Array.indexOf polyfill 45 */ 46if (! Array.prototype.indexOf) { 47 Array.prototype.indexOf = function (obj, start) { 48 for (var i = (start || 0); i < this.length; i++) { 49 if (this[i] === obj) { 50 return i; 51 } 52 } 53 return -1; 54 }; 55} 56 57/** 58 * A Twitter library in JavaScript 59 * 60 * @package codebird 61 * @subpackage codebird-js 62 */ 63/* jshint -W098 */ 64var Codebird = function () { 65/* jshint +W098 */ 66 67 /** 68 * The OAuth consumer key of your registered app 69 */ 70 var _oauth_consumer_key = null; 71 72 /** 73 * The corresponding consumer secret 74 */ 75 var _oauth_consumer_secret = null; 76 77 /** 78 * The app-only bearer token. Used to authorize app-only requests 79 */ 80 var _oauth_bearer_token = null; 81 82 /** 83 * The API endpoint base to use 84 */ 85 var _endpoint_base = "https://api.twitter.com/"; 86 87 /** 88 * The media API endpoint base to use 89 */ 90 var _endpoint_base_media = "https://upload.twitter.com/"; 91 92 /** 93 * The API endpoint to use 94 */ 95 var _endpoint = _endpoint_base + "1.1/"; 96 97 /** 98 * The media API endpoint to use 99 */ 100 var _endpoint_media = _endpoint_base_media + "1.1/"; 101 102 /** 103 * The API endpoint base to use 104 */ 105 var _endpoint_oauth = _endpoint_base; 106 107 /** 108 * API proxy endpoint 109 */ 110 var _endpoint_proxy = "https://api.jublo.net/codebird/"; 111 112 /** 113 * The API endpoint to use for old requests 114 */ 115 var _endpoint_old = _endpoint_base + "1/"; 116 117 /** 118 * Use JSONP for GET requests in IE7-9 119 */ 120 var _use_jsonp = (typeof navigator !== "undefined" 121 && typeof navigator.userAgent !== "undefined" 122 && (navigator.userAgent.indexOf("Trident/4") > -1 123 || navigator.userAgent.indexOf("Trident/5") > -1 124 || navigator.userAgent.indexOf("MSIE 7.0") > -1 125 ) 126 ); 127 128 /** 129 * Whether to access the API via a proxy that is allowed by CORS 130 * Assume that CORS is only necessary in browsers 131 */ 132 var _use_proxy = (typeof navigator !== "undefined" 133 && typeof navigator.userAgent !== "undefined" 134 ); 135 136 /** 137 * The Request or access token. Used to sign requests 138 */ 139 var _oauth_token = null; 140 141 /** 142 * The corresponding request or access token secret 143 */ 144 var _oauth_token_secret = null; 145 146 /** 147 * The current Codebird version 148 */ 149 var _version = "2.5.0"; 150 151 /** 152 * Sets the OAuth consumer key and secret (App key) 153 * 154 * @param string key OAuth consumer key 155 * @param string secret OAuth consumer secret 156 * 157 * @return void 158 */ 159 var setConsumerKey = function (key, secret) { 160 _oauth_consumer_key = key; 161 _oauth_consumer_secret = secret; 162 }; 163 164 /** 165 * Sets the OAuth2 app-only auth bearer token 166 * 167 * @param string token OAuth2 bearer token 168 * 169 * @return void 170 */ 171 var setBearerToken = function (token) { 172 _oauth_bearer_token = token; 173 }; 174 175 /** 176 * Gets the current Codebird version 177 * 178 * @return string The version number 179 */ 180 var getVersion = function () { 181 return _version; 182 }; 183 184 /** 185 * Sets the OAuth request or access token and secret (User key) 186 * 187 * @param string token OAuth request or access token 188 * @param string secret OAuth request or access token secret 189 * 190 * @return void 191 */ 192 var setToken = function (token, secret) { 193 _oauth_token = token; 194 _oauth_token_secret = secret;
195 }; 196 197 /** 198 * Enables or disables CORS proxy 199 * 200 * @param bool use_proxy Whether to use CORS proxy or not 201 * 202 * @return void 203 */ 204 var setUseProxy = function (use_proxy) { 205 _use_proxy = !! use_proxy; 206 }; 207 208 /** 209 * Sets custom CORS proxy server 210 * 211 * @param string proxy Address of proxy server to use 212 * 213 * @return void 214 */ 215 var setProxy = function (proxy) { 216 // add trailing slash if missing 217 if (! proxy.match(/\/$/)) { 218 proxy += "/"; 219 } 220 _endpoint_proxy = proxy; 221 }; 222 223 /** 224 * Parse URL-style parameters into object 225 * 226 * version: 1109.2015 227 * discuss at: http://phpjs.org/functions/parse_str 228 * + original by: Cagri Ekin 229 * + improved by: Michael White (http://getsprink.com) 230 * + tweaked by: Jack 231 * + bugfixed by: Onno Marsman 232 * + reimplemented by: stag019 233 * + bugfixed by: Brett Zamir (http://brett-zamir.me) 234 * + bugfixed by: stag019 235 * - depends on: urldecode 236 * + input by: Dreamer 237 * + bugfixed by: Brett Zamir (http://brett-zamir.me) 238 * % note 1: When no argument is specified, will put variables in global scope. 239 * 240 * @param string str String to parse 241 * @param array array to load data into 242 * 243 * @return object 244 */ 245 var _parse_str = function (str, array) { 246 var glue1 = "=", 247 glue2 = "&", 248 array2 = String(str).replace(/^&?([\s\S]*?)&?$/, "$1").split(glue2), 249 i, j, chr, tmp, key, value, bracket, keys, evalStr, 250 fixStr = function (str) { 251 return decodeURIComponent(str).replace(/([\\"'])/g, "\\$1").replace(/\n/g, "\\n").replace(/\r/g, "\\r"); 252 }; 253 if (! array) { 254 array = this.window; 255 } 256 257 for (i = 0; i < array2.length; i++) { 258 tmp = array2[i].split(glue1); 259 if (tmp.length < 2) { 260 tmp = [tmp, ""]; 261 } 262 key = fixStr(tmp[0]); 263 value = fixStr(tmp[1]); 264 while (key.charAt(0) === " ") { 265 key = key.substr(1); 266 } 267 if (key.indexOf("\0") !== -1) { 268 key = key.substr(0, key.indexOf("\0")); 269 } 270 if (key && key.charAt(0) !== "[") { 271 keys = []; 272 bracket = 0; 273 for (j = 0; j < key.length; j++) { 274 if (key.charAt(j) === "[" && !bracket) { 275 bracket = j + 1; 276 } else if (key.charAt(j) === "]") { 277 if (bracket) { 278 if (!keys.length) { 279 keys.push(key.substr(0, bracket - 1)); 280 } 281 keys.push(key.substr(bracket, j - bracket)); 282 bracket = 0; 283 if (key.charAt(j + 1) !== "[") { 284 break; 285 } 286 } 287 } 288 } 289 if (!keys.length) { 290 keys = [key]; 291 } 292 for (j = 0; j < keys[0].length; j++) { 293 chr = keys[0].charAt(j); 294 if (chr === " " || chr === "." || chr === "[") { 295 keys[0] = keys[0].substr(0, j) + "_" + keys[0].substr(j + 1); 296 } 297 if (chr === "[") { 298 break; 299 } 300 } 301 /* jshint -W061 */ 302 evalStr = "array"; 303 for (j = 0; j < keys.length; j++) { 304 key = keys[j]; 305 if ((key !== "" && key !== " ") || j === 0) { 306 key = "'" + key + "'"; 307 } else { 308 key = eval(evalStr + ".push([]);") - 1; 309 } 310 evalStr += "[" + key + "]"; 311 if (j !== keys.length - 1 && eval("typeof " + evalStr) === "undefined") { 312 eval(evalStr + " = [];"); 313 } 314 } 315 evalStr += " = '" + value + "';\n"; 316 eval(evalStr); 317 /* jshint +W061 */ 318 } 319 } 320 }; 321 322 /** 323 * Main API handler working on any requests you issue 324 * 325 * @param string fn The member function you called 326 * @param array params The parameters you sent along 327 * @param function callback The callback to call with the reply 328 * @param bool app_only_auth Whether to use app-only auth 329 * 330 * @return mixed The API reply encoded in the set return_format 331 */ 332 333 var __call = function (fn, params, callback, app_only_auth) { 334 if (typeof params === "undefined") { 335 params = {}; 336 } 337 if (typeof app_only_auth === "undefined") { 338 app_only_auth = false;
339 } 340 if (typeof callback !== "function" && typeof params === "function") { 341 callback = params; 342 params = {}; 343 if (typeof callback === "boolean") { 344 app_only_auth = callback; 345 } 346 } else if (typeof callback === "undefined") { 347 callback = function () {}; 348 } 349 switch (fn) { 350 case "oauth_authenticate": 351 case "oauth_authorize": 352 return this[fn](params, callback); 353 354 case "oauth2_token": 355 return this[fn](callback); 356 } 357 // reset token when requesting a new token (causes 401 for signature error on 2nd+ requests) 358 if (fn === "oauth_requestToken") { 359 setToken(null, null); 360 } 361 // parse parameters 362 var apiparams = {}; 363 if (typeof params === "object") { 364 apiparams = params; 365 } else { 366 _parse_str(params, apiparams); //TODO 367 } 368 369 // map function name to API method 370 var method = ""; 371 var param, i, j; 372 373 // replace _ by / 374 var path = fn.split("_"); 375 for (i = 0; i < path.length; i++) { 376 if (i > 0) { 377 method += "/"; 378 } 379 method += path[i]; 380 } 381 382 // undo replacement for URL parameters 383 var url_parameters_with_underscore = ["screen_name", "place_id"]; 384 for (i = 0; i < url_parameters_with_underscore.length; i++) { 385 param = url_parameters_with_underscore[i].toUpperCase(); 386 var replacement_was = param.split("_").join("/"); 387 method = method.split(replacement_was).join(param); 388 } 389 390 // replace AA by URL parameters 391 var method_template = method; 392 var match = method.match(/[A-Z_]{2,}/); 393 if (match) { 394 for (i = 0; i < match.length; i++) { 395 param = match[i]; 396 var param_l = param.toLowerCase(); 397 method_template = method_template.split(param).join(":" + param_l); 398 if (typeof apiparams[param_l] === "undefined") { 399 for (j = 0; j < 26; j++) { 400 method_template = method_template.split(String.fromCharCode(65 + j)).join("_" + String.fromCharCode(97 + j)); 401 } 402 console.warn("To call the templated method \"" + method_template + "\", specify the parameter value for \"" + param_l + "\"."); 403 } 404 method = method.split(param).join(apiparams[param_l]); 405 delete apiparams[param_l]; 406 } 407 } 408 409 // replace A-Z by _a-z 410 for (i = 0; i < 26; i++) { 411 method = method.split(String.fromCharCode(65 + i)).join("_" + String.fromCharCode(97 + i)); 412 method_template = method_template.split(String.fromCharCode(65 + i)).join("_" + String.fromCharCode(97 + i)); 413 } 414 415 var httpmethod = _detectMethod(method_template, apiparams); 416 var multipart = _detectMultipart(method_template); 417 var internal = _detectInternal(method_template); 418 419 return _callApi( 420 httpmethod, 421 method, 422 apiparams, 423 multipart, 424 app_only_auth, 425 internal, 426 callback 427 ); 428 }; 429 430 /** 431 * Gets the OAuth authenticate URL for the current request token 432 * 433 * @return string The OAuth authenticate URL 434 */ 435 var oauth_authenticate = function (params, callback) { 436 if (typeof params.force_login === "undefined") { 437 params.force_login = null; 438 } 439 if (typeof params.screen_name === "undefined") { 440 params.screen_name = null; 441 } 442 if (_oauth_token === null) { 443 console.warn("To get the authenticate URL, the OAuth token must be set."); 444 } 445 var url = _endpoint_oauth + "oauth/authenticate?oauth_token=" + _url(_oauth_token); 446 if (params.force_login === true) { 447 url += "?force_login=1"; 448 if (params.screen_name !== null) { 449 url += "&screen_name=" + params.screen_name; 450 } 451 } 452 callback(url); 453 return true; 454 }; 455 456 /** 457 * Gets the OAuth authorize URL for the current request token 458 * 459 * @return string The OAuth authorize URL 460 */ 461 var oauth_authorize = function (params, callback) { 462 if (typeof params.force_login === "undefined") { 463 params.force_login = null; 464 } 465 if (typeof params.screen_name === "undefined") { 466 params.screen_name = null; 467 } 468 if (_oauth_token === null) { 469 console.warn("To get the authorize URL, the OAuth token must be set."); 470 } 471 var url = _endpoint_oauth + "oauth/authorize?oauth_token=" + _url(_oauth_token); 472 if (params.force_login === true) { 473 url += "?force_login=1"; 474 if (params.screen_name !== null) { 475 url += "&screen_name=" + params.screen_name; 476 } 477 } 478 callback(url); 479 return true; 480 }; 481 482 /** 483 * Gets the OAuth bearer token 484 * 485 * @return string The OAuth bearer token 486 */ 487 488 var oauth2_token = function (callback) { 489 if (_oauth_consumer_key === null) { 490 console.warn("To obtain a bearer token, the consumer key must be set."); 491 } 492 493 if (typeof callback === "undefined") { 494 callback = function () {}; 495 } 496 497 var post_fields = "grant_type=client_credentials"; 498 var url = _endpoint_oauth + "oauth2/token"; 499 500 if (_use_proxy) { 501 url = url.replace( 502 _endpoint_base, 503 _endpoint_proxy 504 ); 505 } 506 507 var xml = _getXmlRequestObject(); 508 if (xml === null) { 509 return; 510 } 511 xml.open("POST", url, true); 512 xml.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 513 xml.setRequestHeader( 514 (_use_proxy ? "X-" : "") + "Authorization", 515 "Basic " + _base64_encode(_oauth_consumer_key + ":" + _oauth_consumer_secret) 516 ); 517 518 xml.onreadystatechange = function () { 519 if (xml.readyState >= 4) { 520 var httpstatus = 12027; 521 try { 522 httpstatus = xml.status; 523 } catch (e) {} 524 var response = ""; 525 try { 526 response = xml.responseText; 527 } catch (e) {} 528 var reply = _parseApiReply(response); 529 reply.httpstatus = httpstatus; 530 if (httpstatus === 200) { 531 setBearerToken(reply.access_token); 532 } 533 callback(reply); 534 } 535 }; 536 xml.send(post_fields); 537 538 }; 539 540 /** 541 * Signing helpers 542 */ 543 544 /** 545 * URL-encodes the given data 546 * 547 * @param mixed data 548 * 549 * @return mixed The encoded data 550 */ 551 var _url = function (data) { 552 if ((/boolean|number|string/).test(typeof data)) { 553 return encodeURIComponent(data).replace(/!/g, "%21").replace(/'/g, "%27").replace(/\(/g, "%28").replace(/\)/g, "%29").replace(/\*/g, "%2A"); 554 } else { 555 return ""; 556 } 557 }; 558 559 /** 560 * Gets the base64-encoded SHA1 hash for the given data 561 * 562 * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined 563 * in FIPS PUB 180-1 564 * Based on version 2.1 Copyright Paul Johnston 2000 - 2002. 565 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet 566 * Distributed under the BSD License 567 * See http://pajhome.org.uk/crypt/md5 for details. 568 * 569 * @param string data The data to calculate the hash from 570 * 571 * @return string The hash 572 */ 573 var _sha1 = function () { 574 function n(e, b) { 575 e[b >> 5] |= 128 << 24 - b % 32; 576 e[(b + 64 >> 9 << 4) + 15] = b; 577 for (var c = new Array(80), a = 1732584193, d = -271733879, h = -1732584194, 578 k = 271733878, g = -1009589776, p = 0; p < e.length; p += 16) { 579 for (var o = a, q = d, r = h, s = k, t = g, f = 0; 80 > f; f++) { 580 var m; 581 582 if (f < 16) { 583 m = e[p + f]; 584 } else { 585 m = c[f - 3] ^ c[f - 8] ^ c[f - 14] ^ c[f - 16]; 586 m = m << 1 | m >>> 31; 587 } 588 589 c[f] = m; 590 m = l(l(a << 5 | a >>> 27, 20 > f ? d & h | ~d & k : 40 > f ? d ^ 591 h ^ k : 60 > f ? d & h | d & k | h & k : d ^ h ^ k), l( 592 l(g, c[f]), 20 > f ? 1518500249 : 40 > f ? 1859775393 : 593 60 > f ? -1894007588 : -899497514)); 594 g = k; 595 k = h; 596 h = d << 30 | d >>> 2; 597 d = a; 598 a = m; 599 } 600 a = l(a, o); 601 d = l(d, q); 602 h = l(h, r); 603 k = l(k, s); 604 g = l(g, t); 605 } 606 return [a, d, h, k, g]; 607 } 608 609 function l(e, b) { 610 var c = (e & 65535) + (b & 65535); 611 return (e >> 16) + (b >> 16) + (c >> 16) << 16 | c & 65535; 612 } 613 614 function q(e) { 615 for (var b = [], c = (1 << g) - 1, a = 0; a < e.length * g; a += g) { 616 b[a >> 5] |= (e.charCodeAt(a / g) & c) << 24 - a % 32; 617 } 618 return b; 619 } 620 var g = 8; 621 return function (e) { 622 var b = _oauth_consumer_secret + "&" + (null !== _oauth_token_secret ? 623 _oauth_token_secret : ""); 624 if (_oauth_consumer_secret === null) { 625 console.warn("To generate a hash, the consumer secret must be set."); 626 } 627 var c = q(b); 628 if (c.length > 16) { 629 c = n(c, b.length * g); 630 } 631 b = new Array(16); 632 for (var a = new Array(16), d = 0; d < 16; d++) { 633 a[d] = c[d] ^ 909522486; 634 b[d] = c[d] ^ 1549556828; 635 } 636 c = n(a.concat(q(e)), 512 + e.length * g); 637 b = n(b.concat(c), 672); 638 c = ""; 639 for (a = 0; a < 4 * b.length; a += 3) { 640 for (d = (b[a >> 2] >> 8 * (3 - a % 4) & 255) << 16 | (b[a + 1 >> 2] >> 641 8 * (3 - (a + 1) % 4) & 255) << 8 | b[a + 2 >> 2] >> 8 * (3 - 642 (a + 2) % 4) & 255, e = 0; 4 > e; e++) { 643 c = 8 * a + 6 * e > 32 * b.length ? c + "=" : c + 644 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
644+/" 645 .charAt(d >> 6 * (3 - e) & 63); 646 } 647 } 648 return c; 649 }; 650 }(); 651 652 /* 653 * Gets the base64 representation for the given data 654 * 655 * http://phpjs.org 656 * + original by: Tyler Akins (http://rumkin.com) 657 * + improved by: Bayron Guevara 658 * + improved by: Thunder.m 659 * + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) 660 * + bugfixed by: Pellentesque Malesuada 661 * + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) 662 * + improved by: Rafał Kukawski (http://kukawski.pl) 663 * 664 * @param string data The data to calculate the base64 representation from 665 * 666 * @return string The base64 representation 667 */ 668 var _base64_encode = function (a) { 669 var d, e, f, b, g = 0, 670 h = 0, 671 i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", 672 c = []; 673 if (!a) { 674 return a; 675 } 676 do { 677 d = a.charCodeAt(g++); 678 e = a.charCodeAt(g++); 679 f = a.charCodeAt(g++); 680 b = d << 16 | e << 8 | f; 681 d = b >> 18 & 63; 682 e = b >> 12 & 63; 683 f = b >> 6 & 63; 684 b &= 63; 685 c[h++] = i.charAt(d) + i.charAt(e) + i.charAt(f) + i.charAt(b); 686 } while (g < a.length); 687 c = c.join(""); 688 a = a.length % 3; 689 return (a ? c.slice(0, a - 3) : c) + "===".slice(a || 3); 690 }; 691 692 /* 693 * Builds a HTTP query string from the given data 694 * 695 * http://phpjs.org 696 * + original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) 697 * + improved by: Legaev Andrey 698 * + improved by: Michael White (http://getsprink.com) 699 * + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) 700 * + improved by: Brett Zamir (http://brett-zamir.me) 701 * + revised by: stag019 702 * + input by: Dreamer 703 * + bugfixed by: Brett Zamir (http://brett-zamir.me) 704 * + bugfixed by: MIO_KODUKI (http://mio-koduki.blogspot.com/) 705 * 706 * @param string data The data to concatenate 707 * 708 * @return string The HTTP query 709 */ 710 var _http_build_query = function (e, f, b) { 711 function g(c, a, d) { 712 var b, e = []; 713 if (a === true) { 714 a = "1"; 715 } else if (a === false) { 716 a = "0"; 717 } 718 if (null !== a) { 719 if (typeof a === "object") { 720 for (b in a) { 721 if (a[b] !== null) { 722 e.push(g(c + "[" + b + "]", a[b], d)); 723 } 724 } 725 return e.join(d); 726 } 727 if (typeof a !== "function") { 728 return _url(c) + "=" + _url(a); 729 } 730 console.warn("There was an error processing for http_build_query()."); 731 } else { 732 return ""; 733 } 734 } 735 var d, c, h = []; 736 if (! b) { 737 b = "&"; 738 } 739 for (c in e) { 740 d = e[c]; 741 if (f && ! isNaN(c)) { 742 c = String(f) + c; 743 } 744 d = g(c, d, b); 745 if (d !== "") { 746 h.push(d); 747 } 748 } 749 return h.join(b); 750 }; 751 752 /** 753 * Generates a (hopefully) unique random string 754 * 755 * @param int optional length The length of the string to generate 756 * 757 * @return string The random string 758 */ 759 var _nonce = function (length) { 760 if (typeof length === "undefined") { 761 length = 8; 762 } 763 if (length < 1) { 764 console.warn("Invalid nonce length."); 765 } 766 var nonce = ""; 767 for (var i = 0; i < length; i++) { 768 var character = Math.floor(Math.random() * 61); 769 nonce += "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz".substring(character, character + 1); 770 } 771 return nonce; 772 }; 773 774 /** 775 * Sort array elements by key 776 * 777 * @param array input_arr The array to sort 778 * 779 * @return array The sorted keys 780 */ 781 var _ksort = function (input_arr) { 782 var keys = [], sorter, k; 783 784 sorter = function (a, b) { 785 var a_float = parseFloat(a), 786 b_float = parseFloat(b), 787 a_numeric = a_float + "" === a, 788 b_numeric = b_float + "" === b; 789 if (a_numeric && b_numeric) { 790 return a_float > b_float ? 1 : a_float < b_float ? -1 : 0; 791 } else if (a_numeric && !b_numeric) { 792 return 1; 793 } else if (!a_numeric && b_numeric) { 794 return -1; 795 } 796 return a > b ? 1 : a < b ? -1 : 0; 797 }; 798 799 // Make a list of key names 800 for (k in input_arr) { 801 if (input_arr.hasOwnProperty(k)) { 802 keys.push(k); 803 } 804 } 805 keys.sort(sorter); 806 return keys; 807 }; 808 809 /** 810 * Clone objects 811 * 812 * @param object obj The object to clone 813 * 814 * @return object clone The cloned object 815 */ 816 var _clone = function (obj) { 817 var clone = {}; 818 for (var i in obj) { 819 if (typeof(obj[i]) === "object") { 820 clone[i] = _clone(obj[i]); 821 } else { 822 clone[i] = obj[i]; 823 } 824 } 825 return clone; 826 }; 827 828 /** 829 * Generates an OAuth signature 830 * 831 * @param string httpmethod Usually either 'GET' or 'POST' or 'DELETE' 832 * @param string method The API method to call 833 * @param array optional params The API call parameters, associative 834 * @param bool optional append_to_get Whether to append the OAuth params to GET 835 * 836 * @return string Authorization HTTP header 837 */ 838 var _sign = function (httpmethod, method, params, append_to_get) { 839 if (typeof params === "undefined") { 840 params = {}; 841 } 842 if (typeof append_to_get === "undefined") { 843 append_to_get = false;
844 } 845 if (_oauth_consumer_key === null) { 846 console.warn("To generate a signature, the consumer key must be set."); 847 } 848 var sign_params = { 849 consumer_key: _oauth_consumer_key, 850 version: "1.0", 851 timestamp: Math.round(new Date().getTime() / 1000), 852 nonce: _nonce(), 853 signature_method: "HMAC-SHA1" 854 }; 855 var sign_base_params = {}; 856 var value; 857 for (var key in sign_params) { 858 value = sign_params[key]; 859 sign_base_params["oauth_" + key] = _url(value); 860 } 861 if (_oauth_token !== null) { 862 sign_base_params.oauth_token = _url(_oauth_token); 863 } 864 var oauth_params = _clone(sign_base_params); 865 for (key in params) { 866 value = params[key]; 867 sign_base_params[key] = value; 868 } 869 var keys = _ksort(sign_base_params); 870 var sign_base_string = ""; 871 for (var i = 0; i < keys.length; i++) { 872 key = keys[i]; 873 value = sign_base_params[key]; 874 sign_base_string += key + "=" + _url(value) + "&"; 875 } 876 sign_base_string = sign_base_string.substring(0, sign_base_string.length - 1); 877 var signature = _sha1(httpmethod + "&" + _url(method) + "&" + _url(sign_base_string)); 878 879 params = append_to_get ? sign_base_params : oauth_params; 880 params.oauth_signature = signature; 881 keys = _ksort(params); 882 var authorization = ""; 883 if (append_to_get) { 884 for(i = 0; i < keys.length; i++) { 885 key = keys[i]; 886 value = params[key]; 887 authorization += key + "=" + _url(value) + "&"; 888 } 889 return authorization.substring(0, authorization.length - 1); 890 } 891 authorization = "OAuth "; 892 for (i = 0; i < keys.length; i++) { 893 key = keys[i]; 894 value = params[key]; 895 authorization += key + "=\"" + _url(value) + "\", "; 896 } 897 return authorization.substring(0, authorization.length - 2); 898 }; 899 900 /** 901 * Detects HTTP method to use for API call 902 * 903 * @param string method The API method to call 904 * @param array params The parameters to send along 905 * 906 * @return string The HTTP method that should be used 907 */ 908 var _detectMethod = function (method, params) { 909 // multi-HTTP method endpoints 910 switch (method) { 911 case "account/settings": 912 case "account/login_verification_enrollment": 913 case "account/login_verification_request": 914 method = params.length ? method + "__post" : method; 915 break; 916 } 917 918 var httpmethods = {}; 919 httpmethods.GET = [ 920 // Timelines 921 "statuses/mentions_timeline", 922 "statuses/user_timeline", 923 "statuses/home_timeline", 924 "statuses/retweets_of_me", 925 926 // Tweets 927 "statuses/retweets/:id", 928 "statuses/show/:id", 929 "statuses/oembed", 930 "statuses/retweeters/ids", 931 932 // Search 933 "search/tweets", 934 935 // Direct Messages 936 "direct_messages", 937 "direct_messages/sent", 938 "direct_messages/show", 939 940 // Friends & Followers 941 "friendships/no_retweets/ids", 942 "friends/ids", 943 "followers/ids", 944 "friendships/lookup", 945 "friendships/incoming", 946 "friendships/outgoing", 947 "friendships/show", 948 "friends/list", 949 "followers/list", 950 "friendships/lookup", 951 952 // Users 953 "account/settings", 954 "account/verify_credentials", 955 "blocks/list", 956 "blocks/ids", 957 "users/lookup", 958 "users/show", 959 "users/search", 960 "users/contributees", 961 "users/contributors", 962 "users/profile_banner", 963 "mutes/users/ids", 964 "mutes/users/list", 965 966 // Suggested Users 967 "users/suggestions/:slug", 968 "users/suggestions", 969 "users/suggestions/:slug/members", 970 971 // Favorites 972 "favorites/list", 973 974 // Lists 975 "lists/list", 976 "lists/statuses", 977 "lists/memberships", 978 "lists/subscribers", 979 "lists/subscribers/show", 980 "lists/members/show", 981 "lists/members", 982 "lists/show", 983 "lists/subscriptions", 984 "lists/ownerships", 985 986 // Saved searches 987 "saved_searches/list", 988 "saved_searches/show/:id", 989 990 // Places & Geo 991 "geo/id/:place_id", 992 "geo/reverse_geocode", 993 "geo/search", 994 "geo/similar_places", 995 996 // Trends 997 "trends/place", 998 "trends/available", 999 "trends/closest", 1000 1001 // OAuth 1002 "oauth/authenticate", 1003 "oauth/authorize", 1004 1005 // Help 1006 "help/configuration", 1007 "help/languages", 1008 "help/privacy", 1009 "help/tos", 1010 "application/rate_limit_status", 1011 1012 // Tweets 1013 "statuses/lookup", 1014 1015 // Internal 1016 "users/recommendations", 1017 "account/push_destinations/device", 1018 "activity/about_me", 1019 "activity/by_friends", 1020 "statuses/media_timeline", 1021 "timeline/home", 1022 "help/experiments", 1023 "search/typeahead", 1024 "search/universal", 1025 "discover/universal", 1026 "conversation/show", 1027 "statuses/:id/activity/summary", 1028 "account/login_verification_enrollment", 1029 "account/login_verification_request", 1030 "prompts/suggest", 1031 1032 "beta/timelines/custom/list", 1033 "beta/timelines/timeline", 1034 "beta/timelines/custom/show" 1035 ]; 1036 httpmethods.POST = [ 1037 // Tweets 1038 "statuses/destroy/:id", 1039 "statuses/update", 1040 "statuses/retweet/:id", 1041 "statuses/update_with_media", 1042 "media/upload", 1043 1044 // Direct Messages 1045 "direct_messages/destroy", 1046 "direct_messages/new", 1047 1048 // Friends & Followers 1049 "friendships/create", 1050 "friendships/destroy", 1051 "friendships/update", 1052 1053 // Users 1054 "account/settings__post", 1055 "account/update_delivery_device", 1056 "account/update_profile", 1057 "account/update_profile_background_image", 1058 "account/update_profile_colors", 1059 "account/update_profile_image", 1060 "blocks/create", 1061 "blocks/destroy", 1062 "account/update_profile_banner", 1063 "account/remove_profile_banner", 1064 "mutes/users/create", 1065 "mutes/users/destroy", 1066 1067 // Favorites 1068 "favorites/destroy", 1069 "favorites/create", 1070 1071 // Lists 1072 "lists/members/destroy", 1073 "lists/subscribers/create", 1074 "lists/subscribers/destroy", 1075 "lists/members/create_all", 1076 "lists/members/create", 1077 "lists/destroy", 1078 "lists/update", 1079 "lists/create", 1080 "lists/members/destroy_all", 1081 1082 // Saved Searches 1083 "saved_searches/create", 1084 "saved_searches/destroy/:id", 1085 1086 // Spam Reporting 1087 "users/report_spam", 1088 1089 // OAuth 1090 "oauth/access_token", 1091 "oauth/request_token", 1092 "oauth2/token", 1093 "oauth2/invalidate_token", 1094 1095 // Internal 1096 "direct_messages/read", 1097 "account/login_verification_enrollment__post", 1098 "push_destinations/enable_login_verification", 1099 "account/login_verification_request__post", 1100 1101 "beta/timelines/custom/create", 1102 "beta/timelines/custom/update", 1103 "beta/timelines/custom/destroy", 1104 "beta/timelines/custom/add", 1105 "beta/timelines/custom/remove" 1106 ]; 1107 for (var httpmethod in httpmethods) { 1108 if (httpmethods[httpmethod].indexOf(method) > -1) { 1109 return httpmethod; 1110 } 1111 } 1112 console.warn("Can't find HTTP method to use for \"" + method + "\"."); 1113 }; 1114 1115 /** 1116 * Detects if API call should use multipart/form-data 1117 * 1118 * @param string method The API method to call 1119 * 1120 * @return bool Whether the method should be sent as multipart 1121 */ 1122 var _detectMultipart = function (method) { 1123 var multiparts = [ 1124 // Tweets 1125 "statuses/update_with_media", 1126 1127 // Users 1128 "account/update_profile_background_image", 1129 "account/update_profile_image", 1130 "account/update_profile_banner" 1131 ]; 1132 return multiparts.indexOf(method) > -1; 1133 }; 1134 1135 /** 1136 * Build multipart request from upload params 1137 * 1138 * @param string method The API method to call
1139 * @param array params The parameters to send along 1140 * 1141 * @return null|string The built multipart request body 1142 */ 1143 var _buildMultipart = function (method, params) { 1144 // well, files will only work in multipart methods 1145 if (! _detectMultipart(method)) { 1146 return; 1147 } 1148 1149 // only check specific parameters 1150 var possible_methods = [ 1151 // Tweets 1152 "statuses/update_with_media", 1153 // Accounts 1154 "account/update_profile_background_image", 1155 "account/update_profile_image", 1156 "account/update_profile_banner" 1157 ]; 1158 var possible_files = { 1159 // Tweets 1160 "statuses/update_with_media": "media[]", 1161 // Accounts 1162 "account/update_profile_background_image": "image", 1163 "account/update_profile_image": "image", 1164 "account/update_profile_banner": "banner" 1165 }; 1166 // method might have files? 1167 if (possible_methods.indexOf(method) === -1) { 1168 return; 1169 } 1170 1171 // check for filenames 1172 possible_files = possible_files[method].split(" "); 1173 1174 var multipart_border = "--------------------" + _nonce(); 1175 var multipart_request = ""; 1176 for (var key in params) { 1177 multipart_request += 1178 "--" + multipart_border + "\r\n" 1179 + "Content-Disposition: form-data; name=\"" + key + "\""; 1180 if (possible_files.indexOf(key) > -1) { 1181 multipart_request += 1182 "\r\nContent-Transfer-Encoding: base64"; 1183 } 1184 multipart_request += 1185 "\r\n\r\n" + params[key] + "\r\n"; 1186 } 1187 multipart_request += "--" + multipart_border + "--"; 1188 return multipart_request; 1189 }; 1190 1191 /** 1192 * Detects if API call is internal 1193 * 1194 * @param string method The API method to call 1195 * 1196 * @return bool Whether the method is defined in internal API 1197 */ 1198 var _detectInternal = function (method) { 1199 var internals = [ 1200 "users/recommendations" 1201 ]; 1202 return internals.join(" ").indexOf(method) > -1; 1203 }; 1204 1205 /** 1206 * Detects if API call should use media endpoint 1207 * 1208 * @param string method The API method to call 1209 * 1210 * @return bool Whether the method is defined in media API 1211 */ 1212 var _detectMedia = function (method) { 1213 var medias = [ 1214 "media/upload" 1215 ]; 1216 return medias.join(" ").indexOf(method) > -1; 1217 }; 1218 1219 /** 1220 * Detects if API call should use old endpoint 1221 * 1222 * @param string method The API method to call 1223 * 1224 * @return bool Whether the method is defined in old API 1225 */ 1226 var _detectOld = function (method) { 1227 var olds = [ 1228 "account/push_destinations/device" 1229 ]; 1230 return olds.join(" ").indexOf(method) > -1; 1231 }; 1232 1233 /** 1234 * Builds the complete API endpoint url 1235 * 1236 * @param string method The API method to call 1237 * 1238 * @return string The URL to send the request to 1239 */ 1240 var _getEndpoint = function (method) { 1241 var url; 1242 if (method.substring(0, 5) === "oauth") { 1243 url = _endpoint_oauth + method; 1244 } else if (_detectMedia(method)) { 1245 url = _endpoint_media + method + ".json"; 1246 } else if (_detectOld(method)) { 1247 url = _endpoint_old + method + ".json"; 1248 } else { 1249 url = _endpoint + method + ".json"; 1250 } 1251 return url; 1252 }; 1253 1254 /** 1255 * Gets the XML HTTP Request object, trying to load it in various ways 1256 * 1257 * @return object The XMLHttpRequest object instance 1258 */ 1259 var _getXmlRequestObject = function () { 1260 var xml = null; 1261 // first, try the W3-standard object 1262 if (typeof window === "object" 1263 && window 1264 && typeof window.XMLHttpRequest !== "undefined" 1265 ) { 1266 xml = new window.XMLHttpRequest(); 1267 // then, try Titanium framework object 1268 } else if (typeof Ti === "object" 1269 && Ti 1270 && typeof Ti.Network.createHTTPClient !== "undefined" 1271 ) { 1272 xml = Ti.Network.createHTTPClient(); 1273 // are we in an old Internet Explorer? 1274 } else if (typeof ActiveXObject !== "undefined" 1275 ) { 1276 try { 1277 xml = new ActiveXObject("Microsoft.XMLHTTP"); 1278 } catch (e) { 1279 console.error("ActiveXObject object not defined."); 1280 } 1281 // now, consider RequireJS and/or Node.js objects 1282 } else if (typeof require === "function" 1283 && require 1284 ) { 1285 // look for xmlhttprequest module 1286 try { 1287 var XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest; 1288 xml = new XMLHttpRequest(); 1289 } catch (e1) { 1290 // or maybe the user is using xhr2 1291 try { 1292 var XMLHttpRequest = require("xhr2"); 1293 xml = new XMLHttpRequest(); 1294 } catch (e2) { 1295 console.error("xhr2 object not defined, cancelling."); 1296 } 1297 } 1298 } 1299 return xml; 1300 }; 1301 1302 /** 1303 * Calls the API using cURL 1304 * 1305 * @param string httpmethod The HTTP method to use for making the request 1306 * @param string method The API method to call
1307 * @param array optional params The parameters to send along 1308 * @param bool optional multipart Whether to use multipart/form-data 1309 * @param bool optional app_only_auth Whether to use app-only bearer authentication 1310 * @param bool optional internal Whether to use internal call 1311 * @param function callback The function to call with the API call result 1312 * 1313 * @return mixed The API reply, encoded in the set return_format 1314 */ 1315 1316 var _callApi = function (httpmethod, method, params, multipart, app_only_auth, internal, callback) { 1317 if (typeof params === "undefined") { 1318 params = {}; 1319 } 1320 if (typeof multipart === "undefined") { 1321 multipart = false; 1322 } 1323 if (typeof app_only_auth === "undefined") { 1324 app_only_auth = false; 1325 } 1326 if (typeof callback !== "function") { 1327 callback = function () {}; 1328 } 1329 if (internal) { 1330 params.adc = "phone"; 1331 params.application_id = 333903271; 1332 } 1333 1334 var url = _getEndpoint(method); 1335 var authorization = null; 1336 1337 var xml = _getXmlRequestObject(); 1338 if (xml === null) { 1339 return; 1340 } 1341 var post_fields; 1342 1343 if (httpmethod === "GET") { 1344 var url_with_params = url; 1345 if (JSON.stringify(params) !== "{}") { 1346 url_with_params += "?" + _http_build_query(params); 1347 } 1348 if (! app_only_auth) { 1349 authorization = _sign(httpmethod, url, params); 1350 } 1351 1352 // append auth params to GET url for IE7-9, to send via JSONP 1353 if (_use_jsonp) { 1354 if (JSON.stringify(params) !== "{}") { 1355 url_with_params += "&"; 1356 } else { 1357 url_with_params += "?"; 1358 } 1359 var callback_name = _nonce(); 1360 window[callback_name] = function (reply) { 1361 reply.httpstatus = 200; 1362 1363 var rate = null; 1364 if (typeof xml.getResponseHeader !== "undefined" 1365 && xml.getResponseHeader("x-rate-limit-limit") !== "" 1366 ) { 1367 rate = { 1368 limit: xml.getResponseHeader("x-rate-limit-limit"), 1369 remaining: xml.getResponseHeader("x-rate-limit-remaining"), 1370 reset: xml.getResponseHeader("x-rate-limit-reset") 1371 }; 1372 } 1373 callback(reply, rate); 1374 }; 1375 params.callback = callback_name; 1376 url_with_params = url + "?" + _sign(httpmethod, url, params, true); 1377 var tag = document.createElement("script"); 1378 tag.type = "text/javascript"; 1379 tag.src = url_with_params; 1380 var body = document.getElementsByTagName("body")[0]; 1381 body.appendChild(tag); 1382 return; 1383 1384 } else if (_use_proxy) { 1385 url_with_params = url_with_params.replace( 1386 _endpoint_base, 1387 _endpoint_proxy 1388 ).replace( 1389 _endpoint_base_media, 1390 _endpoint_proxy 1391 ); 1392 } 1393 xml.open(httpmethod, url_with_params, true); 1394 } else { 1395 if (_use_jsonp) { 1396 console.warn("Sending POST requests is not supported for IE7-9."); 1397 return; 1398 } 1399 if (multipart) { 1400 if (! app_only_auth) { 1401 authorization = _sign(httpmethod, url, {}); 1402 } 1403 params = _buildMultipart(method, params); 1404 } else { 1405 if (! app_only_auth) { 1406 authorization = _sign(httpmethod, url, params); 1407 } 1408 params = _http_build_query(params); 1409 } 1410 post_fields = params; 1411 if (_use_proxy || multipart) { // force proxy for multipart base64 1412 url = url.replace( 1413 _endpoint_base, 1414 _endpoint_proxy 1415 ).replace( 1416 _endpoint_base_media, 1417 _endpoint_proxy 1418 ); 1419 } 1420 xml.open(httpmethod, url, true); 1421 if (multipart) { 1422 xml.setRequestHeader("Content-Type", "multipart/form-data; boundary=" 1423 + post_fields.split("\r\n")[0].substring(2)); 1424 } else { 1425 xml.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 1426 } 1427 } 1428 if (app_only_auth) { 1429 if (_oauth_consumer_key === null 1430 && _oauth_bearer_token === null 1431 ) { 1432 console.warn("To make an app-only auth API request, consumer key or bearer token must be set."); 1433 } 1434 // automatically fetch bearer token, if necessary 1435 if (_oauth_bearer_token === null) { 1436 return oauth2_token(function () { 1437 _callApi(httpmethod, method, params, multipart, app_only_auth, false, callback); 1438 }); 1439 } 1440 authorization = "Bearer " + _oauth_bearer_token; 1441 } 1442 if (authorization !== null) { 1443 xml.setRequestHeader((_use_proxy ? "X-" : "") + "Authorization", authorization); 1444 } 1445 xml.onreadystatechange = function () { 1446 if (xml.readyState >= 4) { 1447 var httpstatus = 12027; 1448 try { 1449 httpstatus = xml.status; 1450 } catch (e) {} 1451 var response = ""; 1452 try { 1453 response = xml.responseText; 1454 } catch (e) {} 1455 var reply = _parseApiReply(response); 1456 reply.httpstatus = httpstatus; 1457 var rate = null; 1458 if (typeof xml.getResponseHeader !== "undefined" 1459 && xml.getResponseHeader("x-rate-limit-limit") !== "" 1460 ) { 1461 rate = { 1462 limit: xml.getResponseHeader("x-rate-limit-limit"), 1463 remaining: xml.getResponseHeader("x-rate-limit-remaining"), 1464 reset: xml.getResponseHeader("x-rate-limit-reset") 1465 }; 1466 } 1467 callback(reply, rate); 1468 } 1469 }; 1470 xml.send(httpmethod === "GET" ? null : post_fields); 1471 return true; 1472 }; 1473 1474 /** 1475 * Parses the API reply to encode it in the set return_format 1476 * 1477 * @param string reply The actual reply, JSON-encoded or URL-encoded 1478 * 1479 * @return array|object The parsed reply 1480 */ 1481 var _parseApiReply = function (reply) { 1482 if (typeof reply !== "string" || reply === "") { 1483 return {}; 1484 } 1485 if (reply === "[]") { 1486 return []; 1487 } 1488 var parsed; 1489 try { 1490 parsed = JSON.parse(reply); 1491 } catch (e) { 1492 parsed = {}; 1493 if (reply.indexOf("<" + "?xml version=\"1.0\" encoding=\"UTF-8\"?" + ">") === 0) { 1494 // we received XML... 1495 // since this only happens for errors, 1496 // don't perform a full decoding 1497 parsed.request = reply.match(/<request>(.*)<\/request>/)[1]; 1498 parsed.error = reply.match(/<error>(.*)<\/error>/)[1]; 1499 } else { 1500 // assume query format 1501 var elements = reply.split("&"); 1502 for (var i = 0; i < elements.length; i++) { 1503 var element = elements[i].split("=", 2); 1504 if (element.length > 1) { 1505 parsed[element[0]] = decodeURIComponent(element[1]); 1506 } else { 1507 parsed[element[0]] = null; 1508 } 1509 } 1510 } 1511 } 1512 return parsed; 1513 }; 1514 1515 return { 1516 setConsumerKey: setConsumerKey, 1517 getVersion: getVersion, 1518 setToken: setToken, 1519 setBearerToken: setBearerToken, 1520 setUseProxy: setUseProxy, 1521 setProxy: setProxy,
1522 __call: __call, 1523 oauth_authenticate: oauth_authenticate, 1524 oauth_authorize: oauth_authorize, 1525 oauth2_token: oauth2_token 1526 }; 1527}; 1528 1529if (typeof module === "object" 1530 && module 1531 && typeof module.exports === "object" 1532) { 1533 // Expose codebird as module.exports in loaders that implement the Node 1534 // module pattern (including browserify). Do not create the global, since 1535 // the user will be storing it themselves locally, and globals are frowned 1536 // upon in the Node module world. 1537 module.exports = Codebird; 1538} else { 1539 // Otherwise expose codebird to the global object as usual 1540 if (typeof window === "object" 1541 && window) { 1542 window.Codebird = Codebird; 1543 } 1544 1545 // Register as a named AMD module, since codebird can be concatenated with other 1546 // files that may use define, but not via a proper concatenation script that 1547 // understands anonymous AMD modules. A named AMD is safest and most robust 1548 // way to register. Lowercase codebird is used because AMD module names are 1549 // derived from file names, and codebird is normally delivered in a lowercase 1550 // file name. Do this after creating the global so that if an AMD module wants 1551 // to call noConflict to hide this version of codebird, it will work. 1552 if (typeof define === "function" && define.amd) { 1553 define("codebird", [], function () { return Codebird; }); 1554 } 1555} 1556 1557})(); 1558 1559/* Laura Doktorova https://github.com/olado/doT */ 1560(function(){function o(){var a={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},b=/&(?!#?\w+;)|<|>|"|'|\//g;return function(){return this?this.replace(b,function(c){return a[c]||c}):this}}function p(a,b,c){return(typeof b==="string"?b:b.toString()).replace(a.define||i,function(l,e,f,g){if(e.indexOf("def.")===0)e=e.substring(4);if(!(e in c))if(f===":"){a.defineParams&&g.replace(a.defineParams,function(n,h,d){c[e]={arg:h,text:d}});e in c||(c[e]=g)}else(new Function("def","def['"+ 1561e+"']="+g))(c);return""}).replace(a.use||i,function(l,e){if(a.useParams)e=e.replace(a.useParams,function(g,n,h,d){if(c[h]&&c[h].arg&&d){g=(h+":"+d).replace(/'|\\/g,"_");c.__exp=c.__exp||{};c.__exp[g]=c[h].text.replace(RegExp("(^|[^\\w$])"+c[h].arg+"([^\\w$])","g"),"$1"+d+"$2");return n+"def.__exp['"+g+"']"}});var f=(new Function("def","return "+e))(c);return f?p(a,f,c):f})}function m(a){return a.replace(/\\('|\\)/g,"$1").replace(/[\r\t\n]/g," ")}var j={version:"1.0.1",templateSettings:{evaluate:/\{\{([\s\S]+?(\}?)+)\}\}/g, 1562interpolate:/\{\{=([\s\S]+?)\}\}/g,encode:/\{\{!([\s\S]+?)\}\}/g,use:/\{\{#([\s\S]+?)\}\}/g,useParams:/(^|[^\w$])def(?:\.|\[[\'\"])([\w$\.]+)(?:[\'\"]\])?\s*\:\s*([\w$\.]+|\"[^\"]+\"|\'[^\']+\'|\{[^\}]+\})/g,define:/\{\{##\s*([\w\.$]+)\s*(\:|=)([\s\S]+?)#\}\}/g,defineParams:/^\s*([\w$]+):([\s\S]+)/,conditional:/\{\{\?(\?)?\s*([\s\S]*?)\s*\}\}/g,iterate:/\{\{~\s*(?:\}\}|([\s\S]+?)\s*\:\s*([\w$]+)\s*(?:\:\s*([\w$]+))?\s*\}\})/g,varname:"it",strip:true,append:true,selfcontained:false},template:undefined, 1563compile:undefined},q;if(typeof module!=="undefined"&&module.exports)module.exports=j;else if(typeof define==="function"&&define.amd)define(function(){return j});else{q=function(){return this||(0,eval)("this")}();q.doT=j}String.prototype.encodeHTML=o();var r={append:{start:"'+(",end:")+'",endencode:"||'').toString().encodeHTML()+'"},split:{start:"';out+=(",end:");out+='",endencode:"||'').toString().encodeHTML();out+='"}},i=/$^/;j.template=function(a,b,c){b=b||j.templateSettings;var l=b.append?r.append: 1564r.split,e,f=0,g;a=b.use||b.define?p(b,a,c||{}):a;a=("var out='"+(b.strip?a.replace(/(^|\r|\n)\t* +| +\t*(\r|\n|$)/g," ").replace(/\r|\n|\t|\/\*[\s\S]*?\*\//g,""):a).replace(/'|\\/g,"\\$&").replace(b.interpolate||i,function(h,d){return l.start+m(d)+l.end}).replace(b.encode||i,function(h,d){e=true;return l.start+m(d)+l.endencode}).replace(b.conditional||i,function(h,d,k){return d?k?"';}else if("+m(k)+"){out+='":"';}else{out+='":k?"';if("+m(k)+"){out+='":"';}out+='"}).replace(b.iterate||i,function(h, 1565d,k,s){if(!d)return"';} } out+='";f+=1;g=s||"i"+f;d=m(d);return"';var arr"+f+"="+d+";if(arr"+f+"){var "+k+","+g+"=-1,l"+f+"=arr"+f+".length-1;while("+g+"<l"+f+"){"+k+"=arr"+f+"["+g+"+=1];out+='"}).replace(b.evaluate||i,function(h,d){return"';"+m(d)+"out+='"})+"';return out;").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r").replace(/(\s|;|\}|^|\{)out\+='';/g,"$1").replace(/\+''/g,"").replace(/(\s|;|\}|^|\{)out\+=''\+/g,"$1out+=");if(e&&b.selfcontained)a="String.prototype.encodeHTML=("+ 1566o.toString()+"());"+a;try{return new Function(b.varname,a)}catch(n){typeof console!=="undefined"&&console.log("Could not create a template function: "+a);throw n;}};j.compile=function(a,b){return j.template(a,null,b)}})(); 1567 1568//! moment.js 1569//! version : 2.8.3 1570//! authors : Tim Wood, Iskren Chernev, Moment.js contributors 1571//! license : MIT 1572//! momentjs.com 1573(function(a){function b(a,b,c){switch(arguments.length){case 2:return null!=a?a:b;case 3:return null!=a?a:null!=b?b:c;default:throw new Error("Implement me")}}function c(a,b){return zb.call(a,b)}function d(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invali
1573dFormat:!1,userInvalidated:!1,iso:!1}}function e(a){tb.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+a)}function f(a,b){var c=!0;return m(function(){return c&&(e(a),c=!1),b.apply(this,arguments)},b)}function g(a,b){qc[a]||(e(b),qc[a]=!0)}function h(a,b){return function(c){return p(a.call(this,c),b)}}function i(a,b){return function(c){return this.localeData().ordinal(a.call(this,c),b)}}function j(){}function k(a,b){b!==!1&&F(a),n(this,a),this._d=new Date(+a._d)}function l(a){var b=y(a),c=b.year||0,d=b.quarter||0,e=b.month||0,f=b.week||0,g=b.day||0,h=b.hour||0,i=b.minute||0,j=b.second||0,k=b.millisecond||0;this._milliseconds=+k+1e3*j+6e4*i+36e5*h,this._days=+g+7*f,this._months=+e+3*d+12*c,this._data={},this._locale=tb.localeData(),this._bubble()}function m(a,b){for(var d in b)c(b,d)&&(a[d]=b[d]);return c(b,"toString")&&(a.toString=b.toString),c(b,"valueOf")&&(a.valueOf=b.valueOf),a}function n(a,b){var c,d,e;if("undefined"!=typeof b._isAMomentObject&&(a._isAMomentObject=b._isAMomentObject),"undefined"!=typeof b._i&&(a._i=b._i),"undefined"!=typeof b._f&&(a._f=b._f),"undefined"!=typeof b._l&&(a._l=b._l),"undefined"!=typeof b._strict&&(a._strict=b._strict),"undefined"!=typeof b._tzm&&(a._tzm=b._tzm),"undefined"!=typeof b._isUTC&&(a._isUTC=b._isUTC),"undefined"!=typeof b._offset&&(a._offset=b._offset),"undefined"!=typeof b._pf&&(a._pf=b._pf),"undefined"!=typeof b._locale&&(a._locale=b._locale),Ib.length>0)for(c in Ib)d=Ib[c],e=b[d],"undefined"!=typeof e&&(a[d]=e);return a}function o(a){return 0>a?Math.ceil(a):Math.floor(a)}function p(a,b,c){for(var d=""+Math.abs(a),e=a>=0;d.length<b;)d="0"+d;return(e?c?"+":"":"-")+d}function q(a,b){var c={milliseconds:0,months:0};return c.months=b.month()-a.month()+12*(b.year()-a.year()),a.clone().add(c.months,"M").isAfter(b)&&--c.months,c.milliseconds=+b-+a.clone().add(c.months,"M"),c}function r(a,b){var c;return b=K(b,a),a.isBefore(b)?c=q(a,b):(c=q(b,a),c.milliseconds=-c.milliseconds,c.months=-c.months),c}function s(a,b){return function(c,d){var e,f;return null===d||isNaN(+d)||(g(b,"moment()."+b+"(period, number) is deprecated. Please use moment()."+b+"(number, period)."),f=c,c=d,d=f),c="string"==typeof c?+c:c,e=tb.duration(c,d),t(this,e,a),this}}function t(a,b,c,d){var e=b._milliseconds,f=b._days,g=b._months;d=null==d?!0:d,e&&a._d.setTime(+a._d+e*c),f&&nb(a,"Date",mb(a,"Date")+f*c),g&&lb(a,mb(a,"Month")+g*c),d&&tb.updateOffset(a,f||g)}function u(a){return"[object Array]"===Object.prototype.toString.call(a)}function v(a){return"[object Date]"===Object.prototype.toString.call(a)||a instanceof Date}function w(a,b,c){var d,e=Math.min(a.length,b.length),f=Math.abs(a.length-b.length),g=0;for(d=0;e>d;d++)(c&&a[d]!==b[d]||!c&&A(a[d])!==A(b[d]))&&g++;return g+f}function x(a){if(a){var b=a.toLowerCase().replace(/(.)s$/,"$1");a=jc[a]||kc[b]||b}return a}function y(a){var b,d,e={};for(d in a)c(a,d)&&(b=x(d),b&&(e[b]=a[d]));return e}function z(b){var c,d;if(0===b.indexOf("week"))c=7,d="day";else{if(0!==b.indexOf("month"))return;c=12,d="month"}tb[b]=function(e,f){var g,h,i=tb._locale[b],j=[];if("number"==typeof e&&(f=e,e=a),h=function(a){var b=tb().utc().set(d,a);return i.call(tb._locale,b,e||"")},null!=f)return h(f);for(g=0;c>g;g++)j.push(h(g));return j}}function A(a){var b=+a,c=0;return 0!==b&&isFinite(b)&&(c=b>=0?Math.floor(b):Math.ceil(b)),c}function B(a,b){return new Date(Date.UTC(a,b+1,0)).getUTCDate()}function C(a,b,c){return hb(tb([a,11,31+b-c]),b,c).week}function D(a){return E(a)?366:365}function E(a){return a%4===0&&a%100!==0||a%400===0}function F(a){var b;a._a&&-2===a._pf.overflow&&(b=a._a[Bb]<0||a._a[Bb]>11?Bb:a._a[Cb]<1||a._a[Cb]>B(a._a[Ab],a._a[Bb])?Cb:a._a[Db]<0||a._a[Db]>23?Db:a._a[Eb]<0||a._a[Eb]>59?Eb:a._a[Fb]<0||a._a[Fb]>59?Fb:a._a[Gb]<0||a._a[Gb]>999?Gb:-1,a._pf._overflowDayOfYear&&(Ab>b||b>Cb)&&(b=Cb),a._pf.overflow=b)}
1573function G(a){return null==a._isValid&&(a._isValid=!isNaN(a._d.getTime())&&a._pf.overflow<0&&!a._pf.empty&&!a._pf.invalidMonth&&!a._pf.nullInput&&!a._pf.invalidFormat&&!a._pf.userInvalidated,a._strict&&(a._isValid=a._isValid&&0===a._pf.charsLeftOver&&0===a._pf.unusedTokens.length)),a._isValid}function H(a){return a?a.toLowerCase().replace("_","-"):a}function I(a){for(var b,c,d,e,f=0;f<a.length;){for(e=H(a[f]).split("-"),b=e.length,c=H(a[f+1]),c=c?c.split("-"):null;b>0;){if(d=J(e.slice(0,b).join("-")))return d;if(c&&c.length>=b&&w(e,c,!0)>=b-1)break;b--}f++}return null}function J(a){var b=null;if(!Hb[a]&&Jb)try{b=tb.locale(),require("./locale/"+a),tb.locale(b)}catch(c){}return Hb[a]}function K(a,b){return b._isUTC?tb(a).zone(b._offset||0):tb(a).local()}function L(a){return a.match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function M(a){var b,c,d=a.match(Nb);for(b=0,c=d.length;c>b;b++)d[b]=pc[d[b]]?pc[d[b]]:L(d[b]);return function(e){var f="";for(b=0;c>b;b++)f+=d[b]instanceof Function?d[b].call(e,a):d[b];return f}}function N(a,b){return a.isValid()?(b=O(b,a.localeData()),lc[b]||(lc[b]=M(b)),lc[b](a)):a.localeData().invalidDate()}function O(a,b){function c(a){return b.longDateFormat(a)||a}var d=5;for(Ob.lastIndex=0;d>=0&&Ob.test(a);)a=a.replace(Ob,c),Ob.lastIndex=0,d-=1;return a}function P(a,b){var c,d=b._strict;switch(a){case"Q":return Zb;case"DDDD":return _b;case"YYYY":case"GGGG":case"gggg":return d?ac:Rb;case"Y":case"G":case"g":return cc;case"YYYYYY":case"YYYYY":case"GGGGG":case"ggggg":return d?bc:Sb;case"S":if(d)return Zb;case"SS":if(d)return $b;case"SSS":if(d)return _b;case"DDD":return Qb;case"MMM":case"MMMM":case"dd":case"ddd":case"dddd":return Ub;case"a":case"A":return b._locale._meridiemParse;case"X":return Xb;case"Z":case"ZZ":return Vb;case"T":return Wb;case"SSSS":return Tb;case"MM":case"DD":case"YY":case"GG":case"gg":case"HH":case"hh":case"mm":case"ss":case"ww":case"WW":return d?$b:Pb;case"M":case"D":case"d":case"H":case"h":case"m":case"s":case"w":case"W":case"e":case"E":return Pb;case"Do":return Yb;default:return c=new RegExp(Y(X(a.replace("\\","")),"i"))}}function Q(a){a=a||"";var b=a.match(Vb)||[],c=b[b.length-1]||[],d=(c+"").match(hc)||["-",0,0],e=+(60*d[1])+A(d[2]);return"+"===d[0]?-e:e}function R(a,b,c){var d,e=c._a;switch(a){case"Q":null!=b&&(e[Bb]=3*(A(b)-1));break;case"M":case"MM":null!=b&&(e[Bb]=A(b)-1);break;case"MMM":case"MMMM":d=c._locale.monthsParse(b),null!=d?e[Bb]=d:c._pf.invalidMonth=b;break;case"D":case"DD":null!=b&&(e[Cb]=A(b));break;case"Do":null!=b&&(e[Cb]=A(parseInt(b,10)));break;case"DDD":case"DDDD":null!=b&&(c._dayOfYear=A(b));break;case"YY":e[Ab]=tb.parseTwoDigitYear(b);break;case"YYYY":case"YYYYY":case"YYYYYY":e[Ab]=A(b);break;case"a":case"A":c._isPm=c._locale.isPM(b);break;case"H":case"HH":case"h":case"hh":e[Db]=A(b);break;case"m":case"mm":e[Eb]=A(b);break;case"s":case"ss":e[Fb]=A(b);break;case"S":case"SS":case"SSS":case"SSSS":e[Gb]=A(1e3*("0."+b));break;case"X":c._d=new Date(1e3*parseFloat(b));break;case"Z":case"ZZ":c._useUTC=!0,c._tzm=Q(b);break;case"dd":case"ddd":case"dddd":d=c._locale.weekdaysParse(b),null!=d?(c._w=c._w||{},c._w.d=d):c._pf.invalidWeekday=b;break;case"w":case"ww":case"W":case"WW":case"d":case"e":case"E":a=a.substr(0,1);case"gggg":case"GGGG":case"GGGGG":a=a.substr(0,2),b&&(c._w=c._w||{},c._w[a]=A(b));break;case"gg":case"GG":c._w=c._w||{},c._w[a]=tb.parseTwoDigitYear(b)}}function S(a){var c,d,e,f,g,h,i;c=a._w,null!=c.GG||null!=c.W||null!=c.E?(g=1,h=4,d=b(c.GG,a._a[Ab],hb(tb(),1,4).year),e=b(c.W,1),f=b(c.E,1)):(g=a._locale._week.dow,h=a._locale._week.doy,d=b(c.gg,a._a[Ab],hb(tb(),g,h).year),e=b(c.w,1),null!=c.d?(f=c.d,g>f&&++e):f=null!=c.e?c.e+g:g),i=ib(d,e,f,h,g),a._a[Ab]=i.year,a._dayOfYear=i.dayOfYear}function T(a){var c,d,e,f,g=[];if(!a._d){for(e=V(a),a._w&&null==a._a[Cb]&&null==a._a[Bb]&&S(a),a._dayOfYear&&(f=b(a._a[Ab],e[Ab]),a._dayOfYear>D(f)&&(a._pf._overflowDayOfYear=!0),d=db(f,0,a._dayOfYear),a._a[Bb]=d.getUTCMonth(),a._a[Cb]=d.getUTCDate()),c=0;3>c&&null==a._a[c];++c)a._a[c]=g[c]=e[c];for(;7>c;c++)a._a[c]=g[c]=null==a._a[c]?2===c?1:0:a._a[c];a._d=(a._useUTC?db:cb).apply(null,g),null!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()+a._tzm)}}function U(a){var b;a._d||(b=y(a._i),a._a=[b.year,b.month,b.day,b.hour,b.minute,b.second,b.millisecond],T(a))}function V(a){var b=new Date;return a._useUTC?[b.getUTCFullYear(),b.getUTCMonth(),b.getUTCDate()]:[b.getFullYear(),b.getMonth(),b.getDate()]}function W(a){if(a._f===tb.ISO_8601)return void $(a);a._a=[],a._pf.empty=!0;var b,c,d,e,f,g=""+a._i,h=g.length,i=0;for(d=O(a._f,a._locale).match(Nb)||[],b=0;b<d.length;b++)e=d[b],c=(g.match(P(e,a))||[])[0],c&&(f=g.substr(0,g.indexOf(c)),f.length>0&&a._pf.unusedInput.push(f),g=g.slice(g.indexOf(c)+c.length),i+=c.length),pc[e]?(c?a._pf.empty=!1:a._pf.unusedTokens.push(e),R(e,c,a)):a._strict&&!c&&a._pf.unusedTokens.push(e);a._pf.charsLeftOver=h-i,g.length>0&&a._pf.unusedInput.push(g),a._isPm&&a._a[Db]<12&&(a._a[Db]+=12),a._isPm===!1&&12===a._a[Db]&&(a._a[Db]=0),T(a),F(a)}function X(a){return a.replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,b,c,d,e){return b||c||d||e})}function Y(a){return a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Z(a){var b,c,e,f,g;
1573if(0===a._f.length)return a._pf.invalidFormat=!0,void(a._d=new Date(0/0));for(f=0;f<a._f.length;f++)g=0,b=n({},a),null!=a._useUTC&&(b._useUTC=a._useUTC),b._pf=d(),b._f=a._f[f],W(b),G(b)&&(g+=b._pf.charsLeftOver,g+=10*b._pf.unusedTokens.length,b._pf.score=g,(null==e||e>g)&&(e=g,c=b));m(a,c||b)}function $(a){var b,c,d=a._i,e=dc.exec(d);if(e){for(a._pf.iso=!0,b=0,c=fc.length;c>b;b++)if(fc[b][1].exec(d)){a._f=fc[b][0]+(e[6]||" ");break}for(b=0,c=gc.length;c>b;b++)if(gc[b][1].exec(d)){a._f+=gc[b][0];break}d.match(Vb)&&(a._f+="Z"),W(a)}else a._isValid=!1}function _(a){$(a),a._isValid===!1&&(delete a._isValid,tb.createFromInputFallback(a))}function ab(a,b){var c,d=[];for(c=0;c<a.length;++c)d.push(b(a[c],c));return d}function bb(b){var c,d=b._i;d===a?b._d=new Date:v(d)?b._d=new Date(+d):null!==(c=Kb.exec(d))?b._d=new Date(+c[1]):"string"==typeof d?_(b):u(d)?(b._a=ab(d.slice(0),function(a){return parseInt(a,10)}),T(b)):"object"==typeof d?U(b):"number"==typeof d?b._d=new Date(d):tb.createFromInputFallback(b)}function cb(a,b,c,d,e,f,g){var h=new Date(a,b,c,d,e,f,g);return 1970>a&&h.setFullYear(a),h}function db(a){var b=new Date(Date.UTC.apply(null,arguments));return 1970>a&&b.setUTCFullYear(a),b}function eb(a,b){if("string"==typeof a)if(isNaN(a)){if(a=b.weekdaysParse(a),"number"!=typeof a)return null}else a=parseInt(a,10);return a}function fb(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function gb(a,b,c){var d=tb.duration(a).abs(),e=yb(d.as("s")),f=yb(d.as("m")),g=yb(d.as("h")),h=yb(d.as("d")),i=yb(d.as("M")),j=yb(d.as("y")),k=e<mc.s&&["s",e]||1===f&&["m"]||f<mc.m&&["mm",f]||1===g&&["h"]||g<mc.h&&["hh",g]||1===h&&["d"]||h<mc.d&&["dd",h]||1===i&&["M"]||i<mc.M&&["MM",i]||1===j&&["y"]||["yy",j];return k[2]=b,k[3]=+a>0,k[4]=c,fb.apply({},k)}function hb(a,b,c){var d,e=c-b,f=c-a.day();return f>e&&(f-=7),e-7>f&&(f+=7),d=tb(a).add(f,"d"),{week:Math.ceil(d.dayOfYear()/7),year:d.year()}}function ib(a,b,c,d,e){var f,g,h=db(a,0,1).getUTCDay();return h=0===h?7:h,c=null!=c?c:e,f=e-h+(h>d?7:0)-(e>h?7:0),g=7*(b-1)+(c-e)+f+1,{year:g>0?a:a-1,dayOfYear:g>0?g:D(a-1)+g}}function jb(b){var c=b._i,d=b._f;return b._locale=b._locale||tb.localeData(b._l),null===c||d===a&&""===c?tb.invalid({nullInput:!0}):("string"==typeof c&&(b._i=c=b._locale.preparse(c)),tb.isMoment(c)?new k(c,!0):(d?u(d)?Z(b):W(b):bb(b),new k(b)))}function kb(a,b){var c,d;if(1===b.length&&u(b[0])&&(b=b[0]),!b.length)return tb();for(c=b[0],d=1;d<b.length;++d)b[d][a](c)&&(c=b[d]);return c}function lb(a,b){var c;return"string"==typeof b&&(b=a.localeData().monthsParse(b),"number"!=typeof b)?a:(c=Math.min(a.date(),B(a.year(),b)),a._d["set"+(a._isUTC?"UTC":"")+"Month"](b,c),a)}function mb(a,b){return a._d["get"+(a._isUTC?"UTC":"")+b]()}function nb(a,b,c){return"Month"===b?lb(a,c):a._d["set"+(a._isUTC?"UTC":"")+b](c)}function ob(a,b){return function(c){return null!=c?(nb(this,a,c),tb.updateOffset(this,b),this):mb(this,a)}}function pb(a){return 400*a/146097}function qb(a){return 146097*a/400}function rb(a){tb.duration.fn[a]=function(){return this._data[a]}}function sb(a){"undefined"==typeof ender&&(ub=xb.moment,xb.moment=a?f("Accessing Moment through the global scope is deprecated, and will be removed in an upcoming release.",tb):tb)}for(var tb,ub,vb,wb="2.8.3",xb="undefined"!=typeof global?global:this,yb=Math.round,zb=Object.prototype.hasOwnProperty,Ab=0,Bb=1,Cb=2,Db=3,Eb=4,Fb=5,Gb=6,Hb={},Ib=[],Jb="undefined"!=typeof module&&module.exports,Kb=/^\/?Date\((\-?\d+)/i,Lb=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,Mb=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/,Nb=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|X|zz?|ZZ?|.)/g,Ob=/(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g,Pb=/\d\d?/,Qb=/\d{1,3}/,Rb=/\d{1,4}/,Sb=/[+\-]?\d{1,6}/,Tb=/\d+/,Ub=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,Vb=/Z|[\+\-]\d\d:?\d\d/gi,Wb=/T/i,Xb=/[\+\-]?\d+(\.\d{1,3})?/,Yb=/\d{1,2}/,Zb=/\d/,$b=/\d\d/,_b=/\d{3}/,ac=/\d{4}/,bc=/[+-]?\d{6}/,cc=/[+-]?\d+/,dc=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ec="YYYY-MM-DDTHH:mm:ssZ",fc=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],gc=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],hc=/([\+\-]|\d\d)/gi,ic=("Date|Hours|Minutes|Seconds|Milliseconds".split("|"),{Milliseconds:1,Seconds:1e3,Minutes:6e4,Hours:36e5,Days:864e5,Months:2592e6,Years:31536e6}),jc={ms:"millisecond",s:"second",m:"minute",h:"hour",d:"day",D:"date",w:"week",W:"isoWeek",M:"month",Q:"quarter",y:"year",DDD:"dayOfYear",e:"weekday",E:"isoWeekday",gg:"weekYear",GG:"isoWeekYear"},kc={dayofyear:"dayOfYear",isoweekday:"isoWeekday",isoweek:"isoWeek",weekyear:"weekYear",isoweekyear:"isoWeekYear"},lc={},mc={s:45,m:45,h:22,d:26,M:11},nc="DDD w W M D d".split(" "),oc="M D H h m s w W".split(" "),pc={M:function(){return this.month()+1},MMM:function(a){return this.localeData().monthsShort(this,a)},MMMM:function(a){return this.localeData().months(this,a)},D:function(){return this.date()},DDD:function(){return this.dayOfYear()},d:function(){return this.day()},dd:function(a){return this.localeData().weekdaysMin(this,a)},ddd:function(a){return this.localeData().weekdaysShort(this,a)},dddd:function(a){return this.localeData().weekdays(this,a)},w:function(){return this.week()},W:function(){return this.isoWeek()},YY:function(){return p(this.year()%100,2)},YYYY:function(){return p(this.year(),4)},YYYYY:function(){return p(this.year(),5)},YYYYYY:function(){var a=this.year(),b=a>=0?"+":"-";return b+p(Math.abs(a),6)},gg:function(){return p(this.weekYear()%100,2)},gggg:function(){return p(this.weekYear(),4)},ggggg:function(){return p(this.weekYear(),5)},GG:function(){return p(this.isoWeekYear()%100,2)},GGGG:function(){return p(this.isoWeekYear(),4)},GGGGG:function(){return p(this.isoWeekYear(),5)},e:function(){return this.weekday()},E:function(){return this.isoWeekday()},a:function(){return this.localeData().meridiem(this.hours(),this.minutes(),!0)},A:function(){return this.localeData().meridiem(this.hours(),this.minutes(),!1)},H:function(){return this.hours()},h:function(){return this.hours()%12||12},m:function(){return this.minutes()},s:function(){return this.seconds()},S:function(){return A(this.milliseconds()/100)},SS:function(){return p(A(this.milliseconds()/10),2)},SSS:function(){return p(this.milliseconds(),3)},SSSS:function(){return p(this.milliseconds(),3)},Z:function(){var a=-this.zone(),b="+";return 0>a&&(a=-a,b="-"),b+p(A(a/60),2)+":"+p(A(a)%60,2)},ZZ:function(){var a=-this.zone(),b="+";return 0>a&&(a=-a,b="-"),b+p(A(a/60),2)+p(A(a)%60,2)},z:function(){return this.zoneAbbr()},zz:function(){return this.zoneName()},X:function(){return this.unix()},Q:function(){return this.quarter()}},qc={},rc=["months","monthsShort","weekdays","weekdaysShort","weekdaysMin"];nc.length;)vb=nc.pop(),pc[vb+"o"]=i(pc[vb],vb);for(;oc.length;)vb=oc.pop(),pc[vb+vb]=h(pc[vb],2);pc.DDDD=h(pc.DDD,3),m(j.prototype,{set:function(a){var b,c;for(c in a)b=a[c],"function"==typeof b?this[c]=b:this["_"+c]=b},_months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),months:function(a){return this._months[a.month()]},_monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),monthsShort:function(a){return this._monthsShort[a.month()]},monthsParse:function(a){var b,c,d;for(this._monthsParse||(this._monthsParse=[]),b=0;12>b;b++)if(this._monthsParse[b]||(c=tb.utc([2e3,b]),d="^"+this.months(c,"")+"|^"+this.monthsShort(c,""),this._monthsParse[b]=new RegExp(d.replace(".",""),"i")),this._monthsParse[b].test(a))return b},_weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdays:function(a){return this._weekdays[a.day()]},_weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysShort:function(a){return this._weekdaysShort[a.day()]},_weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),weekdaysMin:function(a){return this._weekdaysMin[a.day()]},weekdaysParse:function(a){var b,c,d;for(this._weekdaysParse||(this._weekdaysParse=[]),b=0;7>b;b++)if(this._weekdaysParse[b]||(c=tb([2e3,1]).day(b),d="^"+this.weekdays(c,"")+"|^"+this.weekdaysShort(c,"")+"|^"+this.weekdaysMin(c,""),this._weekdaysParse[b]=new RegExp(d.replace(".",""),"i")),this._weekdaysParse[b].test(a))return b},_longDateFormat:{LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY LT",LLLL:"dddd, MMMM D, YYYY LT"},longDateFormat:function(a){var b=this._longDateFormat[a];return!b&&this._longDateFormat[a.toUpperCase()]&&(b=this._longDateFormat[a.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a]=b),b},isPM:function(a){return"p"===(a+"").toLowerCase().charAt(0)},_meridiemParse:/[ap]\.?m?\.?/i,meridiem:function(a,b,c){return a>11?c?"pm":"PM":c?"am":"AM"},_calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},calendar:function(a,b){var c=this._calendar[a];return"function"==typeof c?c.apply(b):c},_relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},relativeTime:function(a,b,c,d){var e=this._relativeTime[c];return"function"==typeof e?e(a,b,c,d):e.replace(/%d/i,a)},pastFuture:function(a,b){var c=this._relativeTime[a>0?"future":"past"];return"function"==typeof c?c(b):c.replace(/%s/i,b)},ordinal:function(a){return this._ordinal.replace("%d",a)},_ordinal:"%d",preparse:function(a){return a},postformat:function(a){return a},week:function(a){return hb(a,this._week.dow,this._week.doy).week},_week:{dow:0,doy:6},_invalidDate:"Invalid date",invalidDate:function(){return this._invalidDate}}),tb=function(b,c,e,f){var g;return"boolean"==typeof e&&(f=e,e=a),g={},g._isAMomentObject=!0,g._i=b,g._f=c,g._l=e,g._strict=f,g._isUTC=!1,g._pf=d(),jb(g)},tb.suppressDeprecationWarnings=!1,tb.createFromInputFallback=f("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(a){a._d=new Date(a._i)}),tb.min=function(){var a=[].slice.call(arguments,0);return kb("isBefore",a)},tb.max=function(){var a=[].slice.call(arguments,0);return kb("isAfter",a)},tb.utc=function(b,c,e,f){var g;return"boolean"==typeof e&&(f=e,e=a),g={},g._isAMomentObject=!0,g._useUTC=!0,g._isUTC=!0,g._l=e,g._i=b,g._f=c,g._strict=f,g._pf=d(),jb(g).utc()},tb.unix=function(a){return tb(1e3*a)},tb.duration=function(a,b){var d,e,f,g,h=a,i=null;return tb.isDuration(a)?h={ms:a._milliseconds,d:a._days,M:a._months}:"number"==typeof a?(h={},b?h[b]=a:h.milliseconds=a):(i=Lb.exec(a))?(d="-"===i[1]?-1:1,h={y:0,d:A(i[Cb])*
1573d,h:A(i[Db])*d,m:A(i[Eb])*d,s:A(i[Fb])*d,ms:A(i[Gb])*d}):(i=Mb.exec(a))?(d="-"===i[1]?-1:1,f=function(a){var b=a&&parseFloat(a.replace(",","."));return(isNaN(b)?0:b)*d},h={y:f(i[2]),M:f(i[3]),d:f(i[4]),h:f(i[5]),m:f(i[6]),s:f(i[7]),w:f(i[8])}):"object"==typeof h&&("from"in h||"to"in h)&&(g=r(tb(h.from),tb(h.to)),h={},h.ms=g.milliseconds,h.M=g.months),e=new l(h),tb.isDuration(a)&&c(a,"_locale")&&(e._locale=a._locale),e},tb.version=wb,tb.defaultFormat=ec,tb.ISO_8601=function(){},tb.momentProperties=Ib,tb.updateOffset=function(){},tb.relativeTimeThreshold=function(b,c){return mc[b]===a?!1:c===a?mc[b]:(mc[b]=c,!0)},tb.lang=f("moment.lang is deprecated. Use moment.locale instead.",function(a,b){return tb.locale(a,b)}),tb.locale=function(a,b){var c;return a&&(c="undefined"!=typeof b?tb.defineLocale(a,b):tb.localeData(a),c&&(tb.duration._locale=tb._locale=c)),tb._locale._abbr},tb.defineLocale=function(a,b){return null!==b?(b.abbr=a,Hb[a]||(Hb[a]=new j),Hb[a].set(b),tb.locale(a),Hb[a]):(delete Hb[a],null)},tb.langData=f("moment.langData is deprecated. Use moment.localeData instead.",function(a){return tb.localeData(a)}),tb.localeData=function(a){var b;if(a&&a._locale&&a._locale._abbr&&(a=a._locale._abbr),!a)return tb._locale;if(!u(a)){if(b=J(a))return b;a=[a]}return I(a)},tb.isMoment=function(a){return a instanceof k||null!=a&&c(a,"_isAMomentObject")},tb.isDuration=function(a){return a instanceof l};for(vb=rc.length-1;vb>=0;--vb)z(rc[vb]);tb.normalizeUnits=function(a){return x(a)},tb.invalid=function(a){var b=tb.utc(0/0);return null!=a?m(b._pf,a):b._pf.userInvalidated=!0,b},tb.parseZone=function(){return tb.apply(null,arguments).parseZone()},tb.parseTwoDigitYear=function(a){return A(a)+(A(a)>68?1900:2e3)},m(tb.fn=k.prototype,{clone:function(){return tb(this)},valueOf:function(){return+this._d+6e4*(this._offset||0)},unix:function(){return Math.floor(+this/1e3)},toString:function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._offset?new Date(+this):this._d},toISOString:function(){var a=tb(this).utc();return 0<a.year()&&a.year()<=9999?N(a,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):N(a,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")},toArray:function(){var a=this;return[a.year(),a.month(),a.date(),a.hours(),a.minutes(),a.seconds(),a.milliseconds()]},isValid:function(){return G(this)},isDSTShifted:function(){return this._a?this.isValid()&&w(this._a,(this._isUTC?tb.utc(this._a):tb(this._a)).toArray())>0:!1},parsingFlags:function(){return m({},this._pf)},invalidAt:function(){return this._pf.overflow},utc:function(a){return this.zone(0,a)},local:function(a){return this._isUTC&&(this.zone(0,a),this._isUTC=!1,a&&this.add(this._dateTzOffset(),"m")),this},format:function(a){var b=N(this,a||tb.defaultFormat);return this.localeData().postformat(b)},add:s(1,"add"),subtract:s(-1,"subtract"),diff:function(a,b,c){var d,e,f,g=K(a,this),h=6e4*(this.zone()-g.zone());return b=x(b),"year"===b||"month"===b?(d=432e5*(this.daysInMonth()+g.daysInMonth()),e=12*(this.year()-g.year())+(this.month()-g.month()),f=this-tb(this).startOf("month")-(g-tb(g).startOf("month")),f-=6e4*(this.zone()-tb(this).startOf("month").zone()-(g.zone()-tb(g).startOf("month").zone())),e+=f/d,"year"===b&&(e/=12)):(d=this-g,e="second"===b?d/1e3:"minute"===b?d/6e4:"hour"===b?d/36e5:"day"===b?(d-h)/864e5:"week"===b?(d-h)/6048e5:d),c?e:o(e)},from:function(a,b){return tb.duration({to:this,from:a}).locale(this.locale()).humanize(!b)},fromNow:function(a){return this.from(tb(),a)},calendar:function(a){var b=a||tb(),c=K(b,this).startOf("day"),d=this.diff(c,"days",!0),e=-6>d?"sameElse":-1>d?"lastWeek":0>d?"lastDay":1>d?"sameDay":2>d?"nextDay":7>d?"nextWeek":"sameElse";return this.format(this.localeData().calendar(e,this))},isLeapYear:function(){return E(this.year())},isDST:function(){return this.zone()<this.clone().month(0).zone()||this.zone()<this.clone().month(5).zone()},day:function(a){var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=a?(a=eb(a,this.localeData()),this.add(a-b,"d")):b},month:ob("Month",!0),startOf:function(a){switch(a=x(a)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===a?this.weekday(0):"isoWeek"===a&&this.isoWeekday(1),"quarter"===a&&this.month(3*Math.floor(this.month()/3)),this},endOf:function(a){return a=x(a),this.startOf(a).add(1,"isoWeek"===a?"week":a).subtract(1,"ms")},isAfter:function(a,b){return b=x("undefined"!=typeof b?b:"millisecond"),"millisecond"===b?(a=tb.isMoment(a)?a:tb(a),+this>+a):+this.clone().startOf(b)>+tb(a).startOf(b)},isBefore:function(a,b){return b=x("undefined"!=typeof b?b:"millisecond"),"millisecond"===b?(a=tb.isMoment(a)?a:tb(a),+a>+this):+this.clone().startOf(b)<+tb(a).startOf(b)},isSame:function(a,b){return b=x(b||"millisecond"),"millisecond"===b?(a=tb.isMoment(a)?a:tb(a),+this===+a):+this.clone().startOf(b)===+K(a,this).startOf(b)},min:f("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(a){return a=tb.apply(null,arguments),this>a?this:a}),max:f("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(a){return a=tb.apply(null,arguments),a>this?this:a}),zone:function(a,b){var c,d=this._offset||0;return null==a?this._isUTC?d:this._dateTzOffset():("string"==typeof a&&(a=Q(a)),Math.abs(a)<16&&(a=60*a),!this._isUTC&&b&&(c=this._dateTzOffset()),this._offset=a,this._isUTC=!0,null!=c&&this.subtract(c,"m"),d!==a&&(!b||this._changeInProgress?t(this,tb.duration(d-a,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,tb.updateOffset(this,!0),this._changeInProgress=null)),this)},zoneAbbr:function(){return this._isUTC?"UTC":""},zoneName:function(){return this._isUTC?"Coordinated Universal Time":""},parseZone:function(){return this._tzm?this.zone(this._tzm):"string"==typeof this._i&&this.zone(this._i),this},hasAlignedHourOffset:function(a){return a=a?tb(a).zone():0,(this.zone()-a)%60===0},daysInMonth:function(){return B(this.year(),this.month())},dayOfYear:function(a){var b=yb((tb(this).startOf("day")-tb(this).startOf("year"))/864e5)+1;return null==a?b:this.add(a-b,"d")}
1573,quarter:function(a){return null==a?Math.ceil((this.month()+1)/3):this.month(3*(a-1)+this.month()%3)},weekYear:function(a){var b=hb(this,this.localeData()._week.dow,this.localeData()._week.doy).year;return null==a?b:this.add(a-b,"y")},isoWeekYear:function(a){var b=hb(this,1,4).year;return null==a?b:this.add(a-b,"y")},week:function(a){var b=this.localeData().week(this);return null==a?b:this.add(7*(a-b),"d")},isoWeek:function(a){var b=hb(this,1,4).week;return null==a?b:this.add(7*(a-b),"d")},weekday:function(a){var b=(this.day()+7-this.localeData()._week.dow)%7;return null==a?b:this.add(a-b,"d")},isoWeekday:function(a){return null==a?this.day()||7:this.day(this.day()%7?a:a-7)},isoWeeksInYear:function(){return C(this.year(),1,4)},weeksInYear:function(){var a=this.localeData()._week;return C(this.year(),a.dow,a.doy)},get:function(a){return a=x(a),this[a]()},set:function(a,b){return a=x(a),"function"==typeof this[a]&&this[a](b),this},locale:function(b){var c;return b===a?this._locale._abbr:(c=tb.localeData(b),null!=c&&(this._locale=c),this)},lang:f("moment().lang() is deprecated. Use moment().localeData() instead.",function(b){return b===a?this.localeData():this.locale(b)}),localeData:function(){return this._locale},_dateTzOffset:function(){return 15*Math.round(this._d.getTimezoneOffset()/15)}}),tb.fn.millisecond=tb.fn.milliseconds=ob("Milliseconds",!1),tb.fn.second=tb.fn.seconds=ob("Seconds",!1),tb.fn.minute=tb.fn.minutes=ob("Minutes",!1),tb.fn.hour=tb.fn.hours=ob("Hours",!0),tb.fn.date=ob("Date",!0),tb.fn.dates=f("dates accessor is deprecated. Use date instead.",ob("Date",!0)),tb.fn.year=ob("FullYear",!0),tb.fn.years=f("years accessor is deprecated. Use year instead.",ob("FullYear",!0)),tb.fn.days=tb.fn.day,tb.fn.months=tb.fn.month,tb.fn.weeks=tb.fn.week,tb.fn.isoWeeks=tb.fn.isoWeek,tb.fn.quarters=tb.fn.quarter,tb.fn.toJSON=tb.fn.toISOString,m(tb.duration.fn=l.prototype,{_bubble:function(){var a,b,c,d=this._milliseconds,e=this._days,f=this._months,g=this._data,h=0;g.milliseconds=d%1e3,a=o(d/1e3),g.seconds=a%60,b=o(a/60),g.minutes=b%60,c=o(b/60),g.hours=c%24,e+=o(c/24),h=o(pb(e)),e-=o(qb(h)),f+=o(e/30),e%=30,h+=o(f/12),f%=12,g.days=e,g.months=f,g.years=h},abs:function(){return this._milliseconds=Math.abs(this._milliseconds),this._days=Math.abs(this._days),this._months=Math.abs(this._months),this._data.milliseconds=Math.abs(this._data.milliseconds),this._data.seconds=Math.abs(this._data.seconds),this._data.minutes=Math.abs(this._data.minutes),this._data.hours=Math.abs(this._data.hours),this._data.months=Math.abs(this._data.months),this._data.years=Math.abs(this._data.years),this},weeks:function(){return o(this.days()/7)},valueOf:function(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*A(this._months/12)},humanize:function(a){var b=gb(this,!a,this.localeData());return a&&(b=this.localeData().pastFuture(+this,b)),this.localeData().postformat(b)},add:function(a,b){var c=tb.duration(a,b);return this._milliseconds+=c._milliseconds,this._days+=c._days,this._months+=c._months,this._bubble(),this},subtract:function(a,b){var c=tb.duration(a,b);return this._milliseconds-=c._milliseconds,this._days-=c._days,this._months-=c._months,this._bubble(),this},get:function(a){return a=x(a),this[a.toLowerCase()+"s"]()},as:function(a){var b,c;if(a=x(a),"month"===a||"year"===a)return b=this._days+this._milliseconds/864e5,c=this._months+12*pb(b),"month"===a?c:c/12;switch(b=this._days+qb(this._months/12),a){case"week":return b/7+this._milliseconds/6048e5;case"day":return b+this._milliseconds/864e5;case"hour":return 24*b+this._milliseconds/36e5;case"minute":return 24*b*60+this._milliseconds/6e4;case"second":return 24*b*60*60+this._milliseconds/1e3;case"millisecond":return Math.floor(24*b*60*60*1e3)+this._milliseconds;default:throw new Error("Unknown unit "+a)}},lang:tb.fn.lang,locale:tb.fn.locale,toIsoString:f("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",function(){return this.toISOString()}),toISOString:function(){var a=Math.abs(this.years()),b=Math.abs(this.months()),c=Math.abs(this.days()),d=Math.abs(this.hours()),e=Math.abs(this.minutes()),f=Math.abs(this.seconds()+this.milliseconds()/1e3);return this.asSeconds()?(this.asSeconds()<0?"-":"")+"P"+(a?a+"Y":"")+(b?b+"M":"")+(c?c+"D":"")+(d||e||f?"T":"")+(d?d+"H":"")+(e?e+"M":"")+(f?f+"S":""):"P0D"},localeData:function(){return this._locale}}),tb.duration.fn.toString=tb.duration.fn.toISOString;for(vb in ic)c(ic,vb)&&rb(vb.toLowerCase());tb.duration.fn.asMilliseconds=function(){return this.as("ms")},tb.duration.fn.asSeconds=function(){return this.as("s")},tb.duration.fn.asMinutes=function(){return this.as("m")},tb.duration.fn.asHours=function(){return this.as("h")},tb.duration.fn.asDays=function(){return this.as("d")},tb.duration.fn.asWeeks=function(){return this.as("weeks")},tb.duration.fn.asMonths=function(){return this.as("M")},tb.duration.fn.asYears=function(){return this.as("y")},tb.locale("en",{ordinal:function(a){var b=a%10,c=1===A(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th"; 1574return a+c}}),Jb?module.exports=tb:"function"==typeof define&&define.amd?(define("moment",function(a,b,c){return c.config&&c.config()&&c.config().noGlobal===!0&&(xb.moment=ub),tb}),sb(!0)):sb()}).call(this); 1575// moment.js locale configuration 1576// locale : french (fr) 1577// author : John Fischer : https://github.com/jfroffice 1578 1579(function (factory) { 1580 if (typeof define === 'function' && define.amd) { 1581 define(['moment'], factory); // AMD 1582 } else if (typeof exports === 'object') { 1583 module.exports = factory(require('../moment')); // Node 1584 } else { 1585 factory(window.moment); // Browser global 1586 } 1587}(function (moment) { 1588 return moment.defineLocale('fr', { 1589 months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'), 1590 monthsShort : 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'), 1591 weekdays : 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'), 1592 weekdaysShort : 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'), 1593 weekdaysMin : 'Di_Lu_Ma_Me_Je_Ve_Sa'.split('_'), 1594 longDateFormat : { 1595 LT : 'HH:mm', 1596 L : 'DD/MM/YYYY', 1597 LL : 'D MMMM YYYY', 1598 LLL : 'D MMMM YYYY LT', 1599 LLLL : 'dddd D MMMM YYYY LT' 1600 }, 1601 calendar : { 1602 sameDay: '[Aujourd\'hui à] LT', 1603 nextDay: '[Demain à] LT', 1604 nextWeek: 'dddd [à] LT', 1605 lastDay: '[Hier à] LT', 1606 lastWeek: 'dddd [dernier à] LT', 1607 sameElse: 'L' 1608 }, 1609 relativeTime : { 1610 future : 'dans %s', 1611 past : 'il y a %s', 1612 s : 'quelques secondes', 1613 m : 'une minute', 1614 mm : '%d minutes', 1615 h : 'une heure', 1616 hh : '%d heures', 1617 d : 'un jour', 1618 dd : '%d jours', 1619 M : 'un mois', 1620 MM : '%d mois', 1621 y : 'un an', 1622 yy : '%d ans' 1623 }, 1624 ordinal : function (number) { 1625 return number + (number === 1 ? 'er' : ''); 1626 }, 1627 week : { 1628 dow : 1, // Monday is the first day of the week. 1629 doy : 4 // The week that contains Jan 4th is the first week of the year. 1630 } 1631 }); 1632})); 1633 1634if (typeof Object.create !== 'function') { 1635 Object.create = function(obj) { 1636 function F() {} 1637 F.prototype = obj; 1638 return new F(); 1639 }; 1640} 1641 1642(function($, window, document, undefined) { 1643 $.fn.socialfeed = function(_options) { 1644 1645 1646 var defaults = { 1647 plugin_folder: '', // a folder in which the plugin is located (with a
1647slash in the end) 1648 template: '/assets/js/socialFeed/template.html', // a path to the template file 1649 show_media: false, // show images of attachments if available 1650 media_min_width: 300, 1651 length: 500, // maximum length of post message shown 1652 date_format: 'll' 1653 1654 }; 1655 //--------------------------------------------------------------------------------- 1656 var options = $.extend(defaults, _options), 1657 container = $(this), 1658 template, 1659 template2, 1660 social_networks = ['facebook', 'instagram', 'vk', 'google', 'blogspot', 'twitter', 'pinterest', 'rss'], 1661 posts_to_load_count = 0, 1662 loaded_post_count = 0; 1663 1664 if(options.template2 === 'true') { 1665 options.template = '/assets/js/socialFeed/template-accueil'; 1666 } 1667 1668 // container.empty().css('display', 'block'); 1669 //--------------------------------------------------------------------------------- 1670 1671 //--------------------------------------------------------------------------------- 1672 // This function performs consequent data loading from all of the sources by calling corresponding functions 1673 function calculatePostsToLoadCount() { 1674 social_networks.forEach(function(network) { 1675 if (options[network]) { 1676 if (options[network].accounts) { 1677 posts_to_load_count += options[network].limit * options[network].accounts.length; 1678 1679 1680 } else { 1681 posts_to_load_count += options[network].limit; 1682 } 1683 } 1684 }); 1685 } 1686 1687 calculatePostsToLoadCount(); 1688 1689 function fireCallback() { 1690 var fire = true; 1691 /*$.each(Object.keys(loaded), function() { 1692 if (loaded[this] > 0) 1693 fire = false; 1694 });*/ 1695 if (fire && options.callback) { 1696 options.callback(); 1697 } 1698 } 1699 1700 var Utility = { 1701 request: function(url, callback) { 1702 $.ajax({ 1703 url: url, 1704 dataType: 'jsonp', 1705 success: callback 1706 }); 1707 }, 1708 get_request: function(url, callback) { 1709 $.get(url, callback, 'json'); 1710 }, 1711 wrapLinks: function(string, social_network) { 1712 var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig; 1713 if (social_network === 'google-plus') { 1714 string = string.replace(/(@|#)([a-z0-9_]+['])/ig, Utility.wrapGoogleplusTagTemplate); 1715 } else { 1716 string = string.replace(exp, Utility.wrapLinkTemplate); 1717 } 1718 return string; 1719 }, 1720 wrapLinkTemplate: function(string) { 1721 return '<a target="_blank" href="' + string + '">' + string + '<\/a>'; 1722 }, 1723 wrapGoogleplusTagTemplate: function(string) { 1724 return '<a target="_blank" href="https://plus.google.com/s/' + string + '" >' + string + '<\/a>'; 1725 }, 1726 shorten: function(string) { 1727 string = $.trim(string); 1728 if (string.length > options.length) { 1729 return jQuery.trim(string).substring(0, options.length).split(" ").slice(0, -1).join(" ") + "..."; 1730 } else { 1731 return string; 1732 } 1733 }, 1734 stripHTML: function(string) { 1735 if (typeof string === "undefined" || string === null) { 1736 return ''; 1737 } 1738 return string.replace(/(<([^>]+)>)|nbsp;|\s{2,}|/ig, ""); 1739 } 1740 }; 1741 1742 function SocialFeedPost(social_network, data) { 1743 this.content = data; 1744 this.content.social_network = social_network; 1745 this.content.attachment = (this.content.attachment === undefined) ? '' : this.content.attachment; 1746 this.content.time_ago = data.dt_create.fromNow(); 1747 this.content.date = data.dt_create.format(options.date_format); 1748 this.content.dt_create = this.content.dt_create.valueOf(); 1749 this.content.text = Utility.wrapLinks(Utility.shorten(data.message + ' ' + data.description), data.social_network); 1750 this.content.moderation_passed = (options.moderation) ? options.moderation(this.content) : true; 1751 1752 Feed[social_network].posts.push(this); 1753 } 1754 SocialFeedPost.prototype = { 1755 render: function() { 1756 var rendered_html = Feed.template(this.content); 1757 var data = this.content; 1758 1759 if ($(container).children('[social-feed-id=' + data.id + ']').length !== 0) { 1760 return false;
1761 } 1762 if ($(container).children().length === 0) { 1763 $(container).append(rendered_html); 1764 } else { 1765 var i = 0, 1766 insert_index = -1; 1767 $.each($(container).children(), function() { 1768 if ($(this).attr('dt-create') < data.dt_create) { 1769 insert_index = i; 1770 return false; 1771 } 1772 i++; 1773 }); 1774 $(container).append(rendered_html); 1775 if (insert_index >= 0) { 1776 insert_index++; 1777 var before = $(container).children('div:nth-child(' + insert_index + ')'), 1778 current = $(container).children('div:last-child'); 1779 $(current).insertBefore(before); 1780 } 1781 1782 } 1783 if (options.media_min_width) { 1784 1785 var query = '[social-feed-id=' + data.id + '] img.attachment'; 1786 var image = $(query); 1787 1788 // preload the image 1789 var height, width = ''; 1790 var img = new Image(); 1791 var imgSrc = image.attr("src"); 1792 1793 $(img).load(function() { 1794 1795 1796 if (img.width < options.media_min_width) { 1797 image.addClass('hidden'); 1798 1799 } 1800 // garbage collect img 1801 delete img; 1802 1803 }).error(function() { 1804 // image couldnt be loaded 1805 image.addClass('hidden'); 1806 1807 1808 }).attr({ 1809 src: imgSrc 1810 }); 1811 1812 } 1813 1814 loaded_post_count++; 1815 if (loaded_post_count == posts_to_load_count) { 1816 fireCallback(); 1817 } 1818 1819 } 1820 1821 }; 1822 1823 var Feed = { 1824 template: false, 1825 init: function() { 1826 Feed.getTemplate(function() { 1827 social_networks.forEach(function(network) { 1828 if (options[network]) { 1829 if ( options[network].accounts ) { 1830 //loaded[network] = 0; 1831 options[network].accounts.forEach(function(account) { 1832 //loaded[network]++; 1833 Feed[network].getData(account); 1834 }); 1835 } else if ( options[network].urls ) { 1836 options[network].urls.forEach(function(url) { 1837 Feed[network].getData(url); 1838 }); 1839 } else { 1840 Feed[network].getData(); 1841 } 1842 } 1843 }); 1844 }); 1845 }, 1846 getTemplate: function(callback) { 1847 if (Feed.template) { 1848 return callback(); 1849 } else { 1850 if (options.template_html) { 1851 Feed.template = doT.template(options.template_html); 1852 return callback(); 1853 } else { 1854 $.get(options.template, function(template_html) { 1855 Feed.template = doT.template(template_html); 1856 return callback(); 1857 }); 1858 } 1859 } 1860 }, 1861 twitter: { 1862 posts: [], 1863 loaded: false, 1864 api: 'http://api.tweecool.com/', 1865 1866 getData: function(account) { 1867 1868 var cb = new Codebird(); 1869 cb.setConsumerKey(options.twitter.consumer_key, options.twitter.consumer_secret); 1870 1871 // Allow setting your own proxy with Codebird 1872 if (options.twitter.proxy !== undefined) { 1873 cb.setProxy(options.twitter.proxy); 1874 } 1875 1876 switch (account[0]) { 1877 case '@': 1878 var userid = account.substr(1); 1879 cb.__call( 1880 "statuses_userTimeline", 1881 "id=" + userid + "&count=" + options.twitter.limit, 1882 1883 1884 1885 1886 1887 Feed.twitter.utility.getPosts, 1888 true // this parameter required 1889 ); 1890 break; 1891 case '#': 1892 var hashtag = account.substr(1); 1893 cb.__call( 1894 "search_tweets", 1895 "q=" + hashtag + "&count=" + options.twitter.limit, 1896 1897 1898 1899 1900 1901 function(reply) { 1902 Feed.twitter.utility.getPosts(reply.statuses); 1903 }, 1904 true // this parameter required 1905 ); 1906 break; 1907 default: 1908 } 1909 }, 1910 utility: { 1911 getPosts: function(json) { 1912 if (json) { 1913 $.each(json, function() { 1914 var element = this; 1915 var post = new SocialFeedPost('twitter', Feed.twitter.utility.unifyPostData(element)); 1916 post.render(); 1917 }); 1918 fireCallback(); 1919 } 1920 }, 1921 unifyPostData: function(element) { 1922 var post = {};
1923 if (element.id) { 1924 post.id = element.id; 1925 //prevent a moment.js console warning due to Twitter's poor date format. 1926 post.dt_create = moment(new Date(element.created_at)); 1927 post.author_link = 'http://twitter.com/' + element.user.screen_name; 1928 post.author_picture = element.user.profile_image_url; 1929 post.post_url = post.author_link + '/status/' + element.id_str; 1930 post.author_name = element.user.name; 1931 post.message = element.text; 1932 1933 1934 1935 post.description = ''; 1936 post.link = 'http://twitter.com/' + element.user.screen_name + '/status/' + element.id_str; 1937 1938 if (options.show_media === true) { 1939 if (element.entities.media && element.entities.media.length > 0) { 1940 var image_url = element.entities.media[0].media_url; 1941 if (image_url) { 1942 post.attachment = '<img class="attachment" src="' + image_url + '" />'; 1943 } 1944 } 1945 } 1946 } 1947 return post; 1948 } 1949 } 1950 }, 1951 facebook: { 1952 posts: [], 1953 graph: 'https://graph.facebook.com/', 1954 loaded: false, 1955 getData: function(account) { 1956 var proceed = function(request_url){ 1957 Utility.request(request_url, Feed.facebook.utility.getPosts); 1958 }; 1959 var fields = '?fields=id,from,name,message,created_time,story,description,link'; 1960 fields += (options.show_media === true)?',picture,object_id':''; 1961 var request_url, limit = '&limit=' + options.facebook.limit,
1962 query_extention = '&access_token=' + options.facebook.access_token + '&callback=?'; 1963 switch (account[0]) { 1964 case '@': 1965 var username = account.substr(1); 1966 Feed.facebook.utility.getUserId(username, function(userdata) { 1967 if (userdata.id !== '') { 1968 request_url = Feed.facebook.graph + 'v2.12/' + userdata.id + '/posts'+ fields + limit + query_extention; 1969 proceed(request_url); 1970 } 1971 }); 1972 break; 1973 case '!': 1974 var page = account.substr(1); 1975 request_url = Feed.facebook.graph + 'v2.12/' + page + '/feed'+ fields + limit + query_extention; 1976 proceed(request_url); 1977 break; 1978 default: 1979 proceed(request_url); 1980 } 1981 }, 1982 utility: { 1983 getUserId: function(username, callback) {
1984 var query_extention = '&access_token=' + options.facebook.access_token + '&callback=?'; 1985 var url = 'https://graph.facebook.com/' + username + '?' + query_extention; 1986 var result = ''; 1987 $.get(url, callback, 'json'); 1988 }, 1989 prepareAttachment: function(element) { 1990 var image_url = element.picture; 1991 if (image_url.indexOf('_b.') !== -1) { 1992 //do nothing it is already big 1993 } else if (image_url.indexOf('safe_image.php') !== -1) { 1994 image_url = Feed.facebook.utility.getExternalImageURL(image_url, 'url'); 1995 1996 } else if (image_url.indexOf('app_full_proxy.php') !== -1) { 1997 image_url = Feed.facebook.utility.getExternalImageURL(image_url, 'src'); 1998 1999 } else if (element.object_id) { 2000 image_url = Feed.facebook.graph + element.object_id + '/picture/?type=normal'; 2001 } 2002 return '<img class="attachment" src="' + image_url + '" />'; 2003 }, 2004 getExternalImageURL: function(image_url, parameter) { 2005 image_url = decodeURIComponent(image_url).split(parameter + '=')[1]; 2006 if (image_url.indexOf('fbcdn-sphotos') === -1) { 2007 return image_url.split('&')[0]; 2008 } else { 2009 return image_url; 2010 } 2011 2012 }, 2013 getPosts: function(json) { 2014 if (json['data']) { 2015 json['data'].forEach(function(element) { 2016 var post = new SocialFeedPost('facebook', Feed.facebook.utility.unifyPostData(element)); 2017 post.render(); 2018 }); 2019 fireCallback(); 2020 } 2021 }, 2022 unifyPostData: function(element) { 2023 var post = {}, 2024 text = (element.message) ? element.message : element.story; 2025 2026 post.id = element.id; 2027 post.dt_create = moment(element.created_time); 2028 post.author_link = 'http://facebook.com/' + element.from.id; 2029 post.author_picture = Feed.facebook.graph + element.from.id + '/picture'; 2030 post.author_name = element.from.name; 2031 post.name = element.name || ""; 2032 post.message = (text) ? text : ''; 2033 post.description = (element.description) ? element.description : ''; 2034 post.link = (element.link) ? element.link : 'http://facebook.com/' + element.from.id; 2035 2036 if (options.show_media === true) { 2037 if (element.picture) { 2038 var attachment = Feed.facebook.utility.prepareAttachment(element); 2039 if (attachment) { 2040 post.attachment = attachment; 2041 } 2042 } 2043 } 2044 return post; 2045 } 2046 } 2047 }, 2048 google: { 2049 posts: [], 2050 loaded: false, 2051 api: 'https://www.googleapis.com/plus/v1/', 2052 getData: function(account) { 2053 var request_url; 2054 switch (account[0]) { 2055 case '#': 2056 var hashtag = account.substr(1); 2057 request_url = Feed.google.api + 'activities?query=' + hashtag + '&key=' + options.google.access_token + '&maxResults=' + options.google.limit; 2058 Utility.get_request(request_url, Feed.google.utility.getPosts); 2059 break; 2060 case '@': 2061 var username = account.substr(1); 2062 request_url = Feed.google.api + 'people/' + username + '/activities/public?key=' + options.google.access_token + '&maxResults=' + options.google.limit; 2063 Utility.get_request(request_url, Feed.google.utility.getPosts); 2064 break; 2065 default: 2066 } 2067 }, 2068 utility: { 2069 getPosts: function(json) { 2070 if (json.items) { 2071 $.each(json.items, function(i) { 2072 var post = new SocialFeedPost('google', Feed.google.utility.unifyPostData(json.items[i])); 2073 post.render(); 2074 }); 2075 } 2076 }, 2077 unifyPostData: function(element) { 2078 var post = {}; 2079
2080 post.id = element.id; 2081 post.attachment = ''; 2082 post.description = ''; 2083 post.dt_create = moment(element.published); 2084 post.author_link = element.actor.url; 2085 post.author_picture = element.actor.image.url; 2086 post.author_name = element.actor.displayName; 2087 2088 if (options.show_media === true) { 2089 if (element.object.attachments) { 2090 $.each(element.object.attachments, function() { 2091 var image = ''; 2092 if (this.fullImage) { 2093 image = this.fullImage.url; 2094 } else { 2095 if (this.objectType === 'album') { 2096 if (this.thumbnails && this.thumbnails.length > 0) { 2097 if (this.thumbnails[0].image) { 2098 image = this.thumbnails[0].image.url; 2099 } 2100 } 2101 } 2102 } 2103 post.attachment = '<img class="attachment" src="' + image
2103+ '"/>'; 2104 }); 2105 } 2106 } 2107 post.message = element.title; 2108 post.link = element.url; 2109 2110 return post; 2111 } 2112 } 2113 }, 2114 instagram: { 2115 posts: [], 2116 api: 'https://api.instagram.com/v1/', 2117 loaded: false, 2118 accessType: function() { 2119 // If we have both the client_id and access_token set in options, 2120 // use access_token for authentication. If client_id is not set 2121 // then use access_token. If neither are set, log an error to console. 2122 if (typeof options.instagram.access_token === 'undefined' && typeof options.instagram.client_id === 'undefined') { 2123 console.log('You need to define a client_id or access_token to authenticate with Instagram\'s API.'); 2124 return undefined; 2125 } 2126 if (options.instagram.access_token) { options.instagram.client_id = undefined; } 2127 options.instagram.access_type = (typeof options.instagram.client_id === 'undefined' ? 'access_token' : 'client_id'); 2128 return options.instagram.access_type; 2129 }, 2130 getData: function(account) { 2131 var url; 2132 2133 // API endpoint URL depends on which authentication type we're using. 2134 if (this.accessType() !== 'undefined') { 2135 var authTokenParams = options.instagram.access_type + '=' + options.instagram[options.instagram.access_type]; 2136 } 2137 2138 switch (account[0]) { 2139 case '@': 2140 var username = account.substr(1); 2141 url = Feed.instagram.api + 'users/' + username + '/media/recent'; 2142 // url = Feed.instagram.api + 'users/search/?q=' + username + '&' + authTokenParams + '&count=1' + '&callback=?'; 2143 Utility.request(url, Feed.instagram.utility.getUsers); 2144 break; 2145 case '#': 2146 var hashtag = account.substr(1); 2147 url = Feed.instagram.api + 'tags/' + hashtag + '/media/recent/?' + authTokenParams + '&' + 'count=' + options.instagram.limit + '&callback=?'; 2148 Utility.request(url, Feed.instagram.utility.getImages); 2149 break; 2150 case '&': 2151 var id = account.substr(1); 2152 url = Feed.instagram.api + 'users/' + id + '/?' + authTokenParams + '&' + 'count=' + options.instagram.limit + '&callback=?'; 2153 Utility.request(url, Feed.instagram.utility.getUsers); 2154 default: 2155 } 2156 }, 2157 utility: { 2158 getImages: function(json) { 2159 if (json.data) { 2160 json.data.forEach(function(element) { 2161 var post = new SocialFeedPost('instagram', Feed.instagram.utility.unifyPostData(element)); 2162 post.render(); 2163 }); 2164 fireCallback(); 2165 } 2166 }, 2167 getUsers: function(json) { 2168 // API endpoint URL depends on which authentication type we're using. 2169 if (options.instagram.access_type !== 'undefined') { 2170 var authTokenParams = options.instagram.access_type + '=' + options.instagram[options.instagram.access_type]; 2171 } 2172 2173 if (!jQuery.isArray(json.data)) json.data = [json.data] 2174 json.data.forEach(function(user) { 2175 var url = Feed.instagram.api + 'users/self/media/recent/?' + authTokenParams + '&' + 'count=' + options.instagram.limit + '&callback=?'; 2176 Utility.request(url, Feed.instagram.utility.getImages); 2177 }); 2178 }, 2179 unifyPostData: function(element) { 2180 var post = {}; 2181
2182 post.id = element.id; 2183 post.dt_create = moment(element.created_time * 1000); 2184 post.author_link = 'http://instagram.com/' + element.user.username; 2185 post.author_picture = element.user.profile_picture; 2186 post.author_name = element.user.full_name || element.user.username; 2187 post.message = (element.caption && element.caption) ? element.caption.text : ''; 2188 post.description = ''; 2189 post.link = element.link; 2190 if (options.show_media) { 2191 post.attachment = '<img class="attachment" src="' + element.images.standard_resolution.url + '' + '" />'; 2192 } 2193 return post; 2194 } 2195 } 2196 }, 2197 vk: { 2198 posts: [], 2199 loaded: false, 2200 base: 'http://vk.com/', 2201 api: 'https://api.vk.com/method/', 2202 user_json_template: 'https://api.vk.com/method/' + 'users.get?fields=first_name,%20last_name,%20screen_name,%20photo&uid=', 2203 group_json_template: 'https://api.vk.com/method/' + 'groups.getById?fields=first_name,%20last_name,%20screen_name,%20photo&gid=', 2204 getData: function(account) { 2205 var request_url; 2206 2207 switch (account[0]) { 2208 case '@': 2209 var username = account.substr(1); 2210 request_url = Feed.vk.api + 'wall.get?owner_id=' + username + '&filter=' + options.vk.source + '&count=' + options.vk.limit + '&callback=?'; 2211 Utility.get_request(request_url, Feed.vk.utility.getPosts); 2212 break; 2213 case '#': 2214 var hashtag = account.substr(1); 2215 request_url = Feed.vk.api + 'newsfeed.search?q=' + hashtag + '&count=' + options.vk.limit + '&callback=?'; 2216 Utility.get_request(request_url, Feed.vk.utility.getPosts); 2217 break; 2218 default: 2219 } 2220 }, 2221 utility: { 2222 getPosts: function(json) { 2223 if (json.response) { 2224 $.each(json.response, function() { 2225 if (this != parseInt(this) && this.post_type === 'post') { 2226 var owner_id = (this.owner_id) ? this.owner_id : this.from_id, 2227 vk_wall_owner_url = (owner_id > 0) ? (Feed.vk.user_json_template + owner_id + '&callback=?') : (Feed.vk.group_json_template + (-1) * owner_id + '&callback=?'), 2228 element = this; 2229 Utility.get_request(vk_wall_owner_url, function(wall_owner) { 2230 Feed.vk.utility.unifyPostData(wall_owner, element, json); 2231 }); 2232 } 2233 }); 2234 } 2235 }, 2236 unifyPostData: function(wall_owner, element, json) { 2237 var post = {}; 2238 2239 post.id = element.id; 2240 post.dt_create = moment.unix(element.date); 2241 post.description = ' '; 2242 post.message = Utility.stripHTML(element.text); 2243 if (options.show_media) { 2244 if (element.attachment) { 2245 if (element.attachment.type === 'link') 2246 post.attachment = '<img class="attachment" src="' + element.attachment.link.image_src + '" />'; 2247 if (element.attachment.type === 'video') 2248 post.attachment = '<img class="attachment" src="' + element.attachment.video.image_big + '" />'; 2249 if (element.attachment.type === 'photo') 2250 post.attachment = '<img class="attachment" src="' + element.attachment.photo.src_big + '" />'; 2251 } 2252 } 2253 2254 if (element.from_id > 0) { 2255 var vk_user_json = Feed.vk.user_json_template + element.from_id + '&callback=?'; 2256 Utility.get_request(vk_user_json, function(user_json) { 2257 var vk_post = new SocialFeedPost('vk', Feed.vk.utility.getUser(user_json, post, element, json)); 2258 vk_post.render(); 2259 }); 2260 2261 } else { 2262 var vk_group_json = Feed.vk.group_json_template + (-1) * element.from_id + '&callback=?'; 2263 Utility.get_request(vk_group_json, function(user_json) { 2264 var vk_post = new SocialFeedPost('vk', Feed.vk.utility.getGroup(user_json, post, element, json)); 2265 vk_post.render(); 2266 }); 2267 } 2268 }, 2269 getUser: function(user_json, post, element, json) { 2270 post.author_name = user_json.response[0].first_name + ' ' + user_json.response[0].last_name; 2271 post.author_picture = user_json.response[0].photo; 2272 post.author_link = Feed.vk.base + user_json.response[0].screen_name; 2273 post.link = Feed.vk.base + user_json.response[0].screen_name + '?w=wall' + element.from_id + '_' + element.i
2273d; 2274 2275 return post; 2276 }, 2277 getGroup: function(user_json, post, element, json) { 2278 post.author_name = user_json.response[0].name; 2279 post.author_picture = user_json.response[0].photo; 2280 post.author_link = Feed.vk.base + user_json.response[0].screen_name; 2281 post.link = Feed.vk.base + user_json.response[0].screen_name + '?w=wall-' + user_json.response[0].gid + '_' + element.id; 2282 2283 return post; 2284 } 2285 } 2286 }, 2287 blogspot: { 2288 loaded: false, 2289 getData: function(account) { 2290 var url; 2291 2292 switch (account[0]) { 2293 case '@': 2294 var username = account.substr(1); 2295 url = 'http://' + username + '.blogspot.com/feeds/posts/default?alt=json-in-script&callback=?'; 2296 request(url, getPosts); 2297 break; 2298 default: 2299 } 2300 }, 2301 utility: { 2302 getPosts: function(json) { 2303 $.each(json.feed.entry, function() { 2304 var post = {}, 2305 element = this; 2306 post.id = element.id['$t'].replace(/[^a-z0-9]/gi, ''); 2307 post.dt_create = moment((element.published['$t'])); 2308 post.author_link = element.author[0]['uri']['$t']; 2309 post.author_picture = 'http:' + element.author[0]['gd$image']['src']; 2310 post.author_name = element.author[0]['name']['$t']; 2311 post.message = element.title['$t'] + '</br></br>' + stripHTML(element.content['$t']); 2312 post.description = ''; 2313 post.link = element.link.pop().href; 2314 2315 if (options.show_media) { 2316 if (element['media$thumbnail']) { 2317 post.attachment = '<img class="attachment" src="' + element['media$thumbnail']['url'] + '" />'; 2318 } 2319 } 2320 2321 post.render(); 2322 2323 }); 2324 } 2325 } 2326 }, 2327 pinterest: { 2328 posts: [], 2329 loaded: false, 2330 apiv1: 'https://api.pinterest.com/v1/', 2331 2332 getData: function(account) { 2333 var request_url, 2334 limit = 'limit=' + options.pinterest.limit, 2335 fields = 'fields=id,created_at,link,note,creator(url,first_name,last_name,image),image', 2336 query_extention = fields + '&access_token='
2336+ options.pinterest.access_token + '&' + limit + '&callback=?'; 2337 switch (account[0]) { 2338 case '@': 2339 var username = account.substr(1); 2340 if (username === 'me') { 2341 request_url = Feed.pinterest.apiv1 + 'me/pins/?' + query_extention; 2342 } else { 2343 request_url = Feed.pinterest.apiv1 + 'boards/' + username + '/pins?' + query_extention; 2344 } 2345 break; 2346 default: 2347 } 2348 Utility.request(request_url, Feed.pinterest.utility.getPosts); 2349 }, 2350 utility: { 2351 2352 getPosts: function(json) { 2353 json.data.forEach(function(element) { 2354 var post = new SocialFeedPost('pinterest', Feed.pinterest.utility.unifyPostData(element)); 2355 post.render(); 2356 }); 2357 fireCallback(); 2358 }, 2359 2360 unifyPostData: function(element){ 2361 var post = {}; 2362 2363 post.id = element.id; 2364 post.dt_create= moment(element.created_at); 2365 post.author_link = element.creator.url; 2366 post.author_picture = element.creator.image['60x60' ].url; 2367 post.author_name = element.creator.first_name + element.creator.last_name; 2368 post.message = element.note; 2369 post.description = ''; 2370 post.social_network = 'pinterest'; 2371 post.link = element.link ? element.link : 'https://www.pinterest.com/pin/' + element.id; 2372 if (options.show_media) { 2373 post.attachment = '<img class="attachment" src="' + element.image['original'].url + '" />'; 2374 } 2375 return post; 2376 } 2377 } 2378 }, 2379 rss : { 2380 posts: [], 2381 loaded: false, 2382 api : 'https://ajax.googleapis.com/ajax/services/feed/load?v=1.0', 2383 2384 2385 2386 getData: function(url) { 2387 var limit = '&num='+ options.rss.limit, 2388 request_url = Feed.rss.api + limit + '&q=' + encodeURIComponent(url); 2389 2390 2391 2392 Utility.request(request_url, Feed.rss.utility.getPosts); 2393 }, 2394 utility: { 2395 2396 getPosts: function(json) { 2397 2398 2399 $.each(json.responseData.feed.entries, function(index, element) { 2400 var post = new SocialFeedPost('rss', Feed.rss.utility.unifyPostData(index, element)); 2401 post.render(); 2402 }); 2403 2404 }, 2405 2406 unifyPostData: function(index, element){ 2407 2408 2409 2410 2411 2412 2413 var post = {}; 2414 2415 post.id = index; 2416 2417 post.dt_create= moment(element.publishedDate, 'ddd, DD MMM YYYY HH:mm:ss ZZ', 'en'); 2418 2419 post.author_link = ''; 2420 post.author_picture = ''; 2421 post.author_name = element.author; 2422 post.message = Utility.stripHTML(element.title); 2423 2424 2425 2426 2427 2428 2429 2430 post.description = Utility.stripHTML(element.content); 2431 2432 post.social_network = 'rss'; 2433 post.link = element.link; 2434 2435 if (options.show_media && element.mediaGroups ) { 2436 post.attachment = '<img class="attachment" src="' + element.mediaGroups[0].contents[0].url + '" />'; 2437 } 2438 return post; 2439 } 2440 } 2441 } 2442 }; 2443 2444 //make the plugin chainable 2445 return this.each(function() { 2446 // Initialization 2447 Feed.init(); 2448 if (options.update_period) { 2449 setInterval(function() { 2450 return Feed.init(); 2451 }, options.update_period); 2452 } 2453 }) 2454 }; 2455 2456})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.