example/dist/app.built.js
/* Riot v2.6.8, @license MIT */
!function(e,t){"use strict";function n(e,t,n){var r={};return r[e.key]=t,e.pos&&(r[e.pos]=n),r}function r(e,t){for(var n,r=t.length,o=e.length;r>o;)n=t[--r],t.splice(r,1),n.unmount()}function o(e,t){Object.keys(e.tags).forEach(function(n){var r=e.tags[n];I(r)?m(r,function(e){N(e,n,t)}):N(r,n,t)})}function i(e,t,n){var r,o=e._root;for(e._virts=[];o;)r=o.nextSibling,n?t.insertBefore(o,n._root):t.appendChild(o),e._virts.push(o),o=r}function a(e,t,n,r){for(var o,i=e._root,a=0;a<r;a++)o=i.nextSibling,t.insertBefore(i,n._root),i=o}function u(e,t,n,r,o,i,a){H(t.root)||(e?i(t,r,n,a.childNodes.length):r.insertBefore(t.root,n.root))}function s(e,t,s){w(e,"each");var c,f=typeof C(e,"no-reorder")!==re||w(e,"no-reorder"),p=T(e),d=J[p]||{tmpl:v(e)},g=ce.test(p),m=e.parentNode,h=document.createTextNode(""),x=S(e),b="option"===p.toLowerCase(),y=[],_=[],O="VIRTUAL"==e.tagName;s=me.loopKeys(s),m.insertBefore(h,e),t.one("before-mount",function(){e.parentNode.removeChild(e),m.stub&&(m=t.root)}).on("update",function(){var v=me(s.val,t),w=document.createDocumentFragment();I(v)||(c=v||!1,v=c?Object.keys(v).map(function(e){return n(s,e,v[e])}):[]);for(var C=0,S=v.length;C<S;C++){var E=v[C],N=f&&typeof E==oe&&!c,L=_.indexOf(E),j=~L&&N?L:C,T=y[j];E=!c&&s.key?n(s,E,C):E,!N&&!T||N&&!~L||!T?(T=new l(d,{parent:t,isLoop:!0,hasImpl:!!J[p],root:g?m:e.cloneNode(),item:E},e.innerHTML),T.mount(),O&&(T._root=T.root.firstChild),C!=y.length&&y[C]?(u(O,T,y[C],m,y,i,e),_.splice(C,0,E)):O?i(T,w):w.appendChild(T.root),y.splice(C,0,T),j=C):T.update(E,!0),j!==C&&N&&y[C]&&(A(v,_[C])&&u(O,T,y[C],m,y,a,e),s.pos&&(T[s.pos]=C),y.splice(C,0,y.splice(j,1)[0]),_.splice(C,0,_.splice(j,1)[0]),!x&&T.tags&&o(T,C)),T._item=E,M(T,"_parent",t)}if(r(v,y),m.insertBefore(w,h),b&&de&&!m.multiple)for(var R=0;R<m.length;R++)if(m[R].__riot1374){m.selectedIndex=R,delete m[R].__riot1374;break}x&&(t.tags[p]=y),_=v.slice()})}function c(e,t,n,r){F(e,function(e){if(1==e.nodeType){if(e.isLoop=e.isLoop||e.parentNode&&e.parentNode.isLoop||C(e,"each")?1:0,n){var o=S(e);o&&!e.isLoop&&n.push(L(o,{root:e,parent:t},e.innerHTML,t))}e.isLoop&&!r||Z(e,t,[])}})}function f(e,t,n){function r(e,t,r){me.hasExpr(t)&&n.push(R({dom:e,expr:t},r))}F(e,function(e){var n,o=e.nodeType;if(3==o&&"STYLE"!=e.parentNode.tagName&&r(e,e.nodeValue),1==o)return(n=C(e,"each"))?(s(e,t,n),!1):(m(e.attributes,function(t){var n=t.name,o=n.split("__")[1];if(r(e,t.value,{attr:o||n,bool:o}),o)return w(e,n),!1}),!S(e)&&void 0)})}function l(e,n,r){function o(){var e=b&&x?p:v||p;m(N.attributes,function(t){if(!(t.name in T)){var n=t.value;d[_(t.name)]=me.hasExpr(n)?me(n,e):n}}),m(Object.keys(T),function(t){d[_(t)]=me(T[t],e)})}function i(e){for(var t in C)typeof p[t]!==ie&&$(p,t)&&(p[t]=e[t])}function a(e){m(Object.keys(e),function(t){var n=!fe.test(t)&&A(F,t);(typeof p[t]===ie||n)&&(n||F.push(t),p[t]=e[t])})}function u(e){p.update(e,!0)}function s(e){if(m(E,function(t){t[e?"mount":"unmount"]()}),v){var t=e?"on":"off";x?v[t]("unmount",p.unmount):v[t]("update",u)[t]("unmount",p.unmount)}}var l,p=Q.observable(this),d=z(n.opts)||{},v=n.parent,x=n.isLoop,b=n.hasImpl,C=k(n.item),S=[],E=[],N=n.root,L=N.tagName.toLowerCase(),T={},F=[];e.name&&N._tag&&N._tag.unmount(!0),this.isMounted=!1,N.isLoop=x,N._tag=this,M(this,"_riot_id",++W),R(this,{parent:v,root:N,opts:d},C),M(this,"tags",{}),m(N.attributes,function(e){var t=e.value;me.hasExpr(t)&&(T[e.name]=t)}),l=he(e.tmpl,r,x),M(this,"update",function(e,t){return e=k(e),x&&a(p.parent),e&&y(C)&&(i(e),C=e),R(p,e),o(),p.trigger("update",e),g(S,p),t&&p.parent?p.parent.one("updated",function(){p.trigger("updated")}):xe(function(){p.trigger("updated")}),this}),M(this,"mixin",function(){return m(arguments,function(e){var t,n,r=[];e=typeof e===re?Q.mixin(e):e,t=h(e)?new e:e;var o=Object.getPrototypeOf(t);do{r=r.concat(Object.getOwnPropertyNames(n||t))}while(n=Object.getPrototypeOf(n||t));m(r,function(e){if("init"!=e){var n=Object.getOwnPropertyDescriptor(t,e)||Object.getOwnPropertyDescriptor(o,e),r=n&&(n.get||n.set);!p.hasOwnProperty(e)&&r?Object.defineProperty(p,e,n):p[e]=h(t[e])?t[e].bind(p):t[e]}}),t.init&&t.init.bind(p)()}),this}),M(this,"mount",function(){o();var t=Q.mixin(Y);if(t)for(var n in t)t.hasOwnProperty(n)&&p.mixin(t[n]);if(p._parent&&p._parent.root.isLoop&&a(p._parent),e.fn&&e.fn.call(p,d),f(l,p,S),s(!0),e.attrs&&P(e.attrs,function(e,t){O(N,e,t)}),(e.attrs||b)&&f(p.root,p,S),p.parent&&!x||p.update(C),p.trigger("before-mount"),x&&!b)N=l.firstChild;else{for(;l.firstChild;)N.appendChild(l.firstChild);N.stub&&(N=v.root)}M(p,"root",N),x&&c(p.root,p.parent,null,!0),!p.parent||p.parent.isMounted?(p.isMounted=!0,p.trigger("mount")):p.parent.one("mount",function(){H(p.root)||(p.parent.isMounted=p.isMounted=!0,p.trigger("mount"))})}),M(this,"unmount",function(e){var n,r=N,o=r.parentNode,i=X.indexOf(p);if(p.trigger("before-unmount"),~i&&X.splice(i,1),o){if(v)n=j(v),I(n.tags[L])?m(n.tags[L],function(e,t){e._riot_id==p._riot_id&&n.tags[L].splice(t,1)}):n.tags[L]=t;else for(;r.firstChild;)r.removeChild(r.firstChild);e?(w(o,ne),w(o,te)):o.removeChild(r)}this._virts&&m(this._virts,function(e){e.parentNode&&e.parentNode.removeChild(e)}),p.trigger("unmount"),s(),p.off("*"),p.isMounted=!1,delete N._tag}),c(l,this,E)}function p(t,n,r,o){r[t]=function(t){var i,a=o._parent,u=o._item;if(!u)for(;a&&!u;)u=a._item,a=a._parent;t=t||e.event,$(t,"currentTarget")&&(t.currentTarget=r),$(t,"target")&&(t.target=t.srcElement),$(t,"which")&&(t.which=t.charCode||t.keyCode),t.item=u,!0===n.call(o,t)||/radio|check/.test(r.type)||(t.preventDefault&&t.preventDefault(),t.returnValue=!1),t.preventUpdate||(i=u?j(a):o,i.update())}}function d(e,t,n){e&&(e.insertBefore(n,t),e.removeChild(t))}function g(e,t){m(e,function(e,n){var r=e.dom,o=e.attr,i=me(e.expr,t),a=e.parent||e.dom.parentNode;if(e.bool?i=!!i:null==i&&(i=""),e.value!==i){if(e.value=i,!o)return i+="",void(a&&(e.parent=a,"TEXTAREA"===a.tagName?(a.value=i,pe||(r.nodeValue=i)):r.nodeValue=i));if("value"===o)return void(r.value!==i&&(r.value=i,O(r,o,i)));if(w(r,o),h(i))p(o,i,r,t);else if("if"==o){var u=e.stub,s=function(){d(r.parentNode,r,u)};i?u&&(!function(){d(u.parentNode,u,r)}(),r.inStub=!1,H(r)||F(r,function(e){e._tag&&!e._tag.isMounted&&(e._tag.isMounted=!!e._tag.trigger("mount"))})):(u=e.stub=u||document.createTextNode(""),r.parentNode?s():(t.parent||t).one("updated",s),r.inStub=!0)}else"show"===o?r.style.display=i?"":"none":"hide"===o?r.style.display=i?"none":"":e.bool?(r[o]=i,i&&O(r,o,o),de&&"selected"===o&&"OPTION"===r.tagName&&(r.__riot1374=i)):(0===i||i&&typeof i!==oe)&&(G(o,ee)&&o!=te&&(o=o.slice(ee.length)),O(r,o,i))}})}function m(e,t){for(var n,r=e?e.length:0,o=0;o<r;o++)null!=(n=e[o])&&!1===t(n,o)&&o--;return e}function h(e){return typeof e===ae||!1}function v(e){if(e.outerHTML)return e.outerHTML;var t=D("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}function x(e,t){if(typeof e.innerHTML!=ie)e.innerHTML=t;else{var n=(new DOMParser).parseFromString(t,"application/xml");e.appendChild(e.ownerDocument.importNode(n.documentElement,!0))}}function b(e){return~le.indexOf(e)}function y(e){return e&&typeof e===oe}function w(e,t){e.removeAttribute(t)}function _(e){return e.replace(/-(\w)/g,function(e,t){return t.toUpperCase()})}function C(e,t){return e.getAttribute(t)}function O(e,t,n){var r=se.exec(t);r&&r[1]?e.setAttributeNS(ue,r[1],n):e.setAttribute(t,n)}function S(e){return e.tagName&&J[C(e,ne)||C(e,te)||e.tagName.toLowerCase()]}function E(e,t,n){var r=n.tags[t];r?(I(r)||r!==e&&(n.tags[t]=[r]),A(n.tags[t],e)||n.tags[t].push(e)):n.tags[t]=e}function N(e,t,n){var r,o=e.parent;o&&(r=o.tags[t],I(r)?r.splice(n,0,r.splice(r.indexOf(e),1)[0]):E(e,t,o))}function L(e,t,n,r){var o=new l(e,t,n),i=T(t.root),a=j(r);return o.parent=a,o._parent=r,E(o,i,a),a!==r&&E(o,i,r),t.root.innerHTML="",o}function j(e){for(var t=e;!S(t.root)&&t.parent;)t=t.parent;return t}function M(e,t,n,r){return Object.defineProperty(e,t,R({value:n,enumerable:!1,writable:!1,configurable:!0},r)),e}function T(e){var t=S(e),n=C(e,"name");return n&&!me.hasExpr(n)?n:t?t.name:e.tagName.toLowerCase()}function R(e){for(var t,n=arguments,r=1;r<n.length;++r)if(t=n[r])for(var o in t)$(e,o)&&(e[o]=t[o]);return e}function A(e,t){return~e.indexOf(t)}function I(e){return Array.isArray(e)||e instanceof Array}function $(e,t){var n=Object.getOwnPropertyDescriptor(e,t);return typeof e[t]===ie||n&&n.writable}function k(e){if(!(e instanceof l||e&&typeof e.trigger==ae))return e;var t={};for(var n in e)fe.test(n)||(t[n]=e[n]);return t}function F(e,t){if(e){if(!1===t(e))return;for(e=e.firstChild;e;)F(e,t),e=e.nextSibling}}function P(e,t){for(var n,r=/([-\w]+) ?= ?(?:"([^"]*)|'([^']*)|({[^}]*}))/g;n=r.exec(e);)t(n[1].toLowerCase(),n[2]||n[3]||n[4])}function H(e){for(;e;){if(e.inStub)return!0;e=e.parentNode}return!1}function D(e,t){return t?document.createElementNS("http://www.w3.org/2000/svg","svg"):document.createElement(e)}function q(e,t){return(t||document).querySelectorAll(e)}function B(e,t){return(t||document).querySelector(e)}function z(e){return Object.create(e||null)}function K(e){return C(e,"id")||C(e,"name")}function Z(e,t,n){var r,o=K(e),i=function(i){A(n,o)||(r=I(i),i?(!r||r&&!A(i,e))&&(r?i.push(e):t[o]=[i,e]):t[o]=e)};o&&(me.hasExpr(o)?t.one("mount",function(){o=K(e),i(t[o])}):i(t[o]))}function G(e,t){return e.slice(0,t.length)===t}function U(e,t,n){var r=J[t],o=e._innerHTML=e._innerHTML||e.innerHTML;return e.innerHTML="",r&&e&&(r=new l(r,{root:e,opts:n},o)),r&&r.mount&&(r.mount(),A(X,r)||X.push(r)),r}function V(e){var t=e.source,n=e.global?"g":"";e.ignoreCase&&(n+="i"),e.multiline&&(n+="m");for(var r=1;r<arguments.length;r++)t=t.replace("@","\\"+arguments[r]);return new RegExp(t,n)}var Q={version:"v2.6.8",settings:{}},W=0,X=[],J={},Y="__global_mixin",ee="riot-",te=ee+"tag",ne="data-is",re="string",oe="object",ie="undefined",ae="function",ue="http://www.w3.org/1999/xlink",se=/^xlink:(\w+)/,ce=/^(?:t(?:body|head|foot|[rhd])|caption|col(?:group)?|opt(?:ion|group))$/,fe=/^(?:_(?:item|id|parent)|update|root|(?:un)?mount|mixin|is(?:Mounted|Loop)|tags|parent|opts|trigger|o(?:n|ff|ne))$/,le=["altGlyph","animate","animateColor","circle","clipPath","defs","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","filter","font","foreignObject","g","glyph","glyphRef","image","line","linearGradient","marker","mask","missing-glyph","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","switch","symbol","text","textPath","tref","tspan","use"],pe=0|(e&&e.document||{}).documentMode,de=e&&!!e.InstallTrigger;Q.observable=function(e){function t(e,t){for(var n=e.split(" "),r=n.length,o=0;o<r;o++){var i=n[o];i&&t(i,o)}}e=e||{};var n={},r=Array.prototype.slice;return Object.defineProperties(e,{on:{value:function(r,o){return"function"!=typeof o?e:(t(r,function(e,t){(n[e]=n[e]||[]).push(o),o.typed=t>0}),e)},enumerable:!1,writable:!1,configurable:!1},off:{value:function(r,o){return"*"!=r||o?t(r,function(e,t){if(o)for(var r,i=n[e],a=0;r=i&&i[a];++a)r==o&&i.splice(a--,1);else delete n[e]}):n={},e},enumerable:!1,writable:!1,configurable:!1},one:{value:function(t,n){function r(){e.off(t,r),n.apply(e,arguments)}return e.on(t,r)},enumerable:!1,writable:!1,configurable:!1},trigger:{value:function(o){for(var i,a=arguments.length-1,u=new Array(a),s=0;s<a;s++)u[s]=arguments[s+1];return t(o,function(t,o){i=r.call(n[t]||[],0);for(var a,s=0;a=i[s];++s)a.busy||(a.busy=1,a.apply(e,a.typed?[t].concat(u):u),i[s]!==a&&s--,a.busy=0);n["*"]&&"*"!=t&&e.trigger.apply(e,["*",t].concat(u))}),e},enumerable:!1,writable:!1,configurable:!1}}),e},function(t){function n(e){return e.split(/[\/?#]/)}function r(e,t){var n=new RegExp("^"+t[_](/\*/g,"([^/?#]+?)")[_](/\.\./,".*")+"$"),r=e.match(n);if(r)return r.slice(1)}function o(e,t){var n;return function(){clearTimeout(n),n=setTimeout(e,t)}}function i(e){g=o(l,1),N[y](C,g),N[y](O,g),L[y](R,p),e&&l(!0)}function a(){this.$=[],t.observable(this),I.on("stop",this.s.bind(this)),I.on("emit",this.e.bind(this))}function u(e){return e[_](/^\/|\/$/,"")}function s(e){return"string"==typeof e}function c(e){return(e||M.href)[_](b,"")}function f(e){return"#"==m[0]?(e||M.href||"").split(m)[1]||"":(M?c(e):e||"")[_](m,"")}function l(e){var t,n=0==F;if(!(E<=F)&&(F++,k.push(function(){var t=f();(e||t!=h)&&(I[S]("emit",t),h=t)}),n)){for(;t=k.shift();)t();F=0}}function p(e){if(!(1!=e.which||e.metaKey||e.ctrlKey||e.shiftKey||e.defaultPrevented)){for(var t=e.target;t&&"A"!=t.nodeName;)t=t.parentNode;!t||"A"!=t.nodeName||t[w]("download")||!t[w]("href")||t.target&&"_self"!=t.target||-1==t.href.indexOf(M.href.match(b)[0])||t.href!=M.href&&(t.href.split("#")[0]==M.href.split("#")[0]||"#"!=m[0]&&0!==c(t.href).indexOf(m)||"#"==m[0]&&t.href.split(m)[0]!=M.href.split(m)[0]||!d(f(t.href),t.title||L.title))||e.preventDefault()}}function d(e,t,n){return j?(e=m+u(e),t=t||L.title,n?j.replaceState(null,t,e):j.pushState(null,t,e),L.title=t,$=!1,l(),$):I[S]("emit",f(e))}var g,m,h,v,x,b=/^.+?\/\/+[^\/]+/,y="addEventListener",w="hasAttribute",_="replace",C="popstate",O="hashchange",S="trigger",E=3,N=void 0!==e&&e,L="undefined"!=typeof document&&document,j=N&&history,M=N&&(j.location||N.location),T=a.prototype,R=L&&L.ontouchstart?"touchstart":"click",A=!1,I=t.observable(),$=!1,k=[],F=0;T.m=function(e,t,n){!s(e)||t&&!s(t)?t?this.r(e,t):this.r("@",e):d(e,t,n||!1)},T.s=function(){this.off("*"),this.$=[]},T.e=function(e){this.$.concat("@").some(function(t){var n=("@"==t?v:x)(u(e),u(t));if(void 0!==n)return this[S].apply(null,[t].concat(n)),$=!0},this)},T.r=function(e,t){"@"!=e&&(e="/"+u(e),this.$.push(e)),this.on(e,t)};var P=new a,H=P.m.bind(P);H.create=function(){var e=new a,t=e.m.bind(e);return t.stop=e.s.bind(e),t},H.base=function(e){m=e||"#",h=f()},H.exec=function(){l(!0)},H.parser=function(e,t){e||t||(v=n,x=r),e&&(v=e),t&&(x=t)},H.query=function(){var e={};return(M.href||h)[_](/[?&](.+?)=([^&]*)/g,function(t,n,r){e[n]=r}),e},H.stop=function(){A&&(N&&(N.removeEventListener(C,g),N.removeEventListener(O,g),L.removeEventListener(R,p)),I[S]("stop"),A=!1)},H.start=function(e){A||(N&&("complete"==document.readyState?i(e):N[y]("load",function(){setTimeout(function(){i(e)},1)})),A=!0)},H.base(),H.parser(),t.route=H}(Q);var ge=function(e){function t(e){return e}function n(e,t){return t||(t=x),new RegExp(e.source.replace(/{/g,t[2]).replace(/}/g,t[3]),e.global?c:"")}function r(e){if(e===m)return h;var t=e.split(" ");if(2!==t.length||p.test(e))throw new Error('Unsupported brackets "'+e+'"');return t=t.concat(e.replace(d,"\\").split(" ")),t[4]=n(t[1].length>1?/{[\S\s]*?}/:h[4],t),t[5]=n(e.length>3?/\\({|})/g:h[5],t),t[6]=n(h[6],t),t[7]=RegExp("\\\\("+t[3]+")|([[({])|("+t[3]+")|"+l,c),t[8]=e,t}function o(e){return e instanceof RegExp?u(e):x[e]}function i(e){(e||(e=m))!==x[8]&&(x=r(e),u=e===m?t:n,x[9]=u(h[9])),v=e}function a(e){var t;e=e||{},t=e.brackets,Object.defineProperty(e,"brackets",{set:i,get:function(){return v},enumerable:!0}),s=e,i(t)}var u,s,c="g",f=/"[^"\\]*(?:\\[\S\s][^"\\]*)*"|'[^'\\]*(?:\\[\S\s][^'\\]*)*'/g,l=f.source+"|"+/(?:\breturn\s+|(?:[$\w\)\]]|\+\+|--)\s*(\/)(?![*\/]))/.source+"|"+/\/(?=[^*\/])[^[\/\\]*(?:(?:\[(?:\\.|[^\]\\]*)*\]|\\.)[^[\/\\]*)*?(\/)[gim]*/.source,p=RegExp("[\\x00-\\x1F<>a-zA-Z0-9'\",;\\\\]"),d=/(?=[[\]()*+?.^$|])/g,g={"(":RegExp("([()])|"+l,c),"[":RegExp("([[\\]])|"+l,c),"{":RegExp("([{}])|"+l,c)},m="{ }",h=["{","}","{","}",/{[^}]*}/,/\\([{}])/g,/\\({)|{/g,RegExp("\\\\(})|([[({])|(})|"+l,c),m,/^\s*{\^?\s*([$\w]+)(?:\s*,\s*(\S+))?\s+in\s+(\S.*)\s*}/,/(^|[^\\]){=[\S\s]*?}/],v=void 0,x=[];return o.split=function(e,t,n){function r(e){t||i?s.push(e&&e.replace(n[5],"$1")):s.push(e)}n||(n=x);var o,i,a,u,s=[],c=n[6];for(i=a=c.lastIndex=0;o=c.exec(e);){if(u=o.index,i){if(o[2]){c.lastIndex=function(e,t,n){var r,o=g[t];for(o.lastIndex=n,n=1;(r=o.exec(e))&&(!r[1]||(r[1]===t?++n:--n)););return n?e.length:o.lastIndex}(e,o[2],c.lastIndex);continue}if(!o[3])continue}o[1]||(r(e.slice(a,u)),a=c.lastIndex,c=n[6+(i^=1)],c.lastIndex=a)}return e&&a<e.length&&r(e.slice(a)),s},o.hasExpr=function(e){return x[4].test(e)},o.loopKeys=function(e){var t=e.match(x[9]);return t?{key:t[1],pos:t[2],val:x[0]+t[3].trim()+x[1]}:{val:e.trim()}},o.array=function(e){return e?r(e):x},Object.defineProperty(o,"settings",{set:a,get:function(){return s}}),o.settings=void 0!==Q&&Q.settings||{},o.set=i,o.R_STRINGS=f,o.R_MLCOMMS=/\/\*[^*]*\*+(?:[^*\/][^*]*\*+)*\//g,o.S_QBLOCKS=l,o}(),me=function(){function t(e,t){return e?(u[e]||(u[e]=r(e))).call(t,n):e}function n(e,n){t.errorHandler&&(e.riotData={tagName:n&&n.root&&n.root.tagName,_riot_id:n&&n._riot_id},t.errorHandler(e))}function r(e){var t=o(e);return"try{return "!==t.slice(0,11)&&(t="return "+t),new Function("E",t+";")}function o(e){var t,n=[],r=ge.split(e.replace(l,'"'),1);if(r.length>2||r[0]){var o,a,u=[];for(o=a=0;o<r.length;++o)(t=r[o])&&(t=1&o?i(t,1,n):'"'+t.replace(/\\/g,"\\\\").replace(/\r\n?|\n/g,"\\n").replace(/"/g,'\\"')+'"')&&(u[a++]=t);t=a<2?u[0]:"["+u.join(",")+'].join("")'}else t=i(r[1],0,n);return n[0]&&(t=t.replace(p,function(e,t){return n[t].replace(/\r/g,"\\r").replace(/\n/g,"\\n")})),t}function i(e,t,n){if(e=e.replace(f,function(e,t){return e.length>2&&!t?s+(n.push(e)-1)+"~":e}).replace(/\s+/g," ").trim().replace(/\ ?([[\({},?\.:])\ ?/g,"$1")){for(var r,o=[],i=0;e&&(r=e.match(c))&&!r.index;){var u,l,p=/,|([[{(])|$/g;for(e=RegExp.rightContext,u=r[2]?n[r[2]].slice(1,-1).trim().replace(/\s+/g," "):r[1];l=(r=p.exec(e))[1];)!function(t,n){var r,o=1,i=d[t];for(i.lastIndex=n.lastIndex;r=i.exec(e);)if(r[0]===t)++o;else if(!--o)break;n.lastIndex=o?e.length:i.lastIndex}(l,p);l=e.slice(0,r.index),e=RegExp.rightContext,o[i++]=a(l,1,u)}e=i?i>1?"["+o.join(",")+'].join(" ").trim()':o[0]:a(e,t)}return e}function a(e,t,n){var r;return e=e.replace(m,function(e,t,n,o,i){return n&&(o=r?0:o+e.length,"this"!==n&&"global"!==n&&"window"!==n?(e=t+'("'+n+g+n,o&&(r="."===(i=i[o])||"("===i||"["===i)):o&&(r=!h.test(i.slice(o)))),e}),r&&(e="try{return "+e+"}catch(e){E(e,this)}"),n?e=(r?"function(){"+e+"}.call(this)":"("+e+")")+'?"'+n+'":""':t&&(e="function(v){"+(r?e.replace("return ","v="):"v=("+e+")")+';return v||v===0?v:""}.call(this)'),e}var u={};t.haveRaw=ge.hasRaw,t.hasExpr=ge.hasExpr,t.loopKeys=ge.loopKeys,t.clearCache=function(){u={}},t.errorHandler=null;var s=String.fromCharCode(8279),c=/^(?:(-?[_A-Za-z\xA0-\xFF][-\w\xA0-\xFF]*)|\u2057(\d+)~):/,f=RegExp(ge.S_QBLOCKS,"g"),l=/\u2057/g,p=/\u2057(\d+)~/g,d={"(":/[()]/g,"[":/[[\]]/g,"{":/[{}]/g},g='"in this?this:'+("object"!=typeof e?"global":"window")+").",m=/[,{][\$\w]+(?=:)|(^ *|[^$\w\.{])(?!(?:typeof|true|false|null|undefined|in|instanceof|is(?:Finite|NaN)|void|NaN|new|Date|RegExp|Math)(?![$\w]))([$_A-Za-z][$\w]*)/g,h=/^(?=(\.[$\w]+))\1(?:[^.[(]|$)/;return t.version=ge.version="v2.4.2",t}(),he=function(){function e(e,r,o){var i=e&&e.match(/^\s*<([-\w]+)/),a=i&&i[1].toLowerCase(),u=D("div",o&&b(a));return e=n(e,r),s.test(a)?u=t(u,e,a):x(u,e),u.stub=!0,u}function t(e,t,n){var r="o"===n[0],o=r?"select>":"table>";if(e.innerHTML="<"+o+t.trim()+"</"+o,o=e.firstChild,r)o.selectedIndex=-1;else{var i=u[n];i&&1===o.childElementCount&&(o=B(i,o))}return o}function n(e,t){if(!r.test(e))return e;var n={};return t=t&&t.replace(i,function(e,t,r){return n[t]=n[t]||r,""}).trim(),e.replace(a,function(e,t,r){return n[t]||r||""}).replace(o,function(e,n){return t||n||""})}var r=/<yield\b/i,o=/<yield\s*(?:\/>|>([\S\s]*?)<\/yield\s*>|>)/gi,i=/<yield\s+to=['"]([^'">]*)['"]\s*>([\S\s]*?)<\/yield\s*>/gi,a=/<yield\s+from=['"]?([-\w]+)['"]?\s*(?:\/>|>([\S\s]*?)<\/yield\s*>)/gi,u={tr:"tbody",th:"tr",td:"tr",col:"colgroup"},s=pe&&pe<10?ce:/^(?:t(?:body|head|foot|[rhd])|caption|col(?:group)?)$/;return e}(),ve=function(t){if(!e)return{add:function(){},inject:function(){}};var n=function(){var e=D("style");O(e,"type","text/css");var t=B("style[type=riot]");return t?(t.id&&(e.id=t.id),t.parentNode.replaceChild(e,t)):document.getElementsByTagName("head")[0].appendChild(e),e}(),r=n.styleSheet,o="";return Object.defineProperty(t,"styleNode",{value:n,writable:!0}),{add:function(e){o+=e},inject:function(){o&&(r?r.cssText+=o:n.innerHTML+=o,o="")}}}(Q),xe=function(e){var t=e.requestAnimationFrame||e.mozRequestAnimationFrame||e.webkitRequestAnimationFrame;if(!t||/iP(ad|hone|od).*OS 6/.test(e.navigator.userAgent)){var n=0;t=function(e){var t=Date.now(),r=Math.max(16-(t-n),0);setTimeout(function(){e(n=t+r)},r)}}return t}(e||{});Q.util={brackets:ge,tmpl:me},Q.mixin=function(){var e={},t=e[Y]={},n=0;return function(r,o,i){if(y(r))return void Q.mixin("__unnamed_"+n++,r,!0);var a=i?t:e;if(!o){if(typeof a[r]===ie)throw new Error("Unregistered mixin: "+r);return a[r]}h(o)?(R(o.prototype,a[r]||{}),a[r]=o):a[r]=R(a[r]||{},o)}}(),Q.tag=function(e,t,n,r,o){return h(r)&&(o=r,/^[\w\-]+\s?=/.test(n)?(r=n,n=""):r=""),n&&(h(n)?o=n:ve.add(n)),e=e.toLowerCase(),J[e]={name:e,tmpl:t,attrs:r,fn:o},e},Q.tag2=function(e,t,n,r,o){return n&&ve.add(n),J[e]={name:e,tmpl:t,attrs:r,fn:o},e},Q.mount=function(e,t,n){function r(e){var t="";return m(e,function(e){/[^-\w]/.test(e)||(e=e.trim().toLowerCase(),t+=",["+ne+'="'+e+'"],['+te+'="'+e+'"]')}),t}function o(){var e=Object.keys(J);return e+r(e)}function i(e){if(e.tagName){var r=C(e,ne)||C(e,te);t&&r!==t&&(r=t,O(e,ne,t),O(e,te,t));var o=U(e,r||e.tagName.toLowerCase(),n);o&&s.push(o)}else e.length&&m(e,i)}var a,u,s=[];if(ve.inject(),y(t)&&(n=t,t=0),typeof e===re?("*"===e?e=u=o():e+=r(e.split(/, */)),a=e?q(e):[]):a=e,"*"===t){if(t=u||o(),a.tagName)a=q(t,a);else{var c=[];m(a,function(e){c.push(q(t,e))}),a=c}t=0}return i(a),s},Q.update=function(){return m(X,function(e){e.update()})},Q.vdom=X,Q.Tag=l;var be=function(e){function t(t){var n=e[t];if(n)return n;throw new Error('Parser "'+t+'" not loaded.')}function n(e){var t=e.split(".");if(2!==t.length)throw new Error("Bad format for parsers._req");var n=i[t[0]][t[1]];if(n)return n;throw new Error('Parser "'+e+'" not found.')}function r(e,t){if(t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function o(e,n,o,i){return o=r({pretty:!0,filename:i,doctype:"html"},o),t(e).render(n,o)}var i={};return i.html={jade:function(e,t,n){return console.log('DEPRECATION WARNING: jade was renamed "pug" - The jade parser will be removed in riot@3.0.0!'),o("jade",e,t,n)},pug:function(e,t,n){return o("pug",e,t,n)}},i.css={less:function(e,n,o,i){var a;return o=r({sync:!0,syncImport:!0,filename:i},o),t("less").render(n,o,function(e,t){if(e)throw e;a=t.css}),a}},i.js={es6:function(e,n){return n=r({blacklist:["useStrict","strict","react"],sourceMaps:!1,comments:!1},n),t("babel").transform(e,n).code},babel:function(e,n,o){return t("babel").transform(e,r({filename:o},n)).code},buble:function(e,n,o){return n=r({source:o,modules:!1},n),t("buble").transform(e,n).code},coffee:function(e,n){return t("CoffeeScript").compile(e,r({bare:!0},n))},livescript:function(e,n){return t("livescript").compile(e,r({bare:!0,header:!1},n))},typescript:function(e,n){return t("typescript")(e,n)},none:function(e){return e}},i.js.javascript=i.js.none,i.js.coffeescript=i.js.coffee,i._req=n,i.utils={extend:r},i}(e||global);Q.parsers=be;var ye=function(){function e(e){var t,n=N;for(~e.indexOf("\r")&&(e=e.replace(/\r\n?/g,"\n")),n.lastIndex=0;t=n.exec(e);)"<"===t[0][0]&&(e=RegExp.leftContext+RegExp.rightContext,n.lastIndex=t[3]+1);return e}function t(e,t){var n,r,o,i=[];for(E.lastIndex=0,e=e.replace(/\s+/g," ");n=E.exec(e);){var a=n[1].toLowerCase(),u=n[2];u?(u[0]!==q&&(u=q+(u[0]===B?u.slice(1,-1):u)+q),"type"===a&&I.test(u)?r=u:(F.test(u)&&("value"===a?o=1:M.test(a)?a="__"+a:~T.indexOf(a)&&(a="riot-"+a)),i.push(a+"="+u))):i.push(a)}return r&&(o&&(r=q+t._bp[0]+B+r.slice(1,-1)+B+t._bp[1]+q),i.push("type="+r)),i.join(" ")}function n(e,t,n){var r=n._bp;if(e&&r[4].test(e)){for(var o,i=t.expr&&(t.parser||t.type)?u:0,a=ge.split(e,0,r),s=1;s<a.length;s+=2)o=a[s],"^"===o[0]?o=o.slice(1):i&&(o=i(o,t).trim(),";"===o.slice(-1)&&(o=o.slice(0,-1))),a[s]=H+(n.push(o)-1)+r[1];e=a.join("")}return e}function r(e,t){return t.length&&(e=e.replace(P,function(e,n){return t._bp[0]+t[n].trim().replace(/[\r\n]+/g," ").replace(/"/g,D)})),e}function o(e,o,i){if(!/\S/.test(e))return"";if(e=n(e,o,i).replace(L,function(e,n,r,o){return n=n.toLowerCase(),o=o&&!R.test(n)?"></"+n:"",r&&(n+=" "+t(r,i)),"<"+n+o+">"}),!o.whitespace){var a=[];/<pre[\s>]/.test(e)&&(e=e.replace(A,function(e){return a.push(e),""})),e=e.trim().replace(/\s+/g," "),a.length&&(e=e.replace(/\u0002/g,function(){return a.shift()}))}return o.compact&&(e=e.replace(j,"><$1")),r(e,i).replace(k,"")}function i(t,n,r){return Array.isArray(n)?(r=n,n={}):(r||(r=[]),n||(n={})),r._bp=ge.array(n.brackets),o(e(t),n,r)}function a(e){var t,n,r,o,i=[],a=RegExp;for(~e.indexOf("/")&&(e=function(e,t,n){for(t.lastIndex=0;n=t.exec(e);)"/"!==n[0][0]||n[1]||n[2]||(e=a.leftContext+" "+a.rightContext,t.lastIndex=n[3]+1);return e}(e,Z));t=e.match(z);)i.push(a.leftContext),e=a.rightContext,r=function(e,t){var n,r=1;for(t.lastIndex=0;r&&(n=t.exec(e));)"{"===n[0]?++r:"}"===n[0]&&--r;return r?e.length:t.lastIndex}(e,K),o=t[1],n=!/^(?:if|while|for|switch|catch|function)$/.test(o),o=n?t[0].replace(o,"this."+o+" = function"):t[0],i.push(o,e.slice(0,r)),e=e.slice(r),n&&!/^\s*.\s*bind\b/.test(e)&&i.push(".bind(this)");return i.length?i.join("")+e:e}function u(e,t,n,r,o){return/\S/.test(e)?(n||(n=t.type),(t.parser||n&&be._req("js."+n,!0)||a)(e,r,o).replace(/\r\n?/g,"\n").replace(k,"")):""}function s(e,t,n,r){return"string"==typeof t&&(r=n,n=t,t={}),n&&"object"==typeof n&&(r=n,n=""),r||(r={}),u(e,t||{},n,r.parserOptions,r.url)}function c(e,t){return t.replace(G,function(t,n,r){return r?(r=r.replace(/[^,]+/g,function(t){var n=t.trim();return n&&"from"!==n&&"to"!==n&&"%"!==n.slice(-1)?n=n.indexOf(":scope")<0?e+" "+n+',[riot-tag="'+e+'"] '+n+',[data-is="'+e+'"] '+n:n.replace(":scope",e)+","+n.replace(":scope",'[riot-tag="'+e+'"]')+","+n.replace(":scope",'[data-is="'+e+'"]'):t}),n?n+" "+r:r):t})}function f(e,t,n,r){var o=(r||(r={})).scoped;if(n)if("scoped-css"===n)o=!0;else if("css"!==n){var i=be._req("css."+n,!0);e=i(t,e,r.parserOpts||{},r.url)}if(e=e.replace(ge.R_MLCOMMS,"").replace(/\s+/g," ").trim(),o){if(!t)throw new Error("Can not parse scoped CSS without a tagName");e=c(t,e)}return e}function l(e,t,n){return t&&"object"==typeof t?(n=t,t=""):n||(n={}),f(e,n.tagName,t,n)}function p(e,t){return e?(e=B+e.replace(/\\/g,"\\\\").replace(/'/g,"\\'")+B,t&&~e.indexOf("\n")?e.replace(/\n/g,"\\n"):e):"''"}function d(e,t,n,r,o,i,a){var u=a.debug?",\n ":", ",s="});";return o&&"\n"!==o.slice(-1)&&(s="\n"+s),i+"riot.tag2('"+e+B+u+p(t,1)+u+p(n)+u+p(r)+", function(opts) {\n"+o+s}function g(e){if(/<[-\w]/.test(e))for(var t,n=e.lastIndexOf("<"),r=e.length;~n;){if(t=e.slice(n,r).match(X))return n+=t.index+t[0].length,t=e.slice(0,n),"<-/>\n"===t.slice(-5)&&(t=t.slice(0,-5)),[t,e.slice(n)];r=n,n=e.lastIndexOf("<",n-1)}return["",e]}function m(e){if(e){var t=e.match(U);if(t=t&&(t[2]||t[3]))return t.replace("text/","")}return""}function h(e,t){if(e){var n=e.match(RegExp("\\s"+t+W,"i"));if(n=n&&n[1])return/^['"]/.test(n)?n.slice(1,-1):n}return""}function v(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'")}function x(e){var t=v(h(e,"options"));return t?JSON.parse(t):null}function b(e,t,n,r){var o=m(n),i=h(n,"src"),a=C({},t.parserOptions.js);return!i&&u(e,t,o,C(a,x(n)),r)}function y(e,t,n,r,o){var i=C({},t.parserOptions.style),a={parserOpts:C(i,x(n)),scoped:n&&/\sscoped(\s|=|$)/i.test(n),url:r};return f(e,o,m(n)||t.style,a)}function w(e,t,n,r){return be._req("html."+n,!0)(e,r,t)}function _(i,a,s){var c,f=[],l={template:{},js:{},style:{}};a||(a={}),a.parserOptions=C(l,a.parserOptions||{}),c=a.exclude?function(e){return a.exclude.indexOf(e)<0}:function(){return 1},s||(s="");var p=ge.array(a.brackets);return a.template&&(i=w(i,s,a.template,a.parserOptions.template)),i=e(i).replace(J,function(e,i,l,m,h,v){var x="",w="",_="",C="",O=[];if(O._bp=p,l=l.toLowerCase(),m=m&&c("attribs")?r(t(n(m,a,O),O),O):"",(h||(h=v))&&/\S/.test(h))if(v)c("html")&&(_=o(v,a,O));else{h=h.replace(RegExp("^"+i,"gm"),""),h=h.replace(ee,function(e,t,n){return c("css")&&(w+=(w?" ":"")+y(n,a,t,s,l)),""}),h=h.replace(Y,function(e,t,n){if(c("js")){var r=b(n,a,t,s);r&&(x+=(x?"\n":"")+r)}return""});var S=g(h.replace(k,""));c("html")&&(_=o(S[0],a,O)),c("js")&&(h=u(S[1],a,null,null,s),h&&(x+=(x?"\n":"")+h),x=x.replace($,function(e){return C+=e.trim()+"\n",""}))}return x=/\S/.test(x)?x.replace(/\n{3,}/g,"\n\n"):"",a.entities?(f.push({tagName:l,html:_,css:w,attribs:m,js:x,imports:C}),""):d(l,_,w,m,x,C,a)}),a.entities?f:i}var C=be.utils.extend,O=/"[^"\n\\]*(?:\\[\S\s][^"\n\\]*)*"|'[^'\n\\]*(?:\\[\S\s][^'\n\\]*)*'/.source,S=ge.R_STRINGS.source,E=/ *([-\w:\xA0-\xFF]+) ?(?:= ?('[^']*'|"[^"]*"|\S+))?/g,N=RegExp(/<!--(?!>)[\S\s]*?-->/.source+"|"+O,"g"),L=/<(-?[A-Za-z][-\w\xA0-\xFF]*)(?:\s+([^"'\/>]*(?:(?:"[^"]*"|'[^']*'|\/[^>])[^'"\/>]*)*)|\s*)(\/?)>/g,j=/>[ \t]+<(-?[A-Za-z]|\/[-A-Za-z])/g,M=RegExp("^(?:disabled|checked|readonly|required|allowfullscreen|auto(?:focus|play)|compact|controls|default|formnovalidate|hidden|ismap|itemscope|loop|multiple|muted|no(?:resize|shade|validate|wrap)?|open|reversed|seamless|selected|sortable|truespeed|typemustmatch)$"),T=["style","src","d"],R=/^(?:input|img|br|wbr|hr|area|base|col|embed|keygen|link|meta|param|source|track)$/,A=/<pre(?:\s+(?:[^">]*|"[^"]*")*)?>([\S\s]+?)<\/pre\s*>/gi,I=/^"(?:number|date(?:time)?|time|month|email|color)\b/i,$=/^\s*import(?:(?:\s|[^\s'"])*)['|"].*\n?/gm,k=/[ \t]+$/gm,F=V(/@#\d/,"x01"),P=V(/@#(\d+)/g,"x01"),H="#",D="⁗",q='"',B="'",z=/^[ \t]*([$_A-Za-z][$\w]*)\s*\([^()]*\)\s*{/m,K=RegExp("[{}]|"+ge.S_QBLOCKS,"g"),Z=RegExp(ge.R_MLCOMMS.source+"|//[^\r\n]*|"+ge.S_QBLOCKS,"g"),G=RegExp("([{}]|^)[ ;]*([^@ ;{}][^{}]*)(?={)|"+O,"g"),U=/\stype\s*=\s*(?:(['"])(.+?)\1|(\S+))/i,W="\\s*=\\s*("+S+"|{[^}]+}|\\S+)",X=/\/>\n|^<(?:\/?-?[A-Za-z][-\w\xA0-\xFF]*\s*|-?[A-Za-z][-\w\xA0-\xFF]*\s+[-\w:\xA0-\xFF][\S\s]*?)>\n/,J=RegExp(/^([ \t]*)<(-?[A-Za-z][-\w\xA0-\xFF]*)(?:\s+([^'"\/>]+(?:(?:@|\/[^>])[^'"\/>]*)*)|\s*)?(?:\/>|>[ \t]*\n?([\S\s]*)^\1<\/\2\s*>|>(.*)<\/\2\s*>)/.source.replace("@",S),"gim"),Y=/<script(\s+[^>]*)?>\n?([\S\s]*?)<\/script\s*>/gi,ee=/<style(\s+[^>]*)?>\n?([\S\s]*?)<\/style\s*>/gi;return Q.util.compiler={compile:_,html:i,css:l,js:s,version:"v2.5.7"},_}();Q.compile=function(){function e(e,t,n){var r=new XMLHttpRequest;r.onreadystatechange=function(){4===r.readyState&&(200===r.status||!r.status&&r.responseText.length)&&t(r.responseText,n,e)},r.open("GET",e,!0),r.send("")}function n(e,t){if(typeof e===re){var n=D("script"),r=document.documentElement;t&&(e+="\n//# sourceURL="+t+".js"),n.text=e,r.appendChild(n),r.removeChild(n)}}function r(t,r){function a(){o.trigger("ready"),i=!0,t&&t()}function u(e,t,r){n(ye(e,t,r),r),--c||a()}var s=q('script[type="riot/tag"]'),c=s.length;if(c)for(var f=0;f<s.length;++f){var l=s[f],p=R({template:C(l,"template")},r),d=C(l,"src");d?e(d,u,p):u(l.innerHTML,p)}else a()}var o,i;return function(a,u,s){if(typeof a===re){if(y(u)&&(s=u,u=!1),/^\s*</m.test(a)){var c=ye(a,s);return!0!==u&&n(c),h(u)&&u(c,a,s),c}e(a,function(e,t,r){var o=ye(e,t,r);n(o,r),u&&u(o,e,t)},s)}else{if(h(a)?(s=u,u=a):(s=a,u=t),i)return u&&u();o?u&&o.on("ready",u):(o=Q.observable(),r(u,s))}}}();var we=Q.mount;Q.mount=function(){var e,t=arguments;return Q.compile(function(){e=we.apply(Q,t)}),e},typeof exports===oe?module.exports=Q:typeof define===ae&&typeof define.amd!==ie?define('riot',[],function(){return Q}):e.riot=Q}("undefined"!=typeof window?window:void 0);
define('tag',{load: function(id){throw new Error("Dynamic load not allowed: " + id);}});
define('tag!tags/timer.tag',['riot'], function(riot){ return riot.tag2('timer', '<p>Seconds Elapsed: {time}</p>', '', '', function(opts) {
this.time = opts.start || 0
this.tick = function() {
this.update({ time: ++this.time })
}.bind(this)
var timer = setInterval(this.tick, 1000)
this.on('unmount', function() {
clearInterval(timer)
})
});
});
define('tag!tags/panels.tag',['riot'], function(riot){ return riot.tag2('panels', '<nav><a each="{data}" href="#{id}">{title}</a></nav> <article> <h1>{page.title || \'Not found\'}</h1> <p>{page.body || \'Specified id is not found.\'}</p> </article>', 'panels,[riot-tag="panels"],[data-is="panels"]{ display: block; font-family: sans-serif; margin: 0; padding: 1em; text-align: center; color: #666; } panels nav,[riot-tag="panels"] nav,[data-is="panels"] nav{ display: block; border-bottom: 1px solid #666; padding: 0 0 1em; } panels nav > a,[riot-tag="panels"] nav > a,[data-is="panels"] nav > a{ display: inline-block; padding: 0 .8em; } panels nav > a:not(:first-child),[riot-tag="panels"] nav > a:not(:first-child),[data-is="panels"] nav > a:not(:first-child){ border-left: 1px solid #eee; }', '', function(opts) {
var self = this
self.data = [
{ id: "", title: "Home", body: "Click the link above." },
{ id: "1", title: "First", body: "This is the first page." },
{ id: "2", title: "Second", body: "This is the second page." }
]
self.page = self.data[0]
riot.route(function(id) {
self.page = self.data.filter(function(r) { return r.id == id })[0] || {}
self.update()
})
});
});
define('tag!tags/todo.tag',['riot'], function(riot){ return riot.tag2('todo', '<h3>{opts.title}</h3> <ul> <li each="{items.filter(whatShow)}"> <label class="{completed: done}"> <input type="checkbox" __checked="{done}" onclick="{parent.toggle}"> {title} </label> </li> </ul> <form onsubmit="{add}"> <input name="input" onkeyup="{edit}"> <button __disabled="{!text}">Add #{items.filter(whatShow).length + 1}</button> <button __disabled="{items.filter(onlyDone).length == 0}" onclick="{removeAllDone}"> X{items.filter(onlyDone).length} </button> </form>', '', '', function(opts) {
this.items = opts.items
this.edit = function(e) {
this.text = e.target.value
}.bind(this)
this.add = function(e) {
if (this.text) {
this.items.push({ title: this.text })
this.text = this.input.value = ''
}
}.bind(this)
this.removeAllDone = function(e) {
this.items = this.items.filter(function(item) {
return !item.done
})
}.bind(this)
this.whatShow = function(item) {
return !item.hidden
}.bind(this)
this.onlyDone = function(item) {
return item.done
}.bind(this)
this.toggle = function(e) {
var item = e.item
item.done = !item.done
return true
}.bind(this)
});
});
define('js/app',[
"riot",
"tag!tags/timer.tag",
"tag!tags/panels.tag",
"tag!tags/todo.tag"
], function(riot) {
riot.mount('timer', {
start: 0
});
riot.mount('panels');
riot.mount('todo', {
items: [{ title: 'wash my teeth' }, { title: 'wipe my hands' }]
});
riot.route.start(true);
});