text: (function(){function y(b,d,e,k,n,f){return{tag:b,key:d,attrs:e,children:k,text:n,dom:f,domSize:void 0,state:void 0,_state:void 0,events:void 0,instance:void 0,skip:!1}}function N(b){for(var d in b)if(C.call(b,d))return!1;return!0}function A(b){var d,e=arguments[1],k=2;if(null==b||"string"!==typeof b&&"function"!==typeof b&&"function"!==typeof b.view)throw Error("The selector must be either a string or a component.");if("string"===typeof b&&!(d=O[b])){var n="div";for(var f=[],g={};d=R.exec(b);){var r=
  d[1],l=d[2];""===r&&""!==l?n=l:"#"===r?g.id=l:"."===r?f.push(l):"["===d[3][0]&&((r=d[6])&&(r=r.replace(/\\(["'])/g,"$1").replace(/\\\\/g,"\\")),"class"===d[4]?f.push(r):g[d[4]]=""===r?r:r||!0)}0<f.length&&(g.className=f.join(" "));d=O[b]={tag:n,attrs:g}}if(null==e)e={};else if("object"!==typeof e||null!=e.tag||Array.isArray(e))e={},k=1;if(arguments.length===k+1)n=arguments[k],Array.isArray(n)||(n=[n]);else for(n=[];k<arguments.length;)n.push(arguments[k++]);k=y.normalizeChildren(n);if("string"===
  typeof b){n=!1;var m,p;f=e.className||e["class"];if(!N(d.attrs)&&!N(e)){g={};for(var a in e)C.call(e,a)&&(g[a]=e[a]);e=g}for(a in d.attrs)C.call(d.attrs,a)&&(e[a]=d.attrs[a]);void 0!==f&&(void 0!==e["class"]&&(e["class"]=void 0,e.className=f),null!=d.attrs.className&&(e.className=d.attrs.className+" "+f));for(a in e)if(C.call(e,a)&&"key"!==a){n=!0;break}Array.isArray(k)&&1===k.length&&null!=k[0]&&"#"===k[0].tag?p=k[0].children:m=k;return y(d.tag,e.key,n?e:void 0,m,p)}return y(b,e.key,e,k)}function S(b){var d=
  0,e=null,k="function"===typeof requestAnimationFrame?requestAnimationFrame:setTimeout;return function(){var n=Date.now()-d;null===e&&(e=k(function(){e=null;b();d=Date.now()},16-n))}}y.normalize=function(b){return Array.isArray(b)?y("[",void 0,void 0,y.normalizeChildren(b),void 0,void 0):null!=b&&"object"!==typeof b?y("#",void 0,void 0,!1===b?"":b,void 0,void 0):b};y.normalizeChildren=function(b){for(var d=0;d<b.length;d++)b[d]=y.normalize(b[d]);return b};var R=/(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g,
  O={},C={}.hasOwnProperty;A.trust=function(b){null==b&&(b="");return y("<",void 0,void 0,b,void 0,void 0)};A.fragment=function(b,d){return y("[",b.key,b,y.normalizeChildren(d),void 0,void 0)};var w=function(b){function d(b,a){return function t(d){var g;try{if(!a||null==d||"object"!==typeof d&&"function"!==typeof d||"function"!==typeof(g=d.then))m(function(){a||0!==b.length||console.error("Possible unhandled promise rejection:",d);for(var e=0;e<b.length;e++)b[e](d);n.length=0;f.length=0;l.state=a;l.retry=
  function(){t(d)}});else{if(d===k)throw new TypeError("Promise can't be resolved w/ itself");e(g.bind(d))}}catch(G){r(G)}}}function e(b){function a(a){return function(b){0<d++||a(b)}}var d=0,e=a(r);try{b(a(g),e)}catch(D){e(D)}}if(!(this instanceof w))throw Error("Promise must be called with `new`");if("function"!==typeof b)throw new TypeError("executor must be a function");var k=this,n=[],f=[],g=d(n,!0),r=d(f,!1),l=k._instance={resolvers:n,rejectors:f},m="function"===typeof setImmediate?setImmediate:
  setTimeout;e(b)};w.prototype.then=function(b,d){function e(b,d,e,g){d.push(function(a){if("function"!==typeof b)e(a);else try{n(b(a))}catch(z){f&&f(z)}});"function"===typeof k.retry&&g===k.state&&k.retry()}var k=this._instance,n,f,g=new w(function(b,d){n=b;f=d});e(b,k.resolvers,n,!0);e(d,k.rejectors,f,!1);return g};w.prototype["catch"]=function(b){return this.then(null,b)};w.resolve=function(b){return b instanceof w?b:new w(function(d){d(b)})};w.reject=function(b){return new w(function(d,e){e(b)})};
  w.all=function(b){return new w(function(d,e){var k=b.length,n=0,f=[];if(0===b.length)d([]);else for(var g=0;g<b.length;g++)(function(g){function l(b){n++;f[g]=b;n===k&&d(f)}null==b[g]||"object"!==typeof b[g]&&"function"!==typeof b[g]||"function"!==typeof b[g].then?l(b[g]):b[g].then(l,e)})(g)})};w.race=function(b){return new w(function(d,e){for(var k=0;k<b.length;k++)b[k].then(d,e)})};"undefined"!==typeof window?("undefined"===typeof window.Promise&&(window.Promise=w),w=window.Promise):"undefined"!==
  typeof global&&("undefined"===typeof global.Promise&&(global.Promise=w),w=global.Promise);var H=function(b){function d(b,f){if(Array.isArray(f))for(var g=0;g<f.length;g++)d(b+"["+g+"]",f[g]);else if("[object Object]"===Object.prototype.toString.call(f))for(g in f)d(b+"["+g+"]",f[g]);else e.push(encodeURIComponent(b)+(null!=f&&""!==f?"="+encodeURIComponent(f):""))}if("[object Object]"!==Object.prototype.toString.call(b))return"";var e=[],k;for(k in b)d(k,b[k]);return e.join("&")},T=/^file:\/\//i,L=
  function(b,d){function e(){function a(){0===--b&&"function"===typeof p&&p()}var b=0;return function D(d){var e=d.then;d.then=function(){b++;var l=e.apply(d,arguments);l.then(a,function(d){a();if(0===b)throw d;});return D(l)};return d}}function k(a,b){if("string"===typeof a){var d=a;a=b||{};null==a.url&&(a.url=d)}return a}function n(a,b){if(null==b)return a;for(var d=a.match(/:[^\/]+/gi)||[],e=0;e<d.length;e++){var l=d[e].slice(1);null!=b[l]&&(a=a.replace(d[e],b[l]))}return a}function f(a,b){var d=
  H(b);if(""!==d){var e=0>a.indexOf("?")?"?":"&";a+=e+d}return a}function g(a){try{return""!==a?JSON.parse(a):null}catch(z){throw Error(a);}}function r(a){return a.responseText}function l(a,b){if("function"===typeof a)if(Array.isArray(b))for(var d=0;d<b.length;d++)b[d]=new a(b[d]);else return new a(b);return b}var m=0,p;return{request:function(a,m){var p=e();a=k(a,m);var z=new d(function(d,e){null==a.method&&(a.method="GET");a.method=a.method.toUpperCase();var k="GET"===a.method||"TRACE"===a.method?
  !1:"boolean"===typeof a.useBody?a.useBody:!0;"function"!==typeof a.serialize&&(a.serialize="undefined"!==typeof FormData&&a.data instanceof FormData?function(a){return a}:JSON.stringify);"function"!==typeof a.deserialize&&(a.deserialize=g);"function"!==typeof a.extract&&(a.extract=r);a.url=n(a.url,a.data);k?a.data=a.serialize(a.data):a.url=f(a.url,a.data);var m=new b.XMLHttpRequest,p=!1,z=m.abort;m.abort=function(){p=!0;z.call(m)};m.open(a.method,a.url,"boolean"===typeof a.async?a.async:!0,"string"===
  typeof a.user?a.user:void 0,"string"===typeof a.password?a.password:void 0);a.serialize!==JSON.stringify||!k||a.headers&&a.headers.hasOwnProperty("Content-Type")||m.setRequestHeader("Content-Type","application/json; charset=utf-8");a.deserialize!==g||a.headers&&a.headers.hasOwnProperty("Accept")||m.setRequestHeader("Accept","application/json, text/*");a.withCredentials&&(m.withCredentials=a.withCredentials);for(var t in a.headers)({}).hasOwnProperty.call(a.headers,t)&&m.setRequestHeader(t,a.headers[t]);
  "function"===typeof a.config&&(m=a.config(m,a)||m);m.onreadystatechange=function(){if(!p&&4===m.readyState)try{var b=a.extract!==r?a.extract(m,a):a.deserialize(a.extract(m,a));if(200<=m.status&&300>m.status||304===m.status||T.test(a.url))d(l(a.type,b));else{var h=Error(m.responseText);h.code=m.status;h.response=b;e(h)}}catch(c){e(c)}};k&&null!=a.data?m.send(a.data):m.send()});return!0===a.background?z:p(z)},jsonp:function(a,g){var r=e();a=k(a,g);var p=new d(function(d,e){var g=a.callbackName||"_mithril_"+
  Math.round(1E16*Math.random())+"_"+m++,k=b.document.createElement("script");b[g]=function(e){k.parentNode.removeChild(k);d(l(a.type,e));delete b[g]};k.onerror=function(){k.parentNode.removeChild(k);e(Error("JSONP request failed"));delete b[g]};null==a.data&&(a.data={});a.url=n(a.url,a.data);a.data[a.callbackKey||"callback"]=g;k.src=f(a.url,a.data);b.document.documentElement.appendChild(k)});return!0===a.background?p:r(p)},setCompletionCallback:function(a){p=a}}}(window,w),Q=function(b){function d(h,
  c,q,a,b,d,l){for(;q<a;q++){var u=c[q];null!=u&&e(h,u,b,l,d)}}function e(h,c,q,a,b){var u=c.tag;if("string"===typeof u)switch(c.state={},null!=c.attrs&&A(c.attrs,c,q),u){case "#":return c.dom=x.createTextNode(c.children),m(h,c.dom,b),c.dom;case "<":return k(h,c,b);case "[":var l=x.createDocumentFragment();null!=c.children&&(u=c.children,d(l,u,0,u.length,q,null,a));c.dom=l.firstChild;c.domSize=l.childNodes.length;m(h,l,b);return l;default:var g=c.tag,f=(u=c.attrs)&&u.is;g=(a=c.attrs&&c.attrs.xmlns||
  P[c.tag]||a)?f?x.createElementNS(a,g,{is:f}):x.createElementNS(a,g):f?x.createElement(g,{is:f}):x.createElement(g);c.dom=g;if(null!=u)for(l in f=a,u)D(c,l,null,u[l],f);m(h,g,b);null!=c.attrs&&null!=c.attrs.contenteditable?p(c):(null!=c.text&&(""!==c.text?g.textContent=c.text:c.children=[y("#",void 0,void 0,c.text,void 0,void 0)]),null!=c.children&&(h=c.children,d(g,h,0,h.length,q,null,a),h=c.attrs,"select"===c.tag&&null!=h&&("value"in h&&D(c,"value",null,h.value,void 0),"selectedIndex"in h&&D(c,"selectedIndex",
  null,h.selectedIndex,void 0))));return g}else return n(c,q),null!=c.instance?(q=e(h,c.instance,q,a,b),c.dom=c.instance.dom,c.domSize=null!=c.dom?c.instance.domSize:0,m(h,q,b),c=q):(c.domSize=0,c=K),c}function k(h,c,a){var q={caption:"table",thead:"table",tbody:"table",tfoot:"table",tr:"tbody",th:"tr",td:"tr",colgroup:"table",col:"colgroup"}[(c.children.match(/^\s*?<(\w+)/im)||[])[1]]||"div";q=x.createElement(q);q.innerHTML=c.children;c.dom=q.firstChild;c.domSize=q.childNodes.length;c=x.createDocumentFragment();
  for(var b;b=q.firstChild;)c.appendChild(b);m(h,c,a);return c}function n(h,c){if("function"===typeof h.tag.view){h.state=Object.create(h.tag);var a=h.state.view;if(null!=a.$$reentrantLock$$)return K;a.$$reentrantLock$$=!0}else{h.state=void 0;a=h.tag;if(null!=a.$$reentrantLock$$)return K;a.$$reentrantLock$$=!0;h.state=null!=h.tag.prototype&&"function"===typeof h.tag.prototype.view?new h.tag(h):h.tag(h)}h._state=h.state;null!=h.attrs&&A(h.attrs,h,c);A(h._state,h,c);h.instance=y.normalize(h._state.view.call(h.state,
  h));if(h.instance===h)throw Error("A view cannot return the vnode it received as argument");a.$$reentrantLock$$=null}function f(h,c,q,b,k,f,n){if(c!==q&&(null!=c||null!=q))if(null==c)d(h,q,0,q.length,k,f,n);else if(null==q)a(c,0,c.length,q);else{if(c.length===q.length){var u=!1;for(var p=0;p<q.length;p++)if(null!=q[p]&&null!=c[p]){u=null==q[p].key&&null==c[p].key;break}if(u){for(p=0;p<c.length;p++)c[p]!==q[p]&&(null==c[p]&&null!=q[p]?e(h,q[p],k,n,l(c,p+1,f)):null==q[p]?a(c,p,p+1,q):g(h,c[p],q[p],
  k,l(c,p+1,f),b,n));return}}if(!b)a:{if(null!=c.pool&&Math.abs(c.pool.length-q.length)<=Math.abs(c.length-q.length)&&(b=q[0]&&q[0].children&&q[0].children.length||0,Math.abs((c.pool[0]&&c.pool[0].children&&c.pool[0].children.length||0)-b)<=Math.abs((c[0]&&c[0].children&&c[0].children.length||0)-b))){b=!0;break a}b=!1}if(b){var z=c.pool;c=c.concat(c.pool)}for(var B=p=0,v=c.length-1,E=q.length-1,F;v>=p&&E>=B;){var t=c[p];u=q[B];if(t!==u||b)if(null==t)p++;else if(null==u)B++;else if(t.key===u.key){var x=
  null!=z&&p>=c.length-z.length||null==z&&b;p++;B++;g(h,t,u,k,l(c,p,f),x,n);b&&t.tag===u.tag&&m(h,r(t),f)}else if(t=c[v],t!==u||b)if(null==t)v--;else if(null==u)B++;else if(t.key===u.key)x=null!=z&&v>=c.length-z.length||null==z&&b,g(h,t,u,k,l(c,v+1,f),x,n),(b||B<E)&&m(h,r(t),l(c,p,f)),v--,B++;else break;else v--,B++;else p++,B++}for(;v>=p&&E>=B;){t=c[v];u=q[E];if(t!==u||b)if(null==t)v--;else{if(null!=u)if(t.key===u.key)x=null!=z&&v>=c.length-z.length||null==z&&b,g(h,t,u,k,l(c,v+1,f),x,n),b&&t.tag===
  u.tag&&m(h,r(t),f),null!=t.dom&&(f=t.dom),v--;else{if(!F){F=c;x=v;t={};var w;for(w=0;w<x;w++){var y=F[w];null!=y&&(y=y.key,null!=y&&(t[y]=w))}F=t}null!=u&&(x=F[u.key],null!=x?(t=c[x],g(h,t,u,k,l(c,v+1,f),b,n),m(h,r(t),f),c[x].skip=!0,null!=t.dom&&(f=t.dom)):f=e(h,u,k,n,f))}E--}else v--,E--;if(E<B)break}d(h,q,B,E+1,k,f,n);a(c,p,v+1,q)}}function g(h,c,a,b,d,l,m){var q=c.tag;if(q===a.tag){a.state=c.state;a._state=c._state;a.events=c.events;var u;if(u=!l){var t,B;null!=a.attrs&&"function"===typeof a.attrs.onbeforeupdate&&
  (t=a.attrs.onbeforeupdate.call(a.state,a,c));"string"!==typeof a.tag&&"function"===typeof a._state.onbeforeupdate&&(B=a._state.onbeforeupdate.call(a.state,a,c));void 0===t&&void 0===B||t||B?u=!1:(a.dom=c.dom,a.domSize=c.domSize,a.instance=c.instance,u=!0)}if(!u)if("string"===typeof q)switch(null!=a.attrs&&(l?(a.state={},A(a.attrs,a,b)):J(a.attrs,a,b)),q){case "#":c.children.toString()!==a.children.toString()&&(c.dom.nodeValue=a.children);a.dom=c.dom;break;case "<":c.children!==a.children?(r(c),k(h,
  a,d)):(a.dom=c.dom,a.domSize=c.domSize);break;case "[":f(h,c.children,a.children,l,b,d,m);c=0;b=a.children;a.dom=null;if(null!=b){for(l=0;l<b.length;l++){var v=b[l];null!=v&&null!=v.dom&&(null==a.dom&&(a.dom=v.dom),c+=v.domSize||1)}1!==c&&(a.domSize=c)}break;default:h=a.dom=c.dom;m=a.attrs&&a.attrs.xmlns||P[a.tag]||m;"textarea"===a.tag&&(null==a.attrs&&(a.attrs={}),null!=a.text&&(a.attrs.value=a.text,a.text=void 0));d=c.attrs;q=a.attrs;u=m;if(null!=q)for(v in q)D(a,v,d&&d[v],q[v],u);if(null!=d)for(v in d)null!=
  q&&v in q||("className"===v&&(v="class"),"o"!==v[0]||"n"!==v[1]||w(v)?"key"!==v&&a.dom.removeAttribute(v):G(a,v,void 0));null!=a.attrs&&null!=a.attrs.contenteditable?p(a):null!=c.text&&null!=a.text&&""!==a.text?c.text.toString()!==a.text.toString()&&(c.dom.firstChild.nodeValue=a.text):(null!=c.text&&(c.children=[y("#",void 0,void 0,c.text,void 0,c.dom.firstChild)]),null!=a.text&&(a.children=[y("#",void 0,void 0,a.text,void 0,void 0)]),f(h,c.children,a.children,l,b,null,m))}else{if(l)n(a,b);else{a.instance=
  y.normalize(a._state.view.call(a.state,a));if(a.instance===a)throw Error("A view cannot return the vnode it received as argument");null!=a.attrs&&J(a.attrs,a,b);J(a._state,a,b)}null!=a.instance?(null==c.instance?e(h,a.instance,b,m,d):g(h,c.instance,a.instance,b,d,l,m),a.dom=a.instance.dom,a.domSize=a.instance.domSize):null!=c.instance?(z(c.instance,null),a.dom=void 0,a.domSize=0):(a.dom=c.dom,a.domSize=c.domSize)}}else z(c,null),e(h,a,b,m,d)}function r(a){var c=a.domSize;if(null!=c||null==a.dom){var b=
  x.createDocumentFragment();if(0<c){for(a=a.dom;--c;)b.appendChild(a.nextSibling);b.insertBefore(a,b.firstChild)}return b}return a.dom}function l(a,c,b){for(;c<a.length;c++)if(null!=a[c]&&null!=a[c].dom)return a[c].dom;return b}function m(a,c,b){b&&b.parentNode?a.insertBefore(c,b):a.appendChild(c)}function p(a){var c=a.children;if(null!=c&&1===c.length&&"<"===c[0].tag)c=c[0].children,a.dom.innerHTML!==c&&(a.dom.innerHTML=c);else if(null!=a.text||null!=c&&0!==c.length)throw Error("Child node of a contenteditable must be trusted");
  }function a(a,c,b,d){for(;c<b;c++){var h=a[c];null!=h&&(h.skip?h.skip=!1:z(h,d))}}function z(a,c){function b(){if(++d===h&&(t(a),a.dom)){var b=a.domSize||1;if(1<b)for(var e=a.dom;--b;){var l=e.nextSibling,f=l.parentNode;null!=f&&f.removeChild(l)}b=a.dom;e=b.parentNode;null!=e&&e.removeChild(b);if(b=null!=c&&null==a.domSize)b=a.attrs,b=!(null!=b&&(b.oncreate||b.onupdate||b.onbeforeremove||b.onremove));b&&"string"===typeof a.tag&&(c.pool?c.pool.push(a):c.pool=[a])}}var h=1,d=0;if(a.attrs&&"function"===
  typeof a.attrs.onbeforeremove){var e=a.attrs.onbeforeremove.call(a.state,a);null!=e&&"function"===typeof e.then&&(h++,e.then(b,b))}"string"!==typeof a.tag&&"function"===typeof a._state.onbeforeremove&&(e=a._state.onbeforeremove.call(a.state,a),null!=e&&"function"===typeof e.then&&(h++,e.then(b,b)));b()}function t(a){a.attrs&&"function"===typeof a.attrs.onremove&&a.attrs.onremove.call(a.state,a);if("string"!==typeof a.tag)"function"===typeof a._state.onremove&&a._state.onremove.call(a.state,a),null!=
  a.instance&&t(a.instance);else if(a=a.children,Array.isArray(a))for(var c=0;c<a.length;c++){var b=a[c];null!=b&&t(b)}}function D(a,c,b,d,e){var h=a.dom;if("key"!==c&&"is"!==c&&(b!==d||"value"===c||"checked"===c||"selectedIndex"===c||"selected"===c&&a.dom===x.activeElement||"object"===typeof d)&&"undefined"!==typeof d&&!w(c)){var l=c.indexOf(":");if(-1<l&&"xlink"===c.substr(0,l))h.setAttributeNS("http://www.w3.org/1999/xlink",c.slice(l+1),d);else if("o"===c[0]&&"n"===c[1]&&"function"===typeof d)G(a,
  c,d);else if("style"===c)if(a=b,null!=a&&null!=d&&"object"===typeof a&&"object"===typeof d&&d!==a){for(var f in d)d[f]!==a[f]&&(h.style[f]=d[f]);for(f in a)f in d||(h.style[f]="")}else if(a===d&&(h.style.cssText="",a=null),null==d)h.style.cssText="";else if("string"===typeof d)h.style.cssText=d;else for(f in"string"===typeof a&&(h.style.cssText=""),d)h.style[f]=d[f];else if(c in h&&"href"!==c&&"list"!==c&&"form"!==c&&"width"!==c&&"height"!==c&&void 0===e&&!(a.attrs.is||-1<a.tag.indexOf("-"))){if("value"===
  c){f=""+d;if(("input"===a.tag||"textarea"===a.tag)&&a.dom.value===f&&a.dom===x.activeElement)return;if("select"===a.tag)if(null===d){if(-1===a.dom.selectedIndex&&a.dom===x.activeElement)return}else if(null!==b&&a.dom.value===f&&a.dom===x.activeElement)return;if("option"===a.tag&&null!=b&&a.dom.value===f)return}"input"===a.tag&&"type"===c?h.setAttribute(c,d):h[c]=d}else"boolean"===typeof d?d?h.setAttribute(c,""):h.removeAttribute(c):h.setAttribute("className"===c?"class":c,d)}}function w(a){return"oninit"===
  a||"oncreate"===a||"onupdate"===a||"onremove"===a||"onbeforeremove"===a||"onbeforeupdate"===a}function G(a,b,d){var c=a.dom,e="function"!==typeof C?d:function(a){var b=d.call(c,a);C.call(c,a);return b};if(b in c)c[b]="function"===typeof d?e:null;else{var h=b.slice(2);void 0===a.events&&(a.events={});a.events[b]!==e&&(null!=a.events[b]&&c.removeEventListener(h,a.events[b],!1),"function"===typeof d&&(a.events[b]=e,c.addEventListener(h,a.events[b],!1)))}}function A(a,b,d){"function"===typeof a.oninit&&
  a.oninit.call(b.state,b);"function"===typeof a.oncreate&&d.push(a.oncreate.bind(b.state,b))}function J(a,b,d){"function"===typeof a.onupdate&&d.push(a.onupdate.bind(b.state,b))}var x=b.document,K=x.createDocumentFragment(),P={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"},C;return{render:function(a,b){if(!a)throw Error("Ensure the DOM element being passed to m.route/m.mount/m.render is not undefined.");var c=[],d=x.activeElement,e=a.namespaceURI;null==a.vnodes&&(a.textContent=
  "");Array.isArray(b)||(b=[b]);f(a,a.vnodes,y.normalizeChildren(b),!1,c,null,"http://www.w3.org/1999/xhtml"===e?void 0:e);a.vnodes=b;for(e=0;e<c.length;e++)c[e]();null!=d&&x.activeElement!==d&&d.focus()},setEventCallback:function(a){return C=a}}},I=function(b,d){function e(b){b=f.indexOf(b);-1<b&&f.splice(b,2)}function k(){if(g)throw Error("Nested m.redraw.sync() call");g=!0;for(var b=1;b<f.length;b+=2)try{f[b]()}catch(m){}g=!1}var n=Q(b);n.setEventCallback(function(b){!1===b.redraw?b.redraw=void 0:
  r()});var f=[],g=!1,r=(d||S)(k);r.sync=k;return{subscribe:function(b,d){e(b);f.push(b,d)},unsubscribe:e,redraw:r,render:n.render}}(window);L.setCompletionCallback(I.redraw);A.mount=function(b){return function(d,e){if(null===e)b.render(d,[]),b.unsubscribe(d);else{if(null==e.view&&"function"!==typeof e)throw Error("m.mount(element, component) expects a component, not a vnode");var k=function(){b.render(d,y(e))};b.subscribe(d,k);k()}}}(I);var U=w,M=function(b){if(""===b||null==b)return{};"?"===b.charAt(0)&&
  (b=b.slice(1));b=b.split("&");for(var d={},e={},k=0;k<b.length;k++){var n=b[k].split("=");var f=decodeURIComponent(n[0]);n=2===n.length?decodeURIComponent(n[1]):"";"true"===n?n=!0:"false"===n&&(n=!1);var g=f.split(/\]\[?|\[/),r=d;-1<f.indexOf("[")&&g.pop();for(var l=0;l<g.length;l++){f=g[l];var m=g[l+1];m=""==m||!isNaN(parseInt(m,10));var p=l===g.length-1;""===f&&(f=g.slice(0,l).join(),null==e[f]&&(e[f]=0),f=e[f]++);null==r[f]&&(r[f]=p?n:m?[]:{});r=r[f]}}return d},V=function(b){function d(d){var e=
  b.location[d].replace(/(?:%[a-f89][a-f0-9])+/gim,decodeURIComponent);"pathname"===d&&"/"!==e[0]&&(e="/"+e);return e}function e(b){return function(){null==g&&(g=f(function(){g=null;b()}))}}function k(b,d,e){var a=b.indexOf("?"),f=b.indexOf("#"),g=-1<a?a:-1<f?f:b.length;if(-1<a){a=M(b.slice(a+1,-1<f?f:b.length));for(var k in a)d[k]=a[k]}if(-1<f)for(k in d=M(b.slice(f+1)),d)e[k]=d[k];return b.slice(0,g)}var n="function"===typeof b.history.pushState,f="function"===typeof setImmediate?setImmediate:setTimeout,
  g,r={prefix:"#!",getPath:function(){switch(r.prefix.charAt(0)){case "#":return d("hash").slice(r.prefix.length);case "?":return d("search").slice(r.prefix.length)+d("hash");default:return d("pathname").slice(r.prefix.length)+d("search")+d("hash")}},setPath:function(d,e,f){var a={},g={};d=k(d,a,g);if(null!=e){for(var l in e)a[l]=e[l];d=d.replace(/:([^\/]+)/g,function(b,d){delete a[d];return e[d]})}(l=H(a))&&(d+="?"+l);(g=H(g))&&(d+="#"+g);n?(g=f?f.state:null,l=f?f.title:null,b.onpopstate(),f&&f.replace?
  b.history.replaceState(g,l,r.prefix+d):b.history.pushState(g,l,r.prefix+d)):b.location.href=r.prefix+d},defineRoutes:function(d,f,g){function a(){var a=r.getPath(),e={},l=k(a,e,e),p=b.history.state;if(null!=p)for(var m in p)e[m]=p[m];for(var n in d)if(p=new RegExp("^"+n.replace(/:[^\/]+?\.{3}/g,"(.*?)").replace(/:[^\/]+/g,"([^\\/]+)")+"/?$"),p.test(l)){l.replace(p,function(){for(var b=n.match(/:[^\/]+/g)||[],g=[].slice.call(arguments,1,-2),k=0;k<b.length;k++)e[b[k].replace(/:|\./g,"")]=decodeURIComponent(g[k]);
  f(d[n],e,a,n)});return}g(a,e)}n?b.onpopstate=e(a):"#"===r.prefix.charAt(0)&&(b.onhashchange=a);a()}};return r};A.route=function(b,d){var e=V(b),k=function(b){return b},n,f,g,r,l,m=function(b,a,m){function p(){null!=n&&d.render(b,n(y(f,g.key,g)))}if(null==b)throw Error("Ensure the DOM element that was passed to `m.route` is not undefined");var w=function(){p();w=d.redraw};d.subscribe(b,p);var z=function(b){if(b!==a)e.setPath(a,null,{replace:!0});else throw Error("Could not resolve default route "+
  a);};e.defineRoutes(m,function(a,b,d){var e=l=function(a,p){e===l&&(f=null==p||"function"!==typeof p.view&&"function"!==typeof p?"div":p,g=b,r=d,l=null,n=(a.render||k).bind(a),w())};a.view||"function"===typeof a?e({},a):a.onmatch?U.resolve(a.onmatch(b,d)).then(function(b){e(a,b)},z):e(a,"div")},z)};m.set=function(b,a,d){null!=l&&(d=d||{},d.replace=!0);l=null;e.setPath(b,a,d)};m.get=function(){return r};m.prefix=function(b){e.prefix=b};m.link=function(b){b.dom.setAttribute("href",e.prefix+b.attrs.href);
  b.dom.onclick=function(a){a.ctrlKey||a.metaKey||a.shiftKey||2===a.which||(a.preventDefault(),a.redraw=!1,a=this.getAttribute("href"),0===a.indexOf(e.prefix)&&(a=a.slice(e.prefix.length)),m.set(a,void 0,void 0))}};m.param=function(b){return"undefined"!==typeof g&&"undefined"!==typeof b?g[b]:g};return m}(window,I);A.withAttr=function(b,d,e){return function(k){d.call(e||this,b in k.currentTarget?k.currentTarget[b]:k.currentTarget.getAttribute(b))}};var W=Q(window);A.render=W.render;A.redraw=I.redraw;
  A.request=L.request;A.jsonp=L.jsonp;A.parseQueryString=M;A.buildQueryString=H;A.version="1.1.3";A.vnode=y;"undefined"!==typeof module?module.exports=A:window.m=A})();