text: /*
  Mithril v0.1.23
  http://github.com/lhorie/mithril.js
  (c) Leo Horie
  License: MIT
  */
  Mithril=m=new function a(b,c){function d(){for(var a,b=[].slice.call(arguments),c=(!(null==b[1]||H.call(b[1])!=D||"tag"in b[1]||"subtree"in b[1])),d=c?b[1]:{},e=("class"in d?"class":"className"),f={tag:"div",attrs:{}},g=[];a=I.exec(b[0]);)if(""==a[1]&&a[2])f.tag=a[2];else if("#"==a[1])f.attrs.id=a[2];else if("."==a[1])g.push(a[2]);else if("["==a[3][0]){var h=J.exec(a[3]);f.attrs[h[1]]=h[3]||(h[2]?"":!0)}g.length>0&&(f.attrs[e]=g.join(" "));var i=c?b[2]:b[1];f.children=H.call(i)==E?i:b.slice(c?2:1);for(var j in d)f.attrs[j]=j==e?(f.attrs[j]||"")+" "+d[j]:d[j];return f}function e(a,d,h,k,l,m,n,o,p,q,r){if(null==l&&(l=""),"retain"===l.subtree)return m;var s=H.call(m),t=H.call(l);if(null==m||s!=t){if(null!=m)if(h&&h.nodes){var u=o-k,v=u+(t==E?l:m.nodes).length;g(h.nodes.slice(u,v),h.slice(u,v))}else m.nodes&&g(m.nodes,m);m=new l.constructor,m.tag&&(m={}),m.nodes=[]}if(t==E){l=j(l);for(var w=[],x=m.length===l.length,y=0,z=1,A=2,B=3,C={},I=[],J=!1,L=0;L<m.length;L++)m[L]&&m[L].attrs&&null!=m[L].attrs.key&&(J=!0,C[m[L].attrs.key]={action:z,index:L});if(J){for(var L=0;L<l.length;L++)if(l[L]&&l[L].attrs)if(null!=l[L].attrs.key){var M=l[L].attrs.key;C[M]=C[M]?{action:B,index:L,from:C[M].index,element:a.childNodes[C[M].index]||b.document.createElement("div")}:{action:A,index:L}}else I.push({index:L,element:a.childNodes[L]||b.document.createElement("div")});for(var N,O=Object.keys(C).map(function(a){return C[a]}),P=O.sort(function(a,b){return a.action-b.action||a.index-b.index}),Q=m.slice(),L=0;N=P[L];L++){if(N.action==z&&(g(m[N.index].nodes,m[N.index]),Q.splice(N.index,1)),N.action==A){var R=b.document.createElement("div");R.key=l[N.index].attrs.key,a.insertBefore(R,a.childNodes[N.index]||null),Q.splice(N.index,0,{attrs:{key:l[N.index].attrs.key},nodes:[R]})}N.action==B&&(a.childNodes[N.index]!==N.element&&null!==N.element&&a.insertBefore(N.element,a.childNodes[N.index]||null),Q[N.index]=m[N.from])}for(var L=0;L<I.length;L++){var N=I[L];a.insertBefore(N.element,a.childNodes[N.index]||null),Q[N.index]=m[N.index]}m=Q,m.nodes=[];for(var S,L=0;S=a.childNodes[L];L++)m.nodes.push(S)}for(var L=0,T=0;L<l.length;L++){var U=e(a,d,m,o,l[L],m[T],n,o+y||y,p,q,r);U!==c&&(U.nodes.intact||(x=!1),y+=U.$trusted?(U.match(/<[^\/]|\>\s*[^<]/g)||[]).length:H.call(U)==E?U.length:1,m[T++]=U)}if(!x){for(var L=0;L<l.length;L++)null!=m[L]&&(w=w.concat(m[L].nodes));for(var V,L=0;V=m.nodes[L];L++)null!=V.parentNode&&w.indexOf(V)<0&&g([V],[m[L]]);for(var V,L=m.nodes.length;V=w[L];L++)null==V.parentNode&&a.appendChild(V);l.length<m.length&&(m.length=l.length),m.nodes=w}}else if(null!=l&&t==D){l.attrs||(l.attrs={}),m.attrs||(m.attrs={});var W=Object.keys(l.attrs);if((l.tag!=m.tag||W.join()!=Object.keys(m.attrs).join()||l.attrs.id!=m.attrs.id)&&(m.nodes.length&&g(m.nodes),m.configContext&&typeof m.configContext.onunload==G&&m.configContext.onunload()),H.call(l.tag)!=F)return;var V,X=0===m.nodes.length;if(l.attrs.xmlns?q=l.attrs.xmlns:"svg"===l.tag?q="http://www.w3.org/2000/svg":"math"===l.tag&&(q="http://www.w3.org/1998/Math/MathML"),X?(V=q===c?b.document.createElement(l.tag,l.attrs.is):b.document.createElementNS(q,l.tag,l.attrs.is),m={tag:l.tag,attrs:W.length?f(V,l.tag,l.attrs,{},q):{},children:null!=l.children&&l.children.length>0?e(V,l.tag,c,c,l.children,m.children,!0,0,l.attrs.contenteditable?V:p,q,r):l.children,nodes:[V]},m.children&&!m.children.nodes&&(m.children.nodes=[]),"select"==l.tag&&l.attrs.value&&f(V,l.tag,{value:l.attrs.value},{},q),a.insertBefore(V,a.childNodes[o]||null)):(V=m.nodes[0],W.length&&f(V,l.tag,l.attrs,m.attrs,q),m.children=e(V,l.tag,c,c,l.children,m.children,!1,0,l.attrs.contenteditable?V:p,q,r),m.nodes.intact=!0,n===!0&&null!=V&&a.insertBefore(V,a.childNodes[o]||null)),typeof l.attrs.config==G){var Y=m.configContext=m.configContext||{},Z=function(a,b){return function(){return a.attrs.config.apply(a,b)}};r.push(Z(l,[V,!X,Y,m]))}}else if(typeof t!=G){var w;0===m.nodes.length?(l.$trusted?w=i(a,o,l):(w=[b.document.createTextNode(l)],a.nodeName.match(K)||a.insertBefore(w[0],a.childNodes[o]||null)),m="string number boolean".indexOf(typeof l)>-1?new l.constructor(l):l,m.nodes=w):m.valueOf()!==l.valueOf()||n===!0?(w=m.nodes,p&&p===b.document.activeElement||(l.$trusted?(g(w,m),w=i(a,o,l)):"textarea"===d?a.value=l:p?p.innerHTML=l:((1==w[0].nodeType||w.length>1)&&(g(m.nodes,m),w=[b.document.createTextNode(l)]),a.insertBefore(w[0],a.childNodes[o]||null),w[0].nodeValue=l)),m=new l.constructor(l),m.nodes=w):m.nodes.intact=!0}return m}function f(a,b,c,d,e){for(var f in c){var g=c[f],h=d[f];if(f in d&&h===g)"value"===f&&"input"===b&&a.value!==g&&(a.value=g);else{d[f]=g;try{if("config"===f)continue;if(typeof g==G&&0==f.indexOf("on"))a[f]=k(g,a);else if("style"===f&&null!=g&&H.call(g)==D){for(var i in g)(null==h||h[i]!==g[i])&&(a.style[i]=g[i]);for(var i in h)i in g||(a.style[i]="")}else null!=e?"href"===f?a.setAttributeNS("http://www.w3.org/1999/xlink","href",g):"className"===f?a.setAttribute("class",g):a.setAttribute(f,g):f in a&&"list"!=f&&"style"!=f&&"form"!=f?a[f]=g:a.setAttribute(f,g)}catch(j){if(j.message.indexOf("Invalid argument")<0)throw j}}}return d}function g(a,b){for(var c=a.length-1;c>-1;c--)a[c]&&a[c].parentNode&&(a[c].parentNode.removeChild(a[c]),b=[].concat(b),b[c]&&h(b[c]));0!=a.length&&(a.length=0)}function h(a){if(a.configContext&&typeof a.configContext.onunload==G&&a.configContext.onunload(),a.children)if(H.call(a.children)==E)for(var b=0;b<a.children.length;b++)h(a.children[b]);else a.children.tag&&h(a.children)}function i(a,c,d){var e=a.childNodes[c];if(e){var f=1!=e.nodeType,g=b.document.createElement("span");f?(a.insertBefore(g,e||null),g.insertAdjacentHTML("beforebegin",d),a.removeChild(g)):e.insertAdjacentHTML("beforebegin",d)}else a.insertAdjacentHTML("beforeend",d);for(var h=[];a.childNodes[c]!==e;)h.push(a.childNodes[c]),c++;return h}function j(a){var b=0;a:for(;;){for(var c=b;c<a.length;c++){{a[c]}if(H.call(a[c])==E){b=c,a=a.concat.apply([],a);continue a}}break}return a}function k(a,b){return function(c){c=c||event,d.redraw.strategy("diff"),d.startComputation();try{return a.call(b,c)}finally{d.endComputation()}}}function l(a){var b=M.indexOf(a);return 0>b?M.push(a)-1:b}function m(a){var b=function(){return arguments.length&&(a=arguments[0]),a};return b.toJSON=function(){return a},b}function n(){for(var a=d.redraw.strategy(),b=0;b<P.length;b++)R[b]&&"none"!=a&&d.render(P[b],Q[b].view(R[b]),"all"==a);U&&(U(),U=null),S=null,T=new Date,d.redraw.strategy("diff")}function o(a){return a.slice(Y[d.route.mode].length)}function p(a,b,c){$={};var e=c.indexOf("?");-1!==e&&($=t(c.substr(e+1,c.length)),c=c.substr(0,e));for(var f in b){if(f==c)return d.module(a,b[f]),!0;var g=new RegExp("^"+f.replace(/:[^\/]+?\.{3}/g,"(.*?)").replace(/:[^\/]+/g,"([^\\/]+)")+"/?$");if(g.test(c))return c.replace(g,function(){for(var c=f.match(/:[^\/]+/g)||[],e=[].slice.call(arguments,1,-2),g=0;g<c.length;g++)$[c[g].replace(/:|\./g,"")]=decodeURIComponent(e[g]);d.module(a,b[f])}),!0}}function q(a){if(a=a||event,!a.ctrlKey&&!a.metaKey&&2!=a.which){a.preventDefault?a.preventDefault():a.returnValue=!1;var b=a.currentTarget||this,c="pathname"==d.route.mode&&b.search?t(b.search.slice(1)):{};d.route(b[d.route.mode].slice(Y[d.route.mode].length),c)}}function r(){"hash"!=d.route.mode&&b.location.hash?b.location.hash=b.location.hash:b.scrollTo(0,0)}function s(a,b){var c=[];for(var d in a){var e=b?b+"["+d+"]":d,f=a[d];c.push(null!=f&&H.call(f)==D?s(f,e):encodeURIComponent(e)+"="+encodeURIComponent(f))}return c.join("&")}function t(a){for(var b=a.split("&"),c={},d=0;d<b.length;d++){var e=b[d].split("=");c[u(e[0])]=e[1]?u(e[1]):1===e.length?!0:""}return c}function u(a){return decodeURIComponent(a.replace(/\+/g," "))}function v(a){var b=l(a);g(a.childNodes,N[b]),N[b]=c}function w(a){var b=d.prop();return a.then(b),b.then=function(b,c){return w(a.then(b,c))},b}function x(a,b){function c(a){l=a||j,n.map(function(a){l==i&&a.resolve(m)||a.reject(m)})}function e(a,b,c,e){if((null!=m&&H.call(m)==D||typeof m==G)&&typeof a==G)try{var f=0;a.call(m,function(a){f++||(m=a,b())},function(a){f++||(m=a,c())})}catch(g){d.deferred.onerror(g),m=g,c()}else e()}function f(){var j;try{j=m&&m.then}catch(n){return d.deferred.onerror(n),m=n,l=h,f()}e(j,function(){l=g,f()},function(){l=h,f()},function(){try{l==g&&typeof a==G?m=a(m):l==h&&"function"==typeof b&&(m=b(m),l=g)}catch(f){return d.deferred.onerror(f),m=f,c()}m==k?(m=TypeError(),c()):e(j,function(){c(i)},c,function(){c(l==g&&i)})})}var g=1,h=2,i=3,j=4,k=this,l=0,m=0,n=[];k.promise={},k.resolve=function(a){return l||(m=a,l=g,f()),this},k.reject=function(a){return l||(m=a,l=h,f()),this},k.promise.then=function(a,b){var c=new x(a,b);return l==i?c.resolve(m):l==j?c.reject(m):n.push(c),c.promise}}function y(a){return a}function z(a){if(!a.dataType||"jsonp"!==a.dataType.toLowerCase()){var d=new b.XMLHttpRequest;if(d.open(a.method,a.url,!0,a.user,a.password),d.onreadystatechange=function(){4===d.readyState&&(d.status>=200&&d.status<300?a.onload({type:"load",target:d}):a.onerror({type:"error",target:d}))},a.serialize==JSON.stringify&&a.data&&"GET"!=a.method&&d.setRequestHeader("Content-Type","application/json; charset=utf-8"),a.deserialize==JSON.parse&&d.setRequestHeader("Accept","application/json, text/*"),typeof a.config==G){var e=a.config(d,a);null!=e&&(d=e)}if(a.data&&H.call(a.data)!=F&&a.data.constructor!=b.FormData)throw"Request data should be either be a string or FormData. Check the `serialize` option in `m.request`";return d.send("GET"!=a.method&&a.data?a.data:""),d}var f="mithril_callback_"+(new Date).getTime()+"_"+Math.round(1e16*Math.random()).toString(36),g=b.document.createElement("script");b[f]=function(d){b.document.body.removeChild(g),a.onload({type:"load",target:{responseText:d}}),b[f]=c},g.onerror=function(){return b.document.body.removeChild(g),a.onerror({type:"error",target:{status:500,responseText:JSON.stringify({error:"Error making jsonp request"})}}),b[f]=c,!1},g.onload=function(){return!1},g.src=a.url+(a.url.indexOf("?")>0?"&":"?")+(a.callbackKey?a.callbackKey:"callback")+"="+f+"&"+s(a.data||{}),b.document.body.appendChild(g)}function A(a,b,c){if("GET"==a.method&&"jsonp"!=a.dataType){var d=a.url.indexOf("?")<0?"?":"&",e=s(b);a.url=a.url+(e?d+e:"")}else a.data=c(b);return a}function B(a,b){var c=a.match(/:[a-z]\w+/gi);if(c&&b)for(var d=0;d<c.length;d++){var e=c[d].slice(1);a=a.replace(c[d],b[e]),delete b[e]}return a}var C,D="[object Object]",E="[object Array]",F="[object String]",G="function",H={}.toString,I=/(?:(^|#|\.)([^#\.\[\]]+))|(\[.+?\])/g,J=/\[(.+?)(?:=("|'|)(.*?)\2)?\]/,K=/AREA|BASE|BR|COL|COMMAND|EMBED|HR|IMG|INPUT|KEYGEN|LINK|META|PARAM|SOURCE|TRACK|WBR/,L={appendChild:function(a){C===c&&(C=b.document.createElement("html")),b.document.documentElement&&b.document.documentElement!==a?b.document.replaceChild(a,b.document.documentElement):b.document.appendChild(a),this.childNodes=b.document.childNodes},insertBefore:function(a){this.appendChild(a)},childNodes:[]},M=[],N={};d.render=function(a,d,f){var h=[];if(!a)throw new Error("Please ensure the DOM element exists before rendering a template into it.");var i=l(a),j=a==b.document,k=j||a==b.document.documentElement?L:a;j&&"html"!=d.tag&&(d={tag:"html",attrs:{},children:d}),N[i]===c&&g(k.childNodes),f===!0&&v(a),N[i]=e(k,null,c,c,d,N[i],!1,0,null,c,h);for(var m=0;m<h.length;m++)h[m]()},d.trust=function(a){return a=new String(a),a.$trusted=!0,a},d.prop=function(a){return(null!=a&&H.call(a)==D||typeof a==G)&&typeof a.then==G?w(a):m(a)};var O,P=[],Q=[],R=[],S=null,T=0,U=null,V=16;d.module=function(a,b){var c=P.indexOf(a);0>c&&(c=P.length);var e=!1;if(R[c]&&typeof R[c].onunload==G){var f={preventDefault:function(){e=!0}};R[c].onunload(f)}if(!e){d.redraw.strategy("all"),d.startComputation(),P[c]=a;var g=O=b,h=new b.controller;return g==O&&(R[c]=h,Q[c]=b),d.endComputation(),R[c]}},d.redraw=function(a){var c=b.cancelAnimationFrame||b.clearTimeout,d=b.requestAnimationFrame||b.setTimeout;S&&a!==!0?(new Date-T>V||d==b.requestAnimationFrame)&&(S>0&&c(S),S=d(n,V)):(n(),S=d(function(){S=null},V))},d.redraw.strategy=d.prop();var W=0;d.startComputation=function(){W++},d.endComputation=function(){W=Math.max(W-1,0),0==W&&d.redraw()},d.withAttr=function(a,b){return function(c){c=c||event;var d=c.currentTarget||this;b(a in d?d[a]:d.getAttribute(a))}};var X,Y={pathname:"",hash:"#",search:"?"},Z=function(){},$={};return d.route=function(){if(0===arguments.length)return X;if(3===arguments.length&&H.call(arguments[1])==F){var a=arguments[0],c=arguments[1],e=arguments[2];Z=function(b){var f=X=o(b);p(a,e,f)||d.route(c,!0)};var f="hash"==d.route.mode?"onhashchange":"onpopstate";b[f]=function(){X!=o(b.location[d.route.mode])&&Z(b.location[d.route.mode])},U=r,b[f]()}else if(arguments[0].addEventListener){{var g=arguments[0];arguments[1],arguments[2]}g.href=("pathname"!==d.route.mode?b.location.pathname:"")+Y[d.route.mode]+this.attrs.href,g.removeEventListener("click",q),g.addEventListener("click",q)}else if(H.call(arguments[0])==F){X=arguments[0];var h=null!=arguments[1]&&H.call(arguments[1])==D?s(arguments[1]):null;h&&(X+=(-1===X.indexOf("?")?"?":"&")+h);var i=(3==arguments.length?arguments[2]:arguments[1])===!0;b.history.pushState?(U=function(){b.history[i?"replaceState":"pushState"](null,b.document.title,Y[d.route.mode]+X),r()},Z(Y[d.route.mode]+X)):b.location[d.route.mode]=X}},d.route.param=function(a){return $[a]},d.route.mode="search",d.deferred=function(){var a=new x;return a.promise=w(a.promise),a},d.deferred.onerror=function(a){if("[object Error]"==H.call(a)&&!a.constructor.toString().match(/ Error/))throw a},d.sync=function(a){function b(a,b){return function(d){return g[a]=d,b||(c="reject"),0==--f&&(e.promise(g),e[c](g)),d}}var c="resolve",e=d.deferred(),f=a.length,g=new Array(f);if(a.length>0)for(var h=0;h<a.length;h++)a[h].then(b(h,!0),b(h,!1));else e.resolve([]);return e.promise},d.request=function(a){a.background!==!0&&d.startComputation();var b=d.deferred(),c=a.dataType&&"jsonp"===a.dataType.toLowerCase(),e=a.serialize=c?y:a.serialize||JSON.stringify,f=a.deserialize=c?y:a.deserialize||JSON.parse,g=a.extract||function(a){return 0===a.responseText.length&&f===JSON.parse?null:a.responseText};return a.url=B(a.url,a.data),a=A(a,a.data,e),a.onload=a.onerror=function(c){try{c=c||event;var e=("load"==c.type?a.unwrapSuccess:a.unwrapError)||y,h=e(f(g(c.target,a)));if("load"==c.type)if(H.call(h)==E&&a.type)for(var i=0;i<h.length;i++)h[i]=new a.type(h[i]);else a.type&&(h=new a.type(h));b["load"==c.type?"resolve":"reject"](h)}catch(c){d.deferred.onerror(c),b.reject(c)}a.background!==!0&&d.endComputation()},z(a),b.promise(a.initialValue),b.promise},d.deps=function(a){return b=a||b},d.deps.factory=a,d}("undefined"!=typeof window?window:{}),"undefined"!=typeof module&&null!==module&&(module.exports=m),"function"==typeof define&&define.amd&&define(function(){return m});
  //# sourceMappingURL=mithril.min.js.map