bundle.jsView |
---|
1 | | -!function(){var e,t,n,r=e={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(e){n=o}}();var a,h=[],u=!1,c=-1;function l(){u&&a&&(u=!1,a.length?h=a.concat(h):c=-1,h.length&&f())}function f(){if(!u){var e=s(l);u=!0;for(var t=h.length;t;){for(a=h,h=[];++c<t;)a&&a[c].run();c=-1,t=h.length}a=null,u=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===o||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function d(){}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];h.push(new p(e,t)),1!==h.length||u||s(f)},p.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=d,r.addListener=d,r.once=d,r.off=d,r.removeListener=d,r.removeAllListeners=d,r.emit=d,r.prependListener=d,r.prependOnceListener=d,r.listeners=function(e){return[]},r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")},r.umask=function(){return 0};var m={};(function(e){function t(e,t){for(var n=0,r=e.length-1;r>=0;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function n(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r<e.length;r++)t(e[r],r,e)&&n.push(e[r]);return n}m.resolve=function(){for(var r="",i=!1,o=arguments.length-1;o>=-1&&!i;o--){var s=o>=0?arguments[o]:e.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(r=s+"/"+r,i="/"===s.charAt(0))}return r=t(n(r.split("/"),function(e){return!!e}),!i).join("/"),(i?"/":"")+r||"."},m.normalize=function(e){var i=m.isAbsolute(e),o="/"===r(e,-1);return(e=t(n(e.split("/"),function(e){return!!e}),!i).join("/"))||i||(e="."),e&&o&&(e+="/"),(i?"/":"")+e},m.isAbsolute=function(e){return"/"===e.charAt(0)},m.join=function(){var e=Array.prototype.slice.call(arguments,0);return m.normalize(n(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))};var r="b"==="ab".substr(-1)?function(e,t,n){return e.substr(t,n)}:function(e,t,n){return t<0&&(t=e.length+t),e.substr(t,n)}}).call(this,e);var v={exports:{}};function g(e,t){return Object.prototype.hasOwnProperty.call(e,t)}(function(e){!function(t){var n="object"==typeof v.exports&&v.exports&&!v.exports.nodeType&&v.exports,r=v&&!v.nodeType&&v,i="object"==typeof e&&e;i.global!==i&&i.window!==i&&i.self!==i||(t=i);var o,s,a=2147483647,h=36,u=1,c=26,l=38,f=700,p=72,d=128,m="-",g=/^xn--/,y=/[^\x20-\x7E]/,w=/[\x2E\u3002\uFF0E\uFF61]/g,b={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},A=h-u,_=Math.floor,E=String.fromCharCode;function O(e){throw new RangeError(b[e])}function T(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function x(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+T((e=e.replace(w,".")).split("."),t).join(".")}function S(e){for(var t,n,r=[],i=0,o=e.length;i<o;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<o?56320==(64512&(n=e.charCodeAt(i++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),i--):r.push(t);return r}function N(e){return T(e,function(e){var t="";return e>65535&&(t+=E((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+E(e)}).join("")}function C(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function L(e,t,n){var r=0;for(e=n?_(e/f):e>>1,e+=_(e/t);e>A*c>>1;r+=h)e=_(e/A);return _(r+(A+1)*e/(e+l))}function k(e){var t,n,r,i,o,s,l,f,v,g,y,w=[],b=e.length,A=0,E=d,T=p;for((n=e.lastIndexOf(m))<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&O("not-basic"),w.push(e.charCodeAt(r));for(i=n>0?n+1:0;i<b;){for(o=A,s=1,l=h;i>=b&&O("invalid-input"),((f=(y=e.charCodeAt(i++))-48<10?y-22:y-65<26?y-65:y-97<26?y-97:h)>=h||f>_((a-A)/s))&&O("overflow"),A+=f*s,!(f<(v=l<=T?u:l>=T+c?c:l-T));l+=h)s>_(a/(g=h-v))&&O("overflow"),s*=g;T=L(A-o,t=w.length+1,0==o),_(A/t)>a-E&&O("overflow"),E+=_(A/t),A%=t,w.splice(A++,0,E)}return N(w)}function R(e){var t,n,r,i,o,s,l,f,v,g,y,w,b,A,T,x=[];for(w=(e=S(e)).length,t=d,n=0,o=p,s=0;s<w;++s)(y=e[s])<128&&x.push(E(y));for(r=i=x.length,i&&x.push(m);r<w;){for(l=a,s=0;s<w;++s)(y=e[s])>=t&&y<l&&(l=y);for(l-t>_((a-n)/(b=r+1))&&O("overflow"),n+=(l-t)*b,t=l,s=0;s<w;++s)if((y=e[s])<t&&++n>a&&O("overflow"),y==t){for(f=n,v=h;!(f<(g=v<=o?u:v>=o+c?c:v-o));v+=h)T=f-g,A=h-g,x.push(E(C(g+T%A,0))),f=_(T/A);x.push(E(C(f,0))),o=L(n,b,r==i),n=0,++r}++n,++t}return x.join("")}if(o={version:"1.4.1",ucs2:{decode:S,encode:N},decode:k,encode:R,toASCII:function(e){return x(e,function(e){return y.test(e)?"xn--"+R(e):e})},toUnicode:function(e){return x(e,function(e){return g.test(e)?k(e.slice(4).toLowerCase()):e})}},"function"==typeof define&&"object"==typeof define.amd&&define.amd)define("punycode",function(){return o});else if(n&&r)if(v.exports==n)r.exports=o;else for(s in o)o.hasOwnProperty(s)&&(n[s]=o[s]);else t.punycode=o}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),v=v.exports;var y=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},w=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}},b=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function A(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r<e.length;r++)n.push(t(e[r],r));return n}var _=Object.keys||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},E={parse:function(e,t,n,r){t=t||"&",n=n||"=";var i={};if("string"!=typeof e||0===e.length)return i;var o=/\+/g;e=e.split(t);var s=1e3;r&&"number"==typeof r.maxKeys&&(s=r.maxKeys);var a=e.length;s>0&&a>s&&(a=s);for(var h=0;h<a;++h){var u,c,l,f,p=e[h].replace(o,"%20"),d=p.indexOf(n);d>=0?(u=p.substr(0,d),c=p.substr(d+1)):(u=p,c=""),l=decodeURIComponent(u),f=decodeURIComponent(c),g(i,l)?y(i[l])?i[l].push(f):i[l]=[i[l],f]:i[l]=f}return i},stringify:function(e,t,n,r){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?A(_(e),function(r){var i=encodeURIComponent(w(r))+n;return b(e[r])?A(e[r],function(e){return i+encodeURIComponent(w(e))}).join(t):i+encodeURIComponent(w(e[r]))}).join(t):r?encodeURIComponent(w(r))+n+encodeURIComponent(w(e)):""}},O={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}},T={};function x(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}T.format=function(e){return O.isString(e)&&(e=$(e)),e instanceof x?e.format():x.prototype.format.call(e)};var S=/^([a-z0-9.+-]+:)/i,N=/:[0-9]*$/,C=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,L=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),k=["'"].concat(L),R=["%","/","?",";","#"].concat(k),j=["/","?","#"],I=/^[+a-z0-9A-Z_-]{0,63}$/,P=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,D={javascript:!0,"javascript:":!0},M={javascript:!0,"javascript:":!0},q={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function $(e,t,n){if(e&&O.isObject(e)&&e instanceof x)return e;var r=new x;return r.parse(e,t,n),r}x.prototype.parse=function(e,t,n){if(!O.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var r=e.indexOf("?"),i=-1!==r&&r<e.indexOf("#")?"?":"#",o=e.split(i);o[0]=o[0].replace(/\\/g,"/");var s=e=o.join(i);if(s=s.trim(),!n&&1===e.split("#").length){var a=C.exec(s);if(a)return this.path=s,this.href=s,this.pathname=a[1],a[2]?(this.search=a[2],this.query=t?E.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var h=S.exec(s);if(h){var u=(h=h[0]).toLowerCase();this.protocol=u,s=s.substr(h.length)}if(n||h||s.match(/^\/\/[^@\/]+@[^@\/]+/)){var c="//"===s.substr(0,2);!c||h&&M[h]||(s=s.substr(2),this.slashes=!0)}if(!M[h]&&(c||h&&!q[h])){for(var l,f,p=-1,d=0;d<j.length;d++)-1!==(m=s.indexOf(j[d]))&&(-1===p||m<p)&&(p=m);for(-1!==(f=-1===p?s.lastIndexOf("@"):s.lastIndexOf("@",p))&&(l=s.slice(0,f),s=s.slice(f+1),this.auth=decodeURIComponent(l)),p=-1,d=0;d<R.length;d++){var m;-1!==(m=s.indexOf(R[d]))&&(-1===p||m<p)&&(p=m)}-1===p&&(p=s.length),this.host=s.slice(0,p),s=s.slice(p),this.parseHost(),this.hostname=this.hostname||"";var g="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!g)for(var y=this.hostname.split(/\./),w=(d=0,y.length);d<w;d++){var b=y[d];if(b&&!b.match(I)){for(var A="",_=0,T=b.length;_<T;_++)b.charCodeAt(_)>127?A+="x":A+=b[_];if(!A.match(I)){var x=y.slice(0,d),N=y.slice(d+1),L=b.match(P);L&&(x.push(L[1]),N.unshift(L[2])),N.length&&(s="/"+N.join(".")+s),this.hostname=x.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),g||(this.hostname=v.toASCII(this.hostname));var $=this.port?":"+this.port:"",U=this.hostname||"";this.host=U+$,this.href+=this.host,g&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!D[u])for(d=0,w=k.length;d<w;d++){var G=k[d];if(-1!==s.indexOf(G)){var V=encodeURIComponent(G);V===G&&(V=escape(G)),s=s.split(G).join(V)}}var F=s.indexOf("#");-1!==F&&(this.hash=s.substr(F),s=s.slice(0,F));var W=s.indexOf("?");if(-1!==W?(this.search=s.substr(W),this.query=s.substr(W+1),t&&(this.query=E.parse(this.query)),s=s.slice(0,W)):t&&(this.search="",this.query={}),s&&(this.pathname=s),q[u]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){$=this.pathname||"";var H=this.search||"";this.path=$+H}return this.href=this.format(),this},x.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",n=this.pathname||"",r=this.hash||"",i=!1,o="";this.host?i=e+this.host:this.hostname&&(i=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&O.isObject(this.query)&&Object.keys(this.query).length&&(o=E.stringify(this.query));var s=this.search||o&&"?"+o||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||q[t])&&!1!==i?(i="//"+(i||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):i||(i=""),r&&"#"!==r.charAt(0)&&(r="#"+r),s&&"?"!==s.charAt(0)&&(s="?"+s),t+i+(n=n.replace(/[?#]/g,function(e){return encodeURIComponent(e)}))+(s=s.replace("#","%23"))+r},x.prototype.resolve=function(e){return this.resolveObject($(e,!1,!0)).format()},x.prototype.resolveObject=function(e){if(O.isString(e)){var t=new x;t.parse(e,!1,!0),e=t}for(var n=new x,r=Object.keys(this),i=0;i<r.length;i++){var o=r[i];n[o]=this[o]}if(n.hash=e.hash,""===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol){for(var s=Object.keys(e),a=0;a<s.length;a++){var h=s[a];"protocol"!==h&&(n[h]=e[h])}return q[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n}if(e.protocol&&e.protocol!==n.protocol){if(!q[e.protocol]){for(var u=Object.keys(e),c=0;c<u.length;c++){var l=u[c];n[l]=e[l]}return n.href=n.format(),n}if(n.protocol=e.protocol,e.host||M[e.protocol])n.pathname=e.pathname;else{for(var f=(e.pathname||"").split("/");f.length&&!(e.host=f.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==f[0]&&f.unshift(""),f.length<2&&f.unshift(""),n.pathname=f.join("/")}if(n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var p=n.pathname||"",d=n.search||"";n.path=p+d}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var m=n.pathname&&"/"===n.pathname.charAt(0),v=e.host||e.pathname&&"/"===e.pathname.charAt(0),g=v||m||n.host&&e.pathname,y=g,w=n.pathname&&n.pathname.split("/")||[],b=(f=e.pathname&&e.pathname.split("/")||[],n.protocol&&!q[n.protocol]);if(b&&(n.hostname="",n.port=null,n.host&&(""===w[0]?w[0]=n.host:w.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===f[0]?f[0]=e.host:f.unshift(e.host)),e.host=null),g=g&&(""===f[0]||""===w[0])),v)n.host=e.host||""===e.host?e.host:n.host,n.hostname=e.hostname||""===e.hostname?e.hostname:n.hostname,n.search=e.search,n.query=e.query,w=f;else if(f.length)w||(w=[]),w.pop(),w=w.concat(f),n.search=e.search,n.query=e.query;else if(!O.isNullOrUndefined(e.search))return b&&(n.hostname=n.host=w.shift(),(S=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=S.shift(),n.host=n.hostname=S.shift())),n.search=e.search,n.query=e.query,O.isNull(n.pathname)&&O.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n;if(!w.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var A=w.slice(-1)[0],_=(n.host||e.host||w.length>1)&&("."===A||".."===A)||""===A,E=0,T=w.length;T>=0;T--)"."===(A=w[T])?w.splice(T,1):".."===A?(w.splice(T,1),E++):E&&(w.splice(T,1),E--);if(!g&&!y)for(;E--;E)w.unshift("..");!g||""===w[0]||w[0]&&"/"===w[0].charAt(0)||w.unshift(""),_&&"/"!==w.join("/").substr(-1)&&w.push("");var S,N=""===w[0]||w[0]&&"/"===w[0].charAt(0);return b&&(n.hostname=n.host=N?"":w.length?w.shift():"",(S=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=S.shift(),n.host=n.hostname=S.shift())),(g=g||n.host&&w.length)&&!N&&w.unshift(""),w.length?n.pathname=w.join("/"):(n.pathname=null,n.path=null),O.isNull(n.pathname)&&O.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},x.prototype.parseHost=function(){var e=this.host,t=N.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var U=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)G.call(n,r)&&(e[r]=n[r])}return e},G=Object.prototype.hasOwnProperty,V={};(function(e){V=n;var t=n.events={INSTALLED:"sw:installed",UPDATED:"sw:updated",REDUNDANT:"sw:redundant",POST_MESSAGE:"sw:postMessage",MESSAGE:"sw:message",SYNC:"sw:sync",NOTIFICATION_REQUEST:"sw:notificationRequest",ERROR:"log:error"};function n(n,r){return n=n||"/sw.js",r=r||{},function(i,o){o.on(i.events.DOMCONTENTLOADED,function(){if((r=U({scope:"/"},r)).electron){r.scope=m.join(e,r.scope),n=T.format({pathname:m.join(e,n.replace(/^\//,"")),protocol:"file:",slashes:!0}),delete r.electron}if(window.onmessage=function(e){o.emit(t.MESSAGE,{data:e.data,channel:"window",port:null})},window.MessageChannel){var s=new MessageChannel;s.port1.onmessage=function(e){o.emit(t.MESSAGE,{data:e.data,channel:"messageChannel",port:"port1"})},s.port2.onmessage=function(e){o.emit(t.MESSAGE,{data:e.data,channel:"messageChannel",port:"port2"})}}o.on(t.NOTIFICATION_REQUEST,function(e){Notification.requestPermission(function(t){"function"==typeof t&&e(t)})}),navigator.serviceWorker&&navigator.onLine&&(navigator.serviceWorker.onmessage=function(e){o.emit(t.MESSAGE,{data:e.data,channel:"navigator.serviceWorker",port:null})},navigator.serviceWorker.register(n,r).then(function(e){e.onupdatefound=function(){var n=e.installing;n.onstatechange=function(){"installed"===n.state?navigator.serviceWorker.controller?o.emit(t.UPDATED,e):o.emit(t.INSTALLED,e):"redundant"===n.state&&o.emit(t.REDUNDANT,e)}},e.sync&&function(e){e.sync.getTags().then(function(e){i.syncTags=e}).catch(function(e){o.emit(t.ERROR,e)})}(e)}).catch(function(e){o.emit(t.ERROR,e)}),navigator.serviceWorker.ready.then(function(e){new Promise(function(n){var r=e.active;"activated"!==r.state?(r.addEventListener("statechange",n,{once:!0}),o.on(t.POST_MESSAGE,function(e){r.postMessage(e)})):n()}).then(function(){e.navigationPreload&&e.navigationPreload.enable()}),o.on(t.SYNC,function(n){e.sync.register(n).then(function(){return e.sync.getTags()}).then(function(e){i.syncTags=e}).catch(function(e){o.emit(t.ERROR,e)})})}).catch(function(e){o.emit(t.ERROR,e)}))})}}}).call(this,"/node_modules/choo-service-worker");var F=/\n[\s]+$/,W=/^\n[\s]+/,H=/[\s]+$/,B=/^[\s]+/,z=/[\n\s]+/g,K=["a","abbr","b","bdi","bdo","br","cite","data","dfn","em","i","kbd","mark","q","rp","rt","rtc","ruby","s","amp","small","span","strong","sub","sup","time","u","var","wbr"],Z=["code","pre","textarea"],Q=function e(t,n){if(Array.isArray(n))for(var r,i,o=t.nodeName.toLowerCase(),s=!1,a=0,h=n.length;a<h;a++){var u=n[a];if(Array.isArray(u))e(t,u);else{("number"==typeof u||"boolean"==typeof u||"function"==typeof u||u instanceof Date||u instanceof RegExp)&&(u=u.toString());var c=t.childNodes[t.childNodes.length-1];if("string"==typeof u)s=!0,c&&"#text"===c.nodeName?c.nodeValue+=u:(u=document.createTextNode(u),t.appendChild(u),c=u),a===h-1&&(s=!1,-1===K.indexOf(o)&&-1===Z.indexOf(o)?""===(r=c.nodeValue.replace(W,"").replace(H,"").replace(F,"").replace(z," "))?t.removeChild(c):c.nodeValue=r:-1===Z.indexOf(o)&&(i=0===a?"":" ",r=c.nodeValue.replace(W,i).replace(B," ").replace(H,"").replace(F,"").replace(z," "),c.nodeValue=r));else if(u&&u.nodeType){s&&(s=!1,-1===K.indexOf(o)&&-1===Z.indexOf(o)?""===(r=c.nodeValue.replace(W,"").replace(F,"").replace(z," "))?t.removeChild(c):c.nodeValue=r:-1===Z.indexOf(o)&&(r=c.nodeValue.replace(B," ").replace(W,"").replace(F,"").replace(z," "),c.nodeValue=r));var l=u.nodeName;l&&(o=l.toLowerCase()),t.appendChild(u)}}}},X={class:"className",for:"htmlFor","http-equiv":"httpEquiv"},Y=1,J=2,ee=3,te=4,ne=5,re=6,ie=7,oe=8,se=9,ae=10,he=11,ue=12,ce=13;function le(e){return e===se||e===ae}Object.prototype.hasOwnProperty;var fe=RegExp("^("+["area","base","basefont","bgsound","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr","!--","animate","animateTransform","circle","cursor","desc","ellipse","feBlend","feColorMatrix","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","font-face-format","font-face-name","font-face-uri","glyph","glyphRef","hkern","image","line","missing-glyph","mpath","path","polygon","polyline","rect","set","stop","tref","use","view","vkern"].join("|")+")(?:[.#][a-zA-Z0-9\x7f-\uffff_:-]+)*$"),pe={},de="http://www.w3.org/2000/svg",me="http://www.w3.org/1999/xlink",ve=["autofocus","checked","defaultchecked","disabled","formnovalidate","indeterminate","readonly","required","selected","willvalidate"],ge="!--",ye=["svg","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"];function we(e,t,n){var r;-1!==ye.indexOf(e)&&(t.namespace=de);var i=!1;if(t.namespace&&(i=t.namespace,delete t.namespace),i)r=document.createElementNS(i,e);else{if(e===ge)return document.createComment(t.comment);r=document.createElement(e)}for(var o in t)if(t.hasOwnProperty(o)){var s=o.toLowerCase(),a=t[o];if("classname"===s&&(s="class",o="class"),"htmlFor"===o&&(o="for"),-1!==ve.indexOf(s))if("true"===a)a=s;else if("false"===a)continue;"on"===s.slice(0,2)?r[o]=a:i?"xlink:href"===o?r.setAttributeNS(me,o,a):/^xmlns($|:)/i.test(o)||r.setAttributeNS(null,o,a):r.setAttribute(o,a)}return Q(r,n),r}(pe=function(e,t){t||(t={});var n=t.concat||function(e,t){return String(e)+String(t)};return!1!==t.attrToProp&&(e=function(e){return function(t,n,r){for(var i in n)i in X&&(n[X[i]]=n[i],delete n[i]);return e(t,n,r)}}(e)),function(i){for(var o=Y,s="",a=arguments.length,h=[],u=0;u<i.length;u++)if(u<a-1){var c=arguments[u+1],l=E(i[u]),f=o;f===ae&&(f=oe),f===se&&(f=oe),f===ie&&(f=oe),f===te&&(f=ne),f===J?"/"===s?(l.push([J,"/",c]),s=""):l.push([J,c]):l.push([0,f,c]),h.push.apply(h,l)}else h.push.apply(h,E(i[u]));var p,d=[null,{},[]],m=[[d,-1]];for(u=0;u<h.length;u++){var v=m[m.length-1][0],g=(l=h[u])[0];if(g===J&&/^\//.test(l[1])){var y=m[m.length-1][1];m.length>1&&(m.pop(),m[m.length-1][0][2][y]=e(v[0],v[1],v[2].length?v[2]:void 0))}else if(g===J){var w=[l[1],{},[]];v[2].push(w),m.push([w,v[2].length-1])}else if(g===ne||0===g&&l[1]===ne){for(var b,A="";u<h.length;u++)if(h[u][0]===ne)A=n(A,h[u][1]);else{if(0!==h[u][0]||h[u][1]!==ne)break;if("object"!=typeof h[u][2]||A)A=n(A,h[u][2]);else for(b in h[u][2])h[u][2].hasOwnProperty(b)&&!v[1][b]&&(v[1][b]=h[u][2][b])}h[u][0]===he&&u++;for(var _=u;u<h.length;u++)if(h[u][0]===oe||h[u][0]===ne)v[1][A]?""===h[u][1]||(v[1][A]=n(v[1][A],h[u][1])):v[1][A]=r(h[u][1]);else{if(0!==h[u][0]||h[u][1]!==oe&&h[u][1]!==ne){!A.length||v[1][A]||u!==_||h[u][0]!==ee&&h[u][0]!==ue||(v[1][A]=A.toLowerCase()),h[u][0]===ee&&u--;break}v[1][A]?""===h[u][2]||(v[1][A]=n(v[1][A],h[u][2])):v[1][A]=r(h[u][2])}}else if(g===ne)v[1][l[1]]=!0;else if(0===g&&l[1]===ne)v[1][l[2]]=!0;else if(g===ee)p=v[0],fe.test(p)&&m.length&&(y=m[m.length-1][1],m.pop(),m[m.length-1][0][2][y]=e(v[0],v[1],v[2].length?v[2]:void 0));else if(0===g&&l[1]===Y)void 0===l[2]||null===l[2]?l[2]="":l[2]||(l[2]=n("",l[2])),Array.isArray(l[2][0])?v[2].push.apply(v[2],l[2]):v[2].push(l[2]);else if(g===Y)v[2].push(l[1]);else if(g!==he&&g!==ue)throw new Error("unhandled: "+g)}if(d[2].length>1&&/^\s*$/.test(d[2][0])&&d[2].shift(),d[2].length>2||2===d[2].length&&/\S/.test(d[2][1]))throw new Error("multiple root elements must be wrapped in an enclosing tag");return Array.isArray(d[2][0])&&"string"==typeof d[2][0][0]&&Array.isArray(d[2][0][2])&&(d[2][0]=e(d[2][0][0],d[2][0][1],d[2][0][2])),d[2][0];function E(e){var n=[];o===ie&&(o=te);for(var r=0;r<e.length;r++){var i=e.charAt(r);o===Y&&"<"===i?(s.length&&n.push([Y,s]),s="",o=J):">"!==i||le(o)||o===ce?o===ce&&/-$/.test(s)&&"-"===i?(t.comments&&n.push([oe,s.substr(0,s.length-1)],[ee]),s="",o=Y):o===J&&/^!--$/.test(s)?(t.comments&&n.push([J,s],[ne,"comment"],[he]),s=i,o=ce):o===Y||o===ce?s+=i:o===J&&"/"===i&&s.length||(o===J&&/\s/.test(i)?(s.length&&n.push([J,s]),s="",o=te):o===J?s+=i:o===te&&/[^\s"'=/]/.test(i)?(o=ne,s=i):o===te&&/\s/.test(i)?(s.length&&n.push([ne,s]),n.push([ue])):o===ne&&/\s/.test(i)?(n.push([ne,s]),s="",o=re):o===ne&&"="===i?(n.push([ne,s],[he]),s="",o=ie):o===ne?s+=i:o!==re&&o!==te||"="!==i?o!==re&&o!==te||/\s/.test(i)?o===ie&&'"'===i?o=ae:o===ie&&"'"===i?o=se:o===ae&&'"'===i?(n.push([oe,s],[ue]),s="",o=te):o===se&&"'"===i?(n.push([oe,s],[ue]),s="",o=te):o!==ie||/\s/.test(i)?o===oe&&/\s/.test(i)?(n.push([oe,s],[ue]),s="",o=te):o!==oe&&o!==se&&o!==ae||(s+=i):(o=oe,r--):(n.push([ue]),/[\w-]/.test(i)?(s+=i,o=ne):o=te):(n.push([he]),o=ie)):(o===J&&s.length?n.push([J,s]):o===ne?n.push([ne,s]):o===oe&&s.length&&n.push([oe,s]),n.push([ee]),s="",o=Y)}return o===Y&&s.length?(n.push([Y,s]),s=""):o===oe&&s.length?(n.push([oe,s]),s=""):o===ae&&s.length?(n.push([oe,s]),s=""):o===se&&s.length?(n.push([oe,s]),s=""):o===ne&&(n.push([ne,s]),s=""),n}};function r(e){return"function"==typeof e?e:"string"==typeof e?e:e&&"object"==typeof e?e:n("",e)}}(we,{comments:!0})).default=pe,pe.createElement=we;var be=pe,Ae={};function _e(e){if(!(this instanceof _e))return new _e(e);"number"==typeof e&&(e={max:e}),e||(e={}),this.cache={},this.head=this.tail=null,this.length=0,this.max=e.max||1e3,this.maxAge=e.maxAge||0}Ae=_e,Object.defineProperty(_e.prototype,"keys",{get:function(){return Object.keys(this.cache)}}),_e.prototype.clear=function(){this.cache={},this.head=this.tail=null,this.length=0},_e.prototype.remove=function(e){if("string"!=typeof e&&(e=""+e),this.cache.hasOwnProperty(e)){var t=this.cache[e];return delete this.cache[e],this._unlink(e,t.prev,t.next),t.value}},_e.prototype._unlink=function(e,t,n){this.length--,0===this.length?this.head=this.tail=null:this.head===e?(this.head=t,this.cache[this.head].next=null):this.tail===e?(this.tail=n,this.cache[this.tail].prev=null):(this.cache[t].next=n,this.cache[n].prev=t)},_e.prototype.peek=function(e){if(this.cache.hasOwnProperty(e)){var t=this.cache[e];if(this._checkAge(e,t))return t.value}},_e.prototype.set=function(e,t){var n;if("string"!=typeof e&&(e=""+e),this.cache.hasOwnProperty(e)){if((n=this.cache[e]).value=t,this.maxAge&&(n.modified=Date.now()),e===this.head)return t;this._unlink(e,n.prev,n.next)}else n={value:t,modified:0,next:null,prev:null},this.maxAge&&(n.modified=Date.now()),this.cache[e]=n,this.length===this.max&&this.evict();return this.length++,n.next=null,n.prev=this.head,this.head&&(this.cache[this.head].next=e),this.head=e,this.tail||(this.tail=e),t},_e.prototype._checkAge=function(e,t){return!(this.maxAge&&Date.now()-t.modified>this.maxAge&&(this.remove(e),1))},_e.prototype.get=function(e){if("string"!=typeof e&&(e=""+e),this.cache.hasOwnProperty(e)){var t=this.cache[e];if(this._checkAge(e,t))return this.head!==e&&(e===this.tail?(this.tail=t.next,this.cache[this.tail].prev=null):this.cache[t.prev].next=t.next,this.cache[t.next].prev=t.prev,this.cache[this.head].next=e,t.prev=this.head,t.next=null,this.head=e),t.value}},_e.prototype.evict=function(){this.tail&&this.remove(this.tail)};var Ee={};function Oe(e,t,n){this.cache="number"==typeof n?new Ae(n):n||new Ae(100),this.state=e,this.emit=t}function Te(e){return new(e.bind.apply(e,arguments))}Ee=Oe,Oe.prototype.render=function(e,t){var n=this.cache.get(t);if(!n){for(var r=[],i=2,o=arguments.length;i<o;i++)r.push(arguments[i]);r.unshift(e,t,this.state,this.emit),n=Te.apply(Te,r),this.cache.set(t,n)}return n};var xe=function(e){var t=document.readyState;if("complete"===t||"interactive"===t)return setTimeout(e,0);document.addEventListener("DOMContentLoaded",function(){e()})},Se="undefined"!=typeof window;function Ne(e){this.hasWindow=e,this.hasIdle=this.hasWindow&&window.requestIdleCallback,this.method=this.hasIdle?window.requestIdleCallback.bind(window):this.setTimeout,this.scheduled=!1,this.queue=[]}Ne.prototype.push=function(e){this.queue.push(e),this.schedule()},Ne.prototype.schedule=function(){if(!this.scheduled){this.scheduled=!0;var e=this;this.method(function(t){for(;e.queue.length&&t.timeRemaining()>0;)e.queue.shift()(t);e.scheduled=!1,e.queue.length&&e.schedule()})}},Ne.prototype.setTimeout=function(e){setTimeout(e,0,{timeRemaining:function(){return 1}})};var Ce,Le=function(){var e;return Se?(window._nanoScheduler||(window._nanoScheduler=new Ne(!0)),e=window._nanoScheduler):e=new Ne,e}();ke.disabled=!0;try{Ce=window.performance,ke.disabled="true"===window.localStorage.DISABLE_NANOTIMING||!Ce.mark}catch(e){}function ke(e){if(ke.disabled)return Re;var t=(1e4*Ce.now()).toFixed()%Number.MAX_SAFE_INTEGER,n="start-"+t+"-"+e;function r(r){var i="end-"+t+"-"+e;Ce.mark(i),Le.push(function(){var o=null;try{var s=e+" ["+t+"]";Ce.measure(s,n,i),Ce.clearMarks(n),Ce.clearMarks(i)}catch(e){o=e}r&&r(o,e)})}return Ce.mark(n),r.uuid=t,r}function Re(e){e&&Le.push(function(){e(new Error("nanotiming: performance API unavailable"))})}var je=ke,Ie=function(e,t,n){var r,i=e.length;if(!(t>=i||0===n)){var o=i-(n=t+n>i?i-t:n);for(r=t;r<o;++r)e[r]=e[r+n];e.length=o}},Pe={};function De(e){if(!(this instanceof De))return new De(e);this._name=e||"nanobus",this._starListeners=[],this._listeners={}}Pe=De,De.prototype.emit=function(e){for(var t=[],n=1,r=arguments.length;n<r;n++)t.push(arguments[n]);var i=je(this._name+"('"+e+"')"),o=this._listeners[e];return o&&o.length>0&&this._emit(this._listeners[e],t),this._starListeners.length>0&&this._emit(this._starListeners,e,t,i.uuid),i(),this},De.prototype.on=De.prototype.addListener=function(e,t){return"*"===e?this._starListeners.push(t):(this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t)),this},De.prototype.prependListener=function(e,t){return"*"===e?this._starListeners.unshift(t):(this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].unshift(t)),this},De.prototype.once=function(e,t){var n=this;return this.on(e,function r(){t.apply(n,arguments),n.removeListener(e,r)}),this},De.prototype.prependOnceListener=function(e,t){var n=this;return this.prependListener(e,function r(){t.apply(n,arguments),n.removeListener(e,r)}),this},De.prototype.removeListener=function(e,t){return"*"===e?(this._starListeners=this._starListeners.slice(),n(this._starListeners,t)):(void 0!==this._listeners[e]&&(this._listeners[e]=this._listeners[e].slice()),n(this._listeners[e],t));function n(e,t){if(e){var n=e.indexOf(t);return-1!==n?(Ie(e,n,1),!0):void 0}}},De.prototype.removeAllListeners=function(e){return e?"*"===e?this._starListeners=[]:this._listeners[e]=[]:(this._starListeners=[],this._listeners={}),this},De.prototype.listeners=function(e){var t="*"!==e?this._listeners[e]:this._starListeners,n=[];if(t)for(var r=t.length,i=0;i<r;i++)n.push(t[i]);return n},De.prototype._emit=function(e,t,n,r){if(void 0!==e&&0!==e.length){void 0===n&&(n=t,t=null),t&&(n=void 0!==r?[t].concat(n,r):[t].concat(n));for(var i=e.length,o=0;o<i;o++){var s=e[o];s.apply(s,n)}}};var Me=/(noopener|noreferrer) (noopener|noreferrer)/,qe=/^[\w-_]+:/,$e=function(){return window.location.pathname.replace(/\/$/,"")+window.location.hash.replace(/^#/,"/")},Ue=["onclick","ondblclick","onmousedown","onmouseup","onmouseover","onmousemove","onmouseout","onmouseenter","onmouseleave","ontouchcancel","ontouchend","ontouchmove","ontouchstart","ondragstart","ondrag","ondragenter","ondragleave","ondragover","ondrop","ondragend","onkeydown","onkeypress","onkeyup","onunload","onabort","onerror","onresize","onscroll","onselect","onchange","onsubmit","onreset","onfocus","onblur","oninput","oncontextmenu","onfocusin","onfocusout"],Ge=Ue.length;function Ve(e,t,n){e[n]!==t[n]&&(t[n]=e[n],e[n]?t.setAttribute(n,""):t.removeAttribute(n))}var Fe=function(e,t){var n=e.nodeType,r=e.nodeName;1===n&&function(e,t){for(var n=t.attributes,r=e.attributes,i=null,o=null,s=null,a=null,h=r.length-1;h>=0;--h)s=(a=r[h]).name,i=a.namespaceURI,o=a.value,i?(s=a.localName||s,t.getAttributeNS(i,s)!==o&&t.setAttributeNS(i,s,o)):t.hasAttribute(s)?t.getAttribute(s)!==o&&("null"===o||"undefined"===o?t.removeAttribute(s):t.setAttribute(s,o)):t.setAttribute(s,o);for(var u=n.length-1;u>=0;--u)!1!==(a=n[u]).specified&&(s=a.name,(i=a.namespaceURI)?(s=a.localName||s,e.hasAttributeNS(i,s)||t.removeAttributeNS(i,s)):e.hasAttributeNS(null,s)||t.removeAttribute(s))}(e,t),3!==n&&8!==n||t.nodeValue!==e.nodeValue&&(t.nodeValue=e.nodeValue),"INPUT"===r?function(e,t){var n=e.value,r=t.value;Ve(e,t,"checked"),Ve(e,t,"disabled"),n!==r&&(t.setAttribute("value",n),t.value=n),"null"===n&&(t.value="",t.removeAttribute("value")),e.hasAttributeNS(null,"value")?"range"===t.type&&(t.value=n):t.removeAttribute("value")}(e,t):"OPTION"===r?function(e,t){Ve(e,t,"selected")}(e,t):"TEXTAREA"===r&&function(e,t){var n=e.value;if(n!==t.value&&(t.value=n),t.firstChild&&t.firstChild.nodeValue!==n){if(""===n&&t.firstChild.nodeValue===t.placeholder)return;t.firstChild.nodeValue=n}}(e,t),function(e,t){for(var n=0;n<Ge;n++){var r=Ue[n];e[r]?t[r]=e[r]:t[r]&&(t[r]=void 0)}}(e,t)},We=3;function He(e,t){return e.id?e.id===t.id:e.isSameNode?e.isSameNode(t):e.tagName===t.tagName&&e.type===We&&e.nodeValue===t.nodeValue}var Be=function(e,t){return function e(t,n){return n?t?t.isSameNode&&t.isSameNode(n)?n:t.tagName!==n.tagName?t:(Fe(t,n),function(t,n){for(var r,i,o,s,a=0,h=0;r=n.childNodes[h],i=t.childNodes[h-a],r||i;h++)if(i)if(r)if(He(i,r))(o=e(i,r))!==r&&(n.replaceChild(o,r),a++);else{s=null;for(var u=h;u<n.childNodes.length;u++)if(He(n.childNodes[u],i)){s=n.childNodes[u];break}s?((o=e(i,s))!==s&&a++,n.insertBefore(o,r)):i.id||r.id?(n.insertBefore(i,r),a++):(o=e(i,r))!==r&&(n.replaceChild(o,r),a++)}else n.appendChild(i),a++;else n.removeChild(r),h--}(t,n),n):null:t}(t,e)},ze=/([^?=&]+)(=([^&]*))?/g,Ke=function(){for(var e={},t=0;t<arguments.length;t++){var n=arguments[t];for(var r in n)Ze.call(n,r)&&(e[r]=n[r])}return e},Ze=Object.prototype.hasOwnProperty,Qe={};function Xe(){if(!(this instanceof Xe))return new Xe;this.trie={nodes:{}}}Qe=Xe,Xe.prototype.create=function(e){var t=e.replace(/^\//,"").split("/");return function e(n,r){var i=t.hasOwnProperty(n)&&t[n];if(!1===i)return r;var o=null;return/^:|^\*/.test(i)?(r.nodes.hasOwnProperty("$$")?o=r.nodes.$$:(o={nodes:{}},r.nodes.$$=o),"*"===i[0]&&(r.wildcard=!0),r.name=i.replace(/^:|^\*/,"")):r.nodes.hasOwnProperty(i)?o=r.nodes[i]:(o={nodes:{}},r.nodes[i]=o),e(n+1,o)}(0,this.trie)},Xe.prototype.match=function(e){var t=e.replace(/^\//,"").split("/"),n={},r=function e(r,i){if(void 0!==i){var o=t[r];if(void 0===o)return i;if(i.nodes.hasOwnProperty(o))return e(r+1,i.nodes[o]);if(i.name){try{n[i.name]=decodeURIComponent(o)}catch(t){return e(r,void 0)}return e(r+1,i.nodes.$$)}if(i.wildcard){try{n.wildcard=decodeURIComponent(t.slice(r).join("/"))}catch(t){return e(r,void 0)}return i.nodes.$$}return e(r+1)}}(0,this.trie);if(r)return(r=Ke(r)).params=n,r},Xe.prototype.mount=function(e,t){var n=e.replace(/^\//,"").split("/"),r=null,i=null;if(1===n.length)i=n[0],r=this.create(i);else{var o=n.join("/");i=n[0],r=this.create(o)}U(r.nodes,t.nodes),t.name&&(r.name=t.name),r.nodes[""]&&(Object.keys(r.nodes[""]).forEach(function(e){"nodes"!==e&&(r[e]=r.nodes[""][e])}),U(r.nodes,r.nodes[""].nodes),delete r.nodes[""].nodes)};var Ye=function e(t){if(!(this instanceof e))return new e(t);var n=(t||"").replace(/^\//,""),r=Qe();return i._trie=r,i.on=function(e,t){(e=e||"/",t.route=e,t&&t._wayfarer&&t._trie)?r.mount(e,t._trie.trie):r.create(e).cb=t;return i},i.emit=i,i.match=o,i._wayfarer=!0,i;function i(e){var t=o(e),n=new Array(arguments.length);n[0]=t.params;for(var r=1;r<n.length;r++)n[r]=arguments[r];return t.cb.apply(t.cb,n)}function o(e){var t=r.match(e);if(t&&t.cb)return new s(t);var i=r.match(n);if(i&&i.cb)return new s(i);throw new Error("route '"+e+"' did not match")}function s(e){this.cb=e.cb,this.route=e.cb.route,this.params=e.params}},Je={},et=/file:\/\//.test("object"==typeof window&&window.location&&window.location.origin),tt=new RegExp("^(file://|/)(.*.html?/?)?"),nt=new RegExp("^(http(s)?(://))?(www.)?[a-zA-Z0-9-_.]+(:[0-9]{1,5})?(/{1})?"),rt=new RegExp("#"),it=new RegExp("[?].*$");function ot(e){if(!(this instanceof ot))return new ot(e);e=e||{},this.router=Ye(e.default||"/404")}function st(e,t){return e=t?e.replace(tt,""):e.replace(nt,""),decodeURI(e.replace(it,"").replace(rt,"/"))}Je=ot,ot.prototype.on=function(e,t){e=e.replace(/^[#/]/,""),this.router.on(e,t)},ot.prototype.emit=function(e){return e=st(e,et),this.router.emit(e)},ot.prototype.match=function(e){return e=st(e,et),this.router.match(e)};var at=ut,ht={};function ut(e){if(!(this instanceof ut))return new ut(e);e=e||{};var t=this;this._events={DOMCONTENTLOADED:"DOMContentLoaded",DOMTITLECHANGE:"DOMTitleChange",REPLACESTATE:"replaceState",PUSHSTATE:"pushState",NAVIGATE:"navigate",POPSTATE:"popState",RENDER:"render"},this._historyEnabled=void 0===e.history||e.history,this._hrefEnabled=void 0===e.href||e.href,this._hasWindow="undefined"!=typeof window,this._createLocation=$e,this._cache=e.cache,this._loaded=!1,this._stores=[],this._tree=null;var n={events:this._events,components:{}};this._hasWindow?(this.state=window.initialState?Ke(window.initialState,n):n,delete window.initialState):this.state=n,this.router=Je({curry:!0}),this.emitter=Pe("choo.emit"),this.emit=this.emitter.emit.bind(this.emitter),this._hasWindow&&(this.state.title=document.title),this.emitter.prependListener(this._events.DOMTITLECHANGE,function(e){t.state.title=e,t._hasWindow&&(document.title=e)})}ut.prototype.route=function(e,t){this.router.on(e,t)},ut.prototype.use=function(e){var t=this;this._stores.push(function(n){var r="choo.use";r=e.storeName?r+"("+e.storeName+")":r;var i=je(r);e(n,t.emitter,t),i()})},ut.prototype.start=function(){var e,t,n=this;return this._historyEnabled&&(this.emitter.prependListener(this._events.NAVIGATE,function(){n._matchRoute(),n._loaded&&(n.emitter.emit(n._events.RENDER),setTimeout(function(e,t){if(e)try{var n=document.querySelector(e);n&&n.scrollIntoView(t)}catch(e){}}.bind(null,window.location.hash),0))}),this.emitter.prependListener(this._events.POPSTATE,function(){n.emitter.emit(n._events.NAVIGATE)}),this.emitter.prependListener(this._events.PUSHSTATE,function(e){window.history.pushState(ht,null,e),n.emitter.emit(n._events.NAVIGATE)}),this.emitter.prependListener(this._events.REPLACESTATE,function(e){window.history.replaceState(ht,null,e),n.emitter.emit(n._events.NAVIGATE)}),window.onpopstate=function(){n.emitter.emit(n._events.POPSTATE)},n._hrefEnabled&&(e=function(e){var t=e.href;t!==window.location.href&&n.emitter.emit(n._events.PUSHSTATE,t)},t=t||window.document,window.addEventListener("click",function(n){if(!(n.button&&0!==n.button||n.ctrlKey||n.metaKey||n.altKey||n.shiftKey||n.defaultPrevented)){var r=function e(n){if(n&&n!==t)return"a"!==n.localName||void 0===n.href?e(n.parentNode):n}(n.target);r&&(window.location.origin!==r.origin||r.hasAttribute("download")||"_blank"===r.getAttribute("target")&&Me.test(r.getAttribute("rel"))||qe.test(r.getAttribute("href"))||(n.preventDefault(),e(r)))}}))),this._setCache(this.state),this._stores.forEach(function(e){e(n.state)}),this._matchRoute(),this._tree=this._prerender(this.state),this.emitter.prependListener(n._events.RENDER,function(e,t){t||(t=window.requestAnimationFrame);var n=!1,r=null;return function(){null!==r||n||(n=!0,t(function(){n=!1;for(var t=r.length,i=new Array(t),o=0;o<t;o++)i[o]=r[o];e.apply(e,i),r=null})),r=arguments}}(function(){var e=je("choo.render"),t=n._prerender(n.state),r=je("choo.morph");Be(n._tree,t),r(),e()})),xe(function(){n.emitter.emit(n._events.DOMCONTENTLOADED),n._loaded=!0}),this._tree},ut.prototype.mount=function(e){if("object"!=typeof window)return this.selector=e,this;var t=this;xe(function(){var n=je("choo.render"),r=t.start();t._tree="string"==typeof e?document.querySelector(e):e;var i=je("choo.morph");Be(t._tree,r),i(),n()})},ut.prototype.toString=function(e,t){this.state=Ke(this.state,t||{});var n=this;this._setCache(this.state),this._stores.forEach(function(e){e(n.state)}),this._matchRoute(e);var r=this._prerender(this.state);return"string"==typeof r.outerHTML?r.outerHTML:r.toString()},ut.prototype._matchRoute=function(e){var t,n;e?(t=e.replace(/\?.+$/,""),n=e):(t=this._createLocation(),n=window.location.search);var r,i=this.router.match(t);return this._handler=i.cb,this.state.href=t,this.state.query=(r={},n.replace(/^.*\?/,"").replace(ze,function(e,t,n,i){r[decodeURIComponent(t)]=decodeURIComponent(i)}),r),this.state.route=i.route,this.state.params=i.params,this.state},ut.prototype._prerender=function(e){var t=je("choo.prerender('"+e.route+"')"),n=this._handler(e,this.emit);return t(),n},ut.prototype._setCache=function(e){var t=new Ee(e,this.emitter.emit.bind(this.emitter),this._cache);function n(e,n){for(var r=[],i=0,o=arguments.length;i<o;i++)r.push(arguments[i]);return t.render.apply(t,r)}e.cache=n,n.toJSON=function(){return null}};var ct=[{title:"background",link:"background",post:"here is what i want to say"},{title:"the future",link:"the-future",post:"here is another thing."},{title:"a third thing",link:"a-third-thing",post:"a third thing tooo."}];const lt=()=>be` |
| 1 | +(function(){ |
| 2 | +var _$browser_4 = {}; |
| 3 | +var cachedSetTimeout,cachedClearTimeout,process=_$browser_4={};function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}function runTimeout(fun){if(cachedSetTimeout===setTimeout)return setTimeout(fun,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(fun,0);try{return cachedSetTimeout(fun,0)}catch(e){try{return cachedSetTimeout.call(null,fun,0)}catch(e){return cachedSetTimeout.call(this,fun,0)}}}!function(){try{cachedSetTimeout="function"==typeof setTimeout?setTimeout:defaultSetTimout}catch(e){cachedSetTimeout=defaultSetTimout}try{cachedClearTimeout="function"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(e){cachedClearTimeout=defaultClearTimeout}}();var currentQueue,queue=[],draining=!1,queueIndex=-1;function cleanUpNextTick(){draining&¤tQueue&&(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var timeout=runTimeout(cleanUpNextTick);draining=!0;for(var len=queue.length;len;){for(currentQueue=queue,queue=[];++queueIndex<len;)currentQueue&¤tQueue[queueIndex].run();queueIndex=-1,len=queue.length}currentQueue=null,draining=!1,function(marker){if(cachedClearTimeout===clearTimeout)return clearTimeout(marker);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(marker);try{cachedClearTimeout(marker)}catch(e){try{return cachedClearTimeout.call(null,marker)}catch(e){return cachedClearTimeout.call(this,marker)}}}(timeout)}}function Item(fun,array){this.fun=fun,this.array=array}function noop(){}process.nextTick=function(fun){var args=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)args[i-1]=arguments[i];queue.push(new Item(fun,args)),1!==queue.length||draining||runTimeout(drainQueue)},Item.prototype.run=function(){this.fun.apply(null,this.array)},process.title="browser",process.browser=!0,process.env={},process.argv=[],process.version="",process.versions={},process.on=noop,process.addListener=noop,process.once=noop,process.off=noop,process.removeListener=noop,process.removeAllListeners=noop,process.emit=noop,process.prependListener=noop,process.prependOnceListener=noop,process.listeners=function(name){return[]},process.binding=function(name){throw new Error("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(dir){throw new Error("process.chdir is not supported")},process.umask=function(){return 0}; |
| 4 | + |
| 5 | +var _$pathBrowserify_24 = {}; |
| 6 | +(function (process){ |
| 7 | +function normalizeArray(parts,allowAboveRoot){for(var up=0,i=parts.length-1;i>=0;i--){var last=parts[i];"."===last?parts.splice(i,1):".."===last?(parts.splice(i,1),up++):up&&(parts.splice(i,1),up--)}if(allowAboveRoot)for(;up--;up)parts.unshift("..");return parts}var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,splitPath=function(filename){return splitPathRe.exec(filename).slice(1)};function filter(xs,f){if(xs.filter)return xs.filter(f);for(var res=[],i=0;i<xs.length;i++)f(xs[i],i,xs)&&res.push(xs[i]);return res}_$pathBrowserify_24.resolve=function(){for(var resolvedPath="",resolvedAbsolute=!1,i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:process.cwd();if("string"!=typeof path)throw new TypeError("Arguments to path.resolve must be strings");path&&(resolvedPath=path+"/"+resolvedPath,resolvedAbsolute="/"===path.charAt(0))}return resolvedPath=normalizeArray(filter(resolvedPath.split("/"),function(p){return!!p}),!resolvedAbsolute).join("/"),(resolvedAbsolute?"/":"")+resolvedPath||"."},_$pathBrowserify_24.normalize=function(path){var isAbsolute=_$pathBrowserify_24.isAbsolute(path),trailingSlash="/"===substr(path,-1);return(path=normalizeArray(filter(path.split("/"),function(p){return!!p}),!isAbsolute).join("/"))||isAbsolute||(path="."),path&&trailingSlash&&(path+="/"),(isAbsolute?"/":"")+path},_$pathBrowserify_24.isAbsolute=function(path){return"/"===path.charAt(0)},_$pathBrowserify_24.join=function(){var paths=Array.prototype.slice.call(arguments,0);return _$pathBrowserify_24.normalize(filter(paths,function(p,index){if("string"!=typeof p)throw new TypeError("Arguments to path.join must be strings");return p}).join("/"))}, void 0, function(from,to){function trim(arr){for(var start=0;start<arr.length&&""===arr[start];start++);for(var end=arr.length-1;end>=0&&""===arr[end];end--);return start>end?[]:arr.slice(start,end-start+1)}from=_$pathBrowserify_24.resolve(from).substr(1),to=_$pathBrowserify_24.resolve(to).substr(1);for(var fromParts=trim(from.split("/")),toParts=trim(to.split("/")),length=Math.min(fromParts.length,toParts.length),samePartsLength=length,i=0;i<length;i++)if(fromParts[i]!==toParts[i]){samePartsLength=i;break}var outputParts=[];for(i=samePartsLength;i<fromParts.length;i++)outputParts.push("..");return(outputParts=outputParts.concat(toParts.slice(samePartsLength))).join("/")}, "/", ":", void 0, function(path){var result=splitPath(path),root=result[0],dir=result[1];return root||dir?(dir&&(dir=dir.substr(0,dir.length-1)),root+dir):"."}, void 0, function(path,ext){var f=splitPath(path)[2];return ext&&f.substr(-1*ext.length)===ext&&(f=f.substr(0,f.length-ext.length)),f}, void 0, function(path){return splitPath(path)[3]};var substr="b"==="ab".substr(-1)?function(str,start,len){return str.substr(start,len)}:function(str,start,len){return start<0&&(start=str.length+start),str.substr(start,len)}; |
| 8 | + |
| 9 | +}).call(this,_$browser_4) |
| 10 | +var _$punycode_25 = { exports: {} }; |
| 11 | +(function (global){ |
| 12 | +!function(root){var freeExports="object"==typeof _$punycode_25.exports&&_$punycode_25.exports&&!_$punycode_25.exports.nodeType&&_$punycode_25.exports,freeModule="object"=="object"&&_$punycode_25&&!_$punycode_25.nodeType&&_$punycode_25,freeGlobal="object"==typeof global&&global;freeGlobal.global!==freeGlobal&&freeGlobal.window!==freeGlobal&&freeGlobal.self!==freeGlobal||(root=freeGlobal);var punycode,key,maxInt=2147483647,base=36,tMin=1,tMax=26,skew=38,damp=700,initialBias=72,initialN=128,delimiter="-",regexPunycode=/^xn--/,regexNonASCII=/[^\x20-\x7E]/,regexSeparators=/[\x2E\u3002\uFF0E\uFF61]/g,errors={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},baseMinusTMin=base-tMin,floor=Math.floor,stringFromCharCode=String.fromCharCode;function error(type){throw new RangeError(errors[type])}function map(array,fn){for(var length=array.length,result=[];length--;)result[length]=fn(array[length]);return result}function mapDomain(string,fn){var parts=string.split("@"),result="";return parts.length>1&&(result=parts[0]+"@",string=parts[1]),result+map((string=string.replace(regexSeparators,".")).split("."),fn).join(".")}function ucs2decode(string){for(var value,extra,output=[],counter=0,length=string.length;counter<length;)(value=string.charCodeAt(counter++))>=55296&&value<=56319&&counter<length?56320==(64512&(extra=string.charCodeAt(counter++)))?output.push(((1023&value)<<10)+(1023&extra)+65536):(output.push(value),counter--):output.push(value);return output}function ucs2encode(array){return map(array,function(value){var output="";return value>65535&&(output+=stringFromCharCode((value-=65536)>>>10&1023|55296),value=56320|1023&value),output+=stringFromCharCode(value)}).join("")}function digitToBasic(digit,flag){return digit+22+75*(digit<26)-((0!=flag)<<5)}function adapt(delta,numPoints,firstTime){var k=0;for(delta=firstTime?floor(delta/damp):delta>>1,delta+=floor(delta/numPoints);delta>baseMinusTMin*tMax>>1;k+=base)delta=floor(delta/baseMinusTMin);return floor(k+(baseMinusTMin+1)*delta/(delta+skew))}function decode(input){var out,basic,j,index,oldi,w,k,digit,t,baseMinusT,codePoint,output=[],inputLength=input.length,i=0,n=initialN,bias=initialBias;for((basic=input.lastIndexOf(delimiter))<0&&(basic=0),j=0;j<basic;++j)input.charCodeAt(j)>=128&&error("not-basic"),output.push(input.charCodeAt(j));for(index=basic>0?basic+1:0;index<inputLength;){for(oldi=i,w=1,k=base;index>=inputLength&&error("invalid-input"),((digit=(codePoint=input.charCodeAt(index++))-48<10?codePoint-22:codePoint-65<26?codePoint-65:codePoint-97<26?codePoint-97:base)>=base||digit>floor((maxInt-i)/w))&&error("overflow"),i+=digit*w,!(digit<(t=k<=bias?tMin:k>=bias+tMax?tMax:k-bias));k+=base)w>floor(maxInt/(baseMinusT=base-t))&&error("overflow"),w*=baseMinusT;bias=adapt(i-oldi,out=output.length+1,0==oldi),floor(i/out)>maxInt-n&&error("overflow"),n+=floor(i/out),i%=out,output.splice(i++,0,n)}return ucs2encode(output)}function encode(input){var n,delta,handledCPCount,basicLength,bias,j,m,q,k,t,currentValue,inputLength,handledCPCountPlusOne,baseMinusT,qMinusT,output=[];for(inputLength=(input=ucs2decode(input)).length,n=initialN,delta=0,bias=initialBias,j=0;j<inputLength;++j)(currentValue=input[j])<128&&output.push(stringFromCharCode(currentValue));for(handledCPCount=basicLength=output.length,basicLength&&output.push(delimiter);handledCPCount<inputLength;){for(m=maxInt,j=0;j<inputLength;++j)(currentValue=input[j])>=n&¤tValue<m&&(m=currentValue);for(m-n>floor((maxInt-delta)/(handledCPCountPlusOne=handledCPCount+1))&&error("overflow"),delta+=(m-n)*handledCPCountPlusOne,n=m,j=0;j<inputLength;++j)if((currentValue=input[j])<n&&++delta>maxInt&&error("overflow"),currentValue==n){for(q=delta,k=base;!(q<(t=k<=bias?tMin:k>=bias+tMax?tMax:k-bias));k+=base)qMinusT=q-t,baseMinusT=base-t,output.push(stringFromCharCode(digitToBasic(t+qMinusT%baseMinusT,0))),q=floor(qMinusT/baseMinusT);output.push(stringFromCharCode(digitToBasic(q,0))),bias=adapt(delta,handledCPCountPlusOne,handledCPCount==basicLength),delta=0,++handledCPCount}++delta,++n}return output.join("")}if(punycode={version:"1.4.1",ucs2:{decode:ucs2decode,encode:ucs2encode},decode:decode,encode:encode,toASCII:function(input){return mapDomain(input,function(string){return regexNonASCII.test(string)?"xn--"+encode(string):string})},toUnicode:function(input){return mapDomain(input,function(string){return regexPunycode.test(string)?decode(string.slice(4).toLowerCase()):string})}},"function"==typeof define&&"object"==typeof define.amd&&define.amd)define("punycode",function(){return punycode});else if(freeExports&&freeModule)if(_$punycode_25.exports==freeExports)freeModule.exports=punycode;else for(key in punycode)punycode.hasOwnProperty(key)&&(freeExports[key]=punycode[key]);else root.punycode=punycode}(this); |
| 13 | + |
| 14 | +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) |
| 15 | +_$punycode_25 = _$punycode_25.exports |
| 16 | +"use strict";function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}var _$decode_26=function(qs,sep,eq,options){sep=sep||"&",eq=eq||"=";var obj={};if("string"!=typeof qs||0===qs.length)return obj;var regexp=/\+/g;qs=qs.split(sep);var maxKeys=1e3;options&&"number"==typeof options.maxKeys&&(maxKeys=options.maxKeys);var len=qs.length;maxKeys>0&&len>maxKeys&&(len=maxKeys);for(var i=0;i<len;++i){var kstr,vstr,k,v,x=qs[i].replace(regexp,"%20"),idx=x.indexOf(eq);idx>=0?(kstr=x.substr(0,idx),vstr=x.substr(idx+1)):(kstr=x,vstr=""),k=decodeURIComponent(kstr),v=decodeURIComponent(vstr),hasOwnProperty(obj,k)?isArray(obj[k])?obj[k].push(v):obj[k]=[obj[k],v]:obj[k]=v}return obj};var isArray=Array.isArray||function(xs){return"[object Array]"===Object.prototype.toString.call(xs)}; |
| 17 | + |
| 18 | +"use strict";var stringifyPrimitive=function(v){switch(typeof v){case"string":return v;case"boolean":return v?"true":"false";case"number":return isFinite(v)?v:"";default:return""}};var _$encode_27=function(obj,sep,eq,name){return sep=sep||"&",eq=eq||"=",null===obj&&(obj=void 0),"object"==typeof obj?map(objectKeys(obj),function(k){var ks=encodeURIComponent(stringifyPrimitive(k))+eq;return __isArray_27(obj[k])?map(obj[k],function(v){return ks+encodeURIComponent(stringifyPrimitive(v))}).join(sep):ks+encodeURIComponent(stringifyPrimitive(obj[k]))}).join(sep):name?encodeURIComponent(stringifyPrimitive(name))+eq+encodeURIComponent(stringifyPrimitive(obj)):""};var __isArray_27=Array.isArray||function(xs){return"[object Array]"===Object.prototype.toString.call(xs)};function map(xs,f){if(xs.map)return xs.map(f);for(var res=[],i=0;i<xs.length;i++)res.push(f(xs[i],i));return res}var objectKeys=Object.keys||function(obj){var res=[];for(var key in obj)Object.prototype.hasOwnProperty.call(obj,key)&&res.push(key);return res}; |
| 19 | + |
| 20 | +var _$querystringEs3_28 = {}; |
| 21 | +"use strict"; void 0, _$querystringEs3_28.parse=_$decode_26, void 0, _$querystringEs3_28.stringify=_$encode_27; |
| 22 | + |
| 23 | +"use strict";var _$util_32={isString:function(arg){return"string"==typeof arg},isObject:function(arg){return"object"==typeof arg&&null!==arg},isNull:function(arg){return null===arg},isNullOrUndefined:function(arg){return null==arg}}; |
| 24 | + |
| 25 | +var _$url_31 = {}; |
| 26 | +"use strict";var __dummy_31$0 = 0,__dummy_31$1 = 0;function Url(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null} urlParse, void 0, function(source,relative){return urlParse(source,!1,!0).resolve(relative)}, void 0, function(source,relative){return source?urlParse(source,!1,!0).resolveObject(relative):relative},_$url_31.format=function(obj){_$util_32.isString(obj)&&(obj=urlParse(obj));return obj instanceof Url?obj.format():Url.prototype.format.call(obj)}, Url;var protocolPattern=/^([a-z0-9.+-]+:)/i,portPattern=/:[0-9]*$/,simplePathPattern=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,unwise=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),autoEscape=["'"].concat(unwise),nonHostChars=["%","/","?",";","#"].concat(autoEscape),hostEndingChars=["/","?","#"],hostnamePartPattern=/^[+a-z0-9A-Z_-]{0,63}$/,hostnamePartStart=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,unsafeProtocol={javascript:!0,"javascript:":!0},hostlessProtocol={javascript:!0,"javascript:":!0},slashedProtocol={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},__dummy_31$2 = 0;function urlParse(url,parseQueryString,slashesDenoteHost){if(url&&_$util_32.isObject(url)&&url instanceof Url)return url;var u=new Url;return u.parse(url,parseQueryString,slashesDenoteHost),u}Url.prototype.parse=function(url,parseQueryString,slashesDenoteHost){if(!_$util_32.isString(url))throw new TypeError("Parameter 'url' must be a string, not "+typeof url);var queryIndex=url.indexOf("?"),splitter=-1!==queryIndex&&queryIndex<url.indexOf("#")?"?":"#",uSplit=url.split(splitter);uSplit[0]=uSplit[0].replace(/\\/g,"/");var rest=url=uSplit.join(splitter);if(rest=rest.trim(),!slashesDenoteHost&&1===url.split("#").length){var simplePath=simplePathPattern.exec(rest);if(simplePath)return this.path=rest,this.href=rest,this.pathname=simplePath[1],simplePath[2]?(this.search=simplePath[2],this.query=parseQueryString?_$querystringEs3_28.parse(this.search.substr(1)):this.search.substr(1)):parseQueryString&&(this.search="",this.query={}),this}var proto=protocolPattern.exec(rest);if(proto){var lowerProto=(proto=proto[0]).toLowerCase();this.protocol=lowerProto,rest=rest.substr(proto.length)}if(slashesDenoteHost||proto||rest.match(/^\/\/[^@\/]+@[^@\/]+/)){var slashes="//"===rest.substr(0,2);!slashes||proto&&hostlessProtocol[proto]||(rest=rest.substr(2),this.slashes=!0)}if(!hostlessProtocol[proto]&&(slashes||proto&&!slashedProtocol[proto])){for(var auth,atSign,hostEnd=-1,i=0;i<hostEndingChars.length;i++){-1!==(hec=rest.indexOf(hostEndingChars[i]))&&(-1===hostEnd||hec<hostEnd)&&(hostEnd=hec)}-1!==(atSign=-1===hostEnd?rest.lastIndexOf("@"):rest.lastIndexOf("@",hostEnd))&&(auth=rest.slice(0,atSign),rest=rest.slice(atSign+1),this.auth=decodeURIComponent(auth)),hostEnd=-1;for(i=0;i<nonHostChars.length;i++){var hec;-1!==(hec=rest.indexOf(nonHostChars[i]))&&(-1===hostEnd||hec<hostEnd)&&(hostEnd=hec)}-1===hostEnd&&(hostEnd=rest.length),this.host=rest.slice(0,hostEnd),rest=rest.slice(hostEnd),this.parseHost(),this.hostname=this.hostname||"";var ipv6Hostname="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!ipv6Hostname)for(var hostparts=this.hostname.split(/\./),l=(i=0,hostparts.length);i<l;i++){var part=hostparts[i];if(part&&!part.match(hostnamePartPattern)){for(var newpart="",j=0,k=part.length;j<k;j++)part.charCodeAt(j)>127?newpart+="x":newpart+=part[j];if(!newpart.match(hostnamePartPattern)){var validParts=hostparts.slice(0,i),notHost=hostparts.slice(i+1),bit=part.match(hostnamePartStart);bit&&(validParts.push(bit[1]),notHost.unshift(bit[2])),notHost.length&&(rest="/"+notHost.join(".")+rest),this.hostname=validParts.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),ipv6Hostname||(this.hostname=_$punycode_25.toASCII(this.hostname));var p=this.port?":"+this.port:"",h=this.hostname||"";this.host=h+p,this.href+=this.host,ipv6Hostname&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==rest[0]&&(rest="/"+rest))}if(!unsafeProtocol[lowerProto])for(i=0,l=autoEscape.length;i<l;i++){var ae=autoEscape[i];if(-1!==rest.indexOf(ae)){var esc=encodeURIComponent(ae);esc===ae&&(esc=escape(ae)),rest=rest.split(ae).join(esc)}}var hash=rest.indexOf("#");-1!==hash&&(this.hash=rest.substr(hash),rest=rest.slice(0,hash));var qm=rest.indexOf("?");if(-1!==qm?(this.search=rest.substr(qm),this.query=rest.substr(qm+1),parseQueryString&&(this.query=_$querystringEs3_28.parse(this.query)),rest=rest.slice(0,qm)):parseQueryString&&(this.search="",this.query={}),rest&&(this.pathname=rest),slashedProtocol[lowerProto]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){p=this.pathname||"";var s=this.search||"";this.path=p+s}return this.href=this.format(),this},Url.prototype.format=function(){var auth=this.auth||"";auth&&(auth=(auth=encodeURIComponent(auth)).replace(/%3A/i,":"),auth+="@");var protocol=this.protocol||"",pathname=this.pathname||"",hash=this.hash||"",host=!1,query="";this.host?host=auth+this.host:this.hostname&&(host=auth+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(host+=":"+this.port)),this.query&&_$util_32.isObject(this.query)&&Object.keys(this.query).length&&(query=_$querystringEs3_28.stringify(this.query));var search=this.search||query&&"?"+query||"";return protocol&&":"!==protocol.substr(-1)&&(protocol+=":"),this.slashes||(!protocol||slashedProtocol[protocol])&&!1!==host?(host="//"+(host||""),pathname&&"/"!==pathname.charAt(0)&&(pathname="/"+pathname)):host||(host=""),hash&&"#"!==hash.charAt(0)&&(hash="#"+hash),search&&"?"!==search.charAt(0)&&(search="?"+search),protocol+host+(pathname=pathname.replace(/[?#]/g,function(match){return encodeURIComponent(match)}))+(search=search.replace("#","%23"))+hash},Url.prototype.resolve=function(relative){return this.resolveObject(urlParse(relative,!1,!0)).format()},Url.prototype.resolveObject=function(relative){if(_$util_32.isString(relative)){var rel=new Url;rel.parse(relative,!1,!0),relative=rel}for(var result=new Url,tkeys=Object.keys(this),tk=0;tk<tkeys.length;tk++){var tkey=tkeys[tk];result[tkey]=this[tkey]}if(result.hash=relative.hash,""===relative.href)return result.href=result.format(),result;if(relative.slashes&&!relative.protocol){for(var rkeys=Object.keys(relative),rk=0;rk<rkeys.length;rk++){var rkey=rkeys[rk];"protocol"!==rkey&&(result[rkey]=relative[rkey])}return slashedProtocol[result.protocol]&&result.hostname&&!result.pathname&&(result.path=result.pathname="/"),result.href=result.format(),result}if(relative.protocol&&relative.protocol!==result.protocol){if(!slashedProtocol[relative.protocol]){for(var keys=Object.keys(relative),v=0;v<keys.length;v++){var k=keys[v];result[k]=relative[k]}return result.href=result.format(),result}if(result.protocol=relative.protocol,relative.host||hostlessProtocol[relative.protocol])result.pathname=relative.pathname;else{for(var relPath=(relative.pathname||"").split("/");relPath.length&&!(relative.host=relPath.shift()););relative.host||(relative.host=""),relative.hostname||(relative.hostname=""),""!==relPath[0]&&relPath.unshift(""),relPath.length<2&&relPath.unshift(""),result.pathname=relPath.join("/")}if(result.search=relative.search,result.query=relative.query,result.host=relative.host||"",result.auth=relative.auth,result.hostname=relative.hostname||relative.host,result.port=relative.port,result.pathname||result.search){var p=result.pathname||"",s=result.search||"";result.path=p+s}return result.slashes=result.slashes||relative.slashes,result.href=result.format(),result}var isSourceAbs=result.pathname&&"/"===result.pathname.charAt(0),isRelAbs=relative.host||relative.pathname&&"/"===relative.pathname.charAt(0),mustEndAbs=isRelAbs||isSourceAbs||result.host&&relative.pathname,removeAllDots=mustEndAbs,srcPath=result.pathname&&result.pathname.split("/")||[],psychotic=(relPath=relative.pathname&&relative.pathname.split("/")||[],result.protocol&&!slashedProtocol[result.protocol]);if(psychotic&&(result.hostname="",result.port=null,result.host&&(""===srcPath[0]?srcPath[0]=result.host:srcPath.unshift(result.host)),result.host="",relative.protocol&&(relative.hostname=null,relative.port=null,relative.host&&(""===relPath[0]?relPath[0]=relative.host:relPath.unshift(relative.host)),relative.host=null),mustEndAbs=mustEndAbs&&(""===relPath[0]||""===srcPath[0])),isRelAbs)result.host=relative.host||""===relative.host?relative.host:result.host,result.hostname=relative.hostname||""===relative.hostname?relative.hostname:result.hostname,result.search=relative.search,result.query=relative.query,srcPath=relPath;else if(relPath.length)srcPath||(srcPath=[]),srcPath.pop(),srcPath=srcPath.concat(relPath),result.search=relative.search,result.query=relative.query;else if(!_$util_32.isNullOrUndefined(relative.search)){if(psychotic)result.hostname=result.host=srcPath.shift(),(authInHost=!!(result.host&&result.host.indexOf("@")>0)&&result.host.split("@"))&&(result.auth=authInHost.shift(),result.host=result.hostname=authInHost.shift());return result.search=relative.search,result.query=relative.query,_$util_32.isNull(result.pathname)&&_$util_32.isNull(result.search)||(result.path=(result.pathname?result.pathname:"")+(result.search?result.search:"")),result.href=result.format(),result}if(!srcPath.length)return result.pathname=null,result.search?result.path="/"+result.search:result.path=null,result.href=result.format(),result;for(var last=srcPath.slice(-1)[0],hasTrailingSlash=(result.host||relative.host||srcPath.length>1)&&("."===last||".."===last)||""===last,up=0,i=srcPath.length;i>=0;i--)"."===(last=srcPath[i])?srcPath.splice(i,1):".."===last?(srcPath.splice(i,1),up++):up&&(srcPath.splice(i,1),up--);if(!mustEndAbs&&!removeAllDots)for(;up--;up)srcPath.unshift("..");!mustEndAbs||""===srcPath[0]||srcPath[0]&&"/"===srcPath[0].charAt(0)||srcPath.unshift(""),hasTrailingSlash&&"/"!==srcPath.join("/").substr(-1)&&srcPath.push("");var authInHost,isAbsolute=""===srcPath[0]||srcPath[0]&&"/"===srcPath[0].charAt(0);psychotic&&(result.hostname=result.host=isAbsolute?"":srcPath.length?srcPath.shift():"",(authInHost=!!(result.host&&result.host.indexOf("@")>0)&&result.host.split("@"))&&(result.auth=authInHost.shift(),result.host=result.hostname=authInHost.shift()));return(mustEndAbs=mustEndAbs||result.host&&srcPath.length)&&!isAbsolute&&srcPath.unshift(""),srcPath.length?result.pathname=srcPath.join("/"):(result.pathname=null,result.path=null),_$util_32.isNull(result.pathname)&&_$util_32.isNull(result.search)||(result.path=(result.pathname?result.pathname:"")+(result.search?result.search:"")),result.auth=relative.auth||result.auth,result.slashes=result.slashes||relative.slashes,result.href=result.format(),result},Url.prototype.parseHost=function(){var host=this.host,port=portPattern.exec(host);port&&(":"!==(port=port[0])&&(this.port=port.substr(1)),host=host.substr(0,host.length-port.length)),host&&(this.hostname=host)}; |
| 27 | + |
| 28 | +var _$mutable_36=function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)__hasOwnProperty_36.call(source,key)&&(target[key]=source[key])}return target};var __hasOwnProperty_36=Object.prototype.hasOwnProperty; |
| 29 | + |
| 30 | +var _$serviceWorker_5 = {}; |
| 31 | +(function (__dirname){ |
| 32 | +;_$serviceWorker_5=serviceWorker;var events=serviceWorker.events={INSTALLED:"sw:installed",UPDATED:"sw:updated",REDUNDANT:"sw:redundant",POST_MESSAGE:"sw:postMessage",MESSAGE:"sw:message",SYNC:"sw:sync",NOTIFICATION_REQUEST:"sw:notificationRequest",ERROR:"log:error"};function serviceWorker(name,opts){return name=name||"/sw.js",opts=opts||{},function(state,emitter){emitter.on(state.events.DOMCONTENTLOADED,function(){if((opts=_$mutable_36({scope:"/"},opts)).electron){var __dummy_5$0 = 0,__dummy_5$1 = 0;opts.scope=_$pathBrowserify_24.join(__dirname,opts.scope),name=_$url_31.format({pathname:_$pathBrowserify_24.join(__dirname,name.replace(/^\//,"")),protocol:"file:",slashes:!0}),delete opts.electron}if(window.onmessage=function(event){emitter.emit(events.MESSAGE,{data:event.data,channel:"window",port:null})},window.MessageChannel){var messageChannel=new MessageChannel;messageChannel.port1.onmessage=function(event){emitter.emit(events.MESSAGE,{data:event.data,channel:"messageChannel",port:"port1"})},messageChannel.port2.onmessage=function(event){emitter.emit(events.MESSAGE,{data:event.data,channel:"messageChannel",port:"port2"})}}emitter.on(events.NOTIFICATION_REQUEST,function(cb){Notification.requestPermission(function(result){"function"==typeof result&&cb(result)})}),navigator.serviceWorker&&navigator.onLine&&(navigator.serviceWorker.onmessage=function(event){emitter.emit(events.MESSAGE,{data:event.data,channel:"navigator.serviceWorker",port:null})},navigator.serviceWorker.register(name,opts).then(function(registration){registration.onupdatefound=function(){var installingWorker=registration.installing;installingWorker.onstatechange=function(){"installed"===installingWorker.state?navigator.serviceWorker.controller?emitter.emit(events.UPDATED,registration):emitter.emit(events.INSTALLED,registration):"redundant"===installingWorker.state&&emitter.emit(events.REDUNDANT,registration)}},registration.sync&&function(registration){registration.sync.getTags().then(function(tags){state.syncTags=tags}).catch(function(err){emitter.emit(events.ERROR,err)})}(registration)}).catch(function(err){emitter.emit(events.ERROR,err)}),navigator.serviceWorker.ready.then(function(registration){new Promise(function(resolve){var worker=registration.active;"activated"!==worker.state?(worker.addEventListener("statechange",resolve,{once:!0}),emitter.on(events.POST_MESSAGE,function(message){worker.postMessage(message)})):resolve()}).then(function(){registration.navigationPreload&®istration.navigationPreload.enable()}),emitter.on(events.SYNC,function(tag){registration.sync.register(tag).then(function(){return registration.sync.getTags()}).then(function(tags){state.syncTags=tags}).catch(function(err){emitter.emit(events.ERROR,err)})})}).catch(function(err){emitter.emit(events.ERROR,err)}))})}} |
| 33 | + |
| 34 | +}).call(this,"/node_modules/choo-service-worker") |
| 35 | +var trailingNewlineRegex=/\n[\s]+$/,leadingNewlineRegex=/^\n[\s]+/,trailingSpaceRegex=/[\s]+$/,leadingSpaceRegex=/^[\s]+/,multiSpaceRegex=/[\n\s]+/g,TEXT_TAGS=["a","abbr","b","bdi","bdo","br","cite","data","dfn","em","i","kbd","mark","q","rp","rt","rtc","ruby","s","amp","small","span","strong","sub","sup","time","u","var","wbr"],VERBATIM_TAGS=["code","pre","textarea"];var _$appendChild_2=function appendChild(el,childs){if(Array.isArray(childs))for(var value,leader,nodeName=el.nodeName.toLowerCase(),hadText=!1,i=0,len=childs.length;i<len;i++){var node=childs[i];if(Array.isArray(node))appendChild(el,node);else{("number"==typeof node||"boolean"==typeof node||"function"==typeof node||node instanceof Date||node instanceof RegExp)&&(node=node.toString());var lastChild=el.childNodes[el.childNodes.length-1];if("string"==typeof node)hadText=!0,lastChild&&"#text"===lastChild.nodeName?lastChild.nodeValue+=node:(node=document.createTextNode(node),el.appendChild(node),lastChild=node),i===len-1&&(hadText=!1,-1===TEXT_TAGS.indexOf(nodeName)&&-1===VERBATIM_TAGS.indexOf(nodeName)?""===(value=lastChild.nodeValue.replace(leadingNewlineRegex,"").replace(trailingSpaceRegex,"").replace(trailingNewlineRegex,"").replace(multiSpaceRegex," "))?el.removeChild(lastChild):lastChild.nodeValue=value:-1===VERBATIM_TAGS.indexOf(nodeName)&&(leader=0===i?"":" ",value=lastChild.nodeValue.replace(leadingNewlineRegex,leader).replace(leadingSpaceRegex," ").replace(trailingSpaceRegex,"").replace(trailingNewlineRegex,"").replace(multiSpaceRegex," "),lastChild.nodeValue=value));else if(node&&node.nodeType){hadText&&(hadText=!1,-1===TEXT_TAGS.indexOf(nodeName)&&-1===VERBATIM_TAGS.indexOf(nodeName)?""===(value=lastChild.nodeValue.replace(leadingNewlineRegex,"").replace(trailingNewlineRegex,"").replace(multiSpaceRegex," "))?el.removeChild(lastChild):lastChild.nodeValue=value:-1===VERBATIM_TAGS.indexOf(nodeName)&&(value=lastChild.nodeValue.replace(leadingSpaceRegex," ").replace(leadingNewlineRegex,"").replace(trailingNewlineRegex,"").replace(multiSpaceRegex," "),lastChild.nodeValue=value));var _nodeName=node.nodeName;_nodeName&&(nodeName=_nodeName.toLowerCase()),el.appendChild(node)}}}}; |
| 36 | + |
| 37 | +var _$hyperscriptAttributeToProperty_10=function(h){return function(tagName,attrs,children){for(var attr in attrs)attr in transform&&(attrs[transform[attr]]=attrs[attr],delete attrs[attr]);return h(tagName,attrs,children)}};var transform={class:"className",for:"htmlFor","http-equiv":"httpEquiv"}; |
| 38 | + |
| 39 | +var __dummy_11$0 = 0,TEXT=1,OPEN=2,CLOSE=3,ATTR=4,ATTR_KEY=5,ATTR_KEY_W=6,ATTR_VALUE_W=7,ATTR_VALUE=8,ATTR_VALUE_SQ=9,ATTR_VALUE_DQ=10,ATTR_EQ=11,ATTR_BREAK=12,COMMENT=13;function quot(state){return state===ATTR_VALUE_SQ||state===ATTR_VALUE_DQ}var _$hyperx_11=function(h,opts){opts||(opts={});var concat=opts.concat||function(a,b){return String(a)+String(b)};return!1!==opts.attrToProp&&(h=_$hyperscriptAttributeToProperty_10(h)),function(strings){for(var state=TEXT,reg="",arglen=arguments.length,parts=[],i=0;i<strings.length;i++)if(i<arglen-1){var arg=arguments[i+1],p=parse(strings[i]),xstate=state;xstate===ATTR_VALUE_DQ&&(xstate=ATTR_VALUE),xstate===ATTR_VALUE_SQ&&(xstate=ATTR_VALUE),xstate===ATTR_VALUE_W&&(xstate=ATTR_VALUE),xstate===ATTR&&(xstate=ATTR_KEY),xstate===OPEN?"/"===reg?(p.push([OPEN,"/",arg]),reg=""):p.push([OPEN,arg]):p.push([0,xstate,arg]),parts.push.apply(parts,p)}else parts.push.apply(parts,parse(strings[i]));var tag,tree=[null,{},[]],stack=[[tree,-1]];for(i=0;i<parts.length;i++){var cur=stack[stack.length-1][0],s=(p=parts[i])[0];if(s===OPEN&&/^\//.test(p[1])){var ix=stack[stack.length-1][1];stack.length>1&&(stack.pop(),stack[stack.length-1][0][2][ix]=h(cur[0],cur[1],cur[2].length?cur[2]:void 0))}else if(s===OPEN){var c=[p[1],{},[]];cur[2].push(c),stack.push([c,cur[2].length-1])}else if(s===ATTR_KEY||0===s&&p[1]===ATTR_KEY){for(var copyKey,key="";i<parts.length;i++)if(parts[i][0]===ATTR_KEY)key=concat(key,parts[i][1]);else{if(0!==parts[i][0]||parts[i][1]!==ATTR_KEY)break;if("object"!=typeof parts[i][2]||key)key=concat(key,parts[i][2]);else for(copyKey in parts[i][2])parts[i][2].hasOwnProperty(copyKey)&&!cur[1][copyKey]&&(cur[1][copyKey]=parts[i][2][copyKey])}parts[i][0]===ATTR_EQ&&i++;for(var j=i;i<parts.length;i++)if(parts[i][0]===ATTR_VALUE||parts[i][0]===ATTR_KEY)cur[1][key]?""===parts[i][1]||(cur[1][key]=concat(cur[1][key],parts[i][1])):cur[1][key]=strfn(parts[i][1]);else{if(0!==parts[i][0]||parts[i][1]!==ATTR_VALUE&&parts[i][1]!==ATTR_KEY){!key.length||cur[1][key]||i!==j||parts[i][0]!==CLOSE&&parts[i][0]!==ATTR_BREAK||(cur[1][key]=key.toLowerCase()),parts[i][0]===CLOSE&&i--;break}cur[1][key]?""===parts[i][2]||(cur[1][key]=concat(cur[1][key],parts[i][2])):cur[1][key]=strfn(parts[i][2])}}else if(s===ATTR_KEY)cur[1][p[1]]=!0;else if(0===s&&p[1]===ATTR_KEY)cur[1][p[2]]=!0;else if(s===CLOSE){if(tag=cur[0],closeRE.test(tag)&&stack.length){ix=stack[stack.length-1][1];stack.pop(),stack[stack.length-1][0][2][ix]=h(cur[0],cur[1],cur[2].length?cur[2]:void 0)}}else if(0===s&&p[1]===TEXT)void 0===p[2]||null===p[2]?p[2]="":p[2]||(p[2]=concat("",p[2])),Array.isArray(p[2][0])?cur[2].push.apply(cur[2],p[2]):cur[2].push(p[2]);else if(s===TEXT)cur[2].push(p[1]);else if(s!==ATTR_EQ&&s!==ATTR_BREAK)throw new Error("unhandled: "+s)}if(tree[2].length>1&&/^\s*$/.test(tree[2][0])&&tree[2].shift(),tree[2].length>2||2===tree[2].length&&/\S/.test(tree[2][1]))throw new Error("multiple root elements must be wrapped in an enclosing tag");return Array.isArray(tree[2][0])&&"string"==typeof tree[2][0][0]&&Array.isArray(tree[2][0][2])&&(tree[2][0]=h(tree[2][0][0],tree[2][0][1],tree[2][0][2])),tree[2][0];function parse(str){var res=[];state===ATTR_VALUE_W&&(state=ATTR);for(var i=0;i<str.length;i++){var c=str.charAt(i);state===TEXT&&"<"===c?(reg.length&&res.push([TEXT,reg]),reg="",state=OPEN):">"!==c||quot(state)||state===COMMENT?state===COMMENT&&/-$/.test(reg)&&"-"===c?(opts.comments&&res.push([ATTR_VALUE,reg.substr(0,reg.length-1)],[CLOSE]),reg="",state=TEXT):state===OPEN&&/^!--$/.test(reg)?(opts.comments&&res.push([OPEN,reg],[ATTR_KEY,"comment"],[ATTR_EQ]),reg=c,state=COMMENT):state===TEXT||state===COMMENT?reg+=c:state===OPEN&&"/"===c&®.length||(state===OPEN&&/\s/.test(c)?(reg.length&&res.push([OPEN,reg]),reg="",state=ATTR):state===OPEN?reg+=c:state===ATTR&&/[^\s"'=/]/.test(c)?(state=ATTR_KEY,reg=c):state===ATTR&&/\s/.test(c)?(reg.length&&res.push([ATTR_KEY,reg]),res.push([ATTR_BREAK])):state===ATTR_KEY&&/\s/.test(c)?(res.push([ATTR_KEY,reg]),reg="",state=ATTR_KEY_W):state===ATTR_KEY&&"="===c?(res.push([ATTR_KEY,reg],[ATTR_EQ]),reg="",state=ATTR_VALUE_W):state===ATTR_KEY?reg+=c:state!==ATTR_KEY_W&&state!==ATTR||"="!==c?state!==ATTR_KEY_W&&state!==ATTR||/\s/.test(c)?state===ATTR_VALUE_W&&'"'===c?state=ATTR_VALUE_DQ:state===ATTR_VALUE_W&&"'"===c?state=ATTR_VALUE_SQ:state===ATTR_VALUE_DQ&&'"'===c?(res.push([ATTR_VALUE,reg],[ATTR_BREAK]),reg="",state=ATTR):state===ATTR_VALUE_SQ&&"'"===c?(res.push([ATTR_VALUE,reg],[ATTR_BREAK]),reg="",state=ATTR):state!==ATTR_VALUE_W||/\s/.test(c)?state===ATTR_VALUE&&/\s/.test(c)?(res.push([ATTR_VALUE,reg],[ATTR_BREAK]),reg="",state=ATTR):state!==ATTR_VALUE&&state!==ATTR_VALUE_SQ&&state!==ATTR_VALUE_DQ||(reg+=c):(state=ATTR_VALUE,i--):(res.push([ATTR_BREAK]),/[\w-]/.test(c)?(reg+=c,state=ATTR_KEY):state=ATTR):(res.push([ATTR_EQ]),state=ATTR_VALUE_W)):(state===OPEN&®.length?res.push([OPEN,reg]):state===ATTR_KEY?res.push([ATTR_KEY,reg]):state===ATTR_VALUE&®.length&&res.push([ATTR_VALUE,reg]),res.push([CLOSE]),reg="",state=TEXT)}return state===TEXT&®.length?(res.push([TEXT,reg]),reg=""):state===ATTR_VALUE&®.length?(res.push([ATTR_VALUE,reg]),reg=""):state===ATTR_VALUE_DQ&®.length?(res.push([ATTR_VALUE,reg]),reg=""):state===ATTR_VALUE_SQ&®.length?(res.push([ATTR_VALUE,reg]),reg=""):state===ATTR_KEY&&(res.push([ATTR_KEY,reg]),reg=""),res}};function strfn(x){return"function"==typeof x?x:"string"==typeof x?x:x&&"object"==typeof x?x:concat("",x)}};Object.prototype.hasOwnProperty;var closeRE=RegExp("^("+["area","base","basefont","bgsound","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr","!--","animate","animateTransform","circle","cursor","desc","ellipse","feBlend","feColorMatrix","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","font-face-format","font-face-name","font-face-uri","glyph","glyphRef","hkern","image","line","missing-glyph","mpath","path","polygon","polyline","rect","set","stop","tref","use","view","vkern"].join("|")+")(?:[.#][a-zA-Z0-9\x7f-\uffff_:-]+)*$"); |
| 40 | + |
| 41 | +var _$browser_3 = {}; |
| 42 | +var __dummy_3$0 = 0,__dummy_3$1 = 0,SVGNS="http://www.w3.org/2000/svg",XLINKNS="http://www.w3.org/1999/xlink",BOOL_PROPS=["autofocus","checked","defaultchecked","disabled","formnovalidate","indeterminate","readonly","required","selected","willvalidate"],COMMENT_TAG="!--",SVG_TAGS=["svg","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"];function belCreateElement(tag,props,children){var el;-1!==SVG_TAGS.indexOf(tag)&&(props.namespace=SVGNS);var ns=!1;if(props.namespace&&(ns=props.namespace,delete props.namespace),ns)el=document.createElementNS(ns,tag);else{if(tag===COMMENT_TAG)return document.createComment(props.comment);el=document.createElement(tag)}for(var p in props)if(props.hasOwnProperty(p)){var key=p.toLowerCase(),val=props[p];if("classname"===key&&(key="class",p="class"),"htmlFor"===p&&(p="for"),-1!==BOOL_PROPS.indexOf(key))if("true"===val)val=key;else if("false"===val)continue;"on"===key.slice(0,2)?el[p]=val:ns?"xlink:href"===p?el.setAttributeNS(XLINKNS,p,val):/^xmlns($|:)/i.test(p)||el.setAttributeNS(null,p,val):el.setAttribute(p,val)}return _$appendChild_2(el,children),el}_$browser_3=_$hyperx_11(belCreateElement,{comments:!0}),_$browser_3.default=_$browser_3,_$browser_3.createElement=belCreateElement; |
| 43 | + |
| 44 | +var _$html_7=_$browser_3; |
| 45 | + |
| 46 | +var _$nanolru_15 = {}; |
| 47 | +function LRU(opts){if(!(this instanceof LRU))return new LRU(opts);"number"==typeof opts&&(opts={max:opts}),opts||(opts={}),this.cache={},this.head=this.tail=null,this.length=0,this.max=opts.max||1e3,this.maxAge=opts.maxAge||0}_$nanolru_15=LRU,Object.defineProperty(LRU.prototype,"keys",{get:function(){return Object.keys(this.cache)}}),LRU.prototype.clear=function(){this.cache={},this.head=this.tail=null,this.length=0},LRU.prototype.remove=function(key){if("string"!=typeof key&&(key=""+key),this.cache.hasOwnProperty(key)){var element=this.cache[key];return delete this.cache[key],this._unlink(key,element.prev,element.next),element.value}},LRU.prototype._unlink=function(key,prev,next){this.length--,0===this.length?this.head=this.tail=null:this.head===key?(this.head=prev,this.cache[this.head].next=null):this.tail===key?(this.tail=next,this.cache[this.tail].prev=null):(this.cache[prev].next=next,this.cache[next].prev=prev)},LRU.prototype.peek=function(key){if(this.cache.hasOwnProperty(key)){var element=this.cache[key];if(this._checkAge(key,element))return element.value}},LRU.prototype.set=function(key,value){var element;if("string"!=typeof key&&(key=""+key),this.cache.hasOwnProperty(key)){if((element=this.cache[key]).value=value,this.maxAge&&(element.modified=Date.now()),key===this.head)return value;this._unlink(key,element.prev,element.next)}else element={value:value,modified:0,next:null,prev:null},this.maxAge&&(element.modified=Date.now()),this.cache[key]=element,this.length===this.max&&this.evict();return this.length++,element.next=null,element.prev=this.head,this.head&&(this.cache[this.head].next=key),this.head=key,this.tail||(this.tail=key),value},LRU.prototype._checkAge=function(key,element){return!(this.maxAge&&Date.now()-element.modified>this.maxAge)||(this.remove(key),!1)},LRU.prototype.get=function(key){if("string"!=typeof key&&(key=""+key),this.cache.hasOwnProperty(key)){var element=this.cache[key];if(this._checkAge(key,element))return this.head!==key&&(key===this.tail?(this.tail=element.next,this.cache[this.tail].prev=null):this.cache[element.prev].next=element.next,this.cache[element.next].prev=element.prev,this.cache[this.head].next=key,element.prev=this.head,element.next=null,this.head=key),element.value}},LRU.prototype.evict=function(){this.tail&&this.remove(this.tail)}; |
| 48 | + |
| 49 | +var _$cache_6 = {}; |
| 50 | +;function ChooComponentCache(state,emit,lru){this.cache="number"==typeof lru?new _$nanolru_15(lru):lru||new _$nanolru_15(100),this.state=state,this.emit=emit}function newCall(Cls){return new(Cls.bind.apply(Cls,arguments))}_$cache_6=ChooComponentCache,ChooComponentCache.prototype.render=function(Component,id){var el=this.cache.get(id);if(!el){for(var args=[],i=2,len=arguments.length;i<len;i++)args.push(arguments[i]);args.unshift(Component,id,this.state,this.emit),el=newCall.apply(newCall,args),this.cache.set(id,el)}return el}; |
| 51 | + |
| 52 | +"use strict";var _$documentReady_9=function(callback){var state=document.readyState;if("complete"===state||"interactive"===state)return setTimeout(callback,0);document.addEventListener("DOMContentLoaded",function(){callback()})}; |
| 53 | + |
| 54 | +var _$nanoscheduler_22 = {}; |
| 55 | +var hasWindow="undefined"!=typeof window;function NanoScheduler(hasWindow){this.hasWindow=hasWindow,this.hasIdle=this.hasWindow&&window.requestIdleCallback,this.method=this.hasIdle?window.requestIdleCallback.bind(window):this.setTimeout,this.scheduled=!1,this.queue=[]}NanoScheduler.prototype.push=function(cb){this.queue.push(cb),this.schedule()},NanoScheduler.prototype.schedule=function(){if(!this.scheduled){this.scheduled=!0;var self=this;this.method(function(idleDeadline){for(;self.queue.length&&idleDeadline.timeRemaining()>0;)self.queue.shift()(idleDeadline);self.scheduled=!1,self.queue.length&&self.schedule()})}},NanoScheduler.prototype.setTimeout=function(cb){setTimeout(cb,0,{timeRemaining:function(){return 1}})},_$nanoscheduler_22=function(){var scheduler;return hasWindow?(window._nanoScheduler||(window._nanoScheduler=new NanoScheduler(!0)),scheduler=window._nanoScheduler):scheduler=new NanoScheduler,scheduler}; |
| 56 | + |
| 57 | +var perf,scheduler=_$nanoscheduler_22();nanotiming.disabled=!0;try{perf=window.performance,nanotiming.disabled="true"===window.localStorage.DISABLE_NANOTIMING||!perf.mark}catch(e){}function nanotiming(name){if(nanotiming.disabled)return __noop_23;var uuid=(1e4*perf.now()).toFixed()%Number.MAX_SAFE_INTEGER,startName="start-"+uuid+"-"+name;function end(cb){var endName="end-"+uuid+"-"+name;perf.mark(endName),scheduler.push(function(){var err=null;try{var measureName=name+" ["+uuid+"]";perf.measure(measureName,startName,endName),perf.clearMarks(startName),perf.clearMarks(endName)}catch(e){err=e}cb&&cb(err,name)})}return perf.mark(startName),end.uuid=uuid,end}function __noop_23(cb){cb&&scheduler.push(function(){cb(new Error("nanotiming: performance API unavailable"))})}var _$nanotiming_23=nanotiming; |
| 58 | + |
| 59 | +"use strict";var _$removeArrayItems_29=function(arr,startIdx,removeCount){var i,length=arr.length;if(!(startIdx>=length||0===removeCount)){var len=length-(removeCount=startIdx+removeCount>length?length-startIdx:removeCount);for(i=startIdx;i<len;++i)arr[i]=arr[i+removeCount];arr.length=len}}; |
| 60 | + |
| 61 | +var _$nanobus_12 = {}; |
| 62 | +var __dummy_12$0 = 0,__dummy_12$1 = 0;function Nanobus(name){if(!(this instanceof Nanobus))return new Nanobus(name);this._name=name||"nanobus",this._starListeners=[],this._listeners={}}_$nanobus_12=Nanobus,Nanobus.prototype.emit=function(eventName){for(var data=[],i=1,len=arguments.length;i<len;i++)data.push(arguments[i]);var emitTiming=_$nanotiming_23(this._name+"('"+eventName+"')"),listeners=this._listeners[eventName];return listeners&&listeners.length>0&&this._emit(this._listeners[eventName],data),this._starListeners.length>0&&this._emit(this._starListeners,eventName,data,emitTiming.uuid),emitTiming(),this},Nanobus.prototype.on=Nanobus.prototype.addListener=function(eventName,listener){return"*"===eventName?this._starListeners.push(listener):(this._listeners[eventName]||(this._listeners[eventName]=[]),this._listeners[eventName].push(listener)),this},Nanobus.prototype.prependListener=function(eventName,listener){return"*"===eventName?this._starListeners.unshift(listener):(this._listeners[eventName]||(this._listeners[eventName]=[]),this._listeners[eventName].unshift(listener)),this},Nanobus.prototype.once=function(eventName,listener){var self=this;return this.on(eventName,function once(){listener.apply(self,arguments);self.removeListener(eventName,once)}),this},Nanobus.prototype.prependOnceListener=function(eventName,listener){var self=this;return this.prependListener(eventName,function once(){listener.apply(self,arguments);self.removeListener(eventName,once)}),this},Nanobus.prototype.removeListener=function(eventName,listener){return"*"===eventName?(this._starListeners=this._starListeners.slice(),remove(this._starListeners,listener)):(void 0!==this._listeners[eventName]&&(this._listeners[eventName]=this._listeners[eventName].slice()),remove(this._listeners[eventName],listener));function remove(arr,listener){if(arr){var index=arr.indexOf(listener);return-1!==index?(_$removeArrayItems_29(arr,index,1),!0):void 0}}},Nanobus.prototype.removeAllListeners=function(eventName){return eventName?"*"===eventName?this._starListeners=[]:this._listeners[eventName]=[]:(this._starListeners=[],this._listeners={}),this},Nanobus.prototype.listeners=function(eventName){var listeners="*"!==eventName?this._listeners[eventName]:this._starListeners,ret=[];if(listeners)for(var ilength=listeners.length,i=0;i<ilength;i++)ret.push(listeners[i]);return ret},Nanobus.prototype._emit=function(arr,eventName,data,uuid){if(void 0!==arr&&0!==arr.length){void 0===data&&(data=eventName,eventName=null),eventName&&(data=void 0!==uuid?[eventName].concat(data,uuid):[eventName].concat(data));for(var length=arr.length,i=0;i<length;i++){var listener=arr[i];listener.apply(listener,data)}}}; |
| 63 | + |
| 64 | +var safeExternalLink=/(noopener|noreferrer) (noopener|noreferrer)/,protocolLink=/^[\w-_]+:/;var _$nanohref_13=function(cb,root){root=root||window.document,window.addEventListener("click",function(e){if(!(e.button&&0!==e.button||e.ctrlKey||e.metaKey||e.altKey||e.shiftKey||e.defaultPrevented)){var anchor=function traverse(node){if(node&&node!==root)return"a"!==node.localName||void 0===node.href?traverse(node.parentNode):node}(e.target);anchor&&(window.location.origin!==anchor.origin||anchor.hasAttribute("download")||"_blank"===anchor.getAttribute("target")&&safeExternalLink.test(anchor.getAttribute("rel"))||protocolLink.test(anchor.getAttribute("href"))||(e.preventDefault(),cb(anchor)))}})}; |
| 65 | + |
| 66 | +var _$nanolocation_14=function(){var pathname=window.location.pathname.replace(/\/$/,""),hash=window.location.hash.replace(/^#/,"/");return pathname+hash}; |
| 67 | + |
| 68 | +var _$events_17=["onclick","ondblclick","onmousedown","onmouseup","onmouseover","onmousemove","onmouseout","onmouseenter","onmouseleave","ontouchcancel","ontouchend","ontouchmove","ontouchstart","ondragstart","ondrag","ondragenter","ondragleave","ondragover","ondrop","ondragend","onkeydown","onkeypress","onkeyup","onunload","onabort","onerror","onresize","onscroll","onselect","onchange","onsubmit","onreset","onfocus","onblur","oninput","oncontextmenu","onfocusin","onfocusout"]; |
| 69 | + |
| 70 | +var __dummy_18$0 = 0,eventsLength=_$events_17.length,ELEMENT_NODE=1,TEXT_NODE=3,COMMENT_NODE=8;function updateAttribute(newNode,oldNode,name){newNode[name]!==oldNode[name]&&(oldNode[name]=newNode[name],newNode[name]?oldNode.setAttribute(name,""):oldNode.removeAttribute(name))}var _$morph_18=function(newNode,oldNode){var nodeType=newNode.nodeType,nodeName=newNode.nodeName;nodeType===ELEMENT_NODE&&function(newNode,oldNode){for(var oldAttrs=oldNode.attributes,newAttrs=newNode.attributes,attrNamespaceURI=null,attrValue=null,attrName=null,attr=null,i=newAttrs.length-1;i>=0;--i)attr=newAttrs[i],attrName=attr.name,attrNamespaceURI=attr.namespaceURI,attrValue=attr.value,attrNamespaceURI?(attrName=attr.localName||attrName,oldNode.getAttributeNS(attrNamespaceURI,attrName)!==attrValue&&oldNode.setAttributeNS(attrNamespaceURI,attrName,attrValue)):oldNode.hasAttribute(attrName)?oldNode.getAttribute(attrName)!==attrValue&&("null"===attrValue||"undefined"===attrValue?oldNode.removeAttribute(attrName):oldNode.setAttribute(attrName,attrValue)):oldNode.setAttribute(attrName,attrValue);for(var j=oldAttrs.length-1;j>=0;--j)!1!==(attr=oldAttrs[j]).specified&&(attrName=attr.name,(attrNamespaceURI=attr.namespaceURI)?(attrName=attr.localName||attrName,newNode.hasAttributeNS(attrNamespaceURI,attrName)||oldNode.removeAttributeNS(attrNamespaceURI,attrName)):newNode.hasAttributeNS(null,attrName)||oldNode.removeAttribute(attrName))}(newNode,oldNode);nodeType!==TEXT_NODE&&nodeType!==COMMENT_NODE||oldNode.nodeValue!==newNode.nodeValue&&(oldNode.nodeValue=newNode.nodeValue);"INPUT"===nodeName?function(newNode,oldNode){var newValue=newNode.value,oldValue=oldNode.value;updateAttribute(newNode,oldNode,"checked"),updateAttribute(newNode,oldNode,"disabled"),newValue!==oldValue&&(oldNode.setAttribute("value",newValue),oldNode.value=newValue);"null"===newValue&&(oldNode.value="",oldNode.removeAttribute("value"));newNode.hasAttributeNS(null,"value")?"range"===oldNode.type&&(oldNode.value=newValue):oldNode.removeAttribute("value")}(newNode,oldNode):"OPTION"===nodeName?function(newNode,oldNode){updateAttribute(newNode,oldNode,"selected")}(newNode,oldNode):"TEXTAREA"===nodeName&&function(newNode,oldNode){var newValue=newNode.value;newValue!==oldNode.value&&(oldNode.value=newValue);if(oldNode.firstChild&&oldNode.firstChild.nodeValue!==newValue){if(""===newValue&&oldNode.firstChild.nodeValue===oldNode.placeholder)return;oldNode.firstChild.nodeValue=newValue}}(newNode,oldNode);!function(newNode,oldNode){for(var i=0;i<eventsLength;i++){var ev=_$events_17[i];newNode[ev]?oldNode[ev]=newNode[ev]:oldNode[ev]&&(oldNode[ev]=void 0)}}(newNode,oldNode)}; |
| 71 | + |
| 72 | +var __dummy_16$0 = 0,__TEXT_NODE_16=3;function walk(newNode,oldNode){return oldNode?newNode?newNode.isSameNode&&newNode.isSameNode(oldNode)?oldNode:newNode.tagName!==oldNode.tagName?newNode:(_$morph_18(newNode,oldNode),function(newNode,oldNode){for(var oldChild,newChild,morphed,oldMatch,offset=0,i=0;oldChild=oldNode.childNodes[i],newChild=newNode.childNodes[i-offset],oldChild||newChild;i++)if(newChild)if(oldChild)if(same(newChild,oldChild))(morphed=walk(newChild,oldChild))!==oldChild&&(oldNode.replaceChild(morphed,oldChild),offset++);else{oldMatch=null;for(var j=i;j<oldNode.childNodes.length;j++)if(same(oldNode.childNodes[j],newChild)){oldMatch=oldNode.childNodes[j];break}oldMatch?((morphed=walk(newChild,oldMatch))!==oldMatch&&offset++,oldNode.insertBefore(morphed,oldChild)):newChild.id||oldChild.id?(oldNode.insertBefore(newChild,oldChild),offset++):(morphed=walk(newChild,oldChild))!==oldChild&&(oldNode.replaceChild(morphed,oldChild),offset++)}else oldNode.appendChild(newChild),offset++;else oldNode.removeChild(oldChild),i--}(newNode,oldNode),oldNode):null:newNode}function same(a,b){return a.id?a.id===b.id:a.isSameNode?a.isSameNode(b):a.tagName===b.tagName&&(a.type===__TEXT_NODE_16&&a.nodeValue===b.nodeValue)}var _$nanomorph_16=function(oldTree,newTree){return walk(newTree,oldTree)}; |
| 73 | + |
| 74 | +var reg=/([^?=&]+)(=([^&]*))?/g;var _$browser_19=function(url){var obj={};return url.replace(/^.*\?/,"").replace(reg,function(a0,a1,a2,a3){obj[decodeURIComponent(a1)]=decodeURIComponent(a3)}),obj}; |
| 75 | + |
| 76 | +"use strict";var _$nanoraf_20=function(render,raf){raf||(raf=window.requestAnimationFrame);var redrawScheduled=!1,args=null;return function(){null!==args||redrawScheduled||(redrawScheduled=!0,raf(function(){redrawScheduled=!1;for(var length=args.length,_args=new Array(length),i=0;i<length;i++)_args[i]=args[i];render.apply(render,_args),args=null})),args=arguments}}; |
| 77 | + |
| 78 | +var _$immutable_35=function(){for(var target={},i=0;i<arguments.length;i++){var source=arguments[i];for(var key in source)__hasOwnProperty_35.call(source,key)&&(target[key]=source[key])}return target};var __hasOwnProperty_35=Object.prototype.hasOwnProperty; |
| 79 | + |
| 80 | +var _$trie_34 = {}; |
| 81 | +var __dummy_34$0 = 0,__dummy_34$1 = 0;function Trie(){if(!(this instanceof Trie))return new Trie;this.trie={nodes:{}}}_$trie_34=Trie,Trie.prototype.create=function(route){var routes=route.replace(/^\//,"").split("/");return function createNode(index,trie){var thisRoute=routes.hasOwnProperty(index)&&routes[index];if(!1===thisRoute)return trie;var node=null;return/^:|^\*/.test(thisRoute)?(trie.nodes.hasOwnProperty("$$")?node=trie.nodes.$$:(node={nodes:{}},trie.nodes.$$=node),"*"===thisRoute[0]&&(trie.wildcard=!0),trie.name=thisRoute.replace(/^:|^\*/,"")):trie.nodes.hasOwnProperty(thisRoute)?node=trie.nodes[thisRoute]:(node={nodes:{}},trie.nodes[thisRoute]=node),createNode(index+1,node)}(0,this.trie)},Trie.prototype.match=function(route){var routes=route.replace(/^\//,"").split("/"),params={};var node=function search(index,trie){if(void 0!==trie){var thisRoute=routes[index];if(void 0===thisRoute)return trie;if(trie.nodes.hasOwnProperty(thisRoute))return search(index+1,trie.nodes[thisRoute]);if(trie.name){try{params[trie.name]=decodeURIComponent(thisRoute)}catch(e){return search(index,void 0)}return search(index+1,trie.nodes.$$)}if(trie.wildcard){try{params.wildcard=decodeURIComponent(routes.slice(index).join("/"))}catch(e){return search(index,void 0)}return trie.nodes.$$}return search(index+1)}}(0,this.trie);if(node)return(node=_$immutable_35(node)).params=params,node},Trie.prototype.mount=function(route,trie){var split=route.replace(/^\//,"").split("/"),node=null,key=null;if(1===split.length)key=split[0],node=this.create(key);else{var head=split.join("/");key=split[0],node=this.create(head)}_$mutable_36(node.nodes,trie.nodes),trie.name&&(node.name=trie.name),node.nodes[""]&&(Object.keys(node.nodes[""]).forEach(function(key){"nodes"!==key&&(node[key]=node.nodes[""][key])}),_$mutable_36(node.nodes,node.nodes[""].nodes),delete node.nodes[""].nodes)}; |
| 82 | + |
| 83 | +;var _$Wayfarer_33=function Wayfarer(dft){if(!(this instanceof Wayfarer))return new Wayfarer(dft);var _default=(dft||"").replace(/^\//,"");var _trie=_$trie_34();emit._trie=_trie;emit.on=function(route,cb){if(route=route||"/",cb.route=route,cb&&cb._wayfarer&&cb._trie)_trie.mount(route,cb._trie.trie);else{var node=_trie.create(route);node.cb=cb}return emit};emit.emit=emit;emit.match=match;emit._wayfarer=!0;return emit;function emit(route){var matched=match(route),args=new Array(arguments.length);args[0]=matched.params;for(var i=1;i<args.length;i++)args[i]=arguments[i];return matched.cb.apply(matched.cb,args)}function match(route){var matched=_trie.match(route);if(matched&&matched.cb)return new Route(matched);var dft=_trie.match(_default);if(dft&&dft.cb)return new Route(dft);throw new Error("route '"+route+"' did not match")}function Route(matched){this.cb=matched.cb,this.route=matched.cb.route,this.params=matched.params}}; |
| 84 | + |
| 85 | +var _$nanorouter_21 = {}; |
| 86 | +var __dummy_21$0 = 0,isLocalFile=/file:\/\//.test("object"==typeof window&&window.location&&window.location.origin),stripElectron=new RegExp("^(file://|/)(.*.html?/?)?"),prefix=new RegExp("^(http(s)?(://))?(www.)?[a-zA-Z0-9-_.]+(:[0-9]{1,5})?(/{1})?"),normalize=new RegExp("#"),suffix=new RegExp("[?].*$");function Nanorouter(opts){if(!(this instanceof Nanorouter))return new Nanorouter(opts);opts=opts||{},this.router=_$Wayfarer_33(opts.default||"/404")}function pathname(routename,isElectron){return routename=isElectron?routename.replace(stripElectron,""):routename.replace(prefix,""),decodeURI(routename.replace(suffix,"").replace(normalize,"/"))}_$nanorouter_21=Nanorouter,Nanorouter.prototype.on=function(routename,listener){routename=routename.replace(/^[#/]/,""),this.router.on(routename,listener)},Nanorouter.prototype.emit=function(routename){return routename=pathname(routename,isLocalFile),this.router.emit(routename)},Nanorouter.prototype.match=function(routename){return routename=pathname(routename,isLocalFile),this.router.match(routename)}; |
| 87 | + |
| 88 | +var _$scrollToAnchor_30=function(anchor,options){if(anchor)try{var el=document.querySelector(anchor);el&&el.scrollIntoView(options)}catch(e){}}; |
| 89 | + |
| 90 | +var __dummy_8$0 = 0,__dummy_8$1 = 0,__dummy_8$2 = 0,__dummy_8$3 = 0,__dummy_8$4 = 0,__dummy_8$5 = 0,__dummy_8$6 = 0,__dummy_8$7 = 0,__dummy_8$8 = 0,__dummy_8$9 = 0,__dummy_8$10 = 0,__dummy_8$11 = 0;var _$Choo_8=Choo;var HISTORY_OBJECT={};function Choo(opts){if(!(this instanceof Choo))return new Choo(opts);opts=opts||{};var self=this;this._events={DOMCONTENTLOADED:"DOMContentLoaded",DOMTITLECHANGE:"DOMTitleChange",REPLACESTATE:"replaceState",PUSHSTATE:"pushState",NAVIGATE:"navigate",POPSTATE:"popState",RENDER:"render"},this._historyEnabled=void 0===opts.history||opts.history,this._hrefEnabled=void 0===opts.href||opts.href,this._hasWindow="undefined"!=typeof window,this._createLocation=_$nanolocation_14,this._cache=opts.cache,this._loaded=!1,this._stores=[],this._tree=null;var _state={events:this._events,components:{}};this._hasWindow?(this.state=window.initialState?_$immutable_35(window.initialState,_state):_state,delete window.initialState):this.state=_state,this.router=_$nanorouter_21({curry:!0}),this.emitter=_$nanobus_12("choo.emit"),this.emit=this.emitter.emit.bind(this.emitter),this._hasWindow&&(this.state.title=document.title),this.emitter.prependListener(this._events.DOMTITLECHANGE,function(title){self.state.title=title,self._hasWindow&&(document.title=title)})}Choo.prototype.route=function(route,handler){this.router.on(route,handler)},Choo.prototype.use=function(cb){var self=this;this._stores.push(function(state){var msg="choo.use";msg=cb.storeName?msg+"("+cb.storeName+")":msg;var endTiming=_$nanotiming_23(msg);cb(state,self.emitter,self),endTiming()})},Choo.prototype.start=function(){var self=this;return this._historyEnabled&&(this.emitter.prependListener(this._events.NAVIGATE,function(){self._matchRoute(),self._loaded&&(self.emitter.emit(self._events.RENDER),setTimeout(_$scrollToAnchor_30.bind(null,window.location.hash),0))}),this.emitter.prependListener(this._events.POPSTATE,function(){self.emitter.emit(self._events.NAVIGATE)}),this.emitter.prependListener(this._events.PUSHSTATE,function(href){window.history.pushState(HISTORY_OBJECT,null,href),self.emitter.emit(self._events.NAVIGATE)}),this.emitter.prependListener(this._events.REPLACESTATE,function(href){window.history.replaceState(HISTORY_OBJECT,null,href),self.emitter.emit(self._events.NAVIGATE)}),window.onpopstate=function(){self.emitter.emit(self._events.POPSTATE)},self._hrefEnabled&&_$nanohref_13(function(location){var href=location.href;href!==window.location.href&&self.emitter.emit(self._events.PUSHSTATE,href)})),this._setCache(this.state),this._stores.forEach(function(initStore){initStore(self.state)}),this._matchRoute(),this._tree=this._prerender(this.state),this.emitter.prependListener(self._events.RENDER,_$nanoraf_20(function(){var renderTiming=_$nanotiming_23("choo.render"),newTree=self._prerender(self.state),morphTiming=_$nanotiming_23("choo.morph");_$nanomorph_16(self._tree,newTree),morphTiming(),renderTiming()})),_$documentReady_9(function(){self.emitter.emit(self._events.DOMCONTENTLOADED),self._loaded=!0}),this._tree},Choo.prototype.mount=function(selector){if("object"!=typeof window)return this.selector=selector,this;var self=this;_$documentReady_9(function(){var renderTiming=_$nanotiming_23("choo.render"),newTree=self.start();self._tree="string"==typeof selector?document.querySelector(selector):selector;var morphTiming=_$nanotiming_23("choo.morph");_$nanomorph_16(self._tree,newTree),morphTiming(),renderTiming()})},Choo.prototype.toString=function(location,state){this.state=_$immutable_35(this.state,state||{});var self=this;this._setCache(this.state),this._stores.forEach(function(initStore){initStore(self.state)}),this._matchRoute(location);var html=this._prerender(this.state);return"string"==typeof html.outerHTML?html.outerHTML:html.toString()},Choo.prototype._matchRoute=function(locationOverride){var location,queryString;locationOverride?(location=locationOverride.replace(/\?.+$/,""),queryString=locationOverride):(location=this._createLocation(),queryString=window.location.search);var matched=this.router.match(location);return this._handler=matched.cb,this.state.href=location,this.state.query=_$browser_19(queryString),this.state.route=matched.route,this.state.params=matched.params,this.state},Choo.prototype._prerender=function(state){var routeTiming=_$nanotiming_23("choo.prerender('"+state.route+"')"),res=this._handler(state,this.emit);return routeTiming(),res},Choo.prototype._setCache=function(state){var cache=new _$cache_6(state,this.emitter.emit.bind(this.emitter),this._cache);function renderComponent(Component,id){for(var args=[],i=0,len=arguments.length;i<len;i++)args.push(arguments[i]);return cache.render.apply(cache,args)}state.cache=renderComponent,renderComponent.toJSON=function(){return null}}; |
| 91 | + |
| 92 | +var _$songs_37={"songs": [ |
| 93 | + {title: 'background', |
| 94 | + link: 'background', |
| 95 | + post:['here is what i want to say']}, |
| 96 | + {title: 'the future', |
| 97 | + link: 'the-future', |
| 98 | + post: ['here is another thing.']}, |
| 99 | + {title: 'a third thing', |
| 100 | + link: 'a-third-thing', |
| 101 | + post: ['a third thing tooo.']}, |
| 102 | + {title: 'the playlist as offering', |
| 103 | + post: [ |
| 104 | + 'You seek out songs and bands to explore your own history and place. The details of a narrative you feel called to own.', |
| 105 | + 'When your first uinteraction with an emition, a tremble, a hue of a color you could name but not see. You are introduced to your personal version of these things when you hear certain songs. These songs are like droplets of amber, containing a reflection of the place you heard it, the time you heard it. They contain a reflection of you.', |
| 106 | + 'During these moments, the gift ofa mixtape is a literal offering of yourself. the mixtape is a form of oral storytelling, like the folktales of old that act as song, lesson, and map all at once.', |
| 107 | + 'The myths that contain maps, the myths whose style and rhythm of telling are important for within that is held a map.' |
| 108 | + ]} |
| 109 | +] } |
| 110 | + |
| 111 | + |
| 112 | + |
| 113 | +var _$songs_38=function(state,emitter){;state.songs=_$songs_37.songs,state.currentSong="",emitter.on("changeSong",function(song){song=song.replace(/\s+/g,"-").toLowerCase(),document.getElementById("tracklist").classList.toggle("fade-out"),emitter.emit("pushState","/#songbook/"+song),document.getElementById("text").classList.toggle("fade-in")})}; |
| 114 | + |
| 115 | +;var _$main_39=(()=>_$html_7` |
2 | 116 | <div class='paper'> |
3 | 117 | <h1>music</h1> |
4 | 118 | <h1>visions</h1> |
5 | 119 | <a href='#songbook'>~enter~</a> |
6 | 120 | </div> |
7 | | - `,ft=at();ft.use(V()),ft.use(function(e,t){e.songs=ct,e.currentSong="",t.on("changeSong",function(e){e=e.replace(/\s+/g,"-").toLowerCase(),t.emit("pushState","/#songbook/"+e)})}),ft.route("/",lt),ft.route("#songbook",function(e,t){return""==e.currentSong?function(e,t){return be` |
| 121 | + `); |
| 122 | + |
| 123 | +;var _$song_40=function(state,emit){var song=state.songs.find(song=>song.title==state.params.song.replace(/-/g," "));return console.log({song:song}),_$html_7` |
| 124 | + <div class='wrapper'> |
| 125 | + <div class='paper'> |
| 126 | + <h1>${song.title}</h1> |
| 127 | + <div id='text'> |
| 128 | + ${song.post.map(function(post){return _$html_7`<p>${post}</p>`})} |
| 129 | + </div> |
| 130 | + <a href='#songbook'>x close x</a> |
| 131 | + </div> |
| 132 | + </div> |
| 133 | + `}; |
| 134 | + |
| 135 | +_$Choo_8;;var _$songbook_41=function(state,emit){return function(state,emit){return _$html_7` |
8 | 136 | <div class='wrapper'> |
9 | 137 | <div class='paper'> |
10 | | - <div class='text'> |
| 138 | + <h1>M U S I C V I S I O N S </h1> |
| 139 | + <div id='tracklist'> |
11 | 140 | <ul> |
12 | | - ${e.songs.map(n)} |
| 141 | + ${state.songs.map(listTracks)} |
13 | 142 | </ul> |
14 | | - <div class='fadingAnimation'></div> |
15 | 143 | </div> |
| 144 | + <h1>Last Track: something</h1> |
16 | 145 | </div> |
17 | 146 | </div> |
18 | | - `}(e):r(e);function n(e){return be`<li onclick=${i}>${e.title}</li>`}function r(e,t){var n=e.songs.find(t=>t.title==e.currentSong);return console.log(n),be` |
19 | | - <div class='wrapper'> |
20 | | - <div class='paper'> |
21 | | - <h1>${n.title}</h1> |
22 | | - <p>${n.post}></p> |
23 | | - <p onclick=${function(e){console.log(e)}}>x close x</a> |
24 | | - </div> |
25 | | - </div> |
26 | | - `}function i(e){console.log(e.target.innerHTML),r=e.target.innerHTML,t("changeSong",r)}}),ft.route("#songbook/:song",function(e,t){return song=e.songs.find(t=>t.title==e.params.song.replace(/-/g," ")),console.log({song:song}),be` |
27 | | - <div class='wrapper'> |
28 | | - <div class='paper'> |
29 | | - <div class='text'> |
30 | | - <h1>${song.title}</h1> |
31 | | - <p>${song.post}</p> |
32 | | - <a href='#songbook'>x close x</a> |
33 | | - </div> |
34 | | - </div> |
35 | | - </div> |
36 | | - `}),ft.mount("div")}(); |
| 147 | + `}(state);function listTracks(song){return _$html_7`<li onclick=${change}>${song.title}</li>`}function change(data){console.log(data.target.innerHTML),song=data.target.innerHTML,emit("changeSong",song)}}; |
| 148 | + |
| 149 | +var _$musicVisions_1 = {}; |
| 150 | +const __dummy_1$0 = 0,main=(_$html_7,_$main_39),__dummy_1$1 = 0,__dummy_1$2 = 0,app=_$Choo_8();app.use(_$serviceWorker_5()),app.use(_$songs_38),app.route("/",main),app.route("#songbook",_$songbook_41),app.route("#songbook/:song",_$song_40),app.mount("div"); |
| 151 | + |
| 152 | +}()); |