-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js.map
1 lines (1 loc) · 96.6 KB
/
index.js.map
1
{"version":3,"file":"index.js","sources":["src/lib/router/not-found-template.js","node_modules/history/node_modules/@babel/runtime/helpers/esm/extends.js","node_modules/resolve-pathname/esm/resolve-pathname.js","node_modules/tiny-warning/dist/tiny-warning.esm.js","node_modules/tiny-invariant/dist/tiny-invariant.esm.js","node_modules/history/esm/history.js","src/lib/router/navigator.js","src/lib/service-manager/controller-initializer.js","src/lib/service-manager/service-store.js","src/lib/service-manager/decorators.js","src/lib/service-manager/layout-service.js","src/lib/ctx/index.js","src/lib/service-manager/hooks.js","src/lib/defaults/default-config.js","src/lib/defaults/index.js","src/lib/service-manager/component.js","src/lib/service-manager/index.js","src/lib/router/utils.js","node_modules/path-to-regexp/index.js","src/lib/router/create-router.js","src/lib/router/index.js"],"sourcesContent":["import React from 'react';\n\nexport default class NotFoundTemplate {\n template = () => <div>Not found!!</div>;\n get() {\n return this.template;\n }\n set(template) {\n this.template = template;\n }\n}\n\nexport const NotFound = new NotFoundTemplate();\n","export default function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}","function isAbsolute(pathname) {\n return pathname.charAt(0) === '/';\n}\n\n// About 1.5x faster than the two-arg version of Array#splice()\nfunction spliceOne(list, index) {\n for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) {\n list[i] = list[k];\n }\n\n list.pop();\n}\n\n// This implementation is based heavily on node's url.parse\nfunction resolvePathname(to, from) {\n if (from === undefined) from = '';\n\n var toParts = (to && to.split('/')) || [];\n var fromParts = (from && from.split('/')) || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');\n\n if (\n mustEndAbs &&\n fromParts[0] !== '' &&\n (!fromParts[0] || !isAbsolute(fromParts[0]))\n )\n fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}\n\nexport default resolvePathname;\n","var isProduction = process.env.NODE_ENV === 'production';\nfunction warning(condition, message) {\n if (!isProduction) {\n if (condition) {\n return;\n }\n\n var text = \"Warning: \" + message;\n\n if (typeof console !== 'undefined') {\n console.warn(text);\n }\n\n try {\n throw Error(text);\n } catch (x) {}\n }\n}\n\nexport default warning;\n","var isProduction = process.env.NODE_ENV === 'production';\nvar prefix = 'Invariant failed';\nfunction invariant(condition, message) {\n if (condition) {\n return;\n }\n\n if (isProduction) {\n throw new Error(prefix);\n } else {\n throw new Error(prefix + \": \" + (message || ''));\n }\n}\n\nexport default invariant;\n","import _extends from '@babel/runtime/helpers/esm/extends';\nimport resolvePathname from 'resolve-pathname';\nimport valueEqual from 'value-equal';\nimport warning from 'tiny-warning';\nimport invariant from 'tiny-invariant';\n\nfunction addLeadingSlash(path) {\n return path.charAt(0) === '/' ? path : '/' + path;\n}\nfunction stripLeadingSlash(path) {\n return path.charAt(0) === '/' ? path.substr(1) : path;\n}\nfunction hasBasename(path, prefix) {\n return path.toLowerCase().indexOf(prefix.toLowerCase()) === 0 && '/?#'.indexOf(path.charAt(prefix.length)) !== -1;\n}\nfunction stripBasename(path, prefix) {\n return hasBasename(path, prefix) ? path.substr(prefix.length) : path;\n}\nfunction stripTrailingSlash(path) {\n return path.charAt(path.length - 1) === '/' ? path.slice(0, -1) : path;\n}\nfunction parsePath(path) {\n var pathname = path || '/';\n var search = '';\n var hash = '';\n var hashIndex = pathname.indexOf('#');\n\n if (hashIndex !== -1) {\n hash = pathname.substr(hashIndex);\n pathname = pathname.substr(0, hashIndex);\n }\n\n var searchIndex = pathname.indexOf('?');\n\n if (searchIndex !== -1) {\n search = pathname.substr(searchIndex);\n pathname = pathname.substr(0, searchIndex);\n }\n\n return {\n pathname: pathname,\n search: search === '?' ? '' : search,\n hash: hash === '#' ? '' : hash\n };\n}\nfunction createPath(location) {\n var pathname = location.pathname,\n search = location.search,\n hash = location.hash;\n var path = pathname || '/';\n if (search && search !== '?') path += search.charAt(0) === '?' ? search : \"?\" + search;\n if (hash && hash !== '#') path += hash.charAt(0) === '#' ? hash : \"#\" + hash;\n return path;\n}\n\nfunction createLocation(path, state, key, currentLocation) {\n var location;\n\n if (typeof path === 'string') {\n // Two-arg form: push(path, state)\n location = parsePath(path);\n location.state = state;\n } else {\n // One-arg form: push(location)\n location = _extends({}, path);\n if (location.pathname === undefined) location.pathname = '';\n\n if (location.search) {\n if (location.search.charAt(0) !== '?') location.search = '?' + location.search;\n } else {\n location.search = '';\n }\n\n if (location.hash) {\n if (location.hash.charAt(0) !== '#') location.hash = '#' + location.hash;\n } else {\n location.hash = '';\n }\n\n if (state !== undefined && location.state === undefined) location.state = state;\n }\n\n try {\n location.pathname = decodeURI(location.pathname);\n } catch (e) {\n if (e instanceof URIError) {\n throw new URIError('Pathname \"' + location.pathname + '\" could not be decoded. ' + 'This is likely caused by an invalid percent-encoding.');\n } else {\n throw e;\n }\n }\n\n if (key) location.key = key;\n\n if (currentLocation) {\n // Resolve incomplete/relative pathname relative to current location.\n if (!location.pathname) {\n location.pathname = currentLocation.pathname;\n } else if (location.pathname.charAt(0) !== '/') {\n location.pathname = resolvePathname(location.pathname, currentLocation.pathname);\n }\n } else {\n // When there is no prior location and pathname is empty, set it to /\n if (!location.pathname) {\n location.pathname = '/';\n }\n }\n\n return location;\n}\nfunction locationsAreEqual(a, b) {\n return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash && a.key === b.key && valueEqual(a.state, b.state);\n}\n\nfunction createTransitionManager() {\n var prompt = null;\n\n function setPrompt(nextPrompt) {\n process.env.NODE_ENV !== \"production\" ? warning(prompt == null, 'A history supports only one prompt at a time') : void 0;\n prompt = nextPrompt;\n return function () {\n if (prompt === nextPrompt) prompt = null;\n };\n }\n\n function confirmTransitionTo(location, action, getUserConfirmation, callback) {\n // TODO: If another transition starts while we're still confirming\n // the previous one, we may end up in a weird state. Figure out the\n // best way to handle this.\n if (prompt != null) {\n var result = typeof prompt === 'function' ? prompt(location, action) : prompt;\n\n if (typeof result === 'string') {\n if (typeof getUserConfirmation === 'function') {\n getUserConfirmation(result, callback);\n } else {\n process.env.NODE_ENV !== \"production\" ? warning(false, 'A history needs a getUserConfirmation function in order to use a prompt message') : void 0;\n callback(true);\n }\n } else {\n // Return false from a transition hook to cancel the transition.\n callback(result !== false);\n }\n } else {\n callback(true);\n }\n }\n\n var listeners = [];\n\n function appendListener(fn) {\n var isActive = true;\n\n function listener() {\n if (isActive) fn.apply(void 0, arguments);\n }\n\n listeners.push(listener);\n return function () {\n isActive = false;\n listeners = listeners.filter(function (item) {\n return item !== listener;\n });\n };\n }\n\n function notifyListeners() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n listeners.forEach(function (listener) {\n return listener.apply(void 0, args);\n });\n }\n\n return {\n setPrompt: setPrompt,\n confirmTransitionTo: confirmTransitionTo,\n appendListener: appendListener,\n notifyListeners: notifyListeners\n };\n}\n\nvar canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);\nfunction getConfirmation(message, callback) {\n callback(window.confirm(message)); // eslint-disable-line no-alert\n}\n/**\n * Returns true if the HTML5 history API is supported. Taken from Modernizr.\n *\n * https://github.com/Modernizr/Modernizr/blob/master/LICENSE\n * https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js\n * changed to avoid false negatives for Windows Phones: https://github.com/reactjs/react-router/issues/586\n */\n\nfunction supportsHistory() {\n var ua = window.navigator.userAgent;\n if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) return false;\n return window.history && 'pushState' in window.history;\n}\n/**\n * Returns true if browser fires popstate on hash change.\n * IE10 and IE11 do not.\n */\n\nfunction supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}\n/**\n * Returns false if using go(n) with hash history causes a full page reload.\n */\n\nfunction supportsGoWithoutReloadUsingHash() {\n return window.navigator.userAgent.indexOf('Firefox') === -1;\n}\n/**\n * Returns true if a given popstate event is an extraneous WebKit event.\n * Accounts for the fact that Chrome on iOS fires real popstate events\n * containing undefined state when pressing the back button.\n */\n\nfunction isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}\n\nvar PopStateEvent = 'popstate';\nvar HashChangeEvent = 'hashchange';\n\nfunction getHistoryState() {\n try {\n return window.history.state || {};\n } catch (e) {\n // IE 11 sometimes throws when accessing window.history.state\n // See https://github.com/ReactTraining/history/pull/289\n return {};\n }\n}\n/**\n * Creates a history object that uses the HTML5 history API including\n * pushState, replaceState, and the popstate event.\n */\n\n\nfunction createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Browser history needs a DOM') : invariant(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n process.env.NODE_ENV !== \"production\" ? warning(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n _extends(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n process.env.NODE_ENV !== \"production\" ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n process.env.NODE_ENV !== \"production\" ? warning(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n process.env.NODE_ENV !== \"production\" ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n process.env.NODE_ENV !== \"production\" ? warning(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}\n\nvar HashChangeEvent$1 = 'hashchange';\nvar HashPathCoders = {\n hashbang: {\n encodePath: function encodePath(path) {\n return path.charAt(0) === '!' ? path : '!/' + stripLeadingSlash(path);\n },\n decodePath: function decodePath(path) {\n return path.charAt(0) === '!' ? path.substr(1) : path;\n }\n },\n noslash: {\n encodePath: stripLeadingSlash,\n decodePath: addLeadingSlash\n },\n slash: {\n encodePath: addLeadingSlash,\n decodePath: addLeadingSlash\n }\n};\n\nfunction stripHash(url) {\n var hashIndex = url.indexOf('#');\n return hashIndex === -1 ? url : url.slice(0, hashIndex);\n}\n\nfunction getHashPath() {\n // We can't use window.location.hash here because it's not\n // consistent across browsers - Firefox will pre-decode it!\n var href = window.location.href;\n var hashIndex = href.indexOf('#');\n return hashIndex === -1 ? '' : href.substring(hashIndex + 1);\n}\n\nfunction pushHashPath(path) {\n window.location.hash = path;\n}\n\nfunction replaceHashPath(path) {\n window.location.replace(stripHash(window.location.href) + '#' + path);\n}\n\nfunction createHashHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Hash history needs a DOM') : invariant(false) : void 0;\n var globalHistory = window.history;\n var canGoWithoutReload = supportsGoWithoutReloadUsingHash();\n var _props = props,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$hashType = _props.hashType,\n hashType = _props$hashType === void 0 ? 'slash' : _props$hashType;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n var _HashPathCoders$hashT = HashPathCoders[hashType],\n encodePath = _HashPathCoders$hashT.encodePath,\n decodePath = _HashPathCoders$hashT.decodePath;\n\n function getDOMLocation() {\n var path = decodePath(getHashPath());\n process.env.NODE_ENV !== \"production\" ? warning(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n _extends(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n var forceNextPop = false;\n var ignorePath = null;\n\n function locationsAreEqual$$1(a, b) {\n return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash;\n }\n\n function handleHashChange() {\n var path = getHashPath();\n var encodedPath = encodePath(path);\n\n if (path !== encodedPath) {\n // Ensure we always have a properly-encoded hash.\n replaceHashPath(encodedPath);\n } else {\n var location = getDOMLocation();\n var prevLocation = history.location;\n if (!forceNextPop && locationsAreEqual$$1(prevLocation, location)) return; // A hashchange doesn't always == location change.\n\n if (ignorePath === createPath(location)) return; // Ignore this change; we already setState in push/replace.\n\n ignorePath = null;\n handlePop(location);\n }\n }\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of paths we've seen in sessionStorage.\n // Instead, we just default to 0 for paths we don't know.\n\n var toIndex = allPaths.lastIndexOf(createPath(toLocation));\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allPaths.lastIndexOf(createPath(fromLocation));\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n } // Ensure the hash is encoded properly before doing anything else.\n\n\n var path = getHashPath();\n var encodedPath = encodePath(path);\n if (path !== encodedPath) replaceHashPath(encodedPath);\n var initialLocation = getDOMLocation();\n var allPaths = [createPath(initialLocation)]; // Public interface\n\n function createHref(location) {\n var baseTag = document.querySelector('base');\n var href = '';\n\n if (baseTag && baseTag.getAttribute('href')) {\n href = stripHash(window.location.href);\n }\n\n return href + '#' + encodePath(basename + createPath(location));\n }\n\n function push(path, state) {\n process.env.NODE_ENV !== \"production\" ? warning(state === undefined, 'Hash history cannot push state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, undefined, undefined, history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var path = createPath(location);\n var encodedPath = encodePath(basename + path);\n var hashChanged = getHashPath() !== encodedPath;\n\n if (hashChanged) {\n // We cannot tell if a hashchange was caused by a PUSH, so we'd\n // rather setState here and ignore the hashchange. The caveat here\n // is that other hash histories in the page will consider it a POP.\n ignorePath = path;\n pushHashPath(encodedPath);\n var prevIndex = allPaths.lastIndexOf(createPath(history.location));\n var nextPaths = allPaths.slice(0, prevIndex + 1);\n nextPaths.push(path);\n allPaths = nextPaths;\n setState({\n action: action,\n location: location\n });\n } else {\n process.env.NODE_ENV !== \"production\" ? warning(false, 'Hash history cannot PUSH the same path; a new entry will not be added to the history stack') : void 0;\n setState();\n }\n });\n }\n\n function replace(path, state) {\n process.env.NODE_ENV !== \"production\" ? warning(state === undefined, 'Hash history cannot replace state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, undefined, undefined, history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var path = createPath(location);\n var encodedPath = encodePath(basename + path);\n var hashChanged = getHashPath() !== encodedPath;\n\n if (hashChanged) {\n // We cannot tell if a hashchange was caused by a REPLACE, so we'd\n // rather setState here and ignore the hashchange. The caveat here\n // is that other hash histories in the page will consider it a POP.\n ignorePath = path;\n replaceHashPath(encodedPath);\n }\n\n var prevIndex = allPaths.indexOf(createPath(history.location));\n if (prevIndex !== -1) allPaths[prevIndex] = path;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n process.env.NODE_ENV !== \"production\" ? warning(canGoWithoutReload, 'Hash history go(n) causes a full page reload in this browser') : void 0;\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(HashChangeEvent$1, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(HashChangeEvent$1, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}\n\nfunction clamp(n, lowerBound, upperBound) {\n return Math.min(Math.max(n, lowerBound), upperBound);\n}\n/**\n * Creates a history object that stores locations in memory.\n */\n\n\nfunction createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n _extends(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n process.env.NODE_ENV !== \"production\" ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n process.env.NODE_ENV !== \"production\" ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}\n\nexport { createBrowserHistory, createHashHistory, createMemoryHistory, createLocation, locationsAreEqual, parsePath, createPath };\n","import { createBrowserHistory } from 'history';\nimport { observable, action } from 'mobx';\n\nexport class Navigator {\n @observable location = {};\n @observable match = {};\n history = createBrowserHistory({});\n\n @action setRoute(location, match, history) {\n this.location = location;\n this.match = match;\n this.history = history;\n }\n push = this.history.push;\n}\n\nexport default new Navigator();\n","import { extendObservable } from 'mobx';\n\nexport function initController(Controller, appConfig) {\n const newController = new Controller(appConfig);\n const extendData = {};\n if (!newController.hasOwnProperty('ready')) {\n extendData.ready = false;\n }\n if (!newController.hasOwnProperty('error')) {\n extendData.error = undefined;\n }\n extendObservable(newController, extendData);\n (async () => {\n try {\n if (newController.init) await newController.init();\n newController.ready = true;\n } catch (e) {\n newController.error = e;\n throw e;\n }\n })();\n return newController;\n}\n","import { initController } from './controller-initializer';\n\nexport default class ServiceStore {\n store = {};\n constructor(appConfig) {\n this.appConfig = appConfig || { parent: '/' };\n\n this.appConfig.store = this;\n }\n create = (Service) => {\n this.store[Service._id] = initController(Service, this.appConfig);\n return this.store[Service._id];\n };\n\n get = (Service) => {\n if (this.store[Service._id]) {\n return this.store[Service._id];\n } else return this.create(Service);\n };\n\n destroy = (Service) => {\n if (this.store[Service._id]) {\n delete this.store[Service._id];\n }\n };\n}\n\nexport const instance = new ServiceStore();\n","import { instance } from './service-store';\nimport { observable } from 'mobx';\nimport navigator from '../router/navigator';\n\nlet id = 0;\nexport function ServiceDecorator(config) {\n return function(Target) {\n class Result extends Target {\n models = {};\n constructor(appConfig) {\n super(appConfig);\n for (let i in this) {\n this.models[i] = (e) => {\n this[i] = e.target.value;\n };\n }\n if (this.__servicesToInject) {\n this.__servicesToInject.forEach(({ service, key }) => {\n this[key] = appConfig.store.get(service);\n });\n }\n\n if (this.__injectAppConfig) {\n this.__injectAppConfig.forEach(({ key }) => {\n this[key] = appConfig;\n });\n }\n\n if (this.__injectController) {\n this.__injectController.forEach(({ key }) => {\n this[key] = appConfig.controller;\n });\n }\n\n if (this.__injectNavigator) {\n this.__injectNavigator.forEach(({ service, key }) => {\n this[key] = {\n nav: navigator,\n push: (path) => {\n navigator.push(appConfig.parentRoute + path);\n },\n };\n });\n }\n }\n }\n Result._id = id;\n id++;\n return Result;\n };\n}\n\nexport function ControllerDecorator(config) {\n return function(Target) {\n return class Result extends Target {\n models = {};\n ready = false;\n error = false;\n constructor(config) {\n super(config);\n for (let i in this) {\n this.models[i] = (e) => {\n this[i] = e.target.value;\n };\n }\n }\n };\n };\n}\n\nexport function injectDecorator(Service, config = {}) {\n return function(target, key, descriptor) {\n if (!target.__servicesToInject) {\n target.__servicesToInject = [{ service: Service, key }];\n } else target.__servicesToInject.push({ service: Service, key });\n //target[key] = instance.get(Service);\n return descriptor;\n };\n}\n\nexport function injectNavigatorDecorator(Service, config = {}) {\n return function(target, key, descriptor) {\n if (!target.__injectNavigator) {\n target.__injectNavigator = [{ key }];\n } else target.__injectNavigator.push({ key });\n return descriptor;\n };\n}\n\nexport function injectAppConfigDecorator(Service, config = {}) {\n return function(target, key, descriptor) {\n if (!target.__injectAppConfig) {\n target.__injectAppConfig = [{ key }];\n } else target.__injectAppConfig.push({ key });\n //target[key] = instance.get(Service);\n return descriptor;\n };\n}\n\nexport function injectControllerDecorator(Service, config = {}) {\n return function(target, key, descriptor) {\n if (!target.__injectController) {\n target.__injectController = [{ key }];\n } else target.__injectController.push({ key });\n //target[key] = instance.get(Service);\n return descriptor;\n };\n}\n\n// TODO inject controller decorator y terminar de exportar y resolver tipado para los controladores y appConfig (especialmente en hooks e inyecciones)\n","import { observable, action } from 'mobx';\n\nexport default class LayoutService {\n @observable show;\n\n @action switch() {\n this.show = !this.show;\n }\n\n @action enable() {\n this.show = true;\n }\n\n @action disable() {\n this.show = false;\n }\n}\n","import React from 'react';\nexport const RouterCtx = React.createContext({\n parent: '',\n});\n\nexport const AppConfigCtx = React.createContext({\n appId: '',\n controller: undefined,\n parentRoute: '',\n params: {},\n store: {},\n parentApp: undefined,\n});\n","import { useMemo, useEffect, useState, useContext } from 'react';\nimport { initController } from './controller-initializer';\nimport ServiceStore, { instance } from './service-store';\nimport { AppConfigCtx } from '../ctx';\nimport { RouterCtx } from '../ctx';\nimport { navigator } from '../router';\n\nexport const useServiceHook = (Service, opt = {}) => {\n const { store } = useContext(AppConfigCtx);\n useEffect(() => {\n return () => {\n if (opt.attach) {\n store.destroy(Service);\n }\n };\n }, []);\n\n return useMemo(() => store.get(Service), [Service]);\n};\n\nexport const useControllerHook = (Controller) => {\n const { controller } = useContext(AppConfigCtx);\n return controller;\n};\n\nexport const useAppConfigHook = () => {\n const appConfig = useContext(AppConfigCtx);\n return appConfig;\n};\n\nexport const useRouterHook = () => {\n const { parent } = useContext(RouterCtx);\n};\n\nexport const useNavigatorHook = () => {\n const { parent } = useContext(RouterCtx);\n return {\n nav: navigator,\n push: (path) => navigator.push(parent + path),\n };\n};\n","import React from 'react';\nexport const defaultConfig = {\n notFound: {\n default: () => <div>Not found</div>,\n templates: {},\n },\n waitFor: {\n default: () => <div>Loading</div>,\n templates: {},\n },\n wip: {\n default: () => <div>WIP</div>,\n templates: {},\n },\n};\n","import { defaultConfig } from './default-config';\n\nexport class Defaults {\n constructor(defaults) {\n this.data = defaults;\n }\n\n setAll = (data) => {\n this.data = data;\n };\n\n set = (value, key) => {\n this.data[key] = value;\n };\n\n get = (key) => this.data[key];\n}\n\nexport const defaultsInstance = new Defaults(defaultConfig);\n\nexport function setDefaults(defaults) {\n defaultsInstance.setAll(defaults);\n}\n","import React, { useState } from 'react';\nimport { observer } from 'mobx-react-lite';\nimport { Component } from 'react';\nimport { defaultsInstance } from '../defaults';\n\nexport function component(Target, config = {}) {\n if (config.wait) {\n const wait = config.wait;\n const waitForDefault = defaultsInstance.get('waitFor');\n const Template =\n wait.component ||\n (wait.template\n ? waitForDefault.templates[wait.template]\n : waitForDefault.default);\n\n const ObserverTarget = observer(Target);\n\n return observer((props) => {\n const isResolved = config.wait.for(props);\n if (!isResolved) return <Template {...props} />;\n else return <ObserverTarget {...props} />;\n });\n }\n return observer(Target);\n}\n","import Ss, { instance } from './service-store';\nimport {\n ServiceDecorator,\n injectDecorator,\n ControllerDecorator,\n injectNavigatorDecorator,\n injectAppConfigDecorator,\n injectControllerDecorator,\n} from './decorators';\nimport LayoutServiceLib from './layout-service';\nimport {\n useServiceHook,\n useControllerHook,\n useNavigatorHook,\n useRouterHook,\n useAppConfigHook,\n} from './hooks';\n\nexport { component } from './component';\nexport const ServiceStore = Ss;\nexport const serviceStore = instance;\n\n// Deprecated\nexport const injectService = serviceStore.get;\nexport const LayoutService = LayoutServiceLib;\n\n// Hooks\nexport const useService = useServiceHook;\nexport const useController = useControllerHook;\nexport const useNavigator = useNavigatorHook;\nexport const useRouter = useRouterHook;\nexport const useAppConfig = useAppConfigHook;\n\n// Decorators\nexport const service = ServiceDecorator;\nexport const controller = ControllerDecorator;\nexport const inject = injectDecorator;\nexport const injectNavigator = injectNavigatorDecorator;\nexport const injectAppConfig = injectAppConfigDecorator;\nexport const injectController = injectControllerDecorator;\n","import React, { useEffect, useContext } from 'react';\nimport { component, injectService, useService } from '../service-manager';\nimport LayoutService from '../service-manager/layout-service';\nimport { Redirect } from 'react-router-dom';\nimport navigator from './navigator';\nimport { AppConfigCtx } from '../ctx';\nimport ServiceStore from '../service-manager/service-store';\nimport { RouterCtx } from '../ctx';\nfunction runOnEnter(onEnter, params) {\n if (onEnter) {\n if (onEnter.length) for (let i in onEnter) onEnter[i](params);\n else onEnter(params);\n }\n}\n\nfunction runOnOut(onOut, params) {\n if (onOut) {\n if (onOut.length) for (let i in onOut) onOut[i](params);\n else onOut(params);\n }\n}\n\nfunction runProtect(protect, params) {\n if (protect) {\n if (protect.length)\n for (let i in protect) {\n const protectRes = protect[i](params);\n if (protectRes) {\n return protectRes;\n }\n }\n else {\n const protectRes = protect(params);\n if (protectRes) {\n return protectRes;\n }\n }\n }\n}\n\nfunction runDisableLayout(services) {\n for (let i in services) services[i].disable();\n}\n\nfunction runEnableLayout(services) {\n for (let i in services) {\n services[i].enable();\n }\n}\n\nexport function createRouteComponent(opt) {\n const Component = opt.component;\n let services = [];\n if (opt.disableLayout)\n services = !opt.disableLayout.length\n ? [injectService(opt.disableLayout)]\n : opt.disableLayout.map((item) => {\n return injectService(item);\n });\n\n let isDisableLayouRun = false;\n\n const RoutedComponent = (props) => {\n navigator.setRoute(props.location, props.match, props.history);\n // Crate optional params for onEnter, onOut and guards\n const appConfig = useContext(AppConfigCtx);\n const { store, controller } = appConfig;\n const useService = (service) => {\n return store.get(Service);\n };\n const useController = () => {\n return controller;\n };\n const useAppConfig = () => {\n return appConfig;\n };\n const params = { useController, useService, useAppConfig };\n\n useEffect(() => {\n runOnEnter(opt.onEnter, params);\n return () => {\n runOnOut(opt.onOut, params);\n };\n }, []);\n if (!isDisableLayouRun) {\n isDisableLayouRun = true;\n }\n if (opt.wait) {\n const isLoading = opt.wait.for();\n return;\n }\n\n const isProtected = runProtect(opt.guard, params);\n if (isProtected) {\n return <Redirect to={isProtected} />;\n }\n\n return (\n <Component\n location={props.location}\n match={props.match}\n history={props.history}\n />\n );\n };\n\n const appConfig = opt.appConfig;\n const FinalComponent = !appConfig\n ? RoutedComponent\n : (props) => {\n const controller = useService(appConfig.controller, {\n attach: !appConfig.keepController,\n });\n return (\n <RouterCtx.Consumer>\n {({ parent }) => (\n <AppConfigCtx.Consumer>\n {(parentAppConfig) => (\n <AppConfigCtx.Provider\n value={{\n parentApp: parentAppConfig,\n ...appConfig,\n controller,\n store: new ServiceStore({\n parentApp: parentAppConfig,\n ...appConfig,\n controller,\n parentRoute: parent,\n }),\n parentRoute: parent,\n }}>\n <RoutedComponent {...props} />\n </AppConfigCtx.Provider>\n )}\n </AppConfigCtx.Consumer>\n )}\n </RouterCtx.Consumer>\n );\n };\n\n return React.memo(\n component(FinalComponent),\n (prev, next) => prev.location.pathname == next.location.pathname,\n );\n}\n","/**\n * Expose `pathToRegexp`.\n */\nmodule.exports = pathToRegexp\nmodule.exports.parse = parse\nmodule.exports.compile = compile\nmodule.exports.tokensToFunction = tokensToFunction\nmodule.exports.tokensToRegExp = tokensToRegExp\n\n/**\n * Default configs.\n */\nvar DEFAULT_DELIMITER = '/'\n\n/**\n * The main path matching regexp utility.\n *\n * @type {RegExp}\n */\nvar PATH_REGEXP = new RegExp([\n // Match escaped characters that would otherwise appear in future matches.\n // This allows the user to escape special characters that won't transform.\n '(\\\\\\\\.)',\n // Match Express-style parameters and un-named parameters with a prefix\n // and optional suffixes. Matches appear as:\n //\n // \":test(\\\\d+)?\" => [\"test\", \"\\d+\", undefined, \"?\"]\n // \"(\\\\d+)\" => [undefined, undefined, \"\\d+\", undefined]\n '(?:\\\\:(\\\\w+)(?:\\\\(((?:\\\\\\\\.|[^\\\\\\\\()])+)\\\\))?|\\\\(((?:\\\\\\\\.|[^\\\\\\\\()])+)\\\\))([+*?])?'\n].join('|'), 'g')\n\n/**\n * Parse a string for the raw tokens.\n *\n * @param {string} str\n * @param {Object=} options\n * @return {!Array}\n */\nfunction parse (str, options) {\n var tokens = []\n var key = 0\n var index = 0\n var path = ''\n var defaultDelimiter = (options && options.delimiter) || DEFAULT_DELIMITER\n var whitelist = (options && options.whitelist) || undefined\n var pathEscaped = false\n var res\n\n while ((res = PATH_REGEXP.exec(str)) !== null) {\n var m = res[0]\n var escaped = res[1]\n var offset = res.index\n path += str.slice(index, offset)\n index = offset + m.length\n\n // Ignore already escaped sequences.\n if (escaped) {\n path += escaped[1]\n pathEscaped = true\n continue\n }\n\n var prev = ''\n var name = res[2]\n var capture = res[3]\n var group = res[4]\n var modifier = res[5]\n\n if (!pathEscaped && path.length) {\n var k = path.length - 1\n var c = path[k]\n var matches = whitelist ? whitelist.indexOf(c) > -1 : true\n\n if (matches) {\n prev = c\n path = path.slice(0, k)\n }\n }\n\n // Push the current path onto the tokens.\n if (path) {\n tokens.push(path)\n path = ''\n pathEscaped = false\n }\n\n var repeat = modifier === '+' || modifier === '*'\n var optional = modifier === '?' || modifier === '*'\n var pattern = capture || group\n var delimiter = prev || defaultDelimiter\n\n tokens.push({\n name: name || key++,\n prefix: prev,\n delimiter: delimiter,\n optional: optional,\n repeat: repeat,\n pattern: pattern\n ? escapeGroup(pattern)\n : '[^' + escapeString(delimiter === defaultDelimiter ? delimiter : (delimiter + defaultDelimiter)) + ']+?'\n })\n }\n\n // Push any remaining characters.\n if (path || index < str.length) {\n tokens.push(path + str.substr(index))\n }\n\n return tokens\n}\n\n/**\n * Compile a string to a template function for the path.\n *\n * @param {string} str\n * @param {Object=} options\n * @return {!function(Object=, Object=)}\n */\nfunction compile (str, options) {\n return tokensToFunction(parse(str, options), options)\n}\n\n/**\n * Expose a method for transforming tokens into the path function.\n */\nfunction tokensToFunction (tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options))\n }\n }\n\n return function (data, options) {\n var path = ''\n var encode = (options && options.encode) || encodeURIComponent\n var validate = options ? options.validate !== false : true\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n continue\n }\n\n var value = data ? data[token.name] : undefined\n var segment\n\n if (Array.isArray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but got array')\n }\n\n if (value.length === 0) {\n if (token.optional) continue\n\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j], token)\n\n if (validate && !matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\"')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {\n segment = encode(String(value), token)\n\n if (validate && !matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but got \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n continue\n }\n\n if (token.optional) continue\n\n throw new TypeError('Expected \"' + token.name + '\" to be ' + (token.repeat ? 'an array' : 'a string'))\n }\n\n return path\n }\n}\n\n/**\n * Escape a regular expression string.\n *\n * @param {string} str\n * @return {string}\n */\nfunction escapeString (str) {\n return str.replace(/([.+*?=^!:${}()[\\]|/\\\\])/g, '\\\\$1')\n}\n\n/**\n * Escape the capturing group by escaping special characters and meaning.\n *\n * @param {string} group\n * @return {string}\n */\nfunction escapeGroup (group) {\n return group.replace(/([=!:$/()])/g, '\\\\$1')\n}\n\n/**\n * Get the flags for a regexp from the options.\n *\n * @param {Object} options\n * @return {string}\n */\nfunction flags (options) {\n return options && options.sensitive ? '' : 'i'\n}\n\n/**\n * Pull out keys from a regexp.\n *\n * @param {!RegExp} path\n * @param {Array=} keys\n * @return {!RegExp}\n */\nfunction regexpToRegexp (path, keys) {\n if (!keys) return path\n\n // Use a negative lookahead to match only capturing groups.\n var groups = path.source.match(/\\((?!\\?)/g)\n\n if (groups) {\n for (var i = 0; i < groups.length; i++) {\n keys.push({\n name: i,\n prefix: null,\n delimiter: null,\n optional: false,\n repeat: false,\n pattern: null\n })\n }\n }\n\n return path\n}\n\n/**\n * Transform an array into a regexp.\n *\n * @param {!Array} path\n * @param {Array=} keys\n * @param {Object=} options\n * @return {!RegExp}\n */\nfunction arrayToRegexp (path, keys, options) {\n var parts = []\n\n for (var i = 0; i < path.length; i++) {\n parts.push(pathToRegexp(path[i], keys, options).source)\n }\n\n return new RegExp('(?:' + parts.join('|') + ')', flags(options))\n}\n\n/**\n * Create a path regexp from string input.\n *\n * @param {string} path\n * @param {Array=} keys\n * @param {Object=} options\n * @return {!RegExp}\n */\nfunction stringToRegexp (path, keys, options) {\n return tokensToRegExp(parse(path, options), keys, options)\n}\n\n/**\n * Expose a function for taking tokens and returning a RegExp.\n *\n * @param {!Array} tokens\n * @param {Array=} keys\n * @param {Object=} options\n * @return {!RegExp}\n */\nfunction tokensToRegExp (tokens, keys, options) {\n options = options || {}\n\n var strict = options.strict\n var start = options.start !== false\n var end = options.end !== false\n var delimiter = options.delimiter || DEFAULT_DELIMITER\n var endsWith = [].concat(options.endsWith || []).map(escapeString).concat('$').join('|')\n var route = start ? '^' : ''\n\n // Iterate over the tokens and create our regexp string.\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n route += escapeString(token)\n } else {\n var capture = token.repeat\n ? '(?:' + token.pattern + ')(?:' + escapeString(token.delimiter) + '(?:' + token.pattern + '))*'\n : token.pattern\n\n if (keys) keys.push(token)\n\n if (token.optional) {\n if (!token.prefix) {\n route += '(' + capture + ')?'\n } else {\n route += '(?:' + escapeString(token.prefix) + '(' + capture + '))?'\n }\n } else {\n route += escapeString(token.prefix) + '(' + capture + ')'\n }\n }\n }\n\n if (end) {\n if (!strict) route += '(?:' + escapeString(delimiter) + ')?'\n\n route += endsWith === '$' ? '$' : '(?=' + endsWith + ')'\n } else {\n var endToken = tokens[tokens.length - 1]\n var isEndDelimited = typeof endToken === 'string'\n ? endToken[endToken.length - 1] === delimiter\n : endToken === undefined\n\n if (!strict) route += '(?:' + escapeString(delimiter) + '(?=' + endsWith + '))?'\n if (!isEndDelimited) route += '(?=' + escapeString(delimiter) + '|' + endsWith + ')'\n }\n\n return new RegExp(route, flags(options))\n}\n\n/**\n * Normalize the given path string, returning a regular expression.\n *\n * An empty array can be passed in for the keys, which will hold the\n * placeholder key descriptions. For example, using `/user/:id`, `keys` will\n * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.\n *\n * @param {(string|RegExp|Array)} path\n * @param {Array=} keys\n * @param {Object=} options\n * @return {!RegExp}\n */\nfunction pathToRegexp (path, keys, options) {\n if (path instanceof RegExp) {\n return regexpToRegexp(path, keys)\n }\n\n if (Array.isArray(path)) {\n return arrayToRegexp(/** @type {!Array} */ (path), keys, options)\n }\n\n return stringToRegexp(/** @type {string} */ (path), keys, options)\n}\n","import React, { useContext } from 'react';\nimport { Switch, Route, Redirect } from 'react-router-dom';\nimport { createRouteComponent } from './utils';\nimport { defaultsInstance } from '../defaults';\nimport pathToRegexp from 'path-to-regexp';\nimport navigator from './navigator';\nimport { toJS } from 'mobx';\nimport { RouterCtx } from '../ctx';\n\nfunction makeRoute(item, index) {\n // if wip is true display 'wip' template\n\n if (item.wip) {\n const WipComponent = defaultsInstance.get('wip').default;\n return (\n <Route\n exact={item.exact}\n key={index}\n path={item.path}\n component={WipComponent}\n />\n );\n }\n\n // if \"redirect\" is a path, change the route by the redirect string otherwise it doesn't anything\n if (item.redirect) {\n console.log(pathToRegexp.compile(item.redirect)(navigator.match.params));\n item.component = () => (\n <Redirect\n to={pathToRegexp.compile(item.redirect)(navigator.match.params)}\n />\n );\n }\n\n return (\n <RouterCtx.Consumer>\n {({ parent }) => (\n <RouterCtx.Provider value={{ parent: parent + item.path }}>\n <Route\n exact={item.exact}\n key={index}\n path={parent + item.path}\n component={createRouteComponent(item)}\n />\n </RouterCtx.Provider>\n )}\n </RouterCtx.Consumer>\n );\n}\n\nfunction sortRoutes(routes) {\n const nested = routes.map((route) => {\n return {\n ...route,\n ...{\n _nested: route.path.split('/').filter((ch) => ch != '').length,\n },\n };\n });\n return nested.sort(({ _nested: r1 }, { _nested: r2 }) => (r1 > r2 ? -1 : 1));\n}\n\nexport function createRouter(router, config = {}) {\n const sortedRouter = sortRoutes(router);\n const routesComponent = sortedRouter.map(makeRoute);\n const ResultComponent = ({ routerConfig }) => {\n const { parent } = routerConfig | {};\n const notFoundTemplate = config.notFoundTemplate;\n const notFoundComponent = config.notFoundComponent;\n const notFoundDefault = defaultsInstance.get('notFound');\n return (\n <Switch>\n {routesComponent}\n {config.default ? (\n makeRoute({ ...config.default, ...{ path: '*' } }, 'default')\n ) : (\n <Route\n path=\"*\"\n component={\n notFoundComponent ||\n (notFoundTemplate\n ? notFoundDefault.templates[notFoundTemplate]\n : notFoundDefault.default)\n }\n />\n )}\n </Switch>\n );\n };\n\n return ResultComponent;\n}\n","import NotFoundTemplate from './not-found-template';\nimport nav, { Navigator as Nav } from './navigator';\n\nexport { createRouter } from './create-router';\nexport { NotFound } from './not-found-template';\nexport const navigator = nav;\nexport const Navigator = Nav;\n"],"names":["NotFoundTemplate","template","React","get","set","NotFound","isProduction","Navigator","history","createBrowserHistory","push","setRoute","location","match","observable","action","initController","Controller","appConfig","newController","extendData","hasOwnProperty","ready","error","undefined","extendObservable","init","e","ServiceStore","constructor","store","create","Service","_id","destroy","parent","instance","id","ServiceDecorator","config","Target","Result","models","i","target","value","__servicesToInject","forEach","service","key","__injectAppConfig","__injectController","controller","__injectNavigator","nav","navigator","path","parentRoute","ControllerDecorator","injectDecorator","descriptor","injectNavigatorDecorator","injectAppConfigDecorator","injectControllerDecorator","LayoutService","switch","show","enable","disable","RouterCtx","createContext","AppConfigCtx","appId","params","parentApp","useServiceHook","opt","useContext","useEffect","attach","useMemo","useControllerHook","useAppConfigHook","useRouterHook","useNavigatorHook","defaultConfig","notFound","default","templates","waitFor","wip","Defaults","defaults","setAll","data","defaultsInstance","setDefaults","component","wait","waitForDefault","Template","ObserverTarget","observer","props","isResolved","for","Ss","serviceStore","injectService","LayoutServiceLib","useService","useController","useNavigator","useRouter","useAppConfig","inject","injectNavigator","injectAppConfig","injectController","runOnEnter","onEnter","length","runOnOut","onOut","runProtect","protect","protectRes","createRouteComponent","Component","services","disableLayout","map","item","RoutedComponent","isLoading","isProtected","guard","Redirect","FinalComponent","keepController","parentAppConfig","memo","prev","next","pathname","makeRoute","index","WipComponent","Route","exact","redirect","console","log","pathToRegexp","compile","sortRoutes","routes","nested","route","_nested","split","filter","ch","sort","r1","r2","createRouter","router","sortedRouter","routesComponent","ResultComponent","routerConfig","notFoundTemplate","notFoundComponent","notFoundDefault","Switch","Nav"],"mappings":";;;;;;;;;;;;AAEe,MAAMA,gBAAN,CAAuB;;SACpCC,QADoC,GACzB,MAAMC,wDADmB;;;EAEpCC,GAAG,GAAG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