Socket
Socket
Sign inDemoInstall

vue-router

Package Overview
Dependencies
Maintainers
1
Versions
185
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-router - npm Package Compare versions

Comparing version 0.5.1 to 0.5.2

4

dist/vue-router.min.js
/*!
* vue-router v0.5.1
* vue-router v0.5.2
* (c) 2015 Evan You
* Released under the MIT License.
*/
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):"object"==typeof exports?exports.VueRouter=e():t.VueRouter=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";var r=n(1)["default"];Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),i=n(6),a=r(i);a["default"].install=function(t){return a["default"].installed?void o.warn("already installed."):(n(15)(t,a["default"]),n(16)(t,a["default"]),n(20)(t),n(21)(t),n(22)(t),a["default"].Vue=t,void(a["default"].installed=!0))},"undefined"!=typeof window&&window.Vue&&a["default"].install(window.Vue),e["default"]=a["default"],t.exports=e["default"]},function(t,e){"use strict";e["default"]=function(t){return t&&t.__esModule?t:{"default":t}},e.__esModule=!0},function(t,e,n){"use strict";function r(t,e){window.console&&(console.warn("[vue-router] "+t),e&&console.warn(e.stack))}function o(t,e){var n=t.match(/(\?.*)$/);if(n&&(n=n[1],t=t.slice(0,-n.length)),"?"===e.charAt(0))return t+e;var r=t.split("/");r.pop();for(var o=e.split("/"),i=0;i<o.length;i++){var a=o[i];"."!==a&&(".."===a?r.pop():r.push(a))}return""!==r[0]&&r.unshift(""),r.join("/")}function i(t){return t&&"function"==typeof t.then}function a(t,e){var n=t&&(t.$options||t.options);return n&&n.route&&n.route[e]}function s(t,e){p?p.$options.components._=t.component:p={resolve:n(6).Vue.prototype._resolveComponent,$options:{components:{_:t.component}}},p.resolve("_",function(n){t.component=n,e(n)})}function u(t,e,n){for(var r in e)t=c(t,e,r);return n&&(t+=d(n)),t}function c(t,e,n){var r=new RegExp(":"+n+"(\\/|$)"),o=e[n];return t.replace(r,function(t){return"/"===t.charAt(t.length-1)?o+"/":o})}var h=n(1)["default"];Object.defineProperty(e,"__esModule",{value:!0}),e.warn=r,e.resolvePath=o,e.isPromise=i,e.getRouteConfig=a,e.resolveAsyncComponent=s,e.mapParams=u;var l=n(3),f=h(l),d=f["default"].prototype.generateQueryString,p=void 0},function(t,e,n){var r;(function(t){(function(){"use strict";function o(t,e,n){this.path=t,this.matcher=e,this.delegate=n}function i(t){this.routes={},this.children={},this.target=t}function a(t,e,n){return function(r,i){var s=t+r;return i?void i(a(s,e,n)):new o(t+r,e,n)}}function s(t,e,n){for(var r=0,o=0,i=t.length;i>o;o++)r+=t[o].path.length;e=e.substr(r);var a={path:e,handler:n};t.push(a)}function u(t,e,n,r){var o=e.routes;for(var i in o)if(o.hasOwnProperty(i)){var a=t.slice();s(a,i,o[i]),e.children[i]?u(a,e.children[i],n,r):n.call(r,a)}}function c(t){return"[object Array]"===Object.prototype.toString.call(t)}function h(t){this.string=t}function l(t){this.name=t}function f(t){this.name=t}function d(){}function p(t,e,n){"/"===t.charAt(0)&&(t=t.substr(1));var r=t.split("/"),o=[];n.val="";for(var i=0,a=r.length;a>i;i++){var s,u=r[i];(s=u.match(/^:([^\/]+)$/))?(o.push(new l(s[1])),e.push(s[1]),n.val+="3"):(s=u.match(/^\*([^\/]+)$/))?(o.push(new f(s[1])),n.val+="2",e.push(s[1])):""===u?(o.push(new d),n.val+="1"):(o.push(new h(u)),n.val+="4")}return n.val=+n.val,o}function v(t){this.charSpec=t,this.nextStates=[]}function g(t){return t.sort(function(t,e){return e.specificity.val-t.specificity.val})}function y(t,e){for(var n=[],r=0,o=t.length;o>r;r++){var i=t[r];n=n.concat(i.match(e))}return n}function m(t){this.queryParams=t||{}}function _(t,e,n){for(var r=t.handlers,o=t.regex,i=e.match(o),a=1,s=new m(n),u=0,c=r.length;c>u;u++){for(var h=r[u],l=h.names,f={},d=0,p=l.length;p>d;d++)f[l[d]]=i[a++];s.push({handler:h.handler,params:f,isDynamic:!!l.length})}return s}function w(t,e){return e.eachChar(function(e){t=t.put(e)}),t}function b(t){return t=t.replace(/\+/gm,"%20"),decodeURIComponent(t)}o.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}},i.prototype={add:function(t,e){this.routes[t]=e},addChild:function(t,e,n,r){var o=new i(e);this.children[t]=o;var s=a(t,o,r);r&&r.contextEntered&&r.contextEntered(e,s),n(s)}};var C=function(t,e){var n=new i;t(a("",n,this.delegate)),u([],n,function(t){e?e(this,t):this.add(t)},this)},x=["/",".","*","+","?","|","(",")","[","]","{","}","\\"],P=new RegExp("(\\"+x.join("|\\")+")","g");h.prototype={eachChar:function(t){for(var e,n=this.string,r=0,o=n.length;o>r;r++)e=n.charAt(r),t({validChars:e})},regex:function(){return this.string.replace(P,"\\$1")},generate:function(){return this.string}},l.prototype={eachChar:function(t){t({invalidChars:"/",repeat:!0})},regex:function(){return"([^/]+)"},generate:function(t){return t[this.name]}},f.prototype={eachChar:function(t){t({invalidChars:"",repeat:!0})},regex:function(){return"(.+)"},generate:function(t){return t[this.name]}},d.prototype={eachChar:function(){},regex:function(){return""},generate:function(){return""}},v.prototype={get:function(t){for(var e=this.nextStates,n=0,r=e.length;r>n;n++){var o=e[n],i=o.charSpec.validChars===t.validChars;if(i=i&&o.charSpec.invalidChars===t.invalidChars)return o}},put:function(t){var e;return(e=this.get(t))?e:(e=new v(t),this.nextStates.push(e),t.repeat&&e.nextStates.push(e),e)},match:function(t){for(var e,n,r,o=this.nextStates,i=[],a=0,s=o.length;s>a;a++)e=o[a],n=e.charSpec,"undefined"!=typeof(r=n.validChars)?-1!==r.indexOf(t)&&i.push(e):"undefined"!=typeof(r=n.invalidChars)&&-1===r.indexOf(t)&&i.push(e);return i}};var R=Object.create||function(t){function e(){}return e.prototype=t,new e};m.prototype=R({splice:Array.prototype.splice,slice:Array.prototype.slice,push:Array.prototype.push,length:0,queryParams:null});var k=function(){this.rootState=new v,this.names={}};k.prototype={add:function(t,e){for(var n,r=this.rootState,o="^",i={},a=[],s=[],u=!0,c=0,h=t.length;h>c;c++){var l=t[c],f=[],v=p(l.path,f,i);s=s.concat(v);for(var g=0,y=v.length;y>g;g++){var m=v[g];m instanceof d||(u=!1,r=r.put({validChars:"/"}),o+="/",r=w(r,m),o+=m.regex())}var _={handler:l.handler,names:f};a.push(_)}u&&(r=r.put({validChars:"/"}),o+="/"),r.handlers=a,r.regex=new RegExp(o+"$"),r.specificity=i,(n=e&&e.as)&&(this.names[n]={segments:s,handlers:a})},handlersFor:function(t){var e=this.names[t],n=[];if(!e)throw new Error("There is no route named "+t);for(var r=0,o=e.handlers.length;o>r;r++)n.push(e.handlers[r]);return n},hasRoute:function(t){return!!this.names[t]},generate:function(t,e){var n=this.names[t],r="";if(!n)throw new Error("There is no route named "+t);for(var o=n.segments,i=0,a=o.length;a>i;i++){var s=o[i];s instanceof d||(r+="/",r+=s.generate(e))}return"/"!==r.charAt(0)&&(r="/"+r),e&&e.queryParams&&(r+=this.generateQueryString(e.queryParams,n.handlers)),r},generateQueryString:function(t,e){var n=[],r=[];for(var o in t)t.hasOwnProperty(o)&&r.push(o);r.sort();for(var i=0,a=r.length;a>i;i++){o=r[i];var s=t[o];if(null!=s){var u=encodeURIComponent(o);if(c(s))for(var h=0,l=s.length;l>h;h++){var f=o+"[]="+encodeURIComponent(s[h]);n.push(f)}else u+="="+encodeURIComponent(s),n.push(u)}}return 0===n.length?"":"?"+n.join("&")},parseQueryString:function(t){for(var e=t.split("&"),n={},r=0;r<e.length;r++){var o,i=e[r].split("="),a=b(i[0]),s=a.length,u=!1;1===i.length?o="true":(s>2&&"[]"===a.slice(s-2)&&(u=!0,a=a.slice(0,s-2),n[a]||(n[a]=[])),o=i[1]?b(i[1]):""),u?n[a].push(o):n[a]=o}return n},recognize:function(t){var e,n,r,o,i=[this.rootState],a={},s=!1;if(o=t.indexOf("?"),-1!==o){var u=t.substr(o+1,t.length);t=t.substr(0,o),a=this.parseQueryString(u)}for(t=decodeURI(t),"/"!==t.charAt(0)&&(t="/"+t),e=t.length,e>1&&"/"===t.charAt(e-1)&&(t=t.substr(0,e-1),s=!0),n=0,r=t.length;r>n&&(i=y(i,t.charAt(n)),i.length);n++);var c=[];for(n=0,r=i.length;r>n;n++)i[n].handlers&&c.push(i[n]);i=g(c);var h=c[0];return h&&h.handlers?(s&&"(.+)$"===h.regex.source.slice(-5)&&(t+="/"),_(h,t,a)):void 0}},k.prototype.map=C,k.VERSION="0.1.9";var $=k;n(5).amd?(r=function(){return $}.call(e,n,e,t),!(void 0!==r&&(t.exports=r))):"undefined"!=typeof t&&t.exports?t.exports=$:"undefined"!=typeof this&&(this.RouteRecognizer=$)}).call(this)}).call(e,n(4)(t))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}},function(t,e){t.exports=function(){throw new Error("define cannot be used indirect")}},function(t,e,n){"use strict";var r=n(7)["default"],o=n(1)["default"];Object.defineProperty(e,"__esModule",{value:!0});var i=n(3),a=o(i),s={"abstract":n(8),hash:n(13),html5:n(14)},u=function c(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],e=t.hashbang,n=void 0===e?!0:e,o=t["abstract"],i=void 0===o?!1:o,u=t.history,h=void 0===u?!1:u,l=t.saveScrollPosition,f=void 0===l?!1:l,d=t.transitionOnLoad,p=void 0===d?!1:d,v=t.suppressTransitionError,g=void 0===v?!1:v,y=t.root,m=void 0===y?null:y,_=t.linkActiveClass,w=void 0===_?"v-link-active":_;if(r(this,c),!c.installed)throw new Error("Please install the Router with Vue.use() before creating an instance.");this.app=null,this._views=[],this._children=[],this._recognizer=new a["default"],this._guardRecognizer=new a["default"],this._started=!1,this._currentRoute={},this._currentTransition=null,this._previousTransition=null,this._notFoundHandler=null,this._beforeEachHook=null,this._hasPushState="undefined"!=typeof window&&window.history&&window.history.pushState,this._rendered=!1,this._transitionOnLoad=p,this._abstract=i,this._hashbang=n,this._history=this._hasPushState&&h,this._saveScrollPosition=f,this._linkActiveClass=w,this._suppress=g;var b=c.Vue.util.inBrowser;this.mode=!b||this._abstract?"abstract":this._history?"html5":"hash";var C=s[this.mode],x=this;this.history=new C({root:m,hashbang:this._hashbang,onChange:function(t,e,n){x._match(t,e,n)}})};e["default"]=u,u.installed=!1,t.exports=e["default"]},function(t,e){"use strict";e["default"]=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},e.__esModule=!0},function(t,e,n){"use strict";var r=n(9)["default"],o=n(7)["default"];Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),a=function(){function t(e){var n=e.onChange;o(this,t),this.onChange=n,this.currentPath="/"}return r(t,[{key:"start",value:function(){this.onChange("/")}},{key:"stop",value:function(){}},{key:"go",value:function(t){t=this.currentPath=this.formatPath(t),this.onChange(t)}},{key:"formatPath",value:function(t){return"/"===t.charAt(0)?t:i.resolvePath(this.currentPath,t)}}]),t}();e["default"]=a,t.exports=e["default"]},function(t,e,n){"use strict";var r=n(10)["default"];e["default"]=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),r(t,o.key,o)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),e.__esModule=!0},function(t,e,n){t.exports={"default":n(11),__esModule:!0}},function(t,e,n){var r=n(12);t.exports=function(t,e,n){return r.setDesc(t,e,n)}},function(t,e){var n=Object;t.exports={create:n.create,getProto:n.getPrototypeOf,isEnum:{}.propertyIsEnumerable,getDesc:n.getOwnPropertyDescriptor,setDesc:n.defineProperty,setDescs:n.defineProperties,getKeys:n.keys,getNames:n.getOwnPropertyNames,getSymbols:n.getOwnPropertySymbols,each:[].forEach}},function(t,e,n){"use strict";var r=n(9)["default"],o=n(7)["default"];Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),a=function(){function t(e){var n=e.hashbang,r=e.onChange;o(this,t),this.hashbang=n,this.onChange=r}return r(t,[{key:"start",value:function(){var t=this;this.listener=function(){var e=location.hash,n=t.formatPath(e,!0);if(n!==e)return void location.replace(n);var r=decodeURI(e.replace(/^#!?/,"")+location.search);t.onChange(r)},window.addEventListener("hashchange",this.listener),this.listener()}},{key:"stop",value:function(){window.removeEventListener("hashchange",this.listener)}},{key:"go",value:function(t,e){t=this.formatPath(t),e?location.replace(t):location.hash=t}},{key:"formatPath",value:function(t,e){t=t.replace(/^#!?/,"");var n="/"===t.charAt(0);e&&!n&&(t="/"+t);var r="#"+(this.hashbang?"!":"");return n||e?r+t:r+i.resolvePath(location.hash.replace(/^#!?/,""),t)}}]),t}();e["default"]=a,t.exports=e["default"]},function(t,e,n){"use strict";var r=n(9)["default"],o=n(7)["default"];Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),a=/#.*$/,s=function(){function t(e){var n=e.root,r=e.onChange;o(this,t),n?("/"!==n.charAt(0)&&(n="/"+n),this.root=n.replace(/\/$/,""),this.rootRE=new RegExp("^\\"+this.root)):this.root=null,this.onChange=r;var i=document.querySelector("base");this.base=i&&i.getAttribute("href")}return r(t,[{key:"start",value:function(){var t=this;this.listener=function(e){var n=decodeURI(location.pathname+location.search);this.root&&(n=n.replace(this.rootRE,"")),t.onChange(n,e&&e.state,location.hash)},window.addEventListener("popstate",this.listener),this.listener()}},{key:"stop",value:function(){window.removeEventListener("popstate",this.listener)}},{key:"go",value:function(t,e){var n=this.root,r=this.formatPath(t,n);e?history.replaceState({},"",r):(history.replaceState({pos:{x:window.pageXOffset,y:window.pageYOffset}},""),history.pushState({},"",r));var o=t.match(a),i=o&&o[0];t=r.replace(a,"").replace(this.rootRE,""),this.onChange(t,null,i)}},{key:"formatPath",value:function(t){return"/"===t.charAt(0)?this.root?this.root+"/"+t.replace(/^\//,""):t:i.resolvePath(this.base||location.pathname,t)}}]),t}();e["default"]=s,t.exports=e["default"]},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(2);e["default"]=function(t,e){e.prototype.map=function(t){for(var e in t)this.on(e,t[e])},e.prototype.on=function(t,e){"*"===t?this._notFound(e):this._addRoute(t,e,[])},e.prototype.redirect=function(t){for(var e in t)this._addRedirect(e,t[e])},e.prototype.alias=function(t){for(var e in t)this._addAlias(e,t[e])},e.prototype.beforeEach=function(t){this._beforeEachHook=t},e.prototype.go=function(t,e){this.history.go(t+"",e)},e.prototype.replace=function(t){this.go(t,!0)},e.prototype.start=function(e,n){if(this._started)return void r.warn("already started.");if(this._started=!0,!this.app){if(!e||!n)throw new Error("Must start vue-router with a component and a root container.");this._appContainer=n,this._appConstructor="function"==typeof e?e:t.extend(e)}this.history.start()},e.prototype.stop=function(){this.history.stop(),this._started=!1}},t.exports=e["default"]},function(t,e,n){"use strict";var r=n(1)["default"];Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),i=n(17),a=r(i),s=n(18),u=r(s);e["default"]=function(t,e){function n(e){var n=e.component;r.isPlainObject(n)&&(n=e.component=t.extend(n)),"function"!=typeof n&&(e.component=null,o.warn('invalid component for route "'+e.path+'"'))}var r=t.util;e.prototype._addRoute=function(t,e,r){if(n(e),r.push({path:t,handler:e}),this._recognizer.add(r),e.subRoutes)for(var o in e.subRoutes)this._addRoute(o,e.subRoutes[o],r.slice())},e.prototype._notFound=function(t){n(t),this._notFoundHandler=[{handler:t}]},e.prototype._addRedirect=function(t,e){this._addGuard(t,e,this.replace)},e.prototype._addAlias=function(t,e){this._addGuard(t,e,this._match)},e.prototype._addGuard=function(t,e,n){var r=this;this._guardRecognizer.add([{path:t,handler:function(t,i){var a=o.mapParams(e,t.params,i);n.call(r,a)}}])},e.prototype._checkGuard=function(t){var e=this._guardRecognizer.recognize(t);return e?(e[0].handler(e[0],e.queryParams),!0):void 0},e.prototype._match=function(t,e,n){var r=this;if(!this._checkGuard(t)){var o=this._currentRoute,i=this._currentTransition;if(!i||t!==o.path){var s=new a["default"](t,this),c=new u["default"](this,s,o);this._prevTransition=i,this._currentTransition=c,this.app||(this.app=new this._appConstructor({el:this._appContainer,_meta:{$route:s}}));var h=this._beforeEachHook,l=function(){c.start(function(){r._postTransition(s,e,n)})};h?c.callHook(h,null,l,!0):l(),this._rendered=!0}}},e.prototype._onTransitionValidated=function(t){var e=this._prevTransition;e&&(e.aborted=!0);var n=this._currentRoute=t.to;this.app.$route!==n&&(this.app.$route=n,this._children.forEach(function(t){t.$route=n}))},e.prototype._postTransition=function(e,n,r){var o=n&&n.pos;o&&this._saveScrollPosition?t.nextTick(function(){window.scrollTo(o.x,o.y)}):r&&t.nextTick(function(){var t=document.getElementById(r.slice(1));t&&window.scrollTo(window.scrollX,t.offsetTop)})}},t.exports=e["default"]},function(t,e,n){"use strict";function r(t,e,n){i(t,e,{value:n,enumerable:!1})}var o=n(7)["default"],i=n(10)["default"];Object.defineProperty(e,"__esModule",{value:!0});var a=function s(t,e){o(this,s),this.path=t;var n=e._recognizer.recognize(t);this.query=n?n.queryParams:{},this.params=n?[].reduce.call(n,function(t,e){if(e.params)for(var n in e.params)t[n]=e.params[n];return t},{}):{},this._aborted=!1,r(this,"_matched",n||e._notFoundHandler),r(this,"_router",e)};e["default"]=a,t.exports=e["default"]},function(t,e,n){"use strict";var r=n(9)["default"],o=n(7)["default"];Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),a=n(19),s=function(){function t(e,n,r){o(this,t),this.router=e,this.to=n,this.from=r,this.next=null,this.aborted=!1,this.deactivateQueue=e._views;var i=n._matched?Array.prototype.slice.call(n._matched):[];this.activateQueue=i.map(function(t){return t.handler})}return r(t,[{key:"abort",value:function(){if(!this.aborted){this.aborted=!0;var t=!this.from.path&&"/"===this.to.path;t||this.router.replace(this.from.path||"/")}}},{key:"redirect",value:function(t){this.aborted||(this.aborted=!0,t=i.mapParams(t,this.to.params,this.to.query),this.router.replace(t))}},{key:"start",value:function(t){var e=this,n=this.deactivateQueue,r=this.activateQueue,o=n.slice().reverse(),i=void 0,s=void 0;for(s=0;s<o.length&&a.canReuse(o[s],r[s],e);s++);s>0&&(i=o.slice(0,s),n=o.slice(s).reverse(),r=r.slice(s)),e.runQueue(n,a.canDeactivate,function(){e.runQueue(r,a.canActivate,function(){e.runQueue(n,a.deactivate,function(){if(e.router._onTransitionValidated(e),i&&i.forEach(function(t){a.reuse(t,e)}),n.length){var r=n[n.length-1],o=i?i.length:0;a.activate(r,e,o,t)}else t()})})})}},{key:"runQueue",value:function(t,e,n){function r(i){i>=t.length?n():e(t[i],o,function(){r(i+1)})}var o=this;r(0)}},{key:"callHook",value:function(t,e,n,r,o){var a=this,s=!1,u=function(t){return s?void i.warn("transition.next() should be called only once."):(s=!0,void(n&&!a.aborted&&n(t)))},c=function(t){o&&o(),a.abort(t)},h=function(t){if(o?u():c(),t&&!a.router._suppress)throw i.warn("Uncaught error during transition: "),t instanceof Error?t:new Error(t)},l={to:a.to,from:a.from,abort:c,next:u,redirect:function(){a.redirect.apply(a,arguments)}},f=void 0;try{f=t.call(e,l)}catch(d){return h(d)}var p=i.isPromise(f);r?"boolean"==typeof f?f?u():c():p&&f.then(function(t){t?u():c()},h):p&&f.then(u,h)}}]),t}();e["default"]=s,t.exports=e["default"]},function(t,e,n){"use strict";function r(t,e,n){var r=t.childVM;if(!r||!e)return!1;if(t.Component!==e.component)return!1;var o=h.getRouteConfig(r,"canReuse");return"boolean"==typeof o?o:o?o.call(r,{to:n.to,from:n.from}):!0}function o(t,e,n){var r=t.childVM,o=h.getRouteConfig(r,"canDeactivate");o?e.callHook(o,r,n,!0):n()}function i(t,e,n){h.resolveAsyncComponent(t,function(t){if(!e.aborted){var r=h.getRouteConfig(t,"canActivate");r?e.callHook(r,null,n,!0):n()}})}function a(t,e,n){var r=t.childVM,o=h.getRouteConfig(r,"deactivate");o?e.callHook(o,r,n):n()}function s(t,n,r,o){var i=n.activateQueue[r];if(!i)return t.setComponent(null),void(o&&o());var a=t.Component=i.component,s=h.getRouteConfig(a,"activate"),u=h.getRouteConfig(a,"data"),l=h.getRouteConfig(a,"waitForData");t.unbuild(!0);var f=t.build({_meta:{$loadingRouteData:!(!u||l)}}),d=function(){f.$destroy()},p=function(){var e=n.router;e._rendered||e._transitionOnLoad?t.transition(f):(t.setCurrent(f),f.$before(t.anchor,null,!1)),o&&o()},v=function(){t.childView&&e.activate(t.childView,n,r+1),u&&l?c(f,n,u,p,d):(u&&c(f,n,u),p())};s?n.callHook(s,f,v,!1,d):v()}function u(t,e){var n=t.childVM,r=h.getRouteConfig(n,"data");r&&c(n,e,r)}function c(t,e,n,r,o){t.$loadingRouteData=!0,e.callHook(n,t,function(e){for(var n in e)t.$set(n,e[n]);t.$loadingRouteData=!1,r&&r(e)},!1,o)}Object.defineProperty(e,"__esModule",{value:!0}),e.canReuse=r,e.canDeactivate=o,e.canActivate=i,e.deactivate=a,e.activate=s,e.reuse=u;var h=n(2)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(2);e["default"]=function(t){var e=t.util,n=t.directive("_component"),o=e.extend({},n);e.extend(o,{_isRouterView:!0,bind:function(){var t=this.vm.$route;if(!t)return void r.warn("<router-view> can only be used inside a router-enabled app.");this._isDynamicLiteral=!0,n.bind.call(this),this.keepAlive&&(this.keepAlive=!1,r.warn("<router-view> does not support keep-alive."));var e=this.router=t._router;e._views.unshift(this);var o=e._views[1];o&&(o.childView=this)},unbind:function(){this.router._views.$remove(this),n.unbind.call(this)}}),t.elementDirective("router-view",o)},t.exports=e["default"]},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(2);e["default"]=function(t){var e=t.util;t.directive("link",{isLiteral:!0,bind:function(){var t=this,n=this.vm;if(!n.$route)return void r.warn("v-link can only be used inside a router-enabled app.");var o=n.$route._router;this.handler=function(e){0===e.button&&(e.preventDefault(),null!=t.destination&&o.go(t.destination))},this.el.addEventListener("click",this.handler),this._isDynamicLiteral||this.update(this.expression),this.unwatch=n.$watch("$route.path",e.bind(this.updateClasses,this))},updateClasses:function(t){var n=this.el,r=this.destination,o=this.vm.$route._router,i=o._linkActiveClass,a=i+"-exact";0===t.indexOf(r)&&"/"!==t?e.addClass(n,i):e.removeClass(n,i),t===r?e.addClass(n,a):e.removeClass(n,a)},update:function(t){this.destination=t,this.updateClasses(this.vm.$route.path),t=t||"";var e=this.vm.$route._router,n="/"===t.charAt(0),r="hash"===e.mode||n?e.history.formatPath(t):t;"A"===this.el.tagName&&(r?this.el.href=r:this.el.removeAttribute("href"))},unbind:function(){this.el.removeEventListener("click",this.handler),this.unwatch&&this.unwatch()}})},t.exports=e["default"]},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=function(t){var e=t.prototype.$addChild;t.prototype.$addChild=function(t,n){var r=this.$route,o=r&&r._router;if(o){t=t||{};var i=t._meta=t._meta||{};i.$route=r,t._isRouterView&&(i.$loadingRouteData=i.$loadingRouteData||!1)}var a=e.call(this,t,n);return o&&(o._children.push(a),a.$on("hook:beforeDestroy",function(){o._children.$remove(a)})),a}},t.exports=e["default"]}])});
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):"object"==typeof exports?exports.VueRouter=e():t.VueRouter=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";var r=n(1)["default"];Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),i=n(6),a=r(i);a["default"].install=function(t){return a["default"].installed?void o.warn("already installed."):(n(15)(t,a["default"]),n(16)(t,a["default"]),n(20)(t),n(21)(t),n(22)(t),a["default"].Vue=t,void(a["default"].installed=!0))},"undefined"!=typeof window&&window.Vue&&window.Vue.use(a["default"]),e["default"]=a["default"],t.exports=e["default"]},function(t,e){"use strict";e["default"]=function(t){return t&&t.__esModule?t:{"default":t}},e.__esModule=!0},function(t,e,n){"use strict";function r(t,e){window.console&&(console.warn("[vue-router] "+t),e&&console.warn(e.stack))}function o(t,e){var n=t.match(/(\?.*)$/);if(n&&(n=n[1],t=t.slice(0,-n.length)),"?"===e.charAt(0))return t+e;var r=t.split("/");r.pop();for(var o=e.split("/"),i=0;i<o.length;i++){var a=o[i];"."!==a&&(".."===a?r.pop():r.push(a))}return""!==r[0]&&r.unshift(""),r.join("/")}function i(t){return t&&"function"==typeof t.then}function a(t,e){var n=t&&(t.$options||t.options);return n&&n.route&&n.route[e]}function s(t,e){p?p.$options.components._=t.component:p={resolve:n(6).Vue.prototype._resolveComponent,$options:{components:{_:t.component}}},p.resolve("_",function(n){t.component=n,e(n)})}function u(t,e,n){for(var r in e)t=c(t,e,r);return n&&(t+=d(n)),t}function c(t,e,n){var r=new RegExp(":"+n+"(\\/|$)"),o=e[n];return t.replace(r,function(t){return"/"===t.charAt(t.length-1)?o+"/":o})}var h=n(1)["default"];Object.defineProperty(e,"__esModule",{value:!0}),e.warn=r,e.resolvePath=o,e.isPromise=i,e.getRouteConfig=a,e.resolveAsyncComponent=s,e.mapParams=u;var l=n(3),f=h(l),d=f["default"].prototype.generateQueryString,p=void 0},function(t,e,n){var r;(function(t){(function(){"use strict";function o(t,e,n){this.path=t,this.matcher=e,this.delegate=n}function i(t){this.routes={},this.children={},this.target=t}function a(t,e,n){return function(r,i){var s=t+r;return i?void i(a(s,e,n)):new o(t+r,e,n)}}function s(t,e,n){for(var r=0,o=0,i=t.length;i>o;o++)r+=t[o].path.length;e=e.substr(r);var a={path:e,handler:n};t.push(a)}function u(t,e,n,r){var o=e.routes;for(var i in o)if(o.hasOwnProperty(i)){var a=t.slice();s(a,i,o[i]),e.children[i]?u(a,e.children[i],n,r):n.call(r,a)}}function c(t){return"[object Array]"===Object.prototype.toString.call(t)}function h(t){this.string=t}function l(t){this.name=t}function f(t){this.name=t}function d(){}function p(t,e,n){"/"===t.charAt(0)&&(t=t.substr(1));var r=t.split("/"),o=[];n.val="";for(var i=0,a=r.length;a>i;i++){var s,u=r[i];(s=u.match(/^:([^\/]+)$/))?(o.push(new l(s[1])),e.push(s[1]),n.val+="3"):(s=u.match(/^\*([^\/]+)$/))?(o.push(new f(s[1])),n.val+="2",e.push(s[1])):""===u?(o.push(new d),n.val+="1"):(o.push(new h(u)),n.val+="4")}return n.val=+n.val,o}function v(t){this.charSpec=t,this.nextStates=[]}function g(t){return t.sort(function(t,e){return e.specificity.val-t.specificity.val})}function y(t,e){for(var n=[],r=0,o=t.length;o>r;r++){var i=t[r];n=n.concat(i.match(e))}return n}function m(t){this.queryParams=t||{}}function _(t,e,n){for(var r=t.handlers,o=t.regex,i=e.match(o),a=1,s=new m(n),u=0,c=r.length;c>u;u++){for(var h=r[u],l=h.names,f={},d=0,p=l.length;p>d;d++)f[l[d]]=i[a++];s.push({handler:h.handler,params:f,isDynamic:!!l.length})}return s}function w(t,e){return e.eachChar(function(e){t=t.put(e)}),t}function b(t){return t=t.replace(/\+/gm,"%20"),decodeURIComponent(t)}o.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}},i.prototype={add:function(t,e){this.routes[t]=e},addChild:function(t,e,n,r){var o=new i(e);this.children[t]=o;var s=a(t,o,r);r&&r.contextEntered&&r.contextEntered(e,s),n(s)}};var C=function(t,e){var n=new i;t(a("",n,this.delegate)),u([],n,function(t){e?e(this,t):this.add(t)},this)},x=["/",".","*","+","?","|","(",")","[","]","{","}","\\"],P=new RegExp("(\\"+x.join("|\\")+")","g");h.prototype={eachChar:function(t){for(var e,n=this.string,r=0,o=n.length;o>r;r++)e=n.charAt(r),t({validChars:e})},regex:function(){return this.string.replace(P,"\\$1")},generate:function(){return this.string}},l.prototype={eachChar:function(t){t({invalidChars:"/",repeat:!0})},regex:function(){return"([^/]+)"},generate:function(t){return t[this.name]}},f.prototype={eachChar:function(t){t({invalidChars:"",repeat:!0})},regex:function(){return"(.+)"},generate:function(t){return t[this.name]}},d.prototype={eachChar:function(){},regex:function(){return""},generate:function(){return""}},v.prototype={get:function(t){for(var e=this.nextStates,n=0,r=e.length;r>n;n++){var o=e[n],i=o.charSpec.validChars===t.validChars;if(i=i&&o.charSpec.invalidChars===t.invalidChars)return o}},put:function(t){var e;return(e=this.get(t))?e:(e=new v(t),this.nextStates.push(e),t.repeat&&e.nextStates.push(e),e)},match:function(t){for(var e,n,r,o=this.nextStates,i=[],a=0,s=o.length;s>a;a++)e=o[a],n=e.charSpec,"undefined"!=typeof(r=n.validChars)?-1!==r.indexOf(t)&&i.push(e):"undefined"!=typeof(r=n.invalidChars)&&-1===r.indexOf(t)&&i.push(e);return i}};var R=Object.create||function(t){function e(){}return e.prototype=t,new e};m.prototype=R({splice:Array.prototype.splice,slice:Array.prototype.slice,push:Array.prototype.push,length:0,queryParams:null});var k=function(){this.rootState=new v,this.names={}};k.prototype={add:function(t,e){for(var n,r=this.rootState,o="^",i={},a=[],s=[],u=!0,c=0,h=t.length;h>c;c++){var l=t[c],f=[],v=p(l.path,f,i);s=s.concat(v);for(var g=0,y=v.length;y>g;g++){var m=v[g];m instanceof d||(u=!1,r=r.put({validChars:"/"}),o+="/",r=w(r,m),o+=m.regex())}var _={handler:l.handler,names:f};a.push(_)}u&&(r=r.put({validChars:"/"}),o+="/"),r.handlers=a,r.regex=new RegExp(o+"$"),r.specificity=i,(n=e&&e.as)&&(this.names[n]={segments:s,handlers:a})},handlersFor:function(t){var e=this.names[t],n=[];if(!e)throw new Error("There is no route named "+t);for(var r=0,o=e.handlers.length;o>r;r++)n.push(e.handlers[r]);return n},hasRoute:function(t){return!!this.names[t]},generate:function(t,e){var n=this.names[t],r="";if(!n)throw new Error("There is no route named "+t);for(var o=n.segments,i=0,a=o.length;a>i;i++){var s=o[i];s instanceof d||(r+="/",r+=s.generate(e))}return"/"!==r.charAt(0)&&(r="/"+r),e&&e.queryParams&&(r+=this.generateQueryString(e.queryParams,n.handlers)),r},generateQueryString:function(t,e){var n=[],r=[];for(var o in t)t.hasOwnProperty(o)&&r.push(o);r.sort();for(var i=0,a=r.length;a>i;i++){o=r[i];var s=t[o];if(null!=s){var u=encodeURIComponent(o);if(c(s))for(var h=0,l=s.length;l>h;h++){var f=o+"[]="+encodeURIComponent(s[h]);n.push(f)}else u+="="+encodeURIComponent(s),n.push(u)}}return 0===n.length?"":"?"+n.join("&")},parseQueryString:function(t){for(var e=t.split("&"),n={},r=0;r<e.length;r++){var o,i=e[r].split("="),a=b(i[0]),s=a.length,u=!1;1===i.length?o="true":(s>2&&"[]"===a.slice(s-2)&&(u=!0,a=a.slice(0,s-2),n[a]||(n[a]=[])),o=i[1]?b(i[1]):""),u?n[a].push(o):n[a]=o}return n},recognize:function(t){var e,n,r,o,i=[this.rootState],a={},s=!1;if(o=t.indexOf("?"),-1!==o){var u=t.substr(o+1,t.length);t=t.substr(0,o),a=this.parseQueryString(u)}for(t=decodeURI(t),"/"!==t.charAt(0)&&(t="/"+t),e=t.length,e>1&&"/"===t.charAt(e-1)&&(t=t.substr(0,e-1),s=!0),n=0,r=t.length;r>n&&(i=y(i,t.charAt(n)),i.length);n++);var c=[];for(n=0,r=i.length;r>n;n++)i[n].handlers&&c.push(i[n]);i=g(c);var h=c[0];return h&&h.handlers?(s&&"(.+)$"===h.regex.source.slice(-5)&&(t+="/"),_(h,t,a)):void 0}},k.prototype.map=C,k.VERSION="0.1.9";var E=k;n(5).amd?(r=function(){return E}.call(e,n,e,t),!(void 0!==r&&(t.exports=r))):"undefined"!=typeof t&&t.exports?t.exports=E:"undefined"!=typeof this&&(this.RouteRecognizer=E)}).call(this)}).call(e,n(4)(t))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}},function(t,e){t.exports=function(){throw new Error("define cannot be used indirect")}},function(t,e,n){"use strict";var r=n(7)["default"],o=n(1)["default"];Object.defineProperty(e,"__esModule",{value:!0});var i=n(3),a=o(i),s={"abstract":n(8),hash:n(13),html5:n(14)},u=function c(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],e=t.hashbang,n=void 0===e?!0:e,o=t["abstract"],i=void 0===o?!1:o,u=t.history,h=void 0===u?!1:u,l=t.saveScrollPosition,f=void 0===l?!1:l,d=t.transitionOnLoad,p=void 0===d?!1:d,v=t.suppressTransitionError,g=void 0===v?!1:v,y=t.root,m=void 0===y?null:y,_=t.linkActiveClass,w=void 0===_?"v-link-active":_;if(r(this,c),!c.installed)throw new Error("Please install the Router with Vue.use() before creating an instance.");this.app=null,this._views=[],this._children=[],this._recognizer=new a["default"],this._guardRecognizer=new a["default"],this._started=!1,this._currentRoute={},this._currentTransition=null,this._previousTransition=null,this._notFoundHandler=null,this._beforeEachHook=null,this._afterEachHook=null,this._hasPushState="undefined"!=typeof window&&window.history&&window.history.pushState,this._rendered=!1,this._transitionOnLoad=p,this._abstract=i,this._hashbang=n,this._history=this._hasPushState&&h,this._saveScrollPosition=f,this._linkActiveClass=w,this._suppress=g;var b=c.Vue.util.inBrowser;this.mode=!b||this._abstract?"abstract":this._history?"html5":"hash";var C=s[this.mode],x=this;this.history=new C({root:m,hashbang:this._hashbang,onChange:function(t,e,n){x._match(t,e,n)}})};e["default"]=u,u.installed=!1,t.exports=e["default"]},function(t,e){"use strict";e["default"]=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},e.__esModule=!0},function(t,e,n){"use strict";var r=n(9)["default"],o=n(7)["default"];Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),a=function(){function t(e){var n=e.onChange;o(this,t),this.onChange=n,this.currentPath="/"}return r(t,[{key:"start",value:function(){this.onChange("/")}},{key:"stop",value:function(){}},{key:"go",value:function(t){t=this.currentPath=this.formatPath(t),this.onChange(t)}},{key:"formatPath",value:function(t){return"/"===t.charAt(0)?t:i.resolvePath(this.currentPath,t)}}]),t}();e["default"]=a,t.exports=e["default"]},function(t,e,n){"use strict";var r=n(10)["default"];e["default"]=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),r(t,o.key,o)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),e.__esModule=!0},function(t,e,n){t.exports={"default":n(11),__esModule:!0}},function(t,e,n){var r=n(12);t.exports=function(t,e,n){return r.setDesc(t,e,n)}},function(t,e){var n=Object;t.exports={create:n.create,getProto:n.getPrototypeOf,isEnum:{}.propertyIsEnumerable,getDesc:n.getOwnPropertyDescriptor,setDesc:n.defineProperty,setDescs:n.defineProperties,getKeys:n.keys,getNames:n.getOwnPropertyNames,getSymbols:n.getOwnPropertySymbols,each:[].forEach}},function(t,e,n){"use strict";var r=n(9)["default"],o=n(7)["default"];Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),a=function(){function t(e){var n=e.hashbang,r=e.onChange;o(this,t),this.hashbang=n,this.onChange=r}return r(t,[{key:"start",value:function(){var t=this;this.listener=function(){var e=location.hash,n=t.formatPath(e,!0);if(n!==e)return void location.replace(n);var r=decodeURI(e.replace(/^#!?/,"")+location.search);t.onChange(r)},window.addEventListener("hashchange",this.listener),this.listener()}},{key:"stop",value:function(){window.removeEventListener("hashchange",this.listener)}},{key:"go",value:function(t,e){t=this.formatPath(t),e?location.replace(t):location.hash=t}},{key:"formatPath",value:function(t,e){t=t.replace(/^#!?/,"");var n="/"===t.charAt(0);e&&!n&&(t="/"+t);var r="#"+(this.hashbang?"!":"");return n||e?r+t:r+i.resolvePath(location.hash.replace(/^#!?/,""),t)}}]),t}();e["default"]=a,t.exports=e["default"]},function(t,e,n){"use strict";var r=n(9)["default"],o=n(7)["default"];Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),a=/#.*$/,s=function(){function t(e){var n=e.root,r=e.onChange;o(this,t),n?("/"!==n.charAt(0)&&(n="/"+n),this.root=n.replace(/\/$/,""),this.rootRE=new RegExp("^\\"+this.root)):this.root=null,this.onChange=r;var i=document.querySelector("base");this.base=i&&i.getAttribute("href")}return r(t,[{key:"start",value:function(){var t=this;this.listener=function(e){var n=decodeURI(location.pathname+location.search);t.root&&(n=n.replace(t.rootRE,"")),t.onChange(n,e&&e.state,location.hash)},window.addEventListener("popstate",this.listener),this.listener()}},{key:"stop",value:function(){window.removeEventListener("popstate",this.listener)}},{key:"go",value:function(t,e){var n=this.root,r=this.formatPath(t,n);e?history.replaceState({},"",r):(history.replaceState({pos:{x:window.pageXOffset,y:window.pageYOffset}},""),history.pushState({},"",r));var o=t.match(a),i=o&&o[0];t=r.replace(a,"").replace(this.rootRE,""),this.onChange(t,null,i)}},{key:"formatPath",value:function(t){return"/"===t.charAt(0)?this.root?this.root+"/"+t.replace(/^\//,""):t:i.resolvePath(this.base||location.pathname,t)}}]),t}();e["default"]=s,t.exports=e["default"]},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(2);e["default"]=function(t,e){e.prototype.map=function(t){for(var e in t)this.on(e,t[e])},e.prototype.on=function(t,e){"*"===t?this._notFound(e):this._addRoute(t,e,[])},e.prototype.redirect=function(t){for(var e in t)this._addRedirect(e,t[e])},e.prototype.alias=function(t){for(var e in t)this._addAlias(e,t[e])},e.prototype.beforeEach=function(t){this._beforeEachHook=t},e.prototype.afterEach=function(t){this._afterEachHook=t},e.prototype.go=function(t,e){this.history.go(t+"",e)},e.prototype.replace=function(t){this.go(t,!0)},e.prototype.start=function(e,n){if(this._started)return void r.warn("already started.");if(this._started=!0,!this.app){if(!e||!n)throw new Error("Must start vue-router with a component and a root container.");this._appContainer=n,this._appConstructor="function"==typeof e?e:t.extend(e)}this.history.start()},e.prototype.stop=function(){this.history.stop(),this._started=!1}},t.exports=e["default"]},function(t,e,n){"use strict";var r=n(1)["default"];Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),i=n(17),a=r(i),s=n(18),u=r(s);e["default"]=function(t,e){function n(e){var n=e.component;r.isPlainObject(n)&&(n=e.component=t.extend(n)),"function"!=typeof n&&(e.component=null,o.warn('invalid component for route "'+e.path+'"'))}var r=t.util;e.prototype._addRoute=function(t,e,r){if(n(e),r.push({path:t,handler:e}),this._recognizer.add(r),e.subRoutes)for(var o in e.subRoutes)this._addRoute(o,e.subRoutes[o],r.slice())},e.prototype._notFound=function(t){n(t),this._notFoundHandler=[{handler:t}]},e.prototype._addRedirect=function(t,e){this._addGuard(t,e,this.replace)},e.prototype._addAlias=function(t,e){this._addGuard(t,e,this._match)},e.prototype._addGuard=function(t,e,n){var r=this;this._guardRecognizer.add([{path:t,handler:function(t,i){var a=o.mapParams(e,t.params,i);n.call(r,a)}}])},e.prototype._checkGuard=function(t){var e=this._guardRecognizer.recognize(t);return e?(e[0].handler(e[0],e.queryParams),!0):void 0},e.prototype._match=function(t,e,n){var r=this;if(!this._checkGuard(t)){var o=this._currentRoute,i=this._currentTransition;if(!i||t!==o.path){var s=new a["default"](t,this),c=new u["default"](this,s,o);this._prevTransition=i,this._currentTransition=c,this.app||(this.app=new this._appConstructor({el:this._appContainer,_meta:{$route:s}}));var h=this._beforeEachHook,l=function(){c.start(function(){r._postTransition(s,e,n)})};h?c.callHook(h,null,l,!0):l(),this._rendered=!0}}},e.prototype._onTransitionValidated=function(t){var e=this._prevTransition;e&&(e.aborted=!0);var n=this._currentRoute=t.to;this.app.$route!==n&&(this.app.$route=n,this._children.forEach(function(t){t.$route=n})),this._afterEachHook&&this._afterEachHook.call(null,{to:t.to,from:t.from})},e.prototype._postTransition=function(e,n,r){var o=n&&n.pos;o&&this._saveScrollPosition?t.nextTick(function(){window.scrollTo(o.x,o.y)}):r&&t.nextTick(function(){var t=document.getElementById(r.slice(1));t&&window.scrollTo(window.scrollX,t.offsetTop)})}},t.exports=e["default"]},function(t,e,n){"use strict";var r=n(7)["default"];Object.defineProperty(e,"__esModule",{value:!0});var o=function i(t,e){r(this,i),this.path=t,this.router=e;var n=e._recognizer.recognize(t);this.query=n?n.queryParams:{},this.params=n?[].reduce.call(n,function(t,e){if(e.params)for(var n in e.params)t[n]=e.params[n];return t},{}):{},this._matched=n||e._notFoundHandler};e["default"]=o,t.exports=e["default"]},function(t,e,n){"use strict";var r=n(9)["default"],o=n(7)["default"];Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),a=n(19),s=function(){function t(e,n,r){o(this,t),this.router=e,this.to=n,this.from=r,this.next=null,this.aborted=!1,this.deactivateQueue=e._views;var i=n._matched?Array.prototype.slice.call(n._matched):[];this.activateQueue=i.map(function(t){return t.handler})}return r(t,[{key:"abort",value:function(){if(!this.aborted){this.aborted=!0;var t=!this.from.path&&"/"===this.to.path;t||this.router.replace(this.from.path||"/")}}},{key:"redirect",value:function(t){this.aborted||(this.aborted=!0,t=i.mapParams(t,this.to.params,this.to.query),this.router.replace(t))}},{key:"start",value:function(t){var e=this,n=this.deactivateQueue,r=this.activateQueue,o=n.slice().reverse(),i=void 0,s=void 0;for(s=0;s<o.length&&a.canReuse(o[s],r[s],e);s++);s>0&&(i=o.slice(0,s),n=o.slice(s).reverse(),r=r.slice(s)),e.runQueue(n,a.canDeactivate,function(){e.runQueue(r,a.canActivate,function(){e.runQueue(n,a.deactivate,function(){if(e.router._onTransitionValidated(e),i&&i.forEach(function(t){a.reuse(t,e)}),n.length){var r=n[n.length-1],o=i?i.length:0;a.activate(r,e,o,t)}else t()})})})}},{key:"runQueue",value:function(t,e,n){function r(i){i>=t.length?n():e(t[i],o,function(){r(i+1)})}var o=this;r(0)}},{key:"callHook",value:function(t,e,n,r,o){var a=this,s=!1,u=function(t){return s?void i.warn("transition.next() should be called only once."):(s=!0,void(n&&!a.aborted&&n(t)))},c=function(t){o&&o(),a.abort(t)},h=function(t){if(o?u():c(),t&&!a.router._suppress)throw i.warn("Uncaught error during transition: "),t instanceof Error?t:new Error(t)},l={to:a.to,from:a.from,abort:c,next:u,redirect:function(){a.redirect.apply(a,arguments)}},f=void 0;try{f=t.call(e,l)}catch(d){return h(d)}var p=i.isPromise(f);r?"boolean"==typeof f?f?u():c():p&&f.then(function(t){t?u():c()},h):p&&f.then(u,h)}}]),t}();e["default"]=s,t.exports=e["default"]},function(t,e,n){"use strict";function r(t,e,n){var r=t.childVM;if(!r||!e)return!1;if(t.Component!==e.component)return!1;var o=h.getRouteConfig(r,"canReuse");return"boolean"==typeof o?o:o?o.call(r,{to:n.to,from:n.from}):!0}function o(t,e,n){var r=t.childVM,o=h.getRouteConfig(r,"canDeactivate");o?e.callHook(o,r,n,!0):n()}function i(t,e,n){h.resolveAsyncComponent(t,function(t){if(!e.aborted){var r=h.getRouteConfig(t,"canActivate");r?e.callHook(r,null,n,!0):n()}})}function a(t,e,n){var r=t.childVM,o=h.getRouteConfig(r,"deactivate");o?e.callHook(o,r,n):n()}function s(t,n,r,o){var i=n.activateQueue[r];if(!i)return t.setComponent(null),void(o&&o());var a=t.Component=i.component,s=h.getRouteConfig(a,"activate"),u=h.getRouteConfig(a,"data"),l=h.getRouteConfig(a,"waitForData");t.unbuild(!0);var f=t.build({_meta:{$loadingRouteData:!(!u||l)}}),d=function(){f.$destroy()},p=function(){var e=n.router;e._rendered||e._transitionOnLoad?t.transition(f):(t.setCurrent(f),f.$before(t.anchor,null,!1)),o&&o()},v=function(){t.childView&&e.activate(t.childView,n,r+1),u&&l?c(f,n,u,p,d):(u&&c(f,n,u),p())};s?n.callHook(s,f,v,!1,d):v()}function u(t,e){var n=t.childVM,r=h.getRouteConfig(n,"data");r&&c(n,e,r)}function c(t,e,n,r,o){t.$loadingRouteData=!0,e.callHook(n,t,function(e){for(var n in e)t.$set(n,e[n]);t.$loadingRouteData=!1,r&&r(e)},!1,o)}Object.defineProperty(e,"__esModule",{value:!0}),e.canReuse=r,e.canDeactivate=o,e.canActivate=i,e.deactivate=a,e.activate=s,e.reuse=u;var h=n(2)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(2);e["default"]=function(t){var e=t.util,n=t.directive("_component"),o=e.extend({},n);e.extend(o,{_isRouterView:!0,bind:function(){var t=this.vm.$route;if(!t)return void r.warn("<router-view> can only be used inside a router-enabled app.");this._isDynamicLiteral=!0,n.bind.call(this),this.keepAlive&&(this.keepAlive=!1,r.warn("<router-view> does not support keep-alive."));var e=this.router=t.router;e._views.unshift(this);var o=e._views[1];o&&(o.childView=this)},unbind:function(){this.router._views.$remove(this),n.unbind.call(this)}}),t.elementDirective("router-view",o)},t.exports=e["default"]},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(2);e["default"]=function(t){var e=t.util;t.directive("link",{isLiteral:!0,bind:function(){var t=this,n=this.vm;if(!n.$route)return void r.warn("v-link can only be used inside a router-enabled app.");var o=n.$route.router;this.handler=function(e){0===e.button&&(e.preventDefault(),null!=t.destination&&o.go(t.destination))},this.el.addEventListener("click",this.handler),this._isDynamicLiteral||this.update(this.expression),this.unwatch=n.$watch("$route.path",e.bind(this.updateClasses,this))},updateClasses:function(t){var n=this.el,r=this.destination,o=this.vm.$route.router,i=o._linkActiveClass,a=i+"-exact";0===t.indexOf(r)&&"/"!==t?e.addClass(n,i):e.removeClass(n,i),t===r?e.addClass(n,a):e.removeClass(n,a)},update:function(t){this.destination=t,this.updateClasses(this.vm.$route.path),t=t||"";var e=this.vm.$route.router,n="/"===t.charAt(0),r="hash"===e.mode||n?e.history.formatPath(t):t;"A"===this.el.tagName&&(r?this.el.href=r:this.el.removeAttribute("href"))},unbind:function(){this.el.removeEventListener("click",this.handler),this.unwatch&&this.unwatch()}})},t.exports=e["default"]},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=function(t){var e=t.prototype.$addChild;t.prototype.$addChild=function(t,n){var r=this.$route,o=r&&r.router;if(o){t=t||{};var i=t._meta=t._meta||{};i.$route=r,t._isRouterView&&(i.$loadingRouteData=i.$loadingRouteData||!1)}var a=e.call(this,t,n);return o&&(o._children.push(a),a.$on("hook:beforeDestroy",function(){o._children.$remove(a)})),a}},t.exports=e["default"]}])});

@@ -29,3 +29,3 @@ 'use strict';

}
var router = vm.$route._router;
var router = vm.$route.router;
this.handler = function (e) {

@@ -50,3 +50,3 @@ if (e.button === 0) {

var dest = this.destination;
var router = this.vm.$route._router;
var router = this.vm.$route.router;
var activeClass = router._linkActiveClass;

@@ -70,3 +70,3 @@ var exactClass = activeClass + '-exact';

path = path || '';
var router = this.vm.$route._router;
var router = this.vm.$route.router;
var isAbsolute = path.charAt(0) === '/';

@@ -73,0 +73,0 @@ // do not format non-hash relative paths

@@ -43,3 +43,3 @@ 'use strict';

// managed by the pipeline.
var router = this.router = route._router;
var router = this.router = route.router;
router._views.unshift(this);

@@ -46,0 +46,0 @@

@@ -42,9 +42,10 @@ 'use strict';

value: function start() {
var self = this;
var _this = this;
this.listener = function (e) {
var url = decodeURI(location.pathname + location.search);
if (this.root) {
url = url.replace(this.rootRE, '');
if (_this.root) {
url = url.replace(_this.rootRE, '');
}
self.onChange(url, e && e.state, location.hash);
_this.onChange(url, e && e.state, location.hash);
};

@@ -51,0 +52,0 @@ window.addEventListener('popstate', this.listener);

@@ -38,3 +38,3 @@ 'use strict';

if (typeof window !== 'undefined' && window.Vue) {
_router2['default'].install(window.Vue);
window.Vue.use(_router2['default']);
}

@@ -41,0 +41,0 @@

@@ -15,3 +15,3 @@ // overriding Vue's $addChild method, so that every child

var route = this.$route;
var router = route && route._router;
var router = route && route.router;

@@ -18,0 +18,0 @@ // inject meta

@@ -8,9 +8,7 @@ /**

'use strict';
"use strict";
var _classCallCheck = require('babel-runtime/helpers/class-call-check')['default'];
var _classCallCheck = require("babel-runtime/helpers/class-call-check")["default"];
var _Object$defineProperty = require('babel-runtime/core-js/object/define-property')['default'];
Object.defineProperty(exports, '__esModule', {
Object.defineProperty(exports, "__esModule", {
value: true

@@ -23,2 +21,4 @@ });

this.path = path;
this.router = router;
var matched = router._recognizer.recognize(path);

@@ -38,15 +38,6 @@

// private stuff
this._aborted = false;
def(this, '_matched', matched || router._notFoundHandler);
def(this, '_router', router);
this._matched = matched || router._notFoundHandler;
};
exports['default'] = Route;
function def(obj, key, val) {
_Object$defineProperty(obj, key, {
value: val,
enumerable: false
});
}
module.exports = exports['default'];
exports["default"] = Route;
module.exports = exports["default"];

@@ -76,2 +76,12 @@ 'use strict';

/**
* Set global after hook.
*
* @param {Function} fn
*/
Router.prototype.afterEach = function (fn) {
this._afterEachHook = fn;
};
/**
* Navigate to a given path.

@@ -78,0 +88,0 @@ * The path is assumed to be already decoded, and will

@@ -70,2 +70,3 @@ 'use strict';

this._beforeEachHook = null;
this._afterEachHook = null;

@@ -72,0 +73,0 @@ // feature detection

@@ -208,2 +208,9 @@ 'use strict';

}
// call global after hook
if (this._afterEachHook) {
this._afterEachHook.call(null, {
to: transition.to,
from: transition.from
});
}
};

@@ -210,0 +217,0 @@

{
"name": "vue-router",
"version": "0.5.1",
"version": "0.5.2",
"description": "A router for Vue.js",

@@ -16,3 +16,4 @@ "main": "lib/index.js",

"release": "bash ./build/release.sh",
"docs": "bash ./build/update-docs.sh",
"docs": "cd docs && gitbook serve",
"deploy-docs": "bash ./build/update-docs.sh",
"test": "npm run lint && npm run unit && npm run e2e-local"

@@ -40,5 +41,5 @@ },

"chromedriver": "2.16.0",
"css-loader": "^0.15.4",
"css-loader": "^0.16.0",
"es6-promise": "^3.0.2",
"eslint": "^0.24.0",
"eslint": "^1.1.0",
"express": "^4.12.3",

@@ -49,3 +50,3 @@ "html-loader": "^0.3.0",

"karma": "^0.13.8",
"karma-coverage": "^0.2.7",
"karma-coverage": "^0.5.0",
"karma-jasmine": "^0.3.5",

@@ -60,3 +61,3 @@ "karma-phantomjs-launcher": "^0.2.1",

"vue": "yyx990803/vue#dev",
"vue-loader": "^2.1.1",
"vue-loader": "^3.0.3",
"webpack": "^1.11.0",

@@ -63,0 +64,0 @@ "webpack-dev-server": "^1.10.1"

@@ -1,2 +0,2 @@

# vue-router [![Build Status](https://img.shields.io/circleci/project/vuejs/vue-router/master.svg)](https://circleci.com/gh/vuejs/vue-router)
# vue-router [![Build Status](https://img.shields.io/circleci/project/vuejs/vue-router/master.svg)](https://circleci.com/gh/vuejs/vue-router) [![npm package](https://img.shields.io/npm/v/vue-router.svg)](https://www.npmjs.com/package/vue-router)

@@ -3,0 +3,0 @@ **Compatibility Note:** `vue-router` requires Vue.js 0.12.10+

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc