!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Router=e():t.Router=e()}(this,function(){return function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var r={};return e.m=t,e.c=r,e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=11)}([function(t,e){var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,r){t.exports=!r(3)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,r){var n=r(0),o=r(5),i=r(6),s=r(19),c=r(8),u=function(t,e,r){var a,f,h,l,p=t&u.F,y=t&u.G,d=t&u.S,v=t&u.P,m=t&u.B,g=y?n:d?n[e]||(n[e]={}):(n[e]||{}).prototype,x=y?o:o[e]||(o[e]={}),w=x.prototype||(x.prototype={});y&&(r=e);for(a in r)f=!p&&g&&void 0!==g[a],h=(f?g:r)[a],l=m&&f?c(h,n):v&&"function"==typeof h?c(Function.call,h):h,g&&s(g,a,h,t&u.U),x[a]!=h&&i(x,a,l),v&&w[a]!=h&&(w[a]=h)};n.core=o,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},function(t,e){var r=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=r)},function(t,e,r){var n=r(13),o=r(18);t.exports=r(2)?function(t,e,r){return n.f(t,e,o(1,r))}:function(t,e,r){return t[e]=r,t}},function(t,e){var r=0,n=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++r+n).toString(36))}},function(t,e,r){var n=r(21);t.exports=function(t,e,r){if(n(t),void 0===e)return t;switch(r){case 1:return function(r){return t.call(e,r)};case 2:return function(r,n){return t.call(e,r,n)};case 3:return function(r,n,o){return t.call(e,r,n,o)}}return function(){return t.apply(e,arguments)}}},function(t,e,r){var n=r(10);t.exports=Array.isArray||function(t){return"Array"==n(t)}},function(t,e){var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},function(t,e,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};r(12),r(22);var o=r(34),i=r(35),c=function t(e){if(!(this instanceof t))return new t(e);this.params={},this.routes={},this.methods=["on","once","after","before"],this.scope=[],this._methods={},this._insert=this.insert,this.insert=this.insertEx,this.historySupport=null!=(null!=window.history?window.history.pushState:null),this.config(),this.mount(e||{})};c.prototype.init=function(t){var e,r=this;return this.handler=function(t){var e=t&&t.newURL||window.location.hash,n=!0===r.history?r.getPath():e.replace(/.*#/,"");r.dispatch("on","/"===n.charAt(0)?n:"/"+n)},o.listener.init(this.handler,this.history),!1===this.history?(0,o.dlocHashEmpty)()&&t?o.dloc.hash=t:(0,o.dlocHashEmpty)()||r.dispatch("on","/"+o.dloc.hash.replace(/^(#\/|#|\/)/,"")):(this.convert_hash_in_init?(e=(0,o.dlocHashEmpty)()&&t?t:(0,o.dlocHashEmpty)()?null:o.dloc.hash.replace(/^#/,""))&&window.history.replaceState({},document.title,e):e=this.getPath(),(e||!0===this.run_in_init)&&this.handler()),this},c.prototype.explode=function(){var t=!0===this.history?this.getPath():o.dloc.hash;return"/"===t.charAt(1)&&(t=t.slice(1)),t.slice(1,t.length).split("/")},c.prototype.setRoute=function(t,e,r){var n=this.explode();return"number"==typeof t&&"string"==typeof e?n[t]=e:"string"==typeof r?n.splice(t,e,s):n=[t],o.listener.setHash(n.join("/")),n},c.prototype.insertEx=function(t,e,r,n){return"once"===t&&(t="on",r=function(t){var e=!1;return function(){if(!e)return e=!0,t.apply(this,arguments)}}(r)),this._insert(t,e,r,n)},c.prototype.getRoute=function(t){var e=t;if("number"==typeof t)e=this.explode()[t];else if("string"==typeof t){var r=this.explode();e=r.indexOf(t)}else e=this.explode();return e},c.prototype.destroy=function(){return o.listener.destroy(this.handler),this},c.prototype.getPath=function(){var t=window.location.pathname;return"/"!==t.substr(0,1)&&(t="/"+t),t},c.prototype.config=function(t){t=t||{};for(var e=0;e0&&c?(this.async?this.invoke(o,this,n):(this.invoke(o,this),n()),!0):(n(),!0)):(this.last=[],"function"==typeof this.notfound&&this.invoke([this.notfound],{method:t,path:e},r),!1)},c.prototype.invoke=function(t,e,r){var n,o=this;this.async?(n=function(r,o){if(Array.isArray(r))return(0,i._asyncEverySeries)(r,n,o);"function"==typeof r&&r.apply(e,(t.captures||[]).concat(o))},(0,i._asyncEverySeries)(t,n,function(){r&&r.apply(e,arguments)})):(n=function(r){return Array.isArray(r)?(0,i._every)(r,n):"function"==typeof r?r.apply(e,t.captures||[]):void("string"==typeof r&&o.resource&&o.resource[r].apply(e,t.captures||[]))},(0,i._every)(t,n))},c.prototype.traverse=function(t,e,r,o,i){function s(t){function e(t){for(var r=[],n=0;n=0;e--)Array.isArray(t[e])?(r(t[e]),0===t[e].length&&t.splice(e,1)):i(t[e])||t.splice(e,1)}if(!i)return t;var n=e(t);return n.matched=t.matched,n.captures=t.captures,n.after=t.after.filter(i),r(n),n}var c,u,a,f,h=[];if(e===this.delimiter&&r[t])return f=[[r.before,r[t]].filter(Boolean)],f.after=[r.after].filter(Boolean),f.matched=!0,f.captures=[],s(f);for(var l in r)if(r.hasOwnProperty(l)&&(!this._methods[l]||this._methods[l]&&"object"===n(r[l])&&!Array.isArray(r[l]))){if(c=u=o+this.delimiter+l,this.strict||(u+="["+this.delimiter+"]?"),!(a=e.match(new RegExp("^"+u))))continue;if(a[0]&&a[0]==e&&r[l][t])return f=[[r[l].before,r[l][t]].filter(Boolean)],f.after=[r[l].after].filter(Boolean),f.matched=!0,f.captures=a.slice(1),this.recurse&&r===this.routes&&(f.push([r.before,r.on].filter(Boolean)),f.after=f.after.concat([r.after].filter(Boolean))),s(f);if(f=this.traverse(t,e,r[l],c),f.matched)return f.length>0&&(h=h.concat(f)),this.recurse&&(h.push([r[l].before,r[l].on].filter(Boolean)),f.after=f.after.concat([r[l].after].filter(Boolean)),r===this.routes&&(h.push([r.before,r.on].filter(Boolean)),f.after=f.after.concat([r.after].filter(Boolean)))),h.matched=!0,h.captures=f.captures,h.after=f.after,s(h)}return!1},c.prototype.insert=function(t,e,r,o){var s,c,u,a;if(e=e.filter(function(t){return t&&t.length>0}),o=o||this.routes,a=e.shift(),/\:|\*/.test(a)&&!/\\d|\\w/.test(a)&&(a=(0,i.regifyString)(a,this.params)),e.length>0)return o[a]=o[a]||{},this.insert(t,e,r,o[a]);if(a||e.length||o!==this.routes){if(s=n(o[a]),c=Array.isArray(o[a]),o[a]&&!c&&"object"==s)switch(n(o[a][t])){case"function":return void(o[a][t]=[o[a][t],r]);case"object":return void o[a][t].push(r);case"undefined":return void(o[a][t]=r)}else if("undefined"==s)return u={},u[t]=r,void(o[a]=u);throw new Error("Invalid route context: "+s)}switch(n(o[t])){case"function":return void(o[t]=[o[t],r]);case"object":return void o[t].push(r);case"undefined":return void(o[t]=r)}},c.prototype.extend=function(t){var e,r=this,n=t.length;for(e=0;e_;_++)if((l||_ in g)&&(d=g[_],v=x(d,_,m),t))if(r)b[_]=v;else if(v)switch(t){case 3:return!0;case 5:return d;case 6:return _;case 2:b.push(d)}else if(f)return!1;return h?-1:a||f?f:b}}},function(t,e,r){var n=r(10);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==n(t)?t.split(""):Object(t)}},function(t,e,r){var n=r(26);t.exports=function(t){return Object(n(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,r){var n=r(28),o=Math.min;t.exports=function(t){return t>0?o(n(t),9007199254740991):0}},function(t,e){var r=Math.ceil,n=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?n:r)(t)}},function(t,e,r){var n=r(30);t.exports=function(t,e){return new(n(t))(e)}},function(t,e,r){var n=r(1),o=r(9),i=r(31)("species");t.exports=function(t){var e;return o(t)&&(e=t.constructor,"function"!=typeof e||e!==Array&&!o(e.prototype)||(e=void 0),n(e)&&null===(e=e[i])&&(e=void 0)),void 0===e?Array:e}},function(t,e,r){var n=r(32)("wks"),o=r(7),i=r(0).Symbol,s="function"==typeof i;(t.exports=function(t){return n[t]||(n[t]=s&&i[t]||(s?i:o)("Symbol."+t))}).store=n},function(t,e,r){var n=r(0),o=n["__core-js_shared__"]||(n["__core-js_shared__"]={});t.exports=function(t){return o[t]||(o[t]={})}},function(t,e,r){var n=r(3);t.exports=function(t,e){return!!t&&n(function(){e?t.call(null,function(){},1):t.call(null)})}},function(t,e,r){"use strict";function n(){return""===o.hash||"#"===o.hash}var o=document.location,i={mode:"modern",hash:o.hash,history:!1,check:function(){var t=o.hash;t!=this.hash&&(this.hash=t,this.onHashChanged())},fire:function(){"modern"===this.mode?!0===this.history?window.onpopstate():window.onhashchange():this.onHashChanged()},init:function(t,e){function r(t){for(var e=0,r=Router.listeners.length;e7))!0===this.history?setTimeout(function(){window.onpopstate=r},500):window.onhashchange=r,this.mode="modern";else{var o=document.createElement("iframe");o.id="state-frame",o.style.display="none",document.body.appendChild(o),this.writeFrame(""),"onpropertychange"in document&&"attachEvent"in document&&document.attachEvent("onpropertychange",function(){"location"===event.propertyName&&n.check()}),window.setInterval(function(){n.check()},50),this.onHashChanged=r,this.mode="legacy"}return Router.listeners.push(t),this.mode},destroy:function(t){if(Router&&Router.listeners)for(var e=Router.listeners,r=e.length-1;r>=0;r--)e[r]===t&&e.splice(r,1)},setHash:function(t){return"legacy"===this.mode&&this.writeFrame(t),!0===this.history?(window.history.pushState({},document.title,t),this.fire()):o.hash="/"===t[0]?t:"/"+t,this},writeFrame:function(t){var e=document.getElementById("state-frame"),r=e.contentDocument||e.contentWindow.document;r.open(),r.write("