diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..231a94b --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2016 Evan You + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/README.md b/README.md index 0ba5d12..c7343c9 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,15 @@ +> **NOTE**: this demo is using Vue.js 1.x - the 2.0 version is [here](https://github.com/vuejs/vue-hackernews-2.0). + # Vue.js HackerNews clone -[Live demo](http://yyx990803.github.io/vue-hackernews/) +[Live demo](http://vuejs.github.io/vue-hackernews/) -Built with [Vue.js](http://vuejs.org) and the official [HackerNews API](https://github.com/HackerNews/API), with routing, comments, comment folding, user profile & realtime updates. +Built with [Vue.js](http://vuejs.org), [vue-router](https://github.com/vuejs/vue-router) and the official [HackerNews API](https://github.com/HackerNews/API), with routing, comments, comment folding, user profile & realtime updates. -The build setup uses Webpack and the [Vue Loader](https://github.com/vuejs/vue-loader) plugin, which enables Vue components to be written in a format that encapsulates a component's style, template and logic in a single file. +The build setup uses [Webpack](http://webpack.github.io/) and the [vue-loader](https://github.com/vuejs/vue-loader) plugin, which enables Vue components to be written in a format that encapsulates a component's style, template and logic in a single file. If you are using SublimeText you can get proper syntax highlighting for `*.vue` files with [vue-syntax-highlight](https://github.com/vuejs/vue-syntax-highlight). -There's also a version of this app built with Browserify + [Vueify](https://github.com/vuejs/vueify) in the [browserify branch](https://github.com/yyx990803/vue-hackernews/tree/browserify). - ### Building ``` bash @@ -19,3 +19,7 @@ npm run dev # build: npm run build ``` + +### License + +[MIT](http://opensource.org/licenses/MIT) diff --git a/build/build.js b/build/build.js deleted file mode 100644 index b740ec7..0000000 --- a/build/build.js +++ /dev/null @@ -1,14 +0,0 @@ -!function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={exports:{},id:i,loaded:!1};return t[i].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){var i=n(2),r=n(3).Router,o=new i(n(1)),a=new r;a.on("/news/:page",function(t){window.scrollTo(0,0),o.view="news-view",o.params.page=+t}),a.on("/user/:id",function(t){window.scrollTo(0,0),o.view="user-view",o.params.userId=t}),a.on("/item/:id",function(t){window.scrollTo(0,0),o.view="item-view",o.params.itemId=t}),a.configure({notfound:function(){a.setRoute("/news/1")}}),a.init("/news/1")},function(t,e,n){n(22)("body,html{font-family:Verdana;font-size:13px;margin:0;height:100%;background-color:#f6f6ef}ul{list-style-type:none;padding:0;margin:0}a{color:#000;cursor:pointer;text-decoration:none}#header{background-color:#f60;height:24px;position:relative}#header h1{font-weight:700;font-size:13px;display:inline-block;vertical-align:middle;margin:0}#header .source{color:#fff;font-size:11px;position:absolute;top:4px;right:4px}#header .source a{color:#fff}#header .source a:hover{text-decoration:underline}#yc{border:1px solid #fff;margin:2px;display:inline-block;vertical-align:middle}#yc img{vertical-align:middle}.view{position:absolute;width:100%;transition:opacity .1s ease;box-sizing:border-box;padding:8px 20px}.view.v-enter,.view.v-leave{opacity:0}");var i='\n \n \n
';t.exports={el:"#app",data:{view:"",params:{page:1,userId:null,itemId:null}},filters:{fromNow:n(4),domain:n(5)},components:{"news-view":n(6),"item-view":n(7),"user-view":n(8)}},("function"==typeof t.exports?t.exports.options:t.exports).template=i},function(t,e,n){function i(t){this._init(t)}var r=n(19),o=r.extend;o(i,n(9)),i.options={directives:n(20),filters:n(21),partials:{},transitions:{},components:{}};var a=i.prototype;Object.defineProperty(a,"$data",{get:function(){return this._data},set:function(t){this._setData(t)}}),o(a,n(10)),o(a,n(11)),o(a,n(12)),o(a,n(13)),o(a,n(14)),o(a,n(15)),o(a,n(16)),o(a,n(17)),o(a,n(18)),t.exports=r.Vue=i},function(t,e,n){!function(t){function e(){return""===u.hash||"#"===u.hash}function n(t,e){for(var n=0;nn;n++)e=e.concat(t[n]);return e}function r(t,e,n){if(!t.length)return n();var i=0;!function r(){e(t[i],function(e){e||e===!1?(n(e),n=function(){}):(i+=1,i===t.length?n():r())})}()}function o(t,e,n){n=t;for(var i in e)if(e.hasOwnProperty(i)&&(n=e[i](t),n!==t))break;return n===t?"([._a-zA-Z0-9-%()]+)":n}function a(t,e){for(var n,i=0,r="";n=t.substr(i).match(/[^\w\d\- %@&]*\*[^\w\d\- %@&]*/);)i=n.index+n[0].length,n[0]=n[0].replace(/^\*/,"([_.()!\\ %@&a-zA-Z0-9-]+)"),r+=t.substr(0,n.index)+n[0];t=r+=t.substr(i);var a,s,h=t.match(/:([^\/]+)/gi);if(h){s=h.length;for(var u=0;s>u;u++)a=h[u],t="::"===a.slice(0,2)?a.slice(1):t.replace(a,o(a,e))}return t}function h(t,e,n,i){var r,o=0,a=0,s=0,n=(n||"(").toString(),i=(i||")").toString();for(r=0;rh.indexOf(i,o)||~h.indexOf(n,o)&&!~h.indexOf(i,o)||!~h.indexOf(n,o)&&~h.indexOf(i,o)){if(a=h.indexOf(n,o),s=h.indexOf(i,o),~a&&!~s||!~a&&~s){var u=t.slice(0,(r||1)+1).join(e);t=[u].concat(t.slice((r||1)+1))}o=(s>a?s:a)+1,r=0}else o=0}return t}var u=document.location,c={mode:"modern",hash:u.hash,history:!1,check:function(){var t=u.hash;t!=this.hash&&(this.hash=t,this.onHashChanged())},fire:function(){"modern"===this.mode?this.history===!0?window.onpopstate():window.onhashchange():this.onHashChanged()},init:function(t,e){function n(t){for(var e=0,n=l.listeners.length;n>e;e++)l.listeners[e](t)}var i=this;if(this.history=e,l.listeners||(l.listeners=[]),"onhashchange"in window&&(void 0===document.documentMode||document.documentMode>7))this.history===!0?setTimeout(function(){window.onpopstate=n},500):window.onhashchange=n,this.mode="modern";else{var r=document.createElement("iframe");r.id="state-frame",r.style.display="none",document.body.appendChild(r),this.writeFrame(""),"onpropertychange"in document&&"attachEvent"in document&&document.attachEvent("onpropertychange",function(){"location"===event.propertyName&&i.check()}),window.setInterval(function(){i.check()},50),this.onHashChanged=n,this.mode="legacy"}return l.listeners.push(t),this.mode},destroy:function(t){if(l&&l.listeners)for(var e=l.listeners,n=e.length-1;n>=0;n--)e[n]===t&&e.splice(n,1)},setHash:function(t){return"legacy"===this.mode&&this.writeFrame(t),this.history===!0?(window.history.pushState({},document.title,t),this.fire()):u.hash="/"===t[0]?t:"/"+t,this},writeFrame:function(t){var e=document.getElementById("state-frame"),n=e.contentDocument||e.contentWindow.document;n.open(),n.write("'),t=""+t+"";try{this.Ca.gb.open(),this.Ca.gb.write(t),this.Ca.gb.close()}catch(o){Bb("frame writing exception"),o.stack&&Bb(o.stack),Bb(o)}}function $g(t){if(t.ke&&t.Td&&t.Oe.count()<(0=t.$c[0].jf.length+30+n.length;){var r=t.$c.shift(),n=n+"&seg"+i+"="+r.Jg+"&ts"+i+"="+r.Rg+"&d"+i+"="+r.jf;i++}return ah(t,e+n,t.se),!0}return!1}function ah(t,e,n){function i(){t.Oe.remove(n),$g(t)}t.Oe.add(n,1);var r=setTimeout(i,Math.floor(25e3));Zg(t,e,function(){clearTimeout(r),i()})}function Zg(t,e,n){setTimeout(function(){try{if(t.Td){var i=t.Ca.gb.createElement("script");i.type="text/javascript",i.async=!0,i.src=e,i.onload=i.onreadystatechange=function(){var t=i.readyState;t&&"loaded"!==t&&"complete"!==t||(i.onload=i.onreadystatechange=null,i.parentNode&&i.parentNode.removeChild(i),n())},i.onerror=function(){Bb("Long-poll script failed to load: "+e),t.Td=!1,t.close()},t.Ca.gb.body.appendChild(i)}}catch(r){}},Math.floor(1))}function ch(t,e,n){this.qe=t,this.f=Oc(this.qe),this.frames=this.Jc=null,this.ob=this.pb=this.bf=0,this.Va=Ob(e),this.fb=(e.lb?"wss://":"ws://")+e.Oa+"/.ws?v=5","undefined"!=typeof location&&location.href&&-1!==location.href.indexOf("firebaseio.com")&&(this.fb+="&r=f"),e.host!==e.Oa&&(this.fb=this.fb+"&ns="+e.Cb),n&&(this.fb=this.fb+"&s="+n)}function fh(t,e){if(t.frames.push(e),t.frames.length==t.bf){var n=t.frames.join("");t.frames=null,n=mb(n),t.wg(n)}}function eh(t){clearInterval(t.Jc),t.Jc=setInterval(function(){t.va&&t.va.send("0"),eh(t)},Math.floor(45e3))}function gh(t){hh(this,t)}function hh(t,e){var n=ch&&ch.isAvailable(),i=n&&!(Dc.uf||!0===Dc.get("previous_websocket_failure"));if(e.Tg&&(n||Q("wss:// URL used, but browser isn't known to support websockets. Trying anyway."),i=!0),i)t.ed=[ch];else{var r=t.ed=[];Yc(ih,function(t,e){e&&e.isAvailable()&&r.push(e)})}}function jh(t){if(00&&(t.vd=setTimeout(function(){t.vd=null,t.Ab||(t.L&&102400=t.Lf?(t.f("Secondary connection is healthy."),t.Ab=!0,t.F.Bd(),t.F.start(),t.f("sending client ack on secondary"),t.F.send({t:"c",d:{t:"a",d:{}}}),t.f("Ending transmission on primary"),t.L.send({t:"c",d:{t:"n",d:{}}}),t.fd=t.F,qh(t)):(t.f("sending ping on secondary."),t.F.send({t:"c",d:{t:"p",d:{}}}))}function sh(t){t.Ab||(t.Qe--,0>=t.Qe&&(t.f("Primary connection is healthy."),t.Ab=!0,t.L.Bd()))}function ph(t,e){t.F=new e("c:"+t.id+":"+t.ef++,t.H,t.Vd),t.Lf=e.responsesRequiredToBeHealthy||0,t.F.open(mh(t,t.F),nh(t,t.F)),setTimeout(function(){t.F&&(t.f("Timed out trying to upgrade."),t.F.close())},Math.floor(6e4))}function oh(t,e,n){t.f("Realtime connection established."),t.L=e,t.Ua=1,t.Vc&&(t.Vc(n),t.Vc=null),0===t.Qe?(t.f("Primary connection is healthy."),t.Ab=!0):setTimeout(function(){th(t)},Math.floor(5e3))}function th(t){t.Ab||1!==t.Ua||(t.f("sending ping on primary."),vh(t,{t:"c",d:{t:"p",d:{}}}))}function vh(t,e){if(1!==t.Ua)throw"Connection is not connected";t.fd.send(e)}function rh(t){t.f("Shutting down all connections"),t.L&&(t.L.close(),t.L=null),t.F&&(t.F.close(),t.F=null),t.vd&&(clearTimeout(t.vd),t.vd=null)}function wh(t,e,n,i){this.id=xh++,this.f=Oc("p:"+this.id+":"),this.wf=this.De=!1,this.aa={},this.pa=[],this.Xc=0,this.Uc=[],this.ma=!1,this.$a=1e3,this.Cd=3e5,this.Gb=e,this.Tc=n,this.Ne=i,this.H=t,this.We=null,this.Qd={},this.Ig=0,this.mf=!0,this.Kc=this.Fe=null,yh(this,0),Mf.ub().Eb("visible",this.zg,this),-1===t.host.indexOf("fblocal")&&Lf.ub().Eb("online",this.xg,this)}function Ah(t,e){var n=e.Fg,i=n.path.toString(),r=n.wa();t.f("Listen on "+i+" for "+r);var o={p:i};e.tag&&(o.q=ce(n.n),o.t=e.tag),o.h=e.ud(),t.Da("q",o,function(o){var a=o.d,s=o.s;if(a&&"object"==typeof a&&u(a,"w")){var h=w(a,"w");ea(h)&&0<=Na(h,"no_index")&&Q("Using an unspecified index. Consider adding "+('".indexOn": "'+n.n.g.toString()+'"')+" at "+n.path.toString()+" to your security rules for better performance")}(t.aa[i]&&t.aa[i][r])===e&&(t.f("listen response",o),"ok"!==s&&Bh(t,i,r),e.J&&e.J(s,a))})}function Ch(t){var e=t.Fa;t.ma&&e&&t.Da("auth",{cred:e.fg},function(n){var i=n.s;n=n.d||"error","ok"!==i&&t.Fa===e&&delete t.Fa,e.nf?"ok"!==i&&e.jd&&e.jd(i,n):(e.nf=!0,e.yc&&e.yc(i,n))})}function Dh(t,e,n,i,r){n={p:n,d:i},t.f("onDisconnect "+e,n),t.Da(e,n,function(t){r&&setTimeout(function(){r(t.s,t.d)},Math.floor(0))})}function Eh(t,e,i,r,o,a){r={p:i,d:r},n(a)&&(r.h=a),t.pa.push({action:e,If:r,J:o}),t.Xc++,e=t.pa.length-1,t.ma?Fh(t,e):t.f("Buffering put: "+i)}function Fh(t,e){var n=t.pa[e].action,i=t.pa[e].If,r=t.pa[e].J;t.pa[e].Gg=t.ma,t.Da(n,i,function(i){t.f(n+" response",i),delete t.pa[e],t.Xc--,0===t.Xc&&(t.pa=[]),r&&r(i.s,i.d)})}function yh(t,e){J(!t.Sa,"Scheduling a connect when we're already connected/ing?"),t.Sb&&clearTimeout(t.Sb),t.Sb=setTimeout(function(){t.Sb=null,Ih(t)},Math.floor(e))}function Ih(t){if(Jh(t)){t.f("Making a connection attempt"),t.Fe=(new Date).getTime(),t.Kc=null;var e=q(t.Fd,t),n=q(t.Vc,t),i=q(t.Cf,t),r=t.id+":"+zh++;t.Sa=new kh(r,t.H,e,n,i,function(e){Q(e+" ("+t.H.toString()+")"),t.wf=!0})}}function Gh(t,e,n){n=n?Qa(n,function(t){return Wc(t)}).join("$"):"default",(t=Bh(t,e,n))&&t.J&&t.J("permission_denied")}function Bh(t,e,i){e=new K(e).toString();var r;return n(t.aa[e])?(r=t.aa[e][i],delete t.aa[e][i],0===pa(t.aa[e])&&delete t.aa[e]):r=void 0,r}function Hh(t){Ch(t),r(t.aa,function(e){r(e,function(e){Ah(t,e)})});for(var e=0;e.firebaseio.com instead"),n||Qc("Cannot parse Firebase url. Please use https://.firebaseio.com"),i.lb||"undefined"!=typeof window&&window.location&&window.location.protocol&&-1!==window.location.protocol.indexOf("https:")&&Q("Insecure Firebase access from a secure page. Please use https in calls to new Firebase()."),n=new Ec(i.host,i.lb,n,"ws"===i.scheme||"wss"===i.scheme),i=new K(i.Zc),r=i.toString();var o;if(!(o=!p(n.host)||0===n.host.length||!Pf(n.Cb))&&(o=0!==r.length)&&(r&&(r=r.replace(/^\/*\.info(\/|$)/,"/")),o=!(p(r)&&0!==r.length&&!Of.test(r))),o)throw Error(z("new Firebase",1,!1)+'must be a valid firebase URL and the path can\'t contain ".", "#", "$", "[", or "]".');if(e)if(e instanceof W)r=e;else{if(!p(e))throw Error("Expected a valid Firebase.Context for second argument to new Firebase()");r=W.ub(),n.Ld=e}else r=W.ub();o=n.toString();var a=w(r.nc,o);a||(a=new Kh(n,r.Pf),r.nc[o]=a),n=a}Y.call(this,n,i,$d,!1)}function Nc(t,e){J(!e||!0===t||!1===t,"Can't turn on custom loggers persistently."),!0===t?("undefined"!=typeof console&&("function"==typeof console.log?Ab=q(console.log,console):"object"==typeof console.log&&(Ab=function(t){console.log(t)})),e&&P.set("logging_enabled",!0)):t?Ab=t:(Ab=null,P.remove("logging_enabled"))}var h,aa=this,la=Date.now||function(){return+new Date},ya="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),Ea={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"," ":"\\u000b"},Fa=/\uffff/.test("ï¿¿")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g,Ha;t:{var Ia=aa.navigator;if(Ia){var Ja=Ia.userAgent;if(Ja){Ha=Ja;break t}}Ha=""}ma(La,Ka),La.prototype.reset=function(){this.R[0]=1732584193,this.R[1]=4023233417,this.R[2]=2562383102,this.R[3]=271733878,this.R[4]=3285377520,this.be=this.$b=0},La.prototype.update=function(t,e){if(null!=t){n(e)||(e=t.length);for(var i=e-this.Wa,r=0,o=this.le,a=this.$b;e>r;){if(0==a)for(;i>=r;)Ma(this,t,r),r+=this.Wa;if(p(t)){for(;e>r;)if(o[a]=t.charCodeAt(r),++a,++r,a==this.Wa){Ma(this,o),a=0;break}}else for(;e>r;)if(o[a]=t[r],++a,++r,a==this.Wa){Ma(this,o),a=0;break}}this.$b=a,this.be+=e}};var t=Array.prototype,Na=t.indexOf?function(e,n,i){return t.indexOf.call(e,n,i)}:function(t,e,n){if(n=null==n?0:0>n?Math.max(0,t.length+n):n,p(t))return p(e)&&1==e.length?t.indexOf(e,n):-1;for(;no;o++)o in r&&e.call(n,r[o],o,t)},Pa=t.filter?function(e,n,i){return t.filter.call(e,n,i)}:function(t,e,n){for(var i=t.length,r=[],o=0,a=p(t)?t.split(""):t,s=0;i>s;s++)if(s in a){var h=a[s];e.call(n,h,s,t)&&(r[o++]=h)}return r},Qa=t.map?function(e,n,i){return t.map.call(e,n,i)}:function(t,e,n){for(var i=t.length,r=Array(i),o=p(t)?t.split(""):t,a=0;i>a;a++)a in o&&(r[a]=e.call(n,o[a],a,t));return r},Ra=t.reduce?function(e,n,i,r){for(var o=[],a=1,s=arguments.length;s>a;a++)o.push(arguments[a]);return r&&(o[0]=q(n,r)),t.reduce.apply(e,o)}:function(t,e,n,i){var r=n;return Oa(t,function(n,o){r=e.call(i,r,n,o,t)}),r},Sa=t.every?function(e,n,i){return t.every.call(e,n,i)}:function(t,e,n){for(var i=t.length,r=p(t)?t.split(""):t,o=0;i>o;o++)if(o in r&&!e.call(n,r[o],o,t))return!1;return!0},Za=-1!=Ha.indexOf("Opera")||-1!=Ha.indexOf("OPR"),$a=-1!=Ha.indexOf("Trident")||-1!=Ha.indexOf("MSIE"),ab=-1!=Ha.indexOf("Gecko")&&-1==Ha.toLowerCase().indexOf("webkit")&&!(-1!=Ha.indexOf("Trident")||-1!=Ha.indexOf("MSIE")),bb=-1!=Ha.toLowerCase().indexOf("webkit");!function(){var t,e="";return Za&&aa.opera?(e=aa.opera.version,ha(e)?e():e):(ab?t=/rv\:([^\);]+)(\)|;)/:$a?t=/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/:bb&&(t=/WebKit\/(\S+)/),t&&(e=(e=t.exec(Ha))?e[1]:""),$a&&(t=(t=aa.document)?t.documentMode:void 0,t>parseFloat(e))?String(t):e)}();var cb=null,db=null,eb=null;nb.prototype.j=function(t){return this.Sd.oa(t)},nb.prototype.toString=function(){return this.Sd.toString()},ob.prototype.pf=function(){return null},ob.prototype.xe=function(){return null};var pb=new ob;qb.prototype.pf=function(t){var e=this.Ka.D;return rb(e,t)?e.j().M(t):(e=null!=this.Hd?new sb(this.Hd,!0,!1):this.Ka.u(),this.Qf.Xa(t,e))},qb.prototype.xe=function(t,e,n){var i=null!=this.Hd?this.Hd:tb(this.Ka);return t=this.Qf.me(i,e,1,n,t),0===t.length?null:t[0]},wb.prototype.add=function(t){this.sd.push(t)},wb.prototype.Yb=function(){return this.qa};var Eb="value";Fb.prototype.Yb=function(){var t=this.Wd.lc();return"value"===this.rd?t.path:t.parent().path},Fb.prototype.ye=function(){return this.rd},Fb.prototype.Ub=function(){return this.te.Ub(this)},Fb.prototype.toString=function(){return this.Yb().toString()+":"+this.rd+":"+B(this.Wd.lf())},Gb.prototype.Yb=function(){return this.path},Gb.prototype.ye=function(){return"cancel"},Gb.prototype.Ub=function(){return this.te.Ub(this)},Gb.prototype.toString=function(){return this.path.toString()+":cancel"},sb.prototype.j=function(){return this.B},Ib.prototype.get=function(){var t=this.dg.get(),e=xa(t);if(this.Ad)for(var n in this.Ad)e[n]-=this.Ad[n];return this.Ad=t,e},Jb.prototype.Hf=function(){var t,e=this.Yd.get(),n={},i=!1;for(t in e)0e?n=n.left:e>0&&(n=n.right)}return null},h.e=function(){return this.xa.e()},h.count=function(){return this.xa.count()},h.Rc=function(){return this.xa.Rc()},h.ec=function(){return this.xa.ec()},h.ha=function(t){return this.xa.ha(t)},h.Wb=function(t){return new dc(this.xa,null,this.La,!1,t)},h.Xb=function(t,e){return new dc(this.xa,t,this.La,!1,e)},h.Zb=function(t,e){return new dc(this.xa,t,this.La,!0,e)},h.rf=function(t){return new dc(this.xa,null,this.La,!0,t)},h=fc.prototype,h.X=function(t,e,n,i,r){return new fc(null!=t?t:this.key,null!=e?e:this.value,null!=n?n:this.color,null!=i?i:this.left,null!=r?r:this.right)},h.count=function(){return this.left.count()+1+this.right.count()},h.e=function(){return!1},h.ha=function(t){return this.left.ha(t)||t(this.key,this.value)||this.right.ha(t)},h.Rc=function(){return gc(this).key},h.ec=function(){return this.right.e()?this.key:this.right.ec()},h.Na=function(t,e,n){var i,r;return r=this,i=n(t,r.key),r=0>i?r.X(null,null,null,r.left.Na(t,e,n),null):0===i?r.X(null,e,null,null,null):r.X(null,null,null,null,r.right.Na(t,e,n)),hc(r)},h.remove=function(t,e){var n,i;if(n=this,0>e(t,n.key))n.left.e()||n.left.fa()||n.left.left.fa()||(n=jc(n)),n=n.X(null,null,null,n.left.remove(t,e),null);else{if(n.left.fa()&&(n=kc(n)),n.right.e()||n.right.fa()||n.right.left.fa()||(n=lc(n),n.left.left.fa()&&(n=kc(n),n=lc(n))),0===e(t,n.key)){if(n.right.e())return bc;i=gc(n.right),n=n.X(i.key,i.value,null,null,ic(n.right))}n=n.X(null,null,null,null,n.right.remove(t,e))}return hc(n)},h.fa=function(){return this.color},h=nc.prototype,h.X=function(){return this},h.Na=function(t,e){return new fc(t,e,null)},h.remove=function(){return this},h.count=function(){return 0},h.e=function(){return!0},h.ha=function(){return!1},h.Rc=function(){return null},h.ec=function(){return null},h.fa=function(){return!1};var bc=new nc;h=K.prototype,h.toString=function(){for(var t="",e=this.Y;e=this.o.length)return null;for(var t=[],e=this.Y;e=this.o.length},h.Z=function(t){if(uc(this)!==uc(t))return!1;for(var e=this.Y,n=t.Y;e<=this.o.length;e++,n++)if(this.o[e]!==t.o[n])return!1;return!0},h.contains=function(t){var e=this.Y,n=t.Y;if(uc(this)>uc(t))return!1;for(;e"),t};var Gc=function(){var t=1;return function(){return t++}}(),Ab=null,Mc=!0,$c=/^-?\d{1,10}$/;dd.prototype.eg=function(t,e){if(null==t.Ya||null==e.Ya)throw Hc("Should only compare child_ events.");return this.g.compare(new E(t.Ya,t.Ja),new E(e.Ya,e.Ja))},h=jd.prototype,h.Jf=function(t){return"value"===t},h.createEvent=function(t,e){var n=e.n.g;return new Fb("value",this,new S(t.Ja,e.lc(),n))},h.Ub=function(t){var e=this.sb;if("cancel"===t.ye()){J(this.qb,"Raising a cancel event on a listener with no cancel callback");var n=this.qb;return function(){n.call(e,t.error)}}var i=this.Pb;return function(){i.call(e,t.Wd)}},h.ff=function(t,e){return this.qb?new Gb(this,t,e):null},h.matches=function(t){return t instanceof jd?t.Pb&&this.Pb?t.Pb===this.Pb&&t.sb===this.sb:!0:!1},h.sf=function(){return null!==this.Pb},h=kd.prototype,h.Jf=function(t){return t="children_added"===t?"child_added":t,("children_removed"===t?"child_removed":t)in this.ga},h.ff=function(t,e){return this.qb?new Gb(this,t,e):null},h.createEvent=function(t,e){J(null!=t.Ya,"Child events should have a childName.");var n=e.lc().w(t.Ya);return new Fb(t.type,this,new S(t.Ja,n,e.n.g),t.Nd)},h.Ub=function(t){var e=this.sb;if("cancel"===t.ye()){J(this.qb,"Raising a cancel event on a listener with no cancel callback");var n=this.qb;return function(){n.call(e,t.error)}}var i=this.ga[t.rd];return function(){i.call(e,t.Wd,t.Nd)}},h.matches=function(t){if(t instanceof kd){if(!this.ga||!t.ga)return!0;if(this.sb===t.sb){var e=pa(t.ga);if(e===pa(this.ga)){if(1===e){var e=qa(t.ga),n=qa(this.ga);return!(n!==e||t.ga[e]&&this.ga[n]&&t.ga[e]!==this.ga[n])}return oa(this.ga,function(e,n){return t.ga[n]===e})}}}return!1},h.sf=function(){return null!==this.ga},h=ld.prototype,h.G=function(t,e,n,i,r){return J(t.Ic(this.g),"A node must be indexed if only a child is updated"),i=t.M(e),i.Z(n)?t:(null!=r&&(n.e()?t.Ha(e)?id(r,new D("child_removed",i,e)):J(t.N(),"A child remove without an old child only makes sense on a leaf node"):i.e()?id(r,new D("child_added",n,e)):id(r,new D("child_changed",n,e,i))),t.N()&&n.e()?t:t.Q(e,n).mb(this.g))},h.ta=function(t,e,n){return null!=n&&(t.N()||t.U(M,function(t,i){e.Ha(t)||id(n,new D("child_removed",i,t))}),e.N()||e.U(M,function(e,i){if(t.Ha(e)){var r=t.M(e);r.Z(i)||id(n,new D("child_changed",i,e,r))}else id(n,new D("child_added",i,e))})),e.mb(this.g)},h.da=function(t,e){return t.e()?C:t.da(e)},h.Ga=function(){return!1},h.Vb=function(){return this},h=md.prototype,h.matches=function(t){return 0>=this.g.compare(this.dd,t)&&0>=this.g.compare(t,this.Fc)},h.G=function(t,e,n,i,r){return this.matches(new E(e,n))||(n=C),this.Ae.G(t,e,n,i,r)},h.ta=function(t,e,n){e.N()&&(e=C);var i=e.mb(this.g),i=i.da(C),r=this;return e.U(M,function(t,e){r.matches(new E(t,e))||(i=i.Q(t,C))}),this.Ae.ta(t,i,n)},h.da=function(t){return t},h.Ga=function(){return!0},h.Vb=function(){return this.Ae},h=rd.prototype,h.G=function(t,e,n,i,r){return this.ra.matches(new E(e,n))||(n=C),t.M(e).Z(n)?t:t.Db()=this.g.compare(this.ra.dd,a):0>=this.g.compare(a,this.ra.Fc)))break;i=i.Q(a.name,a.S),r++}}else{i=e.mb(this.g),i=i.da(C);var s,h,u;if(this.Jb){e=i.rf(this.g),s=this.ra.Fc,h=this.ra.dd;var c=ud(this.g);u=function(t,e){return c(e,t)}}else e=i.Wb(this.g),s=this.ra.dd,h=this.ra.Fc,u=ud(this.g);for(var r=0,l=!1;0=u(s,a)&&(l=!0),(o=l&&r=u(a,h))?r++:i=i.Q(a.name,C)}return this.ra.Vb().ta(t,i,n)},h.da=function(t){return t},h.Ga=function(){return!0},h.Vb=function(){return this.ra.Vb()},zd.prototype.bb=function(t,e,n,i){var r,o=new hd;if(e.type===Vb)e.source.ve?n=Ad(this,t,e.path,e.Ia,n,i,o):(J(e.source.of,"Unknown source."),r=e.source.af,n=Bd(this,t,e.path,e.Ia,n,i,r,o));else if(e.type===Cd)e.source.ve?n=Dd(this,t,e.path,e.children,n,i,o):(J(e.source.of,"Unknown source."),r=e.source.af,n=Ed(this,t,e.path,e.children,n,i,r,o));else if(e.type===Xb)if(e.Ve)if(r=e.path,null!=n.sc(r))n=t;else{if(e=new qb(n,t,i),i=t.D.j(),r.e()||".priority"===O(r))Hb(t.u())?e=n.ua(tb(t)):(e=t.u().j(),J(e instanceof T,"serverChildren would be complete if leaf node"),e=n.xc(e)),e=this.I.ta(i,e,o);else{r=O(r);var a=n.Xa(r,t.u());null==a&&rb(t.u(),r)&&(a=i.M(r)),e=null!=a?this.I.G(i,r,a,e,o):t.D.j().Ha(r)?this.I.G(i,r,C,e,o):i,e.e()&&Hb(t.u())&&(i=n.ua(tb(t)),i.N()&&(e=this.I.ta(e,i,o)))}i=Hb(t.u())||null!=n.sc(F),n=Fd(t,e,i,this.I.Ga())}else n=Gd(this,t,e.path,n,i,o);else{if(e.type!==$b)throw Hc("Unknown operation type: "+e.type);i=e.path,e=t.u(),r=e.j(),a=e.$||i.e(),n=Hd(this,new Id(t.D,new sb(r,a,e.Tb)),i,n,pb,o)}return o=ra(o.eb),i=n,e=i.D,e.$&&(r=e.j().N()||e.j().e(),a=Jd(t),(0=0,"Unknown leaf type: "+e),J(r>=0,"Unknown leaf type: "+n),i===r?"object"===n?0:this.Ci){var o,a=[];for(o in e)a[o]=e[o];return a}return t&&!this.A().e()&&(e[".priority"]=this.A().K()),e},h.hash=function(){if(null===this.Bb){var t="";this.A().e()||(t+="priority:"+le(this.A().K())+":"),this.U(M,function(e,n){var i=n.hash();""!==i&&(t+=":"+e+":"+i)}),this.Bb=""===t?"":Jc(t)}return this.Bb},h.qf=function(t,e,n){return(n=oe(this,n))?(t=cc(n,new E(t,e)))?t.name:null:cc(this.m,t)},h.U=function(t,e){var n=oe(this,t);return n?n.ha(function(t){return e(t.name,t.S)}):this.m.ha(e)},h.Wb=function(t){return this.Xb(t.Sc(),t)},h.Xb=function(t,e){var n=oe(this,e);if(n)return n.Xb(t,function(t){return t});for(var n=this.m.Xb(t.name,Qb),i=ec(n);null!=i&&0>e.compare(i,t);)H(n),i=ec(n);return n},h.rf=function(t){return this.Zb(t.Pc(),t)},h.Zb=function(t,e){var n=oe(this,e);if(n)return n.Zb(t,function(t){return t});for(var n=this.m.Zb(t.name,Qb),i=ec(n);null!=i&&0t?-1:1});h=De.prototype,h.e=function(){return null===this.value&&this.children.e()},h.subtree=function(t){if(t.e())return this;var e=this.children.get(O(t));return null!==e?e.subtree(G(t)):Nd},h.set=function(t,e){if(t.e())return new De(e,this.children);var n=O(t),i=(this.children.get(n)||Nd).set(G(t),e),n=this.children.Na(n,i);return new De(this.value,n)},h.remove=function(t){if(t.e())return this.children.e()?Nd:new De(null,this.children);var e=O(t),n=this.children.get(e);return n?(t=n.remove(G(t)),e=t.e()?this.children.remove(e):this.children.Na(e,t),null===this.value&&e.e()?Nd:new De(this.value,e)):this},h.get=function(t){if(t.e())return this.value;var e=this.children.get(O(t));return e?e.get(G(t)):null};var Nd=new De(null);De.prototype.toString=function(){var t={};return Kd(this,function(e,n){t[e.toString()]=n.toString()}),B(t)};var Re=new Qe(new De(null));Qe.prototype.Od=function(t){return t.e()?Re:(t=Md(this.W,t,Nd),new Qe(t))},Qe.prototype.e=function(){return this.W.e()},Qe.prototype.apply=function(t){return Xe(F,this.W,t)},h=Ye.prototype,h.Od=function(t){var e=Ua(this.za,function(e){return e.ie===t});J(e>=0,"removeWrite called with nonexistent writeId.");var n=this.za[e];this.za.splice(e,1);for(var i=n.visible,o=!1,a=this.za.length-1;i&&a>=0;){var s=this.za[a];s.visible&&(a>=e&&Ze(s,n.path)?i=!1:n.path.contains(s.path)&&(o=!0)),a--}if(i){if(o)this.T=$e(this.za,af,F),this.Lc=0=0;o--)r[o]="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz".charAt(n%64),n=Math.floor(n/64);if(J(0===n,"Cannot push at time == 0"),n=r.join(""),i){for(o=11;o>=0&&63===e[o];o--)e[o]=0;e[o]++}else for(o=0;12>o;o++)e[o]=Math.floor(64*Math.random());for(o=0;12>o;o++)n+="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz".charAt(e[o]);return J(20===n.length,"nextPushId: Length should be 20."),n}}();ma(Lf,If),Lf.prototype.ze=function(t){return J("online"===t,"Unknown event type: "+t),[this.ic]},ca(Lf),ma(Mf,If),Mf.prototype.ze=function(t){return J("visible"===t,"Unknown event type: "+t),[this.uc]},ca(Mf);var Nf=/[\[\].#$\/\u0000-\u001F\u007F]/,Of=/[\[\].#$\u0000-\u001F\u007F]/;h=cg.prototype,h.add=function(t,e){this.set[t]=null!==e?e:!0},h.contains=function(t){return u(this.set,t)},h.get=function(t){return this.contains(t)?this.set[t]:void 0},h.remove=function(t){delete this.set[t]},h.clear=function(){this.set={}},h.e=function(){return wa(this.set)},h.count=function(){return pa(this.set)},h.keys=function(){var t=[]; - -return r(this.set,function(e,n){t.push(n)}),t},qc.prototype.find=function(t){if(null!=this.C)return this.C.oa(t);if(t.e()||null==this.m)return null;var e=O(t);return t=G(t),this.m.contains(e)?this.m.get(e).find(t):null},qc.prototype.mc=function(t,e){if(t.e())this.C=e,this.m=null;else if(null!==this.C)this.C=this.C.G(t,e);else{null==this.m&&(this.m=new cg);var n=O(t);this.m.contains(n)||this.m.add(n,new qc),n=this.m.get(n),t=G(t),n.mc(t,e)}},qc.prototype.U=function(t){null!==this.m&&dg(this.m,function(e,n){t(e,n)})};var fg="auth.firebase.com",hg=["remember","redirectTo"];jg.prototype.set=function(t,e){if(!e){if(!this.$d.length)throw Error("fb.login.SessionManager : No storage options available!");e=this.$d[0]}e.set(this.Pe,t)},jg.prototype.get=function(){var t=Qa(this.$d,q(this.ng,this)),t=Pa(t,function(t){return null!==t});return Xa(t,function(t,e){return bd(e.token)-bd(t.token)}),0o.status){try{t=mb(o.responseText)}catch(e){}n(null,t)}else n(500<=o.status&&600>o.status?yg("SERVER_ERROR"):yg("NETWORK_ERROR"));n=null,pg(window,"beforeunload",i)}},"GET"===a)t+=(/\?/.test(t)?"":"?")+jb(e),r=null;else{var s=this.options.headers.content_type;"application/json"===s&&(r=B(e)),"application/x-www-form-urlencoded"===s&&(r=jb(e))}o.open(a,t,!0),t={"X-Requested-With":"XMLHttpRequest",Accept:"application/json;text/plain"},za(t,this.options.headers);for(var h in t)o.setRequestHeader(h,t[h]);o.send(r)},Ag.isAvailable=function(){return!(!window.XMLHttpRequest||"string"!=typeof(new XMLHttpRequest).responseType||"undefined"!=typeof navigator&&(navigator.userAgent.match(/MSIE/)||navigator.userAgent.match(/Trident/))&&!mg())},Ag.prototype.Bc=function(){return"json"},Bg.prototype.open=function(t,e,n){function i(){n&&(n(yg("USER_CANCELLED")),n=null)}var r,o=this,a=Rc(fg);e.requestId=this.oc,e.redirectTo=a.scheme+"://"+a.host+"/blank/page.html",t+=/\?/.test(t)?"":"?",t+=jb(e),(r=window.open(t,"_blank","location=no"))&&ha(r.addEventListener)?(r.addEventListener("loadstart",function(t){var e;if(e=t&&t.url)t:{try{var s=document.createElement("a");s.href=t.url,e=s.host===a.host&&"/blank/page.html"===s.pathname;break t}catch(h){}e=!1}e&&(t=rg(t.url),r.removeEventListener("exit",i),r.close(),t=new gg(null,null,{requestId:o.oc,requestKey:t}),o.Df.requestWithCredential("/auth/session",t,n),n=null)}),r.addEventListener("exit",i)):n(yg("TRANSPORT_UNAVAILABLE"))},Bg.isAvailable=function(){return kg()},Bg.prototype.Bc=function(){return"redirect"},Cg.prototype.open=function(t,e,n){function i(){n&&(n(yg("REQUEST_INTERRUPTED")),n=null)}function r(){setTimeout(function(){window.__firebase_auth_jsonp[o]=void 0,wa(window.__firebase_auth_jsonp)&&(window.__firebase_auth_jsonp=void 0);try{var t=document.getElementById(o);t&&t.parentNode.removeChild(t)}catch(e){}},1),pg(window,"beforeunload",i)}var o="fn"+(new Date).getTime()+Math.floor(99999*Math.random());e[this.options.callback_parameter]="__firebase_auth_jsonp."+o,t+=(/\?/.test(t)?"":"?")+jb(e),og(window,"beforeunload",i),window.__firebase_auth_jsonp[o]=function(t){n&&(n(null,t),n=null),r()},Dg(o,t,n)},Cg.isAvailable=function(){return!0},Cg.prototype.Bc=function(){return"json"},ma(Eg,If),h=Eg.prototype,h.we=function(){return this.nb||null},h.re=function(t,e){Ng(this);var n=ig(t);n.ab._method="POST",this.pc("/users",n,function(t,n){t?R(e,t):R(e,t,n)})},h.Se=function(t,e){var n=this;Ng(this);var i="/users/"+encodeURIComponent(t.email),r=ig(t);r.ab._method="DELETE",this.pc(i,r,function(t,i){!t&&i&&i.uid&&n.nb&&n.nb.uid&&n.nb.uid===i.uid&&Lg(n),R(e,t)})},h.oe=function(t,e){Ng(this);var n="/users/"+encodeURIComponent(t.email)+"/password",i=ig(t);i.ab._method="PUT",i.ab.password=t.newPassword,this.pc(n,i,function(t){R(e,t)})},h.ne=function(t,e){Ng(this);var n="/users/"+encodeURIComponent(t.oldEmail)+"/email",i=ig(t);i.ab._method="PUT",i.ab.email=t.newEmail,i.ab.password=t.password,this.pc(n,i,function(t){R(e,t)})},h.Ue=function(t,e){Ng(this);var n="/users/"+encodeURIComponent(t.email)+"/password",i=ig(t);i.ab._method="POST",this.pc(n,i,function(t){R(e,t)})},h.pc=function(t,e,n){Qg(this,[Ag,Cg],t,e,n)},h.ze=function(t){return J("auth_status"===t,'initial event must be of type "auth_status"'),this.Re?null:[this.nb]};var Vg,Wg;Ug.prototype.open=function(t,e){this.gf=0,this.ka=e,this.zf=new Rg(t),this.zb=!1;var n=this;this.rb=setTimeout(function(){n.f("Timed out trying to connect."),n.ib(),n.rb=null},Math.floor(3e4)),Tc(function(){if(!n.zb){n.Ta=new Xg(function(t,e,i,r,o){if(Yg(n,arguments),n.Ta)if(n.rb&&(clearTimeout(n.rb),n.rb=null),n.Gc=!0,"start"==t)n.id=e,n.Ff=i;else{if("close"!==t)throw Error("Unrecognized command received: "+t);e?(n.Ta.Td=!1,Sg(n.zf,e,function(){n.ib()})):n.ib()}},function(t,e){Yg(n,arguments),Tg(n.zf,t,e)},function(){n.ib()},n.gd);var t={start:"t"};t.ser=Math.floor(1e8*Math.random()),n.Ta.fe&&(t.cb=n.Ta.fe),t.v="5",n.Vd&&(t.s=n.Vd),"undefined"!=typeof location&&location.href&&-1!==location.href.indexOf("firebaseio.com")&&(t.r="f"),t=n.gd(t),n.f("Connecting via long-poll to "+t),Zg(n.Ta,t,function(){})}})},Ug.prototype.start=function(){var t=this.Ta,e=this.Ff;for(t.rg=this.id,t.sg=e,t.ke=!0;$g(t););t=this.id,e=this.Ff,this.fc=document.createElement("iframe");var n={dframe:"t"};n.id=t,n.pw=e,this.fc.src=this.gd(n),this.fc.style.display="none",document.body.appendChild(this.fc)},Ug.isAvailable=function(){return!(Wg||"object"==typeof window&&window.chrome&&window.chrome.extension&&!/^chrome/.test(window.location.href)||"object"==typeof Windows&&"object"==typeof Windows.Ug)},h=Ug.prototype,h.Bd=function(){},h.cd=function(){this.zb=!0,this.Ta&&(this.Ta.close(),this.Ta=null),this.fc&&(document.body.removeChild(this.fc),this.fc=null),this.rb&&(clearTimeout(this.rb),this.rb=null)},h.ib=function(){this.zb||(this.f("Longpoll is closing itself"),this.cd(),this.ka&&(this.ka(this.Gc),this.ka=null))},h.close=function(){this.zb||(this.f("Longpoll is being closed."),this.cd())},h.send=function(t){t=B(t),this.pb+=t.length,Lb(this.Va,"bytes_sent",t.length),t=Kc(t),t=fb(t,!0),t=Xc(t,1840);for(var e=0;e=t.length){var e=Number(t);if(!isNaN(e)){r.bf=e,r.frames=[],t=null;break t}}r.bf=1,r.frames=[]}null!==t&&fh(r,t)}},this.va.onerror=function(t){r.f("WebSocket error. Closing connection."),(t=t.message||t.data)&&r.f(t),r.ib()}},ch.prototype.start=function(){},ch.isAvailable=function(){var t=!1;if("undefined"!=typeof navigator&&navigator.userAgent){var e=navigator.userAgent.match(/Android ([0-9]{0,}\.[0-9]{0,})/);e&&1parseFloat(e[1])&&(t=!0)}return!t&&null!==bh&&!dh},ch.responsesRequiredToBeHealthy=2,ch.healthyTimeout=3e4,h=ch.prototype,h.Bd=function(){Dc.remove("previous_websocket_failure")},h.send=function(t){eh(this),t=B(t),this.pb+=t.length,Lb(this.Va,"bytes_sent",t.length),t=Xc(t,16384),1r;r++)e+=" ";console.log(e+i)}}},h.Ze=function(t){Lb(this.Va,t),this.Pg.Mf[t]=!0},h.f=function(t){var e="";this.Ra&&(e=this.Ra.id+":"),Bb(e,arguments)},ca(W),W.prototype.yb=function(){for(var t in this.nc)this.nc[t].yb()},W.prototype.interrupt=W.prototype.yb,W.prototype.qc=function(){for(var t in this.nc)this.nc[t].qc()},W.prototype.resume=W.prototype.qc,W.prototype.ue=function(){this.Pf=!0},X.prototype.cancel=function(t){x("Firebase.onDisconnect().cancel",0,1,arguments.length),A("Firebase.onDisconnect().cancel",1,t,!0),this.ad.Gd(this.qa,t||null)},X.prototype.cancel=X.prototype.cancel,X.prototype.remove=function(t){x("Firebase.onDisconnect().remove",0,1,arguments.length),Yf("Firebase.onDisconnect().remove",this.qa),A("Firebase.onDisconnect().remove",1,t,!0),Sh(this.ad,this.qa,null,t)},X.prototype.remove=X.prototype.remove,X.prototype.set=function(t,e){x("Firebase.onDisconnect().set",1,2,arguments.length),Yf("Firebase.onDisconnect().set",this.qa),Rf("Firebase.onDisconnect().set",t,this.qa,!1),A("Firebase.onDisconnect().set",2,e,!0),Sh(this.ad,this.qa,t,e)},X.prototype.set=X.prototype.set,X.prototype.Kb=function(t,e,n){x("Firebase.onDisconnect().setWithPriority",2,3,arguments.length),Yf("Firebase.onDisconnect().setWithPriority",this.qa),Rf("Firebase.onDisconnect().setWithPriority",t,this.qa,!1),Uf("Firebase.onDisconnect().setWithPriority",2,e),A("Firebase.onDisconnect().setWithPriority",3,n,!0),Th(this.ad,this.qa,t,e,n)},X.prototype.setWithPriority=X.prototype.Kb,X.prototype.update=function(t,e){if(x("Firebase.onDisconnect().update",1,2,arguments.length),Yf("Firebase.onDisconnect().update",this.qa),ea(t)){for(var n={},i=0;i=t)throw Error("Query.limit: First argument must be a positive integer.");if(this.n.ia)throw Error("Query.limit: Limit was already set (by another call to limit, limitToFirst, orlimitToLast.");var e=this.n.Ge(t);return fi(e),new Y(this.k,this.path,e,this.jc)},Y.prototype.limit=Y.prototype.Ge,Y.prototype.He=function(t){if(x("Query.limitToFirst",1,1,arguments.length),!ga(t)||Math.floor(t)!==t||0>=t)throw Error("Query.limitToFirst: First argument must be a positive integer.");if(this.n.ia)throw Error("Query.limitToFirst: Limit was already set (by another call to limit, limitToFirst, or limitToLast).");return new Y(this.k,this.path,this.n.He(t),this.jc)},Y.prototype.limitToFirst=Y.prototype.He,Y.prototype.Ie=function(t){if(x("Query.limitToLast",1,1,arguments.length),!ga(t)||Math.floor(t)!==t||0>=t)throw Error("Query.limitToLast: First argument must be a positive integer.");if(this.n.ia)throw Error("Query.limitToLast: Limit was already set (by another call to limit, limitToFirst, or limitToLast).");return new Y(this.k,this.path,this.n.Ie(t),this.jc)},Y.prototype.limitToLast=Y.prototype.Ie,Y.prototype.Bg=function(t){if(x("Query.orderByChild",1,1,arguments.length),"$key"===t)throw Error('Query.orderByChild: "$key" is invalid. Use Query.orderByKey() instead.');if("$priority"===t)throw Error('Query.orderByChild: "$priority" is invalid. Use Query.orderByPriority() instead.');if("$value"===t)throw Error('Query.orderByChild: "$value" is invalid. Use Query.orderByValue() instead.');Wf("Query.orderByChild",1,t,!1),gi(this,"Query.orderByChild");var e=be(this.n,new Rd(t));return ei(e),new Y(this.k,this.path,e,!0)},Y.prototype.orderByChild=Y.prototype.Bg,Y.prototype.Cg=function(){x("Query.orderByKey",0,0,arguments.length),gi(this,"Query.orderByKey");var t=be(this.n,Vd);return ei(t),new Y(this.k,this.path,t,!0)},Y.prototype.orderByKey=Y.prototype.Cg,Y.prototype.Dg=function(){x("Query.orderByPriority",0,0,arguments.length),gi(this,"Query.orderByPriority");var t=be(this.n,M);return ei(t),new Y(this.k,this.path,t,!0)},Y.prototype.orderByPriority=Y.prototype.Dg,Y.prototype.Eg=function(){x("Query.orderByValue",0,0,arguments.length),gi(this,"Query.orderByValue");var t=be(this.n,Yd);return ei(t),new Y(this.k,this.path,t,!0)},Y.prototype.orderByValue=Y.prototype.Eg,Y.prototype.Xd=function(t,e){x("Query.startAt",0,2,arguments.length),Rf("Query.startAt",t,this.path,!0),Wf("Query.startAt",2,e,!0);var i=this.n.Xd(t,e);if(fi(i),ei(i),this.n.la)throw Error("Query.startAt: Starting point was already set (by another call to startAt or equalTo).");return n(t)||(e=t=null),new Y(this.k,this.path,i,this.jc)},Y.prototype.startAt=Y.prototype.Xd,Y.prototype.qd=function(t,e){x("Query.endAt",0,2,arguments.length),Rf("Query.endAt",t,this.path,!0),Wf("Query.endAt",2,e,!0);var n=this.n.qd(t,e);if(fi(n),ei(n),this.n.na)throw Error("Query.endAt: Ending point was already set (by another call to endAt or equalTo).");return new Y(this.k,this.path,n,this.jc)},Y.prototype.endAt=Y.prototype.qd,Y.prototype.hg=function(t,e){if(x("Query.equalTo",1,2,arguments.length),Rf("Query.equalTo",t,this.path,!1),Wf("Query.equalTo",2,e,!0),this.n.la)throw Error("Query.equalTo: Starting point was already set (by another call to endAt or equalTo).");if(this.n.na)throw Error("Query.equalTo: Ending point was already set (by another call to endAt or equalTo).");return this.Xd(t,e).qd(t,e)},Y.prototype.equalTo=Y.prototype.hg,Y.prototype.toString=function(){x("Query.toString",0,0,arguments.length);for(var t=this.path,e="",n=t.Y;n\\n
\\n \\n \\n \\n

Hacker News

\\n \\n Built with Vue.js |\\n Source\\n \\n
\\n \\n
\";\nmodule.exports = {\n el: '#app',\n data: {\n view: '',\n params: {\n page: 1,\n userId: null,\n itemId: null\n }\n },\n filters: {\n fromNow: require('./filters/from-now'),\n domain: require('./filters/domain')\n },\n components: {\n 'news-view': require('./views/news-view.vue'),\n 'item-view': require('./views/item-view.vue'),\n 'user-view': require('./views/user-view.vue')\n }\n}\n;(typeof module.exports === \"function\"? module.exports.options: module.exports).template = __vue_template__;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/app.vue\n ** module id = 1\n ** module chunks = 0\n **/","var _ = require('./util')\nvar extend = _.extend\n\n/**\n * The exposed Vue constructor.\n *\n * API conventions:\n * - public API methods/properties are prefiexed with `$`\n * - internal methods/properties are prefixed with `_`\n * - non-prefixed properties are assumed to be proxied user\n * data.\n *\n * @constructor\n * @param {Object} [options]\n * @public\n */\n\nfunction Vue (options) {\n this._init(options)\n}\n\n/**\n * Mixin global API\n */\n\nextend(Vue, require('./api/global'))\n\n/**\n * Vue and every constructor that extends Vue has an\n * associated options object, which can be accessed during\n * compilation steps as `this.constructor.options`.\n *\n * These can be seen as the default options of every\n * Vue instance.\n */\n\nVue.options = {\n directives : require('./directives'),\n filters : require('./filters'),\n partials : {},\n transitions : {},\n components : {}\n}\n\n/**\n * Build up the prototype\n */\n\nvar p = Vue.prototype\n\n/**\n * $data has a setter which does a bunch of\n * teardown/setup work\n */\n\nObject.defineProperty(p, '$data', {\n get: function () {\n return this._data\n },\n set: function (newData) {\n this._setData(newData)\n }\n})\n\n/**\n * Mixin internal instance methods\n */\n\nextend(p, require('./instance/init'))\nextend(p, require('./instance/events'))\nextend(p, require('./instance/scope'))\nextend(p, require('./instance/compile'))\n\n/**\n * Mixin public API methods\n */\n\nextend(p, require('./api/data'))\nextend(p, require('./api/dom'))\nextend(p, require('./api/events'))\nextend(p, require('./api/child'))\nextend(p, require('./api/lifecycle'))\n\nmodule.exports = _.Vue = Vue\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/vue/src/vue.js\n ** module id = 2\n ** module chunks = 0\n **/","\n\n//\n// Generated on Tue Dec 16 2014 12:13:47 GMT+0100 (CET) by Charlie Robbins, Paolo Fragomeni & the Contributors (Using Codesurgeon).\n// Version 1.2.6\n//\n\n(function (exports) {\n\n/*\n * browser.js: Browser specific functionality for director.\n *\n * (C) 2011, Charlie Robbins, Paolo Fragomeni, & the Contributors.\n * MIT LICENSE\n *\n */\n\nvar dloc = document.location;\n\nfunction dlocHashEmpty() {\n // Non-IE browsers return '' when the address bar shows '#'; Director's logic\n // assumes both mean empty.\n return dloc.hash === '' || dloc.hash === '#';\n}\n\nvar listener = {\n mode: 'modern',\n hash: dloc.hash,\n history: false,\n\n check: function () {\n var h = dloc.hash;\n if (h != this.hash) {\n this.hash = h;\n this.onHashChanged();\n }\n },\n\n fire: function () {\n if (this.mode === 'modern') {\n this.history === true ? window.onpopstate() : window.onhashchange();\n }\n else {\n this.onHashChanged();\n }\n },\n\n init: function (fn, history) {\n var self = this;\n this.history = history;\n\n if (!Router.listeners) {\n Router.listeners = [];\n }\n\n function onchange(onChangeEvent) {\n for (var i = 0, l = Router.listeners.length; i < l; i++) {\n Router.listeners[i](onChangeEvent);\n }\n }\n\n //note IE8 is being counted as 'modern' because it has the hashchange event\n if ('onhashchange' in window && (document.documentMode === undefined\n || document.documentMode > 7)) {\n // At least for now HTML5 history is available for 'modern' browsers only\n if (this.history === true) {\n // There is an old bug in Chrome that causes onpopstate to fire even\n // upon initial page load. Since the handler is run manually in init(),\n // this would cause Chrome to run it twise. Currently the only\n // workaround seems to be to set the handler after the initial page load\n // http://code.google.com/p/chromium/issues/detail?id=63040\n setTimeout(function() {\n window.onpopstate = onchange;\n }, 500);\n }\n else {\n window.onhashchange = onchange;\n }\n this.mode = 'modern';\n }\n else {\n //\n // IE support, based on a concept by Erik Arvidson ...\n //\n var frame = document.createElement('iframe');\n frame.id = 'state-frame';\n frame.style.display = 'none';\n document.body.appendChild(frame);\n this.writeFrame('');\n\n if ('onpropertychange' in document && 'attachEvent' in document) {\n document.attachEvent('onpropertychange', function () {\n if (event.propertyName === 'location') {\n self.check();\n }\n });\n }\n\n window.setInterval(function () { self.check(); }, 50);\n\n this.onHashChanged = onchange;\n this.mode = 'legacy';\n }\n\n Router.listeners.push(fn);\n\n return this.mode;\n },\n\n destroy: function (fn) {\n if (!Router || !Router.listeners) {\n return;\n }\n\n var listeners = Router.listeners;\n\n for (var i = listeners.length - 1; i >= 0; i--) {\n if (listeners[i] === fn) {\n listeners.splice(i, 1);\n }\n }\n },\n\n setHash: function (s) {\n // Mozilla always adds an entry to the history\n if (this.mode === 'legacy') {\n this.writeFrame(s);\n }\n\n if (this.history === true) {\n window.history.pushState({}, document.title, s);\n // Fire an onpopstate event manually since pushing does not obviously\n // trigger the pop event.\n this.fire();\n } else {\n dloc.hash = (s[0] === '/') ? s : '/' + s;\n }\n return this;\n },\n\n writeFrame: function (s) {\n // IE support...\n var f = document.getElementById('state-frame');\n var d = f.contentDocument || f.contentWindow.document;\n d.open();\n d.write(\" + - \ No newline at end of file + diff --git a/package.json b/package.json index 3d81127..6721a23 100644 --- a/package.json +++ b/package.json @@ -2,10 +2,9 @@ "name": "vue-hackernews", "version": "1.0.0", "description": "HN clone with Vue.js using HN API", - "main": "index.js", "scripts": { - "dev": "webpack --module-bind \"vue=vue\" --watch --devtool source-map src/main.js build/build.js", - "build": "webpack --module-bind \"vue=vue\" --plugin webpack/lib/optimize/UglifyJsPlugin src/main.js build/build.js" + "dev": "webpack-dev-server --inline --hot --no-info", + "build": "cross-env NODE_ENV=production webpack --progress --hide-modules" }, "repository": { "type": "git", @@ -18,13 +17,26 @@ }, "homepage": "https://github.com/yyx990803/vue-hackernews", "devDependencies": { - "stylus": "^0.50.0", - "vue-loader": "^1.1.4", - "webpack": "^1.8.4" + "babel-core": "^6.0.0", + "babel-loader": "^6.0.0", + "babel-plugin-transform-runtime": "^6.0.0", + "babel-preset-es2015": "^6.0.0", + "babel-runtime": "^6.0.0", + "cross-env": "^2.0.1", + "css-loader": "^0.24.0", + "stylus": "^0.54.5", + "stylus-loader": "^2.1.1", + "vue-hot-reload-api": "^1.2.0", + "vue-html-loader": "^1.0.0", + "vue-loader": "^8.0.0", + "vue-style-loader": "^1.0.0", + "webpack": "^1.12.2", + "webpack-dev-server": "^1.12.0" }, "dependencies": { - "director": "^1.2.8", - "firebase": "^2.2.4", - "vue": "yyx990803/vue#dev" + "es6-promise": "^3.0.2", + "firebase": "^3.4.1", + "vue": "^1.0.26", + "vue-router": "^0.7.13" } } diff --git a/src/app.vue b/src/app.vue deleted file mode 100644 index dbfbd62..0000000 --- a/src/app.vue +++ /dev/null @@ -1,96 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/components/App.vue b/src/components/App.vue new file mode 100644 index 0000000..39271d5 --- /dev/null +++ b/src/components/App.vue @@ -0,0 +1,93 @@ + + + diff --git a/src/components/Comment.vue b/src/components/Comment.vue new file mode 100644 index 0000000..914e83e --- /dev/null +++ b/src/components/Comment.vue @@ -0,0 +1,67 @@ + + + + + diff --git a/src/components/Item.vue b/src/components/Item.vue new file mode 100644 index 0000000..215130e --- /dev/null +++ b/src/components/Item.vue @@ -0,0 +1,72 @@ + + + + + diff --git a/src/components/ItemView.vue b/src/components/ItemView.vue new file mode 100644 index 0000000..1be4c33 --- /dev/null +++ b/src/components/ItemView.vue @@ -0,0 +1,96 @@ + + + + + diff --git a/src/components/NewsView.vue b/src/components/NewsView.vue new file mode 100644 index 0000000..3872f90 --- /dev/null +++ b/src/components/NewsView.vue @@ -0,0 +1,102 @@ + + + + + diff --git a/src/components/UserView.vue b/src/components/UserView.vue new file mode 100644 index 0000000..a62b12d --- /dev/null +++ b/src/components/UserView.vue @@ -0,0 +1,61 @@ + + + + + diff --git a/src/components/comment.vue b/src/components/comment.vue deleted file mode 100644 index 6fa7b90..0000000 --- a/src/components/comment.vue +++ /dev/null @@ -1,55 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/components/item.vue b/src/components/item.vue deleted file mode 100644 index c3fa8f1..0000000 --- a/src/components/item.vue +++ /dev/null @@ -1,67 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/filters/domain.js b/src/filters/domain.js deleted file mode 100644 index 6aec14d..0000000 --- a/src/filters/domain.js +++ /dev/null @@ -1,6 +0,0 @@ -var parser = document.createElement('a') - -module.exports = function (url) { - parser.href = url - return parser.hostname -} \ No newline at end of file diff --git a/src/filters/from-now.js b/src/filters/from-now.js deleted file mode 100644 index 85539d4..0000000 --- a/src/filters/from-now.js +++ /dev/null @@ -1,10 +0,0 @@ -module.exports = function (time) { - var between = Date.now() / 1000 - Number(time) - if (between < 3600) { - return ~~(between / 60) + ' minutes' - } else if (between < 86400) { - return ~~(between / 3600) + ' hours' - } else { - return ~~(between / 86400) + ' days' - } -} \ No newline at end of file diff --git a/src/filters/index.js b/src/filters/index.js new file mode 100644 index 0000000..e14a6fd --- /dev/null +++ b/src/filters/index.js @@ -0,0 +1,25 @@ +const urlParser = document.createElement('a') + +export function domain (url) { + urlParser.href = url + return urlParser.hostname +} + +export function fromNow (time) { + const between = Date.now() / 1000 - Number(time) + if (between < 3600) { + return pluralize(~~(between / 60), ' minute') + } else if (between < 86400) { + return pluralize(~~(between / 3600), ' hour') + } else { + return pluralize(~~(between / 86400), ' day') + } +} + +function pluralize(time, label) { + if (time === 1) { + return time + label + } + + return time + label + 's'; +} diff --git a/src/main.js b/src/main.js index 6b0c172..d1a5e7b 100644 --- a/src/main.js +++ b/src/main.js @@ -1,34 +1,39 @@ -/** - * Boot up the Vue instance and wire up the router. - */ +import Vue from 'vue' +import Router from 'vue-router' +import { domain, fromNow } from './filters' +import App from './components/App.vue' +import NewsView from './components/NewsView.vue' +import ItemView from './components/ItemView.vue' +import UserView from './components/UserView.vue' -var Vue = require('vue') -var Router = require('director').Router -var app = new Vue(require('./app.vue')) -var router = new Router() +// install router +Vue.use(Router) -router.on('/news/:page', function (page) { - window.scrollTo(0, 0) - app.view = 'news-view' - app.params.page = +page -}) +// register filters globally +Vue.filter('fromNow', fromNow) +Vue.filter('domain', domain) -router.on('/user/:id', function (id) { - window.scrollTo(0, 0) - app.view = 'user-view' - app.params.userId = id +// routing +var router = new Router() + +router.map({ + '/news/:page': { + component: NewsView + }, + '/user/:id': { + component: UserView + }, + '/item/:id': { + component: ItemView + } }) -router.on('/item/:id', function (id) { +router.beforeEach(function () { window.scrollTo(0, 0) - app.view = 'item-view' - app.params.itemId = id }) -router.configure({ - notfound: function () { - router.setRoute('/news/1') - } +router.redirect({ + '*': '/news/1' }) -router.init('/news/1') \ No newline at end of file +router.start(App, '#app') diff --git a/src/store.js b/src/store.js deleted file mode 100644 index 95f68f4..0000000 --- a/src/store.js +++ /dev/null @@ -1,77 +0,0 @@ -var Firebase = require('firebase') -var api = new Firebase('https://hacker-news.firebaseio.com/v0') -var storiesPerPage = 30 -var cachedStoryIds = [] -var Emitter = require('events').EventEmitter -var store = module.exports = new Emitter() - -/** - * Subscribe to real time updates of the top 100 stories, - * and cache the IDs locally. - */ - -api.child('topstories').on('value', function (snapshot) { - cachedStoryIds = snapshot.val() - store.emit('update') -}) - -/** - * Fetch an item data with given id. - * - * @param {Number} id - * @param {Function} cb(item) - */ - -store.fetchItem = function (id, cb) { - api.child('item/' + id).once('value', function (snapshot) { - cb(snapshot.val()) - }) -} - -/** - * Fetch a user data with given id. - * - * @param {Number} id - * @param {Function} cb(user) - */ - -store.fetchUser = function (id, cb) { - api.child('user/' + id).once('value', function (snapshot) { - cb(snapshot.val()) - }) -} - -/** - * Fetch the given list of items. - * - * @param {Array} ids - * @param {Function} cb(items) - */ - -store.fetchItems = function (ids, cb) { - if (!ids || !ids.length) return cb([]) - var items = [] - ids.forEach(function (id) { - store.fetchItem(id, addItem) - }) - function addItem (item) { - items.push(item) - if (items.length >= ids.length) { - cb(items) - } - } -} - -/** - * Fetch items for the given page. - * - * @param {Number} page - * @param {Function} cb(stories) - */ - -store.fetchItemsByPage = function (page, cb) { - var start = (page - 1) * storiesPerPage - var end = page * storiesPerPage - var ids = cachedStoryIds.slice(start, end) - store.fetchItems(ids, cb) -} \ No newline at end of file diff --git a/src/store/index.js b/src/store/index.js new file mode 100644 index 0000000..34360a1 --- /dev/null +++ b/src/store/index.js @@ -0,0 +1,92 @@ +import Firebase from 'firebase/app' +import Database from 'firebase/database' +import { EventEmitter } from 'events' +import { Promise } from 'es6-promise' + +const config = { + databaseURL: 'https://hacker-news.firebaseio.com' +} +Firebase.initializeApp(config) +const version = '/v0' +const api = Firebase.database().ref(version) +const itemsCache = Object.create(null) +const store = new EventEmitter() +const storiesPerPage = store.storiesPerPage = 30 + +let topStoryIds = [] + +export default store + +/** + * Subscribe to real time updates of the top 100 stories, + * and cache the IDs locally. + */ + +api.child('topstories').on('value', snapshot => { + topStoryIds = snapshot.val() + store.emit('topstories-updated') +}) + +/** + * Fetch an item data with given id. + * + * @param {Number} id + * @return {Promise} + */ + +store.fetchItem = id => { + return new Promise((resolve, reject) => { + if (itemsCache[id]) { + resolve(itemsCache[id]) + } else { + api.child('item/' + id).once('value', snapshot => { + const story = itemsCache[id] = snapshot.val() + resolve(story) + }, reject) + } + }) +} + +/** + * Fetch the given list of items. + * + * @param {Array} ids + * @return {Promise} + */ + +store.fetchItems = ids => { + if (!ids || !ids.length) { + return Promise.resolve([]) + } else { + return Promise.all(ids.map(id => store.fetchItem(id))) + } +} + +/** + * Fetch items for the given page. + * + * @param {Number} page + * @return {Promise} + */ + +store.fetchItemsByPage = page => { + const start = (page - 1) * storiesPerPage + const end = page * storiesPerPage + const ids = topStoryIds.slice(start, end) + return store.fetchItems(ids) +} + +/** + * Fetch a user data with given id. + * + * @param {Number} id + * @return {Promise} + */ + +store.fetchUser = id => { + return new Promise((resolve, reject) => { + api.child('user/' + id).once('value', snapshot => { + resolve(snapshot.val()) + }, reject) + }) +} diff --git a/src/shared.styl b/src/variables.styl similarity index 100% rename from src/shared.styl rename to src/variables.styl diff --git a/src/views/item-view.vue b/src/views/item-view.vue deleted file mode 100644 index ff23894..0000000 --- a/src/views/item-view.vue +++ /dev/null @@ -1,84 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/views/news-view.vue b/src/views/news-view.vue deleted file mode 100644 index 2417209..0000000 --- a/src/views/news-view.vue +++ /dev/null @@ -1,70 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/views/user-view.vue b/src/views/user-view.vue deleted file mode 100644 index f6dad1f..0000000 --- a/src/views/user-view.vue +++ /dev/null @@ -1,60 +0,0 @@ - - - - - diff --git a/static/build.js b/static/build.js new file mode 100644 index 0000000..1072695 --- /dev/null +++ b/static/build.js @@ -0,0 +1,52 @@ +!function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={exports:{},id:i,loaded:!1};return t[i].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var n={};return e.m=t,e.c=n,e.p="/static/",e(0)}([function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}var r=n(75),o=i(r),s=n(68),a=i(s),u=n(23),c=n(63),h=i(c),l=n(66),f=i(l),p=n(65),d=i(p),v=n(67),g=i(v);o.default.use(a.default),o.default.filter("fromNow",u.fromNow),o.default.filter("domain",u.domain);var b=new a.default;b.map({"/news/:page":{component:f.default},"/user/:id":{component:g.default},"/item/:id":{component:d.default}}),b.beforeEach(function(){window.scrollTo(0,0)}),b.redirect({"*":"/news/1"}),b.start(h.default,"#app")},function(t,e){t.exports=function(){var t=[];return t.toString=function(){for(var t=[],e=0;e=0&&b.splice(e,1)}function a(t){var e=document.createElement("style");return e.type="text/css",o(t,e),e}function u(t,e){var n,i,r;if(e.singleton){var o=g++;n=v||(v=a(e)),i=c.bind(null,n,o,!1),r=c.bind(null,n,o,!0)}else n=a(e),i=h.bind(null,n),r=function(){s(n)};return i(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;i(t=e)}else r()}}function c(t,e,n,i){var r=n?"":i.css;if(t.styleSheet)t.styleSheet.cssText=m(e,r);else{var o=document.createTextNode(r),s=t.childNodes;s[e]&&t.removeChild(s[e]),s.length?t.insertBefore(o,s[e]):t.appendChild(o)}}function h(t,e){var n=e.css,i=e.media,r=e.sourceMap;if(i&&t.setAttribute("media",i),r&&(n+="\n/*# sourceURL="+r.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */"),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}var l={},f=function(t){var e;return function(){return"undefined"==typeof e&&(e=t.apply(this,arguments)),e}},p=f(function(){return/msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase())}),d=f(function(){return document.head||document.getElementsByTagName("head")[0]}),v=null,g=0,b=[];t.exports=function(t,e){e=e||{},"undefined"==typeof e.singleton&&(e.singleton=p()),"undefined"==typeof e.insertAt&&(e.insertAt="bottom");var n=r(t);return i(n,e),function(t){for(var o=[],s=0;s0?i:n)(t)}},function(t,e,n){var i=n(36),r=n(30);t.exports=function(t){return i(r(t))}},function(t,e){(function(e){/*! @license Firebase v3.6.0 + Build: 3.6.0-rc.3 + Terms: https://developers.google.com/terms */ +var n=null;!function(){function t(t,e){function n(){this.constructor=t}for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function i(t,e,n,i){var r,o=arguments.length,s=3>o?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if(r=f.Reflect,"object"==typeof r&&"function"==typeof r.decorate)s=r.decorate(t,e,n,i);else for(var a=t.length-1;0<=a;a--)(r=t[a])&&(s=(3>o?r(s):3"}),n=this.W+": "+n+" ("+t+").",n=new _t(t,n);for(i in e)e.hasOwnProperty(i)&&"_"!==i.slice(-1)&&(n[i]=e[i]);return n};var kt=vt,Ct=function(t,e,n){var i=this;this.I=n,this.J=!1,this.i={},this.C=e,this.F=o(void 0,t),t="serviceAccount"in this.F,("credential"in this.F||t)&&"undefined"!=typeof console&&console.log("The '"+(t?"serviceAccount":"credential")+"' property specified in the first argument to initializeApp() is deprecated and will be removed in the next major version. You should instead use the 'firebase-admin' package. See https://firebase.google.com/docs/admin/setup for details on how to get started."),Object.keys(n.INTERNAL.factories).forEach(function(t){var e=n.INTERNAL.useAsService(i,t);null!==e&&(e=i.S.bind(i,e),i[t]=e)})};Ct.prototype.delete=function(){var t=this;return new kt(function(e){At(t),e()}).then(function(){return t.I.INTERNAL.removeApp(t.C),kt.all(Object.keys(t.i).map(function(e){return t.i[e].INTERNAL.delete()}))}).then(function(){t.J=!0,t.i={}})},Ct.prototype.S=function(t){return At(this),void 0===this.i[t]&&(this.i[t]=this.I.INTERNAL.factories[t](this,this.R.bind(this))),this.i[t]},Ct.prototype.R=function(t){o(this,t)};var At=function(t){t.J&&h(l("deleted",{name:t.C}))};d.Object.defineProperties(Ct.prototype,{name:{configurable:!0,enumerable:!0,get:function(){return At(this),this.C}},options:{configurable:!0,enumerable:!0,get:function(){return At(this),this.F}}}),Ct.prototype.name&&Ct.prototype.options||Ct.prototype.delete||console.log("dc"),"undefined"!=typeof n&&(n=c())}(),n.SDK_VERSION="3.6.0",t.exports=n}).call(e,function(){return this}())},function(t,e,n){var i,r,o={};n(71),i=n(19),r=n(59),t.exports=i||{},t.exports.__esModule&&(t.exports=t.exports.default);var s="function"==typeof t.exports?t.exports.options||(t.exports.options={}):t.exports;r&&(s.template=r),s.computed||(s.computed={}),Object.keys(o).forEach(function(t){var e=o[t];s.computed[t]=function(){return e}})},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=n(3),o=i(r);e.default={name:"Comment",props:{comment:Object},data:function(){return{childComments:[],open:!0}},created:function(){var t=this;this.comment.kids&&o.default.fetchItems(this.comment.kids).then(function(e){t.childComments=e})}}},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={name:"Item",props:{item:Object,index:Number},computed:{href:function(){return this.item.url||"#/item/"+this.item.id},showInfo:function(){return"story"===this.item.type||"poll"===this.item.type},showDomain:function(){return"story"===this.item.type}}}},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=n(3),o=i(r),s=n(17),a=i(s),u=n(64),c=i(u);e.default={name:"ItemView",components:{Item:a.default,Comment:c.default},data:function(){return{item:{},comments:[],pollOptions:null}},route:{data:function(t){var e=t.to;return o.default.fetchItem(e.params.id).then(function(t){return document.title=t.title+" | Vue.js HN Clone",{item:t,comments:o.default.fetchItems(t.kids),pollOptions:"poll"===t.type?o.default.fetchItems(t.parts):null}})}},computed:{isJob:function(){return"job"===this.item.type},hasText:function(){return this.item.hasOwnProperty("text")}}}},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=n(3),o=i(r),s=n(17),a=i(s);e.default={name:"NewsView",components:{Item:a.default},data:function(){return{page:1,items:[]}},route:{data:function(t){var e=t.to,n=+e.params.page;return document.title="Vue.js HN Clone",o.default.fetchItemsByPage(n).then(function(t){return{page:n,items:t}})}},created:function(){o.default.on("topstories-updated",this.update)},destroyed:function(){o.default.removeListener("topstories-updated",this.update)},methods:{update:function(){var t=this;o.default.fetchItemsByPage(this.page).then(function(e){t.items=e})}},filters:{formatItemIndex:function(t){return(this.page-1)*o.default.storiesPerPage+t+1}}}},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=n(3),o=i(r);e.default={name:"UserView",data:function(){return{user:{}}},route:{data:function(t){var e=t.to;return document.title="Profile: "+e.params.id+" | Vue.js HN Clone",{user:o.default.fetchUser(e.params.id)}}}}},function(t,e){"use strict";function n(t){return o.href=t,o.hostname}function i(t){var e=Date.now()/1e3-Number(t);return e<3600?r(~~(e/60)," minute"):e<86400?r(~~(e/3600)," hour"):r(~~(e/86400)," day")}function r(t,e){return 1===t?t+e:t+e+"s"}Object.defineProperty(e,"__esModule",{value:!0}),e.domain=n,e.fromNow=i;var o=document.createElement("a")},function(t,e,n){t.exports={default:n(25),__esModule:!0}},function(t,e,n){n(47);var i=n(8).Object;t.exports=function(t,e){return i.create(t,e)}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){var i=n(15),r=n(44),o=n(43);t.exports=function(t){return function(e,n,s){var a,u=i(e),c=r(u.length),h=o(s,c);if(t&&n!=n){for(;c>h;)if(a=u[h++],a!=a)return!0}else for(;c>h;h++)if((t||h in u)&&u[h]===n)return t||h||0;return!t&&-1}}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){var i=n(26);t.exports=function(t,e,n){if(i(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,i){return t.call(e,n,i)};case 3:return function(n,i,r){return t.call(e,n,i,r)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){var i=n(5),r=n(8),o=n(29),s=n(33),a="prototype",u=function(t,e,n){var c,h,l,f=t&u.F,p=t&u.G,d=t&u.S,v=t&u.P,g=t&u.B,b=t&u.W,m=p?r:r[e]||(r[e]={}),y=m[a],w=p?i:d?i[e]:(i[e]||{})[a];p&&(n=e);for(c in n)h=!f&&w&&void 0!==w[c],h&&c in m||(l=h?w[c]:n[c],m[c]=p&&"function"!=typeof w[c]?n[c]:g&&h?o(l,i):b&&w[c]==l?function(t){var e=function(e,n,i){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,i)}return t.apply(this,arguments)};return e[a]=t[a],e}(l):v&&"function"==typeof l?o(Function.call,l):l,v&&((m.virtual||(m.virtual={}))[c]=l,t&u.R&&y&&!y[c]&&s(y,c,l)))};u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var i=n(12),r=n(41);t.exports=n(4)?function(t,e,n){return i.f(t,e,r(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){t.exports=n(5).document&&document.documentElement},function(t,e,n){t.exports=!n(4)&&!n(11)(function(){return 7!=Object.defineProperty(n(9)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){var i=n(28);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==i(t)?t.split(""):Object(t)}},function(t,e,n){var i=n(6),r=n(38),o=n(10),s=n(13)("IE_PROTO"),a=function(){},u="prototype",c=function(){var t,e=n(9)("iframe"),i=o.length,r="<",s=">";for(e.style.display="none",n(34).appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write(r+"script"+s+"document.F=Object"+r+"/script"+s),t.close(),c=t.F;i--;)delete c[u][o[i]];return c()};t.exports=Object.create||function(t,e){var n;return null!==t?(a[u]=i(t),n=new a,a[u]=null,n[s]=t):n=c(),void 0===e?n:r(n,e)}},function(t,e,n){var i=n(12),r=n(6),o=n(40);t.exports=n(4)?Object.defineProperties:function(t,e){r(t);for(var n,s=o(e),a=s.length,u=0;a>u;)i.f(t,n=s[u++],e[n]);return t}},function(t,e,n){var i=n(32),r=n(15),o=n(27)(!1),s=n(13)("IE_PROTO");t.exports=function(t,e){var n,a=r(t),u=0,c=[];for(n in a)n!=s&&i(a,n)&&c.push(n);for(;e.length>u;)i(a,n=e[u++])&&(~o(c,n)||c.push(n));return c}},function(t,e,n){var i=n(39),r=n(10);t.exports=Object.keys||function(t){return i(t,r)}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){var i=n(5),r="__core-js_shared__",o=i[r]||(i[r]={});t.exports=function(t){return o[t]||(o[t]={})}},function(t,e,n){var i=n(14),r=Math.max,o=Math.min;t.exports=function(t,e){return t=i(t),t<0?r(t+e,0):o(t,e)}},function(t,e,n){var i=n(14),r=Math.min;t.exports=function(t){return t>0?r(i(t),9007199254740991):0}},function(t,e,n){var i=n(7);t.exports=function(t,e){if(!i(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!i(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!i(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!i(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")}},function(t,e){var n=0,i=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+i).toString(36))}},function(t,e,n){var i=n(31);i(i.S,"Object",{create:n(37)})},function(t,e,n){e=t.exports=n(1)(),e.push([t.id,"body,html{font-family:Verdana;font-size:13px;height:100%}ul{list-style-type:none;padding:0;margin:0}a{color:#000;cursor:pointer;text-decoration:none}#wrapper{background-color:#f6f6ef;width:85%;min-height:80px;margin:0 auto}#header,#wrapper{position:relative}#header{background-color:#f60;height:24px}#header h1{font-weight:700;font-size:13px;display:inline-block;vertical-align:middle;margin:0}#header .source{color:#fff;font-size:11px;position:absolute;top:4px;right:4px}#header .source a{color:#fff}#header .source a:hover{text-decoration:underline}#yc{border:1px solid #fff;margin:2px;display:inline-block}#yc,#yc img{vertical-align:middle}.view{position:absolute;background-color:#f6f6ef;width:100%;-webkit-transition:opacity .2s ease;transition:opacity .2s ease;box-sizing:border-box;padding:8px 20px}.view.v-enter,.view.v-leave{opacity:0}@media screen and (max-width:700px){body,html{margin:0}#wrapper{width:100%}}",""])},function(t,e,n){e=t.exports=n(1)(),e.push([t.id,".comhead{font-size:11px;margin-bottom:8px}.comhead,.comhead a{color:#828282}.comhead a:hover{text-decoration:underline}.comhead .toggle{margin-right:4px}.comment-content{margin:0 0 16px 24px;word-wrap:break-word}.comment-content code{white-space:pre-wrap}.child-comments{margin:8px 0 8px 22px}",""])},function(t,e,n){e=t.exports=n(1)(),e.push([t.id,".item{padding:2px 0 2px 40px;position:relative;-webkit-transition:background-color .2s ease;transition:background-color .2s ease}.item p{margin:2px 0}.item .index,.item .title:visited{color:#828282}.item .index{position:absolute;width:30px;text-align:right;left:0;top:4px}.item .domain,.item .subtext{font-size:11px;color:#828282}.item .domain a,.item .subtext a{color:#828282}.item .subtext a:hover{text-decoration:underline}",""])},function(t,e,n){e=t.exports=n(1)(),e.push([t.id,".item-view .item{padding-left:0;margin-bottom:30px}.item-view .item .index{display:none}.item-view .poll-options{margin-left:30px;margin-bottom:40px}.item-view .poll-options li{margin:12px 0}.item-view .poll-options p{margin:8px 0}.item-view .poll-options .subtext{color:#828282;font-size:11px}.item-view .itemtext{color:#828282;margin-top:0;margin-bottom:30px}.item-view .itemtext p{margin:10px 0}",""])},function(t,e,n){e=t.exports=n(1)(),e.push([t.id,'.news-view{padding-left:5px;padding-right:15px}.news-view.loading:before{content:"Loading...";position:absolute;top:16px;left:20px}.news-view .nav{padding:10px 10px 10px 40px;margin-top:10px;border-top:2px solid #f60}.news-view .nav a{margin-right:10px}.news-view .nav a:hover{text-decoration:underline}',""])},function(t,e,n){e=t.exports=n(1)(),e.push([t.id,".user-view{color:#828282}.user-view li{margin:5px 0}.user-view .label{display:inline-block;min-width:60px}.user-view .about{margin-top:1em}.user-view .links a{text-decoration:underline}",""])},function(t,e){/*! + * @overview es6-promise - a tiny implementation of Promises/A+. + * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) + * @license Licensed under MIT license + * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE + * @version 3.3.1 + */ +!function(n,i){"object"==typeof e&&"undefined"!=typeof t?t.exports=i():"function"==typeof define&&define.amd?define(i):n.ES6Promise=i()}(this,function(){"use strict";function t(t){return"function"==typeof t||"object"==typeof t&&null!==t}function e(t){return"function"==typeof t}function n(t){Q=t}function i(t){G=t}function r(){return function(){return process.nextTick(c)}}function o(){return function(){q(c)}}function s(){var t=0,e=new z(c),n=document.createTextNode("");return e.observe(n,{characterData:!0}),function(){n.data=t=++t%2}}function a(){var t=new MessageChannel;return t.port1.onmessage=c,function(){return t.port2.postMessage(0)}}function u(){var t=setTimeout;return function(){return t(c,1)}}function c(){for(var t=0;t0&&this._events[t].length>r&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace())),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function n(){this.removeListener(t,n),r||(r=!0,e.apply(this,arguments))}if(!i(e))throw TypeError("listener must be a function");var r=!1;return n.listener=e,this.on(t,n),this},n.prototype.removeListener=function(t,e){var n,r,s,a;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(n=this._events[t],s=n.length,r=-1,n===e||i(n.listener)&&n.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(o(n)){for(a=s;a-- >0;)if(n[a]===e||n[a].listener&&n[a].listener===e){r=a;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[t]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[t],i(n))this.removeListener(t,n);else if(n)for(;n.length;)this.removeListener(t,n[n.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){var e;return e=this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(i(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},function(module,exports,__webpack_require__){var firebase=__webpack_require__(16);/*! @license Firebase v3.6.0 + Build: 3.6.0-rc.3 + Terms: https://developers.google.com/terms + + --- + + typedarray.js + Copyright (c) 2010, Linden Research, Inc. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. */ +!function(){function n(t){return void 0!==t}function ba(){}function ca(t){t.Vb=function(){return t.Ye?t.Ye:t.Ye=new t}}function da(t){var e=typeof t;if("object"==e){if(!t)return"null";if(t instanceof Array)return"array";if(t instanceof Object)return e;var n=Object.prototype.toString.call(t);if("[object Window]"==n)return"object";if("[object Array]"==n||"number"==typeof t.length&&"undefined"!=typeof t.splice&&"undefined"!=typeof t.propertyIsEnumerable&&!t.propertyIsEnumerable("splice"))return"array";if("[object Function]"==n||"undefined"!=typeof t.call&&"undefined"!=typeof t.propertyIsEnumerable&&!t.propertyIsEnumerable("call"))return"function"}else if("function"==e&&"undefined"==typeof t.call)return"object";return e}function ea(t){return"array"==da(t)}function fa(t){var e=da(t);return"array"==e||"object"==e&&"number"==typeof t.length}function p(t){return"string"==typeof t}function ga(t){return"number"==typeof t}function ha(t){return"function"==da(t)}function ia(t){var e=typeof t;return"object"==e&&null!=t||"function"==e}function ja(t,e,n){return t.call.apply(t.bind,arguments)}function ka(t,e,n){if(!t)throw Error();if(2r;r++)i[r]=e.charCodeAt(n)<<24|e.charCodeAt(n+1)<<16|e.charCodeAt(n+2)<<8|e.charCodeAt(n+3),n+=4;else for(r=0;16>r;r++)i[r]=e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3],n+=4;for(r=16;80>r;r++){var o=i[r-3]^i[r-8]^i[r-14]^i[r-16];i[r]=4294967295&(o<<1|o>>>31)}e=t.M[0],n=t.M[1];for(var s,a=t.M[2],u=t.M[3],c=t.M[4],r=0;80>r;r++)40>r?20>r?(o=u^n&(a^u),s=1518500249):(o=n^a^u,s=1859775393):60>r?(o=n&a|u&(n|a),s=2400959708):(o=n^a^u,s=3395469782),o=(e<<5|e>>>27)+o+c+s+i[r]&4294967295,c=u,u=a,a=4294967295&(n<<30|n>>>2),n=e,e=o;t.M[0]=t.M[0]+e&4294967295,t.M[1]=t.M[1]+n&4294967295,t.M[2]=t.M[2]+a&4294967295,t.M[3]=t.M[3]+u&4294967295,t.M[4]=t.M[4]+c&4294967295}function r(t,e){for(var n in t)e.call(void 0,t[n],n,t)}function pa(t,e){var n,i={};for(n in t)i[n]=e.call(void 0,t[n],n,t);return i}function qa(t,e){for(var n in t)if(!e.call(void 0,t[n],n,t))return!1;return!0}function ra(t){var e,n=0;for(e in t)n++;return n}function sa(t){for(var e in t)return e}function ta(t){var e,n=[],i=0;for(e in t)n[i++]=t[e];return n}function ua(t){var e,n=[],i=0;for(e in t)n[i++]=e;return n}function va(t,e){for(var n in t)if(t[n]==e)return!0;return!1}function wa(t,e,n){for(var i in t)if(e.call(n,t[i],i,t))return i}function xa(t,e){var n=wa(t,e,void 0);return n&&t[n]}function ya(t){for(var e in t)return!1;return!0}function za(t){var e,n={};for(e in t)n[e]=t[e];return n}function Aa(a){if(a=String(a),/^\s*$/.test(a)?0:/^[\],:{}\s\u2028\u2029]*$/.test(a.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r\u2028\u2029\x00-\x08\x0a-\x1f]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:[\s\u2028\u2029]*\[)+/g,"")))try{return eval("("+a+")")}catch(t){}throw Error("Invalid JSON string: "+a)}function Ba(){this.Dd=void 0}function Ca(t,e,n){switch(typeof e){case"string":Da(e,n);break;case"number":n.push(isFinite(e)&&!isNaN(e)?e:"null");break;case"boolean":n.push(e);break;case"undefined":n.push("null");break;case"object":if(null==e){n.push("null");break}if(ea(e)){var i=e.length;n.push("[");for(var r="",o=0;oe?n+="000":256>e?n+="00":4096>e&&(n+="0"),Ea[t]=n+e.toString(16)}),'"')}function Oa(t,e){var n=Pa(t,e,void 0);return 0>n?null:p(t)?t.charAt(n):t[n]}function Pa(t,e,n){for(var i=t.length,r=p(t)?t.split(""):t,o=0;o=arguments.length?v.slice.call(t,e):v.slice.call(t,e,n)}function Sa(t,e){t.sort(e||Ta)}function Ta(t,e){return t>e?1:t>2,o=(3&o)<<4|a>>4,a=(15&a)<<2|c>>6,c=63&c;u||(c=64,s||(a=64)),i.push(n[h],n[o],n[a],n[c])}return i.join("")}function bb(){if(!Ya){Ya={},Za={},$a={};for(var t=0;65>t;t++)Ya[t]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(t),Za[t]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.".charAt(t),$a[Za[t]]=t,62<=t&&($a["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(t)]=t)}}function cb(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function w(t,e){if(Object.prototype.hasOwnProperty.call(t,e))return t[e]}function db(t,e){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e(n,t[n])}function x(t,e,n,i){var r;if(in&&(r=0===n?"none":"no more than "+n),r)throw Error(t+" failed: Was called with "+i+(1===i?" argument.":" arguments.")+" Expects "+r+".")}function y(t,e,n){var i="";switch(e){case 1:i=n?"first":"First";break;case 2:i=n?"second":"Second";break;case 3:i=n?"third":"Third";break;case 4:i=n?"fourth":"Fourth";break;default:throw Error("errorPrefix called with argumentNumber > 4. Need to update it?")}return t=t+" failed: "+(i+" argument ")}function A(t,e,i,r){if((!r||n(i))&&!ha(i))throw Error(y(t,e,r)+"must be a valid function.")}function eb(t,e,i){if(n(i)&&(!ia(i)||null===i))throw Error(y(t,e,!0)+"must be a valid context object.")}function fb(t){var e=[];return db(t,function(t,n){ea(n)?Ja(n,function(n){e.push(encodeURIComponent(t)+"="+encodeURIComponent(n))}):e.push(encodeURIComponent(t)+"="+encodeURIComponent(n))}),e.length?"&"+e.join("&"):""}function hb(){var t=this;this.reject=this.resolve=null,this.ra=new gb(function(e,n){t.resolve=e,t.reject=n})}function ib(t,e){return function(n,i){n?t.reject(n):t.resolve(i),ha(e)&&(jb(t.ra),1===e.length?e(n):e(n,i))}}function jb(t){t.then(void 0,ba)}function kb(t,e){if(!t)throw lb(e)}function lb(t){return Error("Firebase Database ("+firebase.SDK_VERSION+") INTERNAL ASSERT FAILED: "+t)}function mb(t){for(var e=[],n=0,i=0;i=r&&(r-=55296,i++,kb(ir?e[n++]=r:(2048>r?e[n++]=r>>6|192:(65536>r?e[n++]=r>>12|224:(e[n++]=r>>18|240,e[n++]=r>>12&63|128),e[n++]=r>>6&63|128),e[n++]=63&r|128)}return e}function nb(t){for(var e=0,n=0;ni?e++:2048>i?e+=2:55296<=i&&56319>=i?(e+=4,n++):e+=3}return e}function ob(t){return"undefined"!=typeof JSON&&n(JSON.parse)?JSON.parse(t):Aa(t)}function B(t){if("undefined"!=typeof JSON&&n(JSON.stringify))t=JSON.stringify(t);else{var e=[];Ca(new Ba,t,e),t=e.join("")}return t}function pb(t,e){this.committed=t,this.snapshot=e}function qb(){return"undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test("undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:"")}function rb(t){this.qe=t,this.zd=[],this.Qb=0,this.Wd=-1,this.Fb=null}function sb(t,e,n){t.Wd=e,t.Fb=n,t.Wd>4),64!=a&&(i.push(s<<4&240|a>>2),64!=u&&i.push(a<<6&192|u))}if(8192>i.length)e=String.fromCharCode.apply(null,i);else{for(t="",n=0;nt.$b?t.update(t.xd,56-t.$b):t.update(t.xd,t.Wa-(t.$b-56));for(var i=t.Wa-1;56<=i;i--)t.Ud[i]=255&n,n/=256;for(oa(t,t.Ud),i=n=0;5>i;i++)for(var r=24;0<=r;r-=8)e[n]=t.M[i]>>r&255,++n;return ab(e)}function vc(t){for(var e="",n=0;n.firebaseio.com instead"),n&&"undefined"!=n||Ac("Cannot parse Firebase url. Please use https://.firebaseio.com"),i||"undefined"!=typeof window&&window.location&&window.location.protocol&&-1!==window.location.protocol.indexOf("https:")&&O("Insecure Firebase access from a secure page. Please use https in calls to new Firebase()."),{jc:new Hb(e,i,n,"ws"===r||"wss"===r),path:new L(o)}}function Cc(t){return ga(t)&&(t!=t||t==Number.POSITIVE_INFINITY||t==Number.NEGATIVE_INFINITY)}function Dc(t){if("complete"===document.readyState)t();else{var e=!1,n=function(){document.body?e||(e=!0,t()):setTimeout(n,Math.floor(10))};document.addEventListener?(document.addEventListener("DOMContentLoaded",n,!1),window.addEventListener("load",n,!1)):document.attachEvent&&(document.attachEvent("onreadystatechange",function(){"complete"===document.readyState&&n()}),window.attachEvent("onload",n))}}function hc(t,e){if(t===e)return 0;if("[MIN_NAME]"===t||"[MAX_NAME]"===e)return-1;if("[MIN_NAME]"===e||"[MAX_NAME]"===t)return 1;var n=Ec(t),i=Ec(e);return null!==n?null!==i?0==n-i?t.length-e.length:n-i:-1:null!==i?1:tt?n.push(t.substring(i,t.length)):n.push(t.substring(i,i+e));return n}function Ic(t,e){if(ea(t))for(var n=0;nt,t=Math.abs(t),t>=Math.pow(2,-1022)?(i=Math.min(Math.floor(Math.log(t)/Math.LN2),1023),n=i+1023,i=Math.round(t*Math.pow(2,52-i)-Math.pow(2,52))):(n=0,i=Math.round(t/Math.pow(2,-1074)))),r=[],t=52;t;--t)r.push(i%2?1:0),i=Math.floor(i/2);for(t=11;t;--t)r.push(n%2?1:0),n=Math.floor(n/2);for(r.push(e?1:0),r.reverse(),e=r.join(""),n="",t=0;64>t;t+=8)i=parseInt(e.substr(t,8),2).toString(16),1===i.length&&(i="0"+i),n+=i;return n.toLowerCase()}function Ec(t){return Kc.test(t)&&(t=Number(t),-2147483648<=t&&2147483647>=t)?t:null}function ub(t){try{t()}catch(t){setTimeout(function(){throw O("Exception was thrown by user callback.",t.stack||""),t},Math.floor(0))}}function Lc(t,e,n){Object.defineProperty(t,e,{get:n})}function Mc(t,e){var n=setTimeout(t,e);return"object"==typeof n&&n.unref&&n.unref(),n}function Nc(t){var e={},n={},i={},r="";try{var o=t.split("."),e=ob(tc(o[0])||""),n=ob(tc(o[1])||""),r=o[2],i=n.d||{};delete n.d}catch(t){}return{tg:e,Ie:n,data:i,mg:r}}function Oc(t){t=Nc(t);var e=t.Ie;return!!t.mg&&!!e&&"object"==typeof e&&e.hasOwnProperty("iat")}function Pc(t){return t=Nc(t).Ie,"object"==typeof t&&!0===w(t,"admin")}function Qc(t,e,n){this.f=yc("p:rest:"),this.L=t,this.Gb=e,this.Td=n,this.$={}}function Rc(t,e){return n(e)?"tag$"+e:(H(Sc(t.m),"should have a tag if it's not a default query."),t.path.toString())}function Uc(t,e,n,i){n=n||{},n.format="export",t.Td.getToken(!1).then(function(r){(r=r&&r.accessToken)&&(n.auth=r);var o=(t.L.Rc?"https://":"http://")+t.L.host+e+"?"+fb(n);t.f("Sending REST request for "+o);var s=new XMLHttpRequest;s.onreadystatechange=function(){if(i&&4===s.readyState){t.f("REST Response for "+o+" received. status:",s.status,"response:",s.responseText);var e=null;if(200<=s.status&&300>s.status){try{e=ob(s.responseText)}catch(t){O("Failed to parse JSON response for "+o+": "+s.responseText)}i(null,e)}else 401!==s.status&&404!==s.status&&O("Got unsuccessful REST response for "+o+" Status: "+s.status),i(s.status);i=null}},s.open("GET",o,!0),s.send()})}function Vc(t,e,n){this.type=Wc,this.source=t,this.path=e,this.children=n}function Xc(t,e){this.rf={},this.Uc=new Mb(t),this.va=e;var n=1e4+2e4*Math.random();Mc(q(this.lf,this),Math.floor(n))}function $c(t){return t=t.toString(),Yc[t]||(Yc[t]=new Kb),Yc[t]}function ad(t,e){var n=t.toString();return Zc[n]||(Zc[n]=e()),Zc[n]}function cd(t,e,n,i){this.Xd=t,this.f=yc(this.Xd),this.frames=this.yc=null,this.pb=this.qb=this.Ce=0,this.Va=$c(e),t={v:"5"},"undefined"!=typeof location&&location.href&&-1!==location.href.indexOf("firebaseio.com")&&(t.r="f"),n&&(t.s=n),i&&(t.ls=i),this.Je=Jb(e,"websocket",t)}function fd(t,e){if(t.frames.push(e),t.frames.length==t.Ce){var n=t.frames.join("");t.frames=null,n=ob(n),t.Xf(n)}}function ed(t){clearInterval(t.yc),t.yc=setInterval(function(){t.Ia&&gd(t,"0"),ed(t)},Math.floor(45e3))}function gd(t,e){try{t.Ia.send(e)}catch(e){t.f("Exception thrown from WebSocket.send():",e.message||e.data,"Closing connection."),setTimeout(q(t.bb,t),0)}}function hd(){this.fb={}}function jd(t,e){var n=e.type,i=e.Xa;H("child_added"==n||"child_changed"==n||"child_removed"==n,"Only child changes supported for tracking"),H(".priority"!==i,"Only non-priority child changes can be tracked.");var r=w(t.fb,i);if(r){var o=r.type;if("child_added"==n&&"child_removed"==o)t.fb[i]=new I("child_changed",e.Ja,i,r.Ja);else if("child_removed"==n&&"child_added"==o)delete t.fb[i];else if("child_removed"==n&&"child_changed"==o)t.fb[i]=new I("child_removed",r.ne,i);else if("child_changed"==n&&"child_added"==o)t.fb[i]=new I("child_added",e.Ja,i);else{if("child_changed"!=n||"child_changed"!=o)throw sc("Illegal combination of changes: "+e+" occurred after "+r);t.fb[i]=new I("child_changed",e.Ja,i,r.ne)}}else t.fb[i]=e}function kd(t){this.V=t,this.g=t.m.g}function ld(t,e,n,i){var r=[],o=[];return Ja(e,function(e){"child_changed"===e.type&&t.g.ld(e.ne,e.Ja)&&o.push(new I("child_moved",e.Ja,e.Xa))}),md(t,r,"child_removed",e,i,n),md(t,r,"child_added",e,i,n),md(t,r,"child_moved",o,i,n),md(t,r,"child_changed",e,i,n),md(t,r,cc,e,i,n),r}function md(t,e,n,i,r,o){i=Ka(i,function(t){return t.type===n}),Sa(i,q(t.Ff,t)),Ja(i,function(n){var i=nd(t,n,o);Ja(r,function(r){r.nf(n.type)&&e.push(r.createEvent(i,t.V))})})}function nd(t,e,n){return"value"!==e.type&&"child_removed"!==e.type&&(e.Bd=n.Ve(e.Xa,e.Ja,t.g)),e}function od(t,e){this.Qd=t,this.Df=e}function pd(t){this.U=t}function xd(t,e,n,i,r,o){var s=e.N;if(null!=i.lc(n))return e;var a;if(n.e())H(dc(e.w()),"If change path is empty, we must have complete server data"),ec(e.w())?(r=ac(e),i=i.qc(r instanceof P?r:G)):i=i.Aa(ac(e)),o=t.U.ya(e.N.j(),i,o);else{var u=J(n);if(".priority"==u)H(1==Ad(n),"Can't have a priority with additional path components"),o=s.j(),a=e.w().j(),i=i.Zc(n,o,a),o=null!=i?t.U.fa(o,i):s.j();else{var c=D(n);Zb(s,u)?(a=e.w().j(),i=i.Zc(n,s.j(),a),i=null!=i?s.j().Q(u).F(c,i):s.j().Q(u)):i=i.pc(u,e.w()),o=null!=i?t.U.F(s.j(),u,i,c,r,o):s.j()}}return vd(e,o,s.da||n.e(),t.U.Na())}function rd(t,e,n,i,r,o,s,a){var u=e.w();if(s=s?t.U:t.U.Ub(),n.e())i=s.ya(u.j(),i,null);else if(s.Na()&&!u.Sb)i=u.j().F(n,i),i=s.ya(u.j(),i,null);else{var c=J(n);if(!fc(u,n)&&1document.domain="'+document.domain+'";'),t=""+t+"";try{this.Ea.gb.open(),this.Ea.gb.write(t),this.Ea.gb.close()}catch(t){E("frame writing exception"),t.stack&&E(t.stack),E(t)}}function we(t){if(t.Sd&&t.Id&&t.se.count()<(0=t.Pc[0].Oe.length+30+n.length;){var r=t.Pc.shift(),n=n+"&seg"+i+"="+r.jg+"&ts"+i+"="+r.pg+"&d"+i+"="+r.Oe;i++}return xe(t,e+n,t.Yd),!0}return!1}function xe(t,e,n){function i(){t.se.remove(n),we(t)}t.se.add(n,1);var r=setTimeout(i,Math.floor(25e3));ve(t,e,function(){clearTimeout(r),i()})}function ve(t,e,n){setTimeout(function(){try{if(t.Id){var i=t.Ea.gb.createElement("script");i.type="text/javascript",i.async=!0,i.src=e,i.onload=i.onreadystatechange=function(){var t=i.readyState;t&&"loaded"!==t&&"complete"!==t||(i.onload=i.onreadystatechange=null,i.parentNode&&i.parentNode.removeChild(i),n())},i.onerror=function(){E("Long-poll script failed to load: "+e),t.Id=!1,t.close()},t.Ea.gb.body.appendChild(i)}}catch(t){}},Math.floor(1))}function ye(t){ze(this,t)}function ze(t,e){var n=cd&&cd.isAvailable(),i=n&&!(yb.Ze||!0===yb.get("previous_websocket_failure"));if(e.qg&&(n||O("wss:// URL used, but browser isn't known to support websockets. Trying anyway."),i=!0),i)t.Vc=[cd];else{var r=t.Vc=[];Ic(Ae,function(t,e){e&&e.isAvailable()&&r.push(e)})}}function Be(t){if(0=t.pf?(t.f("Secondary connection is healthy."),t.Bb=!0,t.D.qd(),t.D.start(),t.f("sending client ack on secondary"),t.D.send({t:"c",d:{t:"a",d:{}}}),t.f("Ending transmission on primary"),t.I.send({t:"c",d:{t:"n",d:{}}}),t.Wc=t.D,Ie(t)):(t.f("sending ping on secondary."),t.D.send({t:"c",d:{t:"p",d:{}}}))}function Ke(t){t.Bb||(t.ue--,0>=t.ue&&(t.f("Primary connection is healthy."),t.Bb=!0,t.I.qd()))}function He(t,e){t.D=new e("c:"+t.id+":"+t.Ke++,t.L,t.qf),t.pf=e.responsesRequiredToBeHealthy||0,t.D.open(Ee(t,t.D),Fe(t,t.D)),Mc(function(){t.D&&(t.f("Timed out trying to upgrade."),t.D.close())},Math.floor(6e4))}function Ge(t,e,n){t.f("Realtime connection established."),t.I=e,t.Ua=1,t.Kc&&(t.Kc(n,t.qf),t.Kc=null),0===t.ue?(t.f("Primary connection is healthy."),t.Bb=!0):Mc(function(){Le(t)},Math.floor(5e3))}function Le(t){t.Bb||1!==t.Ua||(t.f("sending ping on primary."),Ne(t,{t:"c",d:{t:"p",d:{}}}))}function Ne(t,e){if(1!==t.Ua)throw"Connection is not connected";t.Wc.send(e)}function Je(t){t.f("Shutting down all connections"),t.I&&(t.I.close(),t.I=null),t.D&&(t.D.close(),t.D=null),t.kd&&(clearTimeout(t.kd),t.kd=null)}function L(t,e){if(1==arguments.length){this.o=t.split("/");for(var n=0,i=0;i=t.o.length?null:t.o[t.Y]}function Ad(t){return t.o.length-t.Y}function D(t){var e=t.Y;return e10485760/3&&10485760n?i=i.left:0r)t=this.ie?t.left:t.right;else{if(0===r){this.Pa.push(t);break}this.Pa.push(t),t=this.ie?t.right:t.left}}function R(t){if(0===t.Pa.length)return null;var e,n=t.Pa.pop();if(e=t.Fd?t.Fd(n.key,n.value):{key:n.key,value:n.value},t.ie)for(n=n.left;!n.e();)t.Pa.push(n),n=n.right;else for(n=n.right;!n.e();)t.Pa.push(n),n=n.left;return e}function zf(t){if(0===t.Pa.length)return null;var e;return e=t.Pa,e=e[e.length-1],t.Fd?t.Fd(e.key,e.value):{key:e.key,value:e.value}}function Af(t,e,n,i,r){this.key=t,this.value=e,this.color=null==n||n,this.left=null!=i?i:wf,this.right=null!=r?r:wf}function Bf(t){return t.left.e()?t:Bf(t.left)}function Df(t){return t.left.e()?wf:(t.left.ea()||t.left.left.ea()||(t=Ef(t)),t=t.X(null,null,null,Df(t.left),null),Cf(t))}function Cf(t){return t.right.ea()&&!t.left.ea()&&(t=Hf(t)),t.left.ea()&&t.left.left.ea()&&(t=Ff(t)),t.left.ea()&&t.right.ea()&&(t=Gf(t)),t}function Ef(t){return t=Gf(t),t.right.left.ea()&&(t=t.X(null,null,null,null,Ff(t.right)),t=Hf(t),t=Gf(t)),t}function Hf(t){return t.right.X(null,null,t.color,t.X(null,null,!0,null,t.right.left),null)}function Ff(t){return t.left.X(null,null,t.color,null,t.X(null,null,!0,t.left.right,null))}function Gf(t){return t.X(null,null,!t.color,t.left.X(null,null,!t.left.color,null,null),t.right.X(null,null,!t.right.color,null,null))}function If(){}function P(t,e,n){this.k=t,(this.aa=e)&&Sd(this.aa),t.e()&&H(!this.aa||this.aa.e(),"An empty node cannot have a priority"),this.yb=n,this.Db=null}function Qd(t,e){var n;return n=(n=Kf(t,e))?(n=n.Fc())&&n.name:t.k.Fc(),n?new K(n,t.k.get(n)):null}function Rd(t,e){var n;return n=(n=Kf(t,e))?(n=n.ec())&&n.name:t.k.ec(),n?new K(n,t.k.get(n)):null}function Kf(t,e){return e===Fd?null:t.yb.get(e.toString())}function M(t,e){if(null===t)return G;var n=null;if("object"==typeof t&&".priority"in t?n=t[".priority"]:"undefined"!=typeof e&&(n=e),H(null===n||"string"==typeof n||"number"==typeof n||"object"==typeof n&&".sv"in n,"Invalid priority type found: "+typeof n),"object"==typeof t&&".value"in t&&null!==t[".value"]&&(t=t[".value"]),"object"!=typeof t||".sv"in t)return new qc(t,M(n));if(t instanceof Array){var i=G,o=t;return r(o,function(t,e){if(cb(o,e)&&"."!==e.substring(0,1)){var n=M(t);!n.J()&&n.e()||(i=i.T(e,n))}}),i.fa(M(n))}var s=[],a=!1,u=t;if(db(u,function(t){if("string"!=typeof t||"."!==t.substring(0,1)){var e=M(u[t]);e.e()||(a=a||!e.C().e(),s.push(new K(t,e)))}}),0==s.length)return G;var c=le(s,gc,function(t){return t.name},ic);if(a){var h=le(s,Pd(N));return new P(c,M(n),new je({".priority":h},{".priority":N}))}return new P(c,M(n),ne)}function Mf(t){this.count=parseInt(Math.log(t+1)/Lf,10),this.Ne=this.count-1,this.Cf=t+1&parseInt(Array(this.count+1).join("1"),2)}function Nf(t){var e=!(t.Cf&1<s.Ac,"Stacking an older write on top of newer ones"),n(a)||(a=!0),s.la.push({path:e,Ga:i,Yc:r,visible:a}),a&&(s.S=sg(s.S,e,i)),s.Ac=r,o?fh(t,new Ab(ng,e,i)):[]}function gh(t,e,n,i){var r=t.jb;return H(i>r.Ac,"Stacking an older merge on top of newer ones"),r.la.push({path:e,children:n,Yc:i,visible:!0}),r.S=tg(r.S,e,n),r.Ac=i,n=bg(n),fh(t,new Vc(ng,e,n))}function hh(t,e,n){n=n||!1;var i=Dg(t.jb,e);if(t.jb.Cd(e)){var r=Q;return null!=i.Ga?r=r.set(C,!0):db(i.children,function(t,e){r=r.set(new L(t),e)}),fh(t,new mg(i.path,r,n))}return[]}function ih(t,e,n){return n=bg(n),fh(t,new Vc(pg,e,n))}function jh(t,e,n,i){if(i=kh(t,i),null!=i){var r=lh(i);return i=r.path,r=r.Hb,e=T(i,e),n=new Ab(new og(!1,!0,r,!0),e,n),mh(t,i,n)}return[]}function nh(t,e,n,i){if(i=kh(t,i)){var r=lh(i);return i=r.path,r=r.Hb,e=T(i,e),n=bg(n),n=new Vc(new og(!1,!0,r,!0),e,n),mh(t,i,n)}return[]}function rh(t){return eg(t,function(t,e,n){if(e&&null!=zg(e))return[zg(e)];var i=[];return e&&(i=Ag(e)),r(n,function(t){i=i.concat(t)}),i})}function vh(t,e){for(var n=0;nn?Math.max(0,t.length+n):n,p(t))return p(e)&&1==e.length?t.indexOf(e,n):-1;for(;nparseFloat(n))?String(e):n)}();var Ya=null,Za=null,$a=null,gb=firebase.Promise;vb.prototype.set=function(t,e){null==e?delete this.oc[t]:this.oc[t]=e},vb.prototype.get=function(t){return cb(this.oc,t)?this.oc[t]:null},vb.prototype.remove=function(t){delete this.oc[t]},vb.prototype.Ze=!0,g=wb.prototype,g.set=function(t,e){null==e?this.tc.removeItem(this.Ad+t):this.tc.setItem(this.Ad+t,B(e))},g.get=function(t){return t=this.tc.getItem(this.Ad+t),null==t?null:ob(t)},g.remove=function(t){this.tc.removeItem(this.Ad+t)},g.Ze=!1,g.toString=function(){return this.tc.toString()};var yb=xb("localStorage"),zb=xb("sessionStorage");Ab.prototype.Lc=function(t){return this.path.e()?new Ab(this.source,C,this.Ga.Q(t)):new Ab(this.source,D(this.path),this.Ga)},Ab.prototype.toString=function(){return"Operation("+this.path+": "+this.source.toString()+" overwrite: "+this.Ga.toString()+")"},Cb.prototype.Lc=function(){return this.path.e()?new Cb(this.source,C):new Cb(this.source,D(this.path))},Cb.prototype.toString=function(){return"Operation("+this.path+": "+this.source.toString()+" listen_complete)"},Eb.prototype.getToken=function(t){return this.Ee.INTERNAL.getToken(t).then(null,function(t){return t&&"auth/token-not-initialized"===t.code?(E("Got auth/token-not-initialized error. Treating as null token."),null):Promise.reject(t)})},Gb.prototype.j=function(t){return this.Hd.P(t)},Gb.prototype.toString=function(){return this.Hd.toString()},Hb.prototype.toString=function(){var t=(this.Rc?"https://":"http://")+this.host;return this.gf&&(t+="<"+this.gf+">"),t},Kb.prototype.get=function(){return za(this.sc)},Mb.prototype.get=function(){var t=this.Ef.get(),e=za(t);if(this.pd)for(var n in this.pd)e[n]-=this.pd[n];return this.pd=t,e},Pb.prototype.add=function(t){this.gd.push(t)},Pb.prototype.Yb=function(){return this.qa},Ub.prototype.Yb=function(){var t=this.Kd.wb();return"value"===this.fd?t.path:t.getParent().path},Ub.prototype.de=function(){return this.fd},Ub.prototype.Tb=function(){return this.Zd.Tb(this)},Ub.prototype.toString=function(){return this.Yb().toString()+":"+this.fd+":"+B(this.Kd.Qe())},Vb.prototype.Yb=function(){return this.path},Vb.prototype.de=function(){return"cancel"},Vb.prototype.Tb=function(){return this.Zd.Tb(this)},Vb.prototype.toString=function(){return this.path.toString()+":cancel"},Wb.prototype.Te=function(){return null},Wb.prototype.ce=function(){return null};var Xb=new Wb;Yb.prototype.Te=function(t){var e=this.Ka.N;return Zb(e,t)?e.j().Q(t):(e=null!=this.wd?new $b(this.wd,!0,!1):this.Ka.w(),this.xf.pc(t,e))},Yb.prototype.ce=function(t,e,n){var i=null!=this.wd?this.wd:ac(this.Ka);return t=this.xf.Vd(i,e,1,n,t),0===t.length?null:t[0]};var cc="value";$b.prototype.j=function(){return this.A};var rc=function(){var t=1;return function(){return t++}}(),H=kb,sc=lb,Tb=null,wc=!0,Kc=/^-?\d{1,10}$/;g=Qc.prototype,g.$e=function(t,e,n,i){var r=t.path.toString();this.f("Listen called for "+r+" "+t.ja());var o=Rc(t,n),s={};this.$[o]=s,t=Tc(t.m);var a=this;Uc(this,r+".json",t,function(t,e){var u=e;404===t&&(t=u=null),null===t&&a.Gb(r,u,!1,n),w(a.$,o)===s&&i(t?401==t?"permission_denied":"rest_error:"+t:"ok",null)})},g.uf=function(t,e){var n=Rc(t,e);delete this.$[n]},g.kf=function(){},g.oe=function(){},g.cf=function(){},g.vd=function(){},g.put=function(){},g.af=function(){},g.ve=function(){},Vc.prototype.Lc=function(t){return this.path.e()?(t=this.children.subtree(new L(t)),t.e()?null:t.value?new Ab(this.source,C,t.value):new Vc(this.source,C,t)):(H(J(this.path)===t,"Can't get a merge for a child not on the path of the operation"),new Vc(this.source,D(this.path),this.children))},Vc.prototype.toString=function(){return"Operation("+this.path+": "+this.source.toString()+" merge: "+this.children.toString()+")"},Xc.prototype.lf=function(){var t,e=this.Uc.get(),n={},i=!1;for(t in e)0=t.length){var e=Number(t);if(!isNaN(e)){i.Ce=e,i.frames=[],t=null;break t}}i.Ce=1,i.frames=[]}null!==t&&fd(i,t)}},this.Ia.onerror=function(t){i.f("WebSocket error. Closing connection."),(t=t.message||t.data)&&i.f(t),i.bb()}},cd.prototype.start=function(){},cd.isAvailable=function(){var t=!1;if("undefined"!=typeof navigator&&navigator.userAgent){var e=navigator.userAgent.match(/Android ([0-9]{0,}\.[0-9]{0,})/);e&&1parseFloat(e[1])&&(t=!0)}return!t&&null!==bd&&!dd},cd.responsesRequiredToBeHealthy=2,cd.healthyTimeout=3e4,g=cd.prototype,g.qd=function(){yb.remove("previous_websocket_failure")},g.send=function(t){ed(this),t=B(t),this.qb+=t.length,Lb(this.Va,"bytes_sent",t.length),t=Hc(t,16384),1=this.g.compare(this.Tc,t)&&0>=this.g.compare(t,this.uc)},g.F=function(t,e,n,i,r,o){return this.matches(new K(e,n))||(n=G),this.ee.F(t,e,n,i,r,o)},g.ya=function(t,e,n){e.J()&&(e=G);var i=e.nb(this.g),i=i.fa(G),r=this;return e.O(N,function(t,e){r.matches(new K(t,e))||(i=i.T(t,G))}),this.ee.ya(t,i,n)},g.fa=function(t){return t},g.Na=function(){return!0},g.Ub=function(){return this.ee},g=Md.prototype,g.F=function(t,e,n,i,r,o){return this.sa.matches(new K(e,n))||(n=G),t.Q(e).Z(n)?t:t.Eb()=this.g.compare(this.sa.Tc,s):0>=this.g.compare(s,this.sa.uc)))break;i=i.T(s.name,s.R),r++}}else{i=e.nb(this.g),i=i.fa(G);var a,u,c;if(this.Ib){e=i.We(this.g),a=this.sa.uc,u=this.sa.Tc;var h=Pd(this.g);c=function(t,e){return h(e,t)}}else e=i.Wb(this.g),a=this.sa.Tc,u=this.sa.uc,c=Pd(this.g);for(var r=0,l=!1;0=c(a,s)&&(l=!0),(o=l&&r=c(s,u))?r++:i=i.T(s.name,G)}return this.sa.Ub().ya(t,i,n)},g.fa=function(t){return t},g.Na=function(){return!0},g.Ub=function(){return this.sa.Ub()};var Td=["object","boolean","number","string"];g=qc.prototype,g.J=function(){return!0},g.C=function(){return this.aa},g.fa=function(t){return new qc(this.B,t)},g.Q=function(t){return".priority"===t?this.aa:G},g.P=function(t){return t.e()?this:".priority"===J(t)?this.aa:G},g.Da=function(){return!1},g.Ve=function(){return null},g.T=function(t,e){return".priority"===t?this.fa(e):e.e()&&".priority"!==t?this:G.T(t,e).fa(this.aa)},g.F=function(t,e){var n=J(t);return null===n?e:e.e()&&".priority"!==n?this:(H(".priority"!==n||1===Ad(t),".priority must be the last token in a path"),this.T(n,G.F(D(t),e)))},g.e=function(){return!1},g.Eb=function(){return 0},g.O=function(){return!1},g.H=function(t){return t&&!this.C().e()?{".value":this.Ca(),".priority":this.C().H()}:this.Ca()},g.hash=function(){if(null===this.Db){var t="";this.aa.e()||(t+="priority:"+Ud(this.aa.H())+":");var e=typeof this.B,t=t+(e+":"),t="number"===e?t+Jc(this.B):t+this.B;this.Db=uc(t)}return this.Db},g.Ca=function(){return this.B},g.rc=function(t){if(t===G)return 1;if(t instanceof P)return-1;H(t.J(),"Unknown node type");var e=typeof t.B,n=typeof this.B,i=Ia(Td,e),r=Ia(Td,n);return H(0<=i,"Unknown leaf type: "+e),H(0<=r,"Unknown leaf type: "+n),i===r?"object"===n?0:this.B=this.o.length)return null;for(var t=[],e=this.Y;e=this.o.length},g.Z=function(t){if(Ad(this)!==Ad(t))return!1;for(var e=this.Y,n=t.Y;e<=this.o.length;e++,n++)if(this.o[e]!==t.o[n])return!1;return!0},g.contains=function(t){var e=this.Y,n=t.Y;if(Ad(this)>Ad(t))return!1;for(;eo;o++)e[o]=Math.floor(64*Math.random());for(o=0;12>o;o++)n+="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz".charAt(e[o]);return H(20===n.length,"nextPushId: Length should be 20."),n}}();g=vf.prototype,g.Oa=function(t,e){return new vf(this.La,this.ba.Oa(t,e,this.La).X(null,null,!1,null,null))},g.remove=function(t){return new vf(this.La,this.ba.remove(t,this.La).X(null,null,!1,null,null))},g.get=function(t){for(var e,n=this.ba;!n.e();){if(e=this.La(t,n.key),0===e)return n.value;0>e?n=n.left:0i?r.X(null,null,null,r.left.Oa(t,e,n),null):0===i?r.X(null,e,null,null,null):r.X(null,null,null,null,r.right.Oa(t,e,n)),Cf(r)},g.remove=function(t,e){var n,i;if(n=this,0>e(t,n.key))n.left.e()||n.left.ea()||n.left.left.ea()||(n=Ef(n)),n=n.X(null,null,null,n.left.remove(t,e),null);else{if(n.left.ea()&&(n=Ff(n)),n.right.e()||n.right.ea()||n.right.left.ea()||(n=Gf(n),n.left.left.ea()&&(n=Ff(n),n=Gf(n))),0===e(t,n.key)){if(n.right.e())return wf;i=Bf(n.right),n=n.X(i.key,i.value,null,null,Df(n.right))}n=n.X(null,null,null,null,n.right.remove(t,e))}return Cf(n)},g.ea=function(){return this.color},g=If.prototype,g.X=function(){return this},g.Oa=function(t,e){return new Af(t,e,null)},g.remove=function(){return this},g.count=function(){return 0},g.e=function(){return!0},g.ha=function(){return!1},g.Fc=function(){return null},g.ec=function(){return null},g.ea=function(){return!1};var wf=new If;g=P.prototype,g.J=function(){return!1},g.C=function(){return this.aa||G},g.fa=function(t){return this.k.e()?this:new P(this.k,t,this.yb)},g.Q=function(t){return".priority"===t?this.C():(t=this.k.get(t),null===t?G:t)},g.P=function(t){var e=J(t);return null===e?this:this.Q(e).P(D(t))},g.Da=function(t){return null!==this.k.get(t)},g.T=function(t,e){if(H(e,"We should always be passing snapshot nodes"),".priority"===t)return this.fa(e);var n,i,r=new K(t,e);return e.e()?(n=this.k.remove(t),r=me(this.yb,r,this.k)):(n=this.k.Oa(t,e),r=ke(this.yb,r,this.k)),i=n.e()?G:this.aa,new P(n,i,r)},g.F=function(t,e){var n=J(t);if(null===n)return e;H(".priority"!==J(t)||1===Ad(t),".priority must be the last token in a path");var i=this.Q(n).F(D(t),e);return this.T(n,i)},g.e=function(){return this.k.e()},g.Eb=function(){return this.k.count()};var Jf=/^(0|[1-9]\d*)$/;g=P.prototype,g.H=function(t){if(this.e())return null;var e={},n=0,i=0,r=!0;if(this.O(N,function(o,s){e[o]=s.H(t),n++,r&&Jf.test(o)?i=Math.max(i,Number(o)):r=!1}),!t&&r&&i<2*n){var o,s=[];for(o in e)s[o]=e[o];return s}return t&&!this.C().e()&&(e[".priority"]=this.C().H()),e},g.hash=function(){if(null===this.Db){var t="";this.C().e()||(t+="priority:"+Ud(this.C().H())+":"),this.O(N,function(e,n){var i=n.hash();""!==i&&(t+=":"+e+":"+i)}),this.Db=""===t?"":uc(t)}return this.Db},g.Ve=function(t,e,n){return(n=Kf(this,n))?(t=xf(n,new K(t,e)))?t.name:null:xf(this.k,t)},g.O=function(t,e){var n=Kf(this,t);return n?n.ha(function(t){return e(t.name,t.R)}):this.k.ha(e)},g.Wb=function(t){return this.Xb(t.Gc(),t)},g.Xb=function(t,e){var n=Kf(this,e);if(n)return n.Xb(t,function(t){return t});for(var n=this.k.Xb(t.name,jc),i=zf(n);null!=i&&0>e.compare(i,t);)R(n),i=zf(n);return n},g.We=function(t){return this.Zb(t.Ec(),t)},g.Zb=function(t,e){var n=Kf(this,e);if(n)return n.Zb(t,function(t){return t});for(var n=this.k.Zb(t.name,jc),i=zf(n);null!=i&&0=t)throw Error("Query.limitToFirst: First argument must be a positive integer.");if(this.m.xa)throw Error("Query.limitToFirst: Limit was already set (by another call to limit, limitToFirst, or limitToLast).");return new X(this.u,this.path,this.m.ke(t),this.Mc)},g.le=function(t){if(x("Query.limitToLast",1,1,arguments.length),!ga(t)||Math.floor(t)!==t||0>=t)throw Error("Query.limitToLast: First argument must be a positive integer.");if(this.m.xa)throw Error("Query.limitToLast: Limit was already set (by another call to limit, limitToFirst, or limitToLast).");return new X(this.u,this.path,this.m.le(t),this.Mc)},g.ag=function(t){if(x("Query.orderByChild",1,1,arguments.length),"$key"===t)throw Error('Query.orderByChild: "$key" is invalid. Use Query.orderByKey() instead.');if("$priority"===t)throw Error('Query.orderByChild: "$priority" is invalid. Use Query.orderByPriority() instead.');if("$value"===t)throw Error('Query.orderByChild: "$value" is invalid. Use Query.orderByValue() instead.');lf("Query.orderByChild",t),Xf(this,"Query.orderByChild");var e=new L(t);if(e.e())throw Error("Query.orderByChild: cannot pass in empty path. Use Query.orderByValue() instead.");return e=new Yd(e),e=he(this.m,e),Vf(e),new X(this.u,this.path,e,!0)},g.bg=function(){x("Query.orderByKey",0,0,arguments.length),Xf(this,"Query.orderByKey");var t=he(this.m,Fd);return Vf(t),new X(this.u,this.path,t,!0)},g.cg=function(){x("Query.orderByPriority",0,0,arguments.length),Xf(this,"Query.orderByPriority");var t=he(this.m,N);return Vf(t),new X(this.u,this.path,t,!0)},g.dg=function(){x("Query.orderByValue",0,0,arguments.length),Xf(this,"Query.orderByValue");var t=he(this.m,de);return Vf(t),new X(this.u,this.path,t,!0)},g.Ld=function(t,e){x("Query.startAt",0,2,arguments.length),df("Query.startAt",t,this.path,!0),kf("Query.startAt",e);var i=this.m.Ld(t,e);if(Wf(i),Vf(i),this.m.ka)throw Error("Query.startAt: Starting point was already set (by another call to startAt or equalTo).");return n(t)||(e=t=null),new X(this.u,this.path,i,this.Mc)},g.ed=function(t,e){x("Query.endAt",0,2,arguments.length),df("Query.endAt",t,this.path,!0),kf("Query.endAt",e);var n=this.m.ed(t,e);if(Wf(n),Vf(n),this.m.na)throw Error("Query.endAt: Ending point was already set (by another call to endAt or equalTo).");return new X(this.u,this.path,n,this.Mc)},g.If=function(t,e){if(x("Query.equalTo",1,2,arguments.length),df("Query.equalTo",t,this.path,!1),kf("Query.equalTo",e),this.m.ka)throw Error("Query.equalTo: Starting point was already set (by another call to endAt or equalTo).");if(this.m.na)throw Error("Query.equalTo: Ending point was already set (by another call to endAt or equalTo).");return this.Ld(t,e).ed(t,e)},g.toString=function(){x("Query.toString",0,0,arguments.length);for(var t=this.path,e="",n=t.Y;n=e&&Eg(a,n.path)?i=!1:n.path.contains(a.path)&&(o=!0)),s--}if(i){if(o)this.S=Fg(this.la,Gg,C),this.Ac=0 "},function(t,e){t.exports="
  • {{open ? '[-]' : '[+]'}} {{comment.by}} {{comment.time | fromNow}} ago

    {{{comment.text}}}

  • "},function(t,e){t.exports="
    {{index}}.

    {{{item.title}}} ({{item.url | domain}})

    {{item.score}} points by {{item.by}} {{item.time | fromNow}} ago | {{item.descendants}} {{item.descendants | pluralize 'comment'}}

    "},function(t,e){t.exports='

    • {{option.text}}

      {{option.score}} points

    No comments yet.

    '},function(t,e){t.exports=' '},function(t,e){t.exports="
    • user: {{user.id}}
    • created: {{user.created | fromNow}} ago
    • karma: {{user.karma}}
    • about:
      {{{user.about}}}
    "},function(t,e,n){var i,r,o={};n(69),r=n(57),t.exports=i||{},t.exports.__esModule&&(t.exports=t.exports.default);var s="function"==typeof t.exports?t.exports.options||(t.exports.options={}):t.exports;r&&(s.template=r),s.computed||(s.computed={}),Object.keys(o).forEach(function(t){var e=o[t];s.computed[t]=function(){return e}})},function(t,e,n){var i,r,o={};n(70),i=n(18),r=n(58),t.exports=i||{},t.exports.__esModule&&(t.exports=t.exports.default);var s="function"==typeof t.exports?t.exports.options||(t.exports.options={}):t.exports;r&&(s.template=r),s.computed||(s.computed={}),Object.keys(o).forEach(function(t){var e=o[t];s.computed[t]=function(){return e}})},function(t,e,n){var i,r,o={};n(72),i=n(20),r=n(60),t.exports=i||{},t.exports.__esModule&&(t.exports=t.exports.default);var s="function"==typeof t.exports?t.exports.options||(t.exports.options={}):t.exports;r&&(s.template=r),s.computed||(s.computed={}),Object.keys(o).forEach(function(t){var e=o[t];s.computed[t]=function(){return e}})},function(t,e,n){var i,r,o={};n(73),i=n(21),r=n(61),t.exports=i||{},t.exports.__esModule&&(t.exports=t.exports.default);var s="function"==typeof t.exports?t.exports.options||(t.exports.options={}):t.exports;r&&(s.template=r),s.computed||(s.computed={}),Object.keys(o).forEach(function(t){var e=o[t];s.computed[t]=function(){return e}})},function(t,e,n){var i,r,o={};n(74),i=n(22),r=n(62),t.exports=i||{},t.exports.__esModule&&(t.exports=t.exports.default);var s="function"==typeof t.exports?t.exports.options||(t.exports.options={}):t.exports;r&&(s.template=r),s.computed||(s.computed={}),Object.keys(o).forEach(function(t){var e=o[t];s.computed[t]=function(){return e}})},function(t,e,n){/*! + * vue-router v0.7.13 + * (c) 2016 Evan You + * Released under the MIT License. + */ +!function(e,n){t.exports=n()}(this,function(){"use strict";function t(t,e,n){this.path=t,this.matcher=e,this.delegate=n}function e(t){this.routes={},this.children={},this.target=t}function n(e,i,r){return function(o,s){var a=e+o;return s?void s(n(a,i,r)):new t(e+o,i,r)}}function i(t,e,n){for(var i=0,r=0,o=t.length;r can only be used inside a router-enabled app.");this._isDynamicLiteral=!0,n.bind.call(this);for(var e=void 0,i=this.vm;i;){if(i._routerView){e=i._routerView;break}i=i.$parent}if(e)this.parentView=e,e.childView=this;else{var r=t.router;r._rootView=this}var o=t.router._currentTransition;if(!e&&o.done||e&&e.activated){var s=e?e.depth+1:0;$(this,o,s)}},unbind:function(){this.parentView&&(this.parentView.childView=null),n.unbind.call(this)}}),t.elementDirective("router-view",i)}function H(t){function e(t){return t.protocol===location.protocol&&t.hostname===location.hostname&&t.port===location.port}function n(t,e,n){if(e=e.trim(),e.indexOf(" ")===-1)return void n(t,e);for(var i=e.split(/\s+/),r=0,o=i.length;r-1&&n.updateClasses(i,t.el)})},unbind:function(){this.vm.$off(c,this.cb)}}),t.directive("link",{priority:u-2,bind:function(){var t=this.vm;if(!t.$route)return void _("v-link can only be used inside a router-enabled app.");this.router=t.$route.router,this.unwatch=t.$watch("$route",r(this.onRouteUpdate,this));var e=this.el.getAttribute(c);e&&(this.el.removeAttribute(c),this.activeIds=e.split(",")),"A"===this.el.tagName&&"_blank"===this.el.getAttribute("target")||(this.handler=r(this.onClick,this),this.el.addEventListener("click",this.handler))},update:function(t){this.target=t,o(t)&&(this.append=t.append,this.exact=t.exact,this.prevActiveClass=this.activeClass,this.activeClass=t.activeClass),this.onRouteUpdate(this.vm.$route)},onClick:function(t){if(!(t.metaKey||t.ctrlKey||t.shiftKey||t.defaultPrevented||0!==t.button)){var n=this.target;if(n)t.preventDefault(),this.router.go(n);else{for(var i=t.target;"A"!==i.tagName&&i!==this.el;)i=i.parentNode;if("A"===i.tagName&&e(i)){t.preventDefault();var r=i.pathname;this.router.history.root&&(r=r.replace(this.router.history.rootRE,"")),this.router.go({path:r,replace:n&&n.replace,append:n&&n.append})}}}},onRouteUpdate:function(t){var e=this.router.stringifyPath(this.target);this.path!==e&&(this.path=e,this.updateActiveMatch(),this.updateHref()),this.activeIds?this.vm.$emit(c,this,t.path):this.updateClasses(t.path,this.el)},updateActiveMatch:function(){this.activeRE=this.path&&!this.exact?new RegExp("^"+this.path.replace(/\/$/,"").replace(st,"").replace(ot,"\\$&")+"(\\/|$)"):null},updateHref:function(){if("A"===this.el.tagName){var t=this.path,e=this.router,n="/"===t.charAt(0),i=t&&("hash"===e.mode||n)?e.history.formatPath(t,this.append):t;i?this.el.href=i:this.el.removeAttribute("href")}},updateClasses:function(t,e){var i=this.activeClass||this.router._linkActiveClass;this.prevActiveClass&&this.prevActiveClass!==i&&n(e,this.prevActiveClass,a);var r=this.path.replace(st,"");t=t.replace(st,""),this.exact?r===t||"/"!==r.charAt(r.length-1)&&r===t.replace(rt,"")?n(e,i,s):n(e,i,a):this.activeRE&&this.activeRE.test(t)?n(e,i,s):n(e,i,a)},unbind:function(){this.el.removeEventListener("click",this.handler),this.unwatch&&this.unwatch()}})}function U(t,e){var n=e.component;ut.util.isPlainObject(n)&&(n=e.component=ut.extend(n)),"function"!=typeof n&&(e.component=null,_('invalid component for route "'+t+'".'))}var W={};W.classCallCheck=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.prototype={to:function(t,e){var n=this.delegate;if(n&&n.willAddRoute&&(t=n.willAddRoute(this.matcher.target,t)),this.matcher.add(this.path,t),e){if(0===e.length)throw new Error("You must have an argument in the function passed to `to`");this.matcher.addChild(this.path,t,e,this.delegate)}return this}},e.prototype={add:function(t,e){this.routes[t]=e},addChild:function(t,i,r,o){var s=new e(i);this.children[t]=s;var a=n(t,s,o);o&&o.contextEntered&&o.contextEntered(i,a),r(a)}};var B=["/",".","*","+","?","|","(",")","[","]","{","}","\\"],V=new RegExp("(\\"+B.join("|\\")+")","g"),q=!1;c.prototype={eachChar:function(t){for(var e,n=this.string,i=0,r=n.length;i2&&"[]"===s.slice(a-2)&&(u=!0,s=s.slice(0,a-2),n[s]||(n[s]=[])),r=o[1]?w(o[1]):""),u?n[s].push(r):n[s]=r}return n},recognize:function(t,e){q=e;var n,i,r,o,s=[this.rootState],u={},c=!1;if(o=t.indexOf("?"),o!==-1){var h=t.substr(o+1,t.length);t=t.substr(0,o),h&&(u=this.parseQueryString(h))}if(t=a(t)){for("/"!==t.charAt(0)&&(t="/"+t),n=t.length,n>1&&"/"===t.charAt(n-1)&&(t=t.substr(0,n-1),c=!0),i=0,r=t.length;i-1?"&"+location.search.slice(1):location.search;t.onChange(e.replace(/^#!?/,"")+r)},window.addEventListener("hashchange",this.listener),this.listener()},t.prototype.stop=function(){window.removeEventListener("hashchange",this.listener)},t.prototype.go=function(t,e,n){t=this.formatPath(t,n),e?location.replace(t):location.hash=t},t.prototype.formatPath=function(t,e){var n="/"===t.charAt(0),i="#"+(this.hashbang?"!":"");return n?i+t:i+x(location.hash.replace(/^#!?/,""),t,e)},t}(),tt=function(){function t(e){var n=e.onChange;W.classCallCheck(this,t),this.onChange=n,this.currentPath="/"}return t.prototype.start=function(){this.onChange("/")},t.prototype.stop=function(){},t.prototype.go=function(t,e,n){t=this.currentPath=this.formatPath(t,n),this.onChange(t)},t.prototype.formatPath=function(t,e){return"/"===t.charAt(0)?t:x(this.currentPath,t,e)},t}(),et=function(){function t(e,n,i){W.classCallCheck(this,t),this.router=e,this.to=n,this.from=i,this.next=null,this.aborted=!1,this.done=!1}return t.prototype.abort=function(){if(!this.aborted){this.aborted=!0;var t=!this.from.path&&"/"===this.to.path;t||this.router.replace(this.from.path||"/")}},t.prototype.redirect=function(t){this.aborted||(this.aborted=!0,"string"==typeof t?t=E(t,this.to.params,this.to.query):(t.params=t.params||this.to.params,t.query=t.query||this.to.query),this.router.replace(t))},t.prototype.start=function(t){for(var e=this,n=[],i=this.router._rootView;i;)n.unshift(i),i=i.childView;var r=n.slice().reverse(),o=this.activateQueue=I(this.to.matched).map(function(t){return t.handler}),s=void 0,a=void 0;for(s=0;s0&&(a=r.slice(0,s),n=r.slice(s).reverse(),o=o.slice(s)),e.runQueue(n,j,function(){e.runQueue(o,T,function(){e.runQueue(n,O,function(){if(e.router._onTransitionValidated(e),a&&a.forEach(function(t){return N(t,e)}),n.length){var i=n[n.length-1],r=a?a.length:0;$(i,e,r,t)}else t()})})})},t.prototype.runQueue=function(t,e,n){function i(o){o>=t.length?n():e(t[o],r,function(){i(o+1)})}var r=this;i(0)},t.prototype.callHook=function(t,e,n){var i=arguments.length<=3||void 0===arguments[3]?{}:arguments[3],r=i.expectBoolean,o=void 0!==r&&r,s=i.postActivate,a=void 0!==s&&s,u=i.processData,c=i.cleanup,h=this,l=!1,f=function(){c&&c(),h.abort()},p=function(t){if(a?v():f(),t&&!h.router._suppress)throw _("Uncaught error during transition: "),t instanceof Error?t:new Error(t)},d=function(t){try{p(t)}catch(t){setTimeout(function(){throw t},0)}},v=function(){return l?void _("transition.next() should be called only once."):(l=!0,h.aborted?void(c&&c()):void(n&&n()))},g=function(e){"boolean"==typeof e?e?v():f():k(e)?e.then(function(t){t?v():f()},d):t.length||v()},b=function(t){var e=void 0;try{e=u(t)}catch(t){return p(t)}k(e)?e.then(v,d):v()},m={to:h.to,from:h.from,abort:f,next:u?b:v,redirect:function(){h.redirect.apply(h,arguments)}},y=void 0;try{y=t.call(e,m)}catch(t){return p(t)}o?g(y):k(y)?u?y.then(b,d):y.then(v,d):u&&M(y)?b(y):t.length||v()},t.prototype.callHooks=function(t,e,n,i){var r=this;Array.isArray(t)?this.runQueue(t,function(t,n,o){r.aborted||r.callHook(t,e,o,i)},n):this.callHook(t,e,n,i)},t}(),nt=/^(component|subRoutes|fullPath)$/,it=function t(e,n){var i=this;W.classCallCheck(this,t);var r=n._recognizer.recognize(e);r&&([].forEach.call(r,function(t){for(var e in t.handler)nt.test(e)||(i[e]=t.handler[e])}),this.query=r.queryParams,this.params=[].reduce.call(r,function(t,e){if(e.params)for(var n in e.params)t[n]=e.params[n];return t},{})),this.path=e,this.matched=r||n._notFoundHandler,Object.defineProperty(this,"router",{enumerable:!1,value:n}),Object.freeze(this)},rt=/\/$/,ot=/[-.*+?^${}()|[\]\/\\]/g,st=/\?.*$/,at={abstract:tt,hash:Z,html5:Y},ut=void 0,ct=function(){function t(){var e=this,n=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],i=n.hashbang,r=void 0===i||i,o=n.abstract,s=void 0!==o&&o,a=n.history,u=void 0!==a&&a,c=n.saveScrollPosition,h=void 0!==c&&c,l=n.transitionOnLoad,f=void 0!==l&&l,p=n.suppressTransitionError,d=void 0!==p&&p,v=n.root,g=void 0===v?null:v,b=n.linkActiveClass,m=void 0===b?"v-link-active":b;if(W.classCallCheck(this,t),!t.installed)throw new Error("Please install the Router with Vue.use() before creating an instance.");this.app=null,this._children=[],this._recognizer=new G,this._guardRecognizer=new G,this._started=!1,this._startCb=null,this._currentRoute={},this._currentTransition=null,this._previousTransition=null,this._notFoundHandler=null,this._notFoundRedirect=null,this._beforeEachHooks=[],this._afterEachHooks=[],this._rendered=!1,this._transitionOnLoad=f,this._root=g,this._abstract=s,this._hashbang=r;var y="undefined"!=typeof window&&window.history&&window.history.pushState;this._history=u&&y,this._historyFallback=u&&!y;var w=ut.util.inBrowser;this.mode=!w||this._abstract?"abstract":this._history?"html5":"hash";var _=at[this.mode];this.history=new _({root:g,hashbang:this._hashbang,onChange:function(t,n,i){e._match(t,n,i)}}),this._saveScrollPosition=h,this._linkActiveClass=m,this._suppress=d}return t.prototype.map=function(t){for(var e in t)this.on(e,t[e]);return this},t.prototype.on=function(t,e){return"*"===t?this._notFound(e):this._addRoute(t,e,[]),this},t.prototype.redirect=function(t){for(var e in t)this._addRedirect(e,t[e]);return this},t.prototype.alias=function(t){for(var e in t)this._addAlias(e,t[e]);return this},t.prototype.beforeEach=function(t){return this._beforeEachHooks.push(t),this},t.prototype.afterEach=function(t){return this._afterEachHooks.push(t),this},t.prototype.go=function(t){var e=!1,n=!1;ut.util.isObject(t)&&(e=t.replace,n=t.append),t=this.stringifyPath(t),t&&this.history.go(t,e,n)},t.prototype.replace=function(t){"string"==typeof t&&(t={path:t}),t.replace=!0,this.go(t)},t.prototype.start=function(t,e,n){if(this._started)return void _("already started.");if(this._started=!0,this._startCb=n,!this.app){if(!t||!e)throw new Error("Must start vue-router with a component and a root container.");if(t instanceof ut)throw new Error("Must start vue-router with a component, not a Vue instance.");this._appContainer=e;var i=this._appConstructor="function"==typeof t?t:ut.extend(t);i.options.name=i.options.name||"RouterApp"}if(this._historyFallback){var r=window.location,o=new Y({root:this._root}),s=o.root?r.pathname.replace(o.rootRE,""):r.pathname;if(s&&"/"!==s)return void r.assign((o.root||"")+"/"+this.history.formatPath(s)+r.search)}this.history.start()},t.prototype.stop=function(){this.history.stop(),this._started=!1},t.prototype.stringifyPath=function(t){var e="";if(t&&"object"==typeof t){if(t.name){var n=ut.util.extend,i=this._currentTransition&&this._currentTransition.to.params,r=t.params||{},o=i?n(n({},i),r):r;e=encodeURI(this._recognizer.generate(t.name,o))}else t.path&&(e=encodeURI(t.path));if(t.query){var s=this._recognizer.generateQueryString(t.query);e+=e.indexOf("?")>-1?"&"+s.slice(1):s}}else e=encodeURI(t?t+"":"");return e},t.prototype._addRoute=function(t,e,n){if(U(t,e),e.path=t,e.fullPath=(n.reduce(function(t,e){return t+e.path},"")+t).replace("//","/"),n.push({path:t,handler:e}),this._recognizer.add(n,{as:e.name}),e.subRoutes)for(var i in e.subRoutes)this._addRoute(i,e.subRoutes[i],n.slice())},t.prototype._notFound=function(t){U("*",t),this._notFoundHandler=[{handler:t}]},t.prototype._addRedirect=function(t,e){"*"===t?this._notFoundRedirect=e:this._addGuard(t,e,this.replace)},t.prototype._addAlias=function(t,e){this._addGuard(t,e,this._match)},t.prototype._addGuard=function(t,e,n){var i=this;this._guardRecognizer.add([{path:t,handler:function(t,r){var o=E(e,t.params,r);n.call(i,o)}}])},t.prototype._checkGuard=function(t){var e=this._guardRecognizer.recognize(t,!0);return e?(e[0].handler(e[0],e.queryParams),!0):this._notFoundRedirect&&(e=this._recognizer.recognize(t),!e)?(this.replace(this._notFoundRedirect),!0):void 0},t.prototype._match=function(t,e,n){var i=this;if(!this._checkGuard(t)){var r=this._currentRoute,o=this._currentTransition;if(o){if(o.to.path===t)return;if(r.path===t)return o.aborted=!0,void(this._currentTransition=this._prevTransition);o.aborted=!0}var s=new it(t,this),a=new et(this,s,r);this._prevTransition=o,this._currentTransition=a,this.app||!function(){var t=i;i.app=new i._appConstructor({el:i._appContainer,created:function(){this.$router=t},_meta:{$route:s}})}();var u=this._beforeEachHooks,c=function(){a.start(function(){i._postTransition(s,e,n)})};u.length?a.runQueue(u,function(t,e,n){a===i._currentTransition&&a.callHook(t,null,n,{expectBoolean:!0})},c):c(),!this._rendered&&this._startCb&&this._startCb.call(null),this._rendered=!0}},t.prototype._onTransitionValidated=function(t){var e=this._currentRoute=t.to;this.app.$route!==e&&(this.app.$route=e,this._children.forEach(function(t){t.$route=e})),this._afterEachHooks.length&&this._afterEachHooks.forEach(function(e){return e.call(null,{to:t.to,from:t.from})}),this._currentTransition.done=!0},t.prototype._postTransition=function(t,e,n){var i=e&&e.pos;i&&this._saveScrollPosition?ut.nextTick(function(){window.scrollTo(i.x,i.y)}):n&&ut.nextTick(function(){var t=document.getElementById(n.slice(1));t&&window.scrollTo(window.scrollX,t.offsetTop)})},t}();return ct.installed=!1,ct.install=function(t){return ct.installed?void _("already installed."):(ut=t,D(ut),L(ut),H(ut),K.Vue=ut,void(ct.installed=!0))},"undefined"!=typeof window&&window.Vue&&window.Vue.use(ct),ct})},function(t,e,n){var i=n(48);"string"==typeof i&&(i=[[t.id,i,""]]);n(2)(i,{});i.locals&&(t.exports=i.locals)},function(t,e,n){var i=n(49);"string"==typeof i&&(i=[[t.id,i,""]]);n(2)(i,{});i.locals&&(t.exports=i.locals)},function(t,e,n){var i=n(50);"string"==typeof i&&(i=[[t.id,i,""]]);n(2)(i,{});i.locals&&(t.exports=i.locals)},function(t,e,n){var i=n(51);"string"==typeof i&&(i=[[t.id,i,""]]);n(2)(i,{});i.locals&&(t.exports=i.locals)},function(t,e,n){var i=n(52);"string"==typeof i&&(i=[[t.id,i,""]]);n(2)(i,{});i.locals&&(t.exports=i.locals)},function(t,e,n){var i=n(53);"string"==typeof i&&(i=[[t.id,i,""]]);n(2)(i,{});i.locals&&(t.exports=i.locals)},function(t,e,n){/*! + * Vue.js v1.0.28 + * (c) 2016 Evan You + * Released under the MIT License. + */ +"use strict";function i(t,e,n){if(o(t,e))return void(t[e]=n);if(t._isVue)return void i(t._data,e,n);var r=t.__ob__;if(!r)return void(t[e]=n);if(r.convert(e,n),r.dep.notify(),r.vms)for(var s=r.vms.length;s--;){var a=r.vms[s];a._proxy(e),a._digest()}return n}function r(t,e){if(o(t,e)){delete t[e];var n=t.__ob__;if(!n)return void(t._isVue&&(delete t._data[e],t._digest()));if(n.dep.notify(),n.vms)for(var i=n.vms.length;i--;){var r=n.vms[i];r._unproxy(e),r._digest()}}}function o(t,e){return Vn.call(t,e)}function s(t){return qn.test(t)}function a(t){var e=(t+"").charCodeAt(0);return 36===e||95===e}function u(t){return null==t?"":t.toString()}function c(t){if("string"!=typeof t)return t;var e=Number(t);return isNaN(e)?t:e}function h(t){return"true"===t||"false"!==t&&t}function l(t){var e=t.charCodeAt(0),n=t.charCodeAt(t.length-1);return e!==n||34!==e&&39!==e?t:t.slice(1,-1)}function f(t){return t.replace(Qn,p)}function p(t,e){return e?e.toUpperCase():""}function d(t){return t.replace(Gn,"$1-$2").replace(Gn,"$1-$2").toLowerCase()}function v(t){return t.replace(Jn,p)}function g(t,e){return function(n){var i=arguments.length;return i?i>1?t.apply(e,arguments):t.call(e,n):t.call(e)}}function b(t,e){e=e||0;for(var n=t.length-e,i=new Array(n);n--;)i[n]=t[n+e];return i}function m(t,e){for(var n=Object.keys(e),i=n.length;i--;)t[n[i]]=e[n[i]];return t}function y(t){return null!==t&&"object"==typeof t}function w(t){return Kn.call(t)===zn}function _(t,e,n,i){Object.defineProperty(t,e,{value:n,enumerable:!!i,writable:!0,configurable:!0})}function x(t,e){var n,i,r,o,s,a=function a(){var u=Date.now()-o;u=0?n=setTimeout(a,e-u):(n=null,s=t.apply(r,i),n||(r=i=null))};return function(){return r=this,i=arguments,o=Date.now(),n||(n=setTimeout(a,e)),s}}function k(t,e){for(var n=t.length;n--;)if(t[n]===e)return n;return-1}function C(t){var e=function e(){if(!e.cancelled)return t.apply(this,arguments)};return e.cancel=function(){e.cancelled=!0},e}function A(t,e){return t==e||!(!y(t)||!y(e))&&JSON.stringify(t)===JSON.stringify(e)}function E(t){return/native code/.test(t.toString())}function S(t){this.size=0,this.limit=t,this.head=this.tail=void 0,this._keymap=Object.create(null)}function j(){return vi.charCodeAt(mi+1)}function T(){return vi.charCodeAt(++mi)}function O(){return mi>=bi}function $(){for(;j()===$i;)T()}function N(t){return t===Si||t===ji}function F(t){return Ni[t]}function P(t,e){return Fi[t]===e}function R(){for(var t,e=T();!O();)if(t=T(),t===Oi)T();else if(t===e)break}function M(t){for(var e=0,n=t;!O();)if(t=j(),N(t))R();else if(n===t&&e++,P(n,t)&&e--,T(),0===e)break}function I(){for(var t=mi;!O();)if(yi=j(),N(yi))R();else if(F(yi))M(yi);else if(yi===Ti){if(T(),yi=j(),yi!==Ti){wi!==ki&&wi!==Ei||(wi=Ci);break}T()}else{if(yi===$i&&(wi===Ai||wi===Ei)){$();break}wi===Ci&&(wi=Ai),T()}return vi.slice(t+1,mi)||null}function D(){for(var t=[];!O();)t.push(L());return t}function L(){var t,e={};return wi=Ci,e.name=I().trim(),wi=Ei,t=H(),t.length&&(e.args=t),e}function H(){for(var t=[];!O()&&wi!==Ci;){var e=I();if(!e)break;t.push(U(e))}return t}function U(t){if(xi.test(t))return{value:c(t),dynamic:!1};var e=l(t),n=e===t;return{value:n?t:e,dynamic:n}}function W(t){var e=_i.get(t);if(e)return e;vi=t,gi={},bi=vi.length,mi=-1,yi="",wi=ki;var n;return vi.indexOf("|")<0?gi.expression=vi.trim():(gi.expression=I().trim(),n=D(),n.length&&(gi.filters=n)),_i.put(t,gi),gi}function B(t){return t.replace(Ri,"\\$&")}function V(){var t=B(Bi.delimiters[0]),e=B(Bi.delimiters[1]),n=B(Bi.unsafeDelimiters[0]),i=B(Bi.unsafeDelimiters[1]);Ii=new RegExp(n+"((?:.|\\n)+?)"+i+"|"+t+"((?:.|\\n)+?)"+e,"g"),Di=new RegExp("^"+n+"((?:.|\\n)+?)"+i+"$"),Mi=new S(1e3)}function q(t){Mi||V();var e=Mi.get(t);if(e)return e;if(!Ii.test(t))return null;for(var n,i,r,o,s,a,u=[],c=Ii.lastIndex=0;n=Ii.exec(t);)i=n.index,i>c&&u.push({value:t.slice(c,i)}),r=Di.test(n[0]),o=r?n[1]:n[2],s=o.charCodeAt(0),a=42===s,o=a?o.slice(1):o,u.push({tag:!0,value:o.trim(),html:r,oneTime:a}),c=i+n[0].length;return c1?t.map(function(t){return G(t,e)}).join("+"):G(t[0],e,!0)}function G(t,e,n){return t.tag?t.oneTime&&e?'"'+e.$eval(t.value)+'"':J(t.value,n):'"'+t.value+'"'}function J(t,e){if(Li.test(t)){var n=W(t);return n.filters?"this._applyFilters("+n.expression+",null,"+JSON.stringify(n.filters)+",false)":"("+t+")"}return e?t:"("+t+")"}function K(t,e,n,i){Y(t,1,function(){e.appendChild(t)},n,i)}function z(t,e,n,i){Y(t,1,function(){rt(t,e)},n,i)}function X(t,e,n){Y(t,-1,function(){st(t)},e,n)}function Y(t,e,n,i,r){var o=t.__v_trans;if(!o||!o.hooks&&!ai||!i._isCompiled||i.$parent&&!i.$parent._isCompiled)return n(),void(r&&r());var s=e>0?"enter":"leave";o[s](n,r)}function Z(t){if("string"==typeof t){t=document.querySelector(t)}return t}function tt(t){if(!t)return!1;var e=t.ownerDocument.documentElement,n=t.parentNode;return e===t||e===n||!(!n||1!==n.nodeType||!e.contains(n))}function et(t,e){var n=t.getAttribute(e);return null!==n&&t.removeAttribute(e),n}function nt(t,e){var n=et(t,":"+e);return null===n&&(n=et(t,"v-bind:"+e)),n}function it(t,e){return t.hasAttribute(e)||t.hasAttribute(":"+e)||t.hasAttribute("v-bind:"+e)}function rt(t,e){e.parentNode.insertBefore(t,e)}function ot(t,e){e.nextSibling?rt(t,e.nextSibling):e.parentNode.appendChild(t)}function st(t){t.parentNode.removeChild(t)}function at(t,e){e.firstChild?rt(t,e.firstChild):e.appendChild(t)}function ut(t,e){var n=t.parentNode;n&&n.replaceChild(e,t)}function ct(t,e,n,i){t.addEventListener(e,n,i)}function ht(t,e,n){t.removeEventListener(e,n)}function lt(t){var e=t.className;return"object"==typeof e&&(e=e.baseVal||""),e}function ft(t,e){ii&&!/svg$/.test(t.namespaceURI)?t.className=e:t.setAttribute("class",e)}function pt(t,e){if(t.classList)t.classList.add(e);else{var n=" "+lt(t)+" ";n.indexOf(" "+e+" ")<0&&ft(t,(n+e).trim())}}function dt(t,e){if(t.classList)t.classList.remove(e);else{for(var n=" "+lt(t)+" ",i=" "+e+" ";n.indexOf(i)>=0;)n=n.replace(i," ");ft(t,n.trim())}t.className||t.removeAttribute("class")}function vt(t,e){var n,i;if(mt(t)&&kt(t.content)&&(t=t.content),t.hasChildNodes())for(gt(t),i=e?document.createDocumentFragment():document.createElement("div");n=t.firstChild;)i.appendChild(n);return i}function gt(t){for(var e;e=t.firstChild,bt(e);)t.removeChild(e);for(;e=t.lastChild,bt(e);)t.removeChild(e)}function bt(t){return t&&(3===t.nodeType&&!t.data.trim()||8===t.nodeType)}function mt(t){return t.tagName&&"template"===t.tagName.toLowerCase()}function yt(t,e){var n=Bi.debug?document.createComment(t):document.createTextNode(e?" ":"");return n.__v_anchor=!0,n}function wt(t){if(t.hasAttributes())for(var e=t.attributes,n=0,i=e.length;n=u.length){for(var t=0;t=97&&e<=122||e>=65&&e<=90?"ident":e>=49&&e<=57?"number":"else"}function Bt(t){var e=t.trim();return("0"!==t.charAt(0)||!isNaN(t))&&(s(e)?l(e):"*"+e)}function Vt(t){function e(){var e=t[h+1];if(l===dr&&"'"===e||l===vr&&'"'===e)return h++,i="\\"+e,p[or](),!0}var n,i,r,o,s,a,u,c=[],h=-1,l=cr,f=0,p=[];for(p[sr]=function(){void 0!==r&&(c.push(r),r=void 0)},p[or]=function(){void 0===r?r=i:r+=i},p[ar]=function(){p[or](),f++},p[ur]=function(){if(f>0)f--,l=pr,p[or]();else{if(f=0,r=Bt(r),r===!1)return!1;p[sr]()}};null!=l;)if(h++,n=t[h],"\\"!==n||!e()){if(o=Wt(n),u=mr[l],s=u[o]||u.else||br,s===br)return;if(l=s[0],a=p[s[1]],a&&(i=s[2],i=void 0===i?n:i,a()===!1))return;if(l===gr)return c.raw=t,c}}function qt(t){var e=rr.get(t);return e||(e=Vt(t),e&&rr.put(t,e)),e}function Qt(t,e){return ee(e).get(t)}function Gt(t,e,n){var r=t;if("string"==typeof e&&(e=Vt(e)),!e||!y(t))return!1;for(var o,s,a=0,u=e.length;a-1?n.replace(jr,Xt):n,e+"scope."+n)}function Xt(t,e){return Nr[e]}function Yt(t){Cr.test(t),Nr.length=0;var e=t.replace(Sr,Kt).replace(Ar,"");return e=(" "+e).replace(Or,zt).replace(jr,Xt),Zt(e)}function Zt(t){try{return new Function("scope","return "+t+";")}catch(t){return Jt}}function te(t){var e=qt(t);if(e)return function(t,n){Gt(t,e,n)}}function ee(t,e){t=t.trim();var n=wr.get(t);if(n)return e&&!n.set&&(n.set=te(n.exp)),n;var i={exp:t};return i.get=ne(t)&&t.indexOf("[")<0?Zt("scope."+t):Yt(t),e&&(i.set=te(t)),wr.put(t,i),i}function ne(t){return Tr.test(t)&&!$r.test(t)&&"Math."!==t.slice(0,5)}function ie(){Pr.length=0,Rr.length=0,Mr={},Ir={},Dr=!1}function re(){for(var t=!0;t;)t=!1,oe(Pr),oe(Rr),Pr.length?t=!0:(ti&&Bi.devtools&&ti.emit("flush"),ie())}function oe(t){for(var e=0;e0){var s=o+(i?e:Ct(e));r=Yr.get(s),r||(r=ze(n,t.$options,!0),Yr.put(s,r))}else r=ze(n,t.$options,!0);this.linker=r}function xe(t,e,n){var i=t.node.previousSibling;if(i){for(t=i.__v_frag;!(t&&t.forId===n&&t.inserted||i===e);){if(i=i.previousSibling,!i)return;t=i.__v_frag}return t}}function ke(t){for(var e=-1,n=new Array(Math.floor(t));++e47&&e<58?parseInt(t,10):1===t.length&&(e=t.toUpperCase().charCodeAt(0),e>64&&e<91)?e:wo[t]});return n=[].concat.apply([],n),function(e){if(n.indexOf(e.keyCode)>-1)return t.call(this,e)}}function Te(t){return function(e){return e.stopPropagation(),t.call(this,e)}}function Oe(t){return function(e){return e.preventDefault(),t.call(this,e)}}function $e(t){return function(e){if(e.target===e.currentTarget)return t.call(this,e)}}function Ne(t){if(Ao[t])return Ao[t];var e=Fe(t);return Ao[t]=Ao[e]=e,e}function Fe(t){t=d(t);var e=f(t),n=e.charAt(0).toUpperCase()+e.slice(1);Eo||(Eo=document.createElement("div"));var i,r=xo.length;if("filter"!==e&&e in Eo.style)return{kebab:t,camel:e};for(;r--;)if(i=ko[r]+n,i in Eo.style)return{kebab:xo[r]+t,camel:i}}function Pe(t){var e=[];if(Xn(t))for(var n=0,i=t.length;n=r?n():t[o].call(e,i)}var r=t.length,o=0;t[0].call(e,i)}function Ie(t,e,n){for(var i,r,o,a,u,c,h,l=[],p=n.$options.propsData,v=Object.keys(e),g=v.length;g--;)if(r=v[g],i=e[r]||Wo,u=f(r),Bo.test(u)){if(h={name:r,path:u,options:i,mode:Uo.ONE_WAY,raw:null},o=d(r),null===(a=nt(t,o))&&(null!==(a=nt(t,o+".sync"))?h.mode=Uo.TWO_WAY:null!==(a=nt(t,o+".once"))&&(h.mode=Uo.ONE_TIME)),null!==a)h.raw=a,c=W(a),a=c.expression,h.filters=c.filters,s(a)&&!c.filters?h.optimizedLiteral=!0:h.dynamic=!0,h.parentPath=a;else if(null!==(a=et(t,o)))h.raw=a;else if(p&&null!==(a=p[r]||p[u]))h.raw=a;else;l.push(h)}return De(l)}function De(t){return function(e,n){e._props={};for(var i,r,s,a,u,f=e.$options.propsData,p=t.length;p--;)if(i=t[p],u=i.raw,r=i.path,s=i.options,e._props[r]=i,f&&o(f,r)&&He(e,i,f[r]),null===u)He(e,i,void 0);else if(i.dynamic)i.mode===Uo.ONE_TIME?(a=(n||e._context||e).$get(i.parentPath),He(e,i,a)):e._context?e._bindDir({name:"prop",def:qo,prop:i},null,null,n):He(e,i,e.$get(i.parentPath));else if(i.optimizedLiteral){var v=l(u);a=v===u?h(c(u)):v,He(e,i,a)}else a=s.type===Boolean&&(""===u||u===d(i.name))||u,He(e,i,a)}}function Le(t,e,n,i){var r=e.dynamic&&ne(e.parentPath),o=n;void 0===o&&(o=We(t,e)),o=Ve(e,o,t);var s=o!==n;Be(e,o,t)||(o=void 0),r&&!s?Rt(function(){i(o)}):i(o)}function He(t,e,n){Le(t,e,n,function(n){Ht(t,e.path,n)})}function Ue(t,e,n){Le(t,e,n,function(n){t[e.path]=n})}function We(t,e){var n=e.options;if(!o(n,"default"))return n.type!==Boolean&&void 0;var i=n.default;return y(i),"function"==typeof i&&n.type!==Function?i.call(t):i}function Be(t,e,n){if(!t.options.required&&(null===t.raw||null==e))return!0;var i=t.options,r=i.type,o=!r,s=[];if(r){Xn(r)||(r=[r]);for(var a=0;ae?-1:t===e?0:1}),e=0,n=a.length;ep.priority)&&(p=f,h=r.name,a=mn(r.name),s=r.value,c=u[1],l=u[2]));return p?gn(t,c,s,n,p,h,l,a):void 0}function vn(){}function gn(t,e,n,i,r,o,s,a){var u=W(n),c={name:e,arg:s,expression:u.expression,filters:u.filters,raw:n,attr:o,modifiers:a,def:r};"for"!==e&&"router-view"!==e||(c.ref=wt(t));var h=function(t,e,n,i,r){c.ref&&Ht((i||t).$refs,c.ref,null),t._bindDir(c,e,n,i,r)};return h.terminal=!0,h}function bn(t,e){function n(t,e,n){var i=n&&wn(n),r=!i&&W(o);v.push({name:t,attr:s,raw:a,def:e,arg:c,modifiers:h,expression:r&&r.expression,filters:r&&r.filters,interp:n,hasOneTime:i})}for(var i,r,o,s,a,u,c,h,l,f,p,d=t.length,v=[];d--;)if(i=t[d],r=s=i.name,o=a=i.value,f=q(o),c=null,h=mn(r),r=r.replace(ss,""),f)o=Q(f),c=r,n("bind",Do.bind,f);else if(as.test(r))h.literal=!is.test(r),n("transition",ns.transition);else if(rs.test(r))c=r.replace(rs,""),n("on",Do.on);else if(is.test(r))u=r.replace(is,""),"style"===u||"class"===u?n(u,ns[u]):(c=u,n("bind",Do.bind));else if(p=r.match(os)){if(u=p[1],c=p[2],"else"===u)continue;l=Ft(e,"directives",u,!0),l&&n(u,l)}if(v.length)return yn(v)}function mn(t){var e=Object.create(null),n=t.match(ss);if(n)for(var i=n.length;i--;)e[n[i].slice(1)]=!0;return e}function yn(t){return function(e,n,i,r,o){for(var s=t.length;s--;)e._bindDir(t[s],n,i,r,o)}}function wn(t){for(var e=t.length;e--;)if(t[e].oneTime)return!0}function _n(t){return"SCRIPT"===t.tagName&&(!t.hasAttribute("type")||"text/javascript"===t.getAttribute("type"))}function xn(t,e){return e&&(e._containerAttrs=Cn(t)),mt(t)&&(t=pe(t)),e&&(e._asComponent&&!e.template&&(e.template=""),e.template&&(e._content=vt(t),t=kn(t,e))),kt(t)&&(at(yt("v-start",!0),t),t.appendChild(yt("v-end",!0))),t}function kn(t,e){var n=e.template,i=pe(n,!0);if(i){var r=i.firstChild;if(!r)return i;var o=r.tagName&&r.tagName.toLowerCase();return e.replace?(t===document.body,i.childNodes.length>1||1!==r.nodeType||"component"===o||Ft(e,"components",o)||it(r,"is")||Ft(e,"elementDirectives",o)||r.hasAttribute("v-for")||r.hasAttribute("v-if")?i:(e._replacerAttrs=Cn(r),An(t,r),r)):(t.appendChild(i),t)}}function Cn(t){if(1===t.nodeType&&t.hasAttributes())return b(t.attributes)}function An(t,e){for(var n,i,r=t.attributes,o=r.length;o--;)n=r[o].name,i=r[o].value,e.hasAttribute(n)||hs.test(n)?"class"===n&&!q(i)&&(i=i.trim())&&i.split(/\s+/).forEach(function(t){pt(e,t)}):e.setAttribute(n,i)}function En(t,e){if(e){for(var n,i,r=t._slotContents=Object.create(null),o=0,s=e.children.length;o1?b(n):n;var r=e&&n.some(function(t){return t._fromParent});r&&(i=!1);for(var o=b(arguments,1),s=0,a=n.length;se?o:-o}var n=null,i=void 0;t=bs(t);var r=b(arguments,1),o=r[r.length-1];"number"==typeof o?(o=o<0?-1:1,r=r.length>1?r.slice(0,-1):r):o=1;var s=r[0];return s?("function"==typeof s?n=function(t,e){return s(t,e)*o}:(i=Array.prototype.concat.apply([],r),n=function(t,r,o){return o=o||0,o>=i.length-1?e(t,r,o):e(t,r,o)||n(t,r,o+1)}),t.slice().sort(n)):t}function Wn(t,e){var n;if(w(t)){var i=Object.keys(t);for(n=i.length;n--;)if(Wn(t[i[n]],e))return!0}else if(Xn(t)){for(n=t.length;n--;)if(Wn(t[n],e))return!0}else if(null!=t)return t.toString().toLowerCase().indexOf(e)>-1}function Bn(t){function e(t){return new Function("return function "+v(t)+" (options) { this._init(options) }")()}t.options={directives:Do,elementDirectives:gs,filters:ys,transitions:{},components:{},partials:{},replace:!0},t.util=nr,t.config=Bi,t.set=i,t.delete=r,t.nextTick=fi,t.compiler=ls,t.FragmentFactory=_e,t.internalDirectives=ns,t.parsers={path:yr,text:Hi,template:zr,directive:Pi,expression:Fr},t.cid=0;var n=1;t.extend=function(t){t=t||{};var i=this,r=0===i.cid;if(r&&t._Ctor)return t._Ctor;var o=t.name||i.options.name,s=e(o||"VueComponent");return s.prototype=Object.create(i.prototype),s.prototype.constructor=s,s.cid=n++,s.options=Nt(i.options,t),s.super=i,s.extend=i.extend,Bi._assetTypes.forEach(function(t){s[t]=i[t]}),o&&(s.options.components[o]=s),r&&(t._Ctor=s),s},t.use=function(t){if(!t.installed){var e=b(arguments,1);return e.unshift(this),"function"==typeof t.install?t.install.apply(t,e):t.apply(null,e),t.installed=!0,this}},t.mixin=function(e){t.options=Nt(t.options,e)},Bi._assetTypes.forEach(function(e){t[e]=function(n,i){return i?("component"===e&&w(i)&&(i.name||(i.name=n),i=t.extend(i)),this.options[e+"s"][n]=i,i):this.options[e+"s"][n]}}),m(t.transition,qi)}var Vn=Object.prototype.hasOwnProperty,qn=/^\s?(true|false|-?[\d\.]+|'[^']*'|"[^"]*")\s?$/,Qn=/-(\w)/g,Gn=/([^-])([A-Z])/g,Jn=/(?:^|[-_\/])(\w)/g,Kn=Object.prototype.toString,zn="[object Object]",Xn=Array.isArray,Yn="__proto__"in{},Zn="undefined"!=typeof window&&"[object Object]"!==Object.prototype.toString.call(window),ti=Zn&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__,ei=Zn&&window.navigator.userAgent.toLowerCase(),ni=ei&&ei.indexOf("trident")>0,ii=ei&&ei.indexOf("msie 9.0")>0,ri=ei&&ei.indexOf("android")>0,oi=ei&&/iphone|ipad|ipod|ios/.test(ei),si=void 0,ai=void 0,ui=void 0,ci=void 0;if(Zn&&!ii){var hi=void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend,li=void 0===window.onanimationend&&void 0!==window.onwebkitanimationend;si=hi?"WebkitTransition":"transition",ai=hi?"webkitTransitionEnd":"transitionend",ui=li?"WebkitAnimation":"animation",ci=li?"webkitAnimationEnd":"animationend"}var fi=function(){function t(){n=!1;var t=e.slice(0);e.length=0;for(var i=0;i=this.length&&(this.length=Number(t)+1),this.splice(t,1,e)[0]}),_(Yi,"$remove",function(t){if(this.length){var e=k(this,t);return e>-1?this.splice(e,1):void 0}});var tr=Object.getOwnPropertyNames(Zi),er=!0;Mt.prototype.walk=function(t){for(var e=Object.keys(t),n=0,i=e.length;n",""],tr:[2,"","
    "],col:[2,"","
    "]};Vr.td=Vr.th=[3,"","
    "],Vr.option=Vr.optgroup=[1,'"],Vr.thead=Vr.tbody=Vr.colgroup=Vr.caption=Vr.tfoot=[1,"","
    "],Vr.g=Vr.defs=Vr.symbol=Vr.use=Vr.image=Vr.text=Vr.circle=Vr.ellipse=Vr.line=Vr.path=Vr.polygon=Vr.polyline=Vr.rect=[1,'',""];var qr=/<([\w:-]+)/,Qr=/&#?\w+?;/,Gr=/