gemi 0.4.98 → 0.4.99

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/dist/app/index.js +2 -2
  2. package/dist/app/index.js.map +1 -1
  3. package/dist/broadcasting/index.js +1 -1
  4. package/dist/chunk-0f8949935ef3c862.js +1 -1
  5. package/dist/chunk-280cabf2f360003f.js +4 -0
  6. package/dist/{chunk-8660ff1b3cc94b99.js.map → chunk-280cabf2f360003f.js.map} +5 -5
  7. package/dist/chunk-28689250fae96e36.js +20 -0
  8. package/dist/{chunk-6477d7e9d0a3c143.js.map → chunk-28689250fae96e36.js.map} +7 -6
  9. package/dist/{chunk-7b222caedbdd07ff.js → chunk-2b3b4a0aa3edf9ec.js} +2 -2
  10. package/dist/{chunk-7b222caedbdd07ff.js.map → chunk-2b3b4a0aa3edf9ec.js.map} +1 -1
  11. package/dist/chunk-2c5231fcdfa1d6f2.js +4 -0
  12. package/dist/{chunk-99c32e4d937131e0.js.map → chunk-2c5231fcdfa1d6f2.js.map} +1 -1
  13. package/dist/chunk-44bbc0745a2b4b82.js +4 -0
  14. package/dist/chunk-44bbc0745a2b4b82.js.map +14 -0
  15. package/dist/{chunk-23d3df5f8342ecc6.js → chunk-58fb175982676253.js} +3 -3
  16. package/dist/{chunk-23d3df5f8342ecc6.js.map → chunk-58fb175982676253.js.map} +1 -1
  17. package/dist/{chunk-5a217af54dd6ae53.js → chunk-59b0df586fa6a917.js} +3 -3
  18. package/dist/{chunk-5a217af54dd6ae53.js.map → chunk-59b0df586fa6a917.js.map} +1 -1
  19. package/dist/chunk-6177d9eb9e7bf615.js +1 -1
  20. package/dist/{chunk-a32dc07245e51d1d.js → chunk-622a799c82e348e7.js} +2 -2
  21. package/dist/{chunk-a32dc07245e51d1d.js.map → chunk-622a799c82e348e7.js.map} +1 -1
  22. package/dist/chunk-7a46d8409a08609d.js +4 -0
  23. package/dist/{chunk-3507a0044b99a2cc.js.map → chunk-7a46d8409a08609d.js.map} +2 -2
  24. package/dist/chunk-7afadccff63d6a14.js +1 -1
  25. package/dist/{chunk-90436b32a64fc784.js → chunk-7ef6dd56fdc9381a.js} +3 -3
  26. package/dist/{chunk-90436b32a64fc784.js.map → chunk-7ef6dd56fdc9381a.js.map} +1 -1
  27. package/dist/chunk-874ce9ed3695d6dc.js +4 -0
  28. package/dist/{chunk-3c0b9555ac26f279.js.map → chunk-874ce9ed3695d6dc.js.map} +2 -2
  29. package/dist/chunk-8fb697a1aeea8f96.js +1 -1
  30. package/dist/chunk-92168dbc9ed3cb8e.js +4 -0
  31. package/dist/{chunk-2f8cf8372320b622.js.map → chunk-92168dbc9ed3cb8e.js.map} +4 -5
  32. package/dist/{chunk-961bb9fd54d10bbe.js → chunk-934537cc925d759e.js} +2 -2
  33. package/dist/{chunk-961bb9fd54d10bbe.js.map → chunk-934537cc925d759e.js.map} +1 -1
  34. package/dist/chunk-9d768d777b1aaf33.js +4 -0
  35. package/dist/{chunk-797989fd6dd03d3e.js.map → chunk-9d768d777b1aaf33.js.map} +1 -1
  36. package/dist/{chunk-28ec4c2b20e69deb.js → chunk-9e77cade8671df8d.js} +3 -3
  37. package/dist/{chunk-28ec4c2b20e69deb.js.map → chunk-9e77cade8671df8d.js.map} +1 -1
  38. package/dist/{chunk-643529c2ad120db7.js → chunk-a75fda9e77cb626c.js} +3 -3
  39. package/dist/{chunk-643529c2ad120db7.js.map → chunk-a75fda9e77cb626c.js.map} +1 -1
  40. package/dist/{chunk-f4faa3f602dc49fa.js → chunk-af12ac64b60b8669.js} +2 -2
  41. package/dist/{chunk-f4faa3f602dc49fa.js.map → chunk-af12ac64b60b8669.js.map} +1 -1
  42. package/dist/chunk-c2eec0de415bd820.js +4 -0
  43. package/dist/{chunk-22c02fbb1a96d282.js.map → chunk-c2eec0de415bd820.js.map} +2 -2
  44. package/dist/{chunk-0d97333b6af9fc45.js → chunk-c83dcc500d5fefe3.js} +2 -2
  45. package/dist/{chunk-0d97333b6af9fc45.js.map → chunk-c83dcc500d5fefe3.js.map} +1 -1
  46. package/dist/{chunk-53b0fab00d83f47e.js → chunk-df2ecbce6f94352a.js} +2 -2
  47. package/dist/{chunk-53b0fab00d83f47e.js.map → chunk-df2ecbce6f94352a.js.map} +1 -1
  48. package/dist/chunk-df507e740b7ba846.js +4 -0
  49. package/dist/{chunk-078b5ca64822d227.js.map → chunk-df507e740b7ba846.js.map} +4 -4
  50. package/dist/{chunk-9b1d4127b8980a77.js → chunk-e5683d4213970b67.js} +2 -2
  51. package/dist/{chunk-9b1d4127b8980a77.js.map → chunk-e5683d4213970b67.js.map} +1 -1
  52. package/dist/{chunk-ae14a8d462938b8e.js → chunk-ebd1b8ef83ffde0a.js} +2 -2
  53. package/dist/{chunk-ae14a8d462938b8e.js.map → chunk-ebd1b8ef83ffde0a.js.map} +1 -1
  54. package/dist/email/index.js +2 -2
  55. package/dist/email/index.js.map +1 -1
  56. package/dist/facades/index.js +2 -2
  57. package/dist/facades/index.js.map +1 -1
  58. package/dist/http/index.js +2 -2
  59. package/dist/http/index.js.map +1 -1
  60. package/dist/kernel/index.js +2 -2
  61. package/dist/kernel/index.js.map +1 -1
  62. package/dist/server/index.js +5 -5
  63. package/dist/server/index.js.map +4 -3
  64. package/dist/services/index.js +3 -3
  65. package/dist/services/index.js.map +3 -3
  66. package/dist/services/router/ViewRouterServiceContainer.d.ts +1 -1
  67. package/dist/services/router/ViewRouterServiceContainer.d.ts.map +1 -1
  68. package/dist/services/router/ViewRouterServiceProvider.d.ts +1 -1
  69. package/dist/services/router/ViewRouterServiceProvider.d.ts.map +1 -1
  70. package/package.json +1 -1
  71. package/dist/chunk-078b5ca64822d227.js +0 -4
  72. package/dist/chunk-22c02fbb1a96d282.js +0 -4
  73. package/dist/chunk-2f8cf8372320b622.js +0 -4
  74. package/dist/chunk-3507a0044b99a2cc.js +0 -4
  75. package/dist/chunk-3c0b9555ac26f279.js +0 -4
  76. package/dist/chunk-6477d7e9d0a3c143.js +0 -20
  77. package/dist/chunk-797989fd6dd03d3e.js +0 -4
  78. package/dist/chunk-8660ff1b3cc94b99.js +0 -3
  79. package/dist/chunk-99c32e4d937131e0.js +0 -4
  80. package/dist/chunk-b9c722a5cdfab5dd.js +0 -4
  81. package/dist/chunk-b9c722a5cdfab5dd.js.map +0 -33
@@ -1,33 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../client/ClientRouter.tsx", "../client/ServerDataProvider.tsx", "../../../node_modules/@babel/runtime/helpers/esm/extends.js", "../../../node_modules/history/index.js", "../client/ClientRouterContext.tsx", "../utils/Subject.ts", "../utils/sleep.ts", "../client/ProgressManager.ts", "../client/HttpReload.tsx", "../client/useNavigate.ts", "../client/i18n/I18nContext.tsx", "../client/QueryManagerContext.tsx", "../client/QueryResource.ts", "../client/useSearchParams.ts", "../client/useRoute.ts", "../client/useParams.ts", "../client/ComponentContext.tsx", "../client/helpers/flattenComponentTree.ts", "../client/WebsocketContext.tsx", "../client/createRoot.tsx", "../services/router/createFlatViewRoutes.ts", "../services/router/ViewRouterServiceContainer.ts", "../services/router/createRouteManifest.ts", "../services/router/createComponentTree.ts"],
4
- "sourcesContent": [
5
- "import {\n Suspense,\n useContext,\n useEffect,\n useState,\n StrictMode,\n type PropsWithChildren,\n type ComponentType,\n} from \"react\";\nimport { ServerDataContext } from \"./ServerDataProvider\";\nimport {\n ClientRouterContext,\n ClientRouterProvider,\n} from \"./ClientRouterContext\";\nimport type { ComponentTree } from \"./types\";\nimport { ComponentsContext, ComponentsProvider } from \"./ComponentContext\";\nimport { QueryManagerProvider } from \"./QueryManagerContext\";\nimport { I18nProvider } from \"./i18n/I18nContext\";\nimport { WebSocketContextProvider } from \"./WebsocketContext\";\n\ninterface RouteProps {\n componentPath: string;\n}\n\nconst Route = (props: PropsWithChildren<RouteProps>) => {\n const { componentPath } = props;\n const { viewImportMap } = useContext(ComponentsContext);\n\n const { viewEntriesSubject, getPageData, history } =\n useContext(ClientRouterContext);\n\n const [render, setRender] = useState(() =>\n viewEntriesSubject.getValue().includes(componentPath),\n );\n const [data, setData] = useState(() => getPageData(componentPath));\n\n useEffect(() => {\n return viewEntriesSubject.subscribe((viewEntries) => {\n setRender(viewEntries.includes(componentPath));\n });\n }, [componentPath]);\n\n useEffect(() => {\n return history?.listen(() => {\n setData(getPageData(componentPath));\n });\n }, []);\n\n if (!render) return null;\n const Component = viewImportMap[componentPath];\n\n if (Component) {\n return <Component {...data}>{props.children}</Component>;\n }\n const NotFound = viewImportMap[\"404\"];\n return <NotFound />;\n};\n\nconst Routes = (props: { componentTree: ComponentTree }) => {\n const { componentTree } = props;\n\n return (\n <Suspense>\n {componentTree.map((node) => {\n const [path, subtree] = node;\n if (subtree.length > 0) {\n return (\n <Route key={path} componentPath={path}>\n <Routes componentTree={subtree} />\n </Route>\n );\n }\n return <Route key={path} componentPath={path} />;\n })}\n </Suspense>\n );\n};\n\nexport const ClientRouter = (props: {\n viewImportMap?: Record<string, any>;\n RootLayout: ComponentType<any>;\n}) => {\n const { RootLayout } = props;\n const { routeManifest, router, componentTree, pageData, auth } =\n useContext(ServerDataContext);\n\n return (\n <I18nProvider>\n <WebSocketContextProvider>\n <QueryManagerProvider>\n <ComponentsProvider viewImportMap={props.viewImportMap}>\n <ClientRouterProvider\n searchParams={router.searchParams}\n params={router.params}\n pageData={pageData}\n is404={router.is404}\n pathname={router.pathname}\n currentPath={router.currentPath}\n routeManifest={routeManifest}\n >\n <StrictMode>\n <RootLayout>\n <Routes componentTree={componentTree} />\n </RootLayout>\n </StrictMode>\n </ClientRouterProvider>\n </ComponentsProvider>\n </QueryManagerProvider>\n </WebSocketContextProvider>\n </I18nProvider>\n );\n};\n",
6
- "import { createContext, type PropsWithChildren } from \"react\";\nimport type { Translations } from \"./i18n/I18nContext\";\nimport type { ComponentTree } from \"./types\";\nimport type { User } from \"../auth/adapters/types\";\n\ntype Data = Record<string, any>;\n\nexport interface ServerDataContextValue {\n routeManifest: Record<string, string[]>;\n pageData: Record<string, Record<string, Data>>;\n prefetchedData: Record<string, Data>;\n router: {\n pathname: string;\n params: Record<string, any>;\n currentPath: string;\n is404: boolean;\n searchParams: string;\n };\n i18n: {\n dictionary: Translations;\n currentLocale: string;\n supportedLocales: string[];\n };\n componentTree: ComponentTree;\n auth: {\n user: User;\n };\n}\n\nexport const ServerDataContext = createContext({} as ServerDataContextValue);\n\ninterface ServerDataProviderProps {\n value?: ServerDataContextValue;\n}\n\nexport const ServerDataProvider = (\n props: PropsWithChildren<ServerDataProviderProps>,\n) => {\n let _value = props.value;\n // Server\n if (props.value) {\n _value = props.value;\n } else {\n // Client\n _value = (window as any).__GEMI_DATA__;\n }\n\n return (\n <ServerDataContext.Provider value={_value}>\n {props.children}\n </ServerDataContext.Provider>\n );\n};\n",
7
- "function _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nexport { _extends as default };",
8
- "import _extends from '@babel/runtime/helpers/esm/extends';\n\n/**\r\n * Actions represent the type of change to a location value.\r\n *\r\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#action\r\n */\nvar Action;\n\n(function (Action) {\n /**\r\n * A POP indicates a change to an arbitrary index in the history stack, such\r\n * as a back or forward navigation. It does not describe the direction of the\r\n * navigation, only that the current index changed.\r\n *\r\n * Note: This is the default action for newly created history objects.\r\n */\n Action[\"Pop\"] = \"POP\";\n /**\r\n * A PUSH indicates a new entry being added to the history stack, such as when\r\n * a link is clicked and a new page loads. When this happens, all subsequent\r\n * entries in the stack are lost.\r\n */\n\n Action[\"Push\"] = \"PUSH\";\n /**\r\n * A REPLACE indicates the entry at the current index in the history stack\r\n * being replaced by a new one.\r\n */\n\n Action[\"Replace\"] = \"REPLACE\";\n})(Action || (Action = {}));\n\nvar readOnly = process.env.NODE_ENV !== \"production\" ? function (obj) {\n return Object.freeze(obj);\n} : function (obj) {\n return obj;\n};\n\nfunction warning(cond, message) {\n if (!cond) {\n // eslint-disable-next-line no-console\n if (typeof console !== 'undefined') console.warn(message);\n\n try {\n // Welcome to debugging history!\n //\n // This error is thrown as a convenience so you can more easily\n // find the source for a warning that appears in the console by\n // enabling \"pause on exceptions\" in your JavaScript debugger.\n throw new Error(message); // eslint-disable-next-line no-empty\n } catch (e) {}\n }\n}\n\nvar BeforeUnloadEventType = 'beforeunload';\nvar HashChangeEventType = 'hashchange';\nvar PopStateEventType = 'popstate';\n/**\r\n * Browser history stores the location in regular URLs. This is the standard for\r\n * most web apps, but it requires some configuration on the server to ensure you\r\n * serve the same app at multiple URLs.\r\n *\r\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createbrowserhistory\r\n */\n\nfunction createBrowserHistory(options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n _options$window = _options.window,\n window = _options$window === void 0 ? document.defaultView : _options$window;\n var globalHistory = window.history;\n\n function getIndexAndLocation() {\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var state = globalHistory.state || {};\n return [state.idx, readOnly({\n pathname: pathname,\n search: search,\n hash: hash,\n state: state.usr || null,\n key: state.key || 'default'\n })];\n }\n\n var blockedPopTx = null;\n\n function handlePop() {\n if (blockedPopTx) {\n blockers.call(blockedPopTx);\n blockedPopTx = null;\n } else {\n var nextAction = Action.Pop;\n\n var _getIndexAndLocation = getIndexAndLocation(),\n nextIndex = _getIndexAndLocation[0],\n nextLocation = _getIndexAndLocation[1];\n\n if (blockers.length) {\n if (nextIndex != null) {\n var delta = index - nextIndex;\n\n if (delta) {\n // Revert the POP\n blockedPopTx = {\n action: nextAction,\n location: nextLocation,\n retry: function retry() {\n go(delta * -1);\n }\n };\n go(delta);\n }\n } else {\n // Trying to POP to a location with no index. We did not create\n // this location, so we can't effectively block the navigation.\n process.env.NODE_ENV !== \"production\" ? warning(false, // TODO: Write up a doc that explains our blocking strategy in\n // detail and link to it here so people can understand better what\n // is going on and how to avoid it.\n \"You are trying to block a POP navigation to a location that was not \" + \"created by the history library. The block will fail silently in \" + \"production, but in general you should do all navigation with the \" + \"history library (instead of using window.history.pushState directly) \" + \"to avoid this situation.\") : void 0;\n }\n } else {\n applyTx(nextAction);\n }\n }\n }\n\n window.addEventListener(PopStateEventType, handlePop);\n var action = Action.Pop;\n\n var _getIndexAndLocation2 = getIndexAndLocation(),\n index = _getIndexAndLocation2[0],\n location = _getIndexAndLocation2[1];\n\n var listeners = createEvents();\n var blockers = createEvents();\n\n if (index == null) {\n index = 0;\n globalHistory.replaceState(_extends({}, globalHistory.state, {\n idx: index\n }), '');\n }\n\n function createHref(to) {\n return typeof to === 'string' ? to : createPath(to);\n } // state defaults to `null` because `window.history.state` does\n\n\n function getNextLocation(to, state) {\n if (state === void 0) {\n state = null;\n }\n\n return readOnly(_extends({\n pathname: location.pathname,\n hash: '',\n search: ''\n }, typeof to === 'string' ? parsePath(to) : to, {\n state: state,\n key: createKey()\n }));\n }\n\n function getHistoryStateAndUrl(nextLocation, index) {\n return [{\n usr: nextLocation.state,\n key: nextLocation.key,\n idx: index\n }, createHref(nextLocation)];\n }\n\n function allowTx(action, location, retry) {\n return !blockers.length || (blockers.call({\n action: action,\n location: location,\n retry: retry\n }), false);\n }\n\n function applyTx(nextAction) {\n action = nextAction;\n\n var _getIndexAndLocation3 = getIndexAndLocation();\n\n index = _getIndexAndLocation3[0];\n location = _getIndexAndLocation3[1];\n listeners.call({\n action: action,\n location: location\n });\n }\n\n function push(to, state) {\n var nextAction = Action.Push;\n var nextLocation = getNextLocation(to, state);\n\n function retry() {\n push(to, state);\n }\n\n if (allowTx(nextAction, nextLocation, retry)) {\n var _getHistoryStateAndUr = getHistoryStateAndUrl(nextLocation, index + 1),\n historyState = _getHistoryStateAndUr[0],\n url = _getHistoryStateAndUr[1]; // TODO: Support forced reloading\n // try...catch because iOS limits us to 100 pushState calls :/\n\n\n try {\n globalHistory.pushState(historyState, '', url);\n } catch (error) {\n // They are going to lose state here, but there is no real\n // way to warn them about it since the page will refresh...\n window.location.assign(url);\n }\n\n applyTx(nextAction);\n }\n }\n\n function replace(to, state) {\n var nextAction = Action.Replace;\n var nextLocation = getNextLocation(to, state);\n\n function retry() {\n replace(to, state);\n }\n\n if (allowTx(nextAction, nextLocation, retry)) {\n var _getHistoryStateAndUr2 = getHistoryStateAndUrl(nextLocation, index),\n historyState = _getHistoryStateAndUr2[0],\n url = _getHistoryStateAndUr2[1]; // TODO: Support forced reloading\n\n\n globalHistory.replaceState(historyState, '', url);\n applyTx(nextAction);\n }\n }\n\n function go(delta) {\n globalHistory.go(delta);\n }\n\n var history = {\n get action() {\n return action;\n },\n\n get location() {\n return location;\n },\n\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n back: function back() {\n go(-1);\n },\n forward: function forward() {\n go(1);\n },\n listen: function listen(listener) {\n return listeners.push(listener);\n },\n block: function block(blocker) {\n var unblock = blockers.push(blocker);\n\n if (blockers.length === 1) {\n window.addEventListener(BeforeUnloadEventType, promptBeforeUnload);\n }\n\n return function () {\n unblock(); // Remove the beforeunload listener so the document may\n // still be salvageable in the pagehide event.\n // See https://html.spec.whatwg.org/#unloading-documents\n\n if (!blockers.length) {\n window.removeEventListener(BeforeUnloadEventType, promptBeforeUnload);\n }\n };\n }\n };\n return history;\n}\n/**\r\n * Hash history stores the location in window.location.hash. This makes it ideal\r\n * for situations where you don't want to send the location to the server for\r\n * some reason, either because you do cannot configure it or the URL space is\r\n * reserved for something else.\r\n *\r\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createhashhistory\r\n */\n\nfunction createHashHistory(options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options2 = options,\n _options2$window = _options2.window,\n window = _options2$window === void 0 ? document.defaultView : _options2$window;\n var globalHistory = window.history;\n\n function getIndexAndLocation() {\n var _parsePath = parsePath(window.location.hash.substr(1)),\n _parsePath$pathname = _parsePath.pathname,\n pathname = _parsePath$pathname === void 0 ? '/' : _parsePath$pathname,\n _parsePath$search = _parsePath.search,\n search = _parsePath$search === void 0 ? '' : _parsePath$search,\n _parsePath$hash = _parsePath.hash,\n hash = _parsePath$hash === void 0 ? '' : _parsePath$hash;\n\n var state = globalHistory.state || {};\n return [state.idx, readOnly({\n pathname: pathname,\n search: search,\n hash: hash,\n state: state.usr || null,\n key: state.key || 'default'\n })];\n }\n\n var blockedPopTx = null;\n\n function handlePop() {\n if (blockedPopTx) {\n blockers.call(blockedPopTx);\n blockedPopTx = null;\n } else {\n var nextAction = Action.Pop;\n\n var _getIndexAndLocation4 = getIndexAndLocation(),\n nextIndex = _getIndexAndLocation4[0],\n nextLocation = _getIndexAndLocation4[1];\n\n if (blockers.length) {\n if (nextIndex != null) {\n var delta = index - nextIndex;\n\n if (delta) {\n // Revert the POP\n blockedPopTx = {\n action: nextAction,\n location: nextLocation,\n retry: function retry() {\n go(delta * -1);\n }\n };\n go(delta);\n }\n } else {\n // Trying to POP to a location with no index. We did not create\n // this location, so we can't effectively block the navigation.\n process.env.NODE_ENV !== \"production\" ? warning(false, // TODO: Write up a doc that explains our blocking strategy in\n // detail and link to it here so people can understand better\n // what is going on and how to avoid it.\n \"You are trying to block a POP navigation to a location that was not \" + \"created by the history library. The block will fail silently in \" + \"production, but in general you should do all navigation with the \" + \"history library (instead of using window.history.pushState directly) \" + \"to avoid this situation.\") : void 0;\n }\n } else {\n applyTx(nextAction);\n }\n }\n }\n\n window.addEventListener(PopStateEventType, handlePop); // popstate does not fire on hashchange in IE 11 and old (trident) Edge\n // https://developer.mozilla.org/de/docs/Web/API/Window/popstate_event\n\n window.addEventListener(HashChangeEventType, function () {\n var _getIndexAndLocation5 = getIndexAndLocation(),\n nextLocation = _getIndexAndLocation5[1]; // Ignore extraneous hashchange events.\n\n\n if (createPath(nextLocation) !== createPath(location)) {\n handlePop();\n }\n });\n var action = Action.Pop;\n\n var _getIndexAndLocation6 = getIndexAndLocation(),\n index = _getIndexAndLocation6[0],\n location = _getIndexAndLocation6[1];\n\n var listeners = createEvents();\n var blockers = createEvents();\n\n if (index == null) {\n index = 0;\n globalHistory.replaceState(_extends({}, globalHistory.state, {\n idx: index\n }), '');\n }\n\n function getBaseHref() {\n var base = document.querySelector('base');\n var href = '';\n\n if (base && base.getAttribute('href')) {\n var url = window.location.href;\n var hashIndex = url.indexOf('#');\n href = hashIndex === -1 ? url : url.slice(0, hashIndex);\n }\n\n return href;\n }\n\n function createHref(to) {\n return getBaseHref() + '#' + (typeof to === 'string' ? to : createPath(to));\n }\n\n function getNextLocation(to, state) {\n if (state === void 0) {\n state = null;\n }\n\n return readOnly(_extends({\n pathname: location.pathname,\n hash: '',\n search: ''\n }, typeof to === 'string' ? parsePath(to) : to, {\n state: state,\n key: createKey()\n }));\n }\n\n function getHistoryStateAndUrl(nextLocation, index) {\n return [{\n usr: nextLocation.state,\n key: nextLocation.key,\n idx: index\n }, createHref(nextLocation)];\n }\n\n function allowTx(action, location, retry) {\n return !blockers.length || (blockers.call({\n action: action,\n location: location,\n retry: retry\n }), false);\n }\n\n function applyTx(nextAction) {\n action = nextAction;\n\n var _getIndexAndLocation7 = getIndexAndLocation();\n\n index = _getIndexAndLocation7[0];\n location = _getIndexAndLocation7[1];\n listeners.call({\n action: action,\n location: location\n });\n }\n\n function push(to, state) {\n var nextAction = Action.Push;\n var nextLocation = getNextLocation(to, state);\n\n function retry() {\n push(to, state);\n }\n\n process.env.NODE_ENV !== \"production\" ? warning(nextLocation.pathname.charAt(0) === '/', \"Relative pathnames are not supported in hash history.push(\" + JSON.stringify(to) + \")\") : void 0;\n\n if (allowTx(nextAction, nextLocation, retry)) {\n var _getHistoryStateAndUr3 = getHistoryStateAndUrl(nextLocation, index + 1),\n historyState = _getHistoryStateAndUr3[0],\n url = _getHistoryStateAndUr3[1]; // TODO: Support forced reloading\n // try...catch because iOS limits us to 100 pushState calls :/\n\n\n try {\n globalHistory.pushState(historyState, '', url);\n } catch (error) {\n // They are going to lose state here, but there is no real\n // way to warn them about it since the page will refresh...\n window.location.assign(url);\n }\n\n applyTx(nextAction);\n }\n }\n\n function replace(to, state) {\n var nextAction = Action.Replace;\n var nextLocation = getNextLocation(to, state);\n\n function retry() {\n replace(to, state);\n }\n\n process.env.NODE_ENV !== \"production\" ? warning(nextLocation.pathname.charAt(0) === '/', \"Relative pathnames are not supported in hash history.replace(\" + JSON.stringify(to) + \")\") : void 0;\n\n if (allowTx(nextAction, nextLocation, retry)) {\n var _getHistoryStateAndUr4 = getHistoryStateAndUrl(nextLocation, index),\n historyState = _getHistoryStateAndUr4[0],\n url = _getHistoryStateAndUr4[1]; // TODO: Support forced reloading\n\n\n globalHistory.replaceState(historyState, '', url);\n applyTx(nextAction);\n }\n }\n\n function go(delta) {\n globalHistory.go(delta);\n }\n\n var history = {\n get action() {\n return action;\n },\n\n get location() {\n return location;\n },\n\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n back: function back() {\n go(-1);\n },\n forward: function forward() {\n go(1);\n },\n listen: function listen(listener) {\n return listeners.push(listener);\n },\n block: function block(blocker) {\n var unblock = blockers.push(blocker);\n\n if (blockers.length === 1) {\n window.addEventListener(BeforeUnloadEventType, promptBeforeUnload);\n }\n\n return function () {\n unblock(); // Remove the beforeunload listener so the document may\n // still be salvageable in the pagehide event.\n // See https://html.spec.whatwg.org/#unloading-documents\n\n if (!blockers.length) {\n window.removeEventListener(BeforeUnloadEventType, promptBeforeUnload);\n }\n };\n }\n };\n return history;\n}\n/**\r\n * Memory history stores the current location in memory. It is designed for use\r\n * in stateful non-browser environments like tests and React Native.\r\n *\r\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#creatememoryhistory\r\n */\n\nfunction createMemoryHistory(options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options3 = options,\n _options3$initialEntr = _options3.initialEntries,\n initialEntries = _options3$initialEntr === void 0 ? ['/'] : _options3$initialEntr,\n initialIndex = _options3.initialIndex;\n var entries = initialEntries.map(function (entry) {\n var location = readOnly(_extends({\n pathname: '/',\n search: '',\n hash: '',\n state: null,\n key: createKey()\n }, typeof entry === 'string' ? parsePath(entry) : entry));\n process.env.NODE_ENV !== \"production\" ? warning(location.pathname.charAt(0) === '/', \"Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: \" + JSON.stringify(entry) + \")\") : void 0;\n return location;\n });\n var index = clamp(initialIndex == null ? entries.length - 1 : initialIndex, 0, entries.length - 1);\n var action = Action.Pop;\n var location = entries[index];\n var listeners = createEvents();\n var blockers = createEvents();\n\n function createHref(to) {\n return typeof to === 'string' ? to : createPath(to);\n }\n\n function getNextLocation(to, state) {\n if (state === void 0) {\n state = null;\n }\n\n return readOnly(_extends({\n pathname: location.pathname,\n search: '',\n hash: ''\n }, typeof to === 'string' ? parsePath(to) : to, {\n state: state,\n key: createKey()\n }));\n }\n\n function allowTx(action, location, retry) {\n return !blockers.length || (blockers.call({\n action: action,\n location: location,\n retry: retry\n }), false);\n }\n\n function applyTx(nextAction, nextLocation) {\n action = nextAction;\n location = nextLocation;\n listeners.call({\n action: action,\n location: location\n });\n }\n\n function push(to, state) {\n var nextAction = Action.Push;\n var nextLocation = getNextLocation(to, state);\n\n function retry() {\n push(to, state);\n }\n\n process.env.NODE_ENV !== \"production\" ? warning(location.pathname.charAt(0) === '/', \"Relative pathnames are not supported in memory history.push(\" + JSON.stringify(to) + \")\") : void 0;\n\n if (allowTx(nextAction, nextLocation, retry)) {\n index += 1;\n entries.splice(index, entries.length, nextLocation);\n applyTx(nextAction, nextLocation);\n }\n }\n\n function replace(to, state) {\n var nextAction = Action.Replace;\n var nextLocation = getNextLocation(to, state);\n\n function retry() {\n replace(to, state);\n }\n\n process.env.NODE_ENV !== \"production\" ? warning(location.pathname.charAt(0) === '/', \"Relative pathnames are not supported in memory history.replace(\" + JSON.stringify(to) + \")\") : void 0;\n\n if (allowTx(nextAction, nextLocation, retry)) {\n entries[index] = nextLocation;\n applyTx(nextAction, nextLocation);\n }\n }\n\n function go(delta) {\n var nextIndex = clamp(index + delta, 0, entries.length - 1);\n var nextAction = Action.Pop;\n var nextLocation = entries[nextIndex];\n\n function retry() {\n go(delta);\n }\n\n if (allowTx(nextAction, nextLocation, retry)) {\n index = nextIndex;\n applyTx(nextAction, nextLocation);\n }\n }\n\n var history = {\n get index() {\n return index;\n },\n\n get action() {\n return action;\n },\n\n get location() {\n return location;\n },\n\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n back: function back() {\n go(-1);\n },\n forward: function forward() {\n go(1);\n },\n listen: function listen(listener) {\n return listeners.push(listener);\n },\n block: function block(blocker) {\n return blockers.push(blocker);\n }\n };\n return history;\n} ////////////////////////////////////////////////////////////////////////////////\n// UTILS\n////////////////////////////////////////////////////////////////////////////////\n\nfunction clamp(n, lowerBound, upperBound) {\n return Math.min(Math.max(n, lowerBound), upperBound);\n}\n\nfunction promptBeforeUnload(event) {\n // Cancel the event.\n event.preventDefault(); // Chrome (and legacy IE) requires returnValue to be set.\n\n event.returnValue = '';\n}\n\nfunction createEvents() {\n var handlers = [];\n return {\n get length() {\n return handlers.length;\n },\n\n push: function push(fn) {\n handlers.push(fn);\n return function () {\n handlers = handlers.filter(function (handler) {\n return handler !== fn;\n });\n };\n },\n call: function call(arg) {\n handlers.forEach(function (fn) {\n return fn && fn(arg);\n });\n }\n };\n}\n\nfunction createKey() {\n return Math.random().toString(36).substr(2, 8);\n}\n/**\r\n * Creates a string URL path from the given pathname, search, and hash components.\r\n *\r\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createpath\r\n */\n\n\nfunction createPath(_ref) {\n var _ref$pathname = _ref.pathname,\n pathname = _ref$pathname === void 0 ? '/' : _ref$pathname,\n _ref$search = _ref.search,\n search = _ref$search === void 0 ? '' : _ref$search,\n _ref$hash = _ref.hash,\n hash = _ref$hash === void 0 ? '' : _ref$hash;\n if (search && search !== '?') pathname += search.charAt(0) === '?' ? search : '?' + search;\n if (hash && hash !== '#') pathname += hash.charAt(0) === '#' ? hash : '#' + hash;\n return pathname;\n}\n/**\r\n * Parses a string URL path into its separate pathname, search, and hash components.\r\n *\r\n * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#parsepath\r\n */\n\nfunction parsePath(path) {\n var parsedPath = {};\n\n if (path) {\n var hashIndex = path.indexOf('#');\n\n if (hashIndex >= 0) {\n parsedPath.hash = path.substr(hashIndex);\n path = path.substr(0, hashIndex);\n }\n\n var searchIndex = path.indexOf('?');\n\n if (searchIndex >= 0) {\n parsedPath.search = path.substr(searchIndex);\n path = path.substr(0, searchIndex);\n }\n\n if (path) {\n parsedPath.pathname = path;\n }\n }\n\n return parsedPath;\n}\n\nexport { Action, createBrowserHistory, createHashHistory, createMemoryHistory, createPath, parsePath };\n//# sourceMappingURL=index.js.map\n",
9
- "import { type History, type Location, createBrowserHistory } from \"history\";\nimport {\n createContext,\n useContext,\n useEffect,\n useRef,\n useState,\n type PropsWithChildren,\n} from \"react\";\nimport { Subject } from \"../utils/Subject\";\n// @ts-ignore\nimport { URLPattern } from \"urlpattern-polyfill\";\nimport { ProgressManager } from \"./ProgressManager\";\nimport { HttpReload } from \"./HttpReload\";\n\ninterface ClientRouterContextValue {\n viewEntriesSubject: Subject<string[]>;\n history: History | null;\n updatePageData: (pageData: Record<string, any>) => void;\n getPageData: (key: string) => any;\n locationSubject: Subject<Location>;\n getScrollPosition: (path: string) => number;\n params: Record<string, string>;\n getViewPathsFromPathname: (pathname: string) => string[];\n getRoutePathnameFromHref: (href: string) => string | null;\n isNavigatingSubject: Subject<boolean>;\n setNavigationAbortController: (controller: AbortController) => void;\n progressManager: ProgressManager;\n}\n\nexport const ClientRouterContext = createContext(\n {} as ClientRouterContextValue,\n);\n\ninterface ClientRouterProviderProps {\n pathname: string;\n routeManifest: Record<string, string[]>;\n pageData: Record<string, any>;\n currentPath: string;\n params: Record<string, string>;\n searchParams: string;\n is404: boolean;\n}\n\nexport const ClientRouterProvider = (\n props: PropsWithChildren<ClientRouterProviderProps>,\n) => {\n const {\n children,\n pathname,\n currentPath,\n is404,\n routeManifest,\n pageData,\n params,\n searchParams,\n } = props;\n const [parameters, setParameters] = useState(params);\n const navigationAbortControllerRef = useRef(new AbortController());\n const [isNavigatingSubject] = useState(() => {\n return new Subject<boolean>(false);\n });\n\n const [progressManager] = useState(new ProgressManager(isNavigatingSubject));\n const pageDataRef = useRef(structuredClone(pageData));\n const scrollHistoryRef = useRef<Map<string, number>>(new Map());\n const initalViewEntries = is404\n ? [\"404\"]\n : (routeManifest[pathname] ?? [\"404\"]);\n const viewEntriesSubject = useRef(new Subject<string[]>(initalViewEntries));\n const [locationSubject] = useState(\n () =>\n new Subject<Location>({\n hash: \"\",\n pathname: currentPath,\n search: searchParams,\n state: {},\n key: \"\",\n }),\n );\n\n const [history] = useState<History | null>(() => {\n let history: History | null = null;\n\n // @ts-ignore\n if (typeof window !== \"undefined\") {\n history = createBrowserHistory();\n }\n return history;\n });\n\n const handleScroll = () => {\n const key = [\n `${locationSubject.getValue().pathname}?${locationSubject.getValue().search}`,\n ]\n .filter((item) => item.length > 0)\n .join(\"\");\n\n scrollHistoryRef.current.set(key, window.scrollY);\n };\n\n const findMatchingRouteFromParams = (pathname: string) => {\n const candidates: string[] = [];\n for (const route of Object.keys(routeManifest)) {\n const urlPattern = new URLPattern({ pathname: route });\n if (urlPattern.test({ pathname })) {\n candidates.push(route);\n }\n }\n const sortedCandidates = candidates.sort((a, b) => {\n const x = a.split(\"/\").length + a.split(\":\").length;\n const y = b.split(\"/\").length + b.split(\":\").length;\n return x - y;\n });\n\n const [route] = sortedCandidates ?? [];\n return route;\n };\n\n const getViewPathsFromPathname = (pathname: string) => {\n const route = findMatchingRouteFromParams(pathname);\n return routeManifest[route] ?? [];\n };\n\n const getRoutePathnameFromHref = (href: string) => {\n const route = findMatchingRouteFromParams(href);\n return route;\n };\n\n const getParams = (pathname: string) => {\n const route = findMatchingRouteFromParams(pathname);\n const urlPattern = new URLPattern({ pathname: route });\n return urlPattern.exec({ pathname })?.pathname.groups!;\n };\n\n useEffect(() => {\n history?.listen(({ location }) => {\n locationSubject.next(structuredClone(location));\n setParameters(getParams(location.pathname));\n viewEntriesSubject.current.next(\n (() => {\n if ((location.state as any)?.status === 404) {\n return [\"404\"];\n }\n return getViewPathsFromPathname(location.pathname);\n })(),\n );\n });\n\n window.addEventListener(\"scrollend\", handleScroll);\n return () => {\n window.removeEventListener(\"scroll\", handleScroll);\n };\n }, []);\n\n const updatePageData = (newPageData: Record<string, any>) => {\n const [key, value] = Object.entries(newPageData)[0];\n if (!pageDataRef.current?.[key]) {\n pageDataRef.current[key] = {};\n }\n\n pageDataRef.current[key] = value;\n };\n\n const getPageData = (key: string) => {\n return pageDataRef.current[locationSubject.getValue().pathname][key];\n };\n\n const setNavigationAbortController = (controller: AbortController) => {\n navigationAbortControllerRef.current.abort();\n navigationAbortControllerRef.current = controller;\n };\n\n return (\n <ClientRouterContext.Provider\n value={{\n isNavigatingSubject,\n getViewPathsFromPathname,\n history,\n params: parameters,\n locationSubject,\n getScrollPosition: (path: string) => {\n return scrollHistoryRef.current.get(path) || 0;\n },\n viewEntriesSubject: viewEntriesSubject.current,\n updatePageData,\n getPageData,\n getRoutePathnameFromHref,\n setNavigationAbortController,\n progressManager,\n }}\n >\n {children}\n {/* @ts-ignore */}\n {import.meta.hot && <HttpReload />}\n </ClientRouterContext.Provider>\n );\n};\n\nfunction useLocationChange(cb: (location: Location) => void) {\n const { locationSubject } = useContext(ClientRouterContext);\n useEffect(() => {\n cb(locationSubject.getValue());\n return locationSubject.subscribe(cb);\n }, []);\n}\n\nexport function useLocation() {\n const ctx = useContext(ClientRouterContext);\n if (!ctx) {\n throw new Error(\"useLocation must be used within a ClientRouterProvider\");\n }\n const { locationSubject } = ctx;\n const [location, setLocation] = useState(locationSubject?.getValue());\n\n useLocationChange((newLocation) => {\n setLocation(newLocation);\n });\n\n return location;\n}\n",
10
- "export class Subject<T> {\n subscribers = new Set<(value: T) => void>();\n value: T;\n\n constructor(initialValue: T) {\n this.value = initialValue;\n }\n\n public subscribe(subscriber: (value: T) => void) {\n this.subscribers.add(subscriber);\n return () => {\n this.subscribers.delete(subscriber);\n };\n }\n\n public next(value: T) {\n this.value = value;\n this.subscribers.forEach((subscriber) => subscriber(value));\n }\n\n public getValue() {\n return this.value;\n }\n}\n",
11
- "export function sleep(time: number) {\n return new Promise((resolve) => setTimeout(resolve, time));\n}\n",
12
- "import { Subject } from \"../utils/Subject\";\nimport { sleep } from \"../utils/sleep\";\n\nexport class ProgressManager {\n state = new Subject(100);\n unsubscribe: ReturnType<InstanceType<typeof Subject>[\"subscribe\"]>;\n timer: ReturnType<typeof setInterval>;\n tick = 0;\n isTicking = false;\n\n constructor(subject: Subject<boolean>) {\n this.unsubscribe = subject.subscribe((state) => {\n if (state) {\n this.start();\n } else {\n this.end();\n }\n });\n }\n\n getNextIncrement() {\n const current = this.state.getValue();\n if (current === 100) {\n return Math.ceil(Math.random() * 10);\n }\n\n if (current <= 20) {\n if (Math.ceil(Math.random() * 100) > 80) {\n return current;\n }\n return current + Math.ceil(Math.random() * 5) + 1;\n }\n\n if (current <= 50) {\n if (Math.ceil(Math.random() * 100) > 50) {\n return current;\n }\n return Math.min(current + Math.ceil(Math.random() * 10), 70);\n }\n\n if (current <= 70) {\n if (Math.ceil(Math.random() * 100) > 60) {\n return current;\n }\n return Math.min(current + Math.ceil(Math.random() * 3), 80);\n }\n\n if (current <= 80) {\n return Math.min(current + Math.ceil(Math.random() * 1), 90);\n }\n\n if (current <= 90) {\n const x = Math.ceil(Math.random() * 100) > 50 ? 0 : 1;\n return Math.min(current + x, 94);\n }\n\n if (current <= 94) {\n const x = Math.ceil(Math.random() * 100) > 20 ? 0 : 1;\n return Math.min(current + x, 99);\n }\n }\n\n getNextInterval() {\n if (this.tick === 0) {\n this.tick = 1;\n return 200;\n }\n const current = this.state.getValue();\n\n if (current >= 88) {\n return 400;\n }\n if (current >= 94) {\n return 1000;\n }\n if (current >= 98) {\n return 2000;\n }\n return 100;\n }\n\n async nextTick() {\n if (!this.isTicking) {\n return;\n }\n await sleep(this.getNextInterval());\n\n if (!this.isTicking) {\n return;\n }\n\n const increment = this.getNextIncrement();\n this.state.next(Math.min(increment, 96));\n\n await this.nextTick();\n }\n\n start() {\n this.isTicking = true;\n this.nextTick();\n }\n\n end() {\n this.state.next(99);\n this.isTicking = false;\n this.tick = 0;\n setTimeout(() => {\n this.state.next(100);\n }, 200);\n }\n\n destroy() {\n this.end();\n this.unsubscribe();\n }\n}\n",
13
- "import { useEffect, useState } from \"react\";\nimport { useNavigate } from \"./useNavigate\";\nimport { useSearchParams } from \"./useSearchParams\";\nimport { useRoute } from \"./useRoute\";\nimport { useParams } from \"./useParams\";\nimport { createPortal } from \"react-dom\";\n\nexport const HttpReload = () => {\n const { replace } = useNavigate();\n const searchParams = useSearchParams();\n const { pathname } = useRoute();\n const params = useParams();\n const [reloading, setReloading] = useState(false);\n const handleReload = () => {\n setReloading(true);\n replace(pathname, {\n params: params,\n search: searchParams.toJSON(),\n } as any)\n .catch(console.log)\n .finally(() => {\n setReloading(false);\n });\n };\n useEffect(() => {\n // @ts-ignore\n if (import.meta.hot) {\n // @ts-ignore\n import.meta.hot.on(\"vite:beforeFullReload\", () => {\n console.log(\"HELLO\");\n throw \"(skipping full reload)\";\n });\n\n // @ts-ignore\n import.meta.hot.on(\"beforeFullReload\", () => {\n console.log(\"HELLO\");\n throw \"(skipping full reload)\";\n });\n }\n return () => {\n // @ts-ignore\n if (import.meta.hot) {\n // @ts-ignore\n import.meta.hot.off(\"http-reload\", handleReload);\n }\n };\n }, [handleReload]);\n\n if (!reloading || typeof document === \"undefined\") {\n return null;\n }\n return createPortal(\n <div className=\"fixed z-[1000] bottom-0 right-0 p-2\">\n <div className=\"p-2 bg-white text-black rounded-md shadow-md\">...</div>\n </div>,\n document.body,\n );\n};\n",
14
- "import { useContext, startTransition } from \"react\";\nimport { ClientRouterContext } from \"./ClientRouterContext\";\nimport type { UrlParser, ViewPaths } from \"./types\";\nimport { applyParams } from \"../utils/applyParams\";\nimport { I18nContext } from \"./i18n/I18nContext\";\nimport { QueryManagerContext } from \"./QueryManagerContext\";\n\ntype Options<T extends ViewPaths> =\n UrlParser<T> extends Record<string, never>\n ? {\n search?: Record<string, string | number | boolean | undefined | null>;\n shallow?: boolean;\n }\n : {\n search?: Record<string, string | number | boolean | undefined | null>;\n params: UrlParser<T>;\n shallow?: boolean;\n };\n\nexport function useNavigate() {\n const {\n updatePageData,\n history,\n getViewPathsFromPathname,\n getRoutePathnameFromHref,\n isNavigatingSubject,\n setNavigationAbortController,\n getScrollPosition,\n } = useContext(ClientRouterContext);\n const { updatePrefecthedData } = useContext(QueryManagerContext);\n const { fetchTranslations } = useContext(I18nContext);\n\n function action(pushOrReplace: \"push\" | \"replace\") {\n return async <T extends ViewPaths>(\n path: T | (string & {}),\n ...args: UrlParser<T> extends Record<string, never>\n ? [options?: Options<T>]\n : [options: Options<T>]\n ) => {\n const navigationAbortController = new AbortController();\n setNavigationAbortController(navigationAbortController);\n\n const [options = {}] = args;\n const {\n search = {},\n params = {},\n shallow,\n } = {\n params: {},\n shallow: false,\n ...options,\n };\n const urlSearchParams = new URLSearchParams(search);\n\n const basePath = applyParams(path, params);\n\n const navigationPath = [\n applyParams(path, params),\n urlSearchParams.toString(),\n ].join(\"?\");\n\n if (shallow) {\n history?.[pushOrReplace](navigationPath);\n return;\n }\n\n const components = getViewPathsFromPathname(path);\n\n const fetchUrlSearchParams = new URLSearchParams(urlSearchParams);\n fetchUrlSearchParams.set(\"json\", \"true\");\n const fetchPath = [basePath, fetchUrlSearchParams.toString()].join(\"?\");\n\n urlSearchParams.set(\"json\", \"true\");\n\n const routePathname = getRoutePathnameFromHref(path);\n\n isNavigatingSubject.next(true);\n\n try {\n const [res] = await Promise.all([\n fetch(fetchPath, { signal: navigationAbortController.signal }),\n fetchTranslations(\n routePathname,\n undefined,\n navigationAbortController.signal,\n ),\n ...components.map((component) =>\n (window as any).loaders[component](),\n ),\n ]);\n\n if (res.ok) {\n const {\n data,\n prefetchedData,\n directive = {},\n is404 = false,\n } = await res.json();\n if (directive?.kind === \"Redirect\") {\n if (directive?.path) {\n isNavigatingSubject.next(false);\n action(\"replace\")(directive.path, { params: {} });\n }\n\n return;\n }\n updatePageData(data);\n updatePrefecthedData(prefetchedData);\n\n history?.[pushOrReplace](\n navigationPath,\n is404 ? { status: 404 } : {},\n );\n setTimeout(() => {\n window.scrollTo(0, getScrollPosition(navigationPath));\n }, 1);\n }\n } catch (err) {\n isNavigatingSubject.next(false);\n // Do something\n }\n\n isNavigatingSubject.next(false);\n };\n }\n\n return {\n push: action(\"push\"),\n replace: action(\"replace\"),\n };\n}\n",
15
- "import {\n createContext,\n type PropsWithChildren,\n useContext,\n useState,\n} from \"react\";\nimport { ServerDataContext } from \"../ServerDataProvider\";\n\ntype TranslationScope = Record<string, string>;\ntype TranslationScopes = Record<string, TranslationScope>;\nexport type Translations = Record<string, TranslationScopes>;\n\ninterface I18nContextValue {\n locale: string;\n changeLocale: (locale: string) => void;\n updateDictionary: (\n translations: Record<string, Record<string, Record<string, string>>>,\n ) => void;\n translations: TranslationScopes;\n fetchTranslations: (\n pathname: string,\n locale?: string,\n signal?: AbortSignal,\n ) => Promise<void>;\n}\n\nexport const I18nContext = createContext({} as I18nContextValue);\n\ninterface I18nProviderProps {}\n\nexport type Dictionary = Map<string, Map<string, Record<string, string>>>;\n\nexport const I18nProvider = (props: PropsWithChildren<I18nProviderProps>) => {\n const { i18n } = useContext(ServerDataContext);\n\n const [currentLocale, setCurrentLocale] = useState(i18n.currentLocale);\n\n const [dictionary] = useState<Dictionary>(() => {\n const dictionary = new Map();\n for (const [locale, value] of Object.entries(i18n.dictionary)) {\n const scopes = new Map();\n for (const [scope, translations] of Object.entries(value)) {\n scopes.set(scope, translations);\n }\n dictionary.set(locale, scopes);\n }\n return dictionary;\n });\n\n const [currentTranslations, setCurrentTranslations] =\n useState<TranslationScopes>(() => {\n if (!dictionary.has(currentLocale)) {\n return {};\n }\n return Object.fromEntries(dictionary.get(currentLocale).entries());\n });\n\n function updateDictionary(\n translations: Record<string, Record<string, Record<string, string>>>,\n ) {\n for (const [locale, value] of Object.entries(translations)) {\n if (!dictionary.has(locale)) {\n dictionary.set(locale, new Map());\n }\n const scopes = dictionary.get(locale);\n for (const [scope, translations] of Object.entries(value)) {\n if (!scopes.has(scope)) {\n scopes.set(scope, {});\n }\n scopes.set(scope, translations);\n }\n }\n setCurrentTranslations(\n Object.fromEntries(dictionary.get(currentLocale).entries()),\n );\n }\n\n const changeLocale = (locale: string) => {\n if (dictionary.has(locale)) {\n setCurrentLocale(locale);\n setCurrentTranslations(\n Object.fromEntries(dictionary.get(locale).entries()),\n );\n }\n };\n\n const fetchTranslations = async (\n pathname: string,\n locale?: string,\n signal?: AbortSignal,\n ) => {\n if (Object.keys(i18n).length === 0) {\n return;\n }\n const response = await fetch(\n `/api/__gemi__/services/i18n/translations?scope=${pathname}&locale=${\n locale || currentLocale\n }`,\n {\n signal,\n },\n );\n const translations = await response.json();\n updateDictionary(translations);\n };\n\n return (\n <I18nContext.Provider\n value={{\n locale: currentLocale,\n translations: currentTranslations,\n changeLocale,\n updateDictionary,\n fetchTranslations,\n }}\n >\n {props.children}\n </I18nContext.Provider>\n );\n};\n",
16
- "import {\n createContext,\n type PropsWithChildren,\n useContext,\n useRef,\n} from \"react\";\nimport { QueryResource } from \"./QueryResource\";\nimport { ServerDataContext } from \"./ServerDataProvider\";\n\nexport const QueryManagerContext = createContext({\n getResource: (key: string, initialState: Record<string, any> = {}) => {\n return new QueryResource(key, initialState);\n },\n updatePrefecthedData: (_data: Record<string, Record<string, any>>) => {},\n});\n\nexport const QueryManagerProvider = ({ children }: PropsWithChildren) => {\n const resourcesRef = useRef<Map<string, QueryResource>>(new Map());\n const { prefetchedData } = useContext(ServerDataContext);\n const prefetchedDataRef = useRef(prefetchedData);\n\n const updatePrefecthedData = (data: Record<string, Record<string, any>>) => {\n for (const [key, value] of Object.entries(data)) {\n prefetchedDataRef.current[key] = value;\n }\n };\n\n return (\n <QueryManagerContext.Provider\n value={{\n updatePrefecthedData,\n getResource: (key: string, initialState?: Record<string, any>) => {\n let _initialState = initialState;\n if (!_initialState && prefetchedDataRef.current[key]) {\n _initialState = prefetchedDataRef.current[key];\n }\n if (!resourcesRef.current.has(key)) {\n resourcesRef.current.set(\n key,\n new QueryResource(key, _initialState ?? {}),\n );\n }\n return resourcesRef.current.get(key);\n },\n }}\n >\n {children}\n </QueryManagerContext.Provider>\n );\n};\n",
17
- "import { Subject } from \"../utils/Subject\";\n\ntype State = {\n loading: boolean;\n data: any;\n error: any;\n};\n\nexport class QueryResource {\n store: Subject<Map<string, State>>;\n staleVariants = new Set<string>();\n lastFetchRecord = new Map<string, number>();\n key: string;\n\n constructor(key: string, initialState: Record<string, any> = {}) {\n this.key = key;\n const store = new Map();\n const now = Date.now();\n for (const [variantKey, data] of Object.entries(initialState)) {\n if (data) {\n store.set(variantKey, {\n loading: false,\n data,\n error: null,\n });\n this.lastFetchRecord.set(variantKey, now);\n }\n }\n\n this.store = new Subject(store);\n }\n\n getVariant(variantKey: string) {\n const store = this.store.getValue();\n if (!store.has(variantKey)) {\n this.resolveVariant(variantKey);\n } else {\n const variant = store.get(variantKey);\n\n if (!variant.loading) {\n // Don't have data\n if (!variant.data) {\n this.resolveVariant(variantKey);\n return store.get(variantKey);\n //\n } else if (variant.data) {\n const stale = this.staleVariants.has(variantKey);\n const now = Date.now();\n // TODO: age must be dynamic\n const old =\n now - (this.lastFetchRecord.get(variantKey) ?? now) > 5000;\n if (stale || old) {\n this.lastFetchRecord.set(variantKey, now);\n this.resolveVariant(variantKey, true);\n return store.get(variantKey);\n //\n }\n }\n }\n }\n return store.get(variantKey);\n }\n\n mutate(variantKey: string, fn: (data: any) => any) {\n const store = this.store.getValue();\n const state = store.get(variantKey);\n const data = fn(state.data);\n\n this.staleVariants.add(variantKey);\n this.store.next(\n store.set(variantKey, { loading: false, data, error: null }),\n );\n this.resolveVariant(variantKey);\n const cacheKey = [window.location.origin, this.key, variantKey]\n .filter((s) => s.length > 0)\n .join(\"?\");\n caches.delete(cacheKey);\n }\n\n private async resolveVariant(variantKey: string, silent = false) {\n if (typeof window === \"undefined\") {\n return;\n }\n const store = this.store.getValue();\n const previousState = store.get(variantKey);\n\n if (!silent) {\n store.set(variantKey, {\n loading: true,\n data: previousState?.data,\n error: previousState?.data,\n });\n }\n\n const fullUrl = [this.key, variantKey].filter((s) => s.length).join(\"?\");\n const response = await fetch(`/api${fullUrl}`);\n\n let data = null;\n try {\n data = await response.json();\n } catch (error) {\n this.store.next(\n store.set(variantKey, {\n loading: false,\n data: previousState?.data,\n error,\n }),\n );\n }\n\n if (response.ok) {\n this.store.next(\n store.set(variantKey, { loading: false, data, error: null }),\n );\n this.staleVariants.delete(variantKey);\n this.lastFetchRecord.set(variantKey, Date.now());\n } else {\n // this.lastFetchRecord.set(variantKey, 0);\n this.store.next(\n store.set(variantKey, {\n loading: false,\n data: previousState?.data,\n error: data,\n }),\n );\n }\n }\n}\n",
18
- "import { useLocation } from \"./ClientRouterContext\";\nimport { useNavigate } from \"./useNavigate\";\n\ntype SearchParamsCallback = (\n search: Record<string, any>,\n shallow: boolean,\n) => void;\n\nclass SearchParams {\n constructor(\n private searchParams: URLSearchParams,\n private callback: SearchParamsCallback,\n ) {}\n\n get(key: string) {\n return this.searchParams.get(key);\n }\n\n set(key: Record<string, string | ((state: string) => string)>): SearchParams;\n set(key: string, value: string | ((state: string) => string)): SearchParams;\n set(key: any, value?: any) {\n let entries: Record<string, any> = {};\n if (typeof key === \"string\") {\n let _value: string = value;\n if (typeof value === \"function\") {\n _value = value(this.get(key) ?? \"\");\n }\n entries[key] = _value;\n } else {\n entries = (key as any) ?? {};\n }\n for (const [key, value] of Object.entries(entries)) {\n let _value: string = value;\n if (typeof value === \"function\") {\n _value = value(this.get(key) ?? \"\");\n }\n this.searchParams.set(key, _value);\n }\n return this;\n }\n\n append(key: string, value: string) {\n this.searchParams.append(key, value);\n return this;\n }\n\n sort() {\n this.searchParams.sort();\n return this;\n }\n\n clear() {\n this.searchParams = new URLSearchParams();\n return this;\n }\n\n delete(key: string | string[]) {\n const keys = Array.isArray(key) ? key : [key];\n for (const key of keys) {\n this.searchParams.delete(key);\n }\n return this;\n }\n\n toJSON() {\n const map = new Map<string, string | string[]>();\n // @ts-ignore\n for (const [key, value] of this.searchParams) {\n if (map.has(key)) {\n const currentValue = map.get(key);\n if (Array.isArray(currentValue)) {\n currentValue.push(value);\n map.set(key, currentValue);\n } else {\n map.set(key, [currentValue, value]);\n }\n } else {\n map.set(key, value);\n }\n }\n\n return Object.fromEntries(map.entries());\n }\n\n toString() {\n return this.searchParams.toString();\n }\n\n push(mode: \"soft\" | \"hard\" = \"soft\") {\n this.callback(this.toJSON(), mode === \"soft\");\n }\n}\n\nexport function useSearchParams() {\n const { push } = useNavigate();\n const location = useLocation();\n const callback = (search: Record<string, any>, shallow: boolean) => {\n push(location.pathname as never, {\n search,\n shallow,\n });\n };\n\n const searchParams = new SearchParams(\n new URLSearchParams(location.search),\n callback,\n );\n\n return searchParams;\n}\n",
19
- "import { useContext } from \"react\";\nimport { useLocation, ClientRouterContext } from \"./ClientRouterContext\";\nimport type { ViewPaths } from \"./types\";\n\ntype Pathname = ViewPaths;\n\nexport function useRoute() {\n const { getRoutePathnameFromHref } = useContext(ClientRouterContext);\n const location = useLocation();\n const routePath = getRoutePathnameFromHref(location.pathname) as Pathname;\n return {\n pathname: routePath,\n startsWith: (pathname: Pathname) => {\n return routePath.startsWith(pathname);\n },\n };\n}\n",
20
- "import { useContext } from \"react\";\nimport { ClientRouterContext } from \"./ClientRouterContext\";\n\nexport function useParams() {\n const { params } = useContext(ClientRouterContext);\n return params;\n}\n",
21
- "import { createContext, lazy, type PropsWithChildren } from \"react\";\nimport { type ServerDataContextValue } from \"./ServerDataProvider\";\nimport { flattenComponentTree } from \"./helpers/flattenComponentTree\";\n\nlet viewImportMap: Record<string, ReturnType<typeof lazy>> | null = null;\nif (typeof window !== \"undefined\" && process.env.NODE_ENV !== \"test\") {\n viewImportMap = {};\n const { componentTree } = (window as any)\n .__GEMI_DATA__ as ServerDataContextValue;\n\n for (const viewName of flattenComponentTree(componentTree)) {\n viewImportMap[viewName] = lazy((window as any).loaders[viewName]);\n }\n}\n\nexport const ComponentsContext = createContext({ viewImportMap });\n\nexport const ComponentsProvider = (\n props: PropsWithChildren<{ viewImportMap: typeof viewImportMap }>,\n) => {\n return (\n <ComponentsContext.Provider\n value={{ viewImportMap: props.viewImportMap ?? viewImportMap }}\n >\n {props.children}\n </ComponentsContext.Provider>\n );\n};\n",
22
- "import type { ComponentTree } from \"../types\";\n\nexport function flattenComponentTree(componentTree: ComponentTree): string[] {\n let out: string[] = [];\n for (const [root, branches] of componentTree) {\n out.push(root, ...flattenComponentTree(branches).flat());\n }\n return Array.from(new Set(out));\n}\n",
23
- "import {\n createContext,\n type PropsWithChildren,\n useEffect,\n useRef,\n} from \"react\";\n\ntype Subscribe = (\n topic: string,\n handler: (event: any) => void,\n) => Promise<void>;\n\nexport const WebSocketContext = createContext(\n {} as {\n broadcast: (topic: string, payload: Record<string, any>) => void;\n subscribe: Subscribe;\n unsubscribe: (\n topic: string,\n handler: (event: any) => void,\n ) => Promise<void>;\n },\n);\n\nexport const WebSocketContextProvider = (props: PropsWithChildren) => {\n const wsRef = useRef<WebSocket>(null);\n\n function getWS() {\n return new Promise<WebSocket>((resolve) => {\n if (wsRef.current) {\n resolve(wsRef.current);\n } else {\n const ws = new WebSocket(\"ws://localhost:5173/\");\n ws.onopen = () => {\n wsRef.current = ws;\n ws.addEventListener(\"close\", () => {\n wsRef.current = null;\n });\n resolve(ws);\n };\n }\n });\n }\n\n const subscribe = async (\n topic: string,\n handler: (event: MessageEvent<any>) => void,\n ) => {\n const ws = await getWS();\n ws.send(JSON.stringify({ type: \"subscribe\", topic }));\n ws.addEventListener(\"message\", handler);\n };\n\n const unsubscribe = async (\n topic: string,\n handler: (event: MessageEvent<any>) => void,\n ) => {\n const ws = await getWS();\n ws.send(JSON.stringify({ type: \"unsubscribe\", topic }));\n ws.removeEventListener(\"message\", handler);\n };\n\n const broadcast = async (topic: string, payload = {}) => {\n const ws = await getWS();\n ws.send(\n JSON.stringify({\n type: \"broadcast\",\n topic,\n payload,\n }),\n );\n };\n\n useEffect(() => {\n return () => {\n if (wsRef.current) {\n wsRef.current.close();\n wsRef.current = null;\n }\n };\n }, []);\n\n return (\n <WebSocketContext.Provider value={{ subscribe, unsubscribe, broadcast }}>\n {props.children}\n </WebSocketContext.Provider>\n );\n};\n",
24
- "import { type ComponentType } from \"react\";\n\nimport { ClientRouter } from \"./ClientRouter\";\nimport { ServerDataProvider } from \"./ServerDataProvider\";\n\nexport function createRoot(RootLayout: ComponentType<any>) {\n return (props: any) => (\n <ServerDataProvider value={props.data}>\n <ClientRouter\n RootLayout={RootLayout}\n viewImportMap={props.viewImportMap}\n />\n </ServerDataProvider>\n );\n}\n",
25
- "import { HttpRequest } from \"../../http\";\nimport type { ViewRoutes } from \"../../http/ViewRouter\";\n\nexport type ViewRouteExec = (req: HttpRequest<any, any>) => any; // TODO: fix type\n\nexport type FlatViewRoutes = Record<\n string,\n { exec: ViewRouteExec[]; middleware: (string | any)[] }\n>;\n\nexport function createFlatViewRoutes(routes: ViewRoutes) {\n const flatRoutes: FlatViewRoutes = {};\n\n for (const [routePath, viewConfigOrViewRouter] of Object.entries(routes)) {\n if (\"run\" in viewConfigOrViewRouter) {\n const route = viewConfigOrViewRouter;\n\n if (\"children\" in route) {\n const children = new route.children();\n const result = createFlatViewRoutes(children.routes);\n\n for (const [path, { exec, middleware }] of Object.entries(result)) {\n const key = routePath === \"/\" ? path : `${routePath}${path}`;\n const _key = path === \"/\" && routePath !== \"/\" ? routePath : key;\n\n flatRoutes[_key] = {\n exec: [route.run.bind(route), ...exec],\n middleware: [...route.middlewares, ...middleware],\n };\n }\n } else {\n flatRoutes[routePath] = {\n exec: [route.run.bind(route)],\n middleware: route.middlewares,\n };\n }\n } else {\n const router = new viewConfigOrViewRouter();\n const result = createFlatViewRoutes(router.routes);\n for (const [path, { exec, middleware }] of Object.entries(result)) {\n const key = routePath === \"/\" ? path : `${routePath}${path}`;\n const _key = path === \"/\" && routePath !== \"/\" ? routePath : key;\n flatRoutes[_key] = {\n exec,\n middleware: [...router.middlewares, ...middleware],\n };\n }\n }\n }\n\n return Object.fromEntries(\n Object.entries(flatRoutes).sort(([a], [b]) => {\n const x = a.split(\"/\").length + a.split(\":\").length;\n const y = b.split(\"/\").length + b.split(\":\").length;\n return x - y;\n }),\n );\n}\n",
26
- "import { HttpRequest } from \"../../http\";\nimport { createRoot } from \"../../client/createRoot\";\n\nimport { Cookie } from \"../../http/Cookie\";\nimport { GEMI_REQUEST_BREAKER_ERROR } from \"../../http/Error\";\nimport { RequestContext } from \"../../http/requestContext\";\nimport type { RouterMiddleware } from \"../../http/Router\";\nimport {\n createFlatViewRoutes,\n FlatViewRoutes,\n type ViewRouteExec,\n} from \"./createFlatViewRoutes\";\nimport { ViewRouterServiceProvider } from \"./ViewRouterServiceProvider\";\n// @ts-ignore\nimport { renderToReadableStream } from \"react-dom/server.browser\";\nimport { createElement, Fragment } from \"react\";\n\n// @ts-ignore\nimport { URLPattern } from \"urlpattern-polyfill/urlpattern\";\nimport { ServiceContainer } from \"../ServiceContainer\";\nimport type { ViewRoutes } from \"../../http/ViewRouter\";\nimport { AuthViewRouter } from \"../../auth/AuthenticationServiceProvider\";\nimport { createRouteManifest } from \"./createRouteManifest\";\nimport { createComponentTree } from \"./createComponentTree\";\nimport { flattenComponentTree } from \"../../client/helpers/flattenComponentTree\";\nimport type { ComponentTree } from \"../../client/types\";\nimport { I18nServiceContainer } from \"../../http/I18nServiceContainer\";\nimport { MiddlewareServiceContainer } from \"../middleware/MiddlewareServiceContainer\";\n\nexport class ViewRouterServiceContainer extends ServiceContainer {\n static _name = \"ViewRouterServiceContainer\";\n\n flatViewRoutes: FlatViewRoutes = {};\n routeManifest: Record<string, string[]> = {};\n componentTree: ComponentTree = [];\n flatComponentTree: string[] = [];\n RootLayout: any = null;\n\n constructor(public service: ViewRouterServiceProvider) {\n super();\n const routes: ViewRoutes = {\n \"/\": service.rootRouter,\n \"/auth\": AuthViewRouter,\n };\n this.flatViewRoutes = createFlatViewRoutes(routes);\n this.routeManifest = createRouteManifest(routes);\n this.componentTree = createComponentTree(routes);\n this.flatComponentTree = flattenComponentTree(this.componentTree);\n this.RootLayout = createRoot(service.rootLayout);\n }\n\n boot() {}\n\n async handleViewRequest(req: Request) {\n const url = new URL(req.url);\n const isViewDataRequest = url.searchParams.get(\"json\");\n\n let pageData: {\n cookies: Set<Cookie>;\n headers: Headers;\n currentPathName: string;\n data: Record<string, any>;\n prefetchedData: Record<string, any>;\n user: any; // TODO: fix type\n params: Record<string, any>;\n } | null = null;\n\n try {\n let handlers: ViewRouteExec[] = [];\n let middlewares: (RouterMiddleware | string)[] = [];\n let currentPathName: null | string = null;\n let params: Record<string, any> = {};\n\n for (const [pathname, handler] of Object.entries(this.flatViewRoutes)) {\n const pattern = new URLPattern({ pathname });\n if (pattern.test({ pathname: url.pathname })) {\n currentPathName = pathname;\n params = pattern.exec({ pathname: url.pathname })?.pathname.groups!;\n handlers = handler.exec;\n middlewares = handler.middleware;\n break;\n }\n }\n\n const httpRequest = new HttpRequest(req, params);\n const { data, cookies, headers, user, prefetchedData } =\n await RequestContext.run(httpRequest, async () => {\n const ctx = RequestContext.getStore();\n ctx.setRequest(httpRequest);\n\n await MiddlewareServiceContainer.use().runMiddleware(\n middlewares,\n currentPathName,\n );\n\n const data = await Promise.all([\n ...handlers.map((fn) => fn(httpRequest as any)),\n ...Array.from(ctx.prefetchPromiseQueue).map((fn) => fn()),\n ]);\n\n const cookies = ctx.cookies;\n const headers = ctx.headers;\n const prefetchedResources = ctx.prefetchedResources;\n\n return {\n data,\n cookies,\n headers,\n user: ctx.user,\n prefetchedData: Object.fromEntries(prefetchedResources.entries()),\n };\n });\n\n pageData = {\n data,\n prefetchedData,\n currentPathName,\n user,\n params,\n cookies,\n headers,\n };\n } catch (err) {\n if (err.kind === GEMI_REQUEST_BREAKER_ERROR) {\n if (isViewDataRequest) {\n const { status = 400, data, directive, headers } = err.payload.api;\n return new Response(JSON.stringify({ data, directive }), {\n headers,\n status,\n });\n } else {\n const { status = 400, error } = err.payload.view;\n return new Response(error?.message, {\n ...err.payload.view,\n status,\n });\n }\n } else {\n throw err;\n }\n }\n\n const { data, params, currentPathName, user, cookies } = pageData;\n\n const viewData = data.reduce((acc, data) => {\n return {\n ...acc,\n ...data,\n };\n }, {});\n const i18nServiceContainer = I18nServiceContainer.use();\n const isI18nEnabled = i18nServiceContainer.isEnabled;\n let i18n: Record<string, any> = {};\n if (isI18nEnabled) {\n const locale = i18nServiceContainer.detectLocale(\n new HttpRequest(req, params as any),\n );\n const translations = i18nServiceContainer.getPageTranslations(\n locale,\n currentPathName,\n );\n\n i18n = {\n supportedLocales: i18nServiceContainer.supportedLocales,\n currentLocale: locale,\n dictionary: {\n [locale]: translations,\n },\n };\n }\n\n if (isViewDataRequest) {\n const headers = new Headers();\n headers.set(\"Content-Type\", \"application/json\");\n\n cookies.forEach((cookie) =>\n headers.append(\"Set-Cookie\", cookie.toString()),\n );\n\n headers.append(\n \"Cache-Control\",\n user\n ? \"private, no-cache, no-store, max-age=0, must-revalidate\"\n : \"public, max-age=864000, must-revalidate\",\n );\n\n return new Response(\n JSON.stringify({\n data: {\n [url.pathname]: viewData,\n },\n prefetchedData: pageData.prefetchedData,\n i18n,\n is404: !currentPathName,\n }),\n {\n headers,\n },\n );\n }\n\n const headers = new Headers();\n headers.set(\"Content-Type\", \"text/html\");\n headers.set(\n \"Cache-Control\",\n user\n ? \"private, no-cache, no-store, max-age=0, must-revalidate\"\n : \"public, max-age=864000, must-revalidate\",\n );\n headers.set(\"ETag\", 'W/\"' + Math.random().toString(36).substring(7) + '\"');\n\n pageData.cookies.forEach((cookie) =>\n headers.append(\"Set-Cookie\", cookie.toString()),\n );\n\n const result = {\n kind: \"view\",\n data: {\n pageData: {\n [url.pathname]: viewData,\n },\n prefetchedData: pageData.prefetchedData,\n i18n,\n auth: { user },\n routeManifest: this.routeManifest,\n router: {\n pathname: currentPathName,\n params,\n currentPath: url.pathname,\n searchParams: url.search,\n is404: !currentPathName ? true : false,\n },\n componentTree: [[\"404\", []], ...this.componentTree],\n },\n head: {},\n };\n const Root = this.RootLayout;\n return async (params: {\n styles: any[];\n viewImportMap: any;\n bootstrapModules: string[];\n loaders: string;\n }) => {\n const { bootstrapModules, loaders, styles, viewImportMap } = params;\n const stream = await renderToReadableStream(\n createElement(Fragment, {\n children: [\n styles,\n createElement(Root as any, {\n data: result.data,\n viewImportMap,\n }),\n ],\n }),\n {\n bootstrapScriptContent: `window.__GEMI_DATA__ = ${JSON.stringify(result.data)}; window.loaders=${loaders}`,\n bootstrapModules,\n },\n );\n\n return new Response(stream, {\n status: !currentPathName ? 404 : 200,\n headers,\n });\n };\n }\n}\n",
27
- "import type { ViewRoutes } from \"../../http/ViewRouter\";\n\nexport function createRouteManifest(routes: ViewRoutes) {\n const routeManifest: Record<string, string[]> = {};\n for (const [routePath, routeHandler] of Object.entries(routes)) {\n if (\"run\" in routeHandler) {\n const viewPath = routeHandler.viewPath;\n\n if (\"children\" in routeHandler) {\n routeManifest[routePath] = [viewPath];\n }\n\n if (\"children\" in routeHandler) {\n const children = new routeHandler.children();\n const manifest = createRouteManifest(children.routes);\n for (const [path, viewPaths] of Object.entries(manifest)) {\n const key = routePath === \"/\" ? path : `${routePath}${path}`;\n const _key = path === \"/\" && routePath !== \"/\" ? routePath : key;\n routeManifest[_key] = [viewPath, ...viewPaths];\n }\n } else {\n routeManifest[routePath] = [viewPath];\n }\n } else {\n const router = new routeHandler();\n\n const manifest = createRouteManifest(router.routes);\n for (const [path, viewPaths] of Object.entries(manifest)) {\n const key = routePath === \"/\" ? path : `${routePath}${path}`;\n const _key = path === \"/\" && routePath !== \"/\" ? routePath : key;\n routeManifest[_key] = viewPaths;\n }\n }\n }\n\n return routeManifest;\n}\n",
28
- "import type { ComponentTree } from \"../../client/types\";\nimport type { ViewRoutes } from \"../../http/ViewRouter\";\n\nexport function createComponentTree(routes: ViewRoutes): ComponentTree {\n const componentTree: ComponentTree = [];\n\n for (const [_, routeHandler] of Object.entries(routes)) {\n if (\"run\" in routeHandler) {\n const viewPath = routeHandler.viewPath;\n if (\"children\" in routeHandler) {\n const router = new routeHandler.children();\n const branch = createComponentTree(router.routes);\n componentTree.push([viewPath, branch]);\n } else {\n componentTree.push([viewPath, []]);\n }\n } else {\n const router = new routeHandler();\n const branch = createComponentTree(router.routes);\n componentTree.push(...branch);\n }\n }\n\n return componentTree;\n}\n"
29
- ],
30
- "mappings": "6NAAA,YACE,mBACA,kBACA,eACA,iBACA,gBCLF,wBAAS,iEA6BF,IAAM,EAAoB,GAAc,CAAC,CAA2B,EAM9D,GAAqB,CAChC,IACG,CACH,IAAI,EAAS,EAAM,MAEnB,GAAI,EAAM,MACR,EAAS,EAAM,UAGf,GAAU,OAAe,cAG3B,OACE,GAEE,EAAkB,SAFpB,CAA4B,MAAO,EAAnC,SACG,EAAM,UADT,qBAEE,GClDN,IAAS,UAAQ,EAAG,CAClB,OAAO,EAAW,OAAO,OAAS,OAAO,OAAO,KAAK,UAAa,CAAC,EAAG,CACpE,QAAS,EAAI,EAAG,EAAI,UAAU,OAAQ,IAAK,CACzC,IAAI,EAAI,UAAU,GAClB,QAAS,KAAK,EAAG,CAAC,CAAC,GAAG,eAAe,KAAK,EAAG,CAAC,IAAM,EAAE,GAAK,EAAE,IAE/D,OAAO,GACN,EAAS,MAAM,KAAM,SAAS,GCgCnC,IAAS,WAAO,CAAC,EAAM,EAAS,CAC9B,IAAK,EAAM,CAET,UAAW,UAAY,YAAa,QAAQ,KAAK,CAAO,EAExD,GAAI,CAMF,MAAM,IAAI,MAAM,CAAO,QAChB,EAAP,KAeG,WAAoB,CAAC,EAAS,CACrC,GAAI,IAAiB,OACnB,EAAU,CAAC,EAGb,IAAI,EA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