Bundled output for commit 67744f4856 [skip ci]

This commit is contained in:
Gandalf-the-Bot 2016-08-16 21:11:34 +00:00
parent 67744f4856
commit 5cf616515d
2 changed files with 9 additions and 9 deletions

14
mithril.min.js vendored
View file

@ -1,9 +1,9 @@
new function(){function n(b,e,B,f,k,h){return{tag:b,key:e,attrs:B,children:f,text:k,dom:h,domSize:void 0,state:{},events:void 0,instance:void 0}}var A=console.error.bind(console),A=console.error.bind(console),K=function(b){function e(){function a(){0<arguments.length&&arguments[0]!==D&&f(a,arguments[0],void 0);return a._state.value}B(a,arguments);0<arguments.length&&arguments[0]!==D&&f(a,arguments[0],void 0);return a}function B(a,c){a.constructor=e;a._state={id:N++,value:void 0,error:void 0,state:0,
derive:void 0,recover:void 0,deps:{},parents:[],errorStream:void 0,endStream:void 0};a.map=O;a.ap=A;a.of=e;a.valueOf=u;a.toJSON=C;a.toString=u;a.run=g;a["catch"]=l;Object.defineProperties(a,{error:{get:function(){if(!a._state.errorStream){var c=function(){0<arguments.length&&arguments[0]!==D&&f(a,void 0,arguments[0]);return a._state.error};B(c,[]);z(c,[a],J,J);a._state.errorStream=c}return a._state.errorStream}},end:{get:function(){if(!a._state.endStream){var c=e();c.map(function(d){!0===d&&(t(a),
t(c));return d});a._state.endStream=c}return a._state.endStream}}})}function f(a,c,d){k(a,c,d);for(var g in a._state.deps)p(a._state.deps[g],!1);a._state.changed=!1;for(var b in a._state.deps)a._state.deps[b]._state.changed=!1}function k(a,c,d){d=q(c,d);if(void 0!==d&&"function"===typeof a._state.recover){if(!r(a,h,!0))return}else h(a,c,d);a._state.changed=!0;2!==a._state.state&&(a._state.state=1)}function h(a,c,d){a._state.value=c;a._state.error=d}function p(a,g){var b=a._state.parents;0<b.length&&
b.filter(F).length===b.length&&(g||0<b.filter(c).length)&&(b=b.filter(d),0<b.length?k(a,void 0,b[0]._state.error):r(a,k,!1))}function r(a,c,d){try{var g=d?a._state.recover():a._state.derive();if(g===D)return!1;c(a,g,void 0)}catch(b){c(a,void 0,null!=b.__error?b.__error:b),null==b.__error&&v(a,b)}return!0}function q(a,c){null!=a&&a.constructor===e&&(c=void 0!==a._state.error?a._state.error:q(a._state.value,a._state.error));return c}function v(a,c){0===Object.keys(a._state.deps).length&&setTimeout(function(){0===
Object.keys(a._state.deps).length&&b(c)},0)}function g(a){var c=e(),d=this;return z(c,[d],function(){return m(c,a(d()))},void 0)}function l(a){var c=e(),d=this;return z(c,[d],function(){return d._state.value},function(){return m(c,a(d._state.error))})}function y(a,g){return z(e(),g,function(){var b=g.filter(d);if(0<b.length)throw{__error:b[0]._state.error};return a.apply(this,g.concat([g.filter(c)]))},void 0)}function m(a,c){if(null!=c&&c.constructor===e){var d=c,g=function(){k(a,d._state.value,d._state.error);
for(var c in a._state.deps)p(a._state.deps[c],!1)};d.map(g)["catch"](function(a){g();throw{__error:a};});if(0===d._state.state)return D;if(d._state.error)throw{__error:d._state.error};c=d._state.value}return c}function z(c,d,g,b){var e=c._state;e.derive=g;e.recover=b;e.parents=d.filter(a);n(c,e.parents);p(c,!0);return c}function n(a,c){for(var d=0;d<c.length;d++)c[d]._state.deps[a._state.id]=a,n(a,c[d]._state.parents)}function t(a){for(var c=0;c<a._state.parents.length;c++)delete a._state.parents[c]._state.deps[a._state.id];
new function(){function n(b,e,B,f,k,h){return{tag:b,key:e,attrs:B,children:f,text:k,dom:h,domSize:void 0,state:{},events:void 0,instance:void 0,skip:!1}}var A=console.error.bind(console),A=console.error.bind(console),K=function(b){function e(){function a(){0<arguments.length&&arguments[0]!==D&&f(a,arguments[0],void 0);return a._state.value}B(a,arguments);0<arguments.length&&arguments[0]!==D&&f(a,arguments[0],void 0);return a}function B(a,c){a.constructor=e;a._state={id:N++,value:void 0,error:void 0,
state:0,derive:void 0,recover:void 0,deps:{},parents:[],errorStream:void 0,endStream:void 0};a.map=O;a.ap=A;a.of=e;a.valueOf=u;a.toJSON=C;a.toString=u;a.run=g;a["catch"]=l;Object.defineProperties(a,{error:{get:function(){if(!a._state.errorStream){var c=function(){0<arguments.length&&arguments[0]!==D&&f(a,void 0,arguments[0]);return a._state.error};B(c,[]);z(c,[a],J,J);a._state.errorStream=c}return a._state.errorStream}},end:{get:function(){if(!a._state.endStream){var c=e();c.map(function(d){!0===
d&&(t(a),t(c));return d});a._state.endStream=c}return a._state.endStream}}})}function f(a,c,d){k(a,c,d);for(var g in a._state.deps)p(a._state.deps[g],!1);a._state.changed=!1;for(var b in a._state.deps)a._state.deps[b]._state.changed=!1}function k(a,c,d){d=q(c,d);if(void 0!==d&&"function"===typeof a._state.recover){if(!r(a,h,!0))return}else h(a,c,d);a._state.changed=!0;2!==a._state.state&&(a._state.state=1)}function h(a,c,d){a._state.value=c;a._state.error=d}function p(a,g){var b=a._state.parents;
0<b.length&&b.filter(F).length===b.length&&(g||0<b.filter(c).length)&&(b=b.filter(d),0<b.length?k(a,void 0,b[0]._state.error):r(a,k,!1))}function r(a,c,d){try{var g=d?a._state.recover():a._state.derive();if(g===D)return!1;c(a,g,void 0)}catch(b){c(a,void 0,null!=b.__error?b.__error:b),null==b.__error&&v(a,b)}return!0}function q(a,c){null!=a&&a.constructor===e&&(c=void 0!==a._state.error?a._state.error:q(a._state.value,a._state.error));return c}function v(a,c){0===Object.keys(a._state.deps).length&&
setTimeout(function(){0===Object.keys(a._state.deps).length&&b(c)},0)}function g(a){var c=e(),d=this;return z(c,[d],function(){return m(c,a(d()))},void 0)}function l(a){var c=e(),d=this;return z(c,[d],function(){return d._state.value},function(){return m(c,a(d._state.error))})}function y(a,g){return z(e(),g,function(){var b=g.filter(d);if(0<b.length)throw{__error:b[0]._state.error};return a.apply(this,g.concat([g.filter(c)]))},void 0)}function m(a,c){if(null!=c&&c.constructor===e){var d=c,g=function(){k(a,
d._state.value,d._state.error);for(var c in a._state.deps)p(a._state.deps[c],!1)};d.map(g)["catch"](function(a){g();throw{__error:a};});if(0===d._state.state)return D;if(d._state.error)throw{__error:d._state.error};c=d._state.value}return c}function z(c,d,g,b){var e=c._state;e.derive=g;e.recover=b;e.parents=d.filter(a);n(c,e.parents);p(c,!0);return c}function n(a,c){for(var d=0;d<c.length;d++)c[d]._state.deps[a._state.id]=a,n(a,c[d]._state.parents)}function t(a){for(var c=0;c<a._state.parents.length;c++)delete a._state.parents[c]._state.deps[a._state.id];
for(var d in a._state.deps){var c=a._state.deps[d],g=c._state.parents.indexOf(a);-1<g&&c._state.parents.splice(g,1)}a._state.state=2;a._state.deps={}}function O(a){return y(function(c){return a(c())},[this])}function A(a){return y(function(a,c){return a()(c())},[this,a])}function u(){return this._state.value}function C(){return null!=this._state.value&&"function"===typeof this._state.value.toJSON?this._state.value.toJSON():this._state.value}function F(a){return 1===a._state.state}function c(a){return a._state.changed}
function a(a){return 2!==a._state.state}function d(a){return a._state.error}var N=0,J=function(){},D={};return{stream:e,merge:function(a){return y(function(){return a.map(function(a){return a()})},a)},combine:y,reject:function(a){var c=e();c.error(a);return c},HALT:D}},t=K(A),C=t.stream;C.combine=t.combine;C.reject=t.reject;C.merge=t.merge;C.HALT=t.HALT;n.normalize=function(b){return b instanceof Array?n("[",void 0,void 0,n.normalizeChildren(b),void 0,void 0):null!=b&&"object"!==typeof b?n("#",void 0,
void 0,b,void 0,void 0):b};n.normalizeChildren=function(b){for(var e=0;e<b.length;e++)b[e]=n.normalize(b[e]);return b};var P=/(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g,G={},t=function(b){if(null==b||"string"!==typeof b&&null==b.view)throw Error("The selector must be either a string or a component.");if("string"===typeof b&&void 0===G[b]){for(var e,B,f=[],k={};e=P.exec(b);){var h=e[1],p=e[2];""===h&&""!==p?B=p:"#"===h?k.id=p:"."===h?f.push(p):"["===e[3][0]&&((h=
@ -19,7 +19,7 @@ a,d,b,e,l,v){var z=a.tag;if(z===d.tag){d.state=a.state;d.events=a.events;var r;v
(a.dom.nodeValue=d.children);d.dom=a.dom;break;case "<":a.children!==d.children?(p(a),q(c,f(d),e)):(d.dom=a.dom,d.domSize=a.domSize);break;case "[":k(c,a.children,d.children,b,e,v);a=0;b=d.children;d.dom=null;if(null!=b){for(var x=0;x<b.length;x++)c=b[x],null!=c&&null!=c.dom&&(null==d.dom&&(d.dom=c.dom),a+=c.domSize||1);1!==a&&(d.domSize=a)}break;default:c=v;e=d.dom=a.dom;switch(d.tag){case "svg":c="http://www.w3.org/2000/svg";break;case "math":c="http://www.w3.org/1998/Math/MathML"}"textarea"===
d.tag&&(null==d.attrs&&(d.attrs={}),null!=d.text&&(d.attrs.value=d.text));l=a.attrs;v=d.attrs;z=c;if(null!=v)for(x in v)y(d,x,l&&l[x],v[x],z);if(null!=l)for(x in l)null!=v&&x in v||("o"!==x[0]||"n"!==x[1]||m(x)?"key"!==x&&d.dom.removeAttribute(x):t(d,x,void 0));null!=a.text&&null!=d.text&&""!==d.text?a.text.toString()!==d.text.toString()&&(a.dom.firstChild.nodeValue=d.text):(null!=a.text&&(a.children=[n("#",void 0,void 0,a.text,void 0,a.dom.firstChild)]),null!=d.text&&(d.children=[n("#",void 0,void 0,
d.text,void 0,void 0)]),k(e,a.children,d.children,b,null,c))}else d.instance=n.normalize(d.tag.view.call(d.state,d)),A(d.tag,d,b,l),null!=d.instance?(null==a.instance?q(c,B(d.instance,b,v),e):h(c,a.instance,d.instance,b,e,l,v),d.dom=d.instance.dom,d.domSize=d.instance.domSize):null!=a.instance?(g(c,a.instance,null,!1),d.dom=void 0,d.domSize=0):(d.dom=a.dom,d.domSize=a.domSize)}else g(c,a,null,!1),q(c,B(d,b,void 0),e)}function p(c){var a=c.domSize;if(null!=a||null==c.dom){var d=u.createDocumentFragment();
if(0<a){for(c=c.dom;--a;)d.appendChild(c.nextSibling);d.insertBefore(c,d.firstChild)}return d}return c.dom}function r(c,a,d){for(;a<c.length;a++)if(null!=c[a]&&null!=c[a].dom)return c[a].dom;return d}function q(c,a,d){d&&d.parentNode?c.insertBefore(a,d):c.appendChild(a)}function v(c,a,d,b,e){for(;d<b;d++){var l=a[d];null!=l&&(l.skip?l.skip=void 0:g(c,l,e,!1))}}function g(c,a,d,b){if(!1===b){var e=0,m=0;b=function(){++m===e&&g(c,a,d,!0)};a.attrs&&a.attrs.onbeforeremove&&(e++,a.attrs.onbeforeremove.call(a.state,
if(0<a){for(c=c.dom;--a;)d.appendChild(c.nextSibling);d.insertBefore(c,d.firstChild)}return d}return c.dom}function r(c,a,d){for(;a<c.length;a++)if(null!=c[a]&&null!=c[a].dom)return c[a].dom;return d}function q(c,a,d){d&&d.parentNode?c.insertBefore(a,d):c.appendChild(a)}function v(c,a,d,b,e){for(;d<b;d++){var l=a[d];null!=l&&(l.skip?l.skip=!1:g(c,l,e,!1))}}function g(c,a,d,b){if(!1===b){var e=0,m=0;b=function(){++m===e&&g(c,a,d,!0)};a.attrs&&a.attrs.onbeforeremove&&(e++,a.attrs.onbeforeremove.call(a.state,
a,b));"string"!==typeof a.tag&&a.tag.onbeforeremove&&(e++,a.tag.onbeforeremove.call(a.state,a,b));if(0<e)return}l(a);if(a.dom){b=a.domSize||1;if(1<b)for(var f=a.dom;--b;)c.removeChild(f.nextSibling);null!=a.dom.parentNode&&c.removeChild(a.dom);null==d||null!=a.domSize||z(a.attrs)||"string"!==typeof a.tag||(d.pool?d.pool.push(a):d.pool=[a])}}function l(c){c.attrs&&c.attrs.onremove&&c.attrs.onremove.call(c.state,c);"string"!==typeof c.tag&&c.tag.onremove&&c.tag.onremove.call(c.state,c);if(null!=c.instance)l(c.instance);
else if(c=c.children,c instanceof Array)for(var a=0;a<c.length;a++){var d=c[a];null!=d&&l(d)}}function y(c,a,d,b,g){var e=c.dom;if("key"!==a&&(d!==b||"value"===a||"checked"===a||"selectedIndex"===a||"selected"===a&&c.dom===u.activeElement||"object"===typeof b)&&"undefined"!==typeof b&&!m(a)){var l=a.indexOf(":");if(-1<l&&"xlink"===a.substr(0,l))e.setAttributeNS("http://www.w3.org/1999/xlink",a.slice(l+1),b);else if("o"===a[0]&&"n"===a[1]&&"function"===typeof b)t(c,a,b);else if("style"===a)if(c=d,
c===b&&(e.style.cssText="",c=null),null==b)e.style.cssText="";else if("string"===typeof b)e.style.cssText=b;else{"string"===typeof c&&(e.style.cssText="");for(var f in b)e.style[f]=b[f];if(null!=c&&"string"!==typeof c)for(f in c)f in b||(e.style[f]="")}else if(a in e&&"href"!==a&&"list"!==a&&"form"!==a&&void 0===g){if("input"!==c.tag||"value"!==a||c.dom.value!==b||c.dom!==u.activeElement)e[a]=b}else"boolean"===typeof b?b?e.setAttribute(a,""):e.removeAttribute(a):e.setAttribute("className"===a?"class":