terra/terra.demo.min.js
2014-08-17 00:25:33 -04:00

1 line
24 KiB
JavaScript
Executable File

!function t(e,n,r){function o(a,u){if(!n[a]){if(!e[a]){var c="function"==typeof require&&require;if(!u&&c)return c(a,!0);if(i)return i(a,!0);var s=new Error("Cannot find module '"+a+"'");throw s.code="MODULE_NOT_FOUND",s}var l=n[a]={exports:{}};e[a][0].call(l.exports,function(t){var n=e[a][1][t];return o(n?n:t)},l,l.exports,t,e,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(t){function e(){document.body.className=document.body.scrollTop>=o?"sticky":""}function n(t,e){var n=function(){setTimeout(function(){t(),requestAnimationFrame(n)},1e3/e)};requestAnimationFrame(n)}var r=t("../../app/terrarium.js");t("./bugs.js"),t("../../bower_components/smooth-scroll.js/dist/js/bind-polyfill.min.js"),t("../../bower_components/smooth-scroll.js/dist/js/smooth-scroll.min.js").init({offset:60});var o=window.innerHeight,i=document.documentElement.clientWidth,a=Math.ceil(o/20),u=Math.ceil(i/20),c=new r(u,a,"topTerrarium",20,document.getElementById("header"));c.canvas.style.top=c.canvas.style.left="50%",c.canvas.style.marginTop=-10*a+"px",c.canvas.style.marginLeft=-10*u+"px",c.populate([["plant",50],["wimp",10],["bully",5]]);var s=new r(25,25,"golTerrarium",10,document.getElementById("gol"));s.populate([["GoL",100]]),c.draw(),s.draw(),n(function(){c.grid=c.step(),c.draw(),s.grid=s.step(),s.draw()},1e3),document.addEventListener("scroll",e)},{"../../app/terrarium.js":5,"../../bower_components/smooth-scroll.js/dist/js/bind-polyfill.min.js":8,"../../bower_components/smooth-scroll.js/dist/js/smooth-scroll.min.js":9,"./bugs.js":10}],2:[function(t,e){var n=t("./util.js"),r=function(){function t(){this.age=0}t.prototype.initialEnergy=50,t.prototype.maxEnergy=100,t.prototype.metabolism=.7,t.prototype.size=50,t.prototype.speed=1,t.prototype.vision=1,t.prototype.sustainability=2,t.prototype.reproduceLv=.7,t.prototype.moveLv=.2,t.prototype.boundEnergy=function(){this.energy>this.maxEnergy&&(this.energy=this.maxEnergy)},t.prototype.isDead=function(){return this.energy<=0},t.prototype.reproduce=function(t){var e=n.filter(t,function(t){return!t.creature});if(e.length){var o=e[n.random(e.length-1)],i=o.coords,a=r.make(this.type),u=function(){return this.energy-=this.initialEnergy,!0}.bind(this),c=this.wait;return{x:i.x,y:i.y,creature:a,successFn:u,failureFn:c}}return!1},t.prototype.move=function(t){var e=this,r=n.filter(t,function(t){return t.creature.size<this.size}.bind(this));if(r.length<this.sustainability&&(r=n.filter(t,function(t){return!t.creature})),r.length){var o=r[n.random(r.length-1)],i=o.coords,a=function(){var t=o.creature.energy*this.metabolism;return this.energy=this.energy+(t||-10),!1}.bind(this);return{x:i.x,y:i.y,creature:e,successFn:a}}return!1},t.prototype.wait=function(){return this.energy-=5,!0},t.prototype.queue=function(t){{var e={};this.maxEnergy}this.energy>this.maxEnergy*this.reproduceLv&&this.reproduce?e=this.reproduce(t):this.energy>this.moveLv&&this.move&&(e=this.move(t));var n=e.creature;return n?(n.successFn=e.successFn||n.wait,n.failureFn=e.failureFn||n.wait,{x:e.x,y:e.y,creature:n}):!1};var e={};return{make:function(t,n){var r=e[t];return r?new r(n):!1},register:function(r,o){var i=r.type,a=r.color;return"string"==typeof i&&"undefined"==typeof e[i]&&"object"==typeof a&&3===a.length?(e[i]="function"==typeof o?function(){this.energy=this.initialEnergy,o.call(this)}:function(){this.energy=this.initialEnergy},e[i].prototype=new t,e[i].prototype.constructor=e[i],n.each(r,function(t,n){e[i].prototype[n]=t}),e[i].prototype.successFn=e[i].wait,e[i].prototype.failureFn=e[i].wait,e[i].prototype.energy=r.initialEnergy,!0):!1}}}();e.exports=r},{"./util.js":6}],3:[function(t,e){var n=t("./util.js");e.exports=function(t,e,r){var o=t.getContext("2d");o.font="bold "+r+"px Arial",o.clearRect(0,0,t.width,t.height),n.each(e,function(t,e){n.each(t,function(t,n){if(t){var i=t.colorFn?t.colorFn():t.color+","+t.energy/t.maxEnergy;o.fillStyle="rgba("+i+")",t.character?o.fillText(t.character,e*r,n*r+r):o.fillRect(e*r,n*r,r,r)}})})}},{"./util.js":6}],4:[function(t,e){var n=function(t,e,n,r){function o(r){var o=document.createElement("canvas");return r=function(){var t=document.createElement("canvas").getContext("2d"),e=window.devicePixelRatio||1,n=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return e/n}(),o.width=t*r,o.height=e*r,o.style.width=t+"px",o.style.height=e+"px",o.getContext("2d").setTransform(r,0,0,r,0,0),o.id=n,o}var i=o();return r?r.parentNode.insertBefore(i,r.nextSibling):document.body.appendChild(i),i};e.exports={createCanvasElement:n}},{}],5:[function(t,e){function n(t,e,n,r,o){this.width=t,this.height=e,this.cellSize=r||10,this.grid=[],this.canvas=a.createCanvasElement(t*r,e*r,n,o)}var r=t("./util"),o=t("./creature.js"),i=t("./display.js"),a=t("./dom.js");n.prototype.populate=function(t,e){function n(t,e){var n=t+e[1];return!i&&n>a&&(i=o.make(e[0])),n}var i,a=0;e||(e=this.grid);for(var u=this.width;u--;)if(e[u]=[],t)for(var c=this.height;c--;)i=!1,a=r.random(99,!0),r.reduce(t,n,0),e[u].push(i)},n.prototype.step=function(t){function e(t){if(t){var e=r.assign(new t.constructor,t);return e.isDead()?!1:e}return!1}function n(t){return r.map(t,e)}function o(t){return{coords:t,creature:y[t.x][t.y]}}function i(t){var e=t.creature;e?(e.failureFn(),e.boundEnergy()):(t.wait(),t.boundEnergy())}function a(t,e,n){if(t){var a=r.map(r.getNeighborCoords(e,n,p-1,h-1,t.vision),o),u=t.queue(a);if(u){var c=f[u.x];c[u.y]||(c[u.y]=[]),c[u.y].push({x:e,y:n,creature:u.creature})}else i(t)}}function u(t,e){r.each(t,function(t,n){a(t,e,n)})}function c(t,e,n){if(t){var o=t.splice(r.random(t.length-1),1)[0],a=o.creature;a.successFn()===!1&&(l[o.x][o.y]=!1),a.boundEnergy(),l[e][n]=a,r.each(t,i)}}function s(t,e){r.each(t,function(t,n){c(t,e,n)})}var l,f,p=this.width,h=this.height,y=this.grid;for("number"!=typeof t&&(t=1);t--;)y=l?r.clone(l):this.grid,l=r.map(y,n),f=[],this.populate(!1,f),r.each(l,u),r.each(f,s);return l},n.prototype.draw=function(){i(this.canvas,this.grid,this.cellSize)},e.exports=n},{"./creature.js":2,"./display.js":3,"./dom.js":4,"./util":6}],6:[function(t,e){t("../bower_components/seedrandom/seedrandom.js")("terra",{global:!0});var n=t("../lodash_custom/lodash.custom.min.js")._;n.getNeighborCoords=function(t,e,n,r,o){var i,a,u,c,s=[];("number"!=typeof o||1>o)&&(o=1),i=Math.max(0,t-o),u=Math.max(0,e-o),a=Math.min(t+o,n),c=Math.min(e+o,r);for(var l=i;a>=l;l++)for(var f=u;c>=f;f++)(l!==t||f!==e)&&s.push({x:l,y:f});return s},e.exports=n},{"../bower_components/seedrandom/seedrandom.js":7,"../lodash_custom/lodash.custom.min.js":11}],7:[function(t,e){!function(t,e,n,r,o,i,a,u,c){function s(t){var e,n=t.length,o=this,i=0,a=o.i=o.j=0,u=o.S=[];for(n||(t=[n++]);r>i;)u[i]=i++;for(i=0;r>i;i++)u[i]=u[a=m&a+t[i%n]+(e=u[i])],u[a]=e;(o.g=function(t){for(var e,n=0,i=o.i,a=o.j,u=o.S;t--;)e=u[i=m&i+1],n=n*r+u[m&(u[i]=u[a=m&a+e])+(u[a]=e)];return o.i=i,o.j=a,n})(r)}function l(t,e){var n,r=[],o=typeof t;if(e&&"object"==o)for(n in t)try{r.push(l(t[n],e-1))}catch(i){}return r.length?r:"string"==o?t:t+"\x00"}function f(t,e){for(var n,r=t+"",o=0;o<r.length;)e[m&o]=m&(n^=19*e[m&o])+r.charCodeAt(o++);return h(e)}function p(n){try{return t.crypto.getRandomValues(n=new Uint8Array(r)),h(n)}catch(o){return[+new Date,t,(n=t.navigator)&&n.plugins,t.screen,h(e)]}}function h(t){return String.fromCharCode.apply(0,t)}var y=n.pow(r,o),d=n.pow(2,i),g=2*d,m=r-1,v=n["seed"+c]=function(t,i,a){var u=[];i=1==i?{entropy:!0}:i||{};var m=f(l(i.entropy?[t,h(e)]:null==t?p():t,3),u),v=new s(u);return f(h(v.S),e),(i.pass||a||function(t,e,r){return r?(n[c]=t,e):t})(function(){for(var t=v.g(o),e=y,n=0;d>t;)t=(t+n)*r,e*=r,n=v.g(1);for(;t>=g;)t/=2,e/=2,n>>>=1;return(t+n)/e},m,"global"in i?i.global:this==n)};f(n[c](),e),a&&a.exports?a.exports=v:u&&u.amd&&u(function(){return v})}(this,[],Math,256,6,52,"object"==typeof e&&e,"function"==typeof define&&define,"random")},{}],8:[function(){Function.prototype.bind||(Function.prototype.bind=function(t){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var e=Array.prototype.slice.call(arguments,1),n=this;return fNOP=function(){},fBound=function(){return n.apply(this instanceof fNOP&&t?this:t,e.concat(Array.prototype.slice.call(arguments)))},fNOP.prototype=this.prototype,fBound.prototype=new fNOP,fBound})},{}],9:[function(t,e,n){!function(t,r){"function"==typeof define&&define.amd?define("smoothScroll",r(t)):"object"==typeof n?e.exports=r(t):t.smoothScroll=r(t)}(this,function(t){"use strict";var e,n={},r=!!document.querySelector&&!!t.addEventListener,o={speed:500,easing:"easeInOutCubic",offset:0,updateURL:!0,callbackBefore:function(){},callbackAfter:function(){}},i=function(t,e,n){if("[object Object]"===Object.prototype.toString.call(t))for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.call(n,t[r],r,t);else for(var o=0,i=t.length;i>o;o++)e.call(n,t[o],o,t)},a=function(t,e){var n={};return i(t,function(e,r){n[r]=t[r]}),i(e,function(t,r){n[r]=e[r]}),n},u=function(t){for(var e,n=String(t),r=n.length,o=-1,i="",a=n.charCodeAt(0);++o<r;){if(e=n.charCodeAt(o),0===e)throw new InvalidCharacterError("Invalid character: the input contains U+0000.");i+=e>=1&&31>=e||127==e||0===o&&e>=48&&57>=e||1===o&&e>=48&&57>=e&&45===a?"\\"+e.toString(16)+" ":e>=128||45===e||95===e||e>=48&&57>=e||e>=65&&90>=e||e>=97&&122>=e?n.charAt(o):"\\"+n.charAt(o)}return i},c=function(t,e){var n;return"easeInQuad"===t&&(n=e*e),"easeOutQuad"===t&&(n=e*(2-e)),"easeInOutQuad"===t&&(n=.5>e?2*e*e:-1+(4-2*e)*e),"easeInCubic"===t&&(n=e*e*e),"easeOutCubic"===t&&(n=--e*e*e+1),"easeInOutCubic"===t&&(n=.5>e?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1),"easeInQuart"===t&&(n=e*e*e*e),"easeOutQuart"===t&&(n=1- --e*e*e*e),"easeInOutQuart"===t&&(n=.5>e?8*e*e*e*e:1-8*--e*e*e*e),"easeInQuint"===t&&(n=e*e*e*e*e),"easeOutQuint"===t&&(n=1+--e*e*e*e*e),"easeInOutQuint"===t&&(n=.5>e?16*e*e*e*e*e:1+16*--e*e*e*e*e),n||e},s=function(t,e,n){var r=0;if(t.offsetParent)do r+=t.offsetTop,t=t.offsetParent;while(t);return r=r-e-n,r>=0?r:0},l=function(){return Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight)},f=function(t){return t&&"object"==typeof JSON&&"function"==typeof JSON.parse?JSON.parse(t):{}},p=function(t,e){history.pushState&&(e||"true"===e)&&history.pushState({pos:t.id},"",window.location.pathname+t)};return n.animateScroll=function(e,n,r,i){var h=a(h||o,r||{}),y=f(e?e.getAttribute("data-options"):null);h=a(h,y),n="#"+u(n.substr(1));var d,g,m,v=document.querySelector("[data-scroll-header]"),b=null===v?0:v.offsetHeight+v.offsetTop,j=t.pageYOffset,w=s(document.querySelector(n),b,parseInt(h.offset,10)),x=w-j,E=l(),O=0;e&&"a"===e.tagName.toLowerCase()&&i&&i.preventDefault(),p(n,h.updateURL);var S=function(r,o,i){var a=t.pageYOffset;(r==o||a==o||t.innerHeight+a>=E)&&(clearInterval(i),h.callbackAfter(e,n))},_=function(){O+=16,g=O/parseInt(h.speed,10),g=g>1?1:g,m=j+x*c(h.easing,g),t.scrollTo(0,Math.floor(m)),S(m,w,d)},C=function(){h.callbackBefore(e,n),d=setInterval(_,16)};0===t.pageYOffset&&t.scrollTo(0,0),C()},n.init=function(t){if(r){e=a(o,t||{});var u=document.querySelectorAll("[data-scroll]");i(u,function(t){t.addEventListener("click",n.animateScroll.bind(null,t,t.hash,e),!1)})}},n})},{}],10:[function(t){var e=t("../../app/creature.js"),n=t("../../app/util.js");e.register({type:"plant",color:[0,120,0],size:10,initialEnergy:5,maxEnergy:20,wait:function(){this.energy+=1},move:!1,reproduceLv:.65}),e.register({type:"wimp",color:[0,255,255],size:20,maxEnergy:50,initialEnergy:10}),e.register({type:"bully",color:[255,200,0],size:30,maxEnergy:50,initialEnergy:10,reproduceLv:.6,moveLv:0,metabolism:1,sustainability:3}),e.register({type:"GoL",color:[255,193,7],colorFn:function(){return this.alive?this.color+",1":"0,0,0,0"},wait:function(){},isDead:function(){return!1},queue:function(t){var e=n.filter(t,function(t){return t.creature.alive}).length;return this.alive=3===e||2===e&&this.alive,!1}},function(){this.alive=Math.random()<.5}),e.register({type:"cyclic",color:[0,0,0],colors:["255,0,0,1","255,217,0,1","72,255,0,1","0,255,145,1","0,145,255,1","72,0,255,1","255,0,217,1"],colorFn:function(){return this.colors[this.state]},wait:function(){},isDead:function(){return!1},queue:function(t){var e=(this.state+1)%7,r=n.some(t,function(t){return t.creature.state===e});r&&(this.state=e)}},function(){this.state=Math.floor(7*Math.random())})},{"../../app/creature.js":2,"../../app/util.js":6}],11:[function(t,e,n){(function(t){(function(){function r(t){return"function"!=typeof t.toString&&"string"==typeof(t+"")}function o(t){t.length=0,A.length<P&&A.push(t)}function i(t,e){var n;e||(e=0),"undefined"==typeof n&&(n=t?t.length:0);var r=-1;n=n-e||0;for(var o=Array(0>n?0:n);++r<n;)o[r]=t[e+r];return o}function a(){}function u(t){function e(){if(r){var t=i(r);se.apply(t,arguments)}if(this instanceof e){var a=s(n.prototype),t=n.apply(a,t||arguments);return v(t)?t:a}return n.apply(o,t||arguments)}var n=t[0],r=t[2],o=t[4];return we(e,t),e}function c(t,e,n,a,u){if(n){var s=n(t);if("undefined"!=typeof s)return s}if(!v(t))return t;var l=oe.call(t);if(!G[l]||!je.nodeClass&&r(t))return t;var f=ve[l];switch(l){case q:case R:return new f(+t);case H:case J:return new f(t);case U:return s=f(t.source,L.exec(t)),s.lastIndex=t.lastIndex,s}if(l=xe(t),e){var p=!a;a||(a=A.pop()||[]),u||(u=A.pop()||[]);for(var h=a.length;h--;)if(a[h]==t)return u[h];s=l?f(t.length):{}}else s=l?i(t):Ce({},t);return l&&(ce.call(t,"index")&&(s.index=t.index),ce.call(t,"input")&&(s.input=t.input)),e?(a.push(t),u.push(s),(l?_e:Ae)(t,function(t,r){s[r]=c(t,e,n,a,u)}),p&&(o(a),o(u)),s):s}function s(t){return v(t)?he(t):{}}function l(t,e,n){if("function"!=typeof t)return _;if("undefined"==typeof e||!("prototype"in t))return t;var r=t.__bindData__;if("undefined"==typeof r&&(je.funcNames&&(r=!t.name),r=r||!je.funcDecomp,!r)){var o=ue.call(t);je.funcNames||(r=!N.test(o)),r||(r=B.test(o),we(t,r))}if(!1===r||!0!==r&&1&r[1])return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)};case 4:return function(n,r,o,i){return t.call(e,n,r,o,i)}}return S(t,e)}function f(t){function e(){var t=l?u:this;if(o){var g=i(o);se.apply(g,arguments)}return(a||h)&&(g||(g=i(arguments)),a&&se.apply(g,a),h&&g.length<c)?(r|=16,f([n,y?r:-4&r,g,null,u,c])):(g||(g=arguments),p&&(n=t[d]),this instanceof e?(t=s(n.prototype),g=n.apply(t,g),v(g)?g:t):n.apply(t,g))}var n=t[0],r=t[1],o=t[2],a=t[3],u=t[4],c=t[5],l=1&r,p=2&r,h=4&r,y=8&r,d=n;return we(e,t),e}function p(t,e,n,i,a,u){if(n){var c=n(t,e);if("undefined"!=typeof c)return!!c}if(t===e)return 0!==t||1/t==1/e;if(t===t&&!(t&&Y[typeof t]||e&&Y[typeof e]))return!1;if(null==t||null==e)return t===e;var s=oe.call(t),l=oe.call(e);if(s==M&&(s=Q),l==M&&(l=Q),s!=l)return!1;switch(s){case q:case R:return+t==+e;case H:return t!=+t?e!=+e:0==t?1/t==1/e:t==+e;case U:case J:return t==e+""}if(l=s==T,!l){var f=ce.call(t,"__wrapped__"),h=ce.call(e,"__wrapped__");if(f||h)return p(f?t.__wrapped__:t,h?e.__wrapped__:e,n,i,a,u);if(s!=Q||!je.nodeClass&&(r(t)||r(e)))return!1;if(s=!je.argsObject&&g(t)?Object:t.constructor,f=!je.argsObject&&g(e)?Object:e.constructor,s!=f&&!(m(s)&&s instanceof s&&m(f)&&f instanceof f)&&"constructor"in t&&"constructor"in e)return!1}for(s=!a,a||(a=A.pop()||[]),u||(u=A.pop()||[]),f=a.length;f--;)if(a[f]==t)return u[f]==e;var y=0,c=!0;if(a.push(t),u.push(e),l){if(f=t.length,y=e.length,(c=y==f)||i)for(;y--;)if(l=f,h=e[y],i)for(;l--&&!(c=p(t[l],h,n,i,a,u)););else if(!(c=p(t[y],h,n,i,a,u)))break}else Fe(e,function(e,r,o){return ce.call(o,r)?(y++,c=ce.call(t,r)&&p(t[r],e,n,i,a,u)):void 0}),c&&!i&&Fe(t,function(t,e,n){return ce.call(n,e)?c=-1<--y:void 0});return a.pop(),u.pop(),s&&(o(a),o(u)),c}function h(t,e,n,r,o,a){var c=1&e,s=4&e,l=16&e,p=32&e;if(!(2&e||m(t)))throw new TypeError;l&&!n.length&&(e&=-17,l=n=!1),p&&!r.length&&(e&=-33,p=r=!1);var y=t&&t.__bindData__;return y&&!0!==y?(y=i(y),y[2]&&(y[2]=i(y[2])),y[3]&&(y[3]=i(y[3])),!c||1&y[1]||(y[4]=o),!c&&1&y[1]&&(e|=8),!s||4&y[1]||(y[5]=a),l&&se.apply(y[2]||(y[2]=[]),n),p&&fe.apply(y[3]||(y[3]=[]),r),y[1]|=e,h.apply(null,y)):(1==e||17===e?u:f)([t,e,n,r,o,a])}function y(){K.h=D,K.b=K.c=K.g=K.i="",K.e="t",K.j=!0;for(var t,e=0;t=arguments[e];e++)for(var n in t)K[n]=t[n];e=K.a,K.d=/^[^,]+/.exec(e)[0],t=Function,e="return function("+e+"){",n=K;var r="var n,t="+n.d+",E="+n.e+";if(!t)return E;"+n.i+";";n.b?(r+="var u=t.length;n=-1;if("+n.b+"){",je.unindexedChars&&(r+="if(s(t)){t=t.split('')}"),r+="while(++n<u){"+n.g+";}}else{"):je.nonEnumArgs&&(r+="var u=t.length;n=-1;if(u&&p(t)){while(++n<u){n+='';"+n.g+";}}else{"),je.enumPrototypes&&(r+="var G=typeof t=='function';"),je.enumErrorProps&&(r+="var F=t===k||t instanceof Error;");var o=[];if(je.enumPrototypes&&o.push('!(G&&n=="prototype")'),je.enumErrorProps&&o.push('!(F&&(n=="message"||n=="name"))'),n.j&&n.f)r+="var C=-1,D=B[typeof t]&&v(t),u=D?D.length:0;while(++C<u){n=D[C];",o.length&&(r+="if("+o.join("&&")+"){"),r+=n.g+";",o.length&&(r+="}"),r+="}";else if(r+="for(n in t){",n.j&&o.push("m.call(t, n)"),o.length&&(r+="if("+o.join("&&")+"){"),r+=n.g+";",o.length&&(r+="}"),r+="}",je.nonEnumShadows){for(r+="if(t!==A){var i=t.constructor,r=t===(i&&i.prototype),f=t===J?I:t===k?j:L.call(t),x=y[f];",k=0;7>k;k++)r+="n='"+n.h[k]+"';if((!(r&&x[n])&&m.call(t,n))",n.j||(r+="||(!x[n]&&t[n]!==A[n])"),r+="){"+n.g+"}";r+="}"}return(n.b||je.nonEnumArgs)&&(r+="}"),r+=n.c+";return E",t("d,j,k,m,o,p,q,s,v,A,B,y,I,J,L",e+r+"}")(l,z,ee,ce,I,g,xe,b,K.f,ne,Y,be,J,re,oe)}function d(t){return"function"==typeof t&&ie.test(t)}function g(t){return t&&"object"==typeof t&&"number"==typeof t.length&&oe.call(t)==M||!1}function m(t){return"function"==typeof t}function v(t){return!(!t||!Y[typeof t])}function b(t){return"string"==typeof t||t&&"object"==typeof t&&oe.call(t)==J||!1}function j(t,e,n){var r=[];if(e=a.createCallback(e,n,3),xe(t)){n=-1;for(var o=t.length;++n<o;){var i=t[n];e(i,n,t)&&r.push(i)}}else _e(t,function(t,n,o){e(t,n,o)&&r.push(t)});return r}function w(t,e,n){if(e&&"undefined"==typeof n&&xe(t)){n=-1;for(var r=t.length;++n<r&&!1!==e(t[n],n,t););}else _e(t,e,n);return t}function x(t,e,n){var r=-1,o=t?t.length:0,i=Array("number"==typeof o?o:0);if(e=a.createCallback(e,n,3),xe(t))for(;++r<o;)i[r]=e(t[r],r,t);else _e(t,function(t,n,o){i[++r]=e(t,n,o)});return i}function E(t,e,n,r){var o=3>arguments.length;if(e=a.createCallback(e,r,4),xe(t)){var i=-1,u=t.length;for(o&&(n=t[++i]);++i<u;)n=e(n,t[i],i,t)}else _e(t,function(t,r,i){n=o?(o=!1,t):e(n,t,r,i)});return n}function O(t,e,n){var r;if(e=a.createCallback(e,n,3),xe(t)){n=-1;for(var o=t.length;++n<o&&!(r=e(t[n],n,t)););}else _e(t,function(t,n,o){return!(r=e(t,n,o))});return!!r}function S(t,e){return 2<arguments.length?h(t,17,i(arguments,2),null,e):h(t,1,null,null,e)}function _(t){return t}function C(){}function F(t){return function(e){return e[t]}}var A=[],I={},P=40,L=/\w*$/,N=/^\s*function[ \n\r\t]+\w/,B=/\bthis\b/,D="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),M="[object Arguments]",T="[object Array]",q="[object Boolean]",R="[object Date]",z="[object Error]",H="[object Number]",Q="[object Object]",U="[object RegExp]",J="[object String]",G={"[object Function]":!1};G[M]=G[T]=G[q]=G[R]=G[H]=G[Q]=G[U]=G[J]=!0;var $={configurable:!1,enumerable:!1,value:null,writable:!1},K={a:"",b:null,c:"",d:"",e:"",v:null,g:"",h:null,support:null,i:"",j:!1},Y={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},V=Y[typeof window]&&window||this,W=Y[typeof n]&&n&&!n.nodeType&&n,X=Y[typeof e]&&e&&!e.nodeType&&e,Z=Y[typeof t]&&t;!Z||Z.global!==Z&&Z.window!==Z||(V=Z);var te=[],ee=Error.prototype,ne=Object.prototype,re=String.prototype,oe=ne.toString,ie=RegExp("^"+(oe+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),ae=Math.floor,ue=Function.prototype.toString,ce=ne.hasOwnProperty,se=te.push,le=ne.propertyIsEnumerable,fe=te.unshift,pe=function(){try{var t={},e=d(e=Object.defineProperty)&&e,n=e(t,t,t)&&e}catch(r){}return n}(),he=d(he=Object.create)&&he,ye=d(ye=Array.isArray)&&ye,de=d(de=Object.keys)&&de,ge=Math.min,me=Math.random,ve={};ve[T]=Array,ve[q]=Boolean,ve[R]=Date,ve["[object Function]"]=Function,ve[Q]=Object,ve[H]=Number,ve[U]=RegExp,ve[J]=String;var be={};be[T]=be[R]=be[H]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},be[q]=be[J]={constructor:!0,toString:!0,valueOf:!0},be[z]=be["[object Function]"]=be[U]={constructor:!0,toString:!0},be[Q]={constructor:!0},function(){for(var t=D.length;t--;){var e,n=D[t];for(e in be)ce.call(be,e)&&!ce.call(be[e],n)&&(be[e][n]=!1)}}();var je=a.support={};!function(){function t(){this.x=1}var e={0:1,length:1},n=[];t.prototype={valueOf:1,y:1};for(var r in new t)n.push(r);for(r in arguments);je.argsClass=oe.call(arguments)==M,je.argsObject=arguments.constructor==Object&&!(arguments instanceof Array),je.enumErrorProps=le.call(ee,"message")||le.call(ee,"name"),je.enumPrototypes=le.call(t,"prototype"),je.funcDecomp=!d(V.k)&&B.test(function(){return this}),je.funcNames="string"==typeof Function.name,je.nonEnumArgs=0!=r,je.nonEnumShadows=!/valueOf/.test(n),je.spliceObjects=(te.splice.call(e,0,1),!e[0]),je.unindexedChars="xx"!="x"[0]+Object("x")[0];try{je.nodeClass=!(oe.call(document)==Q&&!({toString:0}+""))}catch(o){je.nodeClass=!0}}(1),he||(s=function(){function t(){}return function(e){if(v(e)){t.prototype=e;var n=new t;t.prototype=null}return n||V.Object()}}());var we=pe?function(t,e){$.value=e,pe(t,"__bindData__",$)}:C;je.argsClass||(g=function(t){return t&&"object"==typeof t&&"number"==typeof t.length&&ce.call(t,"callee")&&!le.call(t,"callee")||!1});var xe=ye||function(t){return t&&"object"==typeof t&&"number"==typeof t.length&&oe.call(t)==T||!1},Ee=y({a:"z",e:"[]",i:"if(!(B[typeof z]))return E",g:"E.push(n)"}),Oe=de?function(t){return v(t)?je.enumPrototypes&&"function"==typeof t||je.nonEnumArgs&&t.length&&g(t)?Ee(t):de(t):[]}:Ee,Z={a:"g,e,K",i:"e=e&&typeof K=='undefined'?e:d(e,K,3)",b:"typeof u=='number'",v:Oe,g:"if(e(t[n],n,g)===false)return E"},ye={a:"z,H,l",i:"var a=arguments,b=0,c=typeof l=='number'?2:a.length;while(++b<c){t=a[b];if(t&&B[typeof t]){",v:Oe,g:"if(typeof E[n]=='undefined')E[n]=t[n]",c:"}}"},Se={i:"if(!B[typeof t])return E;"+Z.i,b:!1},_e=y(Z),Ce=y(ye,{i:ye.i.replace(";",";if(c>3&&typeof a[c-2]=='function'){var e=d(a[--c-1],a[c--],2)}else if(c>2&&typeof a[c-1]=='function'){e=a[--c]}"),g:"E[n]=e?e(E[n],t[n]):t[n]"}),Fe=y(Z,Se,{j:!1}),Ae=y(Z,Se);m(/x/)&&(m=function(t){return"function"==typeof t&&"[object Function]"==oe.call(t)}),a.assign=Ce,a.bind=S,a.createCallback=function(t,e,n){var r=typeof t;if(null==t||"function"==r)return l(t,e,n);if("object"!=r)return F(t);var o=Oe(t),i=o[0],a=t[i];return 1!=o.length||a!==a||v(a)?function(e){for(var n=o.length,r=!1;n--&&(r=p(e[o[n]],t[o[n]],null,!0)););return r}:function(t){return t=t[i],a===t&&(0!==a||1/a==1/t)}},a.filter=j,a.forEach=w,a.forIn=Fe,a.forOwn=Ae,a.keys=Oe,a.map=x,a.property=F,a.collect=x,a.each=w,a.extend=Ce,a.select=j,a.clone=function(t,e,n,r){return"boolean"!=typeof e&&null!=e&&(r=n,n=e,e=!1),c(t,e,"function"==typeof n&&l(n,r,1))},a.identity=_,a.isArguments=g,a.isArray=xe,a.isFunction=m,a.isObject=v,a.isString=b,a.noop=C,a.random=function(t,e,n){var r=null==t,o=null==e;return null==n&&("boolean"==typeof t&&o?(n=t,t=1):o||"boolean"!=typeof e||(n=e,o=!0)),r&&o&&(e=1),t=+t||0,o?(e=t,t=0):e=+e||0,n||t%1||e%1?(n=me(),ge(t+n*(e-t+parseFloat("1e-"+((n+"").length-1))),e)):t+ae(me()*(e-t+1))},a.reduce=E,a.some=O,a.any=O,a.foldl=E,a.inject=E,a.VERSION="2.4.1",W&&X&&(W._=a)}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1]);