(function(){function z(a,d,e,g,q,h){return{tag:a,key:d,attrs:e,children:g,text:q,dom:h,domSize:void 0,state:void 0,events:void 0,instance:void 0}}function Q(a){for(var d in a)if(H.call(a,d))return!1;return!0}function w(a){if(null==a||"string"!==typeof a&&"function"!==typeof a&&"function"!==typeof a.view)throw Error("The selector must be either a string or a component.");var d=arguments[1],e=2;if(null==d)d={};else if("object"!==typeof d||null!=d.tag||Array.isArray(d))d={},e=1;if(arguments.length=== e+1){var g=arguments[e];Array.isArray(g)||(g=[g])}else for(g=[];ec.indexOf("?")?"?":"&";c+=e+d}return c}function k(c){try{return""!==c?JSON.parse(c):null}catch(x){throw Error(c); }}function n(c){return c.responseText}function m(c,a){if("function"===typeof c)if(Array.isArray(a))for(var d=0;dl.status||304===l.status||Z.test(c.url))d(m(c.type,a));else{var g=Error(l.responseText);g.code=l.status;g.response=a;e(g)}}catch(aa){e(aa)}};g&&null!=c.data?l.send(c.data):l.send()});return!0===c.background?x:E(x)},jsonp:function(c,n){var k=e();c=g(c,n);var x=new d(function(d,e){var g=c.callbackName||"_mithril_"+Math.round(1E16*Math.random())+"_"+l++,n=a.document.createElement("script");a[g]=function(e){n.parentNode.removeChild(n); d(m(c.type,e));delete a[g]};n.onerror=function(){n.parentNode.removeChild(n);e(Error("JSONP request failed"));delete a[g]};null==c.data&&(c.data={});c.url=q(c.url,c.data);c.data[c.callbackKey||"callback"]=g;n.src=h(c.url,c.data);a.document.documentElement.appendChild(n)});return!0===c.background?x:k(x)},setCompletionCallback:function(c){C=c}}}(window,p),V=function(a){function d(t,b){if(t.state!==b)throw Error("`vnode.state` must not be modified");}function e(t){var b=t.state;try{return this.apply(b, arguments)}finally{d(t,b)}}function g(t,b,f,c,a,d,e){for(;f'+ b.children+"",a=a.firstChild):a.innerHTML=b.children;b.dom=a.firstChild;b.domSize=a.childNodes.length;for(b=D.createDocumentFragment();f=a.firstChild;)b.appendChild(f);C(t,b,c)}function k(t,b,f,c,a,d){if(b!==f&&(null!=b||null!=f))if(null==b||0===b.length)g(t,f,0,f.length,c,a,d);else if(null==f||0===f.length)x(b,0,b.length);else{for(var e=0,k=0,v=null,h=null;k=k&&v>=e;)if(A=b[h],y=f[v],null==A)h--;else if(null==y)v--;else if(A.key===y.key)A!==y&&n(t,A,y,c,a,d),null!=y.dom&&(a=y.dom),h--,v--;else break;for(;h>=k&&v>=e;)if(r=b[k],u=f[e],null==r)k++;else if(null==u)e++;else if(r.key===u.key)k++,e++,r!==u&&n(t,r,u,c,l(b,k,a),d);else break;for(;h>=k&&v>=e;){if(null==r)k++;else if(null==u)e++;else if(null==A)h--;else if(null==y)v--;else if(e===v)break;else{if(r.key!== y.key||A.key!==u.key)break;B=l(b,k,a);C(t,m(A),B);A!==u&&n(t,A,u,c,B,d);++e<=--v&&C(t,m(r),a);r!==y&&n(t,r,y,c,a,d);null!=y.dom&&(a=y.dom);k++;h--}A=b[h];y=f[v];r=b[k];u=f[e]}for(;h>=k&&v>=e;){if(null==A)h--;else if(null==y)v--;else if(A.key===y.key)A!==y&&n(t,A,y,c,a,d),null!=y.dom&&(a=y.dom),h--,v--;else break;A=b[h];y=f[v]}if(e>v)x(b,k,h+1);else if(k>h)g(t,f,e,v+1,c,a,d);else{u=a;A=v-e+1;r=Array(A);var G=2147483647,z=0;for(B=0;B=e;B--){if(null==p){p=b;A=k;y=h+1;for(var w= {};A=e;B--)u=f[B],-1===r[B-e]?q(t,u,c,d,a):b[k]===B-e?k--:C(t,m(u),a),null!=u.dom&&(a=f[B].dom)}else for(B=v;B>=e;B--)u=f[B],-1===r[B-e]&&q(t,u,c,d,a),null!=u.dom&&(a=f[B].dom)}}else{v=b.lengthv&&x(b,e,b.length);f.length>v&&g(t,f,e,f.length,c,a,d)}}}function n(a,b,f,d,g,l){var t=b.tag;if(t=== f.tag){f.state=b.state;f.events=b.events;var v;var x;null!=f.attrs&&"function"===typeof f.attrs.onbeforeupdate&&(v=e.call(f.attrs.onbeforeupdate,f,b));"string"!==typeof f.tag&&"function"===typeof f.state.onbeforeupdate&&(x=e.call(f.state.onbeforeupdate,f,b));void 0===v&&void 0===x||v||x?v=!1:(f.dom=b.dom,f.domSize=b.domSize,f.instance=b.instance,v=!0);if(!v)if("string"===typeof t)switch(null!=f.attrs&&L(f.attrs,f,d),t){case "#":b.children.toString()!==f.children.toString()&&(b.dom.nodeValue=f.children); f.dom=b.dom;break;case "<":b.children!==f.children?(m(b),h(a,f,l,g)):(f.dom=b.dom,f.domSize=b.domSize);break;case "[":k(a,b.children,f.children,d,g,l);b=0;d=f.children;f.dom=null;if(null!=d){for(var p=0;p