universal-router
Advanced tools
Comparing version 1.2.2 to 2.0.0
238
browser.js
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } | ||
@@ -8,3 +10,2 @@ | ||
var _asyncToGenerator = _interopDefault(require('babel-runtime/helpers/asyncToGenerator')); | ||
var _getIterator = _interopDefault(require('babel-runtime/core-js/get-iterator')); | ||
var _Object$create = _interopDefault(require('babel-runtime/core-js/object/create')); | ||
@@ -14,6 +15,15 @@ var _Map = _interopDefault(require('babel-runtime/core-js/map')); | ||
/** | ||
* Universal Router (https://www.kriasoft.com/universal-router/) | ||
* | ||
* Copyright © 2015-2016 Konstantin Tarkus, Kriasoft LLC. All rights reserved. | ||
* | ||
* This source code is licensed under the Apache 2.0 license found in the | ||
* LICENSE.txt file in the root directory of this source tree. | ||
*/ | ||
var cache = new _Map(); | ||
function decodeParam(val) { | ||
if (!(typeof val === 'string' || val.length === 0)) { | ||
if (val === undefined || val === '') { | ||
return val; | ||
@@ -25,12 +35,7 @@ } | ||
} catch (err) { | ||
if (err instanceof URIError) { | ||
err.message = 'Failed to decode param \'' + val + '\''; | ||
err.status = 400; | ||
} | ||
throw err; | ||
return val; | ||
} | ||
} | ||
function matchPathBase(end, routePath, urlPath) { | ||
function matchPathBase(end, routePath, urlPath, parentParams) { | ||
var key = routePath + '|' + end; | ||
@@ -51,7 +56,10 @@ var regexp = cache.get(key); | ||
var path = m[0]; | ||
var params = _Object$create(null); | ||
var path = m[0]; | ||
if (parentParams) { | ||
_Object$assign(params, parentParams); | ||
} | ||
for (var i = 1; i < m.length; i++) { | ||
params[regexp.keys[i - 1].name] = m[i] !== undefined ? decodeParam(m[i]) : undefined; | ||
for (var i = 1; i < m.length; i += 1) { | ||
params[regexp.keys[i - 1].name] = decodeParam(m[i]); | ||
} | ||
@@ -67,5 +75,13 @@ | ||
function matchRoute(route, baseUrl, path) { | ||
var match, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, childRoute, newPath; | ||
/** | ||
* Universal Router (https://www.kriasoft.com/universal-router/) | ||
* | ||
* Copyright © 2015-2016 Konstantin Tarkus, Kriasoft LLC. All rights reserved. | ||
* | ||
* This source code is licensed under the Apache 2.0 license found in the | ||
* LICENSE.txt file in the root directory of this source tree. | ||
*/ | ||
function matchRoute(route, baseUrl, path, parentParams) { | ||
var match, i, newPath; | ||
return _regeneratorRuntime.wrap(function matchRoute$(_context) { | ||
@@ -82,3 +98,3 @@ while (1) { | ||
match = matchPath(route.path, path); | ||
match = matchPath(route.path, path, parentParams); | ||
@@ -101,10 +117,10 @@ if (!match) { | ||
if (!route.children) { | ||
_context.next = 37; | ||
_context.next = 18; | ||
break; | ||
} | ||
match = matchBasePath(route.path, path); | ||
match = matchBasePath(route.path, path, parentParams); | ||
if (!match) { | ||
_context.next = 37; | ||
_context.next = 18; | ||
break; | ||
@@ -123,58 +139,19 @@ } | ||
case 11: | ||
_iteratorNormalCompletion = true; | ||
_didIteratorError = false; | ||
_iteratorError = undefined; | ||
_context.prev = 14; | ||
_iterator = _getIterator(route.children); | ||
i = 0; | ||
case 16: | ||
if (_iteratorNormalCompletion = (_step = _iterator.next()).done) { | ||
_context.next = 23; | ||
case 12: | ||
if (!(i < route.children.length)) { | ||
_context.next = 18; | ||
break; | ||
} | ||
childRoute = _step.value; | ||
newPath = path.substr(match.path.length); | ||
return _context.delegateYield(matchRoute(childRoute, baseUrl + (match.path === '/' ? '' : match.path), newPath.startsWith('/') ? newPath : '/' + newPath), 't0', 20); | ||
return _context.delegateYield(matchRoute(route.children[i], baseUrl + (match.path === '/' ? '' : match.path), newPath.startsWith('/') ? newPath : '/' + newPath, match.params), 't0', 15); | ||
case 20: | ||
_iteratorNormalCompletion = true; | ||
_context.next = 16; | ||
case 15: | ||
i += 1; | ||
_context.next = 12; | ||
break; | ||
case 23: | ||
_context.next = 29; | ||
break; | ||
case 25: | ||
_context.prev = 25; | ||
_context.t1 = _context['catch'](14); | ||
_didIteratorError = true; | ||
_iteratorError = _context.t1; | ||
case 29: | ||
_context.prev = 29; | ||
_context.prev = 30; | ||
if (!_iteratorNormalCompletion && _iterator.return) { | ||
_iterator.return(); | ||
} | ||
case 32: | ||
_context.prev = 32; | ||
if (!_didIteratorError) { | ||
_context.next = 35; | ||
break; | ||
} | ||
throw _iteratorError; | ||
case 35: | ||
return _context.finish(32); | ||
case 36: | ||
return _context.finish(29); | ||
case 37: | ||
case 18: | ||
case 'end': | ||
@@ -184,9 +161,9 @@ return _context.stop(); | ||
} | ||
}, _marked[0], this, [[14, 25, 29, 37], [30,, 32, 36]]); | ||
}, _marked[0], this); | ||
} | ||
var resolve = function () { | ||
var ref = _asyncToGenerator(_regeneratorRuntime.mark(function _callee2(routes, pathOrContext) { | ||
var _ref = _asyncToGenerator(_regeneratorRuntime.mark(function _callee2(routes, pathOrContext) { | ||
var next = function () { | ||
var ref = _asyncToGenerator(_regeneratorRuntime.mark(function _callee() { | ||
var _ref2 = _asyncToGenerator(_regeneratorRuntime.mark(function _callee() { | ||
var _match$next, newContext; | ||
@@ -202,49 +179,30 @@ | ||
if (!(value && !done)) { | ||
_context.next = 23; | ||
if (!(!value || done || result !== null && result !== undefined)) { | ||
_context.next = 5; | ||
break; | ||
} | ||
newContext = _Object$assign({}, context, value); | ||
return _context.abrupt('return', result); | ||
case 5: | ||
if (!value.route.action) { | ||
_context.next = 23; | ||
_context.next = 10; | ||
break; | ||
} | ||
if (!errorRoute) { | ||
_context.next = 20; | ||
break; | ||
} | ||
_context.prev = 7; | ||
_context.next = 10; | ||
newContext = _Object$assign({}, context, value); | ||
_context.next = 9; | ||
return value.route.action(newContext, newContext.params); | ||
case 9: | ||
result = _context.sent; | ||
case 10: | ||
_context.next = 12; | ||
return next(); | ||
case 12: | ||
return _context.abrupt('return', _context.sent); | ||
case 13: | ||
_context.prev = 13; | ||
_context.t0 = _context['catch'](7); | ||
_context.t0.status = _context.t0.status || 500; | ||
newContext.error = _context.t0; | ||
return _context.abrupt('return', errorRoute.action(newContext, newContext.params)); | ||
case 18: | ||
_context.next = 23; | ||
break; | ||
case 20: | ||
_context.next = 22; | ||
return value.route.action(newContext, newContext.params); | ||
case 22: | ||
return _context.abrupt('return', _context.sent); | ||
case 23: | ||
return _context.abrupt('return', undefined); | ||
case 24: | ||
case 'end': | ||
@@ -254,11 +212,11 @@ return _context.stop(); | ||
} | ||
}, _callee, this, [[7, 13]]); | ||
}, _callee, this); | ||
})); | ||
return function next() { | ||
return ref.apply(this, arguments); | ||
return _ref2.apply(this, arguments); | ||
}; | ||
}(); | ||
var context, root, result, value, done, errorRoute, match; | ||
var context, root, result, value, done, match, error; | ||
return _regeneratorRuntime.wrap(function _callee2$(_context2) { | ||
@@ -270,8 +228,5 @@ while (1) { | ||
root = Array.isArray(routes) ? { path: '/', children: routes } : routes; | ||
result = void 0; | ||
result = null; | ||
value = void 0; | ||
done = false; | ||
errorRoute = root.children && root.children.find(function (x) { | ||
return x.path === '/error'; | ||
}); | ||
match = matchRoute(root, '', context.path); | ||
@@ -281,43 +236,21 @@ | ||
context.next = next; | ||
context.end = function (data) { | ||
result = data;done = true; | ||
}; | ||
case 9: | ||
if (done) { | ||
_context2.next = 17; | ||
break; | ||
} | ||
_context2.next = 12; | ||
_context2.next = 9; | ||
return next(); | ||
case 12: | ||
result = _context2.sent; | ||
if (!(result !== undefined)) { | ||
_context2.next = 15; | ||
case 9: | ||
if (!(result === null || result === undefined)) { | ||
_context2.next = 13; | ||
break; | ||
} | ||
return _context2.abrupt('break', 17); | ||
error = new Error('Page not found'); | ||
case 15: | ||
_context2.next = 9; | ||
break; | ||
error.status = error.statusCode = 404; | ||
throw error; | ||
case 17: | ||
if (!(result === undefined && errorRoute)) { | ||
_context2.next = 21; | ||
break; | ||
} | ||
context.error = new Error('Not found'); | ||
context.error.status = 404; | ||
return _context2.abrupt('return', errorRoute.action(context, {})); | ||
case 21: | ||
case 13: | ||
return _context2.abrupt('return', result); | ||
case 22: | ||
case 14: | ||
case 'end': | ||
@@ -331,11 +264,28 @@ return _context2.stop(); | ||
return function resolve(_x, _x2) { | ||
return ref.apply(this, arguments); | ||
return _ref.apply(this, arguments); | ||
}; | ||
}(); | ||
var main = { resolve: resolve, match: resolve /* alias */ }; | ||
/** | ||
* Universal Router (https://www.kriasoft.com/universal-router/) | ||
* | ||
* Copyright © 2015-2016 Konstantin Tarkus, Kriasoft LLC. All rights reserved. | ||
* | ||
* This source code is licensed under the Apache 2.0 license found in the | ||
* LICENSE.txt file in the root directory of this source tree. | ||
*/ | ||
/** | ||
* Universal Router (https://www.kriasoft.com/universal-router/) | ||
* | ||
* Copyright © 2015-2016 Konstantin Tarkus, Kriasoft LLC. All rights reserved. | ||
* | ||
* This source code is licensed under the Apache 2.0 license found in the | ||
* LICENSE.txt file in the root directory of this source tree. | ||
*/ | ||
var main = { resolve: resolve }; | ||
exports.resolve = resolve; | ||
exports.match = resolve; | ||
exports['default'] = main; | ||
//# sourceMappingURL=browser.js.map | ||
//# sourceMappingURL=browser.js.map |
238
legacy.js
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } | ||
@@ -8,3 +10,2 @@ | ||
var _asyncToGenerator = _interopDefault(require('babel-runtime/helpers/asyncToGenerator')); | ||
var _getIterator = _interopDefault(require('babel-runtime/core-js/get-iterator')); | ||
var _Object$create = _interopDefault(require('babel-runtime/core-js/object/create')); | ||
@@ -14,6 +15,15 @@ var _Map = _interopDefault(require('babel-runtime/core-js/map')); | ||
/** | ||
* Universal Router (https://www.kriasoft.com/universal-router/) | ||
* | ||
* Copyright © 2015-2016 Konstantin Tarkus, Kriasoft LLC. All rights reserved. | ||
* | ||
* This source code is licensed under the Apache 2.0 license found in the | ||
* LICENSE.txt file in the root directory of this source tree. | ||
*/ | ||
var cache = new _Map(); | ||
function decodeParam(val) { | ||
if (!(typeof val === 'string' || val.length === 0)) { | ||
if (val === undefined || val === '') { | ||
return val; | ||
@@ -25,12 +35,7 @@ } | ||
} catch (err) { | ||
if (err instanceof URIError) { | ||
err.message = 'Failed to decode param \'' + val + '\''; | ||
err.status = 400; | ||
} | ||
throw err; | ||
return val; | ||
} | ||
} | ||
function matchPathBase(end, routePath, urlPath) { | ||
function matchPathBase(end, routePath, urlPath, parentParams) { | ||
var key = routePath + '|' + end; | ||
@@ -51,7 +56,10 @@ var regexp = cache.get(key); | ||
var path = m[0]; | ||
var params = _Object$create(null); | ||
var path = m[0]; | ||
if (parentParams) { | ||
_Object$assign(params, parentParams); | ||
} | ||
for (var i = 1; i < m.length; i++) { | ||
params[regexp.keys[i - 1].name] = m[i] !== undefined ? decodeParam(m[i]) : undefined; | ||
for (var i = 1; i < m.length; i += 1) { | ||
params[regexp.keys[i - 1].name] = decodeParam(m[i]); | ||
} | ||
@@ -67,5 +75,13 @@ | ||
function matchRoute(route, baseUrl, path) { | ||
var match, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, childRoute, newPath; | ||
/** | ||
* Universal Router (https://www.kriasoft.com/universal-router/) | ||
* | ||
* Copyright © 2015-2016 Konstantin Tarkus, Kriasoft LLC. All rights reserved. | ||
* | ||
* This source code is licensed under the Apache 2.0 license found in the | ||
* LICENSE.txt file in the root directory of this source tree. | ||
*/ | ||
function matchRoute(route, baseUrl, path, parentParams) { | ||
var match, i, newPath; | ||
return _regeneratorRuntime.wrap(function matchRoute$(_context) { | ||
@@ -82,3 +98,3 @@ while (1) { | ||
match = matchPath(route.path, path); | ||
match = matchPath(route.path, path, parentParams); | ||
@@ -101,10 +117,10 @@ if (!match) { | ||
if (!route.children) { | ||
_context.next = 37; | ||
_context.next = 18; | ||
break; | ||
} | ||
match = matchBasePath(route.path, path); | ||
match = matchBasePath(route.path, path, parentParams); | ||
if (!match) { | ||
_context.next = 37; | ||
_context.next = 18; | ||
break; | ||
@@ -123,58 +139,19 @@ } | ||
case 11: | ||
_iteratorNormalCompletion = true; | ||
_didIteratorError = false; | ||
_iteratorError = undefined; | ||
_context.prev = 14; | ||
_iterator = _getIterator(route.children); | ||
i = 0; | ||
case 16: | ||
if (_iteratorNormalCompletion = (_step = _iterator.next()).done) { | ||
_context.next = 23; | ||
case 12: | ||
if (!(i < route.children.length)) { | ||
_context.next = 18; | ||
break; | ||
} | ||
childRoute = _step.value; | ||
newPath = path.substr(match.path.length); | ||
return _context.delegateYield(matchRoute(childRoute, baseUrl + (match.path === '/' ? '' : match.path), newPath.startsWith('/') ? newPath : '/' + newPath), 't0', 20); | ||
return _context.delegateYield(matchRoute(route.children[i], baseUrl + (match.path === '/' ? '' : match.path), newPath.startsWith('/') ? newPath : '/' + newPath, match.params), 't0', 15); | ||
case 20: | ||
_iteratorNormalCompletion = true; | ||
_context.next = 16; | ||
case 15: | ||
i += 1; | ||
_context.next = 12; | ||
break; | ||
case 23: | ||
_context.next = 29; | ||
break; | ||
case 25: | ||
_context.prev = 25; | ||
_context.t1 = _context['catch'](14); | ||
_didIteratorError = true; | ||
_iteratorError = _context.t1; | ||
case 29: | ||
_context.prev = 29; | ||
_context.prev = 30; | ||
if (!_iteratorNormalCompletion && _iterator.return) { | ||
_iterator.return(); | ||
} | ||
case 32: | ||
_context.prev = 32; | ||
if (!_didIteratorError) { | ||
_context.next = 35; | ||
break; | ||
} | ||
throw _iteratorError; | ||
case 35: | ||
return _context.finish(32); | ||
case 36: | ||
return _context.finish(29); | ||
case 37: | ||
case 18: | ||
case 'end': | ||
@@ -184,9 +161,9 @@ return _context.stop(); | ||
} | ||
}, _marked[0], this, [[14, 25, 29, 37], [30,, 32, 36]]); | ||
}, _marked[0], this); | ||
} | ||
var resolve = function () { | ||
var ref = _asyncToGenerator(_regeneratorRuntime.mark(function _callee2(routes, pathOrContext) { | ||
var _ref = _asyncToGenerator(_regeneratorRuntime.mark(function _callee2(routes, pathOrContext) { | ||
var next = function () { | ||
var ref = _asyncToGenerator(_regeneratorRuntime.mark(function _callee() { | ||
var _ref2 = _asyncToGenerator(_regeneratorRuntime.mark(function _callee() { | ||
var _match$next, newContext; | ||
@@ -202,49 +179,30 @@ | ||
if (!(value && !done)) { | ||
_context.next = 23; | ||
if (!(!value || done || result !== null && result !== undefined)) { | ||
_context.next = 5; | ||
break; | ||
} | ||
newContext = _Object$assign({}, context, value); | ||
return _context.abrupt('return', result); | ||
case 5: | ||
if (!value.route.action) { | ||
_context.next = 23; | ||
_context.next = 10; | ||
break; | ||
} | ||
if (!errorRoute) { | ||
_context.next = 20; | ||
break; | ||
} | ||
_context.prev = 7; | ||
_context.next = 10; | ||
newContext = _Object$assign({}, context, value); | ||
_context.next = 9; | ||
return value.route.action(newContext, newContext.params); | ||
case 9: | ||
result = _context.sent; | ||
case 10: | ||
_context.next = 12; | ||
return next(); | ||
case 12: | ||
return _context.abrupt('return', _context.sent); | ||
case 13: | ||
_context.prev = 13; | ||
_context.t0 = _context['catch'](7); | ||
_context.t0.status = _context.t0.status || 500; | ||
newContext.error = _context.t0; | ||
return _context.abrupt('return', errorRoute.action(newContext, newContext.params)); | ||
case 18: | ||
_context.next = 23; | ||
break; | ||
case 20: | ||
_context.next = 22; | ||
return value.route.action(newContext, newContext.params); | ||
case 22: | ||
return _context.abrupt('return', _context.sent); | ||
case 23: | ||
return _context.abrupt('return', undefined); | ||
case 24: | ||
case 'end': | ||
@@ -254,11 +212,11 @@ return _context.stop(); | ||
} | ||
}, _callee, this, [[7, 13]]); | ||
}, _callee, this); | ||
})); | ||
return function next() { | ||
return ref.apply(this, arguments); | ||
return _ref2.apply(this, arguments); | ||
}; | ||
}(); | ||
var context, root, result, value, done, errorRoute, match; | ||
var context, root, result, value, done, match, error; | ||
return _regeneratorRuntime.wrap(function _callee2$(_context2) { | ||
@@ -270,8 +228,5 @@ while (1) { | ||
root = Array.isArray(routes) ? { path: '/', children: routes } : routes; | ||
result = void 0; | ||
result = null; | ||
value = void 0; | ||
done = false; | ||
errorRoute = root.children && root.children.find(function (x) { | ||
return x.path === '/error'; | ||
}); | ||
match = matchRoute(root, '', context.path); | ||
@@ -281,43 +236,21 @@ | ||
context.next = next; | ||
context.end = function (data) { | ||
result = data;done = true; | ||
}; | ||
case 9: | ||
if (done) { | ||
_context2.next = 17; | ||
break; | ||
} | ||
_context2.next = 12; | ||
_context2.next = 9; | ||
return next(); | ||
case 12: | ||
result = _context2.sent; | ||
if (!(result !== undefined)) { | ||
_context2.next = 15; | ||
case 9: | ||
if (!(result === null || result === undefined)) { | ||
_context2.next = 13; | ||
break; | ||
} | ||
return _context2.abrupt('break', 17); | ||
error = new Error('Page not found'); | ||
case 15: | ||
_context2.next = 9; | ||
break; | ||
error.status = error.statusCode = 404; | ||
throw error; | ||
case 17: | ||
if (!(result === undefined && errorRoute)) { | ||
_context2.next = 21; | ||
break; | ||
} | ||
context.error = new Error('Not found'); | ||
context.error.status = 404; | ||
return _context2.abrupt('return', errorRoute.action(context, {})); | ||
case 21: | ||
case 13: | ||
return _context2.abrupt('return', result); | ||
case 22: | ||
case 14: | ||
case 'end': | ||
@@ -331,11 +264,28 @@ return _context2.stop(); | ||
return function resolve(_x, _x2) { | ||
return ref.apply(this, arguments); | ||
return _ref.apply(this, arguments); | ||
}; | ||
}(); | ||
var main = { resolve: resolve, match: resolve /* alias */ }; | ||
/** | ||
* Universal Router (https://www.kriasoft.com/universal-router/) | ||
* | ||
* Copyright © 2015-2016 Konstantin Tarkus, Kriasoft LLC. All rights reserved. | ||
* | ||
* This source code is licensed under the Apache 2.0 license found in the | ||
* LICENSE.txt file in the root directory of this source tree. | ||
*/ | ||
/** | ||
* Universal Router (https://www.kriasoft.com/universal-router/) | ||
* | ||
* Copyright © 2015-2016 Konstantin Tarkus, Kriasoft LLC. All rights reserved. | ||
* | ||
* This source code is licensed under the Apache 2.0 license found in the | ||
* LICENSE.txt file in the root directory of this source tree. | ||
*/ | ||
var main = { resolve: resolve }; | ||
exports.resolve = resolve; | ||
exports.match = resolve; | ||
exports['default'] = main; | ||
//# sourceMappingURL=legacy.js.map | ||
//# sourceMappingURL=legacy.js.map |
@@ -0,0 +0,0 @@ The MIT License |
133
main.js
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } | ||
@@ -11,6 +13,15 @@ | ||
/** | ||
* Universal Router (https://www.kriasoft.com/universal-router/) | ||
* | ||
* Copyright © 2015-2016 Konstantin Tarkus, Kriasoft LLC. All rights reserved. | ||
* | ||
* This source code is licensed under the Apache 2.0 license found in the | ||
* LICENSE.txt file in the root directory of this source tree. | ||
*/ | ||
const cache = new _Map(); | ||
function decodeParam(val) { | ||
if (!(typeof val === 'string' || val.length === 0)) { | ||
if (val === undefined || val === '') { | ||
return val; | ||
@@ -22,12 +33,7 @@ } | ||
} catch (err) { | ||
if (err instanceof URIError) { | ||
err.message = `Failed to decode param '${ val }'`; | ||
err.status = 400; | ||
} | ||
throw err; | ||
return val; | ||
} | ||
} | ||
function matchPathBase(end, routePath, urlPath) { | ||
function matchPathBase(end, routePath, urlPath, parentParams) { | ||
const key = `${ routePath }|${ end }`; | ||
@@ -48,7 +54,10 @@ let regexp = cache.get(key); | ||
const path = m[0]; | ||
const params = _Object$create(null); | ||
const path = m[0]; | ||
if (parentParams) { | ||
_Object$assign(params, parentParams); | ||
} | ||
for (let i = 1; i < m.length; i++) { | ||
params[regexp.keys[i - 1].name] = m[i] !== undefined ? decodeParam(m[i]) : undefined; | ||
for (let i = 1; i < m.length; i += 1) { | ||
params[regexp.keys[i - 1].name] = decodeParam(m[i]); | ||
} | ||
@@ -62,7 +71,16 @@ | ||
function* matchRoute(route, baseUrl, path) { | ||
/** | ||
* Universal Router (https://www.kriasoft.com/universal-router/) | ||
* | ||
* Copyright © 2015-2016 Konstantin Tarkus, Kriasoft LLC. All rights reserved. | ||
* | ||
* This source code is licensed under the Apache 2.0 license found in the | ||
* LICENSE.txt file in the root directory of this source tree. | ||
*/ | ||
function* matchRoute(route, baseUrl, path, parentParams) { | ||
let match; | ||
if (!route.children) { | ||
match = matchPath(route.path, path); | ||
match = matchPath(route.path, path, parentParams); | ||
@@ -81,3 +99,4 @@ if (match) { | ||
if (route.children) { | ||
match = matchBasePath(route.path, path); | ||
match = matchBasePath(route.path, path, parentParams); | ||
if (match) { | ||
@@ -92,5 +111,5 @@ yield { | ||
for (const childRoute of route.children) { | ||
for (let i = 0; i < route.children.length; i += 1) { | ||
const newPath = path.substr(match.path.length); | ||
yield* matchRoute(childRoute, baseUrl + (match.path === '/' ? '' : match.path), newPath.startsWith('/') ? newPath : `/${ newPath }`); | ||
yield* matchRoute(route.children[i], baseUrl + (match.path === '/' ? '' : match.path), newPath.startsWith('/') ? newPath : `/${ newPath }`, match.params); | ||
} | ||
@@ -102,34 +121,21 @@ } | ||
let resolve = (() => { | ||
var ref = _asyncToGenerator(function* (routes, pathOrContext) { | ||
var _ref = _asyncToGenerator(function* (routes, pathOrContext) { | ||
let next = (() => { | ||
var ref = _asyncToGenerator(function* () { | ||
var _match$next = match.next(); | ||
var _ref2 = _asyncToGenerator(function* () { | ||
({ value, done } = match.next()); | ||
value = _match$next.value; | ||
done = _match$next.done; | ||
if (!value || done || result !== null && result !== undefined) { | ||
return result; | ||
} | ||
if (value && !done) { | ||
if (value.route.action) { | ||
const newContext = _Object$assign({}, context, value); | ||
if (value.route.action) { | ||
if (errorRoute) { | ||
try { | ||
return yield value.route.action(newContext, newContext.params); | ||
} catch (err) { | ||
err.status = err.status || 500; | ||
newContext.error = err; | ||
return errorRoute.action(newContext, newContext.params); | ||
} | ||
} else { | ||
return yield value.route.action(newContext, newContext.params); | ||
} | ||
} | ||
result = yield value.route.action(newContext, newContext.params); | ||
} | ||
return undefined; | ||
return yield next(); | ||
}); | ||
return function next() { | ||
return ref.apply(this, arguments); | ||
return _ref2.apply(this, arguments); | ||
}; | ||
@@ -140,30 +146,18 @@ })(); | ||
const root = Array.isArray(routes) ? { path: '/', children: routes } : routes; | ||
let result; | ||
let result = null; | ||
let value; | ||
let done = false; | ||
const errorRoute = root.children && root.children.find(function (x) { | ||
return x.path === '/error'; | ||
}); | ||
const match = matchRoute(root, '', context.path); | ||
context.next = next; | ||
context.end = function (data) { | ||
result = data;done = true; | ||
}; | ||
while (!done) { | ||
result = yield next(); | ||
yield next(); | ||
if (result !== undefined) { | ||
break; | ||
} | ||
if (result === null || result === undefined) { | ||
const error = new Error('Page not found'); | ||
error.status = error.statusCode = 404; | ||
throw error; | ||
} | ||
if (result === undefined && errorRoute) { | ||
context.error = new Error('Not found'); | ||
context.error.status = 404; | ||
return errorRoute.action(context, {}); | ||
} | ||
return result; | ||
@@ -173,11 +167,28 @@ }); | ||
return function resolve(_x, _x2) { | ||
return ref.apply(this, arguments); | ||
return _ref.apply(this, arguments); | ||
}; | ||
})(); | ||
var main = { resolve, match: resolve /* alias */ }; | ||
/** | ||
* Universal Router (https://www.kriasoft.com/universal-router/) | ||
* | ||
* Copyright © 2015-2016 Konstantin Tarkus, Kriasoft LLC. All rights reserved. | ||
* | ||
* This source code is licensed under the Apache 2.0 license found in the | ||
* LICENSE.txt file in the root directory of this source tree. | ||
*/ | ||
/** | ||
* Universal Router (https://www.kriasoft.com/universal-router/) | ||
* | ||
* Copyright © 2015-2016 Konstantin Tarkus, Kriasoft LLC. All rights reserved. | ||
* | ||
* This source code is licensed under the Apache 2.0 license found in the | ||
* LICENSE.txt file in the root directory of this source tree. | ||
*/ | ||
var main = { resolve }; | ||
exports.resolve = resolve; | ||
exports.match = resolve; | ||
exports['default'] = main; | ||
//# sourceMappingURL=main.js.map | ||
//# sourceMappingURL=main.js.map |
{ | ||
"name": "universal-router", | ||
"version": "1.2.2", | ||
"version": "2.0.0", | ||
"description": "Isomorphic router for JavaScript web applications", | ||
@@ -9,3 +9,4 @@ "homepage": "https://www.kriasoft.com/universal-router/", | ||
"contributors": [ | ||
"Konstantin Tarkus <hello@tarkus.me> (https://tarkus.me)" | ||
"Konstantin Tarkus <hello@tarkus.me> (https://tarkus.me)", | ||
"Vladimir Kutepov <frenzzy.man@gmail.com>" | ||
], | ||
@@ -28,5 +29,5 @@ "license": "MIT", | ||
"dependencies": { | ||
"babel-runtime": "^6.6.1", | ||
"path-to-regexp": "^1.3.0" | ||
"babel-runtime": "^6.11.6", | ||
"path-to-regexp": "^1.6.0" | ||
} | ||
} |
@@ -15,3 +15,3 @@ # Universal Router | ||
## Documentation | ||
### Documentation | ||
@@ -23,4 +23,10 @@ * [Overview](docs/index.md) | ||
## Backers | ||
### Learn ES6 | ||
:mortar_board: **[ES6 Training Course](https://es6.io/friend/konstantin)** by Wes Bos<br> | ||
:green_book: **[You Don't Know JS: ES6 & Beyond](http://amzn.to/2bFss85)** by Kyle Simpson (Dec, 2015)<br> | ||
### Backers | ||
♥ Universal Router? Help us keep it alive by [donating funds](https://www.patreon.com/tarkus) to cover project expenses! | ||
@@ -31,3 +37,3 @@ | ||
</a> | ||
<a href="https://www.patreon.com/bePatron?patAmt=25&u=2475816" target="_blank"> | ||
<a href="https://www.patreon.com/tarkus" target="_blank"> | ||
<img src="https://opencollective.com/static/images/become_backer.svg" width="64" height="64" alt=""> | ||
@@ -37,4 +43,5 @@ </a> | ||
## Related Projects | ||
### Related Projects | ||
* [React App](https://github.com/kriasoft/react-app) — A better way to bootstrap React apps | ||
* [React Starter Kit](https://github.com/kriasoft/react-starter-kit) — Isomorphic web app boilerplate (Node.js, Express, React, GraphQL) | ||
@@ -52,3 +59,3 @@ * [Babel Starter Kit](https://github.com/kriasoft/babel-starter-kit) — JavaScript library boilerplate (ES2015, Babel, Rollup, Mocha, Chai, Sinon, Rewire) | ||
## License | ||
### License | ||
@@ -55,0 +62,0 @@ Copyright © 2015-2016 Konstantin Tarkus, Kriasoft LLC. This source code is licensed under the MIT |
@@ -1,2 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.UniversalRouter=t.UniversalRouter||{})}(this,function(t){"use strict";function e(t,e){return e={exports:{}},t(e,e.exports,i),e.exports}function n(t){if("string"!=typeof t&&0!==t.length)return t;try{return decodeURIComponent(t)}catch(e){throw e instanceof URIError&&(e.message="Failed to decode param '"+t+"'",e.status=400),e}}function r(t,e,r){var o=e+"|"+t,i=Bn.get(o);if(!i){var u=[];i={pattern:Yn(e,u,{end:t}),keys:u},Bn.set(o,i)}var f=i.pattern.exec(r);if(!f)return null;for(var a=we(null),c=f[0],s=1;s<f.length;s++)a[i.keys[s-1].name]=void 0!==f[s]?n(f[s]):void 0;return{path:""===c?"/":c,keys:i.keys.slice(),params:a}}function o(t,e,n){var r,i,u,f,a,c,s,l;return sn.wrap(function(p){for(;;)switch(p.prev=p.next){case 0:if(r=void 0,t.children){p.next=6;break}if(r=qn(t.path,n),!r){p.next=6;break}return p.next=6,{route:t,baseUrl:e,path:r.path,keys:r.keys,params:r.params};case 6:if(!t.children){p.next=37;break}if(r=Hn(t.path,n),!r){p.next=37;break}return p.next=11,{route:t,baseUrl:e,path:r.path,keys:r.keys,params:r.params};case 11:i=!0,u=!1,f=void 0,p.prev=14,a=En(t.children);case 16:if(i=(c=a.next()).done){p.next=23;break}return s=c.value,l=n.substr(r.path.length),p.delegateYield(o(s,e+("/"===r.path?"":r.path),l.startsWith("/")?l:"/"+l),"t0",20);case 20:i=!0,p.next=16;break;case 23:p.next=29;break;case 25:p.prev=25,p.t1=p["catch"](14),u=!0,f=p.t1;case 29:p.prev=29,p.prev=30,!i&&a["return"]&&a["return"]();case 32:if(p.prev=32,!u){p.next=35;break}throw f;case 35:return p.finish(32);case 36:return p.finish(29);case 37:case"end":return p.stop()}},Qn[0],this,[[14,25,29,37],[30,,32,36]])}var i="undefined"!=typeof window?window:"undefined"!=typeof global?global:this,u=e(function(t){var e=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=e)}),f=u&&"object"==typeof u&&"default"in u?u["default"]:u,a=e(function(t){t.exports=function(t){try{return!!t()}catch(e){return!0}}}),c=a&&"object"==typeof a&&"default"in a?a["default"]:a,s=e(function(t){t.exports=!c(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})}),l=s&&"object"==typeof s&&"default"in s?s["default"]:s,p=e(function(t){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}}),d=p&&"object"==typeof p&&"default"in p?p["default"]:p,v=e(function(t){var e=d;t.exports=function(t,n){if(!e(t))return t;var r,o;if(n&&"function"==typeof(r=t.toString)&&!e(o=r.call(t)))return o;if("function"==typeof(r=t.valueOf)&&!e(o=r.call(t)))return o;if(!n&&"function"==typeof(r=t.toString)&&!e(o=r.call(t)))return o;throw TypeError("Can't convert object to primitive value")}}),h=v&&"object"==typeof v&&"default"in v?v["default"]:v,y=e(function(t){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)}),b=y&&"object"==typeof y&&"default"in y?y["default"]:y,x=e(function(t){var e=d,n=b.document,r=e(n)&&e(n.createElement);t.exports=function(t){return r?n.createElement(t):{}}}),g=x&&"object"==typeof x&&"default"in x?x["default"]:x,j=e(function(t){t.exports=!l&&!c(function(){return 7!=Object.defineProperty(g("div"),"a",{get:function(){return 7}}).a})}),m=j&&"object"==typeof j&&"default"in j?j["default"]:j,_=e(function(t){var e=d;t.exports=function(t){if(!e(t))throw TypeError(t+" is not an object!");return t}}),w=_&&"object"==typeof _&&"default"in _?_["default"]:_,E=e(function(t,e){var n=w,r=m,o=h,i=Object.defineProperty;e.f=l?Object.defineProperty:function(t,e,u){if(n(t),e=o(e,!0),n(u),r)try{return i(t,e,u)}catch(f){}if("get"in u||"set"in u)throw TypeError("Accessors not supported!");return"value"in u&&(t[e]=u.value),t}}),O=E&&"object"==typeof E&&"default"in E?E["default"]:E,k=e(function(t){var e=0,n=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++e+n).toString(36))}}),S=k&&"object"==typeof k&&"default"in k?k["default"]:k,P=e(function(t){var e=b,n="__core-js_shared__",r=e[n]||(e[n]={});t.exports=function(t){return r[t]||(r[t]={})}}),M=P&&"object"==typeof P&&"default"in P?P["default"]:P,L=e(function(t){var e=M("wks"),n=S,r=b.Symbol,o="function"==typeof r,i=t.exports=function(t){return e[t]||(e[t]=o&&r[t]||(o?r:n)("Symbol."+t))};i.store=e}),R=L&&"object"==typeof L&&"default"in L?L["default"]:L,T=e(function(t,e){e.f=R}),A=T&&"object"==typeof T&&"default"in T?T["default"]:T,F=e(function(t){t.exports=!0}),N=F&&"object"==typeof F&&"default"in F?F["default"]:F,I=e(function(t){var e=b,n=f,r=N,o=A,i=O.f;t.exports=function(t){var u=n.Symbol||(n.Symbol=r?{}:e.Symbol||{});"_"==t.charAt(0)||t in u||i(u,t,{value:o.f(t)})}}),C=I&&"object"==typeof I&&"default"in I?I["default"]:I,U=(e(function(t){C("observable")}),e(function(t){C("asyncIterator")}),e(function(t){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}})),G=U&&"object"==typeof U&&"default"in U?U["default"]:U,W=e(function(t){var e=O,n=G;t.exports=l?function(t,r,o){return e.f(t,r,n(1,o))}:function(t,e,n){return t[e]=n,t}}),$=W&&"object"==typeof W&&"default"in W?W["default"]:W,z=e(function(t,e){e.f=Object.getOwnPropertySymbols}),D=z&&"object"==typeof z&&"default"in z?z["default"]:z,J=e(function(t,e){e.f={}.propertyIsEnumerable}),K=J&&"object"==typeof J&&"default"in J?J["default"]:J,Y=e(function(t){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")}),B=Y&&"object"==typeof Y&&"default"in Y?Y["default"]:Y,q=e(function(t){var e=M("keys"),n=S;t.exports=function(t){return e[t]||(e[t]=n(t))}}),H=q&&"object"==typeof q&&"default"in q?q["default"]:q,Q=e(function(t){var e=Math.ceil,n=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?n:e)(t)}}),V=Q&&"object"==typeof Q&&"default"in Q?Q["default"]:Q,X=e(function(t){var e=V,n=Math.max,r=Math.min;t.exports=function(t,o){return t=e(t),0>t?n(t+o,0):r(t,o)}}),Z=X&&"object"==typeof X&&"default"in X?X["default"]:X,tt=e(function(t){var e=V,n=Math.min;t.exports=function(t){return t>0?n(e(t),9007199254740991):0}}),et=tt&&"object"==typeof tt&&"default"in tt?tt["default"]:tt,nt=e(function(t){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}}),rt=nt&&"object"==typeof nt&&"default"in nt?nt["default"]:nt,ot=e(function(t){var e={}.toString;t.exports=function(t){return e.call(t).slice(8,-1)}}),it=ot&&"object"==typeof ot&&"default"in ot?ot["default"]:ot,ut=e(function(t){var e=it;t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==e(t)?t.split(""):Object(t)}}),ft=ut&&"object"==typeof ut&&"default"in ut?ut["default"]:ut,at=e(function(t){var e=ft,n=rt;t.exports=function(t){return e(n(t))}}),ct=at&&"object"==typeof at&&"default"in at?at["default"]:at,st=e(function(t){var e=ct,n=et,r=Z;t.exports=function(t){return function(o,i,u){var f,a=e(o),c=n(a.length),s=r(u,c);if(t&&i!=i){for(;c>s;)if(f=a[s++],f!=f)return!0}else for(;c>s;s++)if((t||s in a)&&a[s]===i)return t||s||0;return!t&&-1}}}),lt=st&&"object"==typeof st&&"default"in st?st["default"]:st,pt=e(function(t){var e={}.hasOwnProperty;t.exports=function(t,n){return e.call(t,n)}}),dt=pt&&"object"==typeof pt&&"default"in pt?pt["default"]:pt,vt=e(function(t){var e=dt,n=ct,r=lt(!1),o=H("IE_PROTO");t.exports=function(t,i){var u,f=n(t),a=0,c=[];for(u in f)u!=o&&e(f,u)&&c.push(u);for(;i.length>a;)e(f,u=i[a++])&&(~r(c,u)||c.push(u));return c}}),ht=vt&&"object"==typeof vt&&"default"in vt?vt["default"]:vt,yt=e(function(t,e){var n=ht,r=B.concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return n(t,r)}}),bt=yt&&"object"==typeof yt&&"default"in yt?yt["default"]:yt,xt=e(function(t){var e=ht,n=B;t.exports=Object.keys||function(t){return e(t,n)}}),gt=xt&&"object"==typeof xt&&"default"in xt?xt["default"]:xt,jt=e(function(t,e){var n=K,r=G,o=ct,i=h,u=dt,f=m,a=Object.getOwnPropertyDescriptor;e.f=l?a:function(t,e){if(t=o(t),e=i(e,!0),f)try{return a(t,e)}catch(c){}return u(t,e)?r(!n.f.call(t,e),t[e]):void 0}}),mt=jt&&"object"==typeof jt&&"default"in jt?jt["default"]:jt,_t=e(function(t){var e=ct,n=bt.f,r={}.toString,o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],i=function(t){try{return n(t)}catch(e){return o.slice()}};t.exports.f=function(t){return o&&"[object Window]"==r.call(t)?i(t):n(e(t))}}),wt=_t&&"object"==typeof _t&&"default"in _t?_t["default"]:_t,Et=e(function(t){t.exports=b.document&&document.documentElement}),Ot=Et&&"object"==typeof Et&&"default"in Et?Et["default"]:Et,kt=e(function(t){var e=O,n=w,r=gt;t.exports=l?Object.defineProperties:function(t,o){n(t);for(var i,u=r(o),f=u.length,a=0;f>a;)e.f(t,i=u[a++],o[i]);return t}}),St=kt&&"object"==typeof kt&&"default"in kt?kt["default"]:kt,Pt=e(function(t){var e=w,n=St,r=B,o=H("IE_PROTO"),i=function(){},u="prototype",f=function(){var t,e=g("iframe"),n=r.length,o=">";for(e.style.display="none",Ot.appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write("<script>document.F=Object</script"+o),t.close(),f=t.F;n--;)delete f[u][r[n]];return f()};t.exports=Object.create||function(t,r){var a;return null!==t?(i[u]=e(t),a=new i,i[u]=null,a[o]=t):a=f(),void 0===r?a:n(a,r)}}),Mt=Pt&&"object"==typeof Pt&&"default"in Pt?Pt["default"]:Pt,Lt=e(function(t){var e=it;t.exports=Array.isArray||function(t){return"Array"==e(t)}}),Rt=Lt&&"object"==typeof Lt&&"default"in Lt?Lt["default"]:Lt,Tt=e(function(t){var e=gt,n=D,r=K;t.exports=function(t){var o=e(t),i=n.f;if(i)for(var u,f=i(t),a=r.f,c=0;f.length>c;)a.call(t,u=f[c++])&&o.push(u);return o}}),At=Tt&&"object"==typeof Tt&&"default"in Tt?Tt["default"]:Tt,Ft=e(function(t){var e=gt,n=ct;t.exports=function(t,r){for(var o,i=n(t),u=e(i),f=u.length,a=0;f>a;)if(i[o=u[a++]]===r)return o}}),Nt=Ft&&"object"==typeof Ft&&"default"in Ft?Ft["default"]:Ft,It=e(function(t){var e=O.f,n=dt,r=R("toStringTag");t.exports=function(t,o,i){t&&!n(t=i?t:t.prototype,r)&&e(t,r,{configurable:!0,value:o})}}),Ct=It&&"object"==typeof It&&"default"in It?It["default"]:It,Ut=e(function(t){var e=S("meta"),n=d,r=dt,o=O.f,i=0,u=Object.isExtensible||function(){return!0},f=!c(function(){return u(Object.preventExtensions({}))}),a=function(t){o(t,e,{value:{i:"O"+ ++i,w:{}}})},s=function(t,o){if(!n(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!r(t,e)){if(!u(t))return"F";if(!o)return"E";a(t)}return t[e].i},l=function(t,n){if(!r(t,e)){if(!u(t))return!0;if(!n)return!1;a(t)}return t[e].w},p=function(t){return f&&v.NEED&&u(t)&&!r(t,e)&&a(t),t},v=t.exports={KEY:e,NEED:!1,fastKey:s,getWeak:l,onFreeze:p}}),Gt=Ut&&"object"==typeof Ut&&"default"in Ut?Ut["default"]:Ut,Wt=e(function(t){t.exports=$}),$t=Wt&&"object"==typeof Wt&&"default"in Wt?Wt["default"]:Wt,zt=e(function(t){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}}),Dt=zt&&"object"==typeof zt&&"default"in zt?zt["default"]:zt,Jt=e(function(t){var e=Dt;t.exports=function(t,n,r){if(e(t),void 0===n)return t;switch(r){case 1:return function(e){return t.call(n,e)};case 2:return function(e,r){return t.call(n,e,r)};case 3:return function(e,r,o){return t.call(n,e,r,o)}}return function(){return t.apply(n,arguments)}}}),Kt=Jt&&"object"==typeof Jt&&"default"in Jt?Jt["default"]:Jt,Yt=e(function(t,e){var n=b,r=f,o=Kt,i=$,u="prototype",a=function(t,e,f){var c,s,l,p=t&a.F,d=t&a.G,v=t&a.S,h=t&a.P,y=t&a.B,b=t&a.W,x=d?r:r[e]||(r[e]={}),g=x[u],j=d?n:v?n[e]:(n[e]||{})[u];d&&(f=e);for(c in f)s=!p&&j&&void 0!==j[c],s&&c in x||(l=s?j[c]:f[c],x[c]=d&&"function"!=typeof j[c]?f[c]:y&&s?o(l,n):b&&j[c]==l?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e[u]=t[u],e}(l):h&&"function"==typeof l?o(Function.call,l):l,h&&((x.virtual||(x.virtual={}))[c]=l,t&a.R&&g&&!g[c]&&i(g,c,l)))};a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,a.U=64,a.R=128,t.exports=a}),Bt=Yt&&"object"==typeof Yt&&"default"in Yt?Yt["default"]:Yt,qt=(e(function(t){var e=b,n=dt,r=l,o=Bt,i=$t,u=Gt.KEY,f=c,a=M,s=Ct,p=S,d=R,v=A,y=C,x=Nt,g=At,j=Rt,m=w,_=ct,E=h,k=G,P=Mt,L=wt,T=mt,F=O,I=gt,U=T.f,W=F.f,z=L.f,J=e.Symbol,Y=e.JSON,B=Y&&Y.stringify,q="prototype",H=d("_hidden"),Q=d("toPrimitive"),V={}.propertyIsEnumerable,X=a("symbol-registry"),Z=a("symbols"),tt=a("op-symbols"),et=Object[q],nt="function"==typeof J,rt=e.QObject,ot=!rt||!rt[q]||!rt[q].findChild,it=r&&f(function(){return 7!=P(W({},"a",{get:function(){return W(this,"a",{value:7}).a}})).a})?function(t,e,n){var r=U(et,e);r&&delete et[e],W(t,e,n),r&&t!==et&&W(et,e,r)}:W,ut=function(t){var e=Z[t]=P(J[q]);return e._k=t,e},ft=nt&&"symbol"==typeof J.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof J},at=function(t,e,r){return t===et&&at(tt,e,r),m(t),e=E(e,!0),m(r),n(Z,e)?(r.enumerable?(n(t,H)&&t[H][e]&&(t[H][e]=!1),r=P(r,{enumerable:k(0,!1)})):(n(t,H)||W(t,H,k(1,{})),t[H][e]=!0),it(t,e,r)):W(t,e,r)},st=function(t,e){m(t);for(var n,r=g(e=_(e)),o=0,i=r.length;i>o;)at(t,n=r[o++],e[n]);return t},lt=function(t,e){return void 0===e?P(t):st(P(t),e)},pt=function(t){var e=V.call(this,t=E(t,!0));return this===et&&n(Z,t)&&!n(tt,t)?!1:e||!n(this,t)||!n(Z,t)||n(this,H)&&this[H][t]?e:!0},vt=function(t,e){if(t=_(t),e=E(e,!0),t!==et||!n(Z,e)||n(tt,e)){var r=U(t,e);return!r||!n(Z,e)||n(t,H)&&t[H][e]||(r.enumerable=!0),r}},ht=function(t){for(var e,r=z(_(t)),o=[],i=0;r.length>i;)n(Z,e=r[i++])||e==H||e==u||o.push(e);return o},yt=function(t){for(var e,r=t===et,o=z(r?tt:_(t)),i=[],u=0;o.length>u;)n(Z,e=o[u++])&&(r?n(et,e):!0)&&i.push(Z[e]);return i};nt||(J=function(){if(this instanceof J)throw TypeError("Symbol is not a constructor!");var t=p(arguments.length>0?arguments[0]:void 0),e=function(r){this===et&&e.call(tt,r),n(this,H)&&n(this[H],t)&&(this[H][t]=!1),it(this,t,k(1,r))};return r&&ot&&it(et,t,{configurable:!0,set:e}),ut(t)},i(J[q],"toString",function(){return this._k}),T.f=vt,F.f=at,bt.f=L.f=ht,K.f=pt,D.f=yt,r&&!N&&i(et,"propertyIsEnumerable",pt,!0),v.f=function(t){return ut(d(t))}),o(o.G+o.W+o.F*!nt,{Symbol:J});for(var xt="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),jt=0;xt.length>jt;)d(xt[jt++]);for(var xt=I(d.store),jt=0;xt.length>jt;)y(xt[jt++]);o(o.S+o.F*!nt,"Symbol",{"for":function(t){return n(X,t+="")?X[t]:X[t]=J(t)},keyFor:function(t){if(ft(t))return x(X,t);throw TypeError(t+" is not a symbol!")},useSetter:function(){ot=!0},useSimple:function(){ot=!1}}),o(o.S+o.F*!nt,"Object",{create:lt,defineProperty:at,defineProperties:st,getOwnPropertyDescriptor:vt,getOwnPropertyNames:ht,getOwnPropertySymbols:yt}),Y&&o(o.S+o.F*(!nt||f(function(){var t=J();return"[null]"!=B([t])||"{}"!=B({a:t})||"{}"!=B(Object(t))})),"JSON",{stringify:function(t){if(void 0!==t&&!ft(t)){for(var e,n,r=[t],o=1;arguments.length>o;)r.push(arguments[o++]);return e=r[1],"function"==typeof e&&(n=e),!n&&j(e)||(e=function(t,e){return n&&(e=n.call(this,t,e)),ft(e)?void 0:e}),r[1]=e,B.apply(Y,r)}}}),J[q][Q]||$(J[q],Q,J[q].valueOf),s(J,"Symbol"),s(Math,"Math",!0),s(e.JSON,"JSON",!0)}),e(function(t){t.exports=f.Symbol})),Ht=qt&&"object"==typeof qt&&"default"in qt?qt["default"]:qt,Qt=e(function(t){t.exports={"default":Ht,__esModule:!0}}),Vt=Qt&&"object"==typeof Qt&&"default"in Qt?Qt["default"]:Qt,Xt=e(function(t){t.exports={}}),Zt=Xt&&"object"==typeof Xt&&"default"in Xt?Xt["default"]:Xt,te=e(function(t){var e=rt;t.exports=function(t){return Object(e(t))}}),ee=te&&"object"==typeof te&&"default"in te?te["default"]:te,ne=e(function(t){var e=dt,n=ee,r=H("IE_PROTO"),o=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=n(t),e(t,r)?t[r]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?o:null}}),re=ne&&"object"==typeof ne&&"default"in ne?ne["default"]:ne,oe=e(function(t){var e=Mt,n=G,r=Ct,o={};$(o,R("iterator"),function(){return this}),t.exports=function(t,i,u){t.prototype=e(o,{next:n(1,u)}),r(t,i+" Iterator")}}),ie=oe&&"object"==typeof oe&&"default"in oe?oe["default"]:oe,ue=e(function(t){var e=N,n=Bt,r=$t,o=$,i=dt,u=Zt,f=ie,a=Ct,c=re,s=R("iterator"),l=!([].keys&&"next"in[].keys()),p="@@iterator",d="keys",v="values",h=function(){return this};t.exports=function(t,y,b,x,g,j,m){f(b,y,x);var _,w,E,O=function(t){if(!l&&t in M)return M[t];switch(t){case d:return function(){return new b(this,t)};case v:return function(){return new b(this,t)}}return function(){return new b(this,t)}},k=y+" Iterator",S=g==v,P=!1,M=t.prototype,L=M[s]||M[p]||g&&M[g],R=L||O(g),T=g?S?O("entries"):R:void 0,A="Array"==y?M.entries||L:L;if(A&&(E=c(A.call(new t)),E!==Object.prototype&&(a(E,k,!0),e||i(E,s)||o(E,s,h))),S&&L&&L.name!==v&&(P=!0,R=function(){return L.call(this)}),e&&!m||!l&&!P&&M[s]||o(M,s,R),u[y]=R,u[k]=h,g)if(_={values:S?R:O(v),keys:j?R:O(d),entries:T},m)for(w in _)w in M||r(M,w,_[w]);else n(n.P+n.F*(l||P),y,_);return _}}),fe=ue&&"object"==typeof ue&&"default"in ue?ue["default"]:ue,ae=e(function(t){t.exports=function(t,e){return{value:e,done:!!t}}}),ce=ae&&"object"==typeof ae&&"default"in ae?ae["default"]:ae,se=e(function(t){t.exports=function(){}}),le=se&&"object"==typeof se&&"default"in se?se["default"]:se,pe=(e(function(t){var e=le,n=ce,r=Zt,o=ct;t.exports=fe(Array,"Array",function(t,e){this._t=o(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,r=this._i++;return!t||r>=t.length?(this._t=void 0,n(1)):"keys"==e?n(0,r):"values"==e?n(0,t[r]):n(0,[r,t[r]])},"values"),r.Arguments=r.Array,e("keys"),e("values"),e("entries")}),e(function(t){for(var e=b,n=$,r=Zt,o=R("toStringTag"),i=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],u=0;5>u;u++){var f=i[u],a=e[f],c=a&&a.prototype;c&&!c[o]&&n(c,o,f),r[f]=r.Array}}),e(function(t){var e=V,n=rt;t.exports=function(t){return function(r,o){var i,u,f=String(n(r)),a=e(o),c=f.length;return 0>a||a>=c?t?"":void 0:(i=f.charCodeAt(a),55296>i||i>56319||a+1===c||(u=f.charCodeAt(a+1))<56320||u>57343?t?f.charAt(a):i:t?f.slice(a,a+2):(i-55296<<10)+(u-56320)+65536)}}})),de=pe&&"object"==typeof pe&&"default"in pe?pe["default"]:pe,ve=(e(function(t){var e=de(!0);fe(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,n=this._t,r=this._i;return r>=n.length?{value:void 0,done:!0}:(t=e(n,r),this._i+=t.length,{value:t,done:!1})})}),e(function(t){t.exports=A.f("iterator")})),he=ve&&"object"==typeof ve&&"default"in ve?ve["default"]:ve,ye=e(function(t){t.exports={"default":he,__esModule:!0}}),be=ye&&"object"==typeof ye&&"default"in ye?ye["default"]:ye,xe=e(function(t,e){function n(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var r=be,o=n(r),i=Vt,u=n(i),f="function"==typeof u["default"]&&"symbol"==typeof o["default"]?function(t){return typeof t}:function(t){return t&&"function"==typeof u["default"]&&t.constructor===u["default"]?"symbol":typeof t};e["default"]="function"==typeof u["default"]&&"symbol"===f(o["default"])?function(t){return"undefined"==typeof t?"undefined":f(t)}:function(t){return t&&"function"==typeof u["default"]&&t.constructor===u["default"]?"symbol":"undefined"==typeof t?"undefined":f(t)}}),ge=xe&&"object"==typeof xe&&"default"in xe?xe["default"]:xe,je=(e(function(t){var e=Bt;e(e.S,"Object",{create:Mt})}),e(function(t){var e=f.Object;t.exports=function(t,n){return e.create(t,n)}})),me=je&&"object"==typeof je&&"default"in je?je["default"]:je,_e=e(function(t){t.exports={"default":me,__esModule:!0}}),we=_e&&"object"==typeof _e&&"default"in _e?_e["default"]:_e,Ee=e(function(t){var e=d,n=w,r=function(t,r){if(n(t),!e(r)&&null!==r)throw TypeError(r+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,n){try{n=Kt(Function.call,mt.f(Object.prototype,"__proto__").set,2),n(t,[]),e=!(t instanceof Array)}catch(o){e=!0}return function(t,o){return r(t,o),e?t.__proto__=o:n(t,o),t}}({},!1):void 0),check:r}}),Oe=Ee&&"object"==typeof Ee&&"default"in Ee?Ee["default"]:Ee,ke=(e(function(t){var e=Bt;e(e.S,"Object",{setPrototypeOf:Oe.set})}),e(function(t){t.exports=f.Object.setPrototypeOf})),Se=ke&&"object"==typeof ke&&"default"in ke?ke["default"]:ke,Pe=e(function(t){t.exports={"default":Se,__esModule:!0}}),Me=Pe&&"object"==typeof Pe&&"default"in Pe?Pe["default"]:Pe,Le=e(function(t){var e=R("iterator"),n=!1;try{var r=[7][e]();r["return"]=function(){n=!0},Array.from(r,function(){throw 2})}catch(o){}t.exports=function(t,r){if(!r&&!n)return!1;var o=!1;try{var i=[7],u=i[e]();u.next=function(){return{done:o=!0}},i[e]=function(){return u},t(i)}catch(f){}return o}}),Re=Le&&"object"==typeof Le&&"default"in Le?Le["default"]:Le,Te=e(function(t){var e=b,n=f,r=O,o=l,i=R("species");t.exports=function(t){var u="function"==typeof n[t]?n[t]:e[t];o&&u&&!u[i]&&r.f(u,i,{configurable:!0,get:function(){return this}})}}),Ae=Te&&"object"==typeof Te&&"default"in Te?Te["default"]:Te,Fe=e(function(t){var e=$;t.exports=function(t,n,r){for(var o in n)r&&t[o]?t[o]=n[o]:e(t,o,n[o]);return t}}),Ne=Fe&&"object"==typeof Fe&&"default"in Fe?Fe["default"]:Fe,Ie=e(function(t){t.exports=function(t,e,n){var r=void 0===n;switch(e.length){case 0:return r?t():t.call(n);case 1:return r?t(e[0]):t.call(n,e[0]);case 2:return r?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return r?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return r?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)}}),Ce=Ie&&"object"==typeof Ie&&"default"in Ie?Ie["default"]:Ie,Ue=e(function(t,e,n){var r,o,i,u=Kt,f=Ce,a=Ot,c=g,n=b,s=n.process,l=n.setImmediate,p=n.clearImmediate,d=n.MessageChannel,v=0,h={},y="onreadystatechange",x=function(){var t=+this;if(h.hasOwnProperty(t)){var e=h[t];delete h[t],e()}},j=function(t){x.call(t.data)};l&&p||(l=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return h[++v]=function(){f("function"==typeof t?t:Function(t),e)},r(v),v},p=function(t){delete h[t]},"process"==it(s)?r=function(t){s.nextTick(u(x,t,1))}:d?(o=new d,i=o.port2,o.port1.onmessage=j,r=u(i.postMessage,i,1)):n.addEventListener&&"function"==typeof postMessage&&!n.importScripts?(r=function(t){n.postMessage(t+"","*")},n.addEventListener("message",j,!1)):r=y in c("script")?function(t){a.appendChild(c("script"))[y]=function(){a.removeChild(this),x.call(t)}}:function(t){setTimeout(u(x,t,1),0)}),t.exports={set:l,clear:p}}),Ge=Ue&&"object"==typeof Ue&&"default"in Ue?Ue["default"]:Ue,We=e(function(t){var e=b,n=Ge.set,r=e.MutationObserver||e.WebKitMutationObserver,o=e.process,i=e.Promise,u="process"==it(o);t.exports=function(){var t,f,a,c=function(){var e,n;for(u&&(e=o.domain)&&e.exit();t;){n=t.fn,t=t.next;try{n()}catch(r){throw t?a():f=void 0,r}}f=void 0,e&&e.enter()};if(u)a=function(){o.nextTick(c)};else if(r){var s=!0,l=document.createTextNode("");new r(c).observe(l,{characterData:!0}),a=function(){l.data=s=!s}}else if(i&&i.resolve){var p=i.resolve();a=function(){p.then(c)}}else a=function(){n.call(e,c)};return function(e){var n={fn:e,next:void 0};f&&(f.next=n),t||(t=n,a()),f=n}}}),$e=We&&"object"==typeof We&&"default"in We?We["default"]:We,ze=e(function(t){var e=w,n=Dt,r=R("species");t.exports=function(t,o){var i,u=e(t).constructor;return void 0===u||void 0==(i=e(u)[r])?o:n(i)}}),De=ze&&"object"==typeof ze&&"default"in ze?ze["default"]:ze,Je=e(function(t){var e=it,n=R("toStringTag"),r="Arguments"==e(function(){return arguments}()),o=function(t,e){try{return t[e]}catch(n){}};t.exports=function(t){var i,u,f;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(u=o(i=Object(t),n))?u:r?e(i):"Object"==(f=e(i))&&"function"==typeof i.callee?"Arguments":f}}),Ke=Je&&"object"==typeof Je&&"default"in Je?Je["default"]:Je,Ye=e(function(t){var e=Ke,n=R("iterator"),r=Zt;t.exports=f.getIteratorMethod=function(t){return void 0!=t?t[n]||t["@@iterator"]||r[e(t)]:void 0}}),Be=Ye&&"object"==typeof Ye&&"default"in Ye?Ye["default"]:Ye,qe=e(function(t){var e=Zt,n=R("iterator"),r=Array.prototype;t.exports=function(t){return void 0!==t&&(e.Array===t||r[n]===t)}}),He=qe&&"object"==typeof qe&&"default"in qe?qe["default"]:qe,Qe=e(function(t){var e=w;t.exports=function(t,n,r,o){try{return o?n(e(r)[0],r[1]):n(r)}catch(i){var u=t["return"];throw void 0!==u&&e(u.call(t)),i}}}),Ve=Qe&&"object"==typeof Qe&&"default"in Qe?Qe["default"]:Qe,Xe=e(function(t){var e=Kt,n=Ve,r=He,o=w,i=et,u=Be,f={},a={},c=t.exports=function(t,c,s,l,p){var d,v,h,y,b=p?function(){return t}:u(t),x=e(s,l,c?2:1),g=0;if("function"!=typeof b)throw TypeError(t+" is not iterable!");if(r(b)){for(d=i(t.length);d>g;g++)if(y=c?x(o(v=t[g])[0],v[1]):x(t[g]),y===f||y===a)return y}else for(h=b.call(t);!(v=h.next()).done;)if(y=n(h,x,v.value,c),y===f||y===a)return y};c.BREAK=f,c.RETURN=a}),Ze=Xe&&"object"==typeof Xe&&"default"in Xe?Xe["default"]:Xe,tn=e(function(t){t.exports=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t}}),en=tn&&"object"==typeof tn&&"default"in tn?tn["default"]:tn,nn=(e(function(t,e,n){var r,o,i,u=N,n=b,a=Kt,c=Ke,s=Bt,l=d,p=Dt,v=en,h=Ze,y=(Oe.set,De),x=Ge.set,g=$e(),j="Promise",m=n.TypeError,_=n.process,w=n[j],_=n.process,E="process"==c(_),O=function(){},k=!!function(){try{var t=w.resolve(1),e=(t.constructor={})[R("species")]=function(t){t(O,O)};return(E||"function"==typeof PromiseRejectionEvent)&&t.then(O)instanceof e}catch(n){}}(),S=function(t,e){return t===e||t===w&&e===i},P=function(t){var e;return l(t)&&"function"==typeof(e=t.then)?e:!1},M=function(t){return S(w,t)?new L(t):new o(t)},L=o=function(t){var e,n;this.promise=new t(function(t,r){if(void 0!==e||void 0!==n)throw m("Bad Promise constructor");e=t,n=r}),this.resolve=p(e),this.reject=p(n)},T=function(t){try{t()}catch(e){return{error:e}}},A=function(t,e){if(!t._n){t._n=!0;var n=t._c;g(function(){for(var r=t._v,o=1==t._s,i=0,u=function(e){var n,i,u=o?e.ok:e.fail,f=e.resolve,a=e.reject,c=e.domain;try{u?(o||(2==t._h&&C(t),t._h=1),u===!0?n=r:(c&&c.enter(),n=u(r),c&&c.exit()),n===e.promise?a(m("Promise-chain cycle")):(i=P(n))?i.call(n,f,a):f(n)):a(r)}catch(s){a(s)}};n.length>i;)u(n[i++]);t._c=[],t._n=!1,e&&!t._h&&F(t)})}},F=function(t){x.call(n,function(){var e,r,o,i=t._v;if(I(t)&&(e=T(function(){E?_.emit("unhandledRejection",i,t):(r=n.onunhandledrejection)?r({promise:t,reason:i}):(o=n.console)&&o.error&&o.error("Unhandled promise rejection",i)}),t._h=E||I(t)?2:1),t._a=void 0,e)throw e.error})},I=function(t){if(1==t._h)return!1;for(var e,n=t._a||t._c,r=0;n.length>r;)if(e=n[r++],e.fail||!I(e.promise))return!1;return!0},C=function(t){x.call(n,function(){var e;E?_.emit("rejectionHandled",t):(e=n.onrejectionhandled)&&e({promise:t,reason:t._v})})},U=function(t){var e=this;e._d||(e._d=!0,e=e._w||e,e._v=t,e._s=2,e._a||(e._a=e._c.slice()),A(e,!0))},G=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw m("Promise can't be resolved itself");(e=P(t))?g(function(){var r={_w:n,_d:!1};try{e.call(t,a(G,r,1),a(U,r,1))}catch(o){U.call(r,o)}}):(n._v=t,n._s=1,A(n,!1))}catch(r){U.call({_w:n,_d:!1},r)}}};k||(w=function(t){v(this,w,j,"_h"),p(t),r.call(this);try{t(a(G,this,1),a(U,this,1))}catch(e){U.call(this,e)}},r=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},r.prototype=Ne(w.prototype,{then:function(t,e){var n=M(y(this,w));return n.ok="function"==typeof t?t:!0,n.fail="function"==typeof e&&e,n.domain=E?_.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&A(this,!1),n.promise},"catch":function(t){return this.then(void 0,t)}}),L=function(){var t=new r;this.promise=t,this.resolve=a(G,t,1),this.reject=a(U,t,1)}),s(s.G+s.W+s.F*!k,{Promise:w}),Ct(w,j),Ae(j),i=f[j],s(s.S+s.F*!k,j,{reject:function(t){var e=M(this),n=e.reject;return n(t),e.promise}}),s(s.S+s.F*(u||!k),j,{resolve:function(t){if(t instanceof w&&S(t.constructor,this))return t;var e=M(this),n=e.resolve;return n(t),e.promise}}),s(s.S+s.F*!(k&&Re(function(t){w.all(t)["catch"](O)})),j,{all:function(t){var e=this,n=M(e),r=n.resolve,o=n.reject,i=T(function(){var n=[],i=0,u=1;h(t,!1,function(t){var f=i++,a=!1;n.push(void 0),u++,e.resolve(t).then(function(t){a||(a=!0,n[f]=t,--u||r(n))},o)}),--u||r(n)});return i&&o(i.error),n.promise},race:function(t){var e=this,n=M(e),r=n.reject,o=T(function(){h(t,!1,function(t){e.resolve(t).then(n.resolve,r)})});return o&&r(o.error),n.promise}})}),e(function(t){t.exports=f.Promise})),rn=nn&&"object"==typeof nn&&"default"in nn?nn["default"]:nn,on=e(function(t){t.exports={"default":rn,__esModule:!0}}),un=on&&"object"==typeof on&&"default"in on?on["default"]:on,fn=e(function(t,e,n){function r(t){return t&&t.__esModule?t:{"default":t}}var o=un,i=r(o),u=Me,f=r(u),a=we,c=r(a),s=ge,l=r(s),p=be,d=r(p),v=Vt,h=r(v);!function(e){function n(t,e,n,r){var i=(0,c["default"])((e||o).prototype),u=new g(r||[]);return i._invoke=y(t,n,u),i}function r(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(r){return{type:"throw",arg:r}}}function o(){}function u(){}function a(){}function s(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function p(t){this.arg=t}function v(t){function e(e,n){var r=t[e](n),f=r.value;return f instanceof p?i["default"].resolve(f.arg).then(o,u):i["default"].resolve(f).then(function(t){return r.value=t,r})}function n(t,n){function o(){return e(t,n)}return r=r?r.then(o,o):new i["default"](function(t){t(o())})}"object"===("undefined"==typeof process?"undefined":(0,l["default"])(process))&&process.domain&&(e=process.domain.bind(e));var r,o=e.bind(t,"next"),u=e.bind(t,"throw");e.bind(t,"return");this._invoke=n}function y(t,e,n){var o=S;return function(i,u){if(o===M)throw new Error("Generator is already running");if(o===L){if("throw"===i)throw u;return m()}for(;;){var f=n.delegate;if(f){if("return"===i||"throw"===i&&f.iterator[i]===_){n.delegate=null;var a=f.iterator["return"];if(a){var c=r(a,f.iterator,u);if("throw"===c.type){i="throw",u=c.arg;continue}}if("return"===i)continue}var c=r(f.iterator[i],f.iterator,u);if("throw"===c.type){n.delegate=null,i="throw",u=c.arg;continue}i="next",u=_;var s=c.arg;if(!s.done)return o=P,s;n[f.resultName]=s.value,n.next=f.nextLoc,n.delegate=null}if("next"===i)n._sent=u,o===P?n.sent=u:n.sent=_;else if("throw"===i){if(o===S)throw o=L,u;n.dispatchException(u)&&(i="next",u=_)}else"return"===i&&n.abrupt("return",u);o=M;var c=r(t,e,n);if("normal"===c.type){o=n.done?L:P;var s={value:c.arg,done:n.done};if(c.arg!==R)return s;n.delegate&&"next"===i&&(u=_)}else"throw"===c.type&&(o=L,i="throw",u=c.arg)}}}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function g(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function j(t){if(t){var e=t[E];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function o(){for(;++n<t.length;)if(w.call(t,n))return o.value=t[n],o.done=!1,o;return o.value=_,o.done=!0,o};return r.next=r}}return{next:m}}function m(){return{value:_,done:!0}}var _,w=Object.prototype.hasOwnProperty,E="function"==typeof h["default"]&&d["default"]||"@@iterator",O="object"===("undefined"==typeof t?"undefined":(0,l["default"])(t)),k=e.regeneratorRuntime;if(k)return void(O&&(t.exports=k));k=e.regeneratorRuntime=O?t.exports:{},k.wrap=n;var S="suspendedStart",P="suspendedYield",M="executing",L="completed",R={},T=a.prototype=o.prototype;u.prototype=T.constructor=a,a.constructor=u,u.displayName="GeneratorFunction",k.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return e?e===u||"GeneratorFunction"===(e.displayName||e.name):!1},k.mark=function(t){return f["default"]?(0,f["default"])(t,a):t.__proto__=a,t.prototype=(0,c["default"])(T),t},k.awrap=function(t){return new p(t)},s(v.prototype),k.async=function(t,e,r,o){var i=new v(n(t,e,r,o));return k.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next(); | ||
})},s(T),T[E]=function(){return this},T.toString=function(){return"[object Generator]"},k.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},k.values=j,g.prototype={constructor:g,reset:function(t){if(this.prev=0,this.next=0,this.sent=_,this.done=!1,this.delegate=null,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&w.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=_)},stop:function(){this.done=!0;var t=this.tryEntries[0],e=t.completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){function e(e,r){return i.type="throw",i.arg=t,n.next=e,!!r}if(this.done)throw t;for(var n=this,r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],i=o.completion;if("root"===o.tryLoc)return e("end");if(o.tryLoc<=this.prev){var u=w.call(o,"catchLoc"),f=w.call(o,"finallyLoc");if(u&&f){if(this.prev<o.catchLoc)return e(o.catchLoc,!0);if(this.prev<o.finallyLoc)return e(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return e(o.catchLoc,!0)}else{if(!f)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return e(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&w.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?this.next=o.finallyLoc:this.complete(i),R},complete:function(t,e){if("throw"===t.type)throw t.arg;"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=t.arg,this.next="end"):"normal"===t.type&&e&&(this.next=e)},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),R}},"catch":function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;x(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:j(t),resultName:e,nextLoc:n},R}}}("object"===("undefined"==typeof n?"undefined":(0,l["default"])(n))?n:"object"===("undefined"==typeof window?"undefined":(0,l["default"])(window))?window:"object"===("undefined"==typeof self?"undefined":(0,l["default"])(self))?self:void 0)}),an=fn&&"object"==typeof fn&&"default"in fn?fn["default"]:fn,cn=e(function(t,e,n){var r="object"==typeof n?n:"object"==typeof window?window:"object"==typeof self?self:i,o=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,u=o&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,t.exports=an,o)r.regeneratorRuntime=u;else try{delete r.regeneratorRuntime}catch(f){r.regeneratorRuntime=void 0}t.exports={"default":t.exports,__esModule:!0}}),sn=cn&&"object"==typeof cn&&"default"in cn?cn["default"]:cn,ln=e(function(t){var e=gt,n=D,r=K,o=ee,i=ft,u=Object.assign;t.exports=!u||c(function(){var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach(function(t){e[t]=t}),7!=u({},t)[n]||Object.keys(u({},e)).join("")!=r})?function(t,u){for(var f=o(t),a=arguments.length,c=1,s=n.f,l=r.f;a>c;)for(var p,d=i(arguments[c++]),v=s?e(d).concat(s(d)):e(d),h=v.length,y=0;h>y;)l.call(d,p=v[y++])&&(f[p]=d[p]);return f}:u}),pn=ln&&"object"==typeof ln&&"default"in ln?ln["default"]:ln,dn=(e(function(t){var e=Bt;e(e.S+e.F,"Object",{assign:pn})}),e(function(t){t.exports=f.Object.assign})),vn=dn&&"object"==typeof dn&&"default"in dn?dn["default"]:dn,hn=e(function(t){t.exports={"default":vn,__esModule:!0}}),yn=hn&&"object"==typeof hn&&"default"in hn?hn["default"]:hn,bn=e(function(t,e){function n(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var r=un,o=n(r);e["default"]=function(t){return function(){var e=t.apply(this,arguments);return new o["default"](function(t,n){function r(i,u){try{var f=e[i](u),a=f.value}catch(c){return void n(c)}return f.done?void t(a):o["default"].resolve(a).then(function(t){return r("next",t)},function(t){return r("throw",t)})}return r("next")})}}}),xn=bn&&"object"==typeof bn&&"default"in bn?bn["default"]:bn,gn=e(function(t){var e=w,n=Be;t.exports=f.getIterator=function(t){var r=n(t);if("function"!=typeof r)throw TypeError(t+" is not iterable!");return e(r.call(t))}}),jn=gn&&"object"==typeof gn&&"default"in gn?gn["default"]:gn,mn=e(function(t){t.exports=jn}),_n=mn&&"object"==typeof mn&&"default"in mn?mn["default"]:mn,wn=e(function(t){t.exports={"default":_n,__esModule:!0}}),En=wn&&"object"==typeof wn&&"default"in wn?wn["default"]:wn,On=e(function(t){var e=Ze;t.exports=function(t,n){var r=[];return e(t,!1,r.push,r,n),r}}),kn=On&&"object"==typeof On&&"default"in On?On["default"]:On,Sn=e(function(t){var e=Ke,n=kn;t.exports=function(t){return function(){if(e(this)!=t)throw TypeError(t+"#toJSON isn't generic");return n(this)}}}),Pn=Sn&&"object"==typeof Sn&&"default"in Sn?Sn["default"]:Sn,Mn=(e(function(t){var e=Bt;e(e.P+e.R,"Map",{toJSON:Pn("Map")})}),e(function(t){var e=d,n=Rt,r=R("species");t.exports=function(t){var o;return n(t)&&(o=t.constructor,"function"!=typeof o||o!==Array&&!n(o.prototype)||(o=void 0),e(o)&&(o=o[r],null===o&&(o=void 0))),void 0===o?Array:o}})),Ln=Mn&&"object"==typeof Mn&&"default"in Mn?Mn["default"]:Mn,Rn=e(function(t){var e=Ln;t.exports=function(t,n){return new(e(t))(n)}}),Tn=Rn&&"object"==typeof Rn&&"default"in Rn?Rn["default"]:Rn,An=e(function(t){var e=Kt,n=ft,r=ee,o=et,i=Tn;t.exports=function(t,u){var f=1==t,a=2==t,c=3==t,s=4==t,l=6==t,p=5==t||l,d=u||i;return function(i,u,v){for(var h,y,b=r(i),x=n(b),g=e(u,v,3),j=o(x.length),m=0,_=f?d(i,j):a?d(i,0):void 0;j>m;m++)if((p||m in x)&&(h=x[m],y=g(h,m,b),t))if(f)_[m]=y;else if(y)switch(t){case 3:return!0;case 5:return h;case 6:return m;case 2:_.push(h)}else if(s)return!1;return l?-1:c||s?s:_}}}),Fn=An&&"object"==typeof An&&"default"in An?An["default"]:An,Nn=e(function(t){var e=b,n=Bt,r=Gt,o=c,i=$,u=Ne,f=Ze,a=en,s=d,p=Ct,v=O.f,h=Fn(0),y=l;t.exports=function(t,c,l,d,b,x){var g=e[t],j=g,m=b?"set":"add",_=j&&j.prototype,w={};return y&&"function"==typeof j&&(x||_.forEach&&!o(function(){(new j).entries().next()}))?(j=c(function(e,n){a(e,j,t,"_c"),e._c=new g,void 0!=n&&f(n,b,e[m],e)}),h("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),function(t){var e="add"==t||"set"==t;t in _&&(!x||"clear"!=t)&&i(j.prototype,t,function(n,r){if(a(this,j,t),!e&&x&&!s(n))return"get"==t?void 0:!1;var o=this._c[t](0===n?0:n,r);return e?this:o})}),"size"in _&&v(j.prototype,"size",{get:function(){return this._c.size}})):(j=d.getConstructor(c,t,b,m),u(j.prototype,l),r.NEED=!0),p(j,t),w[t]=j,n(n.G+n.W+n.F,w),x||d.setStrong(j,t,b),j}}),In=Nn&&"object"==typeof Nn&&"default"in Nn?Nn["default"]:Nn,Cn=e(function(t){var e=O.f,n=Mt,r=Ne,o=Kt,i=en,u=rt,f=Ze,a=fe,c=ce,s=Ae,p=l,d=Gt.fastKey,v=p?"_s":"size",h=function(t,e){var n,r=d(e);if("F"!==r)return t._i[r];for(n=t._f;n;n=n.n)if(n.k==e)return n};t.exports={getConstructor:function(t,a,c,s){var l=t(function(t,e){i(t,l,a,"_i"),t._i=n(null),t._f=void 0,t._l=void 0,t[v]=0,void 0!=e&&f(e,c,t[s],t)});return r(l.prototype,{clear:function(){for(var t=this,e=t._i,n=t._f;n;n=n.n)n.r=!0,n.p&&(n.p=n.p.n=void 0),delete e[n.i];t._f=t._l=void 0,t[v]=0},"delete":function(t){var e=this,n=h(e,t);if(n){var r=n.n,o=n.p;delete e._i[n.i],n.r=!0,o&&(o.n=r),r&&(r.p=o),e._f==n&&(e._f=r),e._l==n&&(e._l=o),e[v]--}return!!n},forEach:function(t){i(this,l,"forEach");for(var e,n=o(t,arguments.length>1?arguments[1]:void 0,3);e=e?e.n:this._f;)for(n(e.v,e.k,this);e&&e.r;)e=e.p},has:function(t){return!!h(this,t)}}),p&&e(l.prototype,"size",{get:function(){return u(this[v])}}),l},def:function(t,e,n){var r,o,i=h(t,e);return i?i.v=n:(t._l=i={i:o=d(e,!0),k:e,v:n,p:r=t._l,n:void 0,r:!1},t._f||(t._f=i),r&&(r.n=i),t[v]++,"F"!==o&&(t._i[o]=i)),t},getEntry:h,setStrong:function(t,e,n){a(t,e,function(t,e){this._t=t,this._k=e,this._l=void 0},function(){for(var t=this,e=t._k,n=t._l;n&&n.r;)n=n.p;return t._t&&(t._l=n=n?n.n:t._t._f)?"keys"==e?c(0,n.k):"values"==e?c(0,n.v):c(0,[n.k,n.v]):(t._t=void 0,c(1))},n?"entries":"values",!n,!0),s(e)}}}),Un=Cn&&"object"==typeof Cn&&"default"in Cn?Cn["default"]:Cn,Gn=(e(function(t){var e=Un;t.exports=In("Map",function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},{get:function(t){var n=e.getEntry(this,t);return n&&n.v},set:function(t,n){return e.def(this,0===t?0:t,n)}},e,!0)}),e(function(t){t.exports=f.Map})),Wn=Gn&&"object"==typeof Gn&&"default"in Gn?Gn["default"]:Gn,$n=e(function(t){t.exports={"default":Wn,__esModule:!0}}),zn=$n&&"object"==typeof $n&&"default"in $n?$n["default"]:$n,Dn=e(function(t){t.exports=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)}}),Jn=Dn&&"object"==typeof Dn&&"default"in Dn?Dn["default"]:Dn,Kn=e(function(t){function e(t){for(var e,n=[],r=0,o=0,i="";null!=(e=h.exec(t));){var f=e[0],a=e[1],c=e.index;if(i+=t.slice(o,c),o=c+f.length,a)i+=a[1];else{var s=t[o],l=e[2],p=e[3],d=e[4],v=e[5],y=e[6],b=e[7];null!=l&&null!=s&&s!==l&&(i+=l,l=null),i&&(n.push(i),i="");var x="+"===y||"*"===y,g="?"===y||"*"===y,j=e[2]||"/",m=d||v||(b?".*":"[^"+j+"]+?");n.push({name:p||r++,prefix:l||"",delimiter:j,optional:g,repeat:x,pattern:u(m)})}}return o<t.length&&(i+=t.substr(o)),i&&n.push(i),n}function n(t){return o(e(t))}function r(t){return encodeURI(t).replace(/[\/?#'"]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}function o(t){for(var e=new Array(t.length),n=0;n<t.length;n++)"object"==typeof t[n]&&(e[n]=new RegExp("^"+t[n].pattern+"$"));return function(n,o){for(var i="",u=n||{},f=o||{},a=f.pretty?r:encodeURIComponent,c=0;c<t.length;c++){var s=t[c];if("string"!=typeof s){var l,p=u[s.name];if(null==p){if(s.optional)continue;throw new TypeError('Expected "'+s.name+'" to be defined')}if(v(p)){if(!s.repeat)throw new TypeError('Expected "'+s.name+'" to not repeat, but received "'+p+'"');if(0===p.length){if(s.optional)continue;throw new TypeError('Expected "'+s.name+'" to not be empty')}for(var d=0;d<p.length;d++){if(l=a(p[d]),!e[c].test(l))throw new TypeError('Expected all "'+s.name+'" to match "'+s.pattern+'", but received "'+l+'"');i+=(0===d?s.prefix:s.delimiter)+l}}else{if(l=a(p),!e[c].test(l))throw new TypeError('Expected "'+s.name+'" to match "'+s.pattern+'", but received "'+l+'"');i+=s.prefix+l}}else i+=s}return i}}function i(t){return t.replace(/([.+*?=^!:${}()[\]|\/])/g,"\\$1")}function u(t){return t.replace(/([=!:$\/()])/g,"\\$1")}function f(t,e){return t.keys=e,t}function a(t){return t.sensitive?"":"i"}function c(t,e){var n=t.source.match(/\((?!\?)/g);if(n)for(var r=0;r<n.length;r++)e.push({name:r,prefix:null,delimiter:null,optional:!1,repeat:!1,pattern:null});return f(t,e)}function s(t,e,n){for(var r=[],o=0;o<t.length;o++)r.push(d(t[o],e,n).source);var i=new RegExp("(?:"+r.join("|")+")",a(n));return f(i,e)}function l(t,n,r){for(var o=e(t),i=p(o,r),u=0;u<o.length;u++)"string"!=typeof o[u]&&n.push(o[u]);return f(i,n)}function p(t,e){e=e||{};for(var n=e.strict,r=e.end!==!1,o="",u=t[t.length-1],f="string"==typeof u&&/\/$/.test(u),c=0;c<t.length;c++){var s=t[c];if("string"==typeof s)o+=i(s);else{var l=i(s.prefix),p=s.pattern;s.repeat&&(p+="(?:"+l+p+")*"),p=s.optional?l?"(?:"+l+"("+p+"))?":"("+p+")?":l+"("+p+")",o+=p}}return n||(o=(f?o.slice(0,-2):o)+"(?:\\/(?=$))?"),o+=r?"$":n&&f?"":"(?=\\/|$)",new RegExp("^"+o,a(e))}function d(t,e,n){return e=e||[],v(e)?n||(n={}):(n=e,e=[]),t instanceof RegExp?c(t,e):v(t)?s(t,e,n):l(t,e,n)}var v=Jn;t.exports=d,t.exports.parse=e,t.exports.compile=n,t.exports.tokensToFunction=o,t.exports.tokensToRegExp=p;var h=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^()])+)\\))?|\\(((?:\\\\.|[^()])+)\\))([+*?])?|(\\*))"].join("|"),"g")}),Yn=Kn&&"object"==typeof Kn&&"default"in Kn?Kn["default"]:Kn,Bn=new zn,qn=r.bind(void 0,!0),Hn=r.bind(void 0,!1),Qn=[o].map(sn.mark),Vn=function(){var t=xn(sn.mark(function e(t,n){var r,i,u,f,a,c,s,l=function(){var t=xn(sn.mark(function e(){var t,n;return sn.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=s.next(),f=t.value,a=t.done,!f||a){e.next=23;break}if(n=yn({},r,f),!f.route.action){e.next=23;break}if(!c){e.next=20;break}return e.prev=7,e.next=10,f.route.action(n,n.params);case 10:return e.abrupt("return",e.sent);case 13:return e.prev=13,e.t0=e["catch"](7),e.t0.status=e.t0.status||500,n.error=e.t0,e.abrupt("return",c.action(n,n.params));case 18:e.next=23;break;case 20:return e.next=22,f.route.action(n,n.params);case 22:return e.abrupt("return",e.sent);case 23:return e.abrupt("return",void 0);case 24:case"end":return e.stop()}},e,this,[[7,13]])}));return function(){return t.apply(this,arguments)}}();return sn.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:r="string"==typeof n||n instanceof String?{path:n}:n,i=Array.isArray(t)?{path:"/",children:t}:t,u=void 0,f=void 0,a=!1,c=i.children&&i.children.find(function(t){return"/error"===t.path}),s=o(i,"",r.path),r.next=l,r.end=function(t){u=t,a=!0};case 9:if(a){e.next=17;break}return e.next=12,l();case 12:if(u=e.sent,void 0===u){e.next=15;break}return e.abrupt("break",17);case 15:e.next=9;break;case 17:if(void 0!==u||!c){e.next=21;break}return r.error=new Error("Not found"),r.error.status=404,e.abrupt("return",c.action(r,{}));case 21:return e.abrupt("return",u);case 22:case"end":return e.stop()}},e,this)}));return function(e,n){return t.apply(this,arguments)}}(),Xn={resolve:Vn,match:Vn};t.resolve=Vn,t.match=Vn,t["default"]=Xn}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.UniversalRouter=t.UniversalRouter||{})}(this,function(t){"use strict";function e(t){return t&&t.__esModule?t.default:t}function n(t,e){return e={exports:{}},t(e,e.exports),e.exports}function r(t,e){for(var n,r=[],o=0,i=0,u="",c=e&&e.delimiter||"/";null!=(n=Si.exec(t));){var s=n[0],l=n[1],p=n.index;if(u+=t.slice(i,p),i=p+s.length,l)u+=l[1];else{var h=t[i],v=n[2],d=n[3],y=n[4],g=n[5],m=n[6],_=n[7];u&&(r.push(u),u="");var w=null!=v&&null!=h&&h!==v,b="+"===m||"*"===m,x="?"===m||"*"===m,E=n[2]||c,j=y||g;r.push({name:d||o++,prefix:v||"",delimiter:E,optional:x,repeat:b,partial:w,asterisk:!!_,pattern:j?f(j):_?".*":"[^"+a(E)+"]+?"})}}return i<t.length&&(u+=t.substr(i)),u&&r.push(u),r}function o(t,e){return c(r(t,e))}function i(t){return encodeURI(t).replace(/[\/?#]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}function u(t){return encodeURI(t).replace(/[?#]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}function c(t){for(var e=new Array(t.length),n=0;n<t.length;n++)"object"==typeof t[n]&&(e[n]=new RegExp("^(?:"+t[n].pattern+")$"));return function(n,r){for(var o="",c=n||{},a=r||{},f=a.pretty?i:encodeURIComponent,s=0;s<t.length;s++){var l=t[s];if("string"!=typeof l){var p,h=c[l.name];if(null==h){if(l.optional){l.partial&&(o+=l.prefix);continue}throw new TypeError('Expected "'+l.name+'" to be defined')}if(bi(h)){if(!l.repeat)throw new TypeError('Expected "'+l.name+'" to not repeat, but received `'+JSON.stringify(h)+"`");if(0===h.length){if(l.optional)continue;throw new TypeError('Expected "'+l.name+'" to not be empty')}for(var v=0;v<h.length;v++){if(p=f(h[v]),!e[s].test(p))throw new TypeError('Expected all "'+l.name+'" to match "'+l.pattern+'", but received `'+JSON.stringify(p)+"`");o+=(0===v?l.prefix:l.delimiter)+p}}else{if(p=l.asterisk?u(h):f(h),!e[s].test(p))throw new TypeError('Expected "'+l.name+'" to match "'+l.pattern+'", but received "'+p+'"');o+=l.prefix+p}}else o+=l}return o}}function a(t){return t.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function f(t){return t.replace(/([=!:$\/()])/g,"\\$1")}function s(t,e){return t.keys=e,t}function l(t){return t.sensitive?"":"i"}function p(t,e){var n=t.source.match(/\((?!\?)/g);if(n)for(var r=0;r<n.length;r++)e.push({name:r,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return s(t,e)}function h(t,e,n){for(var r=[],o=0;o<t.length;o++)r.push(y(t[o],e,n).source);var i=new RegExp("(?:"+r.join("|")+")",l(n));return s(i,e)}function v(t,e,n){return d(r(t,n),e,n)}function d(t,e,n){bi(e)||(n=e||n,e=[]),n=n||{};for(var r=n.strict,o=n.end!==!1,i="",u=t[t.length-1],c="string"==typeof u&&/\/$/.test(u),f=0;f<t.length;f++){var p=t[f];if("string"==typeof p)i+=a(p);else{var h=a(p.prefix),v="(?:"+p.pattern+")";e.push(p),p.repeat&&(v+="(?:"+h+v+")*"),v=p.optional?p.partial?h+"("+v+")?":"(?:"+h+"("+v+"))?":h+"("+v+")",i+=v}}return r||(i=(c?i.slice(0,-2):i)+"(?:\\/(?=$))?"),i+=o?"$":r&&c?"":"(?=\\/|$)",s(new RegExp("^"+i,l(n)),e)}function y(t,e,n){return bi(e)||(n=e||n,e=[]),n=n||{},t instanceof RegExp?p(t,e):bi(t)?h(t,e,n):v(t,e,n)}function g(t){if(void 0===t||""===t)return t;try{return decodeURIComponent(t)}catch(e){return t}}function m(t,e,n,r){var o=e+"|"+t,i=Li.get(o);if(!i){var u=[];i={pattern:xi(e,u,{end:t}),keys:u},Li.set(o,i)}var c=i.pattern.exec(n);if(!c)return null;var a=c[0],f=_o(null);r&&pe(f,r);for(var s=1;s<c.length;s+=1)f[i.keys[s-1].name]=g(c[s]);return{path:""===a?"/":a,keys:i.keys.slice(),params:f}}function _(t,e,n,r){var o,i,u;return k.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(o=void 0,t.children){c.next=6;break}if(o=Pi(t.path,n,r),!o){c.next=6;break}return c.next=6,{route:t,baseUrl:e,path:o.path,keys:o.keys,params:o.params};case 6:if(!t.children){c.next=18;break}if(o=Ri(t.path,n,r),!o){c.next=18;break}return c.next=11,{route:t,baseUrl:e,path:o.path,keys:o.keys,params:o.params};case 11:i=0;case 12:if(!(i<t.children.length)){c.next=18;break}return u=n.substr(o.path.length),c.delegateYield(_(t.children[i],e+("/"===o.path?"":o.path),u.startsWith("/")?u:"/"+u,o.params),"t0",15);case 15:i+=1,c.next=12;break;case 18:case"end":return c.stop()}},Mi[0],this)}var w="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},b=n(function(t){!function(e){function n(t,e,n,r){var i=Object.create((e||o).prototype),u=new h(r||[]);return i._invoke=s(t,n,u),i}function r(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}function o(){}function i(){}function u(){}function c(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function a(t){this.arg=t}function f(t){function e(n,o,i,u){var c=r(t[n],t,o);if("throw"!==c.type){var f=c.arg,s=f.value;return s instanceof a?Promise.resolve(s.arg).then(function(t){e("next",t,i,u)},function(t){e("throw",t,i,u)}):Promise.resolve(s).then(function(t){f.value=t,i(f)},u)}u(c.arg)}function n(t,n){function r(){return new Promise(function(r,o){e(t,n,r,o)})}return o=o?o.then(r,r):r()}"object"==typeof process&&process.domain&&(e=process.domain.bind(e));var o;this._invoke=n}function s(t,e,n){var o=E;return function(i,u){if(o===O)throw new Error("Generator is already running");if(o===k){if("throw"===i)throw u;return d()}for(;;){var c=n.delegate;if(c){if("return"===i||"throw"===i&&c.iterator[i]===y){n.delegate=null;var a=c.iterator.return;if(a){var f=r(a,c.iterator,u);if("throw"===f.type){i="throw",u=f.arg;continue}}if("return"===i)continue}var f=r(c.iterator[i],c.iterator,u);if("throw"===f.type){n.delegate=null,i="throw",u=f.arg;continue}i="next",u=y;var s=f.arg;if(!s.done)return o=j,s;n[c.resultName]=s.value,n.next=c.nextLoc,n.delegate=null}if("next"===i)n.sent=n._sent=u;else if("throw"===i){if(o===E)throw o=k,u;n.dispatchException(u)&&(i="next",u=y)}else"return"===i&&n.abrupt("return",u);o=O;var f=r(t,e,n);if("normal"===f.type){o=n.done?k:j;var s={value:f.arg,done:n.done};if(f.arg!==S)return s;n.delegate&&"next"===i&&(u=y)}else"throw"===f.type&&(o=k,i="throw",u=f.arg)}}}function l(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function p(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function h(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(l,this),this.reset(!0)}function v(t){if(t){var e=t[_];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n<t.length;)if(g.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=y,e.done=!0,e};return r.next=r}}return{next:d}}function d(){return{value:y,done:!0}}var y,g=Object.prototype.hasOwnProperty,m="function"==typeof Symbol?Symbol:{},_=m.iterator||"@@iterator",w=m.toStringTag||"@@toStringTag",b="object"==typeof t,x=e.regeneratorRuntime;if(x)return void(b&&(t.exports=x));x=e.regeneratorRuntime=b?t.exports:{},x.wrap=n;var E="suspendedStart",j="suspendedYield",O="executing",k="completed",S={},L=u.prototype=o.prototype;i.prototype=L.constructor=u,u.constructor=i,u[w]=i.displayName="GeneratorFunction",x.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===i||"GeneratorFunction"===(e.displayName||e.name))},x.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,u):(t.__proto__=u,w in t||(t[w]="GeneratorFunction")),t.prototype=Object.create(L),t},x.awrap=function(t){return new a(t)},c(f.prototype),x.async=function(t,e,r,o){var i=new f(n(t,e,r,o));return x.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},c(L),L[_]=function(){return this},L[w]="Generator",L.toString=function(){return"[object Generator]"},x.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},x.values=v,h.prototype={constructor:h,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=y,this.done=!1,this.delegate=null,this.tryEntries.forEach(p),!t)for(var e in this)"t"===e.charAt(0)&&g.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=y)},stop:function(){this.done=!0;var t=this.tryEntries[0],e=t.completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){function e(e,r){return i.type="throw",i.arg=t,n.next=e,!!r}if(this.done)throw t;for(var n=this,r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],i=o.completion;if("root"===o.tryLoc)return e("end");if(o.tryLoc<=this.prev){var u=g.call(o,"catchLoc"),c=g.call(o,"finallyLoc");if(u&&c){if(this.prev<o.catchLoc)return e(o.catchLoc,!0);if(this.prev<o.finallyLoc)return e(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return e(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return e(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&g.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?this.next=o.finallyLoc:this.complete(i),S},complete:function(t,e){if("throw"===t.type)throw t.arg;"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=t.arg,this.next="end"):"normal"===t.type&&e&&(this.next=e)},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),p(n),S}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;p(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:v(t),resultName:e,nextLoc:n},S}}}("object"==typeof w?w:"object"==typeof window?window:"object"==typeof self?self:w)}),x="object"==typeof w?w:"object"==typeof window?window:"object"==typeof self?self:w,E=x.regeneratorRuntime&&Object.getOwnPropertyNames(x).indexOf("regeneratorRuntime")>=0,j=E&&x.regeneratorRuntime;x.regeneratorRuntime=void 0;var O=b;if(E)x.regeneratorRuntime=j;else try{delete x.regeneratorRuntime}catch(t){x.regeneratorRuntime=void 0}var k=O,S=n(function(t){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)}),L=n(function(t){var e=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=e)}),P=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t},R=P,M=function(t,e,n){if(R(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}},A=function(t){return"object"==typeof t?null!==t:"function"==typeof t},T=A,F=function(t){if(!T(t))throw TypeError(t+" is not an object!");return t},N=function(t){try{return!!t()}catch(t){return!0}},C=!N(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),I=A,U=S.document,G=I(U)&&I(U.createElement),$=function(t){return G?U.createElement(t):{}},W=!C&&!N(function(){return 7!=Object.defineProperty($("div"),"a",{get:function(){return 7}}).a}),z=A,D=function(t,e){if(!z(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!z(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!z(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!z(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")},J=F,K=W,B=D,Y=Object.defineProperty,q=C?Object.defineProperty:function(t,e,n){if(J(t),e=B(e,!0),J(n),K)try{return Y(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t},H={f:q},Q=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},V=H,X=Q,Z=C?function(t,e,n){return V.f(t,e,X(1,n))}:function(t,e,n){return t[e]=n,t},tt=S,et=L,nt=M,rt=Z,ot="prototype",it=function(t,e,n){var r,o,i,u=t&it.F,c=t&it.G,a=t&it.S,f=t&it.P,s=t&it.B,l=t&it.W,p=c?et:et[e]||(et[e]={}),h=p[ot],v=c?tt:a?tt[e]:(tt[e]||{})[ot];c&&(n=e);for(r in n)o=!u&&v&&void 0!==v[r],o&&r in p||(i=o?v[r]:n[r],p[r]=c&&"function"!=typeof v[r]?n[r]:s&&o?nt(i,tt):l&&v[r]==i?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e[ot]=t[ot],e}(i):f&&"function"==typeof i?nt(Function.call,i):i,f&&((p.virtual||(p.virtual={}))[r]=i,t&it.R&&h&&!h[r]&&rt(h,r,i)))};it.F=1,it.G=2,it.S=4,it.P=8,it.B=16,it.W=32,it.U=64,it.R=128;var ut=it,ct={}.hasOwnProperty,at=function(t,e){return ct.call(t,e)},ft={}.toString,st=function(t){return ft.call(t).slice(8,-1)},lt=st,pt=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==lt(t)?t.split(""):Object(t)},ht=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t},vt=pt,dt=ht,yt=function(t){return vt(dt(t))},gt=Math.ceil,mt=Math.floor,_t=function(t){return isNaN(t=+t)?0:(t>0?mt:gt)(t)},wt=_t,bt=Math.min,xt=function(t){return t>0?bt(wt(t),9007199254740991):0},Et=_t,jt=Math.max,Ot=Math.min,kt=function(t,e){return t=Et(t),t<0?jt(t+e,0):Ot(t,e)},St=yt,Lt=xt,Pt=kt,Rt=function(t){return function(e,n,r){var o,i=St(e),u=Lt(i.length),c=Pt(r,u);if(t&&n!=n){for(;u>c;)if(o=i[c++],o!=o)return!0}else for(;u>c;c++)if((t||c in i)&&i[c]===n)return t||c||0;return!t&&-1}},Mt=S,At="__core-js_shared__",Tt=Mt[At]||(Mt[At]={}),Ft=function(t){return Tt[t]||(Tt[t]={})},Nt=0,Ct=Math.random(),It=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++Nt+Ct).toString(36))},Ut=Ft("keys"),Gt=It,$t=function(t){return Ut[t]||(Ut[t]=Gt(t))},Wt=at,zt=yt,Dt=Rt(!1),Jt=$t("IE_PROTO"),Kt=function(t,e){var n,r=zt(t),o=0,i=[];for(n in r)n!=Jt&&Wt(r,n)&&i.push(n);for(;e.length>o;)Wt(r,n=e[o++])&&(~Dt(i,n)||i.push(n));return i},Bt="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),Yt=Kt,qt=Bt,Ht=Object.keys||function(t){return Yt(t,qt)},Qt=Object.getOwnPropertySymbols,Vt={f:Qt},Xt={}.propertyIsEnumerable,Zt={f:Xt},te=ht,ee=function(t){return Object(te(t))},ne=Ht,re=Vt,oe=Zt,ie=ee,ue=pt,ce=Object.assign,ae=!ce||N(function(){var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach(function(t){e[t]=t}),7!=ce({},t)[n]||Object.keys(ce({},e)).join("")!=r})?function(t,e){for(var n=ie(t),r=arguments.length,o=1,i=re.f,u=oe.f;r>o;)for(var c,a=ue(arguments[o++]),f=i?ne(a).concat(i(a)):ne(a),s=f.length,l=0;s>l;)u.call(a,c=f[l++])&&(n[c]=a[c]);return n}:ce,fe=ut;fe(fe.S+fe.F,"Object",{assign:ae});var se=L.Object.assign,le=n(function(t){t.exports={default:se,__esModule:!0}}),pe=e(le),he=_t,ve=ht,de=function(t){return function(e,n){var r,o,i=String(ve(e)),u=he(n),c=i.length;return u<0||u>=c?t?"":void 0:(r=i.charCodeAt(u),r<55296||r>56319||u+1===c||(o=i.charCodeAt(u+1))<56320||o>57343?t?i.charAt(u):r:t?i.slice(u,u+2):(r-55296<<10)+(o-56320)+65536)}},ye=!0,ge=Z,me={},_e=H,we=F,be=Ht,xe=C?Object.defineProperties:function(t,e){we(t);for(var n,r=be(e),o=r.length,i=0;o>i;)_e.f(t,n=r[i++],e[n]);return t},Ee=S.document&&document.documentElement,je=F,Oe=xe,ke=Bt,Se=$t("IE_PROTO"),Le=function(){},Pe="prototype",Re=function(){var t,e=$("iframe"),n=ke.length,r="<",o=">";for(e.style.display="none",Ee.appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write(r+"script"+o+"document.F=Object"+r+"/script"+o),t.close(),Re=t.F;n--;)delete Re[Pe][ke[n]];return Re()},Me=Object.create||function(t,e){var n;return null!==t?(Le[Pe]=je(t),n=new Le,Le[Pe]=null,n[Se]=t):n=Re(),void 0===e?n:Oe(n,e)},Ae=n(function(t){var e=Ft("wks"),n=It,r=S.Symbol,o="function"==typeof r,i=t.exports=function(t){return e[t]||(e[t]=o&&r[t]||(o?r:n)("Symbol."+t))};i.store=e}),Te=H.f,Fe=at,Ne=Ae("toStringTag"),Ce=function(t,e,n){t&&!Fe(t=n?t:t.prototype,Ne)&&Te(t,Ne,{configurable:!0,value:e})},Ie=Me,Ue=Q,Ge=Ce,$e={};Z($e,Ae("iterator"),function(){return this});var We=function(t,e,n){t.prototype=Ie($e,{next:Ue(1,n)}),Ge(t,e+" Iterator")},ze=at,De=ee,Je=$t("IE_PROTO"),Ke=Object.prototype,Be=Object.getPrototypeOf||function(t){return t=De(t),ze(t,Je)?t[Je]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?Ke:null},Ye=ye,qe=ut,He=ge,Qe=Z,Ve=at,Xe=me,Ze=We,tn=Ce,en=Be,nn=Ae("iterator"),rn=!([].keys&&"next"in[].keys()),on="@@iterator",un="keys",cn="values",an=function(){return this},fn=function(t,e,n,r,o,i,u){Ze(n,e,r);var c,a,f,s=function(t){if(!rn&&t in v)return v[t];switch(t){case un:return function(){return new n(this,t)};case cn:return function(){return new n(this,t)}}return function(){return new n(this,t)}},l=e+" Iterator",p=o==cn,h=!1,v=t.prototype,d=v[nn]||v[on]||o&&v[o],y=d||s(o),g=o?p?s("entries"):y:void 0,m="Array"==e?v.entries||d:d;if(m&&(f=en(m.call(new t)),f!==Object.prototype&&(tn(f,l,!0),Ye||Ve(f,nn)||Qe(f,nn,an))),p&&d&&d.name!==cn&&(h=!0,y=function(){return d.call(this)}),Ye&&!u||!rn&&!h&&v[nn]||Qe(v,nn,y),Xe[e]=y,Xe[l]=an,o)if(c={values:p?y:s(cn),keys:i?y:s(un),entries:g},u)for(a in c)a in v||He(v,a,c[a]);else qe(qe.P+qe.F*(rn||h),e,c);return c},sn=de(!0);fn(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=sn(e,n),this._i+=t.length,{value:t,done:!1})});var ln=function(){},pn=function(t,e){return{value:e,done:!!t}},hn=ln,vn=pn,dn=me,yn=yt;fn(Array,"Array",function(t,e){this._t=yn(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,vn(1)):"keys"==e?vn(0,n):"values"==e?vn(0,t[n]):vn(0,[n,t[n]])},"values");dn.Arguments=dn.Array,hn("keys"),hn("values"),hn("entries");for(var gn=S,mn=Z,_n=me,wn=Ae("toStringTag"),bn=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],xn=0;xn<5;xn++){var En=bn[xn],jn=gn[En],On=jn&&jn.prototype;On&&!On[wn]&&mn(On,wn,En),_n[En]=_n.Array}var kn,Sn,Ln,Pn=st,Rn=Ae("toStringTag"),Mn="Arguments"==Pn(function(){return arguments}()),An=function(t,e){try{return t[e]}catch(t){}},Tn=function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=An(e=Object(t),Rn))?n:Mn?Pn(e):"Object"==(r=Pn(e))&&"function"==typeof e.callee?"Arguments":r},Fn=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t},Nn=F,Cn=function(t,e,n,r){try{return r?e(Nn(n)[0],n[1]):e(n)}catch(e){var o=t.return;throw void 0!==o&&Nn(o.call(t)),e}},In=me,Un=Ae("iterator"),Gn=Array.prototype,$n=function(t){return void 0!==t&&(In.Array===t||Gn[Un]===t)},Wn=Tn,zn=Ae("iterator"),Dn=me,Jn=L.getIteratorMethod=function(t){if(void 0!=t)return t[zn]||t["@@iterator"]||Dn[Wn(t)]},Kn=n(function(t){var e=M,n=Cn,r=$n,o=F,i=xt,u=Jn,c={},a={},f=t.exports=function(t,f,s,l,p){var h,v,d,y,g=p?function(){return t}:u(t),m=e(s,l,f?2:1),_=0;if("function"!=typeof g)throw TypeError(t+" is not iterable!");if(r(g)){for(h=i(t.length);h>_;_++)if(y=f?m(o(v=t[_])[0],v[1]):m(t[_]),y===c||y===a)return y}else for(d=g.call(t);!(v=d.next()).done;)if(y=n(d,m,v.value,f),y===c||y===a)return y};f.BREAK=c,f.RETURN=a}),Bn=F,Yn=P,qn=Ae("species"),Hn=function(t,e){var n,r=Bn(t).constructor;return void 0===r||void 0==(n=Bn(r)[qn])?e:Yn(n)},Qn=function(t,e,n){var r=void 0===n;switch(e.length){case 0:return r?t():t.call(n);case 1:return r?t(e[0]):t.call(n,e[0]);case 2:return r?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return r?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return r?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)},Vn=M,Xn=Qn,Zn=Ee,tr=$,er=S,nr=er.process,rr=er.setImmediate,or=er.clearImmediate,ir=er.MessageChannel,ur=0,cr={},ar="onreadystatechange",fr=function(){var t=+this;if(cr.hasOwnProperty(t)){var e=cr[t];delete cr[t],e()}},sr=function(t){fr.call(t.data)};rr&&or||(rr=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return cr[++ur]=function(){Xn("function"==typeof t?t:Function(t),e)},kn(ur),ur},or=function(t){delete cr[t]},"process"==st(nr)?kn=function(t){nr.nextTick(Vn(fr,t,1))}:ir?(Sn=new ir,Ln=Sn.port2,Sn.port1.onmessage=sr,kn=Vn(Ln.postMessage,Ln,1)):er.addEventListener&&"function"==typeof postMessage&&!er.importScripts?(kn=function(t){er.postMessage(t+"","*")},er.addEventListener("message",sr,!1)):kn=ar in tr("script")?function(t){Zn.appendChild(tr("script"))[ar]=function(){Zn.removeChild(this),fr.call(t)}}:function(t){setTimeout(Vn(fr,t,1),0)});var lr={set:rr,clear:or},pr=S,hr=lr.set,vr=pr.MutationObserver||pr.WebKitMutationObserver,dr=pr.process,yr=pr.Promise,gr="process"==st(dr),mr=function(){var t,e,n,r=function(){var r,o;for(gr&&(r=dr.domain)&&r.exit();t;){o=t.fn,t=t.next;try{o()}catch(r){throw t?n():e=void 0,r}}e=void 0,r&&r.enter()};if(gr)n=function(){dr.nextTick(r)};else if(vr){var o=!0,i=document.createTextNode("");new vr(r).observe(i,{characterData:!0}),n=function(){i.data=o=!o}}else if(yr&&yr.resolve){var u=yr.resolve();n=function(){u.then(r)}}else n=function(){hr.call(pr,r)};return function(r){var o={fn:r,next:void 0};e&&(e.next=o),t||(t=o,n()),e=o}},_r=Z,wr=function(t,e,n){for(var r in e)n&&t[r]?t[r]=e[r]:_r(t,r,e[r]);return t},br=S,xr=L,Er=H,jr=C,Or=Ae("species"),kr=function(t){var e="function"==typeof xr[t]?xr[t]:br[t];jr&&e&&!e[Or]&&Er.f(e,Or,{configurable:!0,get:function(){return this}})},Sr=Ae("iterator"),Lr=!1;try{var Pr=[7][Sr]();Pr.return=function(){Lr=!0},Array.from(Pr,function(){throw 2})}catch(t){}var Rr,Mr,Ar,Tr=function(t,e){if(!e&&!Lr)return!1;var n=!1;try{var r=[7],o=r[Sr]();o.next=function(){return{done:n=!0}},r[Sr]=function(){return o},t(r)}catch(t){}return n},Fr=ye,Nr=S,Cr=M,Ir=Tn,Ur=ut,Gr=A,$r=P,Wr=Fn,zr=Kn,Dr=Hn,Jr=lr.set,Kr=mr(),Br="Promise",Yr=Nr.TypeError,qr=Nr.process,Hr=Nr[Br],qr=Nr.process,Qr="process"==Ir(qr),Vr=function(){},Xr=!!function(){try{var t=Hr.resolve(1),e=(t.constructor={})[Ae("species")]=function(t){t(Vr,Vr)};return(Qr||"function"==typeof PromiseRejectionEvent)&&t.then(Vr)instanceof e}catch(t){}}(),Zr=function(t,e){return t===e||t===Hr&&e===Ar},to=function(t){var e;return!(!Gr(t)||"function"!=typeof(e=t.then))&&e},eo=function(t){return Zr(Hr,t)?new no(t):new Mr(t)},no=Mr=function(t){var e,n;this.promise=new t(function(t,r){if(void 0!==e||void 0!==n)throw Yr("Bad Promise constructor");e=t,n=r}),this.resolve=$r(e),this.reject=$r(n)},ro=function(t){try{t()}catch(t){return{error:t}}},oo=function(t,e){if(!t._n){t._n=!0;var n=t._c;Kr(function(){for(var r=t._v,o=1==t._s,i=0,u=function(e){var n,i,u=o?e.ok:e.fail,c=e.resolve,a=e.reject,f=e.domain;try{u?(o||(2==t._h&&co(t),t._h=1),u===!0?n=r:(f&&f.enter(),n=u(r),f&&f.exit()),n===e.promise?a(Yr("Promise-chain cycle")):(i=to(n))?i.call(n,c,a):c(n)):a(r)}catch(t){a(t)}};n.length>i;)u(n[i++]);t._c=[],t._n=!1,e&&!t._h&&io(t)})}},io=function(t){Jr.call(Nr,function(){var e,n,r,o=t._v;if(uo(t)&&(e=ro(function(){Qr?qr.emit("unhandledRejection",o,t):(n=Nr.onunhandledrejection)?n({promise:t,reason:o}):(r=Nr.console)&&r.error&&r.error("Unhandled promise rejection",o)}),t._h=Qr||uo(t)?2:1),t._a=void 0,e)throw e.error})},uo=function(t){if(1==t._h)return!1;for(var e,n=t._a||t._c,r=0;n.length>r;)if(e=n[r++],e.fail||!uo(e.promise))return!1;return!0},co=function(t){Jr.call(Nr,function(){var e;Qr?qr.emit("rejectionHandled",t):(e=Nr.onrejectionhandled)&&e({promise:t,reason:t._v})})},ao=function(t){var e=this;e._d||(e._d=!0,e=e._w||e,e._v=t,e._s=2,e._a||(e._a=e._c.slice()),oo(e,!0))},fo=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw Yr("Promise can't be resolved itself");(e=to(t))?Kr(function(){var r={_w:n,_d:!1};try{e.call(t,Cr(fo,r,1),Cr(ao,r,1))}catch(t){ao.call(r,t)}}):(n._v=t,n._s=1,oo(n,!1))}catch(t){ao.call({_w:n,_d:!1},t)}}};Xr||(Hr=function(t){Wr(this,Hr,Br,"_h"),$r(t),Rr.call(this);try{t(Cr(fo,this,1),Cr(ao,this,1))}catch(t){ao.call(this,t)}},Rr=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},Rr.prototype=wr(Hr.prototype,{then:function(t,e){var n=eo(Dr(this,Hr));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=Qr?qr.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&oo(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),no=function(){var t=new Rr;this.promise=t,this.resolve=Cr(fo,t,1),this.reject=Cr(ao,t,1)}),Ur(Ur.G+Ur.W+Ur.F*!Xr,{Promise:Hr}),Ce(Hr,Br),kr(Br),Ar=L[Br],Ur(Ur.S+Ur.F*!Xr,Br,{reject:function(t){var e=eo(this),n=e.reject;return n(t),e.promise}}),Ur(Ur.S+Ur.F*(Fr||!Xr),Br,{resolve:function(t){if(t instanceof Hr&&Zr(t.constructor,this))return t;var e=eo(this),n=e.resolve;return n(t),e.promise}}),Ur(Ur.S+Ur.F*!(Xr&&Tr(function(t){Hr.all(t).catch(Vr)})),Br,{all:function(t){var e=this,n=eo(e),r=n.resolve,o=n.reject,i=ro(function(){var n=[],i=0,u=1;zr(t,!1,function(t){var c=i++,a=!1;n.push(void 0),u++,e.resolve(t).then(function(t){a||(a=!0,n[c]=t,--u||r(n))},o)}),--u||r(n)});return i&&o(i.error),n.promise},race:function(t){var e=this,n=eo(e),r=n.reject,o=ro(function(){zr(t,!1,function(t){e.resolve(t).then(n.resolve,r)})});return o&&r(o.error),n.promise}});var so=L.Promise,lo=n(function(t){t.exports={default:so,__esModule:!0}}),po=n(function(t,e){function n(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var r=lo,o=n(r);e.default=function(t){return function(){var e=t.apply(this,arguments);return new o.default(function(t,n){function r(i,u){try{var c=e[i](u),a=c.value}catch(t){return void n(t)}return c.done?void t(a):o.default.resolve(a).then(function(t){return r("next",t)},function(t){return r("throw",t)})}return r("next")})}}}),ho=e(po),vo=ut;vo(vo.S,"Object",{create:Me});var yo=L.Object,go=function(t,e){return yo.create(t,e)},mo=n(function(t){t.exports={default:go,__esModule:!0}}),_o=e(mo),wo=n(function(t){var e=It("meta"),n=A,r=at,o=H.f,i=0,u=Object.isExtensible||function(){return!0},c=!N(function(){return u(Object.preventExtensions({}))}),a=function(t){o(t,e,{value:{i:"O"+ ++i,w:{}}})},f=function(t,o){if(!n(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!r(t,e)){if(!u(t))return"F";if(!o)return"E";a(t)}return t[e].i},s=function(t,n){if(!r(t,e)){if(!u(t))return!0;if(!n)return!1;a(t)}return t[e].w},l=function(t){return c&&p.NEED&&u(t)&&!r(t,e)&&a(t),t},p=t.exports={KEY:e,NEED:!1,fastKey:f,getWeak:s,onFreeze:l}}),bo=H.f,xo=Me,Eo=wr,jo=M,Oo=Fn,ko=ht,So=Kn,Lo=fn,Po=pn,Ro=kr,Mo=C,Ao=wo.fastKey,To=Mo?"_s":"size",Fo=function(t,e){var n,r=Ao(e);if("F"!==r)return t._i[r];for(n=t._f;n;n=n.n)if(n.k==e)return n},No={getConstructor:function(t,e,n,r){var o=t(function(t,i){Oo(t,o,e,"_i"),t._i=xo(null),t._f=void 0,t._l=void 0,t[To]=0,void 0!=i&&So(i,n,t[r],t)});return Eo(o.prototype,{clear:function(){for(var t=this,e=t._i,n=t._f;n;n=n.n)n.r=!0,n.p&&(n.p=n.p.n=void 0),delete e[n.i];t._f=t._l=void 0,t[To]=0},delete:function(t){var e=this,n=Fo(e,t);if(n){var r=n.n,o=n.p;delete e._i[n.i],n.r=!0,o&&(o.n=r),r&&(r.p=o),e._f==n&&(e._f=r),e._l==n&&(e._l=o),e[To]--}return!!n},forEach:function(t){Oo(this,o,"forEach");for(var e,n=jo(t,arguments.length>1?arguments[1]:void 0,3);e=e?e.n:this._f;)for(n(e.v,e.k,this);e&&e.r;)e=e.p},has:function(t){return!!Fo(this,t)}}),Mo&&bo(o.prototype,"size",{get:function(){return ko(this[To])}}),o},def:function(t,e,n){var r,o,i=Fo(t,e);return i?i.v=n:(t._l=i={i:o=Ao(e,!0),k:e,v:n,p:r=t._l,n:void 0,r:!1},t._f||(t._f=i),r&&(r.n=i),t[To]++,"F"!==o&&(t._i[o]=i)),t},getEntry:Fo,setStrong:function(t,e,n){Lo(t,e,function(t,e){this._t=t,this._k=e,this._l=void 0},function(){for(var t=this,e=t._k,n=t._l;n&&n.r;)n=n.p;return t._t&&(t._l=n=n?n.n:t._t._f)?"keys"==e?Po(0,n.k):"values"==e?Po(0,n.v):Po(0,[n.k,n.v]):(t._t=void 0,Po(1))},n?"entries":"values",!n,!0),Ro(e)}},Co=st,Io=Array.isArray||function(t){return"Array"==Co(t)},Uo=A,Go=Io,$o=Ae("species"),Wo=function(t){var e;return Go(t)&&(e=t.constructor,"function"!=typeof e||e!==Array&&!Go(e.prototype)||(e=void 0),Uo(e)&&(e=e[$o],null===e&&(e=void 0))),void 0===e?Array:e},zo=Wo,Do=function(t,e){return new(zo(t))(e)},Jo=M,Ko=pt,Bo=ee,Yo=xt,qo=Do,Ho=function(t,e){var n=1==t,r=2==t,o=3==t,i=4==t,u=6==t,c=5==t||u,a=e||qo;return function(e,f,s){for(var l,p,h=Bo(e),v=Ko(h),d=Jo(f,s,3),y=Yo(v.length),g=0,m=n?a(e,y):r?a(e,0):void 0;y>g;g++)if((c||g in v)&&(l=v[g],p=d(l,g,h),t))if(n)m[g]=p;else if(p)switch(t){case 3:return!0;case 5:return l;case 6:return g;case 2:m.push(l)}else if(i)return!1;return u?-1:o||i?i:m}},Qo=S,Vo=ut,Xo=wo,Zo=N,ti=Z,ei=wr,ni=Kn,ri=Fn,oi=A,ii=Ce,ui=H.f,ci=Ho(0),ai=C,fi=function(t,e,n,r,o,i){var u=Qo[t],c=u,a=o?"set":"add",f=c&&c.prototype,s={};return ai&&"function"==typeof c&&(i||f.forEach&&!Zo(function(){(new c).entries().next()}))?(c=e(function(e,n){ri(e,c,t,"_c"),e._c=new u,void 0!=n&&ni(n,o,e[a],e)}),ci("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),function(t){var e="add"==t||"set"==t;t in f&&(!i||"clear"!=t)&&ti(c.prototype,t,function(n,r){if(ri(this,c,t),!e&&i&&!oi(n))return"get"==t&&void 0;var o=this._c[t](0===n?0:n,r);return e?this:o})}),"size"in f&&ui(c.prototype,"size",{get:function(){return this._c.size}})):(c=r.getConstructor(e,t,o,a),ei(c.prototype,n),Xo.NEED=!0),ii(c,t),s[t]=c,Vo(Vo.G+Vo.W+Vo.F,s),i||r.setStrong(c,t,o),c},si=No,li=(fi("Map",function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},{get:function(t){var e=si.getEntry(this,t);return e&&e.v},set:function(t,e){return si.def(this,0===t?0:t,e)}},si,!0),Kn),pi=function(t,e){var n=[];return li(t,!1,n.push,n,e),n},hi=Tn,vi=pi,di=function(t){return function(){if(hi(this)!=t)throw TypeError(t+"#toJSON isn't generic");return vi(this)}},yi=ut;yi(yi.P+yi.R,"Map",{toJSON:di("Map")});var gi=L.Map,mi=n(function(t){t.exports={default:gi,__esModule:!0}}),_i=e(mi),wi=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)},bi=wi,xi=y,Ei=r,ji=o,Oi=c,ki=d,Si=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");xi.parse=Ei,xi.compile=ji,xi.tokensToFunction=Oi,xi.tokensToRegExp=ki;var Li=new _i,Pi=m.bind(void 0,!0),Ri=m.bind(void 0,!1),Mi=[_].map(k.mark),Ai=function(){var t=ho(k.mark(function t(e,n){var r,o,i,u,c,a,f,s=function(){var t=ho(k.mark(function t(){var e,n;return k.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e=a.next(),u=e.value,c=e.done,u&&!c&&(null===i||void 0===i)){t.next=5;break}return t.abrupt("return",i);case 5:if(!u.route.action){t.next=10;break}return n=pe({},r,u),t.next=9,u.route.action(n,n.params);case 9:i=t.sent;case 10:return t.next=12,s();case 12:return t.abrupt("return",t.sent);case 13:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}();return k.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r="string"==typeof n||n instanceof String?{path:n}:n,o=Array.isArray(e)?{path:"/",children:e}:e,i=null,u=void 0,c=!1,a=_(o,"",r.path),r.next=s,t.next=9,s();case 9:if(null!==i&&void 0!==i){t.next=13;break}throw f=new Error("Page not found"),f.status=f.statusCode=404,f;case 13:return t.abrupt("return",i);case 14:case"end":return t.stop()}},t,this)}));return function(e,n){return t.apply(this,arguments)}}(),Ti={resolve:Ai};t.resolve=Ai,t.default=Ti,Object.defineProperty(t,"__esModule",{value:!0})}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
65
388283
3807
Updatedbabel-runtime@^6.11.6
Updatedpath-to-regexp@^1.6.0