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.2 to 0.6.0

4

dist/vue-router.min.js
/*!
* vue-router v0.5.2
* vue-router v0.6.0
* (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&&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"]}])});
!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"],o=n(2)["default"];Object.defineProperty(e,"__esModule",{value:!0});var a=n(3),i=o(a),s=n(4),u=o(s),c=n(7),h=o(c),l=n(8),f=o(l),d=n(26),p=o(d),v=n(27),g=o(v),y=n(28),m=o(y),_=n(29),w=o(_),b=n(30),x=o(b),C=n(31),P=o(C),R={"abstract":w["default"],hash:x["default"],html5:P["default"]},k=function E(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],e=t.hashbang,n=void 0===e?!0:e,o=t["abstract"],a=void 0===o?!1:o,s=t.history,c=void 0===s?!1:s,h=t.saveScrollPosition,l=void 0===h?!1:h,f=t.transitionOnLoad,d=void 0===f?!1:f,p=t.suppressTransitionError,v=void 0===p?!1:p,g=t.root,y=void 0===g?null:g,m=t.linkActiveClass,_=void 0===m?"v-link-active":m;if(r(this,E),!E.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 u["default"],this._guardRecognizer=new u["default"],this._started=!1,this._currentRoute={},this._currentTransition=null,this._previousTransition=null,this._notFoundHandler=null,this._beforeEachHooks=[],this._afterEachHooks=[],this._hasPushState="undefined"!=typeof window&&window.history&&window.history.pushState,this._rendered=!1,this._transitionOnLoad=d,this._abstract=a,this._hashbang=n,this._history=this._hasPushState&&c,this._saveScrollPosition=l,this._linkActiveClass=_,this._suppress=v;var w=i["default"].Vue.util.inBrowser;this.mode=!w||this._abstract?"abstract":this._history?"html5":"hash";var b=R[this.mode],x=this;this.history=new b({root:y,hashbang:this._hashbang,onChange:function(t,e,n){x._match(t,e,n)}})};e["default"]=k,k.installed=!1,k.install=function(t){if(k.installed)return void a.warn("already installed.");h["default"](t,k),f["default"](t,k),p["default"](t),g["default"](t),m["default"](t),i["default"].Vue=t;var e=t.config.optionMergeStrategies;e&&(e.route=e.methods),k.installed=!0},"undefined"!=typeof window&&window.Vue&&window.Vue.use(k),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){"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("/"),a=0;a<o.length;a++){var i=o[a];"."!==i&&(".."===i?r.pop():r.push(i))}return""!==r[0]&&r.unshift(""),r.join("/")}function a(t){return t&&"function"==typeof t.then}function i(t,e){var n=t&&(t.$options||t.options);return n&&n.route&&n.route[e]}function s(t,e){v?v.$options.components._=t.component:v={resolve:p.Vue.prototype._resolveComponent,$options:{components:{_:t.component}}},v.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(2)["default"];Object.defineProperty(e,"__esModule",{value:!0}),e.warn=r,e.resolvePath=o,e.isPromise=a,e.getRouteConfig=i,e.resolveAsyncComponent=s,e.mapParams=u;var l=n(4),f=h(l),d=f["default"].prototype.generateQueryString,p={};e["default"]=p;var v=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 a(t){this.routes={},this.children={},this.target=t}function i(t,e,n){return function(r,a){var s=t+r;return a?void a(i(s,e,n)):new o(t+r,e,n)}}function s(t,e,n){for(var r=0,o=0,a=t.length;a>o;o++)r+=t[o].path.length;e=e.substr(r);var i={path:e,handler:n};t.push(i)}function u(t,e,n,r){var o=e.routes;for(var a in o)if(o.hasOwnProperty(a)){var i=t.slice();s(i,a,o[a]),e.children[a]?u(i,e.children[a],n,r):n.call(r,i)}}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 a=0,i=r.length;i>a;a++){var s,u=r[a];(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 a=t[r];n=n.concat(a.match(e))}return n}function m(t){this.queryParams=t||{}}function _(t,e,n){for(var r=t.handlers,o=t.regex,a=e.match(o),i=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]]=a[i++];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}},a.prototype={add:function(t,e){this.routes[t]=e},addChild:function(t,e,n,r){var o=new a(e);this.children[t]=o;var s=i(t,o,r);r&&r.contextEntered&&r.contextEntered(e,s),n(s)}};var x=function(t,e){var n=new a;t(i("",n,this.delegate)),u([],n,function(t){e?e(this,t):this.add(t)},this)},C=["/",".","*","+","?","|","(",")","[","]","{","}","\\"],P=new RegExp("(\\"+C.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],a=o.charSpec.validChars===t.validChars;if(a=a&&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,a=[],i=0,s=o.length;s>i;i++)e=o[i],n=e.charSpec,"undefined"!=typeof(r=n.validChars)?-1!==r.indexOf(t)&&a.push(e):"undefined"!=typeof(r=n.invalidChars)&&-1===r.indexOf(t)&&a.push(e);return a}};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="^",a={},i=[],s=[],u=!0,c=0,h=t.length;h>c;c++){var l=t[c],f=[],v=p(l.path,f,a);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};i.push(_)}u&&(r=r.put({validChars:"/"}),o+="/"),r.handlers=i,r.regex=new RegExp(o+"$"),r.specificity=a,(n=e&&e.as)&&(this.names[n]={segments:s,handlers:i})},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,a=0,i=o.length;i>a;a++){var s=o[a];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 a=0,i=r.length;i>a;a++){o=r[a];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,a=e[r].split("="),i=b(a[0]),s=i.length,u=!1;1===a.length?o="true":(s>2&&"[]"===i.slice(s-2)&&(u=!0,i=i.slice(0,s-2),n[i]||(n[i]=[])),o=a[1]?b(a[1]):""),u?n[i].push(o):n[i]=o}return n},recognize:function(t){var e,n,r,o,a=[this.rootState],i={},s=!1;if(o=t.indexOf("?"),-1!==o){var u=t.substr(o+1,t.length);t=t.substr(0,o),i=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&&(a=y(a,t.charAt(n)),a.length);n++);var c=[];for(n=0,r=a.length;r>n;n++)a[n].handlers&&c.push(a[n]);a=g(c);var h=c[0];return h&&h.handlers?(s&&"(.+)$"===h.regex.source.slice(-5)&&(t+="/"),_(h,t,i)):void 0}},k.prototype.map=x,k.VERSION="0.1.9";var E=k;n(6).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(5)(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";Object.defineProperty(e,"__esModule",{value:!0});var r=n(3);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._beforeEachHooks.push(t)},e.prototype.afterEach=function(t){this._afterEachHooks.push(t)},e.prototype.go=function(t,e){t=this._normalizePath(t),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(2)["default"];Object.defineProperty(e,"__esModule",{value:!0});var o=n(3),a=n(9),i=r(a),s=n(10),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,{as:e.name}),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,a){var i=o.mapParams(e,t.params,a);n.call(r,i)}}])},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,a=this._currentTransition;if(!a||t!==o.path){var s=new i["default"](t,this),c=new u["default"](this,s,o);this._prevTransition=a,this._currentTransition=c,this.app||(this.app=new this._appConstructor({el:this._appContainer,_meta:{$route:s}}));var h=this._beforeEachHooks,l=function(){c.start(function(){r._postTransition(s,e,n)})};h.length?c.runQueue(h,function(t,e,n){c===r._currentTransition&&c.callHook(t,null,n,!0)},l):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._afterEachHooks.length&&this._afterEachHooks.forEach(function(e){return e.call(null,{to:t.to,from:t.from})}),this._currentTransition.done=!0},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)})},e.prototype._normalizePath=function(t){if("object"==typeof t){if(t.name){var e=t.params||{};return t.query&&(e.queryParams=t.query),this._recognizer.generate(t.name,e)}return t.path?t.path:""}return t+""}},t.exports=e["default"]},function(t,e,n){"use strict";var r=n(1)["default"];Object.defineProperty(e,"__esModule",{value:!0});var o=/^(component|subRoutes|name)$/,a=function i(t,e){var n=this;r(this,i);var a=e._recognizer.recognize(t);a&&([].forEach.call(a,function(t){for(var e in t.handler)o.test(e)||(n[e]=t.handler[e])}),this.query=a.queryParams,this.params=[].reduce.call(a,function(t,e){if(e.params)for(var n in e.params)t[n]=e.params[n];return t},{})),this.path=t,this.router=e,this._matched=a||e._notFoundHandler};e["default"]=a,t.exports=e["default"]},function(t,e,n){"use strict";function r(t){return"[object Object]"===Object.prototype.toString.call(t)}var o=n(11)["default"],a=n(1)["default"];Object.defineProperty(e,"__esModule",{value:!0});var i=n(3),s=n(15),u=function(){function t(e,n,r){a(this,t),this.router=e,this.to=n,this.from=r,this.next=null,this.aborted=!1,this.done=!1,this.deactivateQueue=e._views;var o=n._matched?Array.prototype.slice.call(n._matched):[];this.activateQueue=o.map(function(t){return t.handler})}return o(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,"string"==typeof t?t=i.mapParams(t,this.to.params,this.to.query):(t.params=this.to.params,t.query=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(),a=void 0,i=void 0;for(i=0;i<o.length&&s.canReuse(o[i],r[i],e);i++);i>0&&(a=o.slice(0,i),n=o.slice(i).reverse(),r=r.slice(i)),e.runQueue(n,s.canDeactivate,function(){e.runQueue(r,s.canActivate,function(){e.runQueue(n,s.deactivate,function(){if(e.router._onTransitionValidated(e),a&&a.forEach(function(t){s.reuse(t,e)}),n.length){var r=n[n.length-1],o=a?a.length:0;s.activate(r,e,o,t)}else t()})})})}},{key:"runQueue",value:function(t,e,n){function r(a){a>=t.length?n():e(t[a],o,function(){r(a+1)})}var o=this;r(0)}},{key:"callHook",value:function(t,e,n){var o=arguments.length<=3||void 0===arguments[3]?{}:arguments[3],a=o.expectBoolean,s=void 0===a?!1:a,u=o.expectData,c=void 0===u?!1:u,h=o.cleanup,l=this,f=!1,d=function(t){h&&h(),l.abort(t)},p=function(t){if(h?v():d(),t&&!l.router._suppress)throw i.warn("Uncaught error during transition: "),t instanceof Error?t:new Error(t)},v=function(t){return f?void i.warn("transition.next() should be called only once."):(f=!0,void(n&&!l.aborted&&n(t,p)))},g={to:l.to,from:l.from,abort:d,next:v,redirect:function(){l.redirect.apply(l,arguments)}},y=void 0;try{y=t.call(e,g)}catch(m){return p(m)}var _=i.isPromise(y);s?"boolean"==typeof y?y?v():d():_&&y.then(function(t){t?v():d()},p):_?y.then(v,p):c&&r(y)&&v(y)}}]),t}();e["default"]=u,t.exports=e["default"]},function(t,e,n){"use strict";var r=n(12)["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(13),__esModule:!0}},function(t,e,n){var r=n(14);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";function r(t,e,n){var r=t.childVM;if(!r||!e)return!1;if(t.Component!==e.component)return!1;var o=l.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=l.getRouteConfig(r,"canDeactivate");o?e.callHook(o,r,n,{expectBoolean:!0}):n()}function a(t,e,n){l.resolveAsyncComponent(t,function(t){if(!e.aborted){var r=l.getRouteConfig(t,"canActivate");r?e.callHook(r,null,n,{expectBoolean:!0}):n()}})}function i(t,e,n){var r=t.childVM,o=l.getRouteConfig(r,"deactivate");o?e.callHook(o,r,n):n()}function s(t,n,r,o){var a=n.activateQueue[r];if(!a)return t._bound&&t.setComponent(null),void(o&&o());var i=t.Component=a.component,s=l.getRouteConfig(i,"activate"),u=l.getRouteConfig(i,"data"),h=l.getRouteConfig(i,"waitForData");t.depth=r,t.activated=!1,t.unbuild(!0);var f=t.build({_meta:{$loadingRouteData:!(!u||h)}}),d=function(){f.$destroy()},p=function(){var e=n.router;e._rendered||e._transitionOnLoad?t.transition(f):(t.setCurrent?t.setCurrent(f):t.childVM=f,f.$before(t.anchor,null,!1)),o&&o()},v=function(){t.activated=!0,t.childView&&e.activate(t.childView,n,r+1),u&&h?c(f,n,u,p,d):(u&&c(f,n,u),p())};s?n.callHook(s,f,v,{cleanup:d}):v()}function u(t,e){var n=t.childVM,r=l.getRouteConfig(n,"data");r&&c(n,e,r)}function c(t,e,n,r,o){t.$loadingRouteData=!0,e.callHook(n,t,function(e,n){var o=[];h(e).forEach(function(n){var r=e[n];l.isPromise(r)?o.push(r.then(function(e){t.$set(n,e)})):t.$set(n,r)}),o.length?o[0].constructor.all(o).then(function(e){t.$loadingRouteData=!1},n):t.$loadingRouteData=!1,r&&r(e)},{cleanup:o,expectData:!0})}var h=n(16)["default"];Object.defineProperty(e,"__esModule",{value:!0}),e.canReuse=r,e.canDeactivate=o,e.canActivate=a,e.deactivate=i,e.activate=s,e.reuse=u;var l=n(3)},function(t,e,n){t.exports={"default":n(17),__esModule:!0}},function(t,e,n){n(18),t.exports=n(24).Object.keys},function(t,e,n){var r=n(19);n(21)("keys",function(t){return function(e){return t(r(e))}})},function(t,e,n){var r=n(20);t.exports=function(t){return Object(r(t))}},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){t.exports=function(t,e){var r=n(22),o=(n(24).Object||{})[t]||Object[t],a={};a[t]=e(o),r(r.S+r.F*n(25)(function(){o(1)}),"Object",a)}},function(t,e,n){var r=n(23),o=n(24),a="prototype",i=function(t,e){return function(){return t.apply(e,arguments)}},s=function(t,e,n){var u,c,h,l,f=t&s.G,d=t&s.P,p=f?r:t&s.S?r[e]:(r[e]||{})[a],v=f?o:o[e]||(o[e]={});f&&(n=e);for(u in n)c=!(t&s.F)&&p&&u in p,c&&u in v||(h=c?p[u]:n[u],f&&"function"!=typeof p[u]?l=n[u]:t&s.B&&c?l=i(h,r):t&s.W&&p[u]==h?!function(t){l=function(e){return this instanceof t?new t(e):t(e)},l[a]=t[a]}(h):l=d&&"function"==typeof h?i(Function.call,h):h,v[u]=l,d&&((v[a]||(v[a]={}))[u]=h))};s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,t.exports=s},function(t,e){var n="undefined",r=t.exports=typeof window!=n&&window.Math==Math?window:typeof self!=n&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(t,e){var n=t.exports={};"number"==typeof __e&&(__e=n)},function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(3),o=n(15);e["default"]=function(t){var e=t.util,n=t.directive("_component"),a=e.extend({},n);e.extend(a,{_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.")),this.waitForEvent&&(this.waitForEvent=null,r.warn("<router-view> does not support wait-for. Use the acitvate route hook instead."));var e=this.router=t.router;e._views.unshift(this);var a=e._views[1];a&&(a.childView=this);var i=t.router._currentTransition;if(!a&&i.done||a&&a.activated){var s=a?a.depth+1:0;o.activate(this,i,s)}},unbind:function(){this.router._views.$remove(this),n.unbind.call(this)}}),t.elementDirective("router-view",a)},t.exports=e["default"]},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(3),o=/[-.*+?^${}()|[\]\/\\]/g;e["default"]=function(t){var e=t.util;t.directive("link",{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.unwatch=n.$watch("$route.path",e.bind(this.updateClasses,this))},update:function(t){var e=this.vm.$route.router;t=e._normalizePath(t),this.destination=t,this.activeRE=t?new RegExp("^"+t.replace(o,"\\$&")+"\\b"):null,this.updateClasses(this.vm.$route.path);var 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"))},updateClasses:function(t){var n=this.el,r=this.destination,o=this.vm.$route.router,a=o._linkActiveClass,i=a+"-exact";this.activeRE&&this.activeRE.test(t)&&"/"!==t?e.addClass(n,a):e.removeClass(n,a),t===r?e.addClass(n,i):e.removeClass(n,i)},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 a=t._meta=t._meta||{};a.$route=r,t._isRouterView&&(a.$loadingRouteData=a.$loadingRouteData||!1)}var i=e.call(this,t,n);return o&&(o._children.push(i),i.$on("hook:beforeDestroy",function(){o._children.$remove(i)})),i}},t.exports=e["default"]},function(t,e,n){"use strict";var r=n(11)["default"],o=n(1)["default"];Object.defineProperty(e,"__esModule",{value:!0});var a=n(3),i=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:a.resolvePath(this.currentPath,t)}}]),t}();e["default"]=i,t.exports=e["default"]},function(t,e,n){"use strict";var r=n(11)["default"],o=n(1)["default"];Object.defineProperty(e,"__esModule",{value:!0});var a=n(3),i=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+a.resolvePath(location.hash.replace(/^#!?/,""),t)}}]),t}();e["default"]=i,t.exports=e["default"]},function(t,e,n){"use strict";var r=n(11)["default"],o=n(1)["default"];Object.defineProperty(e,"__esModule",{value:!0});var a=n(3),i=/#.*$/,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 a=document.querySelector("base");this.base=a&&a.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(i),a=o&&o[0];t=r.replace(i,"").replace(this.rootRE,""),this.onChange(t,null,a)}},{key:"formatPath",value:function(t){return"/"===t.charAt(0)?this.root?this.root+"/"+t.replace(/^\//,""):t:a.resolvePath(this.base||location.pathname,t)}}]),t}();e["default"]=s,t.exports=e["default"]}])});

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

var regexEscapeRE = /[-.*+?^${}()|[\]\/\\]/g;
// install v-link, which provides navigation support for

@@ -19,4 +21,2 @@ // HTML5 history mode

isLiteral: true,
bind: function bind() {

@@ -41,5 +41,2 @@ var _this = this;

this.el.addEventListener('click', this.handler);
if (!this._isDynamicLiteral) {
this.update(this.expression);
}
// manage active link class

@@ -49,2 +46,20 @@ this.unwatch = vm.$watch('$route.path', _.bind(this.updateClasses, this));

update: function update(path) {
var router = this.vm.$route.router;
path = router._normalizePath(path);
this.destination = path;
this.activeRE = path ? new RegExp('^' + path.replace(regexEscapeRE, '\\$&') + '\\b') : null;
this.updateClasses(this.vm.$route.path);
var isAbsolute = path.charAt(0) === '/';
// do not format non-hash relative paths
var href = router.mode === 'hash' || isAbsolute ? router.history.formatPath(path) : path;
if (this.el.tagName === 'A') {
if (href) {
this.el.href = href;
} else {
this.el.removeAttribute('href');
}
}
},
updateClasses: function updateClasses(path) {

@@ -56,3 +71,3 @@ var el = this.el;

var exactClass = activeClass + '-exact';
if (path.indexOf(dest) === 0 && path !== '/') {
if (this.activeRE && this.activeRE.test(path) && path !== '/') {
_.addClass(el, activeClass);

@@ -69,19 +84,2 @@ } else {

update: function update(path) {
this.destination = path;
this.updateClasses(this.vm.$route.path);
path = path || '';
var router = this.vm.$route.router;
var isAbsolute = path.charAt(0) === '/';
// do not format non-hash relative paths
var href = router.mode === 'hash' || isAbsolute ? router.history.formatPath(path) : path;
if (this.el.tagName === 'A') {
if (href) {
this.el.href = href;
} else {
this.el.removeAttribute('href');
}
}
},
unbind: function unbind() {

@@ -88,0 +86,0 @@ this.el.removeEventListener('click', this.handler);

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

var _pipeline = require('../pipeline');
exports['default'] = function (Vue) {

@@ -34,2 +36,3 @@

componentDef.bind.call(this);
// does not support keep-alive.

@@ -41,2 +44,7 @@ /* istanbul ignore if */

}
/* istanbul ignore if */
if (this.waitForEvent) {
this.waitForEvent = null;
(0, _util.warn)('<router-view> does not support wait-for. Use ' + 'the acitvate route hook instead.');
}

@@ -58,2 +66,14 @@ // all we need to do here is registering this view

}
// handle late-rendered view
// two possibilities:
// 1. root view rendered after transition has been
// validated;
// 2. child view rendered after parent view has been
// activated.
var transition = route.router._currentTransition;
if (!parentView && transition.done || parentView && parentView.activated) {
var depth = parentView ? parentView.depth + 1 : 0;
(0, _pipeline.activate)(this, transition, depth);
}
},

@@ -60,0 +80,0 @@

'use strict';
var _classCallCheck = require('babel-runtime/helpers/class-call-check')['default'];
var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default'];

@@ -11,7 +13,134 @@

var _router = require('./router');
var _util2 = _interopRequireDefault(_util);
var _router2 = _interopRequireDefault(_router);
var _routeRecognizer = require('route-recognizer');
var _routeRecognizer2 = _interopRequireDefault(_routeRecognizer);
var _routerApi = require('./router/api');
var _routerApi2 = _interopRequireDefault(_routerApi);
var _routerInternal = require('./router/internal');
var _routerInternal2 = _interopRequireDefault(_routerInternal);
var _directivesView = require('./directives/view');
var _directivesView2 = _interopRequireDefault(_directivesView);
var _directivesLink = require('./directives/link');
var _directivesLink2 = _interopRequireDefault(_directivesLink);
var _override = require('./override');
var _override2 = _interopRequireDefault(_override);
var _historyAbstract = require('./history/abstract');
var _historyAbstract2 = _interopRequireDefault(_historyAbstract);
var _historyHash = require('./history/hash');
var _historyHash2 = _interopRequireDefault(_historyHash);
var _historyHtml5 = require('./history/html5');
var _historyHtml52 = _interopRequireDefault(_historyHtml5);
var historyBackends = {
abstract: _historyAbstract2['default'],
hash: _historyHash2['default'],
html5: _historyHtml52['default']
};
/**
* Router constructor
*
* @param {Object} [options]
*/
var Router = function Router() {
var _ref = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
var _ref$hashbang = _ref.hashbang;
var hashbang = _ref$hashbang === undefined ? true : _ref$hashbang;
var _ref$abstract = _ref.abstract;
var abstract = _ref$abstract === undefined ? false : _ref$abstract;
var _ref$history = _ref.history;
var history = _ref$history === undefined ? false : _ref$history;
var _ref$saveScrollPosition = _ref.saveScrollPosition;
var saveScrollPosition = _ref$saveScrollPosition === undefined ? false : _ref$saveScrollPosition;
var _ref$transitionOnLoad = _ref.transitionOnLoad;
var transitionOnLoad = _ref$transitionOnLoad === undefined ? false : _ref$transitionOnLoad;
var _ref$suppressTransitionError = _ref.suppressTransitionError;
var suppressTransitionError = _ref$suppressTransitionError === undefined ? false : _ref$suppressTransitionError;
var _ref$root = _ref.root;
var root = _ref$root === undefined ? null : _ref$root;
var _ref$linkActiveClass = _ref.linkActiveClass;
var linkActiveClass = _ref$linkActiveClass === undefined ? 'v-link-active' : _ref$linkActiveClass;
_classCallCheck(this, Router);
/* istanbul ignore if */
if (!Router.installed) {
throw new Error('Please install the Router with Vue.use() before ' + 'creating an instance.');
}
// Vue instances
this.app = null;
this._views = [];
this._children = [];
// route recognizer
this._recognizer = new _routeRecognizer2['default']();
this._guardRecognizer = new _routeRecognizer2['default']();
// state
this._started = false;
this._currentRoute = {};
this._currentTransition = null;
this._previousTransition = null;
this._notFoundHandler = null;
this._beforeEachHooks = [];
this._afterEachHooks = [];
// feature detection
this._hasPushState = typeof window !== 'undefined' && window.history && window.history.pushState;
// trigger transition on initial render?
this._rendered = false;
this._transitionOnLoad = transitionOnLoad;
// history mode
this._abstract = abstract;
this._hashbang = hashbang;
this._history = this._hasPushState && history;
// other options
this._saveScrollPosition = saveScrollPosition;
this._linkActiveClass = linkActiveClass;
this._suppress = suppressTransitionError;
// create history object
var inBrowser = _util2['default'].Vue.util.inBrowser;
this.mode = !inBrowser || this._abstract ? 'abstract' : this._history ? 'html5' : 'hash';
var History = historyBackends[this.mode];
var self = this;
this.history = new History({
root: root,
hashbang: this._hashbang,
onChange: function onChange(path, state, anchor) {
self._match(path, state, anchor);
}
});
};
exports['default'] = Router;
Router.installed = false;
/**
* Installation interface.

@@ -21,15 +150,21 @@ * Install the necessary directives.

_router2['default'].install = function (Vue) {
Router.install = function (Vue) {
/* istanbul ignore if */
if (_router2['default'].installed) {
if (Router.installed) {
(0, _util.warn)('already installed.');
return;
}
require('./router/api')(Vue, _router2['default']);
require('./router/internal')(Vue, _router2['default']);
require('./directives/view')(Vue);
require('./directives/link')(Vue);
require('./override')(Vue);
_router2['default'].Vue = Vue;
_router2['default'].installed = true;
(0, _routerApi2['default'])(Vue, Router);
(0, _routerInternal2['default'])(Vue, Router);
(0, _directivesView2['default'])(Vue);
(0, _directivesLink2['default'])(Vue);
(0, _override2['default'])(Vue);
_util2['default'].Vue = Vue;
// 1.0 only: enable route mixins
var strats = Vue.config.optionMergeStrategies;
if (strats) {
// use the same merge strategy as methods (object hash)
strats.route = strats.methods;
}
Router.installed = true;
};

@@ -40,6 +175,4 @@

if (typeof window !== 'undefined' && window.Vue) {
window.Vue.use(_router2['default']);
window.Vue.use(Router);
}
exports['default'] = _router2['default'];
module.exports = exports['default'];
'use strict';
var _Object$keys = require('babel-runtime/core-js/object/keys')['default'];
Object.defineProperty(exports, '__esModule', {

@@ -54,3 +56,5 @@ value: true

} else {
transition.callHook(hook, fromComponent, next, true);
transition.callHook(hook, fromComponent, next, {
expectBoolean: true
});
}

@@ -78,3 +82,5 @@ }

} else {
transition.callHook(hook, null, next, true);
transition.callHook(hook, null, next, {
expectBoolean: true
});
}

@@ -114,3 +120,6 @@ });

if (!handler) {
view.setComponent(null);
// fix 1.0.0-alpha.3 compat
if (view._bound) {
view.setComponent(null);
}
cb && cb();

@@ -125,2 +134,5 @@ return;

view.depth = depth;
view.activated = false;
// unbuild current component. this step also destroys

@@ -151,3 +163,9 @@ // and removes all nested child views.

// no transition on first render, manual transition
view.setCurrent(component);
if (view.setCurrent) {
// 0.12 compat
view.setCurrent(component);
} else {
// 1.0
view.childVM = component;
}
component.$before(view.anchor, null, false);

@@ -160,2 +178,3 @@ }

var afterActivate = function afterActivate() {
view.activated = true;
// activate the child view

@@ -178,3 +197,5 @@ if (view.childView) {

if (activateHook) {
transition.callHook(activateHook, component, afterActivate, false, cleanup);
transition.callHook(activateHook, component, afterActivate, {
cleanup: cleanup
});
} else {

@@ -212,9 +233,26 @@ afterActivate();

component.$loadingRouteData = true;
transition.callHook(hook, component, function (data) {
for (var key in data) {
component.$set(key, data[key]);
transition.callHook(hook, component, function (data, onError) {
var promises = [];
_Object$keys(data).forEach(function (key) {
var val = data[key];
if ((0, _util.isPromise)(val)) {
promises.push(val.then(function (resolvedVal) {
component.$set(key, resolvedVal);
}));
} else {
component.$set(key, val);
}
});
if (!promises.length) {
component.$loadingRouteData = false;
} else {
promises[0].constructor.all(promises).then(function (_) {
component.$loadingRouteData = false;
}, onError);
}
component.$loadingRouteData = false;
cb && cb(data);
}, false, cleanup);
}, {
cleanup: cleanup,
expectData: true
});
}

@@ -1,8 +0,1 @@

/**
* Route Context Object
*
* @param {String} path
* @param {Router} router
*/
"use strict";

@@ -15,23 +8,41 @@

});
var internalKeysRE = /^(component|subRoutes|name)$/;
/**
* Route Context Object
*
* @param {String} path
* @param {Router} router
*/
var Route = function Route(path, router) {
var _this = this;
_classCallCheck(this, Route);
var matched = router._recognizer.recognize(path);
if (matched) {
// copy all custom fields from route configs
[].forEach.call(matched, function (match) {
for (var key in match.handler) {
if (!internalKeysRE.test(key)) {
_this[key] = match.handler[key];
}
}
});
// set query and params
this.query = matched.queryParams;
this.params = [].reduce.call(matched, function (prev, cur) {
if (cur.params) {
for (var key in cur.params) {
prev[key] = cur.params[key];
}
}
return prev;
}, {});
}
// expose path and router
this.path = path;
this.router = router;
var matched = router._recognizer.recognize(path);
this.query = matched ? matched.queryParams : {};
this.params = matched ? [].reduce.call(matched, function (prev, cur) {
if (cur.params) {
for (var key in cur.params) {
prev[key] = cur.params[key];
}
}
return prev;
}, {}) : {};
// private stuff
// for internal use
this._matched = matched || router._notFoundHandler;

@@ -38,0 +49,0 @@ };

@@ -13,2 +13,4 @@ 'use strict';

* Register a map of top-level paths.
*
* @param {Object} map
*/

@@ -73,3 +75,3 @@

Router.prototype.beforeEach = function (fn) {
this._beforeEachHook = fn;
this._beforeEachHooks.push(fn);
};

@@ -84,3 +86,3 @@

Router.prototype.afterEach = function (fn) {
this._afterEachHook = fn;
this._afterEachHooks.push(fn);
};

@@ -90,6 +92,8 @@

* Navigate to a given path.
* The path can be an object describing a named path in
* the format of { name: '...', params: {}, query: {}}
* The path is assumed to be already decoded, and will
* be resolved against root (if provided)
*
* @param {String} path
* @param {String|Object} path
* @param {Boolean} [replace]

@@ -99,3 +103,4 @@ */

Router.prototype.go = function (path, replace) {
this.history.go(path + '', replace);
path = this._normalizePath(path);
this.history.go(path, replace);
};

@@ -102,0 +107,0 @@

@@ -39,3 +39,6 @@ 'use strict';

});
this._recognizer.add(segments);
this._recognizer.add(segments, {
as: handler.name
});
// add sub routes
if (handler.subRoutes) {

@@ -165,3 +168,3 @@ for (var subPath in handler.subRoutes) {

// check global before hook
var before = this._beforeEachHook;
var beforeHooks = this._beforeEachHooks;
var startTransition = function startTransition() {

@@ -173,4 +176,8 @@ transition.start(function () {

if (before) {
transition.callHook(before, null, startTransition, true);
if (beforeHooks.length) {
transition.runQueue(beforeHooks, function (hook, _, next) {
if (transition === _this2._currentTransition) {
transition.callHook(hook, null, next, true);
}
}, startTransition);
} else {

@@ -212,8 +219,11 @@ startTransition();

// call global after hook
if (this._afterEachHook) {
this._afterEachHook.call(null, {
to: transition.to,
from: transition.from
if (this._afterEachHooks.length) {
this._afterEachHooks.forEach(function (hook) {
return hook.call(null, {
to: transition.to,
from: transition.from
});
});
}
this._currentTransition.done = true;
};

@@ -249,2 +259,28 @@

/**
* Normalize named route object / string paths into
* a string.
*
* @param {Object|String|Number} path
* @return {String}
*/
Router.prototype._normalizePath = function (path) {
if (typeof path === 'object') {
if (path.name) {
var params = path.params || {};
if (path.query) {
params.queryParams = path.query;
}
return this._recognizer.generate(path.name, params);
} else if (path.path) {
return path.path;
} else {
return '';
}
} else {
return path + '';
}
};
/**
* Allow directly passing components to a route

@@ -251,0 +287,0 @@ * definition.

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

this.aborted = false;
this.done = false;

@@ -82,3 +83,8 @@ // start by determine the queues

this.aborted = true;
path = (0, _util.mapParams)(path, this.to.params, this.to.query);
if (typeof path === 'string') {
path = (0, _util.mapParams)(path, this.to.params, this.to.query);
} else {
path.params = this.to.params;
path.query = this.to.query;
}
this.router.replace(path);

@@ -201,4 +207,6 @@ }

* @param {Function} [cb]
* @param {Boolean} [expectBoolean]
* @param {Function} [cleanup]
* @param {Object} [options]
* - {Boolean} expectBoolean
* - {Boolean} expectData
* - {Function} cleanup
*/

@@ -208,19 +216,14 @@

key: 'callHook',
value: function callHook(hook, context, cb, expectBoolean, cleanup) {
value: function callHook(hook, context, cb) {
var _ref = arguments.length <= 3 || arguments[3] === undefined ? {} : arguments[3];
var _ref$expectBoolean = _ref.expectBoolean;
var expectBoolean = _ref$expectBoolean === undefined ? false : _ref$expectBoolean;
var _ref$expectData = _ref.expectData;
var expectData = _ref$expectData === undefined ? false : _ref$expectData;
var cleanup = _ref.cleanup;
var transition = this;
var nextCalled = false;
// advance the transition to the next step
var next = function next(data) {
if (nextCalled) {
(0, _util.warn)('transition.next() should be called only once.');
return;
}
nextCalled = true;
if (!cb || transition.aborted) {
return;
}
cb(data);
};
// abort the transition

@@ -244,2 +247,15 @@ var abort = function abort(back) {

// advance the transition to the next step
var next = function next(data) {
if (nextCalled) {
(0, _util.warn)('transition.next() should be called only once.');
return;
}
nextCalled = true;
if (!cb || transition.aborted) {
return;
}
cb(data, onError);
};
// expose a clone of the transition object, so that each

@@ -278,2 +294,4 @@ // hook gets a clean copy and prevent the user from

res.then(next, onError);
} else if (expectData && isPlainOjbect(res)) {
next(res);
}

@@ -287,2 +305,6 @@ }

exports['default'] = RouteTransition;
function isPlainOjbect(val) {
return Object.prototype.toString.call(val) === '[object Object]';
}
module.exports = exports['default'];

@@ -21,2 +21,6 @@ 'use strict';

// export default for holding the Vue reference
var _exports = {};
exports['default'] = _exports;
/**

@@ -118,4 +122,3 @@ * Warn stuff.

resolver = {
// HACK
resolve: require('./router').Vue.prototype._resolveComponent,
resolve: _exports.Vue.prototype._resolveComponent,
$options: {

@@ -122,0 +125,0 @@ components: {

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

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

"es6-promise": "^3.0.2",
"eslint": "^1.1.0",
"eslint": "^1.3.1",
"express": "^4.12.3",

@@ -45,0 +45,0 @@ "html-loader": "^0.3.0",

@@ -10,3 +10,3 @@ # 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)

- Nested route/view mapping
- Modular, component-based router configuaration
- Modular, component-based router configuration
- Route params, query, wildcards

@@ -19,3 +19,3 @@ - View transition effects powered by Vue.js' transition system

Get started with the [documentation](http://vuejs.github.io/vue-router) (WIP).
Get started with the [documentation](http://vuejs.github.io/vue-router).

@@ -22,0 +22,0 @@ ### Development Setup

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