!function(t,i){t.Packery=t.Packery||{},t.Packery.Rect=function(){function t(i){for(var e in t.defaults)this[e]=t.defaults[e];for(e in i)this[e]=i[e]}t.defaults={x:0,y:0,width:0,height:0};var i=t.prototype;return i.contains=function(t){var i=t.width||0,e=t.height||0;return this.x<=t.x&&this.y<=t.y&&this.x+this.width>=t.x+i&&this.y+this.height>=t.y+e},i.overlaps=function(t){var i=this.x+this.width,e=this.y+this.height,s=t.x+t.width,h=t.y+t.height;return this.x<s&&i>t.x&&this.y<h&&e>t.y},i.getMaximalFreeRects=function(i){if(!this.overlaps(i))return!1;var e,s=[],h=this.x+this.width,n=this.y+this.height,r=i.x+i.width,a=i.y+i.height;return this.y<i.y&&(e=new t({x:this.x,y:this.y,width:this.width,height:i.y-this.y}),s.push(e)),h>r&&(e=new t({x:r,y:this.y,width:h-r,height:this.height}),s.push(e)),n>a&&(e=new t({x:this.x,y:a,width:this.width,height:n-a}),s.push(e)),this.x<i.x&&(e=new t({x:this.x,y:this.y,width:i.x-this.x,height:this.height}),s.push(e)),s},i.canFit=function(t){return this.width>=t.width&&this.height>=t.height},t}()}(window),function(t,i){var e=t.Packery=t.Packery||{};e.Packer=function(t){function i(t,i,e){this.width=t||0,this.height=i||0,this.sortDirection=e||"downwardLeftToRight",this.reset()}var e=i.prototype;e.reset=function(){this.spaces=[];var i=new t({x:0,y:0,width:this.width,height:this.height});this.spaces.push(i),this.sorter=s[this.sortDirection]||s.downwardLeftToRight},e.pack=function(t){for(var i=0;i<this.spaces.length;i++){var e=this.spaces[i];if(e.canFit(t)){this.placeInSpace(t,e);break}}},e.columnPack=function(t){for(var i=0;i<this.spaces.length;i++){var e=this.spaces[i];if(e.x<=t.x&&e.x+e.width>=t.x+t.width&&e.height>=t.height-.01){t.y=e.y,this.placed(t);break}}},e.rowPack=function(t){for(var i=0;i<this.spaces.length;i++){var e=this.spaces[i];if(e.y<=t.y&&e.y+e.height>=t.y+t.height&&e.width>=t.width-.01){t.x=e.x,this.placed(t);break}}},e.placeInSpace=function(t,i){t.x=i.x,t.y=i.y,this.placed(t)},e.placed=function(t){for(var i=[],e=0;e<this.spaces.length;e++){var s=this.spaces[e],h=s.getMaximalFreeRects(t);h?i.push.apply(i,h):i.push(s)}this.spaces=i,this.mergeSortSpaces()},e.mergeSortSpaces=function(){i.mergeRects(this.spaces),this.spaces.sort(this.sorter)},e.addSpace=function(t){this.spaces.push(t),this.mergeSortSpaces()},i.mergeRects=function(t){var i=0,e=t[i];t:for(;e;){for(var s=0,h=t[i+s];h;){if(h==e)s++;else{if(h.contains(e)){t.splice(i,1),e=t[i];continue t}e.contains(h)?t.splice(i+s,1):s++}h=t[i+s]}e=t[++i]}return t};var s={downwardLeftToRight:function(t,i){return t.y-i.y||t.x-i.x},rightwardTopToBottom:function(t,i){return t.x-i.x||t.y-i.y}};return i}(e.Rect)}(window),function(t,i){t.Packery.Item=function(t,i){var e="string"==typeof document.documentElement.style.transform?"transform":"WebkitTransform",s=function(){t.Item.apply(this,arguments)},h=s.prototype=Object.create(t.Item.prototype),n=h._create;h._create=function(){n.call(this),this.rect=new i};var r=h.moveTo;return h.moveTo=function(t,i){var e=Math.abs(this.position.x-t),s=Math.abs(this.position.y-i);this.layout.dragItemCount&&!this.isPlacing&&!this.isTransitioning&&e<1&&s<1?this.goTo(t,i):r.apply(this,arguments)},h.enablePlacing=function(){this.removeTransitionStyles(),this.isTransitioning&&e&&(this.element.style[e]="none"),this.isTransitioning=!1,this.getSize(),this.layout._setRectSize(this.element,this.rect),this.isPlacing=!0},h.disablePlacing=function(){this.isPlacing=!1},h.removeElem=function(){this.element.parentNode.removeChild(this.element),this.layout.packer.addSpace(this.rect),this.emitEvent("remove",[this])},h.showDropPlaceholder=function(){var t=this.dropPlaceholder;t||((t=this.dropPlaceholder=document.createElement("div")).className="packery-drop-placeholder",t.style.position="absolute"),t.style.width=this.size.width+"px",t.style.height=this.size.height+"px",this.positionDropPlaceholder(),this.layout.element.appendChild(t)},h.positionDropPlaceholder=function(){this.dropPlaceholder.style[e]="translate("+this.rect.x+"px, "+this.rect.y+"px)"},h.hideDropPlaceholder=function(){this.layout.element.removeChild(this.dropPlaceholder)},s}(t.Outlayer,t.Packery.Rect)}(window),
function(t,i){t.Packery=function(t,i,e,s,h){e.prototype.canFit=function(t){return this.width>=t.width-1&&this.height>=t.height-1};var n=i.create("packery");n.Item=h;var r=n.prototype;function a(t,i){return t.position.y-i.position.y||t.position.x-i.position.x}function o(t,i){return t.position.x-i.position.x||t.position.y-i.position.y}function c(t,i){var e=i.x-t.x,s=i.y-t.y;return Math.sqrt(e*e+s*s)}r._create=function(){i.prototype._create.call(this),this.packer=new s,this.shiftPacker=new s,this.isEnabled=!0,this.dragItemCount=0;var t=this;this.handleDraggabilly={dragStart:function(){t.itemDragStart(this.element)},dragMove:function(){t.itemDragMove(this.element,this.position.x,this.position.y)},dragEnd:function(){t.itemDragEnd(this.element)}},this.handleUIDraggable={start:function(i,e){e&&t.itemDragStart(i.currentTarget)},drag:function(i,e){e&&t.itemDragMove(i.currentTarget,e.position.left,e.position.top)},stop:function(i,e){e&&t.itemDragEnd(i.currentTarget)}}},r._resetLayout=function(){var t,i,e;this.getSize(),this._getMeasurements(),this._getOption("horizontal")?(t=1/0,i=this.size.innerHeight+this.gutter,e="rightwardTopToBottom"):(t=this.size.innerWidth+this.gutter,i=1/0,e="downwardLeftToRight"),this.packer.width=this.shiftPacker.width=t,this.packer.height=this.shiftPacker.height=i,this.packer.sortDirection=this.shiftPacker.sortDirection=e,this.packer.reset(),this.maxY=0,this.maxX=0},r._getMeasurements=function(){this._getMeasurement("columnWidth","width"),this._getMeasurement("rowHeight","height"),this._getMeasurement("gutter","width")},r._getItemLayoutPosition=function(t){if(this._setRectSize(t.element,t.rect),this.isShifting||this.dragItemCount>0){var i=this._getPackMethod();this.packer[i](t.rect)}else this.packer.pack(t.rect);return this._setMaxXY(t.rect),t.rect},r.shiftLayout=function(){this.isShifting=!0,this.layout(),delete this.isShifting},r._getPackMethod=function(){return this._getOption("horizontal")?"rowPack":"columnPack"},r._setMaxXY=function(t){this.maxX=Math.max(t.x+t.width,this.maxX),this.maxY=Math.max(t.y+t.height,this.maxY)},r._setRectSize=function(i,e){var s=t(i),h=s.outerWidth,n=s.outerHeight;(h||n)&&(h=this._applyGridGutter(h,this.columnWidth),n=this._applyGridGutter(n,this.rowHeight)),e.width=Math.min(h,this.packer.width),e.height=Math.min(n,this.packer.height)},r._applyGridGutter=function(t,i){if(!i)return t+this.gutter;var e=t%(i+=this.gutter);return t=Math[e&&e<1?"round":"ceil"](t/i)*i},r._getContainerSize=function(){return this._getOption("horizontal")?{width:this.maxX-this.gutter}:{height:this.maxY-this.gutter}},r._manageStamp=function(t){var i,s=this.getItem(t);if(s&&s.isPlacing)i=s.rect;else{var h=this._getElementOffset(t);i=new e({x:this._getOption("originLeft")?h.left:h.right,y:this._getOption("originTop")?h.top:h.bottom})}this._setRectSize(t,i),this.packer.placed(i),this._setMaxXY(i)},r.sortItemsByPosition=function(){var t=this._getOption("horizontal")?o:a;this.items.sort(t)},r.fit=function(t,i,e){var s=this.getItem(t);s&&(this.stamp(s.element),s.enablePlacing(),this.updateShiftTargets(s),i=void 0===i?s.rect.x:i,e=void 0===e?s.rect.y:e,this.shift(s,i,e),this._bindFitEvents(s),s.moveTo(s.rect.x,s.rect.y),this.shiftLayout(),this.unstamp(s.element),this.sortItemsByPosition(),s.disablePlacing())},r._bindFitEvents=function(t){var i=this,e=0;function s(){2==++e&&i.dispatchEvent("fitComplete",null,[t])}t.once("layout",s),this.once("layoutComplete",s)},r.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&(this.options.shiftPercentResize?this.resizeShiftPercentLayout():this.layout())},r.needsResizeLayout=function(){var i=t(this.element),e=this._getOption("horizontal")?"innerHeight":"innerWidth";return i[e]!=this.size[e]},r.resizeShiftPercentLayout=function(){var i=this._getItemsForLayout(this.items),e=this._getOption("horizontal"),s=e?"y":"x",h=e?"height":"width",n=e?"rowHeight":"columnWidth",r=e?"innerHeight":"innerWidth",a=this[n];if(a=a&&a+this.gutter){this._getMeasurements();var o=this[n]+this.gutter;i.forEach((function(t){var i=Math.round(t.rect[s]/a);t.rect[s]=i*o}))}else{var c=t(this.element)[r]+this.gutter,g=this.packer[h];i.forEach((function(t){t.rect[s]=t.rect[s]/g*c}))}this.shiftLayout()},r.itemDragStart=function(t){if(this.isEnabled){this.stamp(t);var i=this.getItem(t);i&&(i.enablePlacing(),i.showDropPlaceholder(),this.dragItemCount++,this.updateShiftTargets(i))}},r.updateShiftTargets=function(t){this.shiftPacker.reset(),this._getBoundingRect();var i=this._getOption("originLeft"),s=this._getOption("originTop");this.stamps.forEach((function(t){var h=this.getItem(t);if(!h||!h.isPlacing){var n=this._getElementOffset(t),r=new e({x:i?n.left:n.right,y:s?n.top:n.bottom});this._setRectSize(t,r),this.shiftPacker.placed(r)}}),this);var h,n=this._getOption("horizontal"),r=n?"rowHeight":"columnWidth",a=n?"height":"width";this.shiftTargetKeys=[],this.shiftTargets=[];var o=this[r];if(o=o&&o+this.gutter){var c=Math.ceil(t.rect[a]/o),g=Math.floor((this.shiftPacker[a]+this.gutter)/o);h=(g-c)*o;for(var u=0;u<g;u++)this._addShiftTarget(u*o,0,h)}else h=this.shiftPacker[a]+this.gutter-t.rect[a],this._addShiftTarget(0,0,h);var d=this._getItemsForLayout(this.items),l=this._getPackMethod();d.forEach((function(t){var i=t.rect;this._setRectSize(t.element,i),this.shiftPacker[l](i),this._addShiftTarget(i.x,i.y,h);var e=n?i.x+i.width:i.x,s=n?i.y:i.y+i.height;if(this._addShiftTarget(e,s,h),o)for(var r=Math.round(i[a]/o),c=1;c<r;c++){var g=n?e:i.x+o*c,u=n?i.y+o*c:s;this._addShiftTarget(g,u,h)}}),this)},r._addShiftTarget=function(t,i,e){var s=this._getOption("horizontal")?i:t;if(!(0!==s&&s>e)){var h=t+","+i;-1!=this.shiftTargetKeys.indexOf(h)||(this.shiftTargetKeys.push(h),this.shiftTargets.push({x:t,y:i}))}},r.shift=function(t,i,e){var s,h=1/0,n={x:i,y:e};this.shiftTargets.forEach((function(t){var i=c(t,n);i<h&&(s=t,h=i)})),t.rect.x=s.x,t.rect.y=s.y};var g=120;r.itemDragMove=function(t,i,e){var s=this.isEnabled&&this.getItem(t);if(s){i-=this.size.paddingLeft,e-=this.size.paddingTop;var h=this,n=new Date;this._itemDragTime&&n-this._itemDragTime<g?(clearTimeout(this.dragTimeout),this.dragTimeout=setTimeout(r,g)):(r(),this._itemDragTime=n)}function r(){h.shift(s,i,e),s.positionDropPlaceholder(),h.layout()}},r.itemDragEnd=function(t){var i=this.isEnabled&&this.getItem(t);if(i){clearTimeout(this.dragTimeout),i.element.classList.add("is-positioning-post-drag");var e=0,s=this;i.once("layout",h),this.once("layoutComplete",h),i.moveTo(i.rect.x,i.rect.y),this.layout(),this.dragItemCount=Math.max(0,this.dragItemCount-1),this.sortItemsByPosition(),i.disablePlacing(),this.unstamp(i.element)}function h(){2==++e&&(i.element.classList.remove("is-positioning-post-drag"),i.hideDropPlaceholder(),s.dispatchEvent("dragItemPositioned",null,[i]))}},r.bindDraggabillyEvents=function(t){this._bindDraggabillyEvents(t,"on")},r.unbindDraggabillyEvents=function(t){this._bindDraggabillyEvents(t,"off")},r._bindDraggabillyEvents=function(t,i){var e=this.handleDraggabilly;t[i]("dragStart",e.dragStart),t[i]("dragMove",e.dragMove),t[i]("dragEnd",e.dragEnd)},r.bindUIDraggableEvents=function(t){this._bindUIDraggableEvents(t,"on")},r.unbindUIDraggableEvents=function(t){this._bindUIDraggableEvents(t,"off")},r._bindUIDraggableEvents=function(t,i){var e=this.handleUIDraggable;t[i]("dragstart",e.start)[i]("drag",e.drag)[i]("dragstop",e.stop)};var u=r.destroy;return r.destroy=function(){u.apply(this,arguments),this.isEnabled=!1},n.Rect=e,n.Packer=s,n}(t.getSize,t.Outlayer,t.Packery.Rect,t.Packery.Packer,t.Packery.Item)}(window),
function(t,i){!function(t,i){var e=t.create("packery"),s=e.prototype,h={_getElementOffset:!0,_getMeasurement:!0};for(var n in i.prototype)h[n]||(s[n]=i.prototype[n]);var r=s._resetLayout;s._resetLayout=function(){this.packer=this.packer||new i.Packer,this.shiftPacker=this.shiftPacker||new i.Packer,r.apply(this,arguments)};var a=s._getItemLayoutPosition;s._getItemLayoutPosition=function(t){return t.rect=t.rect||new i.Rect,a.call(this,t)};var o=s.needsResizeLayout;s.needsResizeLayout=function(){return this._getOption("horizontal")?this.needsVerticalResizeLayout():o.call(this)};var c=s._getOption;s._getOption=function(t){return"horizontal"==t?void 0!==this.options.isHorizontal?this.options.isHorizontal:this.options.horizontal:c.apply(this.isotope,arguments)}}(t.ModulaIsotope.LayoutMode,t.Packery)}(window);