Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mithril

Package Overview
Dependencies
Maintainers
2
Versions
160
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mithril - npm Package Compare versions

Comparing version 0.2.7 to 0.2.8

2

mithril.js

@@ -28,3 +28,3 @@ /* global Promise */

m.version = function () {
return "v0.2.5"
return "v0.2.8"
}

@@ -31,0 +31,0 @@

/*
Mithril v0.2.7
Mithril v0.2.8
https://mithril.js.org

@@ -7,3 +7,3 @@ (c) 2014-2017 Leo Horie

*/
!function(e,t){"use strict";var n=t(e);"undefined"==typeof window&&n.deps({document:"undefined"!=typeof document?document:{},location:"undefined"!=typeof location?location:{},clearTimeout:clearTimeout,setTimeout:setTimeout}),"object"==typeof module&&null!=module&&module.exports?module.exports=n:"function"==typeof define&&define.amd?define(function(){return n}):e.m=n}("undefined"!=typeof window?window:this,function e(t,n){"use strict";function r(e){return"function"==typeof e}function o(e){return"[object Object]"===Ae.call(e)}function a(e){return"[object String]"===Ae.call(e)}function i(){}function u(e){Ne=e.document,Te=e.location,Oe=e.cancelAnimationFrame||e.clearTimeout,ke=e.requestAnimationFrame||e.setTimeout}function l(e,t){for(var n,r=[],o=/(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g;n=o.exec(t);)if(""===n[1]&&n[2])e.tag=n[2];else if("#"===n[1])e.attrs.id=n[2];else if("."===n[1])r.push(n[2]);else if("["===n[3].charAt(0)){var a=n[6];a&&(a=a.replace(/\\(["'])/g,"$1")),"class"===n[4]?r.push(a):e.attrs[n[4]]=a||!0}return r}function c(e,t){var n=t?e.slice(1):e;return 1===n.length&&Se(n[0])?n[0]:n}function s(e,t,n){var r="class"in t?"class":"className";for(var o in t)je.call(t,o)&&(o===r&&null!=t[o]&&""!==t[o]?(n.push(t[o]),e[o]=""):e[o]=t[o]);n.length&&(e[r]=n.join(" "))}function d(e,t){for(var n=[],i=1,u=arguments.length;i<u;i++)n[i-1]=arguments[i];if(e&&r(e.view))return oe(e,n);if(!a(e))throw new Error("selector in m(selector, attrs, children) should be a string");var d=null!=t&&o(t)&&!("tag"in t||"view"in t||"subtree"in t),f=d?t:{},h={tag:"div",attrs:{},children:c(n,d)};return s(h.attrs,f,l(h,e)),h}function f(e,t){for(var n=0;n<e.length&&!t(e[n],n++););}function h(e,t){f(e,function(e,n){return(e=e&&e.attrs)&&null!=e.key&&t(e,n)})}function p(e){try{if("boolean"!=typeof e&&null!=e&&null!=e.toString())return e}catch(e){}return""}function v(e,t,n,r){try{g(e,t,n),t.nodeValue=r}catch(e){}}function m(e){for(var t=0;t<e.length;t++)Se(e[t])&&(e=e.concat.apply([],e),t--);return e}function g(e,t,n){e.insertBefore(t,e.childNodes[n]||null)}function y(e,t,n,r){h(e,function(e,r){t[e=e.key]=t[e]?{action:De,index:r,from:t[e].index,element:n.nodes[t[e].index]||Ne.createElement("div")}:{action:Le,index:r}});var o=[];for(var a in t)je.call(t,a)&&o.push(t[a]);var i=o.sort(_),u=new Array(n.length);return u.nodes=n.nodes.slice(),f(i,function(t){var o=t.index;if(t.action===Me&&(Q(n[o].nodes,n[o]),u.splice(o,1)),t.action===Le){var a=Ne.createElement("div");a.key=e[o].attrs.key,g(r,a,o),u.splice(o,0,{attrs:{key:e[o].attrs.key},nodes:[a]}),u.nodes[o]=a}if(t.action===De){var i=t.element,l=r.childNodes[o];l!==i&&null!==i&&r.insertBefore(i,l||null),u[o]=n[t.from],u.nodes[o]=i}}),u}function w(e,t,n,r){var o=e.length!==t.length;return o||h(e,function(e,n){var r=t[n];return o=r&&r.attrs&&r.attrs.key!==e.key}),o?y(e,n,t,r):t}function E(e,t,n){f(e,function(e,r){null!=t[r]&&n.push.apply(n,t[r].nodes)}),f(t.nodes,function(e,r){null!=e.parentNode&&n.indexOf(e)<0&&Q([e],[t[r]])}),e.length<t.length&&(t.length=e.length),t.nodes=n}function x(e){var t=0;h(e,function(){return f(e,function(e){(e=e&&e.attrs)&&null==e.key&&(e.key="__mithril__"+t++)}),1})}function C(e,t,n){return e.tag!==t.tag||(n.sort().join()!==Object.keys(t.attrs).sort().join()||(e.attrs.id!==t.attrs.id||(e.attrs.key!==t.attrs.key||("all"===d.redraw.strategy()?!t.configContext||!0!==t.configContext.retain:"diff"===d.redraw.strategy()&&(t.configContext&&!1===t.configContext.retain)))))}function b(e,t,n){C(e,t,n)&&(t.nodes.length&&Q(t.nodes),t.configContext&&r(t.configContext.onunload)&&t.configContext.onunload(),t.controllers&&f(t.controllers,function(e){e.onunload&&e.onunload({preventDefault:i})}))}function N(e,t){return e.attrs.xmlns?e.attrs.xmlns:"svg"===e.tag?"http://www.w3.org/2000/svg":"math"===e.tag?"http://www.w3.org/1998/Math/MathML":t}function T(e,t,n){n.length&&(e.views=t,e.controllers=n,f(n,function(e){if(e.onunload&&e.onunload.$old&&(e.onunload=e.onunload.$old),Ie&&e.onunload){var t=e.onunload;e.onunload=function(){},e.onunload.$old=t}}))}function k(e,t,n,o,a){if(r(t.attrs.config)){var i=a.configContext=a.configContext||{};e.push(function(){return t.attrs.config.call(t,n,!o,i,a)})}}function O(e,t,r,o,a,i,u,l){var c=e.nodes[0];return o&&V(c,t.tag,t.attrs,e.attrs,a),e.children=K(c,t.tag,n,n,t.children,e.children,!1,0,t.attrs.contenteditable?c:r,a,u),e.nodes.intact=!0,l.length&&(e.views=i,e.controllers=l),c}function j(e,t,n){var r;e.$trusted?r=ee(t,n,e):(r=[Ne.createTextNode(e)],t.nodeName in Re||g(t,r[0],n));var o;return o="string"==typeof e||"number"==typeof e||"boolean"==typeof e?new e.constructor(e):e,o.nodes=r,o}function A(e,t,n,r,o,a){var i=t.nodes;return r&&r===Ne.activeElement&&e===t||(e.$trusted?(Q(i,t),i=ee(n,o,e)):"textarea"===a?n.value=e:r?(r.innerHTML=e,i=[].slice.call(r.childNodes)):((1===i[0].nodeType||i.length>1||i[0].nodeValue.trim&&!i[0].nodeValue.trim())&&(Q(t.nodes,t),i=[Ne.createTextNode(e)]),v(n,i[0],o,e))),t=new e.constructor(e),t.nodes=i,t.$trusted=e.$trusted,t}function S(e,t,n,r,o,a,i){return e.nodes.length?e.valueOf()!==t.valueOf()||o?A(t,e,r,a,n,i):(e.nodes.intact=!0,e):j(t,r,n)}function R(e){return e.$trusted?e.nodes.length:Se(e)?e.length:1}function M(e,t,r,o,a,i,u,l,c){e=m(e);var s=[],d=t.length===e.length,f=0,p={},v=!1;h(t,function(e,n){v=!0,p[t[n].attrs.key]={action:Me,index:n}}),x(e),v&&(t=w(e,t,p,r));for(var g=0,y=0,C=e.length;y<C;y++){var b=K(r,a,t,o,e[y],t[g],i,o+f||f,u,l,c);b!==n&&(d=d&&b.nodes.intact,f+=R(b),t[g++]=b)}return d||E(e,t,s),t}function L(e,t,n,r,o){if(null!=t){if(Ae.call(t)===Ae.call(e))return t;if(o&&o.nodes){var a=n-r,i=a+(Se(e)?e:t.nodes).length;Q(o.nodes.slice(a,i),o.slice(a,i))}else t.nodes&&Q(t.nodes,t)}return(t=new e.constructor).tag&&(t={}),t.nodes=[],t}function D(e,t){return e.attrs.is?null==t?Ne.createElement(e.tag,e.attrs.is):Ne.createElementNS(t,e.tag,e.attrs.is):null==t?Ne.createElement(e.tag):Ne.createElementNS(t,e.tag)}function I(e,t,n,r){return r?V(t,e.tag,e.attrs,{},n):e.attrs}function $(e,t,r,o,a,i){return null!=e.children&&e.children.length>0?K(t,e.tag,n,n,e.children,r.children,!0,0,e.attrs.contenteditable?t:o,a,i):e.children}function U(e,t,n,r,o,a,i){var u={tag:e.tag,attrs:t,children:n,nodes:[r]};return T(u,a,i),u.children&&!u.children.nodes&&(u.children.nodes=[]),u}function q(e,t,n,o){var a;return(a="diff"===d.redraw.strategy()&&e?e.indexOf(t):-1)>-1?n[a]:r(o)?new o:{}}function z(e,t,n,r){null!=r.onunload&&Ue.map(function(e){return e.handler}).indexOf(r.onunload)<0&&Ue.push({controller:r,handler:r.onunload}),e.push(n),t.push(r)}function H(e,t,n,r,o,a){var i=q(n.views,t,r,e.controller),u=e&&e.attrs&&e.attrs.key;return"retain"===(e=0===Ie||qe||r&&r.indexOf(i)>-1?e.view(i):{tag:"placeholder"}).subtree?e:(e.attrs=e.attrs||{},e.attrs.key=u,z(a,o,t,i),e)}function J(e,t,n,r){for(var o=t&&t.controllers;null!=e.view;)e=H(e,e.view.$original||e.view,t,o,r,n);return e}function B(e,t,n,r,o,i,u,l){var c=[],s=[];if("retain"===(e=J(e,t,c,s)).subtree)return t;if(!e.tag&&s.length)throw new Error("Component template must return a virtual element, not an array, string, etc.");e.attrs=e.attrs||{},t.attrs=t.attrs||{};var d=Object.keys(e.attrs),f=d.length>("key"in e.attrs?1:0);if(b(e,t,d),a(e.tag)){var h=0===t.nodes.length;u=N(e,u);var p;if(h){var v=I(e,p=D(e,u),u,f);g(r,p,o),t=U(e,v,$(e,p,t,n,u,l),p,u,c,s)}else p=O(t,e,n,f,u,c,l,s);return"select"===e.tag&&"value"in e.attrs&&V(p,e.tag,{value:e.attrs.value},{},u),h||!0!==i||null==p||g(r,p,o),k(l,e,p,h,t),t}}function K(e,t,n,a,i,u,l,c,s,d,f){return"retain"===(i=p(i)).subtree?u:(u=L(i,u,c,a,n),Se(i)?M(i,u,e,c,t,l,s,d,f):null!=i&&o(i)?B(i,u,s,e,c,l,d,f):r(i)?u:S(u,i,c,e,l,s,t))}function _(e,t){return e.action-t.action||e.index-t.index}function F(e,t,n){n===t&&(e.style="",n={});for(var r in t)je.call(t,r)&&(null!=n&&n[r]===t[r]||(e.style[r]=t[r]));for(r in n)je.call(n,r)&&(je.call(t,r)||(e.style[r]=""))}function G(e,t,n,a,i,u){if("config"===t||"key"===t)return!0;if(r(n)&&"on"===t.slice(0,2))e[t]=te(n,e);else if("style"===t&&null!=n&&o(n))F(e,n,a);else if(null!=u)"href"===t?e.setAttributeNS("http://www.w3.org/1999/xlink","href",n):e.setAttribute("className"===t?"class":t,n);else if(t in e&&!ze[t])try{("input"!==i&&!e.isContentEditable||e[t]!=n)&&(e[t]=n)}catch(r){e.setAttribute(t,n)}else try{e.setAttribute(t,n)}catch(e){}}function P(e,t,n,r,o,a,i){if(t in o&&r===n&&"object"!=typeof n&&Ne.activeElement!==e)"value"===t&&"input"===a&&e.value!=n&&(e.value=n);else{o[t]=n;try{return G(e,t,n,r,a,i)}catch(e){if(e.message.indexOf("Invalid argument")<0)throw e}}}function V(e,t,n,r,o){for(var a in n)!je.call(n,a)||P(e,a,n[a],r[a],r,t,o);return r}function Q(e,t){for(var n=e.length-1;n>-1;n--)if(e[n]&&e[n].parentNode){try{e[n].parentNode.removeChild(e[n])}catch(e){}(t=[].concat(t))[n]&&Y(t[n])}e.length&&(e.length=0)}function Y(e){e.configContext&&r(e.configContext.onunload)&&(e.configContext.onunload(),e.configContext.onunload=null),e.controllers&&f(e.controllers,function(e){r(e.onunload)&&e.onunload({preventDefault:i})}),e.children&&(Se(e.children)?f(e.children,Y):e.children.tag&&Y(e.children))}function W(e,t){try{e.appendChild(Ne.createRange().createContextualFragment(t))}catch(n){e.insertAdjacentHTML("beforeend",t),X(e)}}function X(e){if("SCRIPT"===e.tagName)e.parentNode.replaceChild(Z(e),e);else{var t=e.childNodes;if(t&&t.length)for(var n=0;n<t.length;n++)X(t[n])}return e}function Z(e){for(var t=document.createElement("script"),n=e.attributes,r=0;r<n.length;r++)t.setAttribute(n[r].name,n[r].value);return t.text=e.innerHTML,t}function ee(e,t,n){var r=e.childNodes[t];if(r){var o=1!==r.nodeType,a=Ne.createElement("span");o?(e.insertBefore(a,r||null),a.insertAdjacentHTML("beforebegin",n),e.removeChild(a)):r.insertAdjacentHTML("beforebegin",n)}else W(e,n);for(var i=[];e.childNodes[t]!==r;)i.push(e.childNodes[t]),t++;return i}function te(e,t){return function(n){n=n||event,d.redraw.strategy("diff"),d.startComputation();try{return e.call(t,n)}finally{le()}}}function ne(e){var t=Je.indexOf(e);return t<0?Je.push(e)-1:t}function re(e){function t(){return arguments.length&&(e=arguments[0]),e}return t.toJSON=function(){return e&&r(e.toJSON)?e.toJSON():e},t}function oe(e,t){function n(){return(e.controller||i).apply(this,t)||this}function r(n){for(var r=[n].concat(t),o=1;o<arguments.length;o++)r.push(arguments[o]);return e.view.apply(e,r)}e.controller&&(n.prototype=e.controller.prototype),r.$original=e.view;var o={controller:n,view:r};return t[0]&&null!=t[0].key&&(o.attrs={key:t[0].key}),o}function ae(e,t,n,r){if(!r){d.redraw.strategy("all"),d.startComputation(),_e[n]=t;var o;o=Ke=e||(e={controller:i});var a=new(e.controller||i);return o===Ke&&(Ge[n]=a,Fe[n]=e),le(),null===e&&ie(t,n),Ge[n]}null==e&&ie(t,n),Xe&&(We=Xe)}function ie(e,t){_e.splice(t,1),Ge.splice(t,1),Fe.splice(t,1),ve(e),Je.splice(ne(e),1),Ue=[]}function ue(){Qe&&(Qe(),Qe=null),f(_e,function(e,t){var n=Fe[t];if(Ge[t]){var r=[Ge[t]];d.render(e,n.view?n.view(Ge[t],r):"")}}),Ye&&(Ye(),Ye=null),Pe=null,Ve=new Date,d.redraw.strategy("diff")}function le(){"none"===d.redraw.strategy()?(Ie--,d.redraw.strategy("diff")):d.endComputation()}function ce(e){return e.slice(tt[d.route.mode].length)}function se(e,t,n){et={};var r=n.indexOf("?");-1!==r&&(et=pe(n.substr(r+1,n.length)),n=n.substr(0,r));var o=Object.keys(t),a=o.indexOf(n);if(-1!==a)return d.mount(e,t[o[a]]),!0;for(var i in t)if(je.call(t,i)){if(i===n)return d.mount(e,t[i]),!0;var u=new RegExp("^"+i.replace(/:[^\/]+?\.{3}/g,"(.*?)").replace(/:[^\/]+/g,"([^\\/]+)")+"/?$");if(u.test(n))return n.replace(u,function(){var n=i.match(/:[^\/]+/g)||[],r=[].slice.call(arguments,1,-2);f(n,function(e,t){et[e.replace(/:|\./g,"")]=decodeURIComponent(r[t])}),d.mount(e,t[i])}),!0}}function de(e){if(!((e=e||event).ctrlKey||e.metaKey||e.shiftKey||2===e.which)){e.preventDefault?e.preventDefault():e.returnValue=!1;var t,n=e.currentTarget||e.srcElement;for(t="pathname"===d.route.mode&&n.search?pe(n.search.slice(1)):{};n&&!/a/i.test(n.nodeName);)n=n.parentNode;Ie=0,d.route(n[d.route.mode].slice(tt[d.route.mode].length),t)}}function fe(){"hash"!==d.route.mode&&Te.hash?Te.hash=Te.hash:t.scrollTo(0,0)}function he(e,t){var r={},a=[];for(var i in e)if(je.call(e,i)){var u=t?t+"["+i+"]":i,l=e[i];if(null===l)a.push(encodeURIComponent(u));else if(o(l))a.push(he(l,u));else if(Se(l)){var c=[];r[u]=r[u]||{},f(l,function(e){r[u][e]||(r[u][e]=!0,c.push(encodeURIComponent(u)+"="+encodeURIComponent(e)))}),a.push(c.join("&"))}else l!==n&&a.push(encodeURIComponent(u)+"="+encodeURIComponent(l))}return a.join("&")}function pe(e){if(""===e||null==e)return{};"?"===e.charAt(0)&&(e=e.slice(1));var t={};return f(e.split("&"),function(e){var n=e.split("="),r=decodeURIComponent(n[0]),o=2===n.length?decodeURIComponent(n[1]):null;null!=t[r]?(Se(t[r])||(t[r]=[t[r]]),t[r].push(o)):t[r]=o}),t}function ve(e){var t=ne(e);Q(e.childNodes,Be[t]),Be[t]=n}function me(e,t){var n=d.prop(t);return e.then(n),n.then=function(n,r){return me(e.then(n,r),t)},n.catch=n.then.bind(null,null),n}function ge(e,t){function n(e){l=e||ut,s.map(function(e){l===it?e.resolve(c):e.reject(c)})}function a(e,t,n,a){if((null!=c&&o(c)||r(c))&&r(e))try{var i=0;e.call(c,function(e){i++||(c=e,t())},function(e){i++||(c=e,n())})}catch(e){d.deferred.onerror(e),c=e,n()}else a()}function i(){var o;try{o=c&&c.then}catch(e){return d.deferred.onerror(e),c=e,l=at,i()}l===at&&d.deferred.onerror(c),a(o,function(){l=ot,i()},function(){l=at,i()},function(){try{l===ot&&r(e)?c=e(c):l===at&&r(t)&&(c=t(c),l=ot)}catch(e){return d.deferred.onerror(e),c=e,n()}c===u?(c=TypeError(),n()):a(o,function(){n(it)},n,function(){n(l===ot&&it)})})}var u=this,l=0,c=0,s=[];u.promise={},u.resolve=function(e){return l||(c=e,l=ot,i()),u},u.reject=function(e){return l||(c=e,l=at,i()),u},u.promise.then=function(e,t){var n=new ge(e,t);return l===it?n.resolve(c):l===ut?n.reject(c):s.push(n),n.promise}}function ye(e){return e}function we(e){var r=e.callbackName||"mithril_callback_"+(new Date).getTime()+"_"+Math.round(1e16*Math.random()).toString(36),o=Ne.createElement("script");t[r]=function(a){o.parentNode.removeChild(o),e.onload({type:"load",target:{responseText:a}}),t[r]=n},o.onerror=function(){return o.parentNode.removeChild(o),e.onerror({type:"error",target:{status:500,responseText:JSON.stringify({error:"Error making jsonp request"})}}),t[r]=n,!1},o.onload=function(){return!1},o.src=e.url+(e.url.indexOf("?")>0?"&":"?")+(e.callbackKey?e.callbackKey:"callback")+"="+r+"&"+he(e.data||{}),Ne.body.appendChild(o)}function Ee(e){var n=new t.XMLHttpRequest;if(n.open(e.method,e.url,!0,e.user,e.password),n.onreadystatechange=function(){4===n.readyState&&(n.status>=200&&n.status<300?e.onload({type:"load",target:n}):e.onerror({type:"error",target:n}))},e.serialize===JSON.stringify&&e.data&&"GET"!==e.method&&n.setRequestHeader("Content-Type","application/json; charset=utf-8"),e.deserialize===JSON.parse&&n.setRequestHeader("Accept","application/json, text/*"),o(e.headers))for(var i in e.headers)je.call(e.headers,i)&&n.setRequestHeader(i,e.headers[i]);if(r(e.config)){var u=e.config(n,e);null!=u&&(n=u)}var l="GET"!==e.method&&e.data?e.data:"";if(l&&!a(l)&&l.constructor!==t.FormData)throw new Error("Request data should be either be a string or FormData. Check the `serialize` option in `m.request`");return n.send(l),n}function xe(e){return e.dataType&&"jsonp"===e.dataType.toLowerCase()?we(e):Ee(e)}function Ce(e,t,n){if("GET"===e.method&&"jsonp"!==e.dataType){var r=e.url.indexOf("?")<0?"?":"&",o=he(t);e.url+=o?r+o:""}else e.data=n(t)}function be(e,t){return t&&(e=e.replace(/:[a-z]\w+/gi,function(e){var n=e.slice(1),r=t[n]||e;return delete t[n],r})),e}d.version=function(){return"v0.2.5"};var Ne,Te,ke,Oe,je={}.hasOwnProperty,Ae={}.toString,Se=Array.isArray||function(e){return"[object Array]"===Ae.call(e)},Re={AREA:1,BASE:1,BR:1,COL:1,COMMAND:1,EMBED:1,HR:1,IMG:1,INPUT:1,KEYGEN:1,LINK:1,META:1,PARAM:1,SOURCE:1,TRACK:1,WBR:1};d.deps=function(e){return u(t=e||window),t},d.deps.factory=d.factory=e,d.deps(t);var Me=1,Le=2,De=3,Ie=0;d.startComputation=function(){Ie++},d.endComputation=function(){Ie>1?Ie--:(Ie=0,d.redraw())};var $e,Ue=[],qe=!1,ze={list:1,style:1,form:1,type:1,width:1,height:1},He={appendChild:function(e){$e===n&&($e=Ne.createElement("html")),Ne.documentElement&&Ne.documentElement!==e?Ne.replaceChild(e,Ne.documentElement):Ne.appendChild(e),this.childNodes=Ne.childNodes},insertBefore:function(e){this.appendChild(e)},childNodes:[]},Je=[],Be={};d.render=function(e,t,r){if(!e)throw new Error("Ensure the DOM element being passed to m.route/m.mount/m.render is not undefined.");var o,a=[],i=ne(e),u=e===Ne;o=u||e===Ne.documentElement?He:e,u&&"html"!==t.tag&&(t={tag:"html",attrs:{},children:t}),Be[i]===n&&Q(o.childNodes),!0===r&&ve(e),Be[i]=K(o,null,n,n,t,Be[i],!1,0,null,n,a),f(a,function(e){e()})},d.trust=function(e){return e=new String(e),e.$trusted=!0,e},d.prop=function(e){return(null!=e&&(o(e)||r(e))||"undefined"!=typeof Promise&&e instanceof Promise)&&r(e.then)?me(e):re(e)};var Ke,_e=[],Fe=[],Ge=[],Pe=null,Ve=0,Qe=null,Ye=null;d.component=function(e){for(var t=new Array(arguments.length-1),n=1;n<arguments.length;n++)t[n-1]=arguments[n];return oe(e,t)};var We,Xe;d.mount=d.module=function(e,t){if(!e)throw new Error("Ensure the DOM element being passed to m.route/m.mount/m.render is not undefined.");var n=_e.indexOf(e);n<0&&(n=_e.length);var o=!1,a={preventDefault:function(){o=!0,Qe=Ye=null}};return f(Ue,function(e){e.handler.call(e.controller,a),e.controller.onunload=null}),o?f(Ue,function(e){e.controller.onunload=e.handler}):Ue=[],Ge[n]&&r(Ge[n].onunload)&&Ge[n].onunload(a),ae(t,e,n,o)};var Ze=!1;d.redraw=function(e){if(!Ze){Ze=!0,e&&(qe=!0);try{Pe&&!e?(ke===t.requestAnimationFrame||new Date-Ve>16)&&(Pe>0&&Oe(Pe),Pe=ke(ue,16)):(ue(),Pe=ke(function(){Pe=null},16))}finally{Ze=qe=!1}}},d.redraw.strategy=d.prop(),d.withAttr=function(e,t,n){return function(r){var o=(r=r||window.event).currentTarget||this,a=n||this,i=e in o?o[e]:o.getAttribute(e);t.call(a,i)}};var et,tt={pathname:"",hash:"#",search:"?"},nt=i,rt=!1;d.route=function(e,n,r,o){if(0===arguments.length)return We;if(3===arguments.length&&a(n)){nt=function(t){var o=We=ce(t);if(!se(e,r,o)){if(rt)throw new Error("Ensure the default route matches one of the routes defined in m.route");rt=!0,d.route(n,!0),rt=!1}};var i="hash"===d.route.mode?"onhashchange":"onpopstate";return t[i]=function(){var e=Te[d.route.mode];"pathname"===d.route.mode&&(e+=Te.search),We!==ce(e)&&nt(e)},Qe=fe,void t[i]()}if(e.addEventListener||e.attachEvent){var u="pathname"!==d.route.mode?Te.pathname:"";return e.href=u+tt[d.route.mode]+o.attrs.href,void(e.addEventListener?(e.removeEventListener("click",de),e.addEventListener("click",de)):(e.detachEvent("onclick",de),e.attachEvent("onclick",de)))}if(a(e)){Xe=We,We=e;var l,c=n||{},s=We.indexOf("?");l=s>-1?pe(We.slice(s+1)):{};for(var f in c)je.call(c,f)&&(l[f]=c[f]);var h,p=he(l);h=s>-1?We.slice(0,s):We,p&&(We=h+(-1===h.indexOf("?")?"?":"&")+p);var v=!0===(3===arguments.length?r:n)||Xe===We;if(t.history.pushState){var m=v?"replaceState":"pushState";Qe=fe,Ye=function(){try{t.history[m](null,Ne.title,tt[d.route.mode]+We)}catch(e){Te[d.route.mode]=We}},nt(tt[d.route.mode]+We)}else Te[d.route.mode]=We,nt(tt[d.route.mode]+We);Xe=null}},d.route.param=function(e){if(!et)throw new Error("You must call m.route(element, defaultRoute, routes) before calling m.route.param()");return e?et[e]:et},d.route.mode="search",d.route.buildQueryString=he,d.route.parseQueryString=pe,d.deferred=function(){var e=new ge;return e.promise=me(e.promise),e};var ot=1,at=2,it=3,ut=4;return d.deferred.onerror=function(e){if("[object Error]"===Ae.call(e)&&!/ Error/.test(e.constructor.toString()))throw Ie=0,e},d.sync=function(e){function t(e,t){return function(i){return o[e]=i,t||(a="reject"),0==--r&&(n.promise(o),n[a](o)),i}}var n=d.deferred(),r=e.length,o=[],a="resolve";return e.length>0?f(e,function(e,n){e.then(t(n,!0),t(n,!1))}):n.resolve([]),n.promise},d.request=function(e){!0!==e.background&&d.startComputation();var t,n,r,o=new ge;return e.dataType&&"jsonp"===e.dataType.toLowerCase()?(t=e.serialize=n=e.deserialize=ye,r=function(e){return e.responseText}):(t=e.serialize=e.serialize||JSON.stringify,n=e.deserialize=e.deserialize||JSON.parse,r=e.extract||function(e){return e.responseText.length||n!==JSON.parse?e.responseText:null}),e.method=(e.method||"GET").toUpperCase(),e.url=be(e.url,e.data),Ce(e,e.data,t),e.onload=e.onerror=function(t){try{t=t||event;var a=n(r(t.target,e));"load"===t.type?(e.unwrapSuccess&&(a=e.unwrapSuccess(a,t.target)),Se(a)&&e.type?f(a,function(t,n){a[n]=new e.type(t)}):e.type&&(a=new e.type(a)),o.resolve(a)):(e.unwrapError&&(a=e.unwrapError(a,t.target)),o.reject(a))}catch(e){o.reject(e),d.deferred.onerror(e)}finally{!0!==e.background&&d.endComputation()}},xe(e),o.promise=me(o.promise,e.initialValue),o.promise},d});
!function(e,t){"use strict";var n=t(e);"undefined"==typeof window&&n.deps({document:"undefined"!=typeof document?document:{},location:"undefined"!=typeof location?location:{},clearTimeout:clearTimeout,setTimeout:setTimeout}),"object"==typeof module&&null!=module&&module.exports?module.exports=n:"function"==typeof define&&define.amd?define(function(){return n}):e.m=n}("undefined"!=typeof window?window:this,function e(t,n){"use strict";function r(e){return"function"==typeof e}function o(e){return"[object Object]"===Ae.call(e)}function a(e){return"[object String]"===Ae.call(e)}function i(){}function u(e){Ne=e.document,Te=e.location,Oe=e.cancelAnimationFrame||e.clearTimeout,ke=e.requestAnimationFrame||e.setTimeout}function l(e,t){for(var n,r=[],o=/(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g;n=o.exec(t);)if(""===n[1]&&n[2])e.tag=n[2];else if("#"===n[1])e.attrs.id=n[2];else if("."===n[1])r.push(n[2]);else if("["===n[3].charAt(0)){var a=n[6];a&&(a=a.replace(/\\(["'])/g,"$1")),"class"===n[4]?r.push(a):e.attrs[n[4]]=a||!0}return r}function c(e,t){var n=t?e.slice(1):e;return 1===n.length&&Se(n[0])?n[0]:n}function s(e,t,n){var r="class"in t?"class":"className";for(var o in t)je.call(t,o)&&(o===r&&null!=t[o]&&""!==t[o]?(n.push(t[o]),e[o]=""):e[o]=t[o]);n.length&&(e[r]=n.join(" "))}function d(e,t){for(var n=[],i=1,u=arguments.length;i<u;i++)n[i-1]=arguments[i];if(e&&r(e.view))return oe(e,n);if(!a(e))throw new Error("selector in m(selector, attrs, children) should be a string");var d=null!=t&&o(t)&&!("tag"in t||"view"in t||"subtree"in t),f=d?t:{},h={tag:"div",attrs:{},children:c(n,d)};return s(h.attrs,f,l(h,e)),h}function f(e,t){for(var n=0;n<e.length&&!t(e[n],n++););}function h(e,t){f(e,function(e,n){return(e=e&&e.attrs)&&null!=e.key&&t(e,n)})}function p(e){try{if("boolean"!=typeof e&&null!=e&&null!=e.toString())return e}catch(e){}return""}function v(e,t,n,r){try{g(e,t,n),t.nodeValue=r}catch(e){}}function m(e){for(var t=0;t<e.length;t++)Se(e[t])&&(e=e.concat.apply([],e),t--);return e}function g(e,t,n){e.insertBefore(t,e.childNodes[n]||null)}function y(e,t,n,r){h(e,function(e,r){t[e=e.key]=t[e]?{action:De,index:r,from:t[e].index,element:n.nodes[t[e].index]||Ne.createElement("div")}:{action:Le,index:r}});var o=[];for(var a in t)je.call(t,a)&&o.push(t[a]);var i=o.sort(_),u=new Array(n.length);return u.nodes=n.nodes.slice(),f(i,function(t){var o=t.index;if(t.action===Me&&(Q(n[o].nodes,n[o]),u.splice(o,1)),t.action===Le){var a=Ne.createElement("div");a.key=e[o].attrs.key,g(r,a,o),u.splice(o,0,{attrs:{key:e[o].attrs.key},nodes:[a]}),u.nodes[o]=a}if(t.action===De){var i=t.element,l=r.childNodes[o];l!==i&&null!==i&&r.insertBefore(i,l||null),u[o]=n[t.from],u.nodes[o]=i}}),u}function w(e,t,n,r){var o=e.length!==t.length;return o||h(e,function(e,n){var r=t[n];return o=r&&r.attrs&&r.attrs.key!==e.key}),o?y(e,n,t,r):t}function E(e,t,n){f(e,function(e,r){null!=t[r]&&n.push.apply(n,t[r].nodes)}),f(t.nodes,function(e,r){null!=e.parentNode&&n.indexOf(e)<0&&Q([e],[t[r]])}),e.length<t.length&&(t.length=e.length),t.nodes=n}function x(e){var t=0;h(e,function(){return f(e,function(e){(e=e&&e.attrs)&&null==e.key&&(e.key="__mithril__"+t++)}),1})}function C(e,t,n){return e.tag!==t.tag||(n.sort().join()!==Object.keys(t.attrs).sort().join()||(e.attrs.id!==t.attrs.id||(e.attrs.key!==t.attrs.key||("all"===d.redraw.strategy()?!t.configContext||!0!==t.configContext.retain:"diff"===d.redraw.strategy()&&(t.configContext&&!1===t.configContext.retain)))))}function b(e,t,n){C(e,t,n)&&(t.nodes.length&&Q(t.nodes),t.configContext&&r(t.configContext.onunload)&&t.configContext.onunload(),t.controllers&&f(t.controllers,function(e){e.onunload&&e.onunload({preventDefault:i})}))}function N(e,t){return e.attrs.xmlns?e.attrs.xmlns:"svg"===e.tag?"http://www.w3.org/2000/svg":"math"===e.tag?"http://www.w3.org/1998/Math/MathML":t}function T(e,t,n){n.length&&(e.views=t,e.controllers=n,f(n,function(e){if(e.onunload&&e.onunload.$old&&(e.onunload=e.onunload.$old),Ie&&e.onunload){var t=e.onunload;e.onunload=function(){},e.onunload.$old=t}}))}function k(e,t,n,o,a){if(r(t.attrs.config)){var i=a.configContext=a.configContext||{};e.push(function(){return t.attrs.config.call(t,n,!o,i,a)})}}function O(e,t,r,o,a,i,u,l){var c=e.nodes[0];return o&&V(c,t.tag,t.attrs,e.attrs,a),e.children=K(c,t.tag,n,n,t.children,e.children,!1,0,t.attrs.contenteditable?c:r,a,u),e.nodes.intact=!0,l.length&&(e.views=i,e.controllers=l),c}function j(e,t,n){var r;e.$trusted?r=ee(t,n,e):(r=[Ne.createTextNode(e)],t.nodeName in Re||g(t,r[0],n));var o;return o="string"==typeof e||"number"==typeof e||"boolean"==typeof e?new e.constructor(e):e,o.nodes=r,o}function A(e,t,n,r,o,a){var i=t.nodes;return r&&r===Ne.activeElement&&e===t||(e.$trusted?(Q(i,t),i=ee(n,o,e)):"textarea"===a?n.value=e:r?(r.innerHTML=e,i=[].slice.call(r.childNodes)):((1===i[0].nodeType||i.length>1||i[0].nodeValue.trim&&!i[0].nodeValue.trim())&&(Q(t.nodes,t),i=[Ne.createTextNode(e)]),v(n,i[0],o,e))),t=new e.constructor(e),t.nodes=i,t.$trusted=e.$trusted,t}function S(e,t,n,r,o,a,i){return e.nodes.length?e.valueOf()!==t.valueOf()||o?A(t,e,r,a,n,i):(e.nodes.intact=!0,e):j(t,r,n)}function R(e){return e.$trusted?e.nodes.length:Se(e)?e.length:1}function M(e,t,r,o,a,i,u,l,c){e=m(e);var s=[],d=t.length===e.length,f=0,p={},v=!1;h(t,function(e,n){v=!0,p[t[n].attrs.key]={action:Me,index:n}}),x(e),v&&(t=w(e,t,p,r));for(var g=0,y=0,C=e.length;y<C;y++){var b=K(r,a,t,o,e[y],t[g],i,o+f||f,u,l,c);b!==n&&(d=d&&b.nodes.intact,f+=R(b),t[g++]=b)}return d||E(e,t,s),t}function L(e,t,n,r,o){if(null!=t){if(Ae.call(t)===Ae.call(e))return t;if(o&&o.nodes){var a=n-r,i=a+(Se(e)?e:t.nodes).length;Q(o.nodes.slice(a,i),o.slice(a,i))}else t.nodes&&Q(t.nodes,t)}return(t=new e.constructor).tag&&(t={}),t.nodes=[],t}function D(e,t){return e.attrs.is?null==t?Ne.createElement(e.tag,e.attrs.is):Ne.createElementNS(t,e.tag,e.attrs.is):null==t?Ne.createElement(e.tag):Ne.createElementNS(t,e.tag)}function I(e,t,n,r){return r?V(t,e.tag,e.attrs,{},n):e.attrs}function $(e,t,r,o,a,i){return null!=e.children&&e.children.length>0?K(t,e.tag,n,n,e.children,r.children,!0,0,e.attrs.contenteditable?t:o,a,i):e.children}function U(e,t,n,r,o,a,i){var u={tag:e.tag,attrs:t,children:n,nodes:[r]};return T(u,a,i),u.children&&!u.children.nodes&&(u.children.nodes=[]),u}function q(e,t,n,o){var a;return(a="diff"===d.redraw.strategy()&&e?e.indexOf(t):-1)>-1?n[a]:r(o)?new o:{}}function z(e,t,n,r){null!=r.onunload&&Ue.map(function(e){return e.handler}).indexOf(r.onunload)<0&&Ue.push({controller:r,handler:r.onunload}),e.push(n),t.push(r)}function H(e,t,n,r,o,a){var i=q(n.views,t,r,e.controller),u=e&&e.attrs&&e.attrs.key;return"retain"===(e=0===Ie||qe||r&&r.indexOf(i)>-1?e.view(i):{tag:"placeholder"}).subtree?e:(e.attrs=e.attrs||{},e.attrs.key=u,z(a,o,t,i),e)}function J(e,t,n,r){for(var o=t&&t.controllers;null!=e.view;)e=H(e,e.view.$original||e.view,t,o,r,n);return e}function B(e,t,n,r,o,i,u,l){var c=[],s=[];if("retain"===(e=J(e,t,c,s)).subtree)return t;if(!e.tag&&s.length)throw new Error("Component template must return a virtual element, not an array, string, etc.");e.attrs=e.attrs||{},t.attrs=t.attrs||{};var d=Object.keys(e.attrs),f=d.length>("key"in e.attrs?1:0);if(b(e,t,d),a(e.tag)){var h=0===t.nodes.length;u=N(e,u);var p;if(h){var v=I(e,p=D(e,u),u,f);g(r,p,o),t=U(e,v,$(e,p,t,n,u,l),p,u,c,s)}else p=O(t,e,n,f,u,c,l,s);return"select"===e.tag&&"value"in e.attrs&&V(p,e.tag,{value:e.attrs.value},{},u),h||!0!==i||null==p||g(r,p,o),k(l,e,p,h,t),t}}function K(e,t,n,a,i,u,l,c,s,d,f){return"retain"===(i=p(i)).subtree?u:(u=L(i,u,c,a,n),Se(i)?M(i,u,e,c,t,l,s,d,f):null!=i&&o(i)?B(i,u,s,e,c,l,d,f):r(i)?u:S(u,i,c,e,l,s,t))}function _(e,t){return e.action-t.action||e.index-t.index}function F(e,t,n){n===t&&(e.style="",n={});for(var r in t)je.call(t,r)&&(null!=n&&n[r]===t[r]||(e.style[r]=t[r]));for(r in n)je.call(n,r)&&(je.call(t,r)||(e.style[r]=""))}function G(e,t,n,a,i,u){if("config"===t||"key"===t)return!0;if(r(n)&&"on"===t.slice(0,2))e[t]=te(n,e);else if("style"===t&&null!=n&&o(n))F(e,n,a);else if(null!=u)"href"===t?e.setAttributeNS("http://www.w3.org/1999/xlink","href",n):e.setAttribute("className"===t?"class":t,n);else if(t in e&&!ze[t])try{("input"!==i&&!e.isContentEditable||e[t]!=n)&&(e[t]=n)}catch(r){e.setAttribute(t,n)}else try{e.setAttribute(t,n)}catch(e){}}function P(e,t,n,r,o,a,i){if(t in o&&r===n&&"object"!=typeof n&&Ne.activeElement!==e)"value"===t&&"input"===a&&e.value!=n&&(e.value=n);else{o[t]=n;try{return G(e,t,n,r,a,i)}catch(e){if(e.message.indexOf("Invalid argument")<0)throw e}}}function V(e,t,n,r,o){for(var a in n)!je.call(n,a)||P(e,a,n[a],r[a],r,t,o);return r}function Q(e,t){for(var n=e.length-1;n>-1;n--)if(e[n]&&e[n].parentNode){try{e[n].parentNode.removeChild(e[n])}catch(e){}(t=[].concat(t))[n]&&Y(t[n])}e.length&&(e.length=0)}function Y(e){e.configContext&&r(e.configContext.onunload)&&(e.configContext.onunload(),e.configContext.onunload=null),e.controllers&&f(e.controllers,function(e){r(e.onunload)&&e.onunload({preventDefault:i})}),e.children&&(Se(e.children)?f(e.children,Y):e.children.tag&&Y(e.children))}function W(e,t){try{e.appendChild(Ne.createRange().createContextualFragment(t))}catch(n){e.insertAdjacentHTML("beforeend",t),X(e)}}function X(e){if("SCRIPT"===e.tagName)e.parentNode.replaceChild(Z(e),e);else{var t=e.childNodes;if(t&&t.length)for(var n=0;n<t.length;n++)X(t[n])}return e}function Z(e){for(var t=document.createElement("script"),n=e.attributes,r=0;r<n.length;r++)t.setAttribute(n[r].name,n[r].value);return t.text=e.innerHTML,t}function ee(e,t,n){var r=e.childNodes[t];if(r){var o=1!==r.nodeType,a=Ne.createElement("span");o?(e.insertBefore(a,r||null),a.insertAdjacentHTML("beforebegin",n),e.removeChild(a)):r.insertAdjacentHTML("beforebegin",n)}else W(e,n);for(var i=[];e.childNodes[t]!==r;)i.push(e.childNodes[t]),t++;return i}function te(e,t){return function(n){n=n||event,d.redraw.strategy("diff"),d.startComputation();try{return e.call(t,n)}finally{le()}}}function ne(e){var t=Je.indexOf(e);return t<0?Je.push(e)-1:t}function re(e){function t(){return arguments.length&&(e=arguments[0]),e}return t.toJSON=function(){return e&&r(e.toJSON)?e.toJSON():e},t}function oe(e,t){function n(){return(e.controller||i).apply(this,t)||this}function r(n){for(var r=[n].concat(t),o=1;o<arguments.length;o++)r.push(arguments[o]);return e.view.apply(e,r)}e.controller&&(n.prototype=e.controller.prototype),r.$original=e.view;var o={controller:n,view:r};return t[0]&&null!=t[0].key&&(o.attrs={key:t[0].key}),o}function ae(e,t,n,r){if(!r){d.redraw.strategy("all"),d.startComputation(),_e[n]=t;var o;o=Ke=e||(e={controller:i});var a=new(e.controller||i);return o===Ke&&(Ge[n]=a,Fe[n]=e),le(),null===e&&ie(t,n),Ge[n]}null==e&&ie(t,n),Xe&&(We=Xe)}function ie(e,t){_e.splice(t,1),Ge.splice(t,1),Fe.splice(t,1),ve(e),Je.splice(ne(e),1),Ue=[]}function ue(){Qe&&(Qe(),Qe=null),f(_e,function(e,t){var n=Fe[t];if(Ge[t]){var r=[Ge[t]];d.render(e,n.view?n.view(Ge[t],r):"")}}),Ye&&(Ye(),Ye=null),Pe=null,Ve=new Date,d.redraw.strategy("diff")}function le(){"none"===d.redraw.strategy()?(Ie--,d.redraw.strategy("diff")):d.endComputation()}function ce(e){return e.slice(tt[d.route.mode].length)}function se(e,t,n){et={};var r=n.indexOf("?");-1!==r&&(et=pe(n.substr(r+1,n.length)),n=n.substr(0,r));var o=Object.keys(t),a=o.indexOf(n);if(-1!==a)return d.mount(e,t[o[a]]),!0;for(var i in t)if(je.call(t,i)){if(i===n)return d.mount(e,t[i]),!0;var u=new RegExp("^"+i.replace(/:[^\/]+?\.{3}/g,"(.*?)").replace(/:[^\/]+/g,"([^\\/]+)")+"/?$");if(u.test(n))return n.replace(u,function(){var n=i.match(/:[^\/]+/g)||[],r=[].slice.call(arguments,1,-2);f(n,function(e,t){et[e.replace(/:|\./g,"")]=decodeURIComponent(r[t])}),d.mount(e,t[i])}),!0}}function de(e){if(!((e=e||event).ctrlKey||e.metaKey||e.shiftKey||2===e.which)){e.preventDefault?e.preventDefault():e.returnValue=!1;var t,n=e.currentTarget||e.srcElement;for(t="pathname"===d.route.mode&&n.search?pe(n.search.slice(1)):{};n&&!/a/i.test(n.nodeName);)n=n.parentNode;Ie=0,d.route(n[d.route.mode].slice(tt[d.route.mode].length),t)}}function fe(){"hash"!==d.route.mode&&Te.hash?Te.hash=Te.hash:t.scrollTo(0,0)}function he(e,t){var r={},a=[];for(var i in e)if(je.call(e,i)){var u=t?t+"["+i+"]":i,l=e[i];if(null===l)a.push(encodeURIComponent(u));else if(o(l))a.push(he(l,u));else if(Se(l)){var c=[];r[u]=r[u]||{},f(l,function(e){r[u][e]||(r[u][e]=!0,c.push(encodeURIComponent(u)+"="+encodeURIComponent(e)))}),a.push(c.join("&"))}else l!==n&&a.push(encodeURIComponent(u)+"="+encodeURIComponent(l))}return a.join("&")}function pe(e){if(""===e||null==e)return{};"?"===e.charAt(0)&&(e=e.slice(1));var t={};return f(e.split("&"),function(e){var n=e.split("="),r=decodeURIComponent(n[0]),o=2===n.length?decodeURIComponent(n[1]):null;null!=t[r]?(Se(t[r])||(t[r]=[t[r]]),t[r].push(o)):t[r]=o}),t}function ve(e){var t=ne(e);Q(e.childNodes,Be[t]),Be[t]=n}function me(e,t){var n=d.prop(t);return e.then(n),n.then=function(n,r){return me(e.then(n,r),t)},n.catch=n.then.bind(null,null),n}function ge(e,t){function n(e){l=e||ut,s.map(function(e){l===it?e.resolve(c):e.reject(c)})}function a(e,t,n,a){if((null!=c&&o(c)||r(c))&&r(e))try{var i=0;e.call(c,function(e){i++||(c=e,t())},function(e){i++||(c=e,n())})}catch(e){d.deferred.onerror(e),c=e,n()}else a()}function i(){var o;try{o=c&&c.then}catch(e){return d.deferred.onerror(e),c=e,l=at,i()}l===at&&d.deferred.onerror(c),a(o,function(){l=ot,i()},function(){l=at,i()},function(){try{l===ot&&r(e)?c=e(c):l===at&&r(t)&&(c=t(c),l=ot)}catch(e){return d.deferred.onerror(e),c=e,n()}c===u?(c=TypeError(),n()):a(o,function(){n(it)},n,function(){n(l===ot&&it)})})}var u=this,l=0,c=0,s=[];u.promise={},u.resolve=function(e){return l||(c=e,l=ot,i()),u},u.reject=function(e){return l||(c=e,l=at,i()),u},u.promise.then=function(e,t){var n=new ge(e,t);return l===it?n.resolve(c):l===ut?n.reject(c):s.push(n),n.promise}}function ye(e){return e}function we(e){var r=e.callbackName||"mithril_callback_"+(new Date).getTime()+"_"+Math.round(1e16*Math.random()).toString(36),o=Ne.createElement("script");t[r]=function(a){o.parentNode.removeChild(o),e.onload({type:"load",target:{responseText:a}}),t[r]=n},o.onerror=function(){return o.parentNode.removeChild(o),e.onerror({type:"error",target:{status:500,responseText:JSON.stringify({error:"Error making jsonp request"})}}),t[r]=n,!1},o.onload=function(){return!1},o.src=e.url+(e.url.indexOf("?")>0?"&":"?")+(e.callbackKey?e.callbackKey:"callback")+"="+r+"&"+he(e.data||{}),Ne.body.appendChild(o)}function Ee(e){var n=new t.XMLHttpRequest;if(n.open(e.method,e.url,!0,e.user,e.password),n.onreadystatechange=function(){4===n.readyState&&(n.status>=200&&n.status<300?e.onload({type:"load",target:n}):e.onerror({type:"error",target:n}))},e.serialize===JSON.stringify&&e.data&&"GET"!==e.method&&n.setRequestHeader("Content-Type","application/json; charset=utf-8"),e.deserialize===JSON.parse&&n.setRequestHeader("Accept","application/json, text/*"),o(e.headers))for(var i in e.headers)je.call(e.headers,i)&&n.setRequestHeader(i,e.headers[i]);if(r(e.config)){var u=e.config(n,e);null!=u&&(n=u)}var l="GET"!==e.method&&e.data?e.data:"";if(l&&!a(l)&&l.constructor!==t.FormData)throw new Error("Request data should be either be a string or FormData. Check the `serialize` option in `m.request`");return n.send(l),n}function xe(e){return e.dataType&&"jsonp"===e.dataType.toLowerCase()?we(e):Ee(e)}function Ce(e,t,n){if("GET"===e.method&&"jsonp"!==e.dataType){var r=e.url.indexOf("?")<0?"?":"&",o=he(t);e.url+=o?r+o:""}else e.data=n(t)}function be(e,t){return t&&(e=e.replace(/:[a-z]\w+/gi,function(e){var n=e.slice(1),r=t[n]||e;return delete t[n],r})),e}d.version=function(){return"v0.2.8"};var Ne,Te,ke,Oe,je={}.hasOwnProperty,Ae={}.toString,Se=Array.isArray||function(e){return"[object Array]"===Ae.call(e)},Re={AREA:1,BASE:1,BR:1,COL:1,COMMAND:1,EMBED:1,HR:1,IMG:1,INPUT:1,KEYGEN:1,LINK:1,META:1,PARAM:1,SOURCE:1,TRACK:1,WBR:1};d.deps=function(e){return u(t=e||window),t},d.deps.factory=d.factory=e,d.deps(t);var Me=1,Le=2,De=3,Ie=0;d.startComputation=function(){Ie++},d.endComputation=function(){Ie>1?Ie--:(Ie=0,d.redraw())};var $e,Ue=[],qe=!1,ze={list:1,style:1,form:1,type:1,width:1,height:1},He={appendChild:function(e){$e===n&&($e=Ne.createElement("html")),Ne.documentElement&&Ne.documentElement!==e?Ne.replaceChild(e,Ne.documentElement):Ne.appendChild(e),this.childNodes=Ne.childNodes},insertBefore:function(e){this.appendChild(e)},childNodes:[]},Je=[],Be={};d.render=function(e,t,r){if(!e)throw new Error("Ensure the DOM element being passed to m.route/m.mount/m.render is not undefined.");var o,a=[],i=ne(e),u=e===Ne;o=u||e===Ne.documentElement?He:e,u&&"html"!==t.tag&&(t={tag:"html",attrs:{},children:t}),Be[i]===n&&Q(o.childNodes),!0===r&&ve(e),Be[i]=K(o,null,n,n,t,Be[i],!1,0,null,n,a),f(a,function(e){e()})},d.trust=function(e){return e=new String(e),e.$trusted=!0,e},d.prop=function(e){return(null!=e&&(o(e)||r(e))||"undefined"!=typeof Promise&&e instanceof Promise)&&r(e.then)?me(e):re(e)};var Ke,_e=[],Fe=[],Ge=[],Pe=null,Ve=0,Qe=null,Ye=null;d.component=function(e){for(var t=new Array(arguments.length-1),n=1;n<arguments.length;n++)t[n-1]=arguments[n];return oe(e,t)};var We,Xe;d.mount=d.module=function(e,t){if(!e)throw new Error("Ensure the DOM element being passed to m.route/m.mount/m.render is not undefined.");var n=_e.indexOf(e);n<0&&(n=_e.length);var o=!1,a={preventDefault:function(){o=!0,Qe=Ye=null}};return f(Ue,function(e){e.handler.call(e.controller,a),e.controller.onunload=null}),o?f(Ue,function(e){e.controller.onunload=e.handler}):Ue=[],Ge[n]&&r(Ge[n].onunload)&&Ge[n].onunload(a),ae(t,e,n,o)};var Ze=!1;d.redraw=function(e){if(!Ze){Ze=!0,e&&(qe=!0);try{Pe&&!e?(ke===t.requestAnimationFrame||new Date-Ve>16)&&(Pe>0&&Oe(Pe),Pe=ke(ue,16)):(ue(),Pe=ke(function(){Pe=null},16))}finally{Ze=qe=!1}}},d.redraw.strategy=d.prop(),d.withAttr=function(e,t,n){return function(r){var o=(r=r||window.event).currentTarget||this,a=n||this,i=e in o?o[e]:o.getAttribute(e);t.call(a,i)}};var et,tt={pathname:"",hash:"#",search:"?"},nt=i,rt=!1;d.route=function(e,n,r,o){if(0===arguments.length)return We;if(3===arguments.length&&a(n)){nt=function(t){var o=We=ce(t);if(!se(e,r,o)){if(rt)throw new Error("Ensure the default route matches one of the routes defined in m.route");rt=!0,d.route(n,!0),rt=!1}};var i="hash"===d.route.mode?"onhashchange":"onpopstate";return t[i]=function(){var e=Te[d.route.mode];"pathname"===d.route.mode&&(e+=Te.search),We!==ce(e)&&nt(e)},Qe=fe,void t[i]()}if(e.addEventListener||e.attachEvent){var u="pathname"!==d.route.mode?Te.pathname:"";return e.href=u+tt[d.route.mode]+o.attrs.href,void(e.addEventListener?(e.removeEventListener("click",de),e.addEventListener("click",de)):(e.detachEvent("onclick",de),e.attachEvent("onclick",de)))}if(a(e)){Xe=We,We=e;var l,c=n||{},s=We.indexOf("?");l=s>-1?pe(We.slice(s+1)):{};for(var f in c)je.call(c,f)&&(l[f]=c[f]);var h,p=he(l);h=s>-1?We.slice(0,s):We,p&&(We=h+(-1===h.indexOf("?")?"?":"&")+p);var v=!0===(3===arguments.length?r:n)||Xe===We;if(t.history.pushState){var m=v?"replaceState":"pushState";Qe=fe,Ye=function(){try{t.history[m](null,Ne.title,tt[d.route.mode]+We)}catch(e){Te[d.route.mode]=We}},nt(tt[d.route.mode]+We)}else Te[d.route.mode]=We,nt(tt[d.route.mode]+We);Xe=null}},d.route.param=function(e){if(!et)throw new Error("You must call m.route(element, defaultRoute, routes) before calling m.route.param()");return e?et[e]:et},d.route.mode="search",d.route.buildQueryString=he,d.route.parseQueryString=pe,d.deferred=function(){var e=new ge;return e.promise=me(e.promise),e};var ot=1,at=2,it=3,ut=4;return d.deferred.onerror=function(e){if("[object Error]"===Ae.call(e)&&!/ Error/.test(e.constructor.toString()))throw Ie=0,e},d.sync=function(e){function t(e,t){return function(i){return o[e]=i,t||(a="reject"),0==--r&&(n.promise(o),n[a](o)),i}}var n=d.deferred(),r=e.length,o=[],a="resolve";return e.length>0?f(e,function(e,n){e.then(t(n,!0),t(n,!1))}):n.resolve([]),n.promise},d.request=function(e){!0!==e.background&&d.startComputation();var t,n,r,o=new ge;return e.dataType&&"jsonp"===e.dataType.toLowerCase()?(t=e.serialize=n=e.deserialize=ye,r=function(e){return e.responseText}):(t=e.serialize=e.serialize||JSON.stringify,n=e.deserialize=e.deserialize||JSON.parse,r=e.extract||function(e){return e.responseText.length||n!==JSON.parse?e.responseText:null}),e.method=(e.method||"GET").toUpperCase(),e.url=be(e.url,e.data),Ce(e,e.data,t),e.onload=e.onerror=function(t){try{t=t||event;var a=n(r(t.target,e));"load"===t.type?(e.unwrapSuccess&&(a=e.unwrapSuccess(a,t.target)),Se(a)&&e.type?f(a,function(t,n){a[n]=new e.type(t)}):e.type&&(a=new e.type(a)),o.resolve(a)):(e.unwrapError&&(a=e.unwrapError(a,t.target)),o.reject(a))}catch(e){o.reject(e),d.deferred.onerror(e)}finally{!0!==e.background&&d.endComputation()}},xe(e),o.promise=me(o.promise,e.initialValue),o.promise},d});
//# sourceMappingURL=mithril.min.js.map
{
"name": "mithril",
"description": "Mithril.js - A Javascript Framework for Building Brilliant Applications",
"version": "0.2.7",
"version": "0.2.8",
"homepage": "https://mithril.js.org",

@@ -6,0 +6,0 @@ "license": "MIT",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc