mirror of
https://github.com/rileyjshaw/terra.git
synced 2024-11-21 04:54:23 +00:00
1 line
18 KiB
JavaScript
Executable File
1 line
18 KiB
JavaScript
Executable File
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.terra=t()}}(function(){var t;return function e(t,n,r){function o(u,a){if(!n[u]){if(!t[u]){var c="function"==typeof require&&require;if(!a&&c)return c(u,!0);if(i)return i(u,!0);var f=new Error("Cannot find module '"+u+"'");throw f.code="MODULE_NOT_FOUND",f}var s=n[u]={exports:{}};t[u][0].call(s.exports,function(e){var n=t[u][1][e];return o(n?n:e)},s,s.exports,e,t,n,r)}return n[u].exports}for(var i="function"==typeof require&&require,u=0;u<r.length;u++)o(r[u]);return o}({1:[function(t,e){var n=t("./terrarium.js"),r=t("./creature.js");e.exports={Terrarium:n,creatureFactory:r}},{"./creature.js":2,"./terrarium.js":5}],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.efficiency=.7,t.prototype.size=50,t.prototype.actionRadius=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,u=r.make(this.type),a=function(){return this.energy-=this.initialEnergy,!0}.bind(this),c=this.wait;return{x:i.x,y:i.y,creature:u,successFn:a,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,u=function(){var t=o.creature.energy*this.efficiency;return this.energy=this.energy+(t||-10),!1}.bind(this);return{x:i.x,y:i.y,creature:e,successFn:u}}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;if("string"==typeof i&&"undefined"==typeof e[i]){e[i]="function"==typeof o?function(){this.energy=this.initialEnergy,o.call(this)}:function(){this.energy=this.initialEnergy};var u=r.color;return("object"!=typeof u||3!==u.length)&&(r.color=[n.random(255),n.random(255),n.random(255)]),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}return!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=u.createCanvasElement(t*r,e*r,n,o),this.nextFrame=!1}var r=t("./util"),o=t("./creature.js"),i=t("./display.js"),u=t("./dom.js");n.prototype.populate=function(t,e){function n(t,e){var n=t+e[1];return!i&&n>u&&(i=o.make(e[0])),n}var i,u=0;e||(e=this.grid);for(var a=this.width;a--;)if(e[a]=[],t)for(var c=this.height;c--;)i=!1,u=r.random(99,!0),r.reduce(t,n,0),e[a].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:h[t.x][t.y]}}function i(t){var e=t.creature;e?(e.failureFn(),e.boundEnergy()):(t.wait(),t.boundEnergy())}function u(t,e,n){if(t){var u=r.map(r.getNeighborCoords(e,n,p-1,y-1,t.actionRadius),o),a=t.queue(u);if(a){var c=l[a.x];c[a.y]||(c[a.y]=[]),c[a.y].push({x:e,y:n,creature:a.creature})}else i(t)}}function a(t,e){r.each(t,function(t,n){u(t,e,n)})}function c(t,e,n){if(t){var o=t.splice(r.random(t.length-1),1)[0],u=o.creature;u.successFn()===!1&&(s[o.x][o.y]=!1),u.boundEnergy(),s[e][n]=u,r.each(t,i)}}function f(t,e){r.each(t,function(t,n){c(t,e,n)})}var s,l,p=this.width,y=this.height,h=this.grid;for("number"!=typeof t&&(t=1);t--;)h=s?r.clone(s):this.grid,s=r.map(h,n),l=[],this.populate(!1,l),r.each(s,a),r.each(l,f);return s},n.prototype.draw=function(){i(this.canvas,this.grid,this.cellSize)},n.prototype.animate=function(t,e){function n(){o.grid=o.step(),o.draw(),r++!==t?o.nextFrame=requestAnimationFrame(n):(o.nextFrame=!1,e())}if(!this.nextFrame){var r=0,o=this;o.nextFrame=requestAnimationFrame(n)}},n.prototype.stop=function(){cancelAnimationFrame(this.nextFrame),this.nextFrame=!1},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,u,a,c,f=[];("number"!=typeof o||1>o)&&(o=1),i=Math.max(0,t-o),a=Math.max(0,e-o),u=Math.min(t+o,n),c=Math.min(e+o,r);for(var s=i;u>=s;s++)for(var l=a;c>=l;l++)(s!==t||l!==e)&&f.push({x:s,y:l});return f},e.exports=n},{"../bower_components/seedrandom/seedrandom.js":7,"../lodash_custom/lodash.custom.min.js":8}],7:[function(e,n){!function(t,e,n,r,o,i,u,a,c){function f(t){var e,n=t.length,o=this,i=0,u=o.i=o.j=0,a=o.S=[];for(n||(t=[n++]);r>i;)a[i]=i++;for(i=0;r>i;i++)a[i]=a[u=v&u+t[i%n]+(e=a[i])],a[u]=e;(o.g=function(t){for(var e,n=0,i=o.i,u=o.j,a=o.S;t--;)e=a[i=v&i+1],n=n*r+a[v&(a[i]=a[u=v&u+e])+(a[u]=e)];return o.i=i,o.j=u,n})(r)}function s(t,e){var n,r=[],o=typeof t;if(e&&"object"==o)for(n in t)try{r.push(s(t[n],e-1))}catch(i){}return r.length?r:"string"==o?t:t+"\x00"}function l(t,e){for(var n,r=t+"",o=0;o<r.length;)e[v&o]=v&(n^=19*e[v&o])+r.charCodeAt(o++);return y(e)}function p(n){try{return t.crypto.getRandomValues(n=new Uint8Array(r)),y(n)}catch(o){return[+new Date,t,(n=t.navigator)&&n.plugins,t.screen,y(e)]}}function y(t){return String.fromCharCode.apply(0,t)}var h=n.pow(r,o),g=n.pow(2,i),d=2*g,v=r-1,m=n["seed"+c]=function(t,i,u){var a=[];i=1==i?{entropy:!0}:i||{};var v=l(s(i.entropy?[t,y(e)]:null==t?p():t,3),a),m=new f(a);return l(y(m.S),e),(i.pass||u||function(t,e,r){return r?(n[c]=t,e):t})(function(){for(var t=m.g(o),e=h,n=0;g>t;)t=(t+n)*r,e*=r,n=m.g(1);for(;t>=d;)t/=2,e/=2,n>>>=1;return(t+n)/e},v,"global"in i?i.global:this==n)};l(n[c](),e),u&&u.exports?u.exports=m:a&&a.amd&&a(function(){return m})}(this,[],Math,256,6,52,"object"==typeof n&&n,"function"==typeof t&&t,"random")},{}],8:[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<D&&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 u(){}function a(t){function e(){if(r){var t=i(r);fe.apply(t,arguments)}if(this instanceof e){var u=f(n.prototype),t=n.apply(u,t||arguments);return m(t)?t:u}return n.apply(o,t||arguments)}var n=t[0],r=t[2],o=t[4];return je(e,t),e}function c(t,e,n,u,a){if(n){var f=n(t);if("undefined"!=typeof f)return f}if(!m(t))return t;var s=oe.call(t);if(!J[s]||!xe.nodeClass&&r(t))return t;var l=me[s];switch(s){case M:case I:return new l(+t);case $:case G:return new l(t);case U:return f=l(t.source,R.exec(t)),f.lastIndex=t.lastIndex,f}if(s=we(t),e){var p=!u;u||(u=A.pop()||[]),a||(a=A.pop()||[]);for(var y=u.length;y--;)if(u[y]==t)return a[y];f=s?l(t.length):{}}else f=s?i(t):Oe({},t);return s&&(ce.call(t,"index")&&(f.index=t.index),ce.call(t,"input")&&(f.input=t.input)),e?(u.push(t),a.push(f),(s?Se:ke)(t,function(t,r){f[r]=c(t,e,n,u,a)}),p&&(o(u),o(a)),f):f}function f(t){return m(t)?ye(t):{}}function s(t,e,n){if("function"!=typeof t)return S;if("undefined"==typeof e||!("prototype"in t))return t;var r=t.__bindData__;if("undefined"==typeof r&&(xe.funcNames&&(r=!t.name),r=r||!xe.funcDecomp,!r)){var o=ae.call(t);xe.funcNames||(r=!B.test(o)),r||(r=N.test(o),je(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 _(t,e)}function l(t){function e(){var t=s?a:this;if(o){var d=i(o);fe.apply(d,arguments)}return(u||y)&&(d||(d=i(arguments)),u&&fe.apply(d,u),y&&d.length<c)?(r|=16,l([n,h?r:-4&r,d,null,a,c])):(d||(d=arguments),p&&(n=t[g]),this instanceof e?(t=f(n.prototype),d=n.apply(t,d),m(d)?d:t):n.apply(t,d))}var n=t[0],r=t[1],o=t[2],u=t[3],a=t[4],c=t[5],s=1&r,p=2&r,y=4&r,h=8&r,g=n;return je(e,t),e}function p(t,e,n,i,u,a){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&&Q[typeof t]||e&&Q[typeof e]))return!1;if(null==t||null==e)return t===e;var f=oe.call(t),s=oe.call(e);if(f==z&&(f=K),s==z&&(s=K),f!=s)return!1;switch(f){case M:case I:return+t==+e;case $:return t!=+t?e!=+e:0==t?1/t==1/e:t==+e;case U:case G:return t==e+""}if(s=f==L,!s){var l=ce.call(t,"__wrapped__"),y=ce.call(e,"__wrapped__");if(l||y)return p(l?t.__wrapped__:t,y?e.__wrapped__:e,n,i,u,a);if(f!=K||!xe.nodeClass&&(r(t)||r(e)))return!1;if(f=!xe.argsObject&&d(t)?Object:t.constructor,l=!xe.argsObject&&d(e)?Object:e.constructor,f!=l&&!(v(f)&&f instanceof f&&v(l)&&l instanceof l)&&"constructor"in t&&"constructor"in e)return!1}for(f=!u,u||(u=A.pop()||[]),a||(a=A.pop()||[]),l=u.length;l--;)if(u[l]==t)return a[l]==e;var h=0,c=!0;if(u.push(t),a.push(e),s){if(l=t.length,h=e.length,(c=h==l)||i)for(;h--;)if(s=l,y=e[h],i)for(;s--&&!(c=p(t[s],y,n,i,u,a)););else if(!(c=p(t[h],y,n,i,u,a)))break}else Ce(e,function(e,r,o){return ce.call(o,r)?(h++,c=ce.call(t,r)&&p(t[r],e,n,i,u,a)):void 0}),c&&!i&&Ce(t,function(t,e,n){return ce.call(n,e)?c=-1<--h:void 0});return u.pop(),a.pop(),f&&(o(u),o(a)),c}function y(t,e,n,r,o,u){var c=1&e,f=4&e,s=16&e,p=32&e;if(!(2&e||v(t)))throw new TypeError;s&&!n.length&&(e&=-17,s=n=!1),p&&!r.length&&(e&=-33,p=r=!1);var h=t&&t.__bindData__;return h&&!0!==h?(h=i(h),h[2]&&(h[2]=i(h[2])),h[3]&&(h[3]=i(h[3])),!c||1&h[1]||(h[4]=o),!c&&1&h[1]&&(e|=8),!f||4&h[1]||(h[5]=u),s&&fe.apply(h[2]||(h[2]=[]),n),p&&le.apply(h[3]||(h[3]=[]),r),h[1]|=e,y.apply(null,h)):(1==e||17===e?a:l)([t,e,n,r,o,u])}function h(){H.h=q,H.b=H.c=H.g=H.i="",H.e="t",H.j=!0;for(var t,e=0;t=arguments[e];e++)for(var n in t)H[n]=t[n];e=H.a,H.d=/^[^,]+/.exec(e)[0],t=Function,e="return function("+e+"){",n=H;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+"){",xe.unindexedChars&&(r+="if(s(t)){t=t.split('')}"),r+="while(++n<u){"+n.g+";}}else{"):xe.nonEnumArgs&&(r+="var u=t.length;n=-1;if(u&&p(t)){while(++n<u){n+='';"+n.g+";}}else{"),xe.enumPrototypes&&(r+="var G=typeof t=='function';"),xe.enumErrorProps&&(r+="var F=t===k||t instanceof Error;");var o=[];if(xe.enumPrototypes&&o.push('!(G&&n=="prototype")'),xe.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+="}",xe.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||xe.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+"}")(s,T,ee,ce,P,d,we,b,H.f,ne,Q,be,G,re,oe)}function g(t){return"function"==typeof t&&ie.test(t)}function d(t){return t&&"object"==typeof t&&"number"==typeof t.length&&oe.call(t)==z||!1}function v(t){return"function"==typeof t}function m(t){return!(!t||!Q[typeof t])}function b(t){return"string"==typeof t||t&&"object"==typeof t&&oe.call(t)==G||!1}function x(t,e,n){var r=[];if(e=u.createCallback(e,n,3),we(t)){n=-1;for(var o=t.length;++n<o;){var i=t[n];e(i,n,t)&&r.push(i)}}else Se(t,function(t,n,o){e(t,n,o)&&r.push(t)});return r}function j(t,e,n){if(e&&"undefined"==typeof n&&we(t)){n=-1;for(var r=t.length;++n<r&&!1!==e(t[n],n,t););}else Se(t,e,n);return t}function w(t,e,n){var r=-1,o=t?t.length:0,i=Array("number"==typeof o?o:0);if(e=u.createCallback(e,n,3),we(t))for(;++r<o;)i[r]=e(t[r],r,t);else Se(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=u.createCallback(e,r,4),we(t)){var i=-1,a=t.length;for(o&&(n=t[++i]);++i<a;)n=e(n,t[i],i,t)}else Se(t,function(t,r,i){n=o?(o=!1,t):e(n,t,r,i)});return n}function F(t,e,n){var r;if(e=u.createCallback(e,n,3),we(t)){n=-1;for(var o=t.length;++n<o&&!(r=e(t[n],n,t)););}else Se(t,function(t,n,o){return!(r=e(t,n,o))});return!!r}function _(t,e){return 2<arguments.length?y(t,17,i(arguments,2),null,e):y(t,1,null,null,e)}function S(t){return t}function O(){}function C(t){return function(e){return e[t]}}var A=[],P={},D=40,R=/\w*$/,B=/^\s*function[ \n\r\t]+\w/,N=/\bthis\b/,q="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),z="[object Arguments]",L="[object Array]",M="[object Boolean]",I="[object Date]",T="[object Error]",$="[object Number]",K="[object Object]",U="[object RegExp]",G="[object String]",J={"[object Function]":!1};J[z]=J[L]=J[M]=J[I]=J[$]=J[K]=J[U]=J[G]=!0;var V={configurable:!1,enumerable:!1,value:null,writable:!1},H={a:"",b:null,c:"",d:"",e:"",v:null,g:"",h:null,support:null,i:"",j:!1},Q={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},W=Q[typeof window]&&window||this,X=Q[typeof n]&&n&&!n.nodeType&&n,Y=Q[typeof e]&&e&&!e.nodeType&&e,Z=Q[typeof t]&&t;!Z||Z.global!==Z&&Z.window!==Z||(W=Z);var te=[],ee=Error.prototype,ne=Object.prototype,re=String.prototype,oe=ne.toString,ie=RegExp("^"+(oe+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),ue=Math.floor,ae=Function.prototype.toString,ce=ne.hasOwnProperty,fe=te.push,se=ne.propertyIsEnumerable,le=te.unshift,pe=function(){try{var t={},e=g(e=Object.defineProperty)&&e,n=e(t,t,t)&&e}catch(r){}return n}(),ye=g(ye=Object.create)&&ye,he=g(he=Array.isArray)&&he,ge=g(ge=Object.keys)&&ge,de=Math.min,ve=Math.random,me={};me[L]=Array,me[M]=Boolean,me[I]=Date,me["[object Function]"]=Function,me[K]=Object,me[$]=Number,me[U]=RegExp,me[G]=String;var be={};be[L]=be[I]=be[$]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},be[M]=be[G]={constructor:!0,toString:!0,valueOf:!0},be[T]=be["[object Function]"]=be[U]={constructor:!0,toString:!0},be[K]={constructor:!0},function(){for(var t=q.length;t--;){var e,n=q[t];for(e in be)ce.call(be,e)&&!ce.call(be[e],n)&&(be[e][n]=!1)}}();var xe=u.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);xe.argsClass=oe.call(arguments)==z,xe.argsObject=arguments.constructor==Object&&!(arguments instanceof Array),xe.enumErrorProps=se.call(ee,"message")||se.call(ee,"name"),xe.enumPrototypes=se.call(t,"prototype"),xe.funcDecomp=!g(W.k)&&N.test(function(){return this}),xe.funcNames="string"==typeof Function.name,xe.nonEnumArgs=0!=r,xe.nonEnumShadows=!/valueOf/.test(n),xe.spliceObjects=(te.splice.call(e,0,1),!e[0]),xe.unindexedChars="xx"!="x"[0]+Object("x")[0];try{xe.nodeClass=!(oe.call(document)==K&&!({toString:0}+""))}catch(o){xe.nodeClass=!0}}(1),ye||(f=function(){function t(){}return function(e){if(m(e)){t.prototype=e;var n=new t;t.prototype=null}return n||W.Object()}}());var je=pe?function(t,e){V.value=e,pe(t,"__bindData__",V)}:O;xe.argsClass||(d=function(t){return t&&"object"==typeof t&&"number"==typeof t.length&&ce.call(t,"callee")&&!se.call(t,"callee")||!1});var we=he||function(t){return t&&"object"==typeof t&&"number"==typeof t.length&&oe.call(t)==L||!1},Ee=h({a:"z",e:"[]",i:"if(!(B[typeof z]))return E",g:"E.push(n)"}),Fe=ge?function(t){return m(t)?xe.enumPrototypes&&"function"==typeof t||xe.nonEnumArgs&&t.length&&d(t)?Ee(t):ge(t):[]}:Ee,Z={a:"g,e,K",i:"e=e&&typeof K=='undefined'?e:d(e,K,3)",b:"typeof u=='number'",v:Fe,g:"if(e(t[n],n,g)===false)return E"},he={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:Fe,g:"if(typeof E[n]=='undefined')E[n]=t[n]",c:"}}"},_e={i:"if(!B[typeof t])return E;"+Z.i,b:!1},Se=h(Z),Oe=h(he,{i:he.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]"}),Ce=h(Z,_e,{j:!1}),ke=h(Z,_e);v(/x/)&&(v=function(t){return"function"==typeof t&&"[object Function]"==oe.call(t)}),u.assign=Oe,u.bind=_,u.createCallback=function(t,e,n){var r=typeof t;if(null==t||"function"==r)return s(t,e,n);if("object"!=r)return C(t);var o=Fe(t),i=o[0],u=t[i];return 1!=o.length||u!==u||m(u)?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],u===t&&(0!==u||1/u==1/t)}},u.filter=x,u.forEach=j,u.forIn=Ce,u.forOwn=ke,u.keys=Fe,u.map=w,u.property=C,u.collect=w,u.each=j,u.extend=Oe,u.select=x,u.clone=function(t,e,n,r){return"boolean"!=typeof e&&null!=e&&(r=n,n=e,e=!1),c(t,e,"function"==typeof n&&s(n,r,1))},u.identity=S,u.isArguments=d,u.isArray=we,u.isFunction=v,u.isObject=m,u.isString=b,u.noop=O,u.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=ve(),de(t+n*(e-t+parseFloat("1e-"+((n+"").length-1))),e)):t+ue(ve()*(e-t+1))},u.reduce=E,u.some=F,u.any=F,u.foldl=E,u.inject=E,u.VERSION="2.4.1",X&&Y&&(X._=u)}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}); |