/*! * packery packaged v1.1.1 * bin-packing layout library * http://packery.metafizzy.co * * commercial use requires one-time purchase of a commercial license * http://packery.metafizzy.co/license.html * * non-commercial use is licensed under the gpl v3 license * * copyright 2013 metafizzy */ (function(t){"use strict";function e(t){return regexp("(^|\\s+)"+t+"(\\s+|$)")}function i(t,e){var i=n(t,e)?r:o;i(t,e)}var n,o,r;"classlist"in document.documentelement?(n=function(t,e){return t.classlist.contains(e)},o=function(t,e){t.classlist.add(e)},r=function(t,e){t.classlist.remove(e)}):(n=function(t,i){return e(i).test(t.classname)},o=function(t,e){n(t,e)||(t.classname=t.classname+" "+e)},r=function(t,i){t.classname=t.classname.replace(e(i)," ")});var s={hasclass:n,addclass:o,removeclass:r,toggleclass:i,has:n,add:o,remove:r,toggle:i};"function"==typeof define&&define.amd?define(s):t.classie=s})(window),function(t){"use strict";function e(t){if(t){if("string"==typeof n[t])return t;t=t.charat(0).touppercase()+t.slice(1);for(var e,o=0,r=i.length;r>o;o++)if(e=i[o]+t,"string"==typeof n[e])return e}}var i="webkit moz ms ms o".split(" "),n=document.documentelement.style;"function"==typeof define&&define.amd?define(function(){return e}):t.getstyleproperty=e}(window),function(t){"use strict";function e(t){var e=parsefloat(t),i=-1===t.indexof("%")&&!isnan(e);return i&&e}function i(){for(var t={width:0,height:0,innerwidth:0,innerheight:0,outerwidth:0,outerheight:0},e=0,i=s.length;i>e;e++){var n=s[e];t[n]=0}return t}function n(t){function n(t){if("string"==typeof t&&(t=document.queryselector(t)),t&&"object"==typeof t&&t.nodetype){var n=r(t);if("none"===n.display)return i();var h={};h.width=t.offsetwidth,h.height=t.offsetheight;for(var p=h.isborderbox=!(!a||!n[a]||"border-box"!==n[a]),u=0,c=s.length;c>u;u++){var f=s[u],d=n[f],l=parsefloat(d);h[f]=isnan(l)?0:l}var y=h.paddingleft+h.paddingright,g=h.paddingtop+h.paddingbottom,m=h.marginleft+h.marginright,v=h.margintop+h.marginbottom,_=h.borderleftwidth+h.borderrightwidth,b=h.bordertopwidth+h.borderbottomwidth,x=p&&o,e=e(n.width);e!==!1&&(h.width=e+(x?0:y+_));var w=e(n.height);return w!==!1&&(h.height=w+(x?0:g+b)),h.innerwidth=h.width-(y+_),h.innerheight=h.height-(g+b),h.outerwidth=h.width+m,h.outerheight=h.height+v,h}}var o,a=t("boxsizing");return function(){if(a){var t=document.createelement("div");t.style.width="200px",t.style.padding="1px 2px 3px 4px",t.style.borderstyle="solid",t.style.borderwidth="1px 2px 3px 4px",t.style[a]="border-box";var i=document.body||document.documentelement;i.appendchild(t);var n=r(t);o=200===e(n.width),i.removechild(t)}}(),n}var o=document.defaultview,r=o&&o.getcomputedstyle?function(t){return o.getcomputedstyle(t,null)}:function(t){return t.currentstyle},s=["paddingleft","paddingright","paddingtop","paddingbottom","marginleft","marginright","margintop","marginbottom","borderleftwidth","borderrightwidth","bordertopwidth","borderbottomwidth"];"function"==typeof define&&define.amd?define(["get-style-property/get-style-property"],n):t.getsize=n(t.getstyleproperty)}(window),function(t){"use strict";var e=document.documentelement,i=function(){};e.addeventlistener?i=function(t,e,i){t.addeventlistener(e,i,!1)}:e.attachevent&&(i=function(e,i,n){e[i+n]=n.handleevent?function(){var e=t.event;e.target=e.target||e.srcelement,n.handleevent.call(n,e)}:function(){var i=t.event;i.target=i.target||i.srcelement,n.call(e,i)},e.attachevent("on"+i,e[i+n])});var n=function(){};e.removeeventlistener?n=function(t,e,i){t.removeeventlistener(e,i,!1)}:e.detachevent&&(n=function(t,e,i){t.detachevent("on"+e,t[e+i]);try{delete t[e+i]}catch(n){t[e+i]=void 0}});var o={bind:i,unbind:n};"function"==typeof define&&define.amd?define(o):t.eventie=o}(this),function(t){"use strict";function e(t){"function"==typeof t&&(e.isready?t():r.push(t))}function i(t){var i="readystatechange"===t.type&&"complete"!==o.readystate;if(!e.isready&&!i){e.isready=!0;for(var n=0,s=r.length;s>n;n++){var a=r[n];a()}}}function n(n){return n.bind(o,"domcontentloaded",i),n.bind(o,"readystatechange",i),n.bind(t,"load",i),e}var o=t.document,r=[];e.isready=!1,"function"==typeof define&&define.amd?(e.isready="function"==typeof requirejs,define(["eventie/eventie"],n)):t.docready=n(t.eventie)}(this),function(){"use strict";function t(){}function e(t,e){for(var i=t.length;i--;)if(t[i].listener===e)return i;return-1}function i(t){return function(){return this[t].apply(this,arguments)}}var n=t.prototype;n.getlisteners=function(t){var e,i,n=this._getevents();if("object"==typeof t){e={};for(i in n)n.hasownproperty(i)&&t.test(i)&&(e[i]=n[i])}else e=n[t]||(n[t]=[]);return e},n.flattenlisteners=function(t){var e,i=[];for(e=0;t.length>e;e+=1)i.push(t[e].listener);return i},n.getlistenersasobject=function(t){var e,i=this.getlisteners(t);return i instanceof array&&(e={},e[t]=i),e||i},n.addlistener=function(t,i){var n,o=this.getlistenersasobject(t),r="object"==typeof i;for(n in o)o.hasownproperty(n)&&-1===e(o[n],i)&&o[n].push(r?i:{listener:i,once:!1});return this},n.on=i("addlistener"),n.addoncelistener=function(t,e){return this.addlistener(t,{listener:e,once:!0})},n.once=i("addoncelistener"),n.defineevent=function(t){return this.getlisteners(t),this},n.defineevents=function(t){for(var e=0;t.length>e;e+=1)this.defineevent(t[e]);return this},n.removelistener=function(t,i){var n,o,r=this.getlistenersasobject(t);for(o in r)r.hasownproperty(o)&&(n=e(r[o],i),-1!==n&&r[o].splice(n,1));return this},n.off=i("removelistener"),n.addlisteners=function(t,e){return this.manipulatelisteners(!1,t,e)},n.removelisteners=function(t,e){return this.manipulatelisteners(!0,t,e)},n.manipulatelisteners=function(t,e,i){var n,o,r=t?this.removelistener:this.addlistener,s=t?this.removelisteners:this.addlisteners;if("object"!=typeof e||e instanceof regexp)for(n=i.length;n--;)r.call(this,e,i[n]);else for(n in e)e.hasownproperty(n)&&(o=e[n])&&("function"==typeof o?r.call(this,n,o):s.call(this,n,o));return this},n.removeevent=function(t){var e,i=typeof t,n=this._getevents();if("string"===i)delete n[t];else if("object"===i)for(e in n)n.hasownproperty(e)&&t.test(e)&&delete n[e];else delete this._events;return this},n.emitevent=function(t,e){var i,n,o,r,s=this.getlistenersasobject(t);for(o in s)if(s.hasownproperty(o))for(n=s[o].length;n--;)i=s[o][n],i.once===!0&&this.removelistener(t,i.listener),r=i.listener.apply(this,e||[]),r===this._getoncereturnvalue()&&this.removelistener(t,i.listener);return this},n.trigger=i("emitevent"),n.emit=function(t){var e=array.prototype.slice.call(arguments,1);return this.emitevent(t,e)},n.setoncereturnvalue=function(t){return this._oncereturnvalue=t,this},n._getoncereturnvalue=function(){return this.hasownproperty("_oncereturnvalue")?this._oncereturnvalue:!0},n._getevents=function(){return this._events||(this._events={})},"function"==typeof define&&define.amd?define(function(){return t}):"object"==typeof module&&module.exports?module.exports=t:this.eventemitter=t}.call(this),function(t){"use strict";function e(){}function i(t){function i(e){e.prototype.option||(e.prototype.option=function(e){t.isplainobject(e)&&(this.options=t.extend(!0,this.options,e))})}function o(e,i){t.fn[e]=function(o){if("string"==typeof o){for(var s=n.call(arguments,1),a=0,h=this.length;h>a;a++){var p=this[a],u=t.data(p,e);if(u)if(t.isfunction(u[o])&&"_"!==o.charat(0)){var c=u[o].apply(u,s);if(void 0!==c)return c}else r("no such method '"+o+"' for "+e+" instance");else r("cannot call methods on "+e+" prior to initialization; "+"attempted to call '"+o+"'")}return this}return this.each(function(){var n=t.data(this,e);n?(n.option(o),n._init()):(n=new i(this,o),t.data(this,e,n))})}}if(t){var r="undefined"==typeof console?e:function(t){console.error(t)};t.bridget=function(t,e){i(e),o(t,e)}}}var n=array.prototype.slice;"function"==typeof define&&define.amd?define(["jquery"],i):i(t.jquery)}(window),function(t,e){"use strict";function i(t,e){return t[a](e)}function n(t){if(!t.parentnode){var e=document.createdocumentfragment();e.appendchild(t)}}function o(t,e){n(t);for(var i=t.parentnode.queryselectorall(e),o=0,r=i.length;r>o;o++)if(i[o]===t)return!0;return!1}function r(t,e){return n(t),i(t,e)}var s,a=function(){if(e.matchesselector)return"matchesselector";for(var t=["webkit","moz","ms","o"],i=0,n=t.length;n>i;i++){var o=t[i],r=o+"matchesselector";if(e[r])return r}}();if(a){var h=document.createelement("div"),p=i(h,"div");s=p?i:r}else s=o;"function"==typeof define&&define.amd?define(function(){return s}):window.matchesselector=s}(this,element.prototype),function(t){"use strict";function e(t,e){for(var i in e)t[i]=e[i];return t}function i(t){for(var e in t)return!1;return e=null,!0}function n(t){return t.replace(/([a-z])/g,function(t){return"-"+t.tolowercase()})}function o(t,o,r){function a(t,e){t&&(this.element=t,this.layout=e,this.position={x:0,y:0},this._create())}var h=r("transition"),p=r("transform"),u=h&&p,c=!!r("perspective"),f={webkittransition:"webkittransitionend",moztransition:"transitionend",otransition:"otransitionend",transition:"transitionend"}[h],d=["transform","transition","transitionduration","transitionproperty"],l=function(){for(var t={},e=0,i=d.length;i>e;e++){var n=d[e],o=r(n);o&&o!==n&&(t[n]=o)}return t}();e(a.prototype,t.prototype),a.prototype._create=function(){this._transition={ingproperties:{},clean:{},onend:{}},this.css({position:"absolute"})},a.prototype.handleevent=function(t){var e="on"+t.type;this[e]&&this[e](t)},a.prototype.getsize=function(){this.size=o(this.element)},a.prototype.css=function(t){var e=this.element.style;for(var i in t){var n=l[i]||i;e[n]=t[i]}},a.prototype.getposition=function(){var t=s(this.element),e=this.layout.options,i=e.isoriginleft,n=e.isorigintop,o=parseint(t[i?"left":"right"],10),r=parseint(t[n?"top":"bottom"],10);o=isnan(o)?0:o,r=isnan(r)?0:r;var a=this.layout.size;o-=i?a.paddingleft:a.paddingright,r-=n?a.paddingtop:a.paddingbottom,this.position.x=o,this.position.y=r},a.prototype.layoutposition=function(){var t=this.layout.size,e=this.layout.options,i={};e.isoriginleft?(i.left=this.position.x+t.paddingleft+"px",i.right=""):(i.right=this.position.x+t.paddingright+"px",i.left=""),e.isorigintop?(i.top=this.position.y+t.paddingtop+"px",i.bottom=""):(i.bottom=this.position.y+t.paddingbottom+"px",i.top=""),this.css(i),this.emitevent("layout",[this])};var y=c?function(t,e){return"translate3d("+t+"px, "+e+"px, 0)"}:function(t,e){return"translate("+t+"px, "+e+"px)"};a.prototype._transitionto=function(t,e){this.getposition();var i=this.position.x,n=this.position.y,o=parseint(t,10),r=parseint(e,10),s=o===this.position.x&&r===this.position.y;if(this.setposition(t,e),s&&!this.istransitioning)return this.layoutposition(),void 0;var a=t-i,h=e-n,p={},u=this.layout.options;a=u.isoriginleft?a:-a,h=u.isorigintop?h:-h,p.transform=y(a,h),this.transition({to:p,ontransitionend:{transform:this.layoutposition},iscleaning:!0})},a.prototype.goto=function(t,e){this.setposition(t,e),this.layoutposition()},a.prototype.moveto=u?a.prototype._transitionto:a.prototype.goto,a.prototype.setposition=function(t,e){this.position.x=parseint(t,10),this.position.y=parseint(e,10)},a.prototype._nontransition=function(t){this.css(t.to),t.iscleaning&&this._removestyles(t.to);for(var e in t.ontransitionend)t.ontransitionend[e].call(this)},a.prototype._transition=function(t){if(!parsefloat(this.layout.options.transitionduration))return this._nontransition(t),void 0;var e=this._transition;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 g=p&&n(p)+",opacity";a.prototype.enabletransition=function(){this.istransitioning||(this.css({transitionproperty:g,transitionduration:this.layout.options.transitionduration}),this.element.addeventlistener(f,this,!1))},a.prototype.transition=a.prototype[h?"_transition":"_nontransition"],a.prototype.onwebkittransitionend=function(t){this.ontransitionend(t)},a.prototype.onotransitionend=function(t){this.ontransitionend(t)};var m={"-webkit-transform":"transform","-moz-transform":"transform","-o-transform":"transform"};a.prototype.ontransitionend=function(t){if(t.target===this.element){var e=this._transition,n=m[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])}},a.prototype.disabletransition=function(){this.removetransitionstyles(),this.element.removeeventlistener(f,this,!1),this.istransitioning=!1},a.prototype._removestyles=function(t){var e={};for(var i in t)e[i]="";this.css(e)};var v={transitionproperty:"",transitionduration:""};return a.prototype.removetransitionstyles=function(){this.css(v)},a.prototype.removeelem=function(){this.element.parentnode.removechild(this.element),this.emitevent("remove",[this])},a.prototype.remove=function(){if(!h||!parsefloat(this.layout.options.transitionduration))return this.removeelem(),void 0;var t=this;this.on("transitionend",function(){return t.removeelem(),!0}),this.hide()},a.prototype.reveal=function(){delete this.ishidden,this.css({display:""});var t=this.layout.options;this.transition({from:t.hiddenstyle,to:t.visiblestyle,iscleaning:!0})},a.prototype.hide=function(){this.ishidden=!0,this.css({display:""});var t=this.layout.options;this.transition({from:t.visiblestyle,to:t.hiddenstyle,iscleaning:!0,ontransitionend:{opacity:function(){this.css({display:"none"})}}})},a.prototype.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},a}var r=document.defaultview,s=r&&r.getcomputedstyle?function(t){return r.getcomputedstyle(t,null)}:function(t){return t.currentstyle};"function"==typeof define&&define.amd?define(["eventemitter/eventemitter","get-size/get-size","get-style-property/get-style-property"],o):(t.outlayer={},t.outlayer.item=o(t.eventemitter,t.getsize,t.getstyleproperty))}(window),function(t){"use strict";function e(t,e){for(var i in e)t[i]=e[i];return t}function i(t){return"[object array]"===u.call(t)}function n(t){var e=[];if(i(t))e=t;else if(t&&"number"==typeof t.length)for(var n=0,o=t.length;o>n;n++)e.push(t[n]);else e.push(t);return e}function o(t){return t.replace(/(.)([a-z])/g,function(t,e,i){return e+"-"+i}).tolowercase()}function r(i,r,u,d,l,y){function g(t,i){if("string"==typeof t&&(t=s.queryselector(t)),!t||!c(t))return a&&a.error("bad "+this.settings.namespace+" element: "+t),void 0;this.element=t,this.options=e({},this.options),this.option(i);var n=++v;this.element.outlayerguid=n,_[n]=this,this._create(),this.options.isinitlayout&&this.layout()}function m(t,i){t.prototype[i]=e({},g.prototype[i])}var v=0,_={};return g.prototype.settings={namespace:"outlayer",item:y},g.prototype.options={containerstyle:{position:"relative"},isinitlayout:!0,isoriginleft:!0,isorigintop:!0,isresizebound:!0,transitionduration:"0.4s",hiddenstyle:{opacity:0,transform:"scale(0.001)"},visiblestyle:{opacity:1,transform:"scale(1)"}},e(g.prototype,u.prototype),g.prototype.option=function(t){e(this.options,t)},g.prototype._create=function(){this.reloaditems(),this.stamps=[],this.stamp(this.options.stamp),e(this.element.style,this.options.containerstyle),this.options.isresizebound&&this.bindresize()},g.prototype.reloaditems=function(){this.items=this._getitems(this.element.children)},g.prototype._getitems=function(t){for(var e=this._filterfinditemelements(t),i=this.settings.item,n=[],o=0,r=e.length;r>o;o++){var s=e[o],a=new i(s,this,this.options.itemoptions);n.push(a)}return n},g.prototype._filterfinditemelements=function(t){t=n(t);for(var e=this.options.itemselector,i=[],o=0,r=t.length;r>o;o++){var s=t[o];if(c(s))if(e){l(s,e)&&i.push(s);for(var a=s.queryselectorall(e),h=0,p=a.length;p>h;h++)i.push(a[h])}else i.push(s)}return i},g.prototype.getitemelements=function(){for(var t=[],e=0,i=this.items.length;i>e;e++)t.push(this.items[e].element);return t},g.prototype.layout=function(){this._resetlayout(),this._managestamps();var t=void 0!==this.options.islayoutinstant?this.options.islayoutinstant:!this._islayoutinited;this.layoutitems(this.items,t),this._islayoutinited=!0},g.prototype._init=g.prototype.layout,g.prototype._resetlayout=function(){this.getsize()},g.prototype.getsize=function(){this.size=d(this.element)},g.prototype._getmeasurement=function(t,e){var i,n=this.options[t];n?("string"==typeof n?i=this.element.queryselector(n):c(n)&&(i=n),this[t]=i?d(i)[e]:n):this[t]=0},g.prototype.layoutitems=function(t,e){t=this._getitemsforlayout(t),this._layoutitems(t,e),this._postlayout()},g.prototype._getitemsforlayout=function(t){for(var e=[],i=0,n=t.length;n>i;i++){var o=t[i];o.isignored||e.push(o)}return e},g.prototype._layoutitems=function(t,e){if(!t||!t.length)return this.emitevent("layoutcomplete",[this,t]),void 0;this._itemson(t,"layout",function(){this.emitevent("layoutcomplete",[this,t])});for(var i=[],n=0,o=t.length;o>n;n++){var r=t[n],s=this._getitemlayoutposition(r);s.item=r,s.isinstant=e,i.push(s)}this._processlayoutqueue(i)},g.prototype._getitemlayoutposition=function(){return{x:0,y:0}},g.prototype._processlayoutqueue=function(t){for(var e=0,i=t.length;i>e;e++){var n=t[e];this._positionitem(n.item,n.x,n.y,n.isinstant)}},g.prototype._positionitem=function(t,e,i,n){n?t.goto(e,i):t.moveto(e,i)},g.prototype._postlayout=function(){var t=this._getcontainersize();t&&(this._setcontainermeasure(t.width,!0),this._setcontainermeasure(t.height,!1))},g.prototype._getcontainersize=p,g.prototype._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"}},g.prototype._itemson=function(t,e,i){function n(){return o++,o===r&&i.call(s),!0}for(var o=0,r=t.length,s=this,a=0,h=t.length;h>a;a++){var p=t[a];p.on(e,n)}},g.prototype.ignore=function(t){var e=this.getitem(t);e&&(e.isignored=!0)},g.prototype.unignore=function(t){var e=this.getitem(t);e&&delete e.isignored},g.prototype.stamp=function(t){if(t=this._find(t)){this.stamps=this.stamps.concat(t);for(var e=0,i=t.length;i>e;e++){var n=t[e];this.ignore(n)}}},g.prototype.unstamp=function(t){if(t=this._find(t))for(var e=0,i=t.length;i>e;e++){var n=t[e],o=f(this.stamps,n);-1!==o&&this.stamps.splice(o,1),this.unignore(n)}},g.prototype._find=function(t){return t?("string"==typeof t&&(t=this.element.queryselectorall(t)),t=n(t)):void 0},g.prototype._managestamps=function(){if(this.stamps&&this.stamps.length){this._getboundingrect();for(var t=0,e=this.stamps.length;e>t;t++){var i=this.stamps[t];this._managestamp(i)}}},g.prototype._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)}},g.prototype._managestamp=p,g.prototype._getelementoffset=function(t){var e=t.getboundingclientrect(),i=this._boundingrect,n=d(t),o={left:e.left-i.left-n.marginleft,top:e.top-i.top-n.margintop,right:i.right-e.right-n.marginright,bottom:i.bottom-e.bottom-n.marginbottom};return o},g.prototype.handleevent=function(t){var e="on"+t.type;this[e]&&this[e](t)},g.prototype.bindresize=function(){this.isresizebound||(i.bind(t,"resize",this),this.isresizebound=!0)},g.prototype.unbindresize=function(){i.unbind(t,"resize",this),this.isresizebound=!1},g.prototype.onresize=function(){function t(){e.resize(),delete e.resizetimeout}this.resizetimeout&&cleartimeout(this.resizetimeout);var e=this;this.resizetimeout=settimeout(t,100)},g.prototype.resize=function(){var t=d(this.element),e=this.size&&t;e&&t.innerwidth===this.size.innerwidth||this.layout()},g.prototype.additems=function(t){var e=this._getitems(t);if(e.length)return this.items=this.items.concat(e),e},g.prototype.appended=function(t){var e=this.additems(t);e.length&&(this.layoutitems(e,!0),this.reveal(e))},g.prototype.prepended=function(t){var e=this._getitems(t);if(e.length){var i=this.items.slice(0);this.items=e.concat(i),this._resetlayout(),this.layoutitems(e,!0),this.reveal(e),this.layoutitems(i)}},g.prototype.reveal=function(t){if(t&&t.length)for(var e=0,i=t.length;i>e;e++){var n=t[e];n.reveal()}},g.prototype.hide=function(t){if(t&&t.length)for(var e=0,i=t.length;i>e;e++){var n=t[e];n.hide()}},g.prototype.getitem=function(t){for(var e=0,i=this.items.length;i>e;e++){var n=this.items[e];if(n.element===t)return n}},g.prototype.getitems=function(t){if(t&&t.length){for(var e=[],i=0,n=t.length;n>i;i++){var o=t[i],r=this.getitem(o);r&&e.push(r)}return e}},g.prototype.remove=function(t){t=n(t);var e=this.getitems(t);if(e&&e.length){this._itemson(e,"remove",function(){this.emitevent("removecomplete",[this,e])});for(var i=0,o=e.length;o>i;i++){var r=e[i];r.remove();var s=f(this.items,r);this.items.splice(s,1)}}},g.prototype.destroy=function(){var t=this.element.style;t.height="",t.position="",t.width="";for(var e=0,i=this.items.length;i>e;e++){var n=this.items[e];n.destroy()}this.unbindresize(),delete this.element.outlayerguid,h&&h.removedata(this.element,this.settings.namespace)},g.data=function(t){var e=t&&t.outlayerguid;return e&&_[e]},g.create=function(t,i){function n(){g.apply(this,arguments)}return e(n.prototype,g.prototype),m(n,"options"),m(n,"settings"),e(n.prototype.options,i),n.prototype.settings.namespace=t,n.data=g.data,n.item=function(){y.apply(this,arguments)},n.item.prototype=new y,n.prototype.settings.item=n.item,r(function(){for(var e=o(t),i=s.queryselectorall(".js-"+e),r="data-"+e+"-options",p=0,u=i.length;u>p;p++){var c,f=i[p],d=f.getattribute(r);try{c=d&&json.parse(d)}catch(l){a&&a.error("error parsing "+r+" on "+f.nodename.tolowercase()+(f.id?"#"+f.id:"")+": "+l);continue}var y=new n(f,c);h&&h.data(f,t,y)}}),h&&h.bridget&&h.bridget(t,n),n},g.item=y,g}var s=t.document,a=t.console,h=t.jquery,p=function(){},u=object.prototype.tostring,c="object"==typeof htmlelement?function(t){return t instanceof htmlelement}:function(t){return t&&"object"==typeof t&&1===t.nodetype&&"string"==typeof t.nodename},f=array.prototype.indexof?function(t,e){return t.indexof(e)}:function(t,e){for(var i=0,n=t.length;n>i;i++)if(t[i]===e)return i;return-1};"function"==typeof define&&define.amd?define(["eventie/eventie","doc-ready/doc-ready","eventemitter/eventemitter","get-size/get-size","matches-selector/matches-selector","./item"],r):t.outlayer=r(t.eventie,t.docready,t.eventemitter,t.getsize,t.matchesselector,t.outlayer.item)}(window),function(t){"use strict";function e(){function t(e){for(var i in t.defaults)this[i]=t.defaults[i];for(i in e)this[i]=e[i]}return i.rect=t,t.defaults={x:0,y:0,width:0,height:0},t.prototype.contains=function(t){var e=t.width||0,i=t.height||0;return this.x<=t.x&&this.y<=t.y&&this.x+this.width>=t.x+e&&this.y+this.height>=t.y+i},t.prototype.overlaps=function(t){var e=this.x+this.width,i=this.y+this.height,n=t.x+t.width,o=t.y+t.height;return n>this.x&&e>t.x&&o>this.y&&i>t.y},t.prototype.getmaximalfreerects=function(e){if(!this.overlaps(e))return!1;var i,n=[],o=this.x+this.width,r=this.y+this.height,s=e.x+e.width,a=e.y+e.height;return this.ys&&(i=new t({x:s,y:this.y,width:o-s,height:this.height}),n.push(i)),r>a&&(i=new t({x:this.x,y:a,width:this.width,height:r-a}),n.push(i)),this.x=t.width&&this.height>=t.height},t}var i=t.packery=function(){};"function"==typeof define&&define.amd?define(e):(t.packery=t.packery||{},t.packery.rect=e())}(window),function(t){"use strict";function e(t){function e(t,e){this.width=t||0,this.height=e||0,this.reset()}return e.prototype.reset=function(){this.spaces=[],this.newspaces=[];var e=new t({x:0,y:0,width:this.width,height:this.height});this.spaces.push(e)},e.prototype.pack=function(t){for(var e=0,i=this.spaces.length;i>e;e++){var n=this.spaces[e];if(n.canfit(t)){this.placeinspace(t,n);break}}},e.prototype.placeinspace=function(t,e){t.x=e.x,t.y=e.y,this.placed(t)},e.prototype.placed=function(t){for(var i=[],n=0,o=this.spaces.length;o>n;n++){var r=this.spaces[n],s=r.getmaximalfreerects(t);s?i.push.apply(i,s):i.push(r)}this.spaces=i,e.mergerects(this.spaces),this.spaces.sort(e.spacesortertopleft)},e.mergerects=function(t){for(var e=0,i=t.length;i>e;e++){var n=t[e];if(n){var o=t.slice(0);o.splice(e,1);for(var r=0,s=0,a=o.length;a>s;s++){var h=o[s],p=e>s?0:1;n.contains(h)&&(t.splice(s+p-r,1),r++)}}}return t},e.spacesortertopleft=function(t,e){return t.y-e.y||t.x-e.x},e.spacesorterlefttop=function(t,e){return t.x-e.x||t.y-e.y},e}if("function"==typeof define&&define.amd)define(["./rect"],e);else{var i=t.packery=t.packery||{};i.packer=e(i.rect)}}(window),function(t){"use strict";function e(t,e,i){var n=t("transform"),o=function(){e.item.apply(this,arguments)};o.prototype=new e.item;var r=o.prototype._create;return o.prototype._create=function(){r.call(this),this.rect=new i,this.placerect=new i},o.prototype.dragstart=function(){this.getposition(),this.removetransitionstyles(),this.istransitioning&&n&&(this.element.style[n]="none"),this.getsize(),this.isplacing=!0,this.needspositioning=!1,this.positionplacerect(this.position.x,this.position.y),this.istransitioning=!1,this.diddrag=!1},o.prototype.dragmove=function(t,e){this.diddrag=!0;var i=this.layout.size;t-=i.paddingleft,e-=i.paddingtop,this.positionplacerect(t,e)},o.prototype.dragstop=function(){this.getposition();var t=this.position.x!==this.placerect.x,e=this.position.y!==this.placerect.y;this.needspositioning=t||e,this.diddrag=!1},o.prototype.positionplacerect=function(t,e,i){this.placerect.x=this.getplacerectcoord(t,!0),this.placerect.y=this.getplacerectcoord(e,!1,i)},o.prototype.getplacerectcoord=function(t,e,i){var n=e?"width":"height",o=this.size["outer"+n],r=this.layout[e?"columnwidth":"rowheight"],s=this.layout.size["inner"+n];e||(s=math.max(s,this.layout.maxy),this.layout.rowheight||(s-=this.layout.gutter));var a;if(r){r+=this.layout.gutter,s+=e?this.layout.gutter:0,t=math.round(t/r);var h=math[e?"floor":"ceil"](s/r);h-=math.ceil(o/r),a=h}else a=s-o;return t=i?t:math.min(t,a),t*=r||1,math.max(0,t)},o.prototype.copyplacerectposition=function(){this.rect.x=this.placerect.x,this.rect.y=this.placerect.y},o}"function"==typeof define&&define.amd?define(["get-style-property/get-style-property","outlayer/outlayer","./rect"],e):t.packery.item=e(t.getstyleproperty,t.outlayer,t.packery.rect)}(window),function(t){"use strict";function e(t,e,i,n,o,r){var s=i.create("packery");return s.item=s.prototype.settings.item=r,s.prototype._create=function(){i.prototype._create.call(this),this.packer=new o,this.stamp(this.options.stamped);var t=this;this.handledraggabilly={dragstart:function(e){t.itemdragstart(e.element)},dragmove:function(e){t.itemdragmove(e.element,e.position.x,e.position.y)},dragend:function(e){t.itemdragend(e.element)}},this.handleuidraggable={start:function(e){t.itemdragstart(e.currenttarget)},drag:function(e,i){t.itemdragmove(e.currenttarget,i.position.left,i.position.top)},stop:function(e){t.itemdragend(e.currenttarget)}}},s.prototype._resetlayout=function(){this.getsize(),this._getmeasurements(),this.packer.width=this.size.innerwidth+this.gutter,this.packer.height=number.positive_infinity,this.packer.reset(),this.maxy=0},s.prototype._getmeasurements=function(){this._getmeasurement("columnwidth","width"),this._getmeasurement("rowheight","height"),this._getmeasurement("gutter","width")},s.prototype._getitemlayoutposition=function(t){return this._packitem(t),t.rect},s.prototype._packitem=function(t){this._setrectsize(t.element,t.rect),this.packer.pack(t.rect),this._setmaxy(t.rect)},s.prototype._setmaxy=function(t){this.maxy=math.max(t.y+t.height,this.maxy)},s.prototype._setrectsize=function(t,i){var n=e(t),o=n.outerwidth,r=n.outerheight,s=this.columnwidth+this.gutter,a=this.rowheight+this.gutter;o=this.columnwidth?math.ceil(o/s)*s:o+this.gutter,r=this.rowheight?math.ceil(r/a)*a:r+this.gutter,i.width=math.min(o,this.packer.width),i.height=r},s.prototype._getcontainersize=function(){return{height:this.maxy-this.gutter}},s.prototype._managestamp=function(t){var e,i=this.getitem(t);if(i&&i.isplacing)e=i.placerect;else{var o=this._getelementoffset(t);e=new n({x:o.left,y:o.top})}this._setrectsize(t,e),this.packer.placed(e),this._setmaxy(e)},s.prototype.sortitemsbyposition=function(){this.items.sort(function(t,e){return t.position.y-e.position.y||t.position.x-e.position.x})},s.prototype.fit=function(t,e,i){var n=this.getitem(t);n&&(this._getmeasurements(),this.stamp(n.element),n.getsize(),n.isplacing=!0,e=void 0===e?n.rect.x:e,i=void 0===i?n.rect.y:i,n.positionplacerect(e,i,!0),this._bindfitevents(n),n.moveto(n.placerect.x,n.placerect.y),this.layout(),this.unstamp(n.element),this.sortitemsbyposition(),n.isplacing=!1,n.copyplacerectposition())},s.prototype._bindfitevents=function(t){function e(){n++,2===n&&i.emitevent("fitcomplete",[i,t])}var i=this,n=0;t.on("layout",function(){return e(),!0}),this.on("layoutcomplete",function(){return e(),!0})},s.prototype.itemdragstart=function(t){this.stamp(t);var e=this.getitem(t);e&&e.dragstart()},s.prototype.itemdragmove=function(t,e,i){function n(){r.layout(),delete r.dragtimeout}var o=this.getitem(t);o&&o.dragmove(e,i);var r=this;this.cleardragtimeout(),this.dragtimeout=settimeout(n,40)},s.prototype.cleardragtimeout=function(){this.dragtimeout&&cleartimeout(this.dragtimeout)},s.prototype.itemdragend=function(e){var i,n=this.getitem(e);if(n&&(i=n.diddrag,n.dragstop()),!n||!i&&!n.needspositioning)return this.unstamp(e),void 0;t.add(n.element,"is-positioning-post-drag");var o=this._getdragendlayoutcomplete(e,n);n.needspositioning?(n.on("layout",o),n.moveto(n.placerect.x,n.placerect.y)):n&&n.copyplacerectposition(),this.cleardragtimeout(),this.on("layoutcomplete",o),this.layout()},s.prototype._getdragendlayoutcomplete=function(e,i){var n=i&&i.needspositioning,o=0,r=n?2:1,s=this;return function(){return o++,o!==r?!0:(i&&(t.remove(i.element,"is-positioning-post-drag"),i.isplacing=!1,i.copyplacerectposition()),s.unstamp(e),s.sortitemsbyposition(),n&&s.emitevent("dragitempositioned",[s,i]),!0)}},s.prototype.binddraggabillyevents=function(t){t.on("dragstart",this.handledraggabilly.dragstart),t.on("dragmove",this.handledraggabilly.dragmove),t.on("dragend",this.handledraggabilly.dragend)},s.prototype.binduidraggableevents=function(t){t.on("dragstart",this.handleuidraggable.start).on("drag",this.handleuidraggable.drag).on("dragstop",this.handleuidraggable.stop)},s.rect=n,s.packer=o,s}"function"==typeof define&&define.amd?define(["classie/classie","get-size/get-size","outlayer/outlayer","./rect","./packer","./item"],e):t.packery=e(t.classie,t.getsize,t.outlayer,t.packery.rect,t.packery.packer,t.packery.item)}(window);