@powerhousedao/connect 2.5.0-dev.3 → 2.5.0-dev.4

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 (27) hide show
  1. package/dist/assets/{app-R_6VkV-i.js → app-BlymZ5Eu.js} +12 -12
  2. package/dist/assets/{app-R_6VkV-i.js.map → app-BlymZ5Eu.js.map} +1 -1
  3. package/dist/assets/{app-loader-BqDKSWeo.js → app-loader-ixWvr7hN.js} +5 -5
  4. package/dist/assets/{app-loader-BqDKSWeo.js.map → app-loader-ixWvr7hN.js.map} +1 -1
  5. package/dist/assets/{browser-B5rZXuuP.js → browser-B6tMdw9J.js} +4 -4
  6. package/dist/assets/{browser-B5rZXuuP.js.map → browser-B6tMdw9J.js.map} +1 -1
  7. package/dist/assets/{ccip-DYPncP4a.js → ccip-Dk_lnFB_.js} +4 -4
  8. package/dist/assets/{ccip-DYPncP4a.js.map → ccip-Dk_lnFB_.js.map} +1 -1
  9. package/dist/assets/{content-CqQsxb96.js → content-DcYVugrw.js} +5 -5
  10. package/dist/assets/{content-CqQsxb96.js.map → content-DcYVugrw.js.map} +1 -1
  11. package/dist/assets/{index-DeVw0J3r.js → index-9aPeo-3X.js} +4 -4
  12. package/dist/assets/{index-DeVw0J3r.js.map → index-9aPeo-3X.js.map} +1 -1
  13. package/dist/assets/{index-B-awMWKA.js → index-BUFRY29m.js} +4 -4
  14. package/dist/assets/{index-B-awMWKA.js.map → index-BUFRY29m.js.map} +1 -1
  15. package/dist/assets/{index-Dy2GF7uR.js → index-CFjTkH76.js} +5 -5
  16. package/dist/assets/{index-Dy2GF7uR.js.map → index-CFjTkH76.js.map} +1 -1
  17. package/dist/assets/{index-CGBYqZMC.js → index-CbtP3DgS.js} +4 -4
  18. package/dist/assets/{index-CGBYqZMC.js.map → index-CbtP3DgS.js.map} +1 -1
  19. package/dist/assets/{main.CqK46g1u.js → main.lh1_RAtn.js} +2 -2
  20. package/dist/assets/{main.CqK46g1u.js.map → main.lh1_RAtn.js.map} +1 -1
  21. package/dist/assets/{reactor-analytics-CDTPdqJ9.js → reactor-analytics-C979Gj9N.js} +6 -6
  22. package/dist/assets/{reactor-analytics-CDTPdqJ9.js.map → reactor-analytics-C979Gj9N.js.map} +1 -1
  23. package/dist/assets/{router-hU0bX-QU.js → router-C-P_hJmM.js} +6 -6
  24. package/dist/assets/{router-hU0bX-QU.js.map → router-C-P_hJmM.js.map} +1 -1
  25. package/dist/index.html +1 -1
  26. package/dist/vite-envs.sh +1 -1
  27. package/package.json +9 -9
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;;;AAEO,MAAM,iBAAiB,CAAC,EAAE,UAAU,cAAc;AACrD,SAAQA,KAAM,SAAS,EAAE,UAAU,CAACC,IAAK,gBAAgB,EAAE,SAAS,MAAM,UAAUA,IAAK,OAAO,EAAE,WAAW,kBAAkB,SAAkB,CAAE,EAAC,CAAE,GAAGA,IAAK,gBAAgB,EAAE,WAAW,YAAY,OAAO,SAAS,UAAU,QAAS,EAAC,EAAC,CAAE;AAClP;ACDO,SAAS,cAAc,EAAE,WAAW,GAAG,SAAS;AACnD,SAAOA,IAAK,OAAO,EAAE,WAAW,QAAQ,YAAY,SAAS,GAAG,GAAG,OAAO;AAC9E;AACO,SAAS,cAAc,EAAE,WAAW,GAAG,SAAS;AACnD,SAAOA,IAAK,OAAO,EAAE,WAAW,QAAQ,YAAY,SAAS,GAAG,GAAG,OAAO;AAC9E;AACO,MAAMC,YAAU,CAAC,EAAE,WAAW,SAAS,WAAW,QAAQ,WAAW,UAAU,GAAG,YAAY;AACjG,QAAM,MAAM,OAAO,IAAI;AACvB,SAAQD,IAAK,OAAO,EAAE,GAAG,OAAO,WAAW,QAAQ,0CAA0C,SAAS,GAAG,KAAU,OAAO;AAAA,IAClH,OAAO;AAAA,EACnB,GAAW,UAAoB;AAC/B;ACXO,SAAS,aAAa,EAAE,WAAW,UAAU,GAAG,MAAK,GAAI;AAC5D,QAAM,CAAC,WA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AACJ;AAEA,MAAM,SAAS,aAAa;AAE5B,MAAM,cAAc,YAAY;AACtB,QAAAG,UAAS,MAAM,aAAa,MAAM;AAExC,QAAM0B,UAAS,MAAO,sCAAe,QAAA1B,QAAgB;AAC9C,SAAA0B;AACX","names":["_jsxs","_jsx","Sidebar","_Fragment","viem_getEnsAvatar","viem_getEnsName","CoreError","tanstack_useQuery","HomeScreen","HomeScreenItem","HomeScreenAddDriveItem","SidebarItem","SidebarAddDriveItem","toast","drive","routes","createRouter","UNSAFE_ErrorResponseImpl","router","t","transition","navigator","state","UNSAFE_logV6DeprecationWarnings","UNSAFE_DataRouterContext","UNSAFE_DataRouterStateContext","UNSAFE_useRoutesImpl","DataRouterHook","DataRouterStateHook","location","baseToast","connectConfig","driveNodes","prevDrive","documentDrives","selectedNodeFromPathname","documentId","driveId","error","AtlasIcon","RefreshIcon","IconLogo","IconConnect","React","Router"],"ignoreList":[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,41,48],"sources":["../../../../packages/design-system/dist/src/connect/components/account-popover/account-popover.js","../../../../packages/design-system/dist/src/powerhouse/components/sidebar/sidebar.js","../../../../packages/design-system/dist/src/powerhouse/components/sidebar/sidebar-panel.js","../../../../packages/design-system/dist/src/connect/components/account-popover/account-popover-login.js","../../../../packages/design-system/dist/src/connect/components/account-popover/account-popover-user.js","../../../../packages/reactor-browser/dist/src/hooks/useSwitchboard.js","../../../../packages/design-system/dist/src/assets/powerhouse-rounded.png","../../../../node_modules/.pnpm/@wagmi+core@2.17.2_@tanstack+query-core@5.77.1_@types+react@18.3.22_immer@9.0.21_react@_cfd742b94b840c743456c5130a9de7ee/node_modules/@wagmi/core/dist/esm/utils/getAction.js","../../../../node_modules/.pnpm/@wagmi+core@2.17.2_@tanstack+query-core@5.77.1_@types+react@18.3.22_immer@9.0.21_react@_cfd742b94b840c743456c5130a9de7ee/node_modules/@wagmi/core/dist/esm/actions/getChainId.js","../../../../node_modules/.pnpm/@wagmi+core@2.17.2_@tanstack+query-core@5.77.1_@types+react@18.3.22_immer@9.0.21_react@_cfd742b94b840c743456c5130a9de7ee/node_modules/@wagmi/core/dist/esm/actions/getEnsAvatar.js","../../../../node_modules/.pnpm/@wagmi+core@2.17.2_@tanstack+query-core@5.77.1_@types+react@18.3.22_immer@9.0.21_react@_cfd742b94b840c743456c5130a9de7ee/node_modules/@wagmi/core/dist/esm/actions/getEnsName.js","../../../../node_modules/.pnpm/@wagmi+core@2.17.2_@tanstack+query-core@5.77.1_@types+react@18.3.22_immer@9.0.21_react@_cfd742b94b840c743456c5130a9de7ee/node_modules/@wagmi/core/dist/esm/actions/watchChainId.js","../../../../node_modules/.pnpm/wagmi@2.15.4_@tanstack+query-core@5.77.1_@tanstack+react-query@5.77.1_react@18.3.1__@ty_567784dc4225e9da9f9c587961226b2e/node_modules/wagmi/dist/esm/version.js","../../../../node_modules/.pnpm/wagmi@2.15.4_@tanstack+query-core@5.77.1_@tanstack+react-query@5.77.1_react@18.3.1__@ty_567784dc4225e9da9f9c587961226b2e/node_modules/wagmi/dist/esm/utils/getVersion.js","../../../../node_modules/.pnpm/wagmi@2.15.4_@tanstack+query-core@5.77.1_@tanstack+react-query@5.77.1_react@18.3.1__@ty_567784dc4225e9da9f9c587961226b2e/node_modules/wagmi/dist/esm/errors/base.js","../../../../node_modules/.pnpm/wagmi@2.15.4_@tanstack+query-core@5.77.1_@tanstack+react-query@5.77.1_react@18.3.1__@ty_567784dc4225e9da9f9c587961226b2e/node_modules/wagmi/dist/esm/errors/context.js","../../../../node_modules/.pnpm/wagmi@2.15.4_@tanstack+query-core@5.77.1_@tanstack+react-query@5.77.1_react@18.3.1__@ty_567784dc4225e9da9f9c587961226b2e/node_modules/wagmi/dist/esm/hooks/useConfig.js","../../../../node_modules/.pnpm/@wagmi+core@2.17.2_@tanstack+query-core@5.77.1_@types+react@18.3.22_immer@9.0.21_react@_cfd742b94b840c743456c5130a9de7ee/node_modules/@wagmi/core/dist/esm/query/utils.js","../../../../node_modules/.pnpm/@wagmi+core@2.17.2_@tanstack+query-core@5.77.1_@types+react@18.3.22_immer@9.0.21_react@_cfd742b94b840c743456c5130a9de7ee/node_modules/@wagmi/core/dist/esm/query/getEnsAvatar.js","../../../../node_modules/.pnpm/@wagmi+core@2.17.2_@tanstack+query-core@5.77.1_@types+react@18.3.22_immer@9.0.21_react@_cfd742b94b840c743456c5130a9de7ee/node_modules/@wagmi/core/dist/esm/query/getEnsName.js","../../../../node_modules/.pnpm/wagmi@2.15.4_@tanstack+query-core@5.77.1_@tanstack+react-query@5.77.1_react@18.3.1__@ty_567784dc4225e9da9f9c587961226b2e/node_modules/wagmi/dist/esm/utils/query.js","../../../../node_modules/.pnpm/wagmi@2.15.4_@tanstack+query-core@5.77.1_@tanstack+react-query@5.77.1_react@18.3.1__@ty_567784dc4225e9da9f9c587961226b2e/node_modules/wagmi/dist/esm/hooks/useChainId.js","../../../../node_modules/.pnpm/wagmi@2.15.4_@tanstack+query-core@5.77.1_@tanstack+react-query@5.77.1_react@18.3.1__@ty_567784dc4225e9da9f9c587961226b2e/node_modules/wagmi/dist/esm/hooks/useEnsAvatar.js","../../../../node_modules/.pnpm/wagmi@2.15.4_@tanstack+query-core@5.77.1_@tanstack+react-query@5.77.1_react@18.3.1__@ty_567784dc4225e9da9f9c587961226b2e/node_modules/wagmi/dist/esm/hooks/useEnsName.js","../../../../packages/design-system/dist/src/connect/components/ens-avatar/ens-avatar.js","../../../../packages/design-system/dist/src/assets/home-bg.png","../../../../packages/design-system/dist/src/connect/components/home-screen/home-screen.js","../../../../packages/design-system/dist/src/connect/components/home-screen/home-screen-item/home-screen-item.js","../../../../packages/design-system/dist/src/connect/components/home-screen/home-screen-add-drive-item/home-screen-add-drive-item.js","../../../../packages/design-system/dist/src/assets/renown-short-hover.png","../../../../packages/design-system/dist/src/assets/renown-short.png","../../../../packages/design-system/dist/src/connect/components/sidebar/sidebar-login.js","../../../../packages/design-system/dist/src/connect/components/sidebar/sidebar-user.js","../../../../packages/design-system/dist/src/connect/components/sidebar/sidebar-footer.js","../../../../packages/design-system/dist/src/connect/components/sidebar/sidebar-header.js","../../../../packages/design-system/dist/src/connect/components/sidebar/sidebar.js","../../../../packages/design-system/dist/src/connect/components/sidebar/sidebar-item.js","../../../../packages/design-system/dist/src/connect/components/sidebar/sidebar-add-drive-item.js","../../src/hooks/useUiNodes.ts","../../src/hooks/modals.ts","../../src/hooks/useClientErrorHandler.ts","../../../../node_modules/.pnpm/react-router-dom@6.30.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-router-dom/dist/index.js","../../src/services/toast.tsx","../../src/hooks/useLoadInitialData.tsx","../../src/hooks/useNodeNavigation.ts","../../assets/icons/Atlas-Logomark.svg?react","../../assets/icons/refresh.svg?react","../../src/components/demo/atlas-import.tsx","../../../../node_modules/.pnpm/react-error-boundary@4.1.2_react@18.3.1/node_modules/react-error-boundary/dist/react-error-boundary.esm.js","../../assets/icons/connect.svg?react","../../assets/icons/logo.svg?react","../../src/components/sidebar.tsx","../../src/components/root.tsx","../../src/components/toast/reload-connect-toast.tsx","../../src/pages/home.tsx","../../src/components/router.tsx"],"sourcesContent":["import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { Popover, PopoverContent, PopoverTrigger, } from \"../../../scalars/components/fragments/popover/popover.js\";\nexport const AccountPopover = ({ children, content }) => {\n return (_jsxs(Popover, { children: [_jsx(PopoverTrigger, { asChild: true, children: _jsx(\"div\", { className: \"cursor-pointer\", children: children }) }), _jsx(PopoverContent, { className: \"w-52 p-0\", align: \"start\", children: content })] }));\n};\n//# sourceMappingURL=account-popover.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useRef } from \"react\";\nimport { twMerge } from \"tailwind-merge\";\nexport function SidebarHeader({ className, ...props }) {\n return _jsx(\"div\", { className: twMerge(\"shrink-0\", className), ...props });\n}\nexport function SidebarFooter({ className, ...props }) {\n return _jsx(\"div\", { className: twMerge(\"shrink-0\", className), ...props });\n}\nexport const Sidebar = ({ maxWidth = \"304px\", minWidth = \"80px\", className, children, ...props }) => {\n const ref = useRef(null);\n return (_jsx(\"div\", { ...props, className: twMerge(`group flex h-full flex-col bg-slate-50`, className), ref: ref, style: {\n width: minWidth,\n }, children: children }));\n};\n//# sourceMappingURL=sidebar.js.map","import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { useEffect, useRef, useState } from \"react\";\nimport { twMerge } from \"tailwind-merge\";\nexport function SidebarPanel({ className, children, ...props }) {\n const [hasScroll, setHasScroll] = useState(false);\n function checkContentScroll(target) {\n setHasScroll(target.scrollHeight - target.scrollTop - target.clientHeight > 1);\n }\n const containerRef = useRef(null);\n // listen for resize events to update shadow\n useEffect(() => {\n if (!containerRef.current) {\n return;\n }\n const observer = new ResizeObserver((entries) => {\n const entry = entries.pop();\n if (!entry) {\n return;\n }\n const { target } = entry;\n checkContentScroll(target);\n });\n observer.observe(containerRef.current);\n return () => {\n observer.disconnect();\n };\n }, [containerRef.current]);\n return (_jsxs(_Fragment, { children: [_jsx(\"div\", { className: twMerge(\"no-scrollbar flex-1 overflow-auto text-gray-900 transition-shadow\", className), onScroll: (e) => checkContentScroll(e.currentTarget), ref: containerRef, ...props, children: children }), hasScroll ? (_jsx(\"div\", { className: \"pointer-events-none z-10 -mt-12 h-12 w-full\", style: {\n boxShadow: \"inset 0px -33px 32px -16px rgba(0,0,0,0.1)\",\n } })) : null] }));\n}\n//# sourceMappingURL=sidebar-panel.js.map","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { Icon } from \"#powerhouse\";\nimport { useState } from \"react\";\nexport const AccountPopoverLogin = ({ onLogin, }) => {\n const [loading, setLoading] = useState(false);\n const content = loading ? (_jsx(Icon, { name: \"Reload\", size: 14, className: \"animate-spin\" })) : (_jsx(\"span\", { children: \"Connect\" }));\n const handleLogin = () => {\n setLoading(true);\n onLogin();\n };\n return (_jsxs(\"div\", { className: \"p-4\", children: [_jsx(\"div\", { className: \"mb-4 flex justify-center\", children: _jsx(\"div\", { className: \"flex h-[22px] w-[83px] items-center justify-center overflow-hidden\", children: _jsx(Icon, { name: \"RenownLight\", size: 83 }) }) }), _jsx(\"button\", { onClick: handleLogin, className: \"mt-4 flex h-7 w-full cursor-pointer items-center justify-center rounded-lg border border-gray-300 bg-transparent text-sm active:opacity-70\", type: \"button\", children: content })] }));\n};\n//# sourceMappingURL=account-popover-login.js.map","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { Button, Icon } from \"#powerhouse\";\nimport { useCallback, useState } from \"react\";\n// short eth address\nconst shortAddress = (address) => `${address.slice(0, 7)}...${address.slice(-5)}`;\nexport const AccountPopoverUser = ({ address, onDisconnect, etherscanUrl, username = \"\", }) => {\n const [isCopied, setIsCopied] = useState(false);\n const copyToClipboard = useCallback(async (text) => {\n try {\n await navigator.clipboard.writeText(text);\n setIsCopied(true);\n setTimeout(() => setIsCopied(false), 2000);\n }\n catch (err) {\n console.error(\"Failed to copy address:\", err);\n }\n }, []);\n return (_jsxs(\"div\", { className: \"flex flex-col divide-y divide-gray-200 text-gray-900\", children: [_jsxs(\"div\", { className: \"px-3 py-2\", children: [username && _jsx(\"div\", { className: \"text-sm font-medium\", children: username }), _jsx(\"div\", { className: \"mt-1 flex items-center gap-2\", children: _jsx(Button, { size: \"small\", color: \"light\", onClick: copyToClipboard.bind(null, address), className: \"w-full cursor-pointer bg-transparent p-0 active:opacity-70\", type: \"button\", children: _jsxs(\"div\", { className: \"relative flex w-full items-center gap-1\", children: [_jsxs(\"div\", { className: `flex items-center gap-1 transition-opacity duration-150 ${isCopied ? \"opacity-0\" : \"opacity-100\"}`, children: [_jsx(\"span\", { className: \"text-xs\", children: shortAddress(address) }), _jsx(Icon, { name: \"FilesEarmark\", color: \"#9EA0A1\", size: 14 })] }), _jsx(\"div\", { className: `absolute left-0 text-xs transition-opacity duration-150 ${isCopied ? \"opacity-100\" : \"opacity-0\"}`, children: \"Copied to clipboard!\" })] }) }) })] }), etherscanUrl && (_jsx(\"div\", { className: \"px-3 py-2\", children: _jsxs(\"a\", { href: etherscanUrl, target: \"_blank\", rel: \"noopener noreferrer\", className: \"flex items-center gap-2 text-sm text-gray-900 hover:text-gray-600\", children: [_jsx(Icon, { name: \"Ethscan\", size: 14 }), \"View on Etherscan\"] }) })), _jsx(\"div\", { className: \"px-3 py-2\", children: _jsxs(\"button\", { onClick: onDisconnect, className: \"flex w-full cursor-pointer items-center gap-2 text-sm text-red-900 hover:text-red-700\", type: \"button\", children: [_jsx(Icon, { name: \"Disconnect\", size: 14, color: \"#EA4335\" }), \"Disconnect\"] }) })] }));\n};\n//# sourceMappingURL=account-popover-user.js.map","import { generateDocumentStateQueryFields } from \"document-drive/utils/graphql\";\nexport function useSwitchboard(reactor) {\n return {\n getDriveIdBySlug: async (driveUrl, slug) => {\n if (!driveUrl) {\n return;\n }\n const urlParts = driveUrl.split(\"/\");\n urlParts.pop(); // remove id\n urlParts.pop(); // remove /d\n urlParts.push(\"drives\"); // add /drives\n const drivesUrl = urlParts.join(\"/\");\n const result = await fetch(drivesUrl, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n query: `\n query getDriveIdBySlug($slug: String!) {\n driveIdBySlug(slug: $slug)\n }\n `,\n variables: {\n slug,\n },\n }),\n });\n const data = (await result.json());\n return data.data.driveIdBySlug;\n },\n getSwitchboardGatewayUrl: (driveUrl) => {\n const urlParts = driveUrl.split(\"/\");\n urlParts.pop(); // remove id\n urlParts.pop(); // remove /d\n urlParts.push(\"graphql\"); // add /graphql\n return urlParts.join(\"/\");\n },\n getDocumentGraphqlQuery: async (driveId, documentId) => {\n const doc = await reactor.getDocument(driveId, documentId);\n const docModel = reactor\n .getDocumentModelModules()\n .find((m) => m.documentModel.id === doc.documentType);\n if (!docModel) {\n throw new Error(\"Document model not found\");\n }\n const stateFields = generateDocumentStateQueryFields(docModel.documentModel, \"document\");\n return `\n query getDocument($documentId: String!) {\n ${docModel.documentModel.name} {\n getDocument(id: $documentId) {\n ${stateFields}\n }\n }\n }\n `;\n },\n };\n}\n//# sourceMappingURL=useSwitchboard.js.map","export default \"__VITE_ASSET__D8iUkzAT__\"","/**\n * Retrieves and returns an action from the client (if exists), and falls\n * back to the tree-shakable action.\n *\n * Useful for extracting overridden actions from a client (ie. if a consumer\n * wants to override the `sendTransaction` implementation).\n */\nexport function getAction(client, actionFn, \n// Some minifiers drop `Function.prototype.name`, or replace it with short letters,\n// meaning that `actionFn.name` will not always work. For that case, the consumer\n// needs to pass the name explicitly.\nname) {\n const action_implicit = client[actionFn.name];\n if (typeof action_implicit === 'function')\n return action_implicit;\n const action_explicit = client[name];\n if (typeof action_explicit === 'function')\n return action_explicit;\n return (params) => actionFn(client, params);\n}\n//# sourceMappingURL=getAction.js.map","/** https://wagmi.sh/core/api/actions/getChainId */\nexport function getChainId(config) {\n return config.state.chainId;\n}\n//# sourceMappingURL=getChainId.js.map","import { getEnsAvatar as viem_getEnsAvatar, } from 'viem/actions';\nimport { getAction } from '../utils/getAction.js';\n/** https://wagmi.sh/core/api/actions/getEnsAvatar */\nexport function getEnsAvatar(config, parameters) {\n const { chainId, ...rest } = parameters;\n const client = config.getClient({ chainId });\n const action = getAction(client, viem_getEnsAvatar, 'getEnsAvatar');\n return action(rest);\n}\n//# sourceMappingURL=getEnsAvatar.js.map","import { getEnsName as viem_getEnsName, } from 'viem/actions';\nimport { getAction } from '../utils/getAction.js';\n/** https://wagmi.sh/core/api/actions/getEnsName */\nexport function getEnsName(config, parameters) {\n const { chainId, ...rest } = parameters;\n const client = config.getClient({ chainId });\n const action = getAction(client, viem_getEnsName, 'getEnsName');\n return action(rest);\n}\n//# sourceMappingURL=getEnsName.js.map","/** https://wagmi.sh/core/api/actions/watchChainId */\nexport function watchChainId(config, parameters) {\n const { onChange } = parameters;\n return config.subscribe((state) => state.chainId, onChange);\n}\n//# sourceMappingURL=watchChainId.js.map","export const version = '2.15.4';\n//# sourceMappingURL=version.js.map","import { version } from '../version.js';\nexport const getVersion = () => `wagmi@${version}`;\n//# sourceMappingURL=getVersion.js.map","import { BaseError as CoreError } from '@wagmi/core';\nimport { getVersion } from '../utils/getVersion.js';\nexport class BaseError extends CoreError {\n constructor() {\n super(...arguments);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'WagmiError'\n });\n }\n get docsBaseUrl() {\n return 'https://wagmi.sh/react';\n }\n get version() {\n return getVersion();\n }\n}\n//# sourceMappingURL=base.js.map","import { BaseError } from './base.js';\nexport class WagmiProviderNotFoundError extends BaseError {\n constructor() {\n super('`useConfig` must be used within `WagmiProvider`.', {\n docsPath: '/api/WagmiProvider',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'WagmiProviderNotFoundError'\n });\n }\n}\n//# sourceMappingURL=context.js.map","'use client';\nimport { useContext } from 'react';\nimport { WagmiContext } from '../context.js';\nimport { WagmiProviderNotFoundError } from '../errors/context.js';\n/** https://wagmi.sh/react/api/hooks/useConfig */\nexport function useConfig(parameters = {}) {\n const config = parameters.config ?? useContext(WagmiContext);\n if (!config)\n throw new WagmiProviderNotFoundError();\n return config;\n}\n//# sourceMappingURL=useConfig.js.map","import { replaceEqualDeep } from '@tanstack/query-core';\nexport function structuralSharing(oldData, newData) {\n return replaceEqualDeep(oldData, newData);\n}\nexport function hashFn(queryKey) {\n return JSON.stringify(queryKey, (_, value) => {\n if (isPlainObject(value))\n return Object.keys(value)\n .sort()\n .reduce((result, key) => {\n result[key] = value[key];\n return result;\n }, {});\n if (typeof value === 'bigint')\n return value.toString();\n return value;\n });\n}\n// biome-ignore lint/complexity/noBannedTypes:\nfunction isPlainObject(value) {\n if (!hasObjectPrototype(value)) {\n return false;\n }\n // If has modified constructor\n const ctor = value.constructor;\n if (typeof ctor === 'undefined')\n return true;\n // If has modified prototype\n const prot = ctor.prototype;\n if (!hasObjectPrototype(prot))\n return false;\n // If constructor does not have an Object-specific method\n // biome-ignore lint/suspicious/noPrototypeBuiltins: <explanation>\n if (!prot.hasOwnProperty('isPrototypeOf'))\n return false;\n // Most likely a plain Object\n return true;\n}\nfunction hasObjectPrototype(o) {\n return Object.prototype.toString.call(o) === '[object Object]';\n}\nexport function filterQueryOptions(options) {\n // destructuring is super fast\n // biome-ignore format: no formatting\n const { \n // import('@tanstack/query-core').QueryOptions\n _defaulted, behavior, gcTime, initialData, initialDataUpdatedAt, maxPages, meta, networkMode, queryFn, queryHash, queryKey, queryKeyHashFn, retry, retryDelay, structuralSharing, \n // import('@tanstack/query-core').InfiniteQueryObserverOptions\n getPreviousPageParam, getNextPageParam, initialPageParam, \n // import('@tanstack/react-query').UseQueryOptions\n _optimisticResults, enabled, notifyOnChangeProps, placeholderData, refetchInterval, refetchIntervalInBackground, refetchOnMount, refetchOnReconnect, refetchOnWindowFocus, retryOnMount, select, staleTime, suspense, throwOnError, \n ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n // wagmi\n ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n config, connector, query, ...rest } = options;\n return rest;\n}\n//# sourceMappingURL=utils.js.map","import { getEnsAvatar, } from '../actions/getEnsAvatar.js';\nimport { filterQueryOptions } from './utils.js';\nexport function getEnsAvatarQueryOptions(config, options = {}) {\n return {\n async queryFn({ queryKey }) {\n const { name, scopeKey: _, ...parameters } = queryKey[1];\n if (!name)\n throw new Error('name is required');\n return getEnsAvatar(config, { ...parameters, name });\n },\n queryKey: getEnsAvatarQueryKey(options),\n };\n}\nexport function getEnsAvatarQueryKey(options = {}) {\n return ['ensAvatar', filterQueryOptions(options)];\n}\n//# sourceMappingURL=getEnsAvatar.js.map","import { getEnsName, } from '../actions/getEnsName.js';\nimport { filterQueryOptions } from './utils.js';\nexport function getEnsNameQueryOptions(config, options = {}) {\n return {\n async queryFn({ queryKey }) {\n const { address, scopeKey: _, ...parameters } = queryKey[1];\n if (!address)\n throw new Error('address is required');\n return getEnsName(config, { ...parameters, address });\n },\n queryKey: getEnsNameQueryKey(options),\n };\n}\nexport function getEnsNameQueryKey(options = {}) {\n return ['ensName', filterQueryOptions(options)];\n}\n//# sourceMappingURL=getEnsName.js.map","import { useInfiniteQuery as tanstack_useInfiniteQuery, useQuery as tanstack_useQuery, useMutation, } from '@tanstack/react-query';\nimport { hashFn } from '@wagmi/core/query';\nexport { useMutation };\n// Adding some basic customization.\n// Ideally we don't have this function, but `import('@tanstack/react-query').useQuery` currently has some quirks where it is super hard to\n// pass down the inferred `initialData` type because of it's discriminated overload in the on `useQuery`.\nexport function useQuery(parameters) {\n const result = tanstack_useQuery({\n ...parameters,\n queryKeyHashFn: hashFn, // for bigint support\n });\n result.queryKey = parameters.queryKey;\n return result;\n}\n// Adding some basic customization.\nexport function useInfiniteQuery(parameters) {\n const result = tanstack_useInfiniteQuery({\n ...parameters,\n queryKeyHashFn: hashFn, // for bigint support\n });\n result.queryKey = parameters.queryKey;\n return result;\n}\n//# sourceMappingURL=query.js.map","'use client';\nimport { getChainId, watchChainId, } from '@wagmi/core';\nimport { useSyncExternalStore } from 'react';\nimport { useConfig } from './useConfig.js';\n/** https://wagmi.sh/react/api/hooks/useChainId */\nexport function useChainId(parameters = {}) {\n const config = useConfig(parameters);\n return useSyncExternalStore((onChange) => watchChainId(config, { onChange }), () => getChainId(config), () => getChainId(config));\n}\n//# sourceMappingURL=useChainId.js.map","'use client';\nimport { getEnsAvatarQueryOptions, } from '@wagmi/core/query';\nimport { useQuery } from '../utils/query.js';\nimport { useChainId } from './useChainId.js';\nimport { useConfig } from './useConfig.js';\n/** https://wagmi.sh/react/api/hooks/useEnsAvatar */\nexport function useEnsAvatar(parameters = {}) {\n const { name, query = {} } = parameters;\n const config = useConfig(parameters);\n const chainId = useChainId({ config });\n const options = getEnsAvatarQueryOptions(config, {\n ...parameters,\n chainId: parameters.chainId ?? chainId,\n });\n const enabled = Boolean(name && (query.enabled ?? true));\n return useQuery({ ...query, ...options, enabled });\n}\n//# sourceMappingURL=useEnsAvatar.js.map","'use client';\nimport { getEnsNameQueryOptions, } from '@wagmi/core/query';\nimport { useQuery } from '../utils/query.js';\nimport { useChainId } from './useChainId.js';\nimport { useConfig } from './useConfig.js';\n/** https://wagmi.sh/react/api/hooks/useEnsName */\nexport function useEnsName(parameters = {}) {\n const { address, query = {} } = parameters;\n const config = useConfig(parameters);\n const chainId = useChainId({ config });\n const options = getEnsNameQueryOptions(config, {\n ...parameters,\n chainId: parameters.chainId ?? chainId,\n });\n const enabled = Boolean(address && (query.enabled ?? true));\n return useQuery({ ...query, ...options, enabled });\n}\n//# sourceMappingURL=useEnsName.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport ImgPowerhouse from \"#assets/powerhouse-rounded.png\";\nimport { useEnsAvatar, useEnsName } from \"wagmi\";\nexport function ENSAvatar(props) {\n const { address, chainId = 1, size = \"14px\" } = props;\n const style = {\n width: size,\n height: size,\n };\n const ensNameResult = useEnsName({ address, chainId });\n const name = ensNameResult.data ?? undefined;\n const ensAvatarResult = useEnsAvatar({ name });\n const avatarUrl = ensAvatarResult.data ?? ImgPowerhouse;\n const isLoading = ensNameResult.isLoading || ensAvatarResult.isLoading;\n if (isLoading)\n return (_jsx(\"div\", { className: \"fade-out flex-none animate-pulse rounded-full bg-gray-400\", style: style }));\n return (_jsx(\"img\", { alt: \"ENS Avatar\", className: \"flex-none rounded-full object-contain\", src: avatarUrl, style: style }));\n}\n//# sourceMappingURL=ens-avatar.js.map","export default \"__VITE_ASSET__CeRLT6og__\"","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport HomeBg from \"#assets/home-bg.png\";\nimport { twMerge } from \"tailwind-merge\";\nexport const HomeScreen = function HomeScreen(props) {\n const { children, containerClassName } = props;\n return (_jsx(\"div\", { className: twMerge(\"container relative mx-auto flex h-full flex-col\", containerClassName), children: _jsxs(\"div\", { className: \"m-8 flex flex-wrap justify-center gap-4 pt-12\", children: [_jsx(\"img\", { src: HomeBg, alt: \"background\", className: \"pointer-events-none absolute inset-8 z-0 size-[calc(100%-32px)] object-contain\" }), children] }) }));\n};\n//# sourceMappingURL=home-screen.js.map","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { Icon } from \"#powerhouse\";\nimport { twMerge } from \"tailwind-merge\";\nexport const HomeScreenItem = function HomeScreenItem(props) {\n const { icon, title, description, containerClassName, shareable, onClick } = props;\n return (_jsxs(\"div\", { className: twMerge(\"relative flex h-24 cursor-pointer flex-col items-center justify-center text-center text-sm text-black\", containerClassName, onClick && \"cursor-pointer\"), onClick: onClick, children: [_jsx(\"div\", { className: \"mx-auto pb-2\", children: icon || (_jsx(\"div\", { className: \"size-8 items-center justify-center rounded-lg bg-black pt-1\", children: _jsx(\"span\", { className: \"text-6 w-6 text-white\", children: title.slice(0, 1).toUpperCase() }) })) }), _jsxs(\"div\", { children: [_jsx(\"h3\", { children: title }), description && _jsx(\"p\", { className: \"text-gray-500\", children: description })] }), shareable && (_jsx(\"div\", { className: \"absolute left-2 top-0 mb-2\", children: _jsx(Icon, { name: \"PeopleFill\", width: 12, height: 12 }) }))] }));\n};\n//# sourceMappingURL=home-screen-item.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { Icon } from \"#powerhouse\";\nimport { HomeScreenItem } from \"../home-screen-item/index.js\";\nexport const HomeScreenAddDriveItem = function HomeScreenAddDriveItem(props) {\n const { containerClassName, onClick } = props;\n return (_jsx(HomeScreenItem, { title: \"Create New Drive\", icon: _jsx(Icon, { name: \"PlusSquare\", size: 32 }), onClick: onClick, containerClassName: containerClassName }));\n};\n//# sourceMappingURL=home-screen-add-drive-item.js.map","export default \"__VITE_ASSET__DPRMYPb7__\"","export default \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAACXBIWXMAACxLAAAsSwGlPZapAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAtmSURBVHgB7Z3dbtvmGcefl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rBUYhpYyh5vLUx0heeLYGsNGa2jbLRdZNrIcYSxxt9BGk3kL7arw+oVqszxYnJTXXocLpesahRqVAgJr/s64YVgZzoGp22BTocTA2KQpzK8ouuxPHKo6qfZVseILwX1Ru7P6jAteA8NqlGrDVNEJMfkLp29933lBWq53n6jbJr27aO6Ry6Jj/xDrBi2gJ3MOYHQzXZ91rezCNrLUGL3nM7BEJ4klL81XWpesBGTmfZB2nLL2BIKnzmTF02vhPKjk2Xb5BJy97jLVUToajiaJQ9rNaW+m7x6MRcPjY1edPvuq6FTb3eXFKKXeu4SCXDYkGzHkz6QdTRffp62pjLR6emloKu7VkZv3zZuCIK4m/O5v3hxQciFVSBjddMeoAsuolWlgwQR9aEKmWmkY26EOpbrzabsyVJt9SfMxt0DlppmmiLhNf4YJZqPLAFQXGMEXW/gVEnmCPWEvITv5qn41yKQFBKY7KCtPoCjx4tL4W9InKIQDQqGOaSENqnxGSEtjj69JHrFeGd4tydvnNMWyS6rMLdVW/HI5MShBoQNejbfsR5/REJcCiTJZKYl4Jm1QfPEjMmyBoWT2AOj+rQ+REzCY2pIzf7lcbJ/wH9VD8KK3ri6QAAAABJRU5ErkJggg==\"","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport renownShortHover from \"#assets/renown-short-hover.png\";\nimport renownShort from \"#assets/renown-short.png\";\nimport { AccountPopover, AccountPopoverLogin, } from \"../account-popover/index.js\";\nexport const SidebarLogin = ({ onLogin }) => {\n const content = _jsx(AccountPopoverLogin, { onLogin: onLogin });\n return (_jsx(AccountPopover, { content: content, children: _jsxs(\"div\", { className: \"group/sidebar-footer flex w-full cursor-pointer items-baseline justify-start text-sm font-semibold leading-10 text-gray-600\", children: [_jsx(\"img\", { className: \"group-hover/sidebar-footer:hidden\", src: renownShort }), _jsx(\"img\", { className: \"hidden group-hover/sidebar-footer:block\", src: renownShortHover })] }) }));\n};\n//# sourceMappingURL=sidebar-login.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { ENSAvatar } from \"#connect\";\nimport { useEnsName } from \"wagmi\";\nimport { AccountPopover, AccountPopoverUser, } from \"../account-popover/index.js\";\nexport const SidebarUser = ({ address, etherscanUrl, onDisconnect, }) => {\n const { data } = useEnsName({ address });\n const ensName = data;\n const content = (_jsx(AccountPopoverUser, { address: address, username: ensName, onDisconnect: onDisconnect, etherscanUrl: etherscanUrl }));\n return (_jsx(AccountPopover, { content: content, children: _jsx(\"div\", { className: \"flex items-center justify-center rounded-sm\", children: _jsx(ENSAvatar, { address: address, size: \"40px\" }) }) }));\n};\n//# sourceMappingURL=sidebar-user.js.map","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { Icon, SidebarFooter } from \"#powerhouse\";\nimport { twMerge } from \"tailwind-merge\";\nimport { SidebarLogin } from \"./sidebar-login.js\";\nimport { SidebarUser } from \"./sidebar-user.js\";\nexport const ConnectSidebarFooter = ({ address, className, onLogin, onClickSettings, onDisconnect, etherscanUrl = \"\", ...props }) => {\n return (_jsxs(SidebarFooter, { ...props, className: twMerge(\"flex flex-col gap-2 border-t border-gray-300 px-2 py-4\", className), children: [_jsx(\"div\", { className: \"\", children: address ? (_jsx(SidebarUser, { address: address, onDisconnect: onDisconnect, etherscanUrl: etherscanUrl })) : (_jsx(SidebarLogin, { onLogin: onLogin })) }), _jsxs(\"button\", { type: \"button\", className: \"mt-3 flex w-full cursor-pointer items-center justify-center outline-none\", onClick: onClickSettings, children: [_jsx(Icon, { className: \"text-gray-600\", name: \"Settings\" }), _jsx(\"span\", { className: \"hidden text-sm font-semibold leading-6 text-gray-800\", children: \"Settings\" })] })] }));\n};\n//# sourceMappingURL=sidebar-footer.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { Icon, SidebarHeader } from \"#powerhouse\";\nimport { twMerge } from \"tailwind-merge\";\nexport const ConnectSidebarHeader = ({ onClick, className, children, ...props }) => {\n return (_jsx(SidebarHeader, { ...props, className: twMerge(\"flex justify-center gap-4 border-b border-gray-300 py-4\", className), children: _jsx(\"button\", { className: \"\", onClick: onClick, type: \"button\", children: _jsx(Icon, { className: \"text-gray-600\", name: \"ConnectSmall\", size: 24 }) }) }));\n};\n//# sourceMappingURL=sidebar-header.js.map","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { Sidebar, SidebarPanel } from \"#powerhouse\";\nimport { ConnectSidebarFooter, } from \"./sidebar-footer.js\";\nimport { ConnectSidebarHeader, } from \"./sidebar-header.js\";\nexport const ConnectSidebar = ({ onClick, address, headerContent, onClickSettings, maxWidth = \"304px\", minWidth = \"58px\", onLogin, onDisconnect, etherscanUrl, ...props }) => {\n return (_jsxs(Sidebar, { ...props, maxWidth: maxWidth, minWidth: minWidth, children: [_jsxs(SidebarPanel, { children: [_jsx(ConnectSidebarHeader, { onClick: onClick, children: headerContent }), _jsx(\"div\", { className: \"flex flex-col\", children: props.children })] }), _jsx(ConnectSidebarFooter, { address: address, onClickSettings: onClickSettings, onLogin: onLogin, onDisconnect: onDisconnect, etherscanUrl: etherscanUrl })] }));\n};\n//# sourceMappingURL=sidebar.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { twMerge } from \"tailwind-merge\";\nexport const SidebarItem = function SidebarItem(props) {\n const { icon, title, description, containerClassName, active, onClick } = props;\n return (_jsx(\"div\", { className: twMerge(\"relative flex cursor-pointer flex-col items-center justify-center text-center text-sm text-black\", containerClassName, active && \"bg-white\", onClick && \"cursor-pointer\"), onClick: onClick, children: _jsx(\"div\", { className: \"mx-auto py-4\", children: icon || (_jsx(\"div\", { className: \"size-8 items-center justify-center rounded-lg bg-black pt-1\", children: _jsx(\"span\", { className: \"text-6 w-6 text-white\", children: title.slice(0, 1).toUpperCase() }) })) }) }));\n};\n//# sourceMappingURL=sidebar-item.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { Icon } from \"#powerhouse\";\nimport { SidebarItem } from \"./sidebar-item.js\";\nexport const SidebarAddDriveItem = function SidebarAddDriveItem(props) {\n const { containerClassName, onClick } = props;\n return (_jsx(SidebarItem, { title: \"Create New Drive\", icon: _jsx(Icon, { name: \"PlusSquare\", size: 32 }), onClick: onClick, containerClassName: containerClassName }));\n};\n//# sourceMappingURL=sidebar-add-drive-item.js.map","import { makeNodeSlugFromNodeName } from '#utils';\nimport {\n DRIVE,\n FILE,\n FOLDER,\n LOCAL,\n PUBLIC,\n type SharingType,\n SUCCESS,\n type UiDriveNode,\n type UiFileNode,\n type UiFolderNode,\n type UiNode,\n} from '@powerhousedao/design-system';\nimport { useUiNodesContext } from '@powerhousedao/reactor-browser/hooks/useUiNodesContext';\nimport { type DocumentDriveDocument, type ReadDrive } from 'document-drive';\nimport { useCallback, useMemo } from 'react';\nimport { useDocumentDriveServer } from './useDocumentDriveServer.js';\n\nexport function useMakeUiDriveNode() {\n const { getSyncStatus } = useDocumentDriveServer();\n const makeUiDriveNode = useCallback(\n async (drive: DocumentDriveDocument | ReadDrive) => {\n const isReadDrive = 'readContext' in drive;\n const id = drive.id;\n const { name, icon } = drive.state.global;\n const { slug } = drive;\n const { sharingType: _sharingType, availableOffline } = !isReadDrive\n ? drive.state.local\n : { sharingType: PUBLIC, availableOffline: false };\n const __sharingType = _sharingType?.toUpperCase();\n const sharingType = (\n __sharingType === 'PRIVATE' ? LOCAL : __sharingType\n ) as SharingType;\n const driveSyncStatus = !isReadDrive\n ? await getSyncStatus(id, sharingType)\n : undefined;\n\n // TODO: rempve this after integration in design-system\n const normalizedDriveSyncStatus =\n driveSyncStatus === 'INITIAL_SYNC'\n ? 'SYNCING'\n : driveSyncStatus;\n\n const driveNode: UiDriveNode = {\n id,\n name,\n slug: slug || null,\n kind: DRIVE,\n children: [],\n nodeMap: {},\n sharingType,\n syncStatus: normalizedDriveSyncStatus,\n availableOffline,\n icon,\n parentFolder: null,\n driveId: id,\n };\n\n const nodes = drive.state.global.nodes.map(n => {\n const node = {\n ...n,\n slug: makeNodeSlugFromNodeName(n.name),\n driveId: id,\n parentFolder: n.parentFolder || id,\n kind: n.kind.toUpperCase(),\n syncStatus: normalizedDriveSyncStatus,\n sharingType,\n };\n\n if (node.kind === DRIVE) {\n throw new Error('Drive nodes should not be nested');\n }\n\n if (node.kind === FILE) {\n return node as UiFileNode;\n }\n\n return {\n ...node,\n children: [],\n } as UiFolderNode;\n });\n\n for (const node of nodes) {\n driveNode.nodeMap[node.id] = node;\n }\n\n // eslint-disable-next-line @typescript-eslint/await-thenable\n for await (const node of nodes) {\n if (node.kind === FILE) {\n const fileSyncStatus = !isReadDrive\n ? await getSyncStatus(\n node.synchronizationUnits[0].syncId,\n sharingType,\n )\n : undefined;\n\n // TODO: rempve this after integration in design-system\n const normalizedFileSyncStatus =\n fileSyncStatus === 'INITIAL_SYNC'\n ? 'SYNCING'\n : fileSyncStatus;\n\n node.syncStatus = normalizedFileSyncStatus;\n }\n\n if (node.parentFolder === id) {\n driveNode.children.push(node);\n continue;\n }\n const parent = driveNode.nodeMap[node.parentFolder];\n\n if (parent.kind === FILE) {\n throw new Error(\n `Parent node ${node.parentFolder} is a file, not a folder`,\n );\n }\n\n parent.children.push(node);\n\n if (node.syncStatus !== SUCCESS) {\n parent.syncStatus = node.syncStatus;\n }\n }\n\n return driveNode;\n },\n [getSyncStatus],\n );\n\n return makeUiDriveNode;\n}\n\nexport function useDebugHandlers() {\n const { removeTrigger, addTrigger, registerNewPullResponderTrigger } =\n useDocumentDriveServer();\n\n const onAddTrigger = useCallback(\n async (uiNodeDriveId: string) => {\n const url = window.prompt('url') || '';\n\n const pullResponderTrigger = await registerNewPullResponderTrigger(\n uiNodeDriveId,\n url,\n { pullInterval: 6000 },\n );\n await addTrigger(uiNodeDriveId, pullResponderTrigger);\n },\n [addTrigger, registerNewPullResponderTrigger],\n );\n\n const onRemoveTrigger = useCallback(\n async (uiNodeDriveId: string) => {\n const triggerId = window.prompt('triggerId:');\n\n if (triggerId) {\n await removeTrigger(uiNodeDriveId, triggerId);\n }\n },\n [removeTrigger],\n );\n\n const onAddInvalidTrigger = useCallback(\n async (uiNodeDriveId: string) => {\n const url = window.prompt('url') || '';\n\n await addTrigger(uiNodeDriveId, {\n id: 'some-invalid-id',\n type: 'PullResponder',\n data: {\n interval: '3000',\n listenerId: 'invalid-listener-id',\n url,\n },\n });\n },\n [addTrigger],\n );\n\n return {\n onAddTrigger,\n onRemoveTrigger,\n onAddInvalidTrigger,\n };\n}\n\nexport function useUiNodes() {\n const { selectedParentNode, setSelectedNode } = useUiNodesContext();\n const { addFolder, addFile, renameNode, copyNode, moveNode } =\n useDocumentDriveServer();\n\n const onAddFile = useCallback(\n async (file: File, parentNode: UiNode | null) => {\n if (!parentNode) {\n throw new Error('Parent node is required');\n }\n if (parentNode.kind === FILE) {\n throw new Error('Cannot add file to a file');\n }\n\n const fileName = file.name.replace(/\\.zip$/gim, '');\n\n return await addFile(\n file,\n parentNode.driveId,\n fileName,\n parentNode.id,\n );\n },\n [addFile],\n );\n\n const onAddFolder = useCallback(\n async (name: string, parentNode: UiNode | null) => {\n if (!parentNode) {\n throw new Error('Parent node is required');\n }\n if (parentNode.kind === FILE) {\n throw new Error('Cannot add folder to a file');\n }\n return await addFolder(parentNode.driveId, name, parentNode.id);\n },\n [addFolder],\n );\n\n const onRenameNode = useCallback(\n async (name: string, uiNode: UiNode) => {\n if (uiNode.kind === DRIVE) {\n throw new Error(\n 'Drive can only be renamed from the drive settings modal',\n );\n }\n return await renameNode(uiNode.driveId, uiNode.id, name);\n },\n [renameNode],\n );\n\n const onCopyNode = useCallback(\n async (uiNode: UiNode, targetNode: UiNode) => {\n if (uiNode.kind === DRIVE) {\n throw new Error('Drive cannot be duplicated');\n }\n\n await copyNode(uiNode, targetNode);\n },\n [copyNode],\n );\n\n const onMoveNode = useCallback(\n async (uiNode: UiNode, targetNode: UiNode) => {\n if (uiNode.kind === DRIVE) {\n throw new Error('Drive cannot be moved');\n }\n\n await moveNode(uiNode, targetNode);\n },\n [moveNode],\n );\n\n const onDuplicateNode = useCallback(\n async (uiNode: UiNode) => {\n if (!selectedParentNode) return;\n\n if (uiNode.kind === DRIVE) {\n throw new Error('Drive cannot be duplicated');\n }\n\n await copyNode(uiNode, selectedParentNode);\n },\n [copyNode, selectedParentNode],\n );\n\n const onAddAndSelectNewFolder = useCallback(\n async (name: string) => {\n if (!name || !selectedParentNode) return;\n\n const newFolder = await onAddFolder(name, selectedParentNode);\n\n setSelectedNode({\n ...newFolder,\n kind: FOLDER,\n slug: makeNodeSlugFromNodeName(newFolder.name),\n parentFolder: selectedParentNode.id,\n syncStatus: selectedParentNode.syncStatus,\n driveId: selectedParentNode.driveId,\n sharingType: selectedParentNode.sharingType,\n children: [],\n });\n },\n [onAddFolder, selectedParentNode, setSelectedNode],\n );\n\n return useMemo(\n () => ({\n onAddFile,\n onAddFolder,\n onRenameNode,\n onCopyNode,\n onMoveNode,\n onDuplicateNode,\n onAddAndSelectNewFolder,\n }),\n [\n onAddFolder,\n onAddFile,\n onCopyNode,\n onMoveNode,\n onRenameNode,\n onDuplicateNode,\n onAddAndSelectNewFolder,\n ],\n );\n}\n\nexport type TUiNodes = ReturnType<typeof useUiNodes>;\n","import { useModal } from '#components';\nimport { useApps } from '#store';\nimport {\n toast,\n type AddLocalDriveInput,\n type AddRemoteDriveInput,\n} from '@powerhousedao/design-system';\nimport {\n FOLDER,\n useUiNodesContext,\n type SharingType,\n type UiDriveNode,\n type UiFileNode,\n type UiFolderNode,\n} from '@powerhousedao/reactor-browser';\nimport { t } from 'i18next';\nimport { useCallback } from 'react';\nimport { useDocumentDriveServer } from './useDocumentDriveServer';\nimport { useMakeUiDriveNode } from './useUiNodes';\n\nexport function useShowAddDriveModal() {\n const { showModal } = useModal();\n const { addDrive, addRemoteDrive } = useDocumentDriveServer();\n const { setSelectedNode } = useUiNodesContext();\n const apps = useApps();\n const makeUiDriveNode = useMakeUiDriveNode();\n const onAddLocalDrive = useCallback(\n async (data: AddLocalDriveInput) => {\n try {\n const app = apps.find(a => a.id === data.appId);\n const newDrive = await addDrive(\n {\n id: '',\n slug: '',\n global: {\n name: data.name,\n icon: null,\n },\n local: {\n availableOffline: data.availableOffline,\n sharingType: data.sharingType.toLowerCase(),\n listeners: [],\n triggers: [],\n },\n },\n app?.driveEditor,\n );\n\n toast(t('notifications.addDriveSuccess'), {\n type: 'connect-success',\n });\n\n const newDriveNode = await makeUiDriveNode(newDrive);\n\n setSelectedNode(newDriveNode);\n } catch (e) {\n console.error(e);\n }\n },\n [addDrive, makeUiDriveNode, setSelectedNode, t],\n );\n\n const onAddRemoteDrive = useCallback(\n async (data: AddRemoteDriveInput) => {\n try {\n const newDrive = await addRemoteDrive(data.url, {\n sharingType: data.sharingType,\n availableOffline: data.availableOffline,\n listeners: [\n {\n block: true,\n callInfo: {\n data: data.url,\n name: 'switchboard-push',\n transmitterType: 'SwitchboardPush',\n },\n filter: {\n branch: ['main'],\n documentId: ['*'],\n documentType: ['*'],\n scope: ['global'],\n },\n label: 'Switchboard Sync',\n listenerId: '1',\n system: true,\n },\n ],\n triggers: [],\n });\n\n toast(t('notifications.addDriveSuccess'), {\n type: 'connect-success',\n });\n\n const newDriveNode = await makeUiDriveNode(newDrive);\n\n setSelectedNode(newDriveNode);\n } catch (e) {\n console.error(e);\n }\n },\n [addRemoteDrive, makeUiDriveNode, setSelectedNode, t],\n );\n const showAddDriveModal = useCallback(\n () =>\n showModal('addDriveModal', {\n onAddLocalDrive,\n onAddRemoteDrive,\n }),\n [onAddLocalDrive, onAddRemoteDrive, showModal],\n );\n\n return showAddDriveModal;\n}\n\nexport function useShowDriveSettingsModal() {\n const { showModal } = useModal();\n const {\n renameDrive,\n setDriveAvailableOffline,\n setDriveSharingType,\n deleteDrive,\n } = useDocumentDriveServer();\n const { driveNodes, setSelectedNode } = useUiNodesContext();\n const onRenameDrive = useCallback(\n async (uiDriveNode: UiDriveNode, newName: string) => {\n await renameDrive(uiDriveNode.id, newName);\n },\n [renameDrive],\n );\n\n const onChangeSharingType = useCallback(\n async (uiDriveNode: UiDriveNode, newSharingType: SharingType) => {\n await setDriveSharingType(uiDriveNode.id, newSharingType);\n },\n [setDriveSharingType],\n );\n\n const onChangeAvailableOffline = useCallback(\n async (uiDriveNode: UiDriveNode, newAvailableOffline: boolean) => {\n await setDriveAvailableOffline(uiDriveNode.id, newAvailableOffline);\n },\n [setDriveAvailableOffline],\n );\n const onDeleteDrive = useCallback(\n (uiDriveNode: UiDriveNode) => {\n showModal('deleteDriveModal', {\n uiDriveNode,\n onDelete: async closeModal => {\n closeModal();\n await deleteDrive(uiDriveNode.id);\n\n setSelectedNode(driveNodes[0]);\n\n toast(t('notifications.deleteDriveSuccess'), {\n type: 'connect-deleted',\n });\n },\n });\n },\n [deleteDrive, driveNodes, setSelectedNode, showModal, t],\n );\n const showDriveSettingsModal = useCallback(\n (uiDriveNode: UiDriveNode) => {\n showModal('driveSettings', {\n uiDriveNode,\n onRenameDrive,\n onDeleteDrive,\n onChangeSharingType,\n onChangeAvailableOffline,\n });\n },\n [\n onChangeAvailableOffline,\n onChangeSharingType,\n onDeleteDrive,\n onRenameDrive,\n showModal,\n ],\n );\n\n return showDriveSettingsModal;\n}\n\nexport function useShowDeleteNodeModal() {\n const { showModal } = useModal();\n const { setSelectedNode, getParentNode } = useUiNodesContext();\n const { deleteNode } = useDocumentDriveServer();\n const showDeleteNodeModal = useCallback(\n (uiNode: UiFileNode | UiFolderNode) => {\n showModal('deleteItem', {\n uiNode,\n onDelete: async closeModal => {\n closeModal();\n\n const i18nKey =\n uiNode.kind === FOLDER\n ? 'notifications.deleteFolderSuccess'\n : 'notifications.fileDeleteSuccess';\n\n const parentNode = getParentNode(uiNode);\n\n await deleteNode(uiNode.driveId, uiNode.id);\n\n setSelectedNode(parentNode);\n\n toast(t(i18nKey), { type: 'connect-deleted' });\n },\n });\n },\n [deleteNode, getParentNode, setSelectedNode, showModal, t],\n );\n\n return showDeleteNodeModal;\n}\n","import { useUnwrappedReactor } from '#store';\nimport { LOCAL } from '@powerhousedao/design-system';\nimport { useSwitchboard } from '@powerhousedao/reactor-browser';\nimport {\n logger,\n type PullResponderTrigger,\n type PullResponderTriggerData,\n type Trigger,\n} from 'document-drive';\nimport { useCallback, useMemo, useRef, useState } from 'react';\nimport { useDocumentDriveServer } from './useDocumentDriveServer.js';\n\nexport type ClientErrorHandler = {\n strandsErrorHandler: (\n driveId: string,\n trigger: Trigger,\n status: number,\n errorMessage: string,\n ) => Promise<void>;\n};\n\nconst DELAY_LIMIT = 100000;\n\nconst isListenerIdNotFound = (errorMessage: string, listenerId?: string) => {\n if (!listenerId) return false;\n\n return errorMessage\n .toLocaleLowerCase()\n .includes(`transmitter ${listenerId} not found`);\n};\n\nexport const useClientErrorHandler = (): ClientErrorHandler => {\n const [handlingInProgress, setHandlingInProgress] = useState<string[]>([]);\n const [pullResponderTriggerMap, setPullResponderTriggerMap] = useState<\n Map<string, PullResponderTrigger>\n >(new Map());\n const {\n addTrigger,\n removeTrigger,\n registerNewPullResponderTrigger,\n renameDrive,\n addRemoteDrive,\n documentDrives,\n setDriveSharingType,\n } = useDocumentDriveServer();\n\n const reactor = useUnwrappedReactor();\n const { getDriveIdBySlug } = useSwitchboard(reactor!);\n\n const pullResponderRegisterDelay = useRef<Map<string, number>>(new Map());\n\n const handleStrands400 = useCallback(\n async (driveId: string, trigger: Trigger, handlerCode: string) => {\n setHandlingInProgress(state => [...state, handlerCode]);\n\n const triggerData =\n trigger.data as unknown as PullResponderTriggerData;\n\n try {\n let pullResponderTrigger =\n pullResponderTriggerMap.get(handlerCode);\n\n if (!pullResponderTrigger) {\n pullResponderTrigger =\n await registerNewPullResponderTrigger(\n driveId,\n triggerData.url,\n {\n pullInterval:\n Number(triggerData.interval) || 3000,\n },\n );\n\n pullResponderTriggerMap.set(\n handlerCode,\n pullResponderTrigger,\n );\n setPullResponderTriggerMap(pullResponderTriggerMap);\n }\n\n await removeTrigger(driveId, trigger.id);\n await addTrigger(driveId, pullResponderTrigger);\n\n pullResponderRegisterDelay.current.delete(handlerCode);\n } catch (error) {\n const delay =\n pullResponderRegisterDelay.current.get(handlerCode) || 1;\n pullResponderRegisterDelay.current.set(\n handlerCode,\n delay === DELAY_LIMIT ? delay : delay * 10,\n );\n\n logger.error(error);\n } finally {\n setHandlingInProgress(state =>\n state.filter(code => code !== handlerCode),\n );\n }\n },\n [\n pullResponderTriggerMap,\n removeTrigger,\n addTrigger,\n pullResponderRegisterDelay,\n registerNewPullResponderTrigger,\n ],\n );\n\n const handleDriveNotFound = useCallback(\n async (driveId: string, trigger: Trigger, handlerCode: string) => {\n setHandlingInProgress(state => [...state, handlerCode]);\n try {\n // get local drive by id\n const drive = documentDrives.find(\n drive => drive.id === driveId,\n );\n if (!drive) return;\n await removeTrigger(driveId, trigger.id);\n\n await renameDrive(\n driveId,\n drive.state.global.name + ` (${drive.id})`,\n );\n\n await setDriveSharingType(driveId, LOCAL);\n\n if (trigger.data?.url && drive.slug) {\n const newId = await getDriveIdBySlug(\n trigger.data.url,\n drive.slug,\n );\n if (newId) {\n const urlParts = trigger.data.url.split('/');\n urlParts[urlParts.length - 1] = newId;\n const newUrl = urlParts.join('/');\n\n await addRemoteDrive(newUrl, {\n availableOffline: true,\n sharingType: 'PUBLIC',\n listeners: [],\n triggers: [],\n });\n }\n }\n } catch (e: unknown) {\n logger.error(e);\n } finally {\n setHandlingInProgress(state =>\n state.filter(code => code !== handlerCode),\n );\n }\n },\n [\n documentDrives,\n removeTrigger,\n renameDrive,\n setDriveSharingType,\n getDriveIdBySlug,\n addRemoteDrive,\n ],\n );\n\n const strandsErrorHandler: ClientErrorHandler['strandsErrorHandler'] =\n useCallback(\n async (driveId, trigger, status, errorMessage) => {\n switch (status) {\n case 400: {\n if (\n isListenerIdNotFound(\n errorMessage,\n trigger.data?.listenerId,\n )\n ) {\n const autoRegisterPullResponder =\n localStorage.getItem(\n 'AUTO_REGISTER_PULL_RESPONDER',\n ) !== 'false';\n\n if (!autoRegisterPullResponder) return;\n const handlerCode = `strands:${driveId}:${status}`;\n\n if (handlingInProgress.includes(handlerCode))\n return;\n if (!trigger.data) return;\n\n const delay =\n pullResponderRegisterDelay.current.get(\n handlerCode,\n ) || 0;\n\n setTimeout(\n () =>\n handleStrands400(\n driveId,\n trigger,\n handlerCode,\n ),\n delay,\n );\n }\n\n break;\n }\n\n case 404: {\n const handlerCode = `strands:${driveId}:${status}`;\n if (handlingInProgress.includes(handlerCode)) return;\n setTimeout(\n () =>\n handleDriveNotFound(\n driveId,\n trigger,\n handlerCode,\n ),\n 0,\n );\n break;\n }\n }\n },\n [handleDriveNotFound, handleStrands400, handlingInProgress],\n );\n\n return useMemo(() => ({ strandsErrorHandler }), [strandsErrorHandler]);\n};\n","/**\n * React Router DOM v6.30.1\n *\n * Copyright (c) Remix Software Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE.md file in the root directory of this source tree.\n *\n * @license MIT\n */\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { UNSAFE_mapRouteProperties, UNSAFE_logV6DeprecationWarnings, UNSAFE_DataRouterContext, UNSAFE_DataRouterStateContext, Router, UNSAFE_useRoutesImpl, UNSAFE_NavigationContext, useHref, useResolvedPath, useLocation, useNavigate, createPath, UNSAFE_useRouteId, UNSAFE_RouteContext, useMatches, useNavigation, useBlocker } from 'react-router';\nexport { AbortedDeferredError, Await, MemoryRouter, Navigate, NavigationType, Outlet, Route, Router, Routes, UNSAFE_DataRouterContext, UNSAFE_DataRouterStateContext, UNSAFE_LocationContext, UNSAFE_NavigationContext, UNSAFE_RouteContext, UNSAFE_useRouteId, createMemoryRouter, createPath, createRoutesFromChildren, createRoutesFromElements, defer, generatePath, isRouteErrorResponse, json, matchPath, matchRoutes, parsePath, redirect, redirectDocument, renderMatches, replace, resolvePath, useActionData, useAsyncError, useAsyncValue, useBlocker, useHref, useInRouterContext, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes } from 'react-router';\nimport { stripBasename, UNSAFE_warning, createRouter, createBrowserHistory, createHashHistory, UNSAFE_ErrorResponseImpl, UNSAFE_invariant, joinPaths, IDLE_FETCHER, matchPath } from '@remix-run/router';\nexport { UNSAFE_ErrorResponseImpl } from '@remix-run/router';\n\nfunction _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}\n\nconst defaultMethod = \"get\";\nconst defaultEncType = \"application/x-www-form-urlencoded\";\nfunction isHtmlElement(object) {\n return object != null && typeof object.tagName === \"string\";\n}\nfunction isButtonElement(object) {\n return isHtmlElement(object) && object.tagName.toLowerCase() === \"button\";\n}\nfunction isFormElement(object) {\n return isHtmlElement(object) && object.tagName.toLowerCase() === \"form\";\n}\nfunction isInputElement(object) {\n return isHtmlElement(object) && object.tagName.toLowerCase() === \"input\";\n}\nfunction isModifiedEvent(event) {\n return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);\n}\nfunction shouldProcessLinkClick(event, target) {\n return event.button === 0 && (\n // Ignore everything but left clicks\n !target || target === \"_self\") &&\n // Let browser handle \"target=_blank\" etc.\n !isModifiedEvent(event) // Ignore clicks with modifier keys\n ;\n}\n/**\n * Creates a URLSearchParams object using the given initializer.\n *\n * This is identical to `new URLSearchParams(init)` except it also\n * supports arrays as values in the object form of the initializer\n * instead of just strings. This is convenient when you need multiple\n * values for a given key, but don't want to use an array initializer.\n *\n * For example, instead of:\n *\n * let searchParams = new URLSearchParams([\n * ['sort', 'name'],\n * ['sort', 'price']\n * ]);\n *\n * you can do:\n *\n * let searchParams = createSearchParams({\n * sort: ['name', 'price']\n * });\n */\nfunction createSearchParams(init) {\n if (init === void 0) {\n init = \"\";\n }\n return new URLSearchParams(typeof init === \"string\" || Array.isArray(init) || init instanceof URLSearchParams ? init : Object.keys(init).reduce((memo, key) => {\n let value = init[key];\n return memo.concat(Array.isArray(value) ? value.map(v => [key, v]) : [[key, value]]);\n }, []));\n}\nfunction getSearchParamsForLocation(locationSearch, defaultSearchParams) {\n let searchParams = createSearchParams(locationSearch);\n if (defaultSearchParams) {\n // Use `defaultSearchParams.forEach(...)` here instead of iterating of\n // `defaultSearchParams.keys()` to work-around a bug in Firefox related to\n // web extensions. Relevant Bugzilla tickets:\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1414602\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1023984\n defaultSearchParams.forEach((_, key) => {\n if (!searchParams.has(key)) {\n defaultSearchParams.getAll(key).forEach(value => {\n searchParams.append(key, value);\n });\n }\n });\n }\n return searchParams;\n}\n// One-time check for submitter support\nlet _formDataSupportsSubmitter = null;\nfunction isFormDataSubmitterSupported() {\n if (_formDataSupportsSubmitter === null) {\n try {\n new FormData(document.createElement(\"form\"),\n // @ts-expect-error if FormData supports the submitter parameter, this will throw\n 0);\n _formDataSupportsSubmitter = false;\n } catch (e) {\n _formDataSupportsSubmitter = true;\n }\n }\n return _formDataSupportsSubmitter;\n}\nconst supportedFormEncTypes = new Set([\"application/x-www-form-urlencoded\", \"multipart/form-data\", \"text/plain\"]);\nfunction getFormEncType(encType) {\n if (encType != null && !supportedFormEncTypes.has(encType)) {\n process.env.NODE_ENV !== \"production\" ? UNSAFE_warning(false, \"\\\"\" + encType + \"\\\" is not a valid `encType` for `<Form>`/`<fetcher.Form>` \" + (\"and will default to \\\"\" + defaultEncType + \"\\\"\")) : void 0;\n return null;\n }\n return encType;\n}\nfunction getFormSubmissionInfo(target, basename) {\n let method;\n let action;\n let encType;\n let formData;\n let body;\n if (isFormElement(target)) {\n // When grabbing the action from the element, it will have had the basename\n // prefixed to ensure non-JS scenarios work, so strip it since we'll\n // re-prefix in the router\n let attr = target.getAttribute(\"action\");\n action = attr ? stripBasename(attr, basename) : null;\n method = target.getAttribute(\"method\") || defaultMethod;\n encType = getFormEncType(target.getAttribute(\"enctype\")) || defaultEncType;\n formData = new FormData(target);\n } else if (isButtonElement(target) || isInputElement(target) && (target.type === \"submit\" || target.type === \"image\")) {\n let form = target.form;\n if (form == null) {\n throw new Error(\"Cannot submit a <button> or <input type=\\\"submit\\\"> without a <form>\");\n }\n // <button>/<input type=\"submit\"> may override attributes of <form>\n // When grabbing the action from the element, it will have had the basename\n // prefixed to ensure non-JS scenarios work, so strip it since we'll\n // re-prefix in the router\n let attr = target.getAttribute(\"formaction\") || form.getAttribute(\"action\");\n action = attr ? stripBasename(attr, basename) : null;\n method = target.getAttribute(\"formmethod\") || form.getAttribute(\"method\") || defaultMethod;\n encType = getFormEncType(target.getAttribute(\"formenctype\")) || getFormEncType(form.getAttribute(\"enctype\")) || defaultEncType;\n // Build a FormData object populated from a form and submitter\n formData = new FormData(form, target);\n // If this browser doesn't support the `FormData(el, submitter)` format,\n // then tack on the submitter value at the end. This is a lightweight\n // solution that is not 100% spec compliant. For complete support in older\n // browsers, consider using the `formdata-submitter-polyfill` package\n if (!isFormDataSubmitterSupported()) {\n let {\n name,\n type,\n value\n } = target;\n if (type === \"image\") {\n let prefix = name ? name + \".\" : \"\";\n formData.append(prefix + \"x\", \"0\");\n formData.append(prefix + \"y\", \"0\");\n } else if (name) {\n formData.append(name, value);\n }\n }\n } else if (isHtmlElement(target)) {\n throw new Error(\"Cannot submit element that is not <form>, <button>, or \" + \"<input type=\\\"submit|image\\\">\");\n } else {\n method = defaultMethod;\n action = null;\n encType = defaultEncType;\n body = target;\n }\n // Send body for <Form encType=\"text/plain\" so we encode it into text\n if (formData && encType === \"text/plain\") {\n body = formData;\n formData = undefined;\n }\n return {\n action,\n method: method.toLowerCase(),\n encType,\n formData,\n body\n };\n}\n\nconst _excluded = [\"onClick\", \"relative\", \"reloadDocument\", \"replace\", \"state\", \"target\", \"to\", \"preventScrollReset\", \"viewTransition\"],\n _excluded2 = [\"aria-current\", \"caseSensitive\", \"className\", \"end\", \"style\", \"to\", \"viewTransition\", \"children\"],\n _excluded3 = [\"fetcherKey\", \"navigate\", \"reloadDocument\", \"replace\", \"state\", \"method\", \"action\", \"onSubmit\", \"relative\", \"preventScrollReset\", \"viewTransition\"];\n// HEY YOU! DON'T TOUCH THIS VARIABLE!\n//\n// It is replaced with the proper version at build time via a babel plugin in\n// the rollup config.\n//\n// Export a global property onto the window for React Router detection by the\n// Core Web Vitals Technology Report. This way they can configure the `wappalyzer`\n// to detect and properly classify live websites as being built with React Router:\n// https://github.com/HTTPArchive/wappalyzer/blob/main/src/technologies/r.json\nconst REACT_ROUTER_VERSION = \"6\";\ntry {\n window.__reactRouterVersion = REACT_ROUTER_VERSION;\n} catch (e) {\n // no-op\n}\nfunction createBrowserRouter(routes, opts) {\n return createRouter({\n basename: opts == null ? void 0 : opts.basename,\n future: _extends({}, opts == null ? void 0 : opts.future, {\n v7_prependBasename: true\n }),\n history: createBrowserHistory({\n window: opts == null ? void 0 : opts.window\n }),\n hydrationData: (opts == null ? void 0 : opts.hydrationData) || parseHydrationData(),\n routes,\n mapRouteProperties: UNSAFE_mapRouteProperties,\n dataStrategy: opts == null ? void 0 : opts.dataStrategy,\n patchRoutesOnNavigation: opts == null ? void 0 : opts.patchRoutesOnNavigation,\n window: opts == null ? void 0 : opts.window\n }).initialize();\n}\nfunction createHashRouter(routes, opts) {\n return createRouter({\n basename: opts == null ? void 0 : opts.basename,\n future: _extends({}, opts == null ? void 0 : opts.future, {\n v7_prependBasename: true\n }),\n history: createHashHistory({\n window: opts == null ? void 0 : opts.window\n }),\n hydrationData: (opts == null ? void 0 : opts.hydrationData) || parseHydrationData(),\n routes,\n mapRouteProperties: UNSAFE_mapRouteProperties,\n dataStrategy: opts == null ? void 0 : opts.dataStrategy,\n patchRoutesOnNavigation: opts == null ? void 0 : opts.patchRoutesOnNavigation,\n window: opts == null ? void 0 : opts.window\n }).initialize();\n}\nfunction parseHydrationData() {\n var _window;\n let state = (_window = window) == null ? void 0 : _window.__staticRouterHydrationData;\n if (state && state.errors) {\n state = _extends({}, state, {\n errors: deserializeErrors(state.errors)\n });\n }\n return state;\n}\nfunction deserializeErrors(errors) {\n if (!errors) return null;\n let entries = Object.entries(errors);\n let serialized = {};\n for (let [key, val] of entries) {\n // Hey you! If you change this, please change the corresponding logic in\n // serializeErrors in react-router-dom/server.tsx :)\n if (val && val.__type === \"RouteErrorResponse\") {\n serialized[key] = new UNSAFE_ErrorResponseImpl(val.status, val.statusText, val.data, val.internal === true);\n } else if (val && val.__type === \"Error\") {\n // Attempt to reconstruct the right type of Error (i.e., ReferenceError)\n if (val.__subType) {\n let ErrorConstructor = window[val.__subType];\n if (typeof ErrorConstructor === \"function\") {\n try {\n // @ts-expect-error\n let error = new ErrorConstructor(val.message);\n // Wipe away the client-side stack trace. Nothing to fill it in with\n // because we don't serialize SSR stack traces for security reasons\n error.stack = \"\";\n serialized[key] = error;\n } catch (e) {\n // no-op - fall through and create a normal Error\n }\n }\n }\n if (serialized[key] == null) {\n let error = new Error(val.message);\n // Wipe away the client-side stack trace. Nothing to fill it in with\n // because we don't serialize SSR stack traces for security reasons\n error.stack = \"\";\n serialized[key] = error;\n }\n } else {\n serialized[key] = val;\n }\n }\n return serialized;\n}\nconst ViewTransitionContext = /*#__PURE__*/React.createContext({\n isTransitioning: false\n});\nif (process.env.NODE_ENV !== \"production\") {\n ViewTransitionContext.displayName = \"ViewTransition\";\n}\nconst FetchersContext = /*#__PURE__*/React.createContext(new Map());\nif (process.env.NODE_ENV !== \"production\") {\n FetchersContext.displayName = \"Fetchers\";\n}\n//#endregion\n////////////////////////////////////////////////////////////////////////////////\n//#region Components\n////////////////////////////////////////////////////////////////////////////////\n/**\n Webpack + React 17 fails to compile on any of the following because webpack\n complains that `startTransition` doesn't exist in `React`:\n * import { startTransition } from \"react\"\n * import * as React from from \"react\";\n \"startTransition\" in React ? React.startTransition(() => setState()) : setState()\n * import * as React from from \"react\";\n \"startTransition\" in React ? React[\"startTransition\"](() => setState()) : setState()\n\n Moving it to a constant such as the following solves the Webpack/React 17 issue:\n * import * as React from from \"react\";\n const START_TRANSITION = \"startTransition\";\n START_TRANSITION in React ? React[START_TRANSITION](() => setState()) : setState()\n\n However, that introduces webpack/terser minification issues in production builds\n in React 18 where minification/obfuscation ends up removing the call of\n React.startTransition entirely from the first half of the ternary. Grabbing\n this exported reference once up front resolves that issue.\n\n See https://github.com/remix-run/react-router/issues/10579\n*/\nconst START_TRANSITION = \"startTransition\";\nconst startTransitionImpl = React[START_TRANSITION];\nconst FLUSH_SYNC = \"flushSync\";\nconst flushSyncImpl = ReactDOM[FLUSH_SYNC];\nconst USE_ID = \"useId\";\nconst useIdImpl = React[USE_ID];\nfunction startTransitionSafe(cb) {\n if (startTransitionImpl) {\n startTransitionImpl(cb);\n } else {\n cb();\n }\n}\nfunction flushSyncSafe(cb) {\n if (flushSyncImpl) {\n flushSyncImpl(cb);\n } else {\n cb();\n }\n}\nclass Deferred {\n constructor() {\n this.status = \"pending\";\n this.promise = new Promise((resolve, reject) => {\n this.resolve = value => {\n if (this.status === \"pending\") {\n this.status = \"resolved\";\n resolve(value);\n }\n };\n this.reject = reason => {\n if (this.status === \"pending\") {\n this.status = \"rejected\";\n reject(reason);\n }\n };\n });\n }\n}\n/**\n * Given a Remix Router instance, render the appropriate UI\n */\nfunction RouterProvider(_ref) {\n let {\n fallbackElement,\n router,\n future\n } = _ref;\n let [state, setStateImpl] = React.useState(router.state);\n let [pendingState, setPendingState] = React.useState();\n let [vtContext, setVtContext] = React.useState({\n isTransitioning: false\n });\n let [renderDfd, setRenderDfd] = React.useState();\n let [transition, setTransition] = React.useState();\n let [interruption, setInterruption] = React.useState();\n let fetcherData = React.useRef(new Map());\n let {\n v7_startTransition\n } = future || {};\n let optInStartTransition = React.useCallback(cb => {\n if (v7_startTransition) {\n startTransitionSafe(cb);\n } else {\n cb();\n }\n }, [v7_startTransition]);\n let setState = React.useCallback((newState, _ref2) => {\n let {\n deletedFetchers,\n flushSync: flushSync,\n viewTransitionOpts: viewTransitionOpts\n } = _ref2;\n newState.fetchers.forEach((fetcher, key) => {\n if (fetcher.data !== undefined) {\n fetcherData.current.set(key, fetcher.data);\n }\n });\n deletedFetchers.forEach(key => fetcherData.current.delete(key));\n let isViewTransitionUnavailable = router.window == null || router.window.document == null || typeof router.window.document.startViewTransition !== \"function\";\n // If this isn't a view transition or it's not available in this browser,\n // just update and be done with it\n if (!viewTransitionOpts || isViewTransitionUnavailable) {\n if (flushSync) {\n flushSyncSafe(() => setStateImpl(newState));\n } else {\n optInStartTransition(() => setStateImpl(newState));\n }\n return;\n }\n // flushSync + startViewTransition\n if (flushSync) {\n // Flush through the context to mark DOM elements as transition=ing\n flushSyncSafe(() => {\n // Cancel any pending transitions\n if (transition) {\n renderDfd && renderDfd.resolve();\n transition.skipTransition();\n }\n setVtContext({\n isTransitioning: true,\n flushSync: true,\n currentLocation: viewTransitionOpts.currentLocation,\n nextLocation: viewTransitionOpts.nextLocation\n });\n });\n // Update the DOM\n let t = router.window.document.startViewTransition(() => {\n flushSyncSafe(() => setStateImpl(newState));\n });\n // Clean up after the animation completes\n t.finished.finally(() => {\n flushSyncSafe(() => {\n setRenderDfd(undefined);\n setTransition(undefined);\n setPendingState(undefined);\n setVtContext({\n isTransitioning: false\n });\n });\n });\n flushSyncSafe(() => setTransition(t));\n return;\n }\n // startTransition + startViewTransition\n if (transition) {\n // Interrupting an in-progress transition, cancel and let everything flush\n // out, and then kick off a new transition from the interruption state\n renderDfd && renderDfd.resolve();\n transition.skipTransition();\n setInterruption({\n state: newState,\n currentLocation: viewTransitionOpts.currentLocation,\n nextLocation: viewTransitionOpts.nextLocation\n });\n } else {\n // Completed navigation update with opted-in view transitions, let 'er rip\n setPendingState(newState);\n setVtContext({\n isTransitioning: true,\n flushSync: false,\n currentLocation: viewTransitionOpts.currentLocation,\n nextLocation: viewTransitionOpts.nextLocation\n });\n }\n }, [router.window, transition, renderDfd, fetcherData, optInStartTransition]);\n // Need to use a layout effect here so we are subscribed early enough to\n // pick up on any render-driven redirects/navigations (useEffect/<Navigate>)\n React.useLayoutEffect(() => router.subscribe(setState), [router, setState]);\n // When we start a view transition, create a Deferred we can use for the\n // eventual \"completed\" render\n React.useEffect(() => {\n if (vtContext.isTransitioning && !vtContext.flushSync) {\n setRenderDfd(new Deferred());\n }\n }, [vtContext]);\n // Once the deferred is created, kick off startViewTransition() to update the\n // DOM and then wait on the Deferred to resolve (indicating the DOM update has\n // happened)\n React.useEffect(() => {\n if (renderDfd && pendingState && router.window) {\n let newState = pendingState;\n let renderPromise = renderDfd.promise;\n let transition = router.window.document.startViewTransition(async () => {\n optInStartTransition(() => setStateImpl(newState));\n await renderPromise;\n });\n transition.finished.finally(() => {\n setRenderDfd(undefined);\n setTransition(undefined);\n setPendingState(undefined);\n setVtContext({\n isTransitioning: false\n });\n });\n setTransition(transition);\n }\n }, [optInStartTransition, pendingState, renderDfd, router.window]);\n // When the new location finally renders and is committed to the DOM, this\n // effect will run to resolve the transition\n React.useEffect(() => {\n if (renderDfd && pendingState && state.location.key === pendingState.location.key) {\n renderDfd.resolve();\n }\n }, [renderDfd, transition, state.location, pendingState]);\n // If we get interrupted with a new navigation during a transition, we skip\n // the active transition, let it cleanup, then kick it off again here\n React.useEffect(() => {\n if (!vtContext.isTransitioning && interruption) {\n setPendingState(interruption.state);\n setVtContext({\n isTransitioning: true,\n flushSync: false,\n currentLocation: interruption.currentLocation,\n nextLocation: interruption.nextLocation\n });\n setInterruption(undefined);\n }\n }, [vtContext.isTransitioning, interruption]);\n React.useEffect(() => {\n process.env.NODE_ENV !== \"production\" ? UNSAFE_warning(fallbackElement == null || !router.future.v7_partialHydration, \"`<RouterProvider fallbackElement>` is deprecated when using \" + \"`v7_partialHydration`, use a `HydrateFallback` component instead\") : void 0;\n // Only log this once on initial mount\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n let navigator = React.useMemo(() => {\n return {\n createHref: router.createHref,\n encodeLocation: router.encodeLocation,\n go: n => router.navigate(n),\n push: (to, state, opts) => router.navigate(to, {\n state,\n preventScrollReset: opts == null ? void 0 : opts.preventScrollReset\n }),\n replace: (to, state, opts) => router.navigate(to, {\n replace: true,\n state,\n preventScrollReset: opts == null ? void 0 : opts.preventScrollReset\n })\n };\n }, [router]);\n let basename = router.basename || \"/\";\n let dataRouterContext = React.useMemo(() => ({\n router,\n navigator,\n static: false,\n basename\n }), [router, navigator, basename]);\n let routerFuture = React.useMemo(() => ({\n v7_relativeSplatPath: router.future.v7_relativeSplatPath\n }), [router.future.v7_relativeSplatPath]);\n React.useEffect(() => UNSAFE_logV6DeprecationWarnings(future, router.future), [future, router.future]);\n // The fragment and {null} here are important! We need them to keep React 18's\n // useId happy when we are server-rendering since we may have a <script> here\n // containing the hydrated server-side staticContext (from StaticRouterProvider).\n // useId relies on the component tree structure to generate deterministic id's\n // so we need to ensure it remains the same on the client even though\n // we don't need the <script> tag\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(UNSAFE_DataRouterContext.Provider, {\n value: dataRouterContext\n }, /*#__PURE__*/React.createElement(UNSAFE_DataRouterStateContext.Provider, {\n value: state\n }, /*#__PURE__*/React.createElement(FetchersContext.Provider, {\n value: fetcherData.current\n }, /*#__PURE__*/React.createElement(ViewTransitionContext.Provider, {\n value: vtContext\n }, /*#__PURE__*/React.createElement(Router, {\n basename: basename,\n location: state.location,\n navigationType: state.historyAction,\n navigator: navigator,\n future: routerFuture\n }, state.initialized || router.future.v7_partialHydration ? /*#__PURE__*/React.createElement(MemoizedDataRoutes, {\n routes: router.routes,\n future: router.future,\n state: state\n }) : fallbackElement))))), null);\n}\n// Memoize to avoid re-renders when updating `ViewTransitionContext`\nconst MemoizedDataRoutes = /*#__PURE__*/React.memo(DataRoutes);\nfunction DataRoutes(_ref3) {\n let {\n routes,\n future,\n state\n } = _ref3;\n return UNSAFE_useRoutesImpl(routes, undefined, state, future);\n}\n/**\n * A `<Router>` for use in web browsers. Provides the cleanest URLs.\n */\nfunction BrowserRouter(_ref4) {\n let {\n basename,\n children,\n future,\n window\n } = _ref4;\n let historyRef = React.useRef();\n if (historyRef.current == null) {\n historyRef.current = createBrowserHistory({\n window,\n v5Compat: true\n });\n }\n let history = historyRef.current;\n let [state, setStateImpl] = React.useState({\n action: history.action,\n location: history.location\n });\n let {\n v7_startTransition\n } = future || {};\n let setState = React.useCallback(newState => {\n v7_startTransition && startTransitionImpl ? startTransitionImpl(() => setStateImpl(newState)) : setStateImpl(newState);\n }, [setStateImpl, v7_startTransition]);\n React.useLayoutEffect(() => history.listen(setState), [history, setState]);\n React.useEffect(() => UNSAFE_logV6DeprecationWarnings(future), [future]);\n return /*#__PURE__*/React.createElement(Router, {\n basename: basename,\n children: children,\n location: state.location,\n navigationType: state.action,\n navigator: history,\n future: future\n });\n}\n/**\n * A `<Router>` for use in web browsers. Stores the location in the hash\n * portion of the URL so it is not sent to the server.\n */\nfunction HashRouter(_ref5) {\n let {\n basename,\n children,\n future,\n window\n } = _ref5;\n let historyRef = React.useRef();\n if (historyRef.current == null) {\n historyRef.current = createHashHistory({\n window,\n v5Compat: true\n });\n }\n let history = historyRef.current;\n let [state, setStateImpl] = React.useState({\n action: history.action,\n location: history.location\n });\n let {\n v7_startTransition\n } = future || {};\n let setState = React.useCallback(newState => {\n v7_startTransition && startTransitionImpl ? startTransitionImpl(() => setStateImpl(newState)) : setStateImpl(newState);\n }, [setStateImpl, v7_startTransition]);\n React.useLayoutEffect(() => history.listen(setState), [history, setState]);\n React.useEffect(() => UNSAFE_logV6DeprecationWarnings(future), [future]);\n return /*#__PURE__*/React.createElement(Router, {\n basename: basename,\n children: children,\n location: state.location,\n navigationType: state.action,\n navigator: history,\n future: future\n });\n}\n/**\n * A `<Router>` that accepts a pre-instantiated history object. It's important\n * to note that using your own history object is highly discouraged and may add\n * two versions of the history library to your bundles unless you use the same\n * version of the history library that React Router uses internally.\n */\nfunction HistoryRouter(_ref6) {\n let {\n basename,\n children,\n future,\n history\n } = _ref6;\n let [state, setStateImpl] = React.useState({\n action: history.action,\n location: history.location\n });\n let {\n v7_startTransition\n } = future || {};\n let setState = React.useCallback(newState => {\n v7_startTransition && startTransitionImpl ? startTransitionImpl(() => setStateImpl(newState)) : setStateImpl(newState);\n }, [setStateImpl, v7_startTransition]);\n React.useLayoutEffect(() => history.listen(setState), [history, setState]);\n React.useEffect(() => UNSAFE_logV6DeprecationWarnings(future), [future]);\n return /*#__PURE__*/React.createElement(Router, {\n basename: basename,\n children: children,\n location: state.location,\n navigationType: state.action,\n navigator: history,\n future: future\n });\n}\nif (process.env.NODE_ENV !== \"production\") {\n HistoryRouter.displayName = \"unstable_HistoryRouter\";\n}\nconst isBrowser = typeof window !== \"undefined\" && typeof window.document !== \"undefined\" && typeof window.document.createElement !== \"undefined\";\nconst ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\\/\\/)/i;\n/**\n * The public API for rendering a history-aware `<a>`.\n */\nconst Link = /*#__PURE__*/React.forwardRef(function LinkWithRef(_ref7, ref) {\n let {\n onClick,\n relative,\n reloadDocument,\n replace,\n state,\n target,\n to,\n preventScrollReset,\n viewTransition\n } = _ref7,\n rest = _objectWithoutPropertiesLoose(_ref7, _excluded);\n let {\n basename\n } = React.useContext(UNSAFE_NavigationContext);\n // Rendered into <a href> for absolute URLs\n let absoluteHref;\n let isExternal = false;\n if (typeof to === \"string\" && ABSOLUTE_URL_REGEX.test(to)) {\n // Render the absolute href server- and client-side\n absoluteHref = to;\n // Only check for external origins client-side\n if (isBrowser) {\n try {\n let currentUrl = new URL(window.location.href);\n let targetUrl = to.startsWith(\"//\") ? new URL(currentUrl.protocol + to) : new URL(to);\n let path = stripBasename(targetUrl.pathname, basename);\n if (targetUrl.origin === currentUrl.origin && path != null) {\n // Strip the protocol/origin/basename for same-origin absolute URLs\n to = path + targetUrl.search + targetUrl.hash;\n } else {\n isExternal = true;\n }\n } catch (e) {\n // We can't do external URL detection without a valid URL\n process.env.NODE_ENV !== \"production\" ? UNSAFE_warning(false, \"<Link to=\\\"\" + to + \"\\\"> contains an invalid URL which will probably break \" + \"when clicked - please update to a valid URL path.\") : void 0;\n }\n }\n }\n // Rendered into <a href> for relative URLs\n let href = useHref(to, {\n relative\n });\n let internalOnClick = useLinkClickHandler(to, {\n replace,\n state,\n target,\n preventScrollReset,\n relative,\n viewTransition\n });\n function handleClick(event) {\n if (onClick) onClick(event);\n if (!event.defaultPrevented) {\n internalOnClick(event);\n }\n }\n return (\n /*#__PURE__*/\n // eslint-disable-next-line jsx-a11y/anchor-has-content\n React.createElement(\"a\", _extends({}, rest, {\n href: absoluteHref || href,\n onClick: isExternal || reloadDocument ? onClick : handleClick,\n ref: ref,\n target: target\n }))\n );\n});\nif (process.env.NODE_ENV !== \"production\") {\n Link.displayName = \"Link\";\n}\n/**\n * A `<Link>` wrapper that knows if it's \"active\" or not.\n */\nconst NavLink = /*#__PURE__*/React.forwardRef(function NavLinkWithRef(_ref8, ref) {\n let {\n \"aria-current\": ariaCurrentProp = \"page\",\n caseSensitive = false,\n className: classNameProp = \"\",\n end = false,\n style: styleProp,\n to,\n viewTransition,\n children\n } = _ref8,\n rest = _objectWithoutPropertiesLoose(_ref8, _excluded2);\n let path = useResolvedPath(to, {\n relative: rest.relative\n });\n let location = useLocation();\n let routerState = React.useContext(UNSAFE_DataRouterStateContext);\n let {\n navigator,\n basename\n } = React.useContext(UNSAFE_NavigationContext);\n let isTransitioning = routerState != null &&\n // Conditional usage is OK here because the usage of a data router is static\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useViewTransitionState(path) && viewTransition === true;\n let toPathname = navigator.encodeLocation ? navigator.encodeLocation(path).pathname : path.pathname;\n let locationPathname = location.pathname;\n let nextLocationPathname = routerState && routerState.navigation && routerState.navigation.location ? routerState.navigation.location.pathname : null;\n if (!caseSensitive) {\n locationPathname = locationPathname.toLowerCase();\n nextLocationPathname = nextLocationPathname ? nextLocationPathname.toLowerCase() : null;\n toPathname = toPathname.toLowerCase();\n }\n if (nextLocationPathname && basename) {\n nextLocationPathname = stripBasename(nextLocationPathname, basename) || nextLocationPathname;\n }\n // If the `to` has a trailing slash, look at that exact spot. Otherwise,\n // we're looking for a slash _after_ what's in `to`. For example:\n //\n // <NavLink to=\"/users\"> and <NavLink to=\"/users/\">\n // both want to look for a / at index 6 to match URL `/users/matt`\n const endSlashPosition = toPathname !== \"/\" && toPathname.endsWith(\"/\") ? toPathname.length - 1 : toPathname.length;\n let isActive = locationPathname === toPathname || !end && locationPathname.startsWith(toPathname) && locationPathname.charAt(endSlashPosition) === \"/\";\n let isPending = nextLocationPathname != null && (nextLocationPathname === toPathname || !end && nextLocationPathname.startsWith(toPathname) && nextLocationPathname.charAt(toPathname.length) === \"/\");\n let renderProps = {\n isActive,\n isPending,\n isTransitioning\n };\n let ariaCurrent = isActive ? ariaCurrentProp : undefined;\n let className;\n if (typeof classNameProp === \"function\") {\n className = classNameProp(renderProps);\n } else {\n // If the className prop is not a function, we use a default `active`\n // class for <NavLink />s that are active. In v5 `active` was the default\n // value for `activeClassName`, but we are removing that API and can still\n // use the old default behavior for a cleaner upgrade path and keep the\n // simple styling rules working as they currently do.\n className = [classNameProp, isActive ? \"active\" : null, isPending ? \"pending\" : null, isTransitioning ? \"transitioning\" : null].filter(Boolean).join(\" \");\n }\n let style = typeof styleProp === \"function\" ? styleProp(renderProps) : styleProp;\n return /*#__PURE__*/React.createElement(Link, _extends({}, rest, {\n \"aria-current\": ariaCurrent,\n className: className,\n ref: ref,\n style: style,\n to: to,\n viewTransition: viewTransition\n }), typeof children === \"function\" ? children(renderProps) : children);\n});\nif (process.env.NODE_ENV !== \"production\") {\n NavLink.displayName = \"NavLink\";\n}\n/**\n * A `@remix-run/router`-aware `<form>`. It behaves like a normal form except\n * that the interaction with the server is with `fetch` instead of new document\n * requests, allowing components to add nicer UX to the page as the form is\n * submitted and returns with data.\n */\nconst Form = /*#__PURE__*/React.forwardRef((_ref9, forwardedRef) => {\n let {\n fetcherKey,\n navigate,\n reloadDocument,\n replace,\n state,\n method = defaultMethod,\n action,\n onSubmit,\n relative,\n preventScrollReset,\n viewTransition\n } = _ref9,\n props = _objectWithoutPropertiesLoose(_ref9, _excluded3);\n let submit = useSubmit();\n let formAction = useFormAction(action, {\n relative\n });\n let formMethod = method.toLowerCase() === \"get\" ? \"get\" : \"post\";\n let submitHandler = event => {\n onSubmit && onSubmit(event);\n if (event.defaultPrevented) return;\n event.preventDefault();\n let submitter = event.nativeEvent.submitter;\n let submitMethod = (submitter == null ? void 0 : submitter.getAttribute(\"formmethod\")) || method;\n submit(submitter || event.currentTarget, {\n fetcherKey,\n method: submitMethod,\n navigate,\n replace,\n state,\n relative,\n preventScrollReset,\n viewTransition\n });\n };\n return /*#__PURE__*/React.createElement(\"form\", _extends({\n ref: forwardedRef,\n method: formMethod,\n action: formAction,\n onSubmit: reloadDocument ? onSubmit : submitHandler\n }, props));\n});\nif (process.env.NODE_ENV !== \"production\") {\n Form.displayName = \"Form\";\n}\n/**\n * This component will emulate the browser's scroll restoration on location\n * changes.\n */\nfunction ScrollRestoration(_ref10) {\n let {\n getKey,\n storageKey\n } = _ref10;\n useScrollRestoration({\n getKey,\n storageKey\n });\n return null;\n}\nif (process.env.NODE_ENV !== \"production\") {\n ScrollRestoration.displayName = \"ScrollRestoration\";\n}\n//#endregion\n////////////////////////////////////////////////////////////////////////////////\n//#region Hooks\n////////////////////////////////////////////////////////////////////////////////\nvar DataRouterHook;\n(function (DataRouterHook) {\n DataRouterHook[\"UseScrollRestoration\"] = \"useScrollRestoration\";\n DataRouterHook[\"UseSubmit\"] = \"useSubmit\";\n DataRouterHook[\"UseSubmitFetcher\"] = \"useSubmitFetcher\";\n DataRouterHook[\"UseFetcher\"] = \"useFetcher\";\n DataRouterHook[\"useViewTransitionState\"] = \"useViewTransitionState\";\n})(DataRouterHook || (DataRouterHook = {}));\nvar DataRouterStateHook;\n(function (DataRouterStateHook) {\n DataRouterStateHook[\"UseFetcher\"] = \"useFetcher\";\n DataRouterStateHook[\"UseFetchers\"] = \"useFetchers\";\n DataRouterStateHook[\"UseScrollRestoration\"] = \"useScrollRestoration\";\n})(DataRouterStateHook || (DataRouterStateHook = {}));\n// Internal hooks\nfunction getDataRouterConsoleError(hookName) {\n return hookName + \" must be used within a data router. See https://reactrouter.com/v6/routers/picking-a-router.\";\n}\nfunction useDataRouterContext(hookName) {\n let ctx = React.useContext(UNSAFE_DataRouterContext);\n !ctx ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, getDataRouterConsoleError(hookName)) : UNSAFE_invariant(false) : void 0;\n return ctx;\n}\nfunction useDataRouterState(hookName) {\n let state = React.useContext(UNSAFE_DataRouterStateContext);\n !state ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, getDataRouterConsoleError(hookName)) : UNSAFE_invariant(false) : void 0;\n return state;\n}\n// External hooks\n/**\n * Handles the click behavior for router `<Link>` components. This is useful if\n * you need to create custom `<Link>` components with the same click behavior we\n * use in our exported `<Link>`.\n */\nfunction useLinkClickHandler(to, _temp) {\n let {\n target,\n replace: replaceProp,\n state,\n preventScrollReset,\n relative,\n viewTransition\n } = _temp === void 0 ? {} : _temp;\n let navigate = useNavigate();\n let location = useLocation();\n let path = useResolvedPath(to, {\n relative\n });\n return React.useCallback(event => {\n if (shouldProcessLinkClick(event, target)) {\n event.preventDefault();\n // If the URL hasn't changed, a regular <a> will do a replace instead of\n // a push, so do the same here unless the replace prop is explicitly set\n let replace = replaceProp !== undefined ? replaceProp : createPath(location) === createPath(path);\n navigate(to, {\n replace,\n state,\n preventScrollReset,\n relative,\n viewTransition\n });\n }\n }, [location, navigate, path, replaceProp, state, target, to, preventScrollReset, relative, viewTransition]);\n}\n/**\n * A convenient wrapper for reading and writing search parameters via the\n * URLSearchParams interface.\n */\nfunction useSearchParams(defaultInit) {\n process.env.NODE_ENV !== \"production\" ? UNSAFE_warning(typeof URLSearchParams !== \"undefined\", \"You cannot use the `useSearchParams` hook in a browser that does not \" + \"support the URLSearchParams API. If you need to support Internet \" + \"Explorer 11, we recommend you load a polyfill such as \" + \"https://github.com/ungap/url-search-params.\") : void 0;\n let defaultSearchParamsRef = React.useRef(createSearchParams(defaultInit));\n let hasSetSearchParamsRef = React.useRef(false);\n let location = useLocation();\n let searchParams = React.useMemo(() =>\n // Only merge in the defaults if we haven't yet called setSearchParams.\n // Once we call that we want those to take precedence, otherwise you can't\n // remove a param with setSearchParams({}) if it has an initial value\n getSearchParamsForLocation(location.search, hasSetSearchParamsRef.current ? null : defaultSearchParamsRef.current), [location.search]);\n let navigate = useNavigate();\n let setSearchParams = React.useCallback((nextInit, navigateOptions) => {\n const newSearchParams = createSearchParams(typeof nextInit === \"function\" ? nextInit(searchParams) : nextInit);\n hasSetSearchParamsRef.current = true;\n navigate(\"?\" + newSearchParams, navigateOptions);\n }, [navigate, searchParams]);\n return [searchParams, setSearchParams];\n}\nfunction validateClientSideSubmission() {\n if (typeof document === \"undefined\") {\n throw new Error(\"You are calling submit during the server render. \" + \"Try calling submit within a `useEffect` or callback instead.\");\n }\n}\nlet fetcherId = 0;\nlet getUniqueFetcherId = () => \"__\" + String(++fetcherId) + \"__\";\n/**\n * Returns a function that may be used to programmatically submit a form (or\n * some arbitrary data) to the server.\n */\nfunction useSubmit() {\n let {\n router\n } = useDataRouterContext(DataRouterHook.UseSubmit);\n let {\n basename\n } = React.useContext(UNSAFE_NavigationContext);\n let currentRouteId = UNSAFE_useRouteId();\n return React.useCallback(function (target, options) {\n if (options === void 0) {\n options = {};\n }\n validateClientSideSubmission();\n let {\n action,\n method,\n encType,\n formData,\n body\n } = getFormSubmissionInfo(target, basename);\n if (options.navigate === false) {\n let key = options.fetcherKey || getUniqueFetcherId();\n router.fetch(key, currentRouteId, options.action || action, {\n preventScrollReset: options.preventScrollReset,\n formData,\n body,\n formMethod: options.method || method,\n formEncType: options.encType || encType,\n flushSync: options.flushSync\n });\n } else {\n router.navigate(options.action || action, {\n preventScrollReset: options.preventScrollReset,\n formData,\n body,\n formMethod: options.method || method,\n formEncType: options.encType || encType,\n replace: options.replace,\n state: options.state,\n fromRouteId: currentRouteId,\n flushSync: options.flushSync,\n viewTransition: options.viewTransition\n });\n }\n }, [router, basename, currentRouteId]);\n}\n// v7: Eventually we should deprecate this entirely in favor of using the\n// router method directly?\nfunction useFormAction(action, _temp2) {\n let {\n relative\n } = _temp2 === void 0 ? {} : _temp2;\n let {\n basename\n } = React.useContext(UNSAFE_NavigationContext);\n let routeContext = React.useContext(UNSAFE_RouteContext);\n !routeContext ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, \"useFormAction must be used inside a RouteContext\") : UNSAFE_invariant(false) : void 0;\n let [match] = routeContext.matches.slice(-1);\n // Shallow clone path so we can modify it below, otherwise we modify the\n // object referenced by useMemo inside useResolvedPath\n let path = _extends({}, useResolvedPath(action ? action : \".\", {\n relative\n }));\n // If no action was specified, browsers will persist current search params\n // when determining the path, so match that behavior\n // https://github.com/remix-run/remix/issues/927\n let location = useLocation();\n if (action == null) {\n // Safe to write to this directly here since if action was undefined, we\n // would have called useResolvedPath(\".\") which will never include a search\n path.search = location.search;\n // When grabbing search params from the URL, remove any included ?index param\n // since it might not apply to our contextual route. We add it back based\n // on match.route.index below\n let params = new URLSearchParams(path.search);\n let indexValues = params.getAll(\"index\");\n let hasNakedIndexParam = indexValues.some(v => v === \"\");\n if (hasNakedIndexParam) {\n params.delete(\"index\");\n indexValues.filter(v => v).forEach(v => params.append(\"index\", v));\n let qs = params.toString();\n path.search = qs ? \"?\" + qs : \"\";\n }\n }\n if ((!action || action === \".\") && match.route.index) {\n path.search = path.search ? path.search.replace(/^\\?/, \"?index&\") : \"?index\";\n }\n // If we're operating within a basename, prepend it to the pathname prior\n // to creating the form action. If this is a root navigation, then just use\n // the raw basename which allows the basename to have full control over the\n // presence of a trailing slash on root actions\n if (basename !== \"/\") {\n path.pathname = path.pathname === \"/\" ? basename : joinPaths([basename, path.pathname]);\n }\n return createPath(path);\n}\n// TODO: (v7) Change the useFetcher generic default from `any` to `unknown`\n/**\n * Interacts with route loaders and actions without causing a navigation. Great\n * for any interaction that stays on the same page.\n */\nfunction useFetcher(_temp3) {\n var _route$matches;\n let {\n key\n } = _temp3 === void 0 ? {} : _temp3;\n let {\n router\n } = useDataRouterContext(DataRouterHook.UseFetcher);\n let state = useDataRouterState(DataRouterStateHook.UseFetcher);\n let fetcherData = React.useContext(FetchersContext);\n let route = React.useContext(UNSAFE_RouteContext);\n let routeId = (_route$matches = route.matches[route.matches.length - 1]) == null ? void 0 : _route$matches.route.id;\n !fetcherData ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, \"useFetcher must be used inside a FetchersContext\") : UNSAFE_invariant(false) : void 0;\n !route ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, \"useFetcher must be used inside a RouteContext\") : UNSAFE_invariant(false) : void 0;\n !(routeId != null) ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, \"useFetcher can only be used on routes that contain a unique \\\"id\\\"\") : UNSAFE_invariant(false) : void 0;\n // Fetcher key handling\n // OK to call conditionally to feature detect `useId`\n // eslint-disable-next-line react-hooks/rules-of-hooks\n let defaultKey = useIdImpl ? useIdImpl() : \"\";\n let [fetcherKey, setFetcherKey] = React.useState(key || defaultKey);\n if (key && key !== fetcherKey) {\n setFetcherKey(key);\n } else if (!fetcherKey) {\n // We will only fall through here when `useId` is not available\n setFetcherKey(getUniqueFetcherId());\n }\n // Registration/cleanup\n React.useEffect(() => {\n router.getFetcher(fetcherKey);\n return () => {\n // Tell the router we've unmounted - if v7_fetcherPersist is enabled this\n // will not delete immediately but instead queue up a delete after the\n // fetcher returns to an `idle` state\n router.deleteFetcher(fetcherKey);\n };\n }, [router, fetcherKey]);\n // Fetcher additions\n let load = React.useCallback((href, opts) => {\n !routeId ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, \"No routeId available for fetcher.load()\") : UNSAFE_invariant(false) : void 0;\n router.fetch(fetcherKey, routeId, href, opts);\n }, [fetcherKey, routeId, router]);\n let submitImpl = useSubmit();\n let submit = React.useCallback((target, opts) => {\n submitImpl(target, _extends({}, opts, {\n navigate: false,\n fetcherKey\n }));\n }, [fetcherKey, submitImpl]);\n let FetcherForm = React.useMemo(() => {\n let FetcherForm = /*#__PURE__*/React.forwardRef((props, ref) => {\n return /*#__PURE__*/React.createElement(Form, _extends({}, props, {\n navigate: false,\n fetcherKey: fetcherKey,\n ref: ref\n }));\n });\n if (process.env.NODE_ENV !== \"production\") {\n FetcherForm.displayName = \"fetcher.Form\";\n }\n return FetcherForm;\n }, [fetcherKey]);\n // Exposed FetcherWithComponents\n let fetcher = state.fetchers.get(fetcherKey) || IDLE_FETCHER;\n let data = fetcherData.get(fetcherKey);\n let fetcherWithComponents = React.useMemo(() => _extends({\n Form: FetcherForm,\n submit,\n load\n }, fetcher, {\n data\n }), [FetcherForm, submit, load, fetcher, data]);\n return fetcherWithComponents;\n}\n/**\n * Provides all fetchers currently on the page. Useful for layouts and parent\n * routes that need to provide pending/optimistic UI regarding the fetch.\n */\nfunction useFetchers() {\n let state = useDataRouterState(DataRouterStateHook.UseFetchers);\n return Array.from(state.fetchers.entries()).map(_ref11 => {\n let [key, fetcher] = _ref11;\n return _extends({}, fetcher, {\n key\n });\n });\n}\nconst SCROLL_RESTORATION_STORAGE_KEY = \"react-router-scroll-positions\";\nlet savedScrollPositions = {};\n/**\n * When rendered inside a RouterProvider, will restore scroll positions on navigations\n */\nfunction useScrollRestoration(_temp4) {\n let {\n getKey,\n storageKey\n } = _temp4 === void 0 ? {} : _temp4;\n let {\n router\n } = useDataRouterContext(DataRouterHook.UseScrollRestoration);\n let {\n restoreScrollPosition,\n preventScrollReset\n } = useDataRouterState(DataRouterStateHook.UseScrollRestoration);\n let {\n basename\n } = React.useContext(UNSAFE_NavigationContext);\n let location = useLocation();\n let matches = useMatches();\n let navigation = useNavigation();\n // Trigger manual scroll restoration while we're active\n React.useEffect(() => {\n window.history.scrollRestoration = \"manual\";\n return () => {\n window.history.scrollRestoration = \"auto\";\n };\n }, []);\n // Save positions on pagehide\n usePageHide(React.useCallback(() => {\n if (navigation.state === \"idle\") {\n let key = (getKey ? getKey(location, matches) : null) || location.key;\n savedScrollPositions[key] = window.scrollY;\n }\n try {\n sessionStorage.setItem(storageKey || SCROLL_RESTORATION_STORAGE_KEY, JSON.stringify(savedScrollPositions));\n } catch (error) {\n process.env.NODE_ENV !== \"production\" ? UNSAFE_warning(false, \"Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (\" + error + \").\") : void 0;\n }\n window.history.scrollRestoration = \"auto\";\n }, [storageKey, getKey, navigation.state, location, matches]));\n // Read in any saved scroll locations\n if (typeof document !== \"undefined\") {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useLayoutEffect(() => {\n try {\n let sessionPositions = sessionStorage.getItem(storageKey || SCROLL_RESTORATION_STORAGE_KEY);\n if (sessionPositions) {\n savedScrollPositions = JSON.parse(sessionPositions);\n }\n } catch (e) {\n // no-op, use default empty object\n }\n }, [storageKey]);\n // Enable scroll restoration in the router\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useLayoutEffect(() => {\n let getKeyWithoutBasename = getKey && basename !== \"/\" ? (location, matches) => getKey( // Strip the basename to match useLocation()\n _extends({}, location, {\n pathname: stripBasename(location.pathname, basename) || location.pathname\n }), matches) : getKey;\n let disableScrollRestoration = router == null ? void 0 : router.enableScrollRestoration(savedScrollPositions, () => window.scrollY, getKeyWithoutBasename);\n return () => disableScrollRestoration && disableScrollRestoration();\n }, [router, basename, getKey]);\n // Restore scrolling when state.restoreScrollPosition changes\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useLayoutEffect(() => {\n // Explicit false means don't do anything (used for submissions)\n if (restoreScrollPosition === false) {\n return;\n }\n // been here before, scroll to it\n if (typeof restoreScrollPosition === \"number\") {\n window.scrollTo(0, restoreScrollPosition);\n return;\n }\n // try to scroll to the hash\n if (location.hash) {\n let el = document.getElementById(decodeURIComponent(location.hash.slice(1)));\n if (el) {\n el.scrollIntoView();\n return;\n }\n }\n // Don't reset if this navigation opted out\n if (preventScrollReset === true) {\n return;\n }\n // otherwise go to the top on new locations\n window.scrollTo(0, 0);\n }, [location, restoreScrollPosition, preventScrollReset]);\n }\n}\n/**\n * Setup a callback to be fired on the window's `beforeunload` event. This is\n * useful for saving some data to `window.localStorage` just before the page\n * refreshes.\n *\n * Note: The `callback` argument should be a function created with\n * `React.useCallback()`.\n */\nfunction useBeforeUnload(callback, options) {\n let {\n capture\n } = options || {};\n React.useEffect(() => {\n let opts = capture != null ? {\n capture\n } : undefined;\n window.addEventListener(\"beforeunload\", callback, opts);\n return () => {\n window.removeEventListener(\"beforeunload\", callback, opts);\n };\n }, [callback, capture]);\n}\n/**\n * Setup a callback to be fired on the window's `pagehide` event. This is\n * useful for saving some data to `window.localStorage` just before the page\n * refreshes. This event is better supported than beforeunload across browsers.\n *\n * Note: The `callback` argument should be a function created with\n * `React.useCallback()`.\n */\nfunction usePageHide(callback, options) {\n let {\n capture\n } = options || {};\n React.useEffect(() => {\n let opts = capture != null ? {\n capture\n } : undefined;\n window.addEventListener(\"pagehide\", callback, opts);\n return () => {\n window.removeEventListener(\"pagehide\", callback, opts);\n };\n }, [callback, capture]);\n}\n/**\n * Wrapper around useBlocker to show a window.confirm prompt to users instead\n * of building a custom UI with useBlocker.\n *\n * Warning: This has *a lot of rough edges* and behaves very differently (and\n * very incorrectly in some cases) across browsers if user click addition\n * back/forward navigations while the confirm is open. Use at your own risk.\n */\nfunction usePrompt(_ref12) {\n let {\n when,\n message\n } = _ref12;\n let blocker = useBlocker(when);\n React.useEffect(() => {\n if (blocker.state === \"blocked\") {\n let proceed = window.confirm(message);\n if (proceed) {\n // This timeout is needed to avoid a weird \"race\" on POP navigations\n // between the `window.history` revert navigation and the result of\n // `window.confirm`\n setTimeout(blocker.proceed, 0);\n } else {\n blocker.reset();\n }\n }\n }, [blocker, message]);\n React.useEffect(() => {\n if (blocker.state === \"blocked\" && !when) {\n blocker.reset();\n }\n }, [blocker, when]);\n}\n/**\n * Return a boolean indicating if there is an active view transition to the\n * given href. You can use this value to render CSS classes or viewTransitionName\n * styles onto your elements\n *\n * @param href The destination href\n * @param [opts.relative] Relative routing type (\"route\" | \"path\")\n */\nfunction useViewTransitionState(to, opts) {\n if (opts === void 0) {\n opts = {};\n }\n let vtContext = React.useContext(ViewTransitionContext);\n !(vtContext != null) ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, \"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. \" + \"Did you accidentally import `RouterProvider` from `react-router`?\") : UNSAFE_invariant(false) : void 0;\n let {\n basename\n } = useDataRouterContext(DataRouterHook.useViewTransitionState);\n let path = useResolvedPath(to, {\n relative: opts.relative\n });\n if (!vtContext.isTransitioning) {\n return false;\n }\n let currentPath = stripBasename(vtContext.currentLocation.pathname, basename) || vtContext.currentLocation.pathname;\n let nextPath = stripBasename(vtContext.nextLocation.pathname, basename) || vtContext.nextLocation.pathname;\n // Transition is active if we're going to or coming from the indicated\n // destination. This ensures that other PUSH navigations that reverse\n // an indicated transition apply. I.e., on the list view you have:\n //\n // <NavLink to=\"/details/1\" viewTransition>\n //\n // If you click the breadcrumb back to the list view:\n //\n // <NavLink to=\"/list\" viewTransition>\n //\n // We should apply the transition because it's indicated as active going\n // from /list -> /details/1 and therefore should be active on the reverse\n // (even though this isn't strictly a POP reverse)\n return matchPath(path.pathname, nextPath) != null || matchPath(path.pathname, currentPath) != null;\n}\n//#endregion\n\nexport { BrowserRouter, Form, HashRouter, Link, NavLink, RouterProvider, ScrollRestoration, FetchersContext as UNSAFE_FetchersContext, ViewTransitionContext as UNSAFE_ViewTransitionContext, useScrollRestoration as UNSAFE_useScrollRestoration, createBrowserRouter, createHashRouter, createSearchParams, HistoryRouter as unstable_HistoryRouter, usePrompt as unstable_usePrompt, useBeforeUnload, useFetcher, useFetchers, useFormAction, useLinkClickHandler, useSearchParams, useSubmit, useViewTransitionState };\n//# sourceMappingURL=index.js.map\n","import {\n ToastContainer as BaseToastContainer,\n toast as baseToast,\n type ConnectToastOptions,\n} from '@powerhousedao/design-system';\n\nexport const CONNECT_TOAST_CONTAINER_ID = 'connect';\n\nexport const ToastContainer = () => (\n <BaseToastContainer containerId={CONNECT_TOAST_CONTAINER_ID} />\n);\n\ntype ToastArgs = Parameters<typeof baseToast>;\nexport function toast(content: ToastArgs[0], options?: ConnectToastOptions) {\n const {\n type = 'default',\n containerId = CONNECT_TOAST_CONTAINER_ID,\n ...restOptions\n } = options || {};\n return baseToast(content, { type, containerId, ...restOptions });\n}\n","import { ReloadConnectToast } from '#components';\nimport { useReadModeContext } from '#context';\nimport { useDocumentDriveServer, useMakeUiDriveNode } from '#hooks';\nimport { useAsyncReactor } from '#store';\nimport {\n CONFLICT,\n ERROR,\n LOCAL,\n SUCCESS,\n type UiDriveNode,\n} from '@powerhousedao/design-system';\nimport { useUiNodesContext } from '@powerhousedao/reactor-browser';\nimport { logger, type DocumentDriveDocument } from 'document-drive';\nimport { type TFunction } from 'i18next';\nimport { useCallback, useEffect, useRef } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { toast } from '../services/toast.js';\nimport { useClientErrorHandler } from './useClientErrorHandler.js';\nimport { useConnectConfig } from './useConnectConfig.js';\nimport { useDocumentDrives } from './useDocumentDrives.js';\nimport { isLatestVersion } from './utils.js';\n\nexport const useLoadInitialData = () => {\n const { t } = useTranslation();\n const { documentDrives, onSyncStatus } = useDocumentDriveServer();\n const { driveNodes, setDriveNodes } = useUiNodesContext();\n const prevDrivesState = useRef([...driveNodes]);\n const drivesWithError = useRef<UiDriveNode[]>([]);\n const [, , serverSubscribeUpdates] = useDocumentDrives();\n const { readDrives } = useReadModeContext();\n const clientErrorHandler = useClientErrorHandler();\n const reactor = useAsyncReactor();\n const [connectConfig] = useConnectConfig();\n\n async function checkLatestVersion() {\n const result = await isLatestVersion();\n if (result === null) return;\n if (result.isLatest) {\n return true;\n }\n\n if (\n import.meta.env.MODE === 'development' ||\n connectConfig.studioMode ||\n !connectConfig.warnOutdatedApp\n ) {\n logger.warn(\n `Connect is outdated: \\nCurrent: ${result.currentVersion}\\nLatest: ${result.latestVersion}`,\n );\n } else {\n toast(<ReloadConnectToast />, {\n type: 'connect-warning',\n toastId: 'outdated-app',\n autoClose: false,\n });\n }\n }\n\n useEffect(() => {\n checkLatestVersion().catch(console.error);\n }, []);\n\n useEffect(() => {\n const unsubscribe = serverSubscribeUpdates(clientErrorHandler);\n return unsubscribe;\n }, [serverSubscribeUpdates, documentDrives, clientErrorHandler]);\n\n const checkDrivesErrors = useCallback(\n async (driveNodes: UiDriveNode[], t: TFunction) => {\n driveNodes.forEach(drive => {\n const prevDrive = prevDrivesState.current.find(\n prevDrive => prevDrive.id === drive.id,\n );\n\n if (!prevDrive) return;\n\n if (\n drive.sharingType !== LOCAL &&\n drive.syncStatus === SUCCESS &&\n drivesWithError.current.includes(drive)\n ) {\n // remove the drive from the error list\n drivesWithError.current = drivesWithError.current.filter(\n d => d.id !== drive.id,\n );\n\n return toast(t('notifications.driveSyncSuccess'), {\n type: 'connect-success',\n });\n }\n\n if (\n (drive.syncStatus === CONFLICT ||\n drive.syncStatus === ERROR) &&\n drive.syncStatus !== prevDrive.syncStatus\n ) {\n // add the drive to the error list\n drivesWithError.current.push(drive);\n }\n });\n\n prevDrivesState.current = [...driveNodes];\n\n if (drivesWithError.current.length > 0) {\n const isCurrent = await checkLatestVersion();\n if (isCurrent) {\n drivesWithError.current.forEach(drive => {\n toast(\n t(\n `notifications.${drive.syncStatus === CONFLICT ? 'driveSyncConflict' : 'driveSyncError'}`,\n { drive: drive.name },\n ),\n {\n type: 'connect-warning',\n toastId: `${drive.syncStatus === CONFLICT ? 'driveSyncConflict' : 'driveSyncError'}-${drive.id}`,\n },\n );\n });\n }\n }\n },\n [],\n );\n\n useEffect(() => {\n checkDrivesErrors(driveNodes, t).catch(console.error);\n }, [driveNodes, t, checkDrivesErrors]);\n\n const makeUiDriveNode = useMakeUiDriveNode();\n\n const makeUiDriveNodes = useCallback(\n async (documentDrives: DocumentDriveDocument[]) => {\n return Promise.all(documentDrives.map(makeUiDriveNode));\n },\n [makeUiDriveNode],\n );\n\n const updateUiDriveNodes = useCallback(\n async (documentDrives: DocumentDriveDocument[]) => {\n const uiDriveNodes = await makeUiDriveNodes(documentDrives);\n setDriveNodes(uiDriveNodes);\n },\n [makeUiDriveNodes, setDriveNodes],\n );\n useEffect(() => {\n const drives: DocumentDriveDocument[] = [\n ...readDrives,\n ...documentDrives,\n ];\n updateUiDriveNodes(drives).catch(console.error);\n }, [documentDrives, readDrives, updateUiDriveNodes]);\n\n useEffect(() => {\n if (!reactor) {\n return;\n }\n\n const unsub = onSyncStatus(() => updateUiDriveNodes(documentDrives));\n return unsub;\n }, [reactor, documentDrives, onSyncStatus, updateUiDriveNodes]);\n};\n","import {\n DRIVE,\n FILE,\n type UiDriveNode,\n type UiNode,\n} from '@powerhousedao/design-system';\nimport { useUiNodesContext } from '@powerhousedao/reactor-browser/hooks/useUiNodesContext';\nimport { useEffect } from 'react';\nimport { useLocation, useNavigate, useParams } from 'react-router-dom';\n\ntype RouteParams = {\n driveId?: string;\n '*'?: string;\n};\n\nfunction buildPathname(selectedNodePath: UiNode[]) {\n const driveNode = selectedNodePath[0];\n if (!driveNode) {\n return;\n }\n if (driveNode.kind !== DRIVE) {\n throw new Error(\n 'Node path is invalid, first node is not a drive node.',\n );\n }\n const driveNodeComponent = makeDriveNodeUrlComponent(driveNode);\n const nodePathComponents = selectedNodePath\n .slice(1)\n .map(node => encodeURIComponent(node.slug || node.name));\n const pathname = [driveNodeComponent, ...nodePathComponents].join('/');\n return pathname;\n}\n\nfunction makeDriveNodeUrlComponent(driveNode: UiDriveNode) {\n const component = driveNode.slug || driveNode.name || driveNode.id;\n\n return `/d/${encodeURIComponent(component)}`;\n}\n\nfunction getSelectedNodeFromPathname(\n driveNodes: (UiDriveNode | null)[],\n driveIdFromPathname: string | undefined,\n nodeNamesFromPathname: string | undefined,\n) {\n if (!driveIdFromPathname) {\n return null;\n }\n\n const driveId = decodeURIComponent(driveIdFromPathname);\n const driveNode = driveNodes.find(\n node =>\n node?.id === driveId ||\n node?.slug === driveId ||\n node?.name === driveId,\n );\n\n if (!driveNode) return null;\n if (!nodeNamesFromPathname) return driveNode;\n\n const nodeNames = nodeNamesFromPathname\n .split('/')\n .filter(Boolean)\n .map(decodeURIComponent);\n\n let selectedNode: UiNode = driveNode;\n\n for (const nodeName of nodeNames) {\n if (selectedNode.kind === FILE) break;\n\n const nextNode: UiNode | undefined = selectedNode.children.find(\n node => node.slug === nodeName || node.name === nodeName,\n );\n\n if (!nextNode) {\n console.error('Node not found:', nodeName);\n break;\n }\n\n selectedNode = nextNode;\n }\n\n return selectedNode;\n}\n\nexport const useNodeNavigation = () => {\n const navigate = useNavigate();\n const location = useLocation();\n const { search, pathname } = location;\n const params = useParams<RouteParams>();\n const { driveNodes, selectedNode, selectedNodePath, setSelectedNode } =\n useUiNodesContext();\n const driveIdFromPathname = params.driveId;\n const nodeNamesFromPathname = params['*'];\n const selectedNodeFromPathname = getSelectedNodeFromPathname(\n driveNodes,\n driveIdFromPathname,\n nodeNamesFromPathname,\n );\n const selectedNodePathname = buildPathname(selectedNodePath);\n\n // when selectedNodePathname changes, navigate to the new path\n useEffect(() => {\n if (!selectedNodePathname || selectedNodePathname === pathname) return;\n\n navigate({ pathname: selectedNodePathname, search });\n }, [search, navigate, selectedNodePathname]);\n\n // on first load, set the selected node from the pathname\n // defaults to setting the first drive node if no drive node is found\n useEffect(() => {\n if (selectedNode || !selectedNodeFromPathname) return;\n\n setSelectedNode(selectedNodeFromPathname);\n }, [selectedNode, selectedNodeFromPathname, setSelectedNode]);\n\n // respond to changes in the url (browser back and forward buttons)\n // update the selected node accordingly\n useEffect(() => {\n const selectedNodeFromPathname = getSelectedNodeFromPathname(\n driveNodes,\n driveIdFromPathname,\n nodeNamesFromPathname,\n );\n\n if (!selectedNodeFromPathname) return;\n\n setSelectedNode(selectedNodeFromPathname);\n }, [\n driveNodes,\n driveIdFromPathname,\n nodeNamesFromPathname,\n setSelectedNode,\n ]);\n};\n","import * as React from \"react\";\nconst SvgAtlasLogomark = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: 28, height: 32, viewBox: \"0 0 28 32\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { fillRule: \"evenodd\", clipRule: \"evenodd\", d: \"M0.05092 23.7286L0.000163347 23.9993L0 23.9995L0.207853 24.067L27.6823 24.067L27.9995 23.9995L27.9161 23.6913L14.2182 0.209032L13.9998 0L13.749 0.246353L0.05092 23.7286ZM20.9994 11.9999L7.0003 11.9999L13.9998 23.999L20.9994 11.9999Z\", fill: \"url(#paint0_radial_319_20865)\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M14 0L0 23.9998V7.99993L14 0Z\", fill: \"url(#paint1_linear_319_20865)\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M28 24L7.82013e-05 24L14 31.9999L28 24Z\", fill: \"url(#paint2_linear_319_20865)\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M14 0L28 23.9998V7.99993L14 0Z\", fill: \"url(#paint3_linear_319_20865)\" }), /* @__PURE__ */ React.createElement(\"defs\", null, /* @__PURE__ */ React.createElement(\"radialGradient\", { id: \"paint0_radial_319_20865\", cx: 0, cy: 0, r: 1, gradientUnits: \"userSpaceOnUse\", gradientTransform: \"translate(13.9994 16.0344) rotate(-89.9988) scale(16.0344 16.201)\" }, /* @__PURE__ */ React.createElement(\"stop\", { offset: 0.181008, stopColor: \"#FFCD6B\" }), /* @__PURE__ */ React.createElement(\"stop\", { offset: 1, stopColor: \"#EB5EDF\" })), /* @__PURE__ */ React.createElement(\"linearGradient\", { id: \"paint1_linear_319_20865\", x1: -0.031454, y1: 24.041, x2: 13.801, y2: -0.142908, gradientUnits: \"userSpaceOnUse\" }, /* @__PURE__ */ React.createElement(\"stop\", { stopColor: \"#4331E9\" }), /* @__PURE__ */ React.createElement(\"stop\", { offset: 1, stopColor: \"#A273FF\" })), /* @__PURE__ */ React.createElement(\"linearGradient\", { id: \"paint2_linear_319_20865\", x1: -0.0310093, y1: 24, x2: 28.0444, y2: 24, gradientUnits: \"userSpaceOnUse\" }, /* @__PURE__ */ React.createElement(\"stop\", { stopColor: \"#A273FF\" }), /* @__PURE__ */ React.createElement(\"stop\", { offset: 1, stopColor: \"#4331E9\" })), /* @__PURE__ */ React.createElement(\"linearGradient\", { id: \"paint3_linear_319_20865\", x1: 28.0315, y1: 24.041, x2: 14.199, y2: -0.142908, gradientUnits: \"userSpaceOnUse\" }, /* @__PURE__ */ React.createElement(\"stop\", { stopColor: \"#A273FF\" }), /* @__PURE__ */ React.createElement(\"stop\", { offset: 1, stopColor: \"#4331E9\" }))));\nexport default SvgAtlasLogomark;\n","import * as React from \"react\";\nconst SvgRefresh = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: 16, height: 16, viewBox: \"0 0 16 16\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M15.6867 8.03333C15.4933 7.83999 15.1733 7.83999 14.98 8.03333L14.6733 8.34001V8C14.6733 4.32 11.68 1.32666 7.99999 1.32666C5.96666 1.32666 4.06666 2.23999 2.79333 3.82666C2.61999 4.03999 2.65332 4.35999 2.87332 4.52665C3.08666 4.69999 3.40666 4.66666 3.57332 4.44666C4.65999 3.09332 6.27332 2.31999 7.99999 2.31999C11.1267 2.31999 13.6733 4.86666 13.6733 7.99333V8.32666L13.3667 8.02002C13.1733 7.82669 12.8533 7.82669 12.66 8.02002C12.4667 8.21335 12.4667 8.53335 12.66 8.72668L13.82 9.88668C13.8667 9.93334 13.92 9.96666 13.98 9.99333C14.04 10.02 14.1067 10.0333 14.1733 10.0333C14.24 10.0333 14.3 10.02 14.3667 9.99333C14.4267 9.96666 14.48 9.93334 14.5267 9.88668L15.6867 8.72668C15.88 8.54668 15.88 8.22666 15.6867 8.03333Z\", fill: \"#6C7275\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M13.1267 11.4666C12.9133 11.2933 12.5933 11.3266 12.4267 11.5466C11.34 12.9 9.72665 13.6733 7.99998 13.6733C4.87332 13.6733 2.32665 11.1266 2.32665 7.99996V7.66663L2.63332 7.97331C2.73332 8.07331 2.85999 8.11996 2.98665 8.11996C3.11332 8.11996 3.23999 8.07331 3.33999 7.97331C3.53332 7.77998 3.53332 7.45998 3.33999 7.26664L2.17998 6.10661C2.13332 6.05994 2.07998 6.02663 2.01998 5.99996C1.89998 5.94663 1.75998 5.94663 1.63998 5.99996C1.57998 6.02663 1.52665 6.05994 1.47999 6.10661L0.319988 7.26664C0.126654 7.45998 0.126654 7.77998 0.319988 7.97331C0.513321 8.16664 0.833319 8.16664 1.02665 7.97331L1.33332 7.66663V7.99996C1.33332 11.68 4.32665 14.6733 8.00665 14.6733C10.04 14.6733 11.94 13.76 13.2133 12.1733C13.38 11.96 13.3467 11.64 13.1267 11.4666Z\", fill: \"#6C7275\" }));\nexport default SvgRefresh;\n","import AtlasIcon from '#assets/icons/Atlas-Logomark.svg?react';\nimport RefreshIcon from '#assets/icons/refresh.svg?react';\nimport { useDocumentDriveServer } from '#hooks';\nimport { useUnwrappedReactor } from '#store';\nimport { Button } from '@powerhousedao/design-system';\nimport { gql, request } from 'graphql-request';\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { useLocation, useNavigate, useParams } from 'react-router-dom';\nimport { toast } from '../../services/toast';\n\nconst REACTOR_URL = 'https://apps.powerhouse.io/sky-atlas/staging/switchboard';\nconst MIN_LOADING_TIME = 2000;\n\nfunction useReactorUrl() {\n const { search } = useLocation();\n return useMemo(() => {\n const params = new URLSearchParams(search);\n const url = params.get('reactorUrl') ?? REACTOR_URL;\n return url.endsWith('/') ? url : `${url}/`;\n }, [search]);\n}\n\nasync function forkAtlas(\n docId: string,\n reactorUrl: string,\n): Promise<{ ForkAtlas: string }> {\n const document = gql`\n mutation ForkAtlas($docId: PHID) {\n ForkAtlas(docId: $docId)\n }\n `;\n return await request(`${reactorUrl}graphql`, document, { docId });\n}\n\nexport function AtlasImport() {\n const status = useRef<\n 'initial' | 'forking' | 'forked' | 'addingDrive' | 'done' | 'error'\n >('initial');\n const reactor = useUnwrappedReactor();\n const { documentId } = useParams();\n const reactorUrl = useReactorUrl();\n const navigate = useNavigate();\n const { addRemoteDrive } = useDocumentDriveServer();\n const [driveId, setDriveId] = useState<string | undefined>(undefined);\n const [error, setError] = useState<unknown>(undefined);\n const [loading, setLoading] = useState(true);\n const hasError = status.current === 'error';\n\n useEffect(() => {\n if (error) {\n console.error('Error forking Atlas:', error);\n toast('Error forking Atlas', { type: 'error' });\n }\n }, [error]);\n\n async function forkAtlasDocument(documentId: string) {\n const result = await forkAtlas(documentId, reactorUrl);\n const driveId = result.ForkAtlas;\n status.current = 'forked';\n setDriveId(driveId);\n }\n\n const redirectToDrive = useCallback(() => {\n if (driveId && !loading) {\n navigate(`/d/${driveId}`, { replace: true });\n }\n }, [driveId, navigate, loading]);\n\n const addForkDrive = useCallback(\n async (driveId: string) => {\n console.log('Adding remote drive:', driveId);\n const driveUrl = `${reactorUrl}d/${driveId}`;\n try {\n const addedDrive = await addRemoteDrive(driveUrl, {\n sharingType: 'PUBLIC',\n availableOffline: true,\n listeners: [\n {\n block: true,\n callInfo: {\n data: driveUrl,\n name: 'switchboard-push',\n transmitterType: 'SwitchboardPush',\n },\n filter: {\n branch: ['main'],\n documentId: ['*'],\n documentType: ['*'],\n scope: ['global'],\n },\n label: 'Switchboard Sync',\n listenerId: '1',\n system: true,\n },\n ],\n triggers: [],\n });\n status.current = 'done';\n console.log('Added remote drive:', addedDrive);\n setTimeout(() => {\n setLoading(false);\n }, MIN_LOADING_TIME);\n } catch (error) {\n status.current = 'error';\n setLoading(false);\n setError(error);\n }\n },\n [addRemoteDrive, navigate, reactorUrl],\n );\n\n useEffect(() => {\n if (!documentId || status.current !== 'initial') return;\n status.current = 'forking';\n forkAtlasDocument(documentId).catch(error => {\n status.current = 'error';\n setError(error);\n });\n }, [documentId, status]);\n\n useEffect(() => {\n if (!driveId || !reactor || status.current !== 'forked') return;\n status.current = 'addingDrive';\n new Promise<void>(resolve => {\n setTimeout(resolve, 500);\n })\n .then(() => addForkDrive(driveId))\n .catch(error => {\n status.current = 'error';\n setError(error);\n });\n }, [driveId, reactor, status]);\n\n return (\n <div className=\"bg-gray-50 size-full flex justify-center gap-x-4\">\n <div className=\"bg-white rounded-2xl w-full max-w-[850px] drop-shadow-sm p-6\">\n <h1 className=\"text-lg text-gray-900 font-medium\">\n Welcome to the Atlas Explorer\n </h1>\n <div className=\"mt-4 bg-gray-50 border border-gray-200 rounded-xl p-6\">\n <div className=\"bg-slate-50 rounded-2xl min-h-80 flex flex-col justify-center items-center\">\n <div>\n <AtlasIcon />\n </div>\n {hasError ? (\n <div className=\"text-sm text-gray-800 mt-3\">\n Error forking Atlas scope. Please try again.\n </div>\n ) : (\n <div className=\"text-sm text-gray-500 mt-3\">\n Forking Atlas scope...\n </div>\n )}\n <Button\n onClick={\n hasError\n ? window.location.reload.bind(\n window.location,\n )\n : redirectToDrive\n }\n size=\"small\"\n color=\"light\"\n className=\"bg-white border border-gray-200 h-9 px-3 mt-4 text-gray-600\"\n >\n {hasError ? (\n 'Retry'\n ) : loading ? (\n <>\n <RefreshIcon className=\"animate-spin\" />\n Loading\n </>\n ) : (\n 'Continue'\n )}\n </Button>\n </div>\n </div>\n </div>\n </div>\n );\n}\n","'use client';\nimport { createContext, Component, createElement, useContext, useState, useMemo, forwardRef } from 'react';\n\nconst ErrorBoundaryContext = createContext(null);\n\nconst initialState = {\n didCatch: false,\n error: null\n};\nclass ErrorBoundary extends Component {\n constructor(props) {\n super(props);\n this.resetErrorBoundary = this.resetErrorBoundary.bind(this);\n this.state = initialState;\n }\n static getDerivedStateFromError(error) {\n return {\n didCatch: true,\n error\n };\n }\n resetErrorBoundary() {\n const {\n error\n } = this.state;\n if (error !== null) {\n var _this$props$onReset, _this$props;\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n (_this$props$onReset = (_this$props = this.props).onReset) === null || _this$props$onReset === void 0 ? void 0 : _this$props$onReset.call(_this$props, {\n args,\n reason: \"imperative-api\"\n });\n this.setState(initialState);\n }\n }\n componentDidCatch(error, info) {\n var _this$props$onError, _this$props2;\n (_this$props$onError = (_this$props2 = this.props).onError) === null || _this$props$onError === void 0 ? void 0 : _this$props$onError.call(_this$props2, error, info);\n }\n componentDidUpdate(prevProps, prevState) {\n const {\n didCatch\n } = this.state;\n const {\n resetKeys\n } = this.props;\n\n // There's an edge case where if the thing that triggered the error happens to *also* be in the resetKeys array,\n // we'd end up resetting the error boundary immediately.\n // This would likely trigger a second error to be thrown.\n // So we make sure that we don't check the resetKeys on the first call of cDU after the error is set.\n\n if (didCatch && prevState.error !== null && hasArrayChanged(prevProps.resetKeys, resetKeys)) {\n var _this$props$onReset2, _this$props3;\n (_this$props$onReset2 = (_this$props3 = this.props).onReset) === null || _this$props$onReset2 === void 0 ? void 0 : _this$props$onReset2.call(_this$props3, {\n next: resetKeys,\n prev: prevProps.resetKeys,\n reason: \"keys\"\n });\n this.setState(initialState);\n }\n }\n render() {\n const {\n children,\n fallbackRender,\n FallbackComponent,\n fallback\n } = this.props;\n const {\n didCatch,\n error\n } = this.state;\n let childToRender = children;\n if (didCatch) {\n const props = {\n error,\n resetErrorBoundary: this.resetErrorBoundary\n };\n if (typeof fallbackRender === \"function\") {\n childToRender = fallbackRender(props);\n } else if (FallbackComponent) {\n childToRender = createElement(FallbackComponent, props);\n } else if (fallback !== undefined) {\n childToRender = fallback;\n } else {\n throw error;\n }\n }\n return createElement(ErrorBoundaryContext.Provider, {\n value: {\n didCatch,\n error,\n resetErrorBoundary: this.resetErrorBoundary\n }\n }, childToRender);\n }\n}\nfunction hasArrayChanged() {\n let a = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n let b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n return a.length !== b.length || a.some((item, index) => !Object.is(item, b[index]));\n}\n\nfunction assertErrorBoundaryContext(value) {\n if (value == null || typeof value.didCatch !== \"boolean\" || typeof value.resetErrorBoundary !== \"function\") {\n throw new Error(\"ErrorBoundaryContext not found\");\n }\n}\n\nfunction useErrorBoundary() {\n const context = useContext(ErrorBoundaryContext);\n assertErrorBoundaryContext(context);\n const [state, setState] = useState({\n error: null,\n hasError: false\n });\n const memoized = useMemo(() => ({\n resetBoundary: () => {\n context.resetErrorBoundary();\n setState({\n error: null,\n hasError: false\n });\n },\n showBoundary: error => setState({\n error,\n hasError: true\n })\n }), [context.resetErrorBoundary]);\n if (state.hasError) {\n throw state.error;\n }\n return memoized;\n}\n\nfunction withErrorBoundary(component, errorBoundaryProps) {\n const Wrapped = forwardRef((props, ref) => createElement(ErrorBoundary, errorBoundaryProps, createElement(component, {\n ...props,\n ref\n })));\n\n // Format for display in DevTools\n const name = component.displayName || component.name || \"Unknown\";\n Wrapped.displayName = \"withErrorBoundary(\".concat(name, \")\");\n return Wrapped;\n}\n\nexport { ErrorBoundary, ErrorBoundaryContext, useErrorBoundary, withErrorBoundary };\n","import * as React from \"react\";\nconst SvgConnect = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: 107, height: 20, viewBox: \"0 0 107 20\", fill: \"currentColor\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M0.666504 10.1087C0.666504 8.30419 1.056 6.69918 1.83499 5.29371C2.61398 3.8709 3.6959 2.76908 5.08077 1.98827C6.48295 1.1901 8.0669 0.791016 9.83261 0.791016C11.9965 0.791016 13.8487 1.36361 15.3894 2.50881C16.9301 3.654 17.9601 5.21563 18.4794 7.1937H13.5977C13.2342 6.43023 12.7149 5.84896 12.0397 5.44988C11.3819 5.05079 10.6289 4.85125 9.78067 4.85125C8.41311 4.85125 7.30522 5.32842 6.45699 6.28275C5.60876 7.23708 5.18464 8.51241 5.18464 10.1087C5.18464 11.7051 5.60876 12.9804 6.45699 13.9347C7.30522 14.8891 8.41311 15.3662 9.78067 15.3662C10.6289 15.3662 11.3819 15.1667 12.0397 14.7676C12.7149 14.3685 13.2342 13.7872 13.5977 13.0238H18.4794C17.9601 15.0018 16.9301 16.5635 15.3894 17.7087C13.8487 18.8365 11.9965 19.4004 9.83261 19.4004C8.0669 19.4004 6.48295 19.01 5.08077 18.2292C3.6959 17.431 2.61398 16.3292 1.83499 14.9238C1.056 13.5183 0.666504 11.9133 0.666504 10.1087Z\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M26.7553 19.4785C25.3358 19.4785 24.0548 19.1749 22.9123 18.5676C21.7871 17.9603 20.8956 17.0927 20.2378 15.9648C19.5973 14.837 19.277 13.5183 19.277 12.0087C19.277 10.5165 19.6059 9.20646 20.2638 8.07862C20.9216 6.93343 21.8217 6.05718 22.9642 5.44988C24.1068 4.84258 25.3878 4.53893 26.8073 4.53893C28.2267 4.53893 29.5078 4.84258 30.6503 5.44988C31.7928 6.05718 32.693 6.93343 33.3508 8.07862C34.0086 9.20646 34.3375 10.5165 34.3375 12.0087C34.3375 13.5009 33.9999 14.8197 33.3248 15.9648C32.667 17.0927 31.7582 17.9603 30.5983 18.5676C29.4558 19.1749 28.1748 19.4785 26.7553 19.4785ZM26.7553 15.6265C27.6036 15.6265 28.322 15.3142 28.9105 14.6895C29.5164 14.0649 29.8193 13.1713 29.8193 12.0087C29.8193 10.8462 29.5251 9.95257 28.9365 9.32792C28.3652 8.70327 27.6555 8.39095 26.8073 8.39095C25.9417 8.39095 25.2233 8.70327 24.6521 9.32792C24.0808 9.93522 23.7952 10.8288 23.7952 12.0087C23.7952 13.1713 24.0721 14.0649 24.6261 14.6895C25.1973 15.3142 25.9071 15.6265 26.7553 15.6265Z\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M44.483 4.59098C46.1795 4.59098 47.5297 5.14623 48.5337 6.25672C49.5551 7.34986 50.0658 8.85944 50.0658 10.7854V19.2703H45.6515V11.3841C45.6515 10.4124 45.4005 9.6576 44.8985 9.11971C44.3964 8.58181 43.7213 8.31286 42.8731 8.31286C42.0249 8.31286 41.3497 8.58181 40.8477 9.11971C40.3457 9.6576 40.0947 10.4124 40.0947 11.3841V19.2703H35.6545V4.74714H40.0947V6.67315C40.5448 6.03115 41.1507 5.52796 41.9123 5.16358C42.674 4.78185 43.5309 4.59098 44.483 4.59098Z\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M60.9412 4.59098C62.6376 4.59098 63.9879 5.14623 64.9919 6.25672C66.0133 7.34986 66.5239 8.85944 66.5239 10.7854V19.2703H62.1096V11.3841C62.1096 10.4124 61.8586 9.6576 61.3566 9.11971C60.8546 8.58181 60.1795 8.31286 59.3313 8.31286C58.483 8.31286 57.8079 8.58181 57.3059 9.11971C56.8039 9.6576 56.5529 10.4124 56.5529 11.3841V19.2703H52.1126V4.74714H56.5529V6.67315C57.0029 6.03115 57.6088 5.52796 58.3705 5.16358C59.1322 4.78185 59.9891 4.59098 60.9412 4.59098Z\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M82.2291 11.7745C82.2291 12.1909 82.2031 12.6247 82.1512 13.0758H72.1022C72.1715 13.9781 72.4571 14.6722 72.9591 15.158C73.4784 15.6265 74.1103 15.8607 74.8546 15.8607C75.9625 15.8607 76.7329 15.3923 77.1656 14.4553H81.8915C81.6491 15.4096 81.2077 16.2685 80.5672 17.032C79.944 17.7954 79.1564 18.3941 78.2043 18.8278C77.2522 19.2616 76.1876 19.4785 75.0104 19.4785C73.5909 19.4785 72.3272 19.1749 71.2194 18.5676C70.1115 17.9603 69.2459 17.0927 68.6227 15.9648C67.9995 14.837 67.6879 13.5183 67.6879 12.0087C67.6879 10.4991 67.9909 9.18044 68.5968 8.05259C69.2199 6.92475 70.0855 6.05718 71.1934 5.44988C72.3013 4.84258 73.5736 4.53893 75.0104 4.53893C76.4126 4.53893 77.659 4.8339 78.7496 5.42385C79.8402 6.0138 80.6884 6.85534 81.2943 7.94848C81.9175 9.04163 82.2291 10.317 82.2291 11.7745ZM77.685 10.6033C77.685 9.83979 77.4253 9.23249 76.906 8.78135C76.3866 8.33022 75.7375 8.10465 74.9585 8.10465C74.2141 8.10465 73.5823 8.32154 73.063 8.75533C72.561 9.18911 72.2494 9.80509 72.1282 10.6033H77.685Z\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M82.65 12.0087C82.65 10.4991 82.9529 9.18044 83.5588 8.05259C84.182 6.92475 85.0389 6.05718 86.1295 5.44988C87.2374 4.84258 88.5011 4.53893 89.9206 4.53893C91.7382 4.53893 93.2529 5.01609 94.4647 5.97042C95.6937 6.92475 96.4987 8.26949 96.8795 10.0046H92.1537C91.7555 8.89414 90.9852 8.33889 89.8427 8.33889C89.0291 8.33889 88.3799 8.65989 87.8952 9.3019C87.4105 9.92655 87.1681 10.8288 87.1681 12.0087C87.1681 13.1886 87.4105 14.0996 87.8952 14.7416C88.3799 15.3662 89.0291 15.6786 89.8427 15.6786C90.9852 15.6786 91.7555 15.1233 92.1537 14.0128H96.8795C96.4987 15.7133 95.6937 17.0493 94.4647 18.021C93.2356 18.9927 91.7209 19.4785 89.9206 19.4785C88.5011 19.4785 87.2374 19.1749 86.1295 18.5676C85.0389 17.9603 84.182 17.0927 83.5588 15.9648C82.9529 14.837 82.65 13.5183 82.65 12.0087Z\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M106.291 15.4964V19.2703H104.032C102.423 19.2703 101.167 18.8799 100.267 18.0991C99.3672 17.3009 98.9171 16.0082 98.9171 14.221V8.443H97.1514V4.74714H98.9171V1.20745H103.357V4.74714H106.266V8.443H103.357V14.2731C103.357 14.7069 103.461 15.0192 103.669 15.2101C103.877 15.4009 104.223 15.4964 104.708 15.4964H106.291Z\" }));\nexport default SvgConnect;\n","import * as React from \"react\";\nconst SvgLogo = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: 26, height: 26, viewBox: \"0 0 26 26\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M20.105 7.37978C19.9097 7.18452 19.9097 6.86795 20.105 6.67269L22.5725 4.20504C24.9229 6.75889 26.0649 10.0248 25.9972 13.2723L20.105 7.37978ZM16.1222 10.6556C15.927 10.8509 15.927 11.1674 16.1222 11.3627L24.2614 19.5023C25.125 18.0079 25.667 16.378 25.8875 14.7149L19.3289 8.15595C19.1336 7.96068 18.817 7.96068 18.6218 8.15595L16.1222 10.6556ZM0.00284613 12.729C-0.0649083 15.9752 1.07706 19.2411 3.42753 21.7962L5.89504 19.3285C6.09029 19.1333 6.09029 18.8167 5.89504 18.6214L0.00284613 12.729ZM4.20485 22.5723C6.75858 24.9229 10.0256 26.0649 13.2716 25.9972L7.37946 20.1047C7.1842 19.9094 6.8676 19.9094 6.67234 20.1047L4.20485 22.5723ZM13.0519 18.5174C13.2472 18.3222 13.2472 18.0056 13.0519 17.8103L1.73982 6.49772C0.87626 7.99209 0.334223 9.62072 0.113713 11.2851L9.84523 21.0171C10.0405 21.2124 10.3571 21.2124 10.5524 21.0171L13.0519 18.5174ZM9.60276 7.08454C9.78969 6.88798 9.7858 6.57823 9.594 6.38642L5.55009 2.34233C4.93783 2.77105 4.35391 3.25889 3.80695 3.80588C3.25998 4.35287 2.77216 4.93684 2.34346 5.54912L6.3864 9.59111C6.57859 9.78325 6.88907 9.7867 7.08548 9.59887L8.47817 8.26702L9.60276 7.08454ZM11.2072 21.6733C11.012 21.8685 11.012 22.1851 11.2072 22.3804L14.7142 25.8875C16.3785 25.667 18.0071 25.1249 19.5013 24.2613L14.4139 19.1736C14.2186 18.9783 13.902 18.9783 13.7067 19.1736L11.2072 21.6733ZM23.6565 20.4496L11.0843 7.87683C10.8891 7.68156 10.5725 7.68156 10.3772 7.87683L7.87766 10.3765C7.68241 10.5718 7.68241 10.8883 7.87766 11.0836L20.4499 23.6564C21.0622 23.2277 21.6461 22.7398 22.193 22.1929C22.74 21.6459 23.2278 21.0619 23.6565 20.4496ZM17.8445 7.37855C18.0397 7.18329 18.0397 6.86672 17.8445 6.67146L11.2858 0.112477C9.62151 0.332998 7.99294 0.875053 6.49865 1.73866L14.6378 9.87821C14.8331 10.0735 15.1497 10.0735 15.3449 9.87821L17.8445 7.37855ZM21.7951 3.42769C19.2414 1.07712 15.9744 -0.0649114 12.7284 0.00284625L18.6205 5.89529C18.8158 6.09056 19.1324 6.09056 19.3277 5.89529L21.7951 3.42769Z\", fill: \"url(#paint0_linear_526_12008)\" }), /* @__PURE__ */ React.createElement(\"defs\", null, /* @__PURE__ */ React.createElement(\"linearGradient\", { id: \"paint0_linear_526_12008\", x1: 13, y1: 0, x2: 13, y2: 26, gradientUnits: \"userSpaceOnUse\" }, /* @__PURE__ */ React.createElement(\"stop\", { stopColor: \"currentColor\" }), /* @__PURE__ */ React.createElement(\"stop\", { offset: 1, stopColor: \"currentColor\" }))));\nexport default SvgLogo;\n","import { useConnectConfig, useLogin, useShowAddDriveModal } from '#hooks';\nimport {\n ConnectSidebar,\n Icon,\n SidebarAddDriveItem,\n SidebarItem,\n type UiDriveNode,\n} from '@powerhousedao/design-system';\nimport { useUiNodesContext } from '@powerhousedao/reactor-browser';\nimport { logger } from 'document-drive';\nimport { useCallback } from 'react';\nimport { ErrorBoundary } from 'react-error-boundary';\nimport { useNavigate } from 'react-router-dom';\nimport { useModal } from './modal/index.js';\n\nexport default function Sidebar() {\n const { showModal } = useModal();\n const navigate = useNavigate();\n\n const { user, openRenown, logout } = useLogin();\n const { driveNodes, setSelectedNode, selectedNode } = useUiNodesContext();\n const [config] = useConnectConfig();\n const showAddDriveModal = useShowAddDriveModal();\n const connectDebug = localStorage.getItem('CONNECT_DEBUG') === 'true';\n\n const onClickSettings = () => {\n showModal('settingsModal', { onRefresh: () => navigate(0) });\n };\n\n const onRootClick = useCallback(() => {\n setSelectedNode(null);\n navigate('/');\n }, [navigate, setSelectedNode]);\n\n const onAddDriveClick = useCallback(() => {\n showAddDriveModal();\n }, [showAddDriveModal]);\n\n const headerContent = (\n <div className=\"flex h-full items-center\">\n <Icon\n name=\"Connect\"\n className=\"!h-[30px] !w-[100px] cursor-pointer\"\n onClick={onRootClick}\n />\n {connectDebug && (\n <button\n id=\"connect-debug-button\"\n className=\"ml-6\"\n onClick={() => showModal('debugSettingsModal', {})}\n >\n <img src=\"settings.png\" className=\"h-5 text-gray-600\" />\n </button>\n )}\n </div>\n );\n\n const handleDriveClick = useCallback(\n (driveNode: UiDriveNode) => {\n setSelectedNode(driveNode);\n },\n [setSelectedNode],\n );\n\n const etherscanUrl = user?.address\n ? `https://etherscan.io/address/${user.address}`\n : '';\n\n return (\n <ConnectSidebar\n id=\"sidebar\"\n onClick={() => onRootClick()}\n onClickSettings={onClickSettings}\n headerContent={headerContent}\n address={user?.address}\n onLogin={openRenown}\n onDisconnect={logout}\n etherscanUrl={etherscanUrl}\n >\n <ErrorBoundary\n fallback={\n <div className=\"text-center\">\n There was an error loading drives\n </div>\n }\n onError={logger.error}\n >\n {driveNodes.map((node, index) => (\n <SidebarItem\n key={index}\n title={node.name}\n onClick={() => handleDriveClick(node)}\n active={selectedNode?.id === node.id}\n icon={\n node.icon ? (\n <img\n src={node.icon}\n alt={node.name}\n width={32}\n height={32}\n />\n ) : undefined\n }\n />\n ))}\n {config.drives.addDriveEnabled && (\n <SidebarAddDriveItem onClick={onAddDriveClick} />\n )}\n </ErrorBoundary>\n </ConnectSidebar>\n );\n}\n","import IconConnect from '#assets/icons/connect.svg?react';\nimport IconLogo from '#assets/icons/logo.svg?react';\nimport { ModalManager } from '#components';\nimport {\n isElectron,\n isMac,\n useLoadInitialData,\n useLogin,\n useNodeNavigation,\n} from '#hooks';\nimport { logger } from 'document-drive';\nimport { Suspense, useEffect } from 'react';\nimport { Outlet, useNavigate, useSearchParams } from 'react-router-dom';\nimport Sidebar from './sidebar.js';\n\nexport default function Root() {\n useLoadInitialData();\n useNodeNavigation();\n\n const navigate = useNavigate();\n const { login } = useLogin();\n\n useEffect(() => {\n window.electronAPI?.ready();\n }, []);\n\n const [searchParams, setSearchParams] = useSearchParams();\n\n useEffect(() => {\n const userStr = searchParams.get('user');\n if (userStr && login) {\n const userDid = decodeURIComponent(userStr);\n searchParams.delete('user');\n setSearchParams(searchParams);\n login(userDid).catch(logger.error);\n }\n }, [login, searchParams, setSearchParams]);\n\n useEffect(() => {\n const unsubscribe = window.electronAPI?.handleURL((_e, url) => {\n navigate(`/${url}`);\n });\n\n return unsubscribe;\n }, [navigate]);\n\n return (\n <ModalManager>\n <div className=\"h-screen\">\n {isElectron && (\n <div\n className={`h-8 w-full\n ${isMac && 'justify-center'}\n flex items-center bg-gray-50`}\n >\n <IconLogo className=\"ml-1 mr-0.5 p-1.5\" />\n <IconConnect className=\"h-3 w-fit\" />\n </div>\n )}\n <div\n className={`flex items-stretch overflow-auto\n ${isElectron ? 'h-app-height' : 'h-screen'}\n `}\n role=\"presentation\"\n tabIndex={0}\n >\n <Suspense>\n <Sidebar />\n <div className=\"relative flex-1 overflow-auto\">\n <Outlet />\n </div>\n </Suspense>\n </div>\n </div>\n </ModalManager>\n );\n}\n","import { useTranslation } from 'react-i18next';\n\nexport const ReloadConnectToast = () => {\n const { t } = useTranslation();\n\n return (\n <div>\n <p className=\"font-medium\">{t('notifications.reloadApp')}</p>\n <button\n onClick={() => location.reload()}\n className=\"underline decoration-solid underline-offset-2\"\n >\n {t('common.reloadConnect')} 🔄\n </button>\n </div>\n );\n};\n","import {\n useConnectConfig,\n useDocumentDriveServer,\n useShowAddDriveModal,\n} from '#hooks';\nimport { useGetAppNameForEditorId } from '#store';\nimport {\n HomeScreen,\n HomeScreenAddDriveItem,\n HomeScreenItem,\n Icon,\n type UiDriveNode,\n} from '@powerhousedao/design-system';\nimport { useUiNodesContext } from '@powerhousedao/reactor-browser';\nimport { useCallback } from 'react';\n\nfunction getDriveIcon(driveNode: UiDriveNode) {\n if (driveNode.icon) {\n return (\n <img\n src={driveNode.icon}\n alt={driveNode.name}\n height={32}\n width={32}\n />\n );\n }\n if (driveNode.sharingType === 'LOCAL') {\n return <Icon name=\"Hdd\" size={32} />;\n } else {\n return <Icon name=\"Server\" size={32} />;\n }\n}\n\nexport function Home() {\n const getAppDescriptionForEditorId = useGetAppNameForEditorId();\n const showAddDriveModal = useShowAddDriveModal();\n const { documentDrives } = useDocumentDriveServer();\n const { driveNodes, setSelectedNode } = useUiNodesContext();\n const [config] = useConnectConfig();\n const handleDriveClick = useCallback(\n (driveNode: UiDriveNode) => {\n setSelectedNode(driveNode);\n },\n [setSelectedNode],\n );\n\n const onAddDriveClick = useCallback(() => {\n showAddDriveModal();\n }, [showAddDriveModal]);\n\n return (\n <HomeScreen>\n {driveNodes.map(driveNode => {\n const drive = documentDrives.find(d => d.id === driveNode.id);\n const editorId = drive?.meta?.preferredEditor;\n const appName = editorId\n ? getAppDescriptionForEditorId(editorId)\n : undefined;\n return (\n <HomeScreenItem\n key={driveNode.id}\n title={driveNode.name}\n description={appName || 'Drive Explorer App'}\n icon={getDriveIcon(driveNode)}\n onClick={() => handleDriveClick(driveNode)}\n />\n );\n })}\n {config.drives.addDriveEnabled && (\n <HomeScreenAddDriveItem onClick={onAddDriveClick} />\n )}\n </HomeScreen>\n );\n}\n","import connectConfig from '#connect-config';\nimport React, { Suspense } from 'react';\nimport {\n type RouteObject,\n RouterProvider,\n createBrowserRouter,\n createMemoryRouter,\n} from 'react-router-dom';\nimport { Home } from '../pages/home.js';\nimport { AtlasImport } from './demo/atlas-import.js';\nimport Root from './root.js';\n\nconst Content = React.lazy(() => import('../pages/content.js'));\n\nasync function createRouter(routes: RouteObject[]) {\n const isPackaged = await window.electronAPI?.isPackaged();\n const createRouter = isPackaged ? createMemoryRouter : createBrowserRouter;\n return createRouter(routes, {\n basename: connectConfig.routerBasename,\n future: {\n v7_fetcherPersist: true,\n v7_relativeSplatPath: true,\n },\n });\n}\n\nfunction createRoutes() {\n const routes: RouteObject[] = [\n {\n path: '/',\n element: <Home />,\n },\n {\n path: 'd?/:driveId?/*?',\n element: (\n <Suspense>\n <Content />\n </Suspense>\n ),\n },\n {\n path: 'import/:documentId',\n element: <AtlasImport />,\n },\n ];\n\n return [\n {\n path: '/',\n element: (\n <Suspense>\n <Root />\n </Suspense>\n ),\n children: routes,\n },\n {\n element: (\n <Suspense>\n <Root />\n </Suspense>\n ),\n },\n ];\n}\n\nconst routes = createRoutes();\n\nconst RouterAsync = async () => {\n const router = await createRouter(routes);\n\n const Router = () => <RouterProvider router={router} />;\n return Router;\n};\n\nexport default RouterAsync;\n"],"file":"assets/router-hU0bX-QU.js"}
1
+ {"version":3,"mappings":";;;;;;;;AAEO,MAAM,iBAAiB,CAAC,EAAE,UAAU,cAAc;AACrD,SAAQA,KAAM,SAAS,EAAE,UAAU,CAACC,IAAK,gBAAgB,EAAE,SAAS,MAAM,UAAUA,IAAK,OAAO,EAAE,WAAW,kBAAkB,SAAkB,CAAE,EAAC,CAAE,GAAGA,IAAK,gBAAgB,EAAE,WAAW,YAAY,OAAO,SAAS,UAAU,QAAS,EAAC,EAAC,CAAE;AAClP;ACDO,SAAS,cAAc,EAAE,WAAW,GAAG,SAAS;AACnD,SAAOA,IAAK,OAAO,EAAE,WAAW,QAAQ,YAAY,SAAS,GAAG,GAAG,OAAO;AAC9E;AACO,SAAS,cAAc,EAAE,WAAW,GAAG,SAAS;AACnD,SAAOA,IAAK,OAAO,EAAE,WAAW,QAAQ,YAAY,SAAS,GAAG,GAAG,OAAO;AAC9E;AACO,MAAMC,YAAU,CAAC,EAAE,WAAW,SAAS,WAAW,QAAQ,WAAW,UAAU,GAAG,YAAY;AACjG,QAAM,MAAM,OAAO,IAAI;AACvB,SA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AAAA;AAAA,EAE9B;AAEO;AAAA,IACH;AAAA,MACI,MAAM;AAAA,MACN,SACI,oBAAC,UACG,gCAAC,OAAK,IACV;AAAA,MAEJ,UAAUA;AAAAA,IACd;AAAA,IACA;AAAA,MACI,SACI,oBAAC,UACG,gCAAC,QAAK,EACV;AAAA;AAAA,EAGZ;AACJ;AAEA,MAAM,SAAS,aAAa;AAE5B,MAAM,cAAc,YAAY;AACtB,QAAAG,UAAS,MAAM,aAAa,MAAM;AAExC,QAAM0B,UAAS,MAAO,sCAAe,QAAA1B,QAAgB;AAC9C,SAAA0B;AACX","names":["_jsxs","_jsx","Sidebar","_Fragment","viem_getEnsAvatar","viem_getEnsName","CoreError","tanstack_useQuery","HomeScreen","HomeScreenItem","HomeScreenAddDriveItem","SidebarItem","SidebarAddDriveItem","toast","drive","routes","createRouter","UNSAFE_ErrorResponseImpl","router","t","transition","navigator","state","UNSAFE_logV6DeprecationWarnings","UNSAFE_DataRouterContext","UNSAFE_DataRouterStateContext","UNSAFE_useRoutesImpl","DataRouterHook","DataRouterStateHook","location","baseToast","connectConfig","driveNodes","prevDrive","documentDrives","selectedNodeFromPathname","documentId","driveId","error","AtlasIcon","RefreshIcon","IconLogo","IconConnect","React","Router"],"ignoreList":[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,41,48],"sources":["../../../../packages/design-system/dist/src/connect/components/account-popover/account-popover.js","../../../../packages/design-system/dist/src/powerhouse/components/sidebar/sidebar.js","../../../../packages/design-system/dist/src/powerhouse/components/sidebar/sidebar-panel.js","../../../../packages/design-system/dist/src/connect/components/account-popover/account-popover-login.js","../../../../packages/design-system/dist/src/connect/components/account-popover/account-popover-user.js","../../../../packages/reactor-browser/dist/src/hooks/useSwitchboard.js","../../../../packages/design-system/dist/src/assets/powerhouse-rounded.png","../../../../node_modules/.pnpm/@wagmi+core@2.17.2_@tanstack+query-core@5.77.1_@types+react@18.3.22_immer@9.0.21_react@_cfd742b94b840c743456c5130a9de7ee/node_modules/@wagmi/core/dist/esm/utils/getAction.js","../../../../node_modules/.pnpm/@wagmi+core@2.17.2_@tanstack+query-core@5.77.1_@types+react@18.3.22_immer@9.0.21_react@_cfd742b94b840c743456c5130a9de7ee/node_modules/@wagmi/core/dist/esm/actions/getChainId.js","../../../../node_modules/.pnpm/@wagmi+core@2.17.2_@tanstack+query-core@5.77.1_@types+react@18.3.22_immer@9.0.21_react@_cfd742b94b840c743456c5130a9de7ee/node_modules/@wagmi/core/dist/esm/actions/getEnsAvatar.js","../../../../node_modules/.pnpm/@wagmi+core@2.17.2_@tanstack+query-core@5.77.1_@types+react@18.3.22_immer@9.0.21_react@_cfd742b94b840c743456c5130a9de7ee/node_modules/@wagmi/core/dist/esm/actions/getEnsName.js","../../../../node_modules/.pnpm/@wagmi+core@2.17.2_@tanstack+query-core@5.77.1_@types+react@18.3.22_immer@9.0.21_react@_cfd742b94b840c743456c5130a9de7ee/node_modules/@wagmi/core/dist/esm/actions/watchChainId.js","../../../../node_modules/.pnpm/wagmi@2.15.4_@tanstack+query-core@5.77.1_@tanstack+react-query@5.77.1_react@18.3.1__@ty_567784dc4225e9da9f9c587961226b2e/node_modules/wagmi/dist/esm/version.js","../../../../node_modules/.pnpm/wagmi@2.15.4_@tanstack+query-core@5.77.1_@tanstack+react-query@5.77.1_react@18.3.1__@ty_567784dc4225e9da9f9c587961226b2e/node_modules/wagmi/dist/esm/utils/getVersion.js","../../../../node_modules/.pnpm/wagmi@2.15.4_@tanstack+query-core@5.77.1_@tanstack+react-query@5.77.1_react@18.3.1__@ty_567784dc4225e9da9f9c587961226b2e/node_modules/wagmi/dist/esm/errors/base.js","../../../../node_modules/.pnpm/wagmi@2.15.4_@tanstack+query-core@5.77.1_@tanstack+react-query@5.77.1_react@18.3.1__@ty_567784dc4225e9da9f9c587961226b2e/node_modules/wagmi/dist/esm/errors/context.js","../../../../node_modules/.pnpm/wagmi@2.15.4_@tanstack+query-core@5.77.1_@tanstack+react-query@5.77.1_react@18.3.1__@ty_567784dc4225e9da9f9c587961226b2e/node_modules/wagmi/dist/esm/hooks/useConfig.js","../../../../node_modules/.pnpm/@wagmi+core@2.17.2_@tanstack+query-core@5.77.1_@types+react@18.3.22_immer@9.0.21_react@_cfd742b94b840c743456c5130a9de7ee/node_modules/@wagmi/core/dist/esm/query/utils.js","../../../../node_modules/.pnpm/@wagmi+core@2.17.2_@tanstack+query-core@5.77.1_@types+react@18.3.22_immer@9.0.21_react@_cfd742b94b840c743456c5130a9de7ee/node_modules/@wagmi/core/dist/esm/query/getEnsAvatar.js","../../../../node_modules/.pnpm/@wagmi+core@2.17.2_@tanstack+query-core@5.77.1_@types+react@18.3.22_immer@9.0.21_react@_cfd742b94b840c743456c5130a9de7ee/node_modules/@wagmi/core/dist/esm/query/getEnsName.js","../../../../node_modules/.pnpm/wagmi@2.15.4_@tanstack+query-core@5.77.1_@tanstack+react-query@5.77.1_react@18.3.1__@ty_567784dc4225e9da9f9c587961226b2e/node_modules/wagmi/dist/esm/utils/query.js","../../../../node_modules/.pnpm/wagmi@2.15.4_@tanstack+query-core@5.77.1_@tanstack+react-query@5.77.1_react@18.3.1__@ty_567784dc4225e9da9f9c587961226b2e/node_modules/wagmi/dist/esm/hooks/useChainId.js","../../../../node_modules/.pnpm/wagmi@2.15.4_@tanstack+query-core@5.77.1_@tanstack+react-query@5.77.1_react@18.3.1__@ty_567784dc4225e9da9f9c587961226b2e/node_modules/wagmi/dist/esm/hooks/useEnsAvatar.js","../../../../node_modules/.pnpm/wagmi@2.15.4_@tanstack+query-core@5.77.1_@tanstack+react-query@5.77.1_react@18.3.1__@ty_567784dc4225e9da9f9c587961226b2e/node_modules/wagmi/dist/esm/hooks/useEnsName.js","../../../../packages/design-system/dist/src/connect/components/ens-avatar/ens-avatar.js","../../../../packages/design-system/dist/src/assets/home-bg.png","../../../../packages/design-system/dist/src/connect/components/home-screen/home-screen.js","../../../../packages/design-system/dist/src/connect/components/home-screen/home-screen-item/home-screen-item.js","../../../../packages/design-system/dist/src/connect/components/home-screen/home-screen-add-drive-item/home-screen-add-drive-item.js","../../../../packages/design-system/dist/src/assets/renown-short-hover.png","../../../../packages/design-system/dist/src/assets/renown-short.png","../../../../packages/design-system/dist/src/connect/components/sidebar/sidebar-login.js","../../../../packages/design-system/dist/src/connect/components/sidebar/sidebar-user.js","../../../../packages/design-system/dist/src/connect/components/sidebar/sidebar-footer.js","../../../../packages/design-system/dist/src/connect/components/sidebar/sidebar-header.js","../../../../packages/design-system/dist/src/connect/components/sidebar/sidebar.js","../../../../packages/design-system/dist/src/connect/components/sidebar/sidebar-item.js","../../../../packages/design-system/dist/src/connect/components/sidebar/sidebar-add-drive-item.js","../../src/hooks/useUiNodes.ts","../../src/hooks/modals.ts","../../src/hooks/useClientErrorHandler.ts","../../../../node_modules/.pnpm/react-router-dom@6.30.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-router-dom/dist/index.js","../../src/services/toast.tsx","../../src/hooks/useLoadInitialData.tsx","../../src/hooks/useNodeNavigation.ts","../../assets/icons/Atlas-Logomark.svg?react","../../assets/icons/refresh.svg?react","../../src/components/demo/atlas-import.tsx","../../../../node_modules/.pnpm/react-error-boundary@4.1.2_react@18.3.1/node_modules/react-error-boundary/dist/react-error-boundary.esm.js","../../assets/icons/connect.svg?react","../../assets/icons/logo.svg?react","../../src/components/sidebar.tsx","../../src/components/root.tsx","../../src/components/toast/reload-connect-toast.tsx","../../src/pages/home.tsx","../../src/components/router.tsx"],"sourcesContent":["import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { Popover, PopoverContent, PopoverTrigger, } from \"../../../scalars/components/fragments/popover/popover.js\";\nexport const AccountPopover = ({ children, content }) => {\n return (_jsxs(Popover, { children: [_jsx(PopoverTrigger, { asChild: true, children: _jsx(\"div\", { className: \"cursor-pointer\", children: children }) }), _jsx(PopoverContent, { className: \"w-52 p-0\", align: \"start\", children: content })] }));\n};\n//# sourceMappingURL=account-popover.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useRef } from \"react\";\nimport { twMerge } from \"tailwind-merge\";\nexport function SidebarHeader({ className, ...props }) {\n return _jsx(\"div\", { className: twMerge(\"shrink-0\", className), ...props });\n}\nexport function SidebarFooter({ className, ...props }) {\n return _jsx(\"div\", { className: twMerge(\"shrink-0\", className), ...props });\n}\nexport const Sidebar = ({ maxWidth = \"304px\", minWidth = \"80px\", className, children, ...props }) => {\n const ref = useRef(null);\n return (_jsx(\"div\", { ...props, className: twMerge(`group flex h-full flex-col bg-slate-50`, className), ref: ref, style: {\n width: minWidth,\n }, children: children }));\n};\n//# sourceMappingURL=sidebar.js.map","import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { useEffect, useRef, useState } from \"react\";\nimport { twMerge } from \"tailwind-merge\";\nexport function SidebarPanel({ className, children, ...props }) {\n const [hasScroll, setHasScroll] = useState(false);\n function checkContentScroll(target) {\n setHasScroll(target.scrollHeight - target.scrollTop - target.clientHeight > 1);\n }\n const containerRef = useRef(null);\n // listen for resize events to update shadow\n useEffect(() => {\n if (!containerRef.current) {\n return;\n }\n const observer = new ResizeObserver((entries) => {\n const entry = entries.pop();\n if (!entry) {\n return;\n }\n const { target } = entry;\n checkContentScroll(target);\n });\n observer.observe(containerRef.current);\n return () => {\n observer.disconnect();\n };\n }, [containerRef.current]);\n return (_jsxs(_Fragment, { children: [_jsx(\"div\", { className: twMerge(\"no-scrollbar flex-1 overflow-auto text-gray-900 transition-shadow\", className), onScroll: (e) => checkContentScroll(e.currentTarget), ref: containerRef, ...props, children: children }), hasScroll ? (_jsx(\"div\", { className: \"pointer-events-none z-10 -mt-12 h-12 w-full\", style: {\n boxShadow: \"inset 0px -33px 32px -16px rgba(0,0,0,0.1)\",\n } })) : null] }));\n}\n//# sourceMappingURL=sidebar-panel.js.map","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { Icon } from \"#powerhouse\";\nimport { useState } from \"react\";\nexport const AccountPopoverLogin = ({ onLogin, }) => {\n const [loading, setLoading] = useState(false);\n const content = loading ? (_jsx(Icon, { name: \"Reload\", size: 14, className: \"animate-spin\" })) : (_jsx(\"span\", { children: \"Connect\" }));\n const handleLogin = () => {\n setLoading(true);\n onLogin();\n };\n return (_jsxs(\"div\", { className: \"p-4\", children: [_jsx(\"div\", { className: \"mb-4 flex justify-center\", children: _jsx(\"div\", { className: \"flex h-[22px] w-[83px] items-center justify-center overflow-hidden\", children: _jsx(Icon, { name: \"RenownLight\", size: 83 }) }) }), _jsx(\"button\", { onClick: handleLogin, className: \"mt-4 flex h-7 w-full cursor-pointer items-center justify-center rounded-lg border border-gray-300 bg-transparent text-sm active:opacity-70\", type: \"button\", children: content })] }));\n};\n//# sourceMappingURL=account-popover-login.js.map","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { Button, Icon } from \"#powerhouse\";\nimport { useCallback, useState } from \"react\";\n// short eth address\nconst shortAddress = (address) => `${address.slice(0, 7)}...${address.slice(-5)}`;\nexport const AccountPopoverUser = ({ address, onDisconnect, etherscanUrl, username = \"\", }) => {\n const [isCopied, setIsCopied] = useState(false);\n const copyToClipboard = useCallback(async (text) => {\n try {\n await navigator.clipboard.writeText(text);\n setIsCopied(true);\n setTimeout(() => setIsCopied(false), 2000);\n }\n catch (err) {\n console.error(\"Failed to copy address:\", err);\n }\n }, []);\n return (_jsxs(\"div\", { className: \"flex flex-col divide-y divide-gray-200 text-gray-900\", children: [_jsxs(\"div\", { className: \"px-3 py-2\", children: [username && _jsx(\"div\", { className: \"text-sm font-medium\", children: username }), _jsx(\"div\", { className: \"mt-1 flex items-center gap-2\", children: _jsx(Button, { size: \"small\", color: \"light\", onClick: copyToClipboard.bind(null, address), className: \"w-full cursor-pointer bg-transparent p-0 active:opacity-70\", type: \"button\", children: _jsxs(\"div\", { className: \"relative flex w-full items-center gap-1\", children: [_jsxs(\"div\", { className: `flex items-center gap-1 transition-opacity duration-150 ${isCopied ? \"opacity-0\" : \"opacity-100\"}`, children: [_jsx(\"span\", { className: \"text-xs\", children: shortAddress(address) }), _jsx(Icon, { name: \"FilesEarmark\", color: \"#9EA0A1\", size: 14 })] }), _jsx(\"div\", { className: `absolute left-0 text-xs transition-opacity duration-150 ${isCopied ? \"opacity-100\" : \"opacity-0\"}`, children: \"Copied to clipboard!\" })] }) }) })] }), etherscanUrl && (_jsx(\"div\", { className: \"px-3 py-2\", children: _jsxs(\"a\", { href: etherscanUrl, target: \"_blank\", rel: \"noopener noreferrer\", className: \"flex items-center gap-2 text-sm text-gray-900 hover:text-gray-600\", children: [_jsx(Icon, { name: \"Ethscan\", size: 14 }), \"View on Etherscan\"] }) })), _jsx(\"div\", { className: \"px-3 py-2\", children: _jsxs(\"button\", { onClick: onDisconnect, className: \"flex w-full cursor-pointer items-center gap-2 text-sm text-red-900 hover:text-red-700\", type: \"button\", children: [_jsx(Icon, { name: \"Disconnect\", size: 14, color: \"#EA4335\" }), \"Disconnect\"] }) })] }));\n};\n//# sourceMappingURL=account-popover-user.js.map","import { generateDocumentStateQueryFields } from \"document-drive/utils/graphql\";\nexport function useSwitchboard(reactor) {\n return {\n getDriveIdBySlug: async (driveUrl, slug) => {\n if (!driveUrl) {\n return;\n }\n const urlParts = driveUrl.split(\"/\");\n urlParts.pop(); // remove id\n urlParts.pop(); // remove /d\n urlParts.push(\"drives\"); // add /drives\n const drivesUrl = urlParts.join(\"/\");\n const result = await fetch(drivesUrl, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n query: `\n query getDriveIdBySlug($slug: String!) {\n driveIdBySlug(slug: $slug)\n }\n `,\n variables: {\n slug,\n },\n }),\n });\n const data = (await result.json());\n return data.data.driveIdBySlug;\n },\n getSwitchboardGatewayUrl: (driveUrl) => {\n const urlParts = driveUrl.split(\"/\");\n urlParts.pop(); // remove id\n urlParts.pop(); // remove /d\n urlParts.push(\"graphql\"); // add /graphql\n return urlParts.join(\"/\");\n },\n getDocumentGraphqlQuery: async (driveId, documentId) => {\n const doc = await reactor.getDocument(driveId, documentId);\n const docModel = reactor\n .getDocumentModelModules()\n .find((m) => m.documentModel.id === doc.documentType);\n if (!docModel) {\n throw new Error(\"Document model not found\");\n }\n const stateFields = generateDocumentStateQueryFields(docModel.documentModel, \"document\");\n return `\n query getDocument($documentId: String!) {\n ${docModel.documentModel.name} {\n getDocument(id: $documentId) {\n ${stateFields}\n }\n }\n }\n `;\n },\n };\n}\n//# sourceMappingURL=useSwitchboard.js.map","export default \"__VITE_ASSET__D8iUkzAT__\"","/**\n * Retrieves and returns an action from the client (if exists), and falls\n * back to the tree-shakable action.\n *\n * Useful for extracting overridden actions from a client (ie. if a consumer\n * wants to override the `sendTransaction` implementation).\n */\nexport function getAction(client, actionFn, \n// Some minifiers drop `Function.prototype.name`, or replace it with short letters,\n// meaning that `actionFn.name` will not always work. For that case, the consumer\n// needs to pass the name explicitly.\nname) {\n const action_implicit = client[actionFn.name];\n if (typeof action_implicit === 'function')\n return action_implicit;\n const action_explicit = client[name];\n if (typeof action_explicit === 'function')\n return action_explicit;\n return (params) => actionFn(client, params);\n}\n//# sourceMappingURL=getAction.js.map","/** https://wagmi.sh/core/api/actions/getChainId */\nexport function getChainId(config) {\n return config.state.chainId;\n}\n//# sourceMappingURL=getChainId.js.map","import { getEnsAvatar as viem_getEnsAvatar, } from 'viem/actions';\nimport { getAction } from '../utils/getAction.js';\n/** https://wagmi.sh/core/api/actions/getEnsAvatar */\nexport function getEnsAvatar(config, parameters) {\n const { chainId, ...rest } = parameters;\n const client = config.getClient({ chainId });\n const action = getAction(client, viem_getEnsAvatar, 'getEnsAvatar');\n return action(rest);\n}\n//# sourceMappingURL=getEnsAvatar.js.map","import { getEnsName as viem_getEnsName, } from 'viem/actions';\nimport { getAction } from '../utils/getAction.js';\n/** https://wagmi.sh/core/api/actions/getEnsName */\nexport function getEnsName(config, parameters) {\n const { chainId, ...rest } = parameters;\n const client = config.getClient({ chainId });\n const action = getAction(client, viem_getEnsName, 'getEnsName');\n return action(rest);\n}\n//# sourceMappingURL=getEnsName.js.map","/** https://wagmi.sh/core/api/actions/watchChainId */\nexport function watchChainId(config, parameters) {\n const { onChange } = parameters;\n return config.subscribe((state) => state.chainId, onChange);\n}\n//# sourceMappingURL=watchChainId.js.map","export const version = '2.15.4';\n//# sourceMappingURL=version.js.map","import { version } from '../version.js';\nexport const getVersion = () => `wagmi@${version}`;\n//# sourceMappingURL=getVersion.js.map","import { BaseError as CoreError } from '@wagmi/core';\nimport { getVersion } from '../utils/getVersion.js';\nexport class BaseError extends CoreError {\n constructor() {\n super(...arguments);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'WagmiError'\n });\n }\n get docsBaseUrl() {\n return 'https://wagmi.sh/react';\n }\n get version() {\n return getVersion();\n }\n}\n//# sourceMappingURL=base.js.map","import { BaseError } from './base.js';\nexport class WagmiProviderNotFoundError extends BaseError {\n constructor() {\n super('`useConfig` must be used within `WagmiProvider`.', {\n docsPath: '/api/WagmiProvider',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'WagmiProviderNotFoundError'\n });\n }\n}\n//# sourceMappingURL=context.js.map","'use client';\nimport { useContext } from 'react';\nimport { WagmiContext } from '../context.js';\nimport { WagmiProviderNotFoundError } from '../errors/context.js';\n/** https://wagmi.sh/react/api/hooks/useConfig */\nexport function useConfig(parameters = {}) {\n const config = parameters.config ?? useContext(WagmiContext);\n if (!config)\n throw new WagmiProviderNotFoundError();\n return config;\n}\n//# sourceMappingURL=useConfig.js.map","import { replaceEqualDeep } from '@tanstack/query-core';\nexport function structuralSharing(oldData, newData) {\n return replaceEqualDeep(oldData, newData);\n}\nexport function hashFn(queryKey) {\n return JSON.stringify(queryKey, (_, value) => {\n if (isPlainObject(value))\n return Object.keys(value)\n .sort()\n .reduce((result, key) => {\n result[key] = value[key];\n return result;\n }, {});\n if (typeof value === 'bigint')\n return value.toString();\n return value;\n });\n}\n// biome-ignore lint/complexity/noBannedTypes:\nfunction isPlainObject(value) {\n if (!hasObjectPrototype(value)) {\n return false;\n }\n // If has modified constructor\n const ctor = value.constructor;\n if (typeof ctor === 'undefined')\n return true;\n // If has modified prototype\n const prot = ctor.prototype;\n if (!hasObjectPrototype(prot))\n return false;\n // If constructor does not have an Object-specific method\n // biome-ignore lint/suspicious/noPrototypeBuiltins: <explanation>\n if (!prot.hasOwnProperty('isPrototypeOf'))\n return false;\n // Most likely a plain Object\n return true;\n}\nfunction hasObjectPrototype(o) {\n return Object.prototype.toString.call(o) === '[object Object]';\n}\nexport function filterQueryOptions(options) {\n // destructuring is super fast\n // biome-ignore format: no formatting\n const { \n // import('@tanstack/query-core').QueryOptions\n _defaulted, behavior, gcTime, initialData, initialDataUpdatedAt, maxPages, meta, networkMode, queryFn, queryHash, queryKey, queryKeyHashFn, retry, retryDelay, structuralSharing, \n // import('@tanstack/query-core').InfiniteQueryObserverOptions\n getPreviousPageParam, getNextPageParam, initialPageParam, \n // import('@tanstack/react-query').UseQueryOptions\n _optimisticResults, enabled, notifyOnChangeProps, placeholderData, refetchInterval, refetchIntervalInBackground, refetchOnMount, refetchOnReconnect, refetchOnWindowFocus, retryOnMount, select, staleTime, suspense, throwOnError, \n ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n // wagmi\n ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n config, connector, query, ...rest } = options;\n return rest;\n}\n//# sourceMappingURL=utils.js.map","import { getEnsAvatar, } from '../actions/getEnsAvatar.js';\nimport { filterQueryOptions } from './utils.js';\nexport function getEnsAvatarQueryOptions(config, options = {}) {\n return {\n async queryFn({ queryKey }) {\n const { name, scopeKey: _, ...parameters } = queryKey[1];\n if (!name)\n throw new Error('name is required');\n return getEnsAvatar(config, { ...parameters, name });\n },\n queryKey: getEnsAvatarQueryKey(options),\n };\n}\nexport function getEnsAvatarQueryKey(options = {}) {\n return ['ensAvatar', filterQueryOptions(options)];\n}\n//# sourceMappingURL=getEnsAvatar.js.map","import { getEnsName, } from '../actions/getEnsName.js';\nimport { filterQueryOptions } from './utils.js';\nexport function getEnsNameQueryOptions(config, options = {}) {\n return {\n async queryFn({ queryKey }) {\n const { address, scopeKey: _, ...parameters } = queryKey[1];\n if (!address)\n throw new Error('address is required');\n return getEnsName(config, { ...parameters, address });\n },\n queryKey: getEnsNameQueryKey(options),\n };\n}\nexport function getEnsNameQueryKey(options = {}) {\n return ['ensName', filterQueryOptions(options)];\n}\n//# sourceMappingURL=getEnsName.js.map","import { useInfiniteQuery as tanstack_useInfiniteQuery, useQuery as tanstack_useQuery, useMutation, } from '@tanstack/react-query';\nimport { hashFn } from '@wagmi/core/query';\nexport { useMutation };\n// Adding some basic customization.\n// Ideally we don't have this function, but `import('@tanstack/react-query').useQuery` currently has some quirks where it is super hard to\n// pass down the inferred `initialData` type because of it's discriminated overload in the on `useQuery`.\nexport function useQuery(parameters) {\n const result = tanstack_useQuery({\n ...parameters,\n queryKeyHashFn: hashFn, // for bigint support\n });\n result.queryKey = parameters.queryKey;\n return result;\n}\n// Adding some basic customization.\nexport function useInfiniteQuery(parameters) {\n const result = tanstack_useInfiniteQuery({\n ...parameters,\n queryKeyHashFn: hashFn, // for bigint support\n });\n result.queryKey = parameters.queryKey;\n return result;\n}\n//# sourceMappingURL=query.js.map","'use client';\nimport { getChainId, watchChainId, } from '@wagmi/core';\nimport { useSyncExternalStore } from 'react';\nimport { useConfig } from './useConfig.js';\n/** https://wagmi.sh/react/api/hooks/useChainId */\nexport function useChainId(parameters = {}) {\n const config = useConfig(parameters);\n return useSyncExternalStore((onChange) => watchChainId(config, { onChange }), () => getChainId(config), () => getChainId(config));\n}\n//# sourceMappingURL=useChainId.js.map","'use client';\nimport { getEnsAvatarQueryOptions, } from '@wagmi/core/query';\nimport { useQuery } from '../utils/query.js';\nimport { useChainId } from './useChainId.js';\nimport { useConfig } from './useConfig.js';\n/** https://wagmi.sh/react/api/hooks/useEnsAvatar */\nexport function useEnsAvatar(parameters = {}) {\n const { name, query = {} } = parameters;\n const config = useConfig(parameters);\n const chainId = useChainId({ config });\n const options = getEnsAvatarQueryOptions(config, {\n ...parameters,\n chainId: parameters.chainId ?? chainId,\n });\n const enabled = Boolean(name && (query.enabled ?? true));\n return useQuery({ ...query, ...options, enabled });\n}\n//# sourceMappingURL=useEnsAvatar.js.map","'use client';\nimport { getEnsNameQueryOptions, } from '@wagmi/core/query';\nimport { useQuery } from '../utils/query.js';\nimport { useChainId } from './useChainId.js';\nimport { useConfig } from './useConfig.js';\n/** https://wagmi.sh/react/api/hooks/useEnsName */\nexport function useEnsName(parameters = {}) {\n const { address, query = {} } = parameters;\n const config = useConfig(parameters);\n const chainId = useChainId({ config });\n const options = getEnsNameQueryOptions(config, {\n ...parameters,\n chainId: parameters.chainId ?? chainId,\n });\n const enabled = Boolean(address && (query.enabled ?? true));\n return useQuery({ ...query, ...options, enabled });\n}\n//# sourceMappingURL=useEnsName.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport ImgPowerhouse from \"#assets/powerhouse-rounded.png\";\nimport { useEnsAvatar, useEnsName } from \"wagmi\";\nexport function ENSAvatar(props) {\n const { address, chainId = 1, size = \"14px\" } = props;\n const style = {\n width: size,\n height: size,\n };\n const ensNameResult = useEnsName({ address, chainId });\n const name = ensNameResult.data ?? undefined;\n const ensAvatarResult = useEnsAvatar({ name });\n const avatarUrl = ensAvatarResult.data ?? ImgPowerhouse;\n const isLoading = ensNameResult.isLoading || ensAvatarResult.isLoading;\n if (isLoading)\n return (_jsx(\"div\", { className: \"fade-out flex-none animate-pulse rounded-full bg-gray-400\", style: style }));\n return (_jsx(\"img\", { alt: \"ENS Avatar\", className: \"flex-none rounded-full object-contain\", src: avatarUrl, style: style }));\n}\n//# sourceMappingURL=ens-avatar.js.map","export default \"__VITE_ASSET__CeRLT6og__\"","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport HomeBg from \"#assets/home-bg.png\";\nimport { twMerge } from \"tailwind-merge\";\nexport const HomeScreen = function HomeScreen(props) {\n const { children, containerClassName } = props;\n return (_jsx(\"div\", { className: twMerge(\"container relative mx-auto flex h-full flex-col\", containerClassName), children: _jsxs(\"div\", { className: \"m-8 flex flex-wrap justify-center gap-4 pt-12\", children: [_jsx(\"img\", { src: HomeBg, alt: \"background\", className: \"pointer-events-none absolute inset-8 z-0 size-[calc(100%-32px)] object-contain\" }), children] }) }));\n};\n//# sourceMappingURL=home-screen.js.map","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { Icon } from \"#powerhouse\";\nimport { twMerge } from \"tailwind-merge\";\nexport const HomeScreenItem = function HomeScreenItem(props) {\n const { icon, title, description, containerClassName, shareable, onClick } = props;\n return (_jsxs(\"div\", { className: twMerge(\"relative flex h-24 cursor-pointer flex-col items-center justify-center text-center text-sm text-black\", containerClassName, onClick && \"cursor-pointer\"), onClick: onClick, children: [_jsx(\"div\", { className: \"mx-auto pb-2\", children: icon || (_jsx(\"div\", { className: \"size-8 items-center justify-center rounded-lg bg-black pt-1\", children: _jsx(\"span\", { className: \"text-6 w-6 text-white\", children: title.slice(0, 1).toUpperCase() }) })) }), _jsxs(\"div\", { children: [_jsx(\"h3\", { children: title }), description && _jsx(\"p\", { className: \"text-gray-500\", children: description })] }), shareable && (_jsx(\"div\", { className: \"absolute left-2 top-0 mb-2\", children: _jsx(Icon, { name: \"PeopleFill\", width: 12, height: 12 }) }))] }));\n};\n//# sourceMappingURL=home-screen-item.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { Icon } from \"#powerhouse\";\nimport { HomeScreenItem } from \"../home-screen-item/index.js\";\nexport const HomeScreenAddDriveItem = function HomeScreenAddDriveItem(props) {\n const { containerClassName, onClick } = props;\n return (_jsx(HomeScreenItem, { title: \"Create New Drive\", icon: _jsx(Icon, { name: \"PlusSquare\", size: 32 }), onClick: onClick, containerClassName: containerClassName }));\n};\n//# sourceMappingURL=home-screen-add-drive-item.js.map","export default \"__VITE_ASSET__DPRMYPb7__\"","export default \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAACXBIWXMAACxLAAAsSwGlPZapAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAtmSURBVHgB7Z3dbtvmGcefl5LsqHYCq0C6tEUCZ0kDzAFqd0NTYAmweAfr0YD0CrpeQboriH0H6RUsu4ChAYodtCdJD3LQBGttILEBJ4tdJ2uzBoi0yIpsi+S790+ZDkmREilSHySfX6FKpkgliH5+nuf9pKAEkFLO1Bu7VzRNzEuiWfXzglDHSIgZYsYC9b1sCaEeJFZMU66WCnS7XC5vUUwE9Qmk2dndvar+ZpetB5NCxIr6Hr+II1NkgQ7FMeTnHGGygxLhRkGj5agiRRKo3mxeY3EyjkZLR8vl5bCnhxKo2WzOGqb4UpJcCDpH1T+E/wpKY+3gU4XoO0MyCaKyhvVsqifTNNWzVM8y8Hz1rW2pr3ExTDTq+Q3vNPc/lYZ+3S/qwI+iVlDSCJYlZcgDiVqGQdLXJVGTJD47NjV5s9vndP3W6429a8rZpY6LIE6hoB4aMenHMMxgkXqktECBguSBNHhwxMkWiEgt3SRDpbgOukjka8HLxt4VQeaX3uOlIkedrKPr7WjkRWiFv0yXJ/7ecdx7AAWzbsgfnDUPgs1EsWgVykz2QTTaa+melCZqRU1+4C2sO8KJSoe3vAXzZInlyRMoTxAw3MgZXbXEvee6BELdg6EI5zGkLa538gcCRkk1lNzIhXqjseQ8cmiGlbpM2nS+WdA0migViMkvKKx1V00kavr+5OlKRdTw02EEUqnrmvNCBJ1SkQvmvFMsauROQHKmOPHqc/sn6y2/6MMtLsams2X2OgpZhrQM92h6u6OQ5WHadItCliWqSL7quqDAdQ/jpqB5nBDaH6wnv/R1ZKLILS/GBbqEdvdarmP6/pGK5k1f1qg6y8N4gBHevsBSafeKOuSeoqGxPEwAXjcwvUfVQGLedZLGxTPjj9cNKWhWw/9cJ3EAYgLwuqH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amiRR630awygzTLcbgmhLE0KsOA+a7A8TgFcNKZRAZJo/Og8apkkM44fpdcOUq0hhrggkuQhiAjA9bsAdzWjt3nSdpHIYO8R4QWAxPfWNUaDbWqVSqSmVbjvf0E2DGMaJ2VFAy5VKubzV7kiU9K3zTUPnOohx0zLcTphSfIFnSyBd373u7A+Ca7rBUYhpYyh5vLUx0heeLYGsNGa2jbLRdZNrIcYSxxt9BGk3kL7arw+oVqszxYnJTXXocLpesahRqVAgJr/s64YVgZzoGp22BTocTA2KQpzK8ouuxPHKo6qfZVseILwX1Ru7P6jAteA8NqlGrDVNEJMfkLp29933lBWq53n6jbJr27aO6Ry6Jj/xDrBi2gJ3MOYHQzXZ91rezCNrLUGL3nM7BEJ4klL81XWpesBGTmfZB2nLL2BIKnzmTF02vhPKjk2Xb5BJy97jLVUToajiaJQ9rNaW+m7x6MRcPjY1edPvuq6FTb3eXFKKXeu4SCXDYkGzHkz6QdTRffp62pjLR6emloKu7VkZv3zZuCIK4m/O5v3hxQciFVSBjddMeoAsuolWlgwQR9aEKmWmkY26EOpbrzabsyVJt9SfMxt0DlppmmiLhNf4YJZqPLAFQXGMEXW/gVEnmCPWEvITv5qn41yKQFBKY7KCtPoCjx4tL4W9InKIQDQqGOaSENqnxGSEtjj69JHrFeGd4tydvnNMWyS6rMLdVW/HI5MShBoQNejbfsR5/REJcCiTJZKYl4Jm1QfPEjMmyBoWT2AOj+rQ+REzCY2pIzf7lcbJ/wH9VD8KK3ri6QAAAABJRU5ErkJggg==\"","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport renownShortHover from \"#assets/renown-short-hover.png\";\nimport renownShort from \"#assets/renown-short.png\";\nimport { AccountPopover, AccountPopoverLogin, } from \"../account-popover/index.js\";\nexport const SidebarLogin = ({ onLogin }) => {\n const content = _jsx(AccountPopoverLogin, { onLogin: onLogin });\n return (_jsx(AccountPopover, { content: content, children: _jsxs(\"div\", { className: \"group/sidebar-footer flex w-full cursor-pointer items-baseline justify-start text-sm font-semibold leading-10 text-gray-600\", children: [_jsx(\"img\", { className: \"group-hover/sidebar-footer:hidden\", src: renownShort }), _jsx(\"img\", { className: \"hidden group-hover/sidebar-footer:block\", src: renownShortHover })] }) }));\n};\n//# sourceMappingURL=sidebar-login.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { ENSAvatar } from \"#connect\";\nimport { useEnsName } from \"wagmi\";\nimport { AccountPopover, AccountPopoverUser, } from \"../account-popover/index.js\";\nexport const SidebarUser = ({ address, etherscanUrl, onDisconnect, }) => {\n const { data } = useEnsName({ address });\n const ensName = data;\n const content = (_jsx(AccountPopoverUser, { address: address, username: ensName, onDisconnect: onDisconnect, etherscanUrl: etherscanUrl }));\n return (_jsx(AccountPopover, { content: content, children: _jsx(\"div\", { className: \"flex items-center justify-center rounded-sm\", children: _jsx(ENSAvatar, { address: address, size: \"40px\" }) }) }));\n};\n//# sourceMappingURL=sidebar-user.js.map","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { Icon, SidebarFooter } from \"#powerhouse\";\nimport { twMerge } from \"tailwind-merge\";\nimport { SidebarLogin } from \"./sidebar-login.js\";\nimport { SidebarUser } from \"./sidebar-user.js\";\nexport const ConnectSidebarFooter = ({ address, className, onLogin, onClickSettings, onDisconnect, etherscanUrl = \"\", ...props }) => {\n return (_jsxs(SidebarFooter, { ...props, className: twMerge(\"flex flex-col gap-2 border-t border-gray-300 px-2 py-4\", className), children: [_jsx(\"div\", { className: \"\", children: address ? (_jsx(SidebarUser, { address: address, onDisconnect: onDisconnect, etherscanUrl: etherscanUrl })) : (_jsx(SidebarLogin, { onLogin: onLogin })) }), _jsxs(\"button\", { type: \"button\", className: \"mt-3 flex w-full cursor-pointer items-center justify-center outline-none\", onClick: onClickSettings, children: [_jsx(Icon, { className: \"text-gray-600\", name: \"Settings\" }), _jsx(\"span\", { className: \"hidden text-sm font-semibold leading-6 text-gray-800\", children: \"Settings\" })] })] }));\n};\n//# sourceMappingURL=sidebar-footer.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { Icon, SidebarHeader } from \"#powerhouse\";\nimport { twMerge } from \"tailwind-merge\";\nexport const ConnectSidebarHeader = ({ onClick, className, children, ...props }) => {\n return (_jsx(SidebarHeader, { ...props, className: twMerge(\"flex justify-center gap-4 border-b border-gray-300 py-4\", className), children: _jsx(\"button\", { className: \"\", onClick: onClick, type: \"button\", children: _jsx(Icon, { className: \"text-gray-600\", name: \"ConnectSmall\", size: 24 }) }) }));\n};\n//# sourceMappingURL=sidebar-header.js.map","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { Sidebar, SidebarPanel } from \"#powerhouse\";\nimport { ConnectSidebarFooter, } from \"./sidebar-footer.js\";\nimport { ConnectSidebarHeader, } from \"./sidebar-header.js\";\nexport const ConnectSidebar = ({ onClick, address, headerContent, onClickSettings, maxWidth = \"304px\", minWidth = \"58px\", onLogin, onDisconnect, etherscanUrl, ...props }) => {\n return (_jsxs(Sidebar, { ...props, maxWidth: maxWidth, minWidth: minWidth, children: [_jsxs(SidebarPanel, { children: [_jsx(ConnectSidebarHeader, { onClick: onClick, children: headerContent }), _jsx(\"div\", { className: \"flex flex-col\", children: props.children })] }), _jsx(ConnectSidebarFooter, { address: address, onClickSettings: onClickSettings, onLogin: onLogin, onDisconnect: onDisconnect, etherscanUrl: etherscanUrl })] }));\n};\n//# sourceMappingURL=sidebar.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { twMerge } from \"tailwind-merge\";\nexport const SidebarItem = function SidebarItem(props) {\n const { icon, title, description, containerClassName, active, onClick } = props;\n return (_jsx(\"div\", { className: twMerge(\"relative flex cursor-pointer flex-col items-center justify-center text-center text-sm text-black\", containerClassName, active && \"bg-white\", onClick && \"cursor-pointer\"), onClick: onClick, children: _jsx(\"div\", { className: \"mx-auto py-4\", children: icon || (_jsx(\"div\", { className: \"size-8 items-center justify-center rounded-lg bg-black pt-1\", children: _jsx(\"span\", { className: \"text-6 w-6 text-white\", children: title.slice(0, 1).toUpperCase() }) })) }) }));\n};\n//# sourceMappingURL=sidebar-item.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { Icon } from \"#powerhouse\";\nimport { SidebarItem } from \"./sidebar-item.js\";\nexport const SidebarAddDriveItem = function SidebarAddDriveItem(props) {\n const { containerClassName, onClick } = props;\n return (_jsx(SidebarItem, { title: \"Create New Drive\", icon: _jsx(Icon, { name: \"PlusSquare\", size: 32 }), onClick: onClick, containerClassName: containerClassName }));\n};\n//# sourceMappingURL=sidebar-add-drive-item.js.map","import { makeNodeSlugFromNodeName } from '#utils';\nimport {\n DRIVE,\n FILE,\n FOLDER,\n LOCAL,\n PUBLIC,\n type SharingType,\n SUCCESS,\n type UiDriveNode,\n type UiFileNode,\n type UiFolderNode,\n type UiNode,\n} from '@powerhousedao/design-system';\nimport { useUiNodesContext } from '@powerhousedao/reactor-browser/hooks/useUiNodesContext';\nimport { type DocumentDriveDocument, type ReadDrive } from 'document-drive';\nimport { useCallback, useMemo } from 'react';\nimport { useDocumentDriveServer } from './useDocumentDriveServer.js';\n\nexport function useMakeUiDriveNode() {\n const { getSyncStatus } = useDocumentDriveServer();\n const makeUiDriveNode = useCallback(\n async (drive: DocumentDriveDocument | ReadDrive) => {\n const isReadDrive = 'readContext' in drive;\n const id = drive.id;\n const { name, icon } = drive.state.global;\n const { slug } = drive;\n const { sharingType: _sharingType, availableOffline } = !isReadDrive\n ? drive.state.local\n : { sharingType: PUBLIC, availableOffline: false };\n const __sharingType = _sharingType?.toUpperCase();\n const sharingType = (\n __sharingType === 'PRIVATE' ? LOCAL : __sharingType\n ) as SharingType;\n const driveSyncStatus = !isReadDrive\n ? await getSyncStatus(id, sharingType)\n : undefined;\n\n // TODO: rempve this after integration in design-system\n const normalizedDriveSyncStatus =\n driveSyncStatus === 'INITIAL_SYNC'\n ? 'SYNCING'\n : driveSyncStatus;\n\n const driveNode: UiDriveNode = {\n id,\n name,\n slug: slug || null,\n kind: DRIVE,\n children: [],\n nodeMap: {},\n sharingType,\n syncStatus: normalizedDriveSyncStatus,\n availableOffline,\n icon,\n parentFolder: null,\n driveId: id,\n };\n\n const nodes = drive.state.global.nodes.map(n => {\n const node = {\n ...n,\n slug: makeNodeSlugFromNodeName(n.name),\n driveId: id,\n parentFolder: n.parentFolder || id,\n kind: n.kind.toUpperCase(),\n syncStatus: normalizedDriveSyncStatus,\n sharingType,\n };\n\n if (node.kind === DRIVE) {\n throw new Error('Drive nodes should not be nested');\n }\n\n if (node.kind === FILE) {\n return node as UiFileNode;\n }\n\n return {\n ...node,\n children: [],\n } as UiFolderNode;\n });\n\n for (const node of nodes) {\n driveNode.nodeMap[node.id] = node;\n }\n\n // eslint-disable-next-line @typescript-eslint/await-thenable\n for await (const node of nodes) {\n if (node.kind === FILE) {\n const fileSyncStatus = !isReadDrive\n ? await getSyncStatus(\n node.synchronizationUnits[0].syncId,\n sharingType,\n )\n : undefined;\n\n // TODO: rempve this after integration in design-system\n const normalizedFileSyncStatus =\n fileSyncStatus === 'INITIAL_SYNC'\n ? 'SYNCING'\n : fileSyncStatus;\n\n node.syncStatus = normalizedFileSyncStatus;\n }\n\n if (node.parentFolder === id) {\n driveNode.children.push(node);\n continue;\n }\n const parent = driveNode.nodeMap[node.parentFolder];\n\n if (parent.kind === FILE) {\n throw new Error(\n `Parent node ${node.parentFolder} is a file, not a folder`,\n );\n }\n\n parent.children.push(node);\n\n if (node.syncStatus !== SUCCESS) {\n parent.syncStatus = node.syncStatus;\n }\n }\n\n return driveNode;\n },\n [getSyncStatus],\n );\n\n return makeUiDriveNode;\n}\n\nexport function useDebugHandlers() {\n const { removeTrigger, addTrigger, registerNewPullResponderTrigger } =\n useDocumentDriveServer();\n\n const onAddTrigger = useCallback(\n async (uiNodeDriveId: string) => {\n const url = window.prompt('url') || '';\n\n const pullResponderTrigger = await registerNewPullResponderTrigger(\n uiNodeDriveId,\n url,\n { pullInterval: 6000 },\n );\n await addTrigger(uiNodeDriveId, pullResponderTrigger);\n },\n [addTrigger, registerNewPullResponderTrigger],\n );\n\n const onRemoveTrigger = useCallback(\n async (uiNodeDriveId: string) => {\n const triggerId = window.prompt('triggerId:');\n\n if (triggerId) {\n await removeTrigger(uiNodeDriveId, triggerId);\n }\n },\n [removeTrigger],\n );\n\n const onAddInvalidTrigger = useCallback(\n async (uiNodeDriveId: string) => {\n const url = window.prompt('url') || '';\n\n await addTrigger(uiNodeDriveId, {\n id: 'some-invalid-id',\n type: 'PullResponder',\n data: {\n interval: '3000',\n listenerId: 'invalid-listener-id',\n url,\n },\n });\n },\n [addTrigger],\n );\n\n return {\n onAddTrigger,\n onRemoveTrigger,\n onAddInvalidTrigger,\n };\n}\n\nexport function useUiNodes() {\n const { selectedParentNode, setSelectedNode } = useUiNodesContext();\n const { addFolder, addFile, renameNode, copyNode, moveNode } =\n useDocumentDriveServer();\n\n const onAddFile = useCallback(\n async (file: File, parentNode: UiNode | null) => {\n if (!parentNode) {\n throw new Error('Parent node is required');\n }\n if (parentNode.kind === FILE) {\n throw new Error('Cannot add file to a file');\n }\n\n const fileName = file.name.replace(/\\.zip$/gim, '');\n\n return await addFile(\n file,\n parentNode.driveId,\n fileName,\n parentNode.id,\n );\n },\n [addFile],\n );\n\n const onAddFolder = useCallback(\n async (name: string, parentNode: UiNode | null) => {\n if (!parentNode) {\n throw new Error('Parent node is required');\n }\n if (parentNode.kind === FILE) {\n throw new Error('Cannot add folder to a file');\n }\n return await addFolder(parentNode.driveId, name, parentNode.id);\n },\n [addFolder],\n );\n\n const onRenameNode = useCallback(\n async (name: string, uiNode: UiNode) => {\n if (uiNode.kind === DRIVE) {\n throw new Error(\n 'Drive can only be renamed from the drive settings modal',\n );\n }\n return await renameNode(uiNode.driveId, uiNode.id, name);\n },\n [renameNode],\n );\n\n const onCopyNode = useCallback(\n async (uiNode: UiNode, targetNode: UiNode) => {\n if (uiNode.kind === DRIVE) {\n throw new Error('Drive cannot be duplicated');\n }\n\n await copyNode(uiNode, targetNode);\n },\n [copyNode],\n );\n\n const onMoveNode = useCallback(\n async (uiNode: UiNode, targetNode: UiNode) => {\n if (uiNode.kind === DRIVE) {\n throw new Error('Drive cannot be moved');\n }\n\n await moveNode(uiNode, targetNode);\n },\n [moveNode],\n );\n\n const onDuplicateNode = useCallback(\n async (uiNode: UiNode) => {\n if (!selectedParentNode) return;\n\n if (uiNode.kind === DRIVE) {\n throw new Error('Drive cannot be duplicated');\n }\n\n await copyNode(uiNode, selectedParentNode);\n },\n [copyNode, selectedParentNode],\n );\n\n const onAddAndSelectNewFolder = useCallback(\n async (name: string) => {\n if (!name || !selectedParentNode) return;\n\n const newFolder = await onAddFolder(name, selectedParentNode);\n\n setSelectedNode({\n ...newFolder,\n kind: FOLDER,\n slug: makeNodeSlugFromNodeName(newFolder.name),\n parentFolder: selectedParentNode.id,\n syncStatus: selectedParentNode.syncStatus,\n driveId: selectedParentNode.driveId,\n sharingType: selectedParentNode.sharingType,\n children: [],\n });\n },\n [onAddFolder, selectedParentNode, setSelectedNode],\n );\n\n return useMemo(\n () => ({\n onAddFile,\n onAddFolder,\n onRenameNode,\n onCopyNode,\n onMoveNode,\n onDuplicateNode,\n onAddAndSelectNewFolder,\n }),\n [\n onAddFolder,\n onAddFile,\n onCopyNode,\n onMoveNode,\n onRenameNode,\n onDuplicateNode,\n onAddAndSelectNewFolder,\n ],\n );\n}\n\nexport type TUiNodes = ReturnType<typeof useUiNodes>;\n","import { useModal } from '#components';\nimport { useApps } from '#store';\nimport {\n toast,\n type AddLocalDriveInput,\n type AddRemoteDriveInput,\n} from '@powerhousedao/design-system';\nimport {\n FOLDER,\n useUiNodesContext,\n type SharingType,\n type UiDriveNode,\n type UiFileNode,\n type UiFolderNode,\n} from '@powerhousedao/reactor-browser';\nimport { t } from 'i18next';\nimport { useCallback } from 'react';\nimport { useDocumentDriveServer } from './useDocumentDriveServer';\nimport { useMakeUiDriveNode } from './useUiNodes';\n\nexport function useShowAddDriveModal() {\n const { showModal } = useModal();\n const { addDrive, addRemoteDrive } = useDocumentDriveServer();\n const { setSelectedNode } = useUiNodesContext();\n const apps = useApps();\n const makeUiDriveNode = useMakeUiDriveNode();\n const onAddLocalDrive = useCallback(\n async (data: AddLocalDriveInput) => {\n try {\n const app = apps.find(a => a.id === data.appId);\n const newDrive = await addDrive(\n {\n id: '',\n slug: '',\n global: {\n name: data.name,\n icon: null,\n },\n local: {\n availableOffline: data.availableOffline,\n sharingType: data.sharingType.toLowerCase(),\n listeners: [],\n triggers: [],\n },\n },\n app?.driveEditor,\n );\n\n toast(t('notifications.addDriveSuccess'), {\n type: 'connect-success',\n });\n\n const newDriveNode = await makeUiDriveNode(newDrive);\n\n setSelectedNode(newDriveNode);\n } catch (e) {\n console.error(e);\n }\n },\n [addDrive, makeUiDriveNode, setSelectedNode, t],\n );\n\n const onAddRemoteDrive = useCallback(\n async (data: AddRemoteDriveInput) => {\n try {\n const newDrive = await addRemoteDrive(data.url, {\n sharingType: data.sharingType,\n availableOffline: data.availableOffline,\n listeners: [\n {\n block: true,\n callInfo: {\n data: data.url,\n name: 'switchboard-push',\n transmitterType: 'SwitchboardPush',\n },\n filter: {\n branch: ['main'],\n documentId: ['*'],\n documentType: ['*'],\n scope: ['global'],\n },\n label: 'Switchboard Sync',\n listenerId: '1',\n system: true,\n },\n ],\n triggers: [],\n });\n\n toast(t('notifications.addDriveSuccess'), {\n type: 'connect-success',\n });\n\n const newDriveNode = await makeUiDriveNode(newDrive);\n\n setSelectedNode(newDriveNode);\n } catch (e) {\n console.error(e);\n }\n },\n [addRemoteDrive, makeUiDriveNode, setSelectedNode, t],\n );\n const showAddDriveModal = useCallback(\n () =>\n showModal('addDriveModal', {\n onAddLocalDrive,\n onAddRemoteDrive,\n }),\n [onAddLocalDrive, onAddRemoteDrive, showModal],\n );\n\n return showAddDriveModal;\n}\n\nexport function useShowDriveSettingsModal() {\n const { showModal } = useModal();\n const {\n renameDrive,\n setDriveAvailableOffline,\n setDriveSharingType,\n deleteDrive,\n } = useDocumentDriveServer();\n const { driveNodes, setSelectedNode } = useUiNodesContext();\n const onRenameDrive = useCallback(\n async (uiDriveNode: UiDriveNode, newName: string) => {\n await renameDrive(uiDriveNode.id, newName);\n },\n [renameDrive],\n );\n\n const onChangeSharingType = useCallback(\n async (uiDriveNode: UiDriveNode, newSharingType: SharingType) => {\n await setDriveSharingType(uiDriveNode.id, newSharingType);\n },\n [setDriveSharingType],\n );\n\n const onChangeAvailableOffline = useCallback(\n async (uiDriveNode: UiDriveNode, newAvailableOffline: boolean) => {\n await setDriveAvailableOffline(uiDriveNode.id, newAvailableOffline);\n },\n [setDriveAvailableOffline],\n );\n const onDeleteDrive = useCallback(\n (uiDriveNode: UiDriveNode) => {\n showModal('deleteDriveModal', {\n uiDriveNode,\n onDelete: async closeModal => {\n closeModal();\n await deleteDrive(uiDriveNode.id);\n\n setSelectedNode(driveNodes[0]);\n\n toast(t('notifications.deleteDriveSuccess'), {\n type: 'connect-deleted',\n });\n },\n });\n },\n [deleteDrive, driveNodes, setSelectedNode, showModal, t],\n );\n const showDriveSettingsModal = useCallback(\n (uiDriveNode: UiDriveNode) => {\n showModal('driveSettings', {\n uiDriveNode,\n onRenameDrive,\n onDeleteDrive,\n onChangeSharingType,\n onChangeAvailableOffline,\n });\n },\n [\n onChangeAvailableOffline,\n onChangeSharingType,\n onDeleteDrive,\n onRenameDrive,\n showModal,\n ],\n );\n\n return showDriveSettingsModal;\n}\n\nexport function useShowDeleteNodeModal() {\n const { showModal } = useModal();\n const { setSelectedNode, getParentNode } = useUiNodesContext();\n const { deleteNode } = useDocumentDriveServer();\n const showDeleteNodeModal = useCallback(\n (uiNode: UiFileNode | UiFolderNode) => {\n showModal('deleteItem', {\n uiNode,\n onDelete: async closeModal => {\n closeModal();\n\n const i18nKey =\n uiNode.kind === FOLDER\n ? 'notifications.deleteFolderSuccess'\n : 'notifications.fileDeleteSuccess';\n\n const parentNode = getParentNode(uiNode);\n\n await deleteNode(uiNode.driveId, uiNode.id);\n\n setSelectedNode(parentNode);\n\n toast(t(i18nKey), { type: 'connect-deleted' });\n },\n });\n },\n [deleteNode, getParentNode, setSelectedNode, showModal, t],\n );\n\n return showDeleteNodeModal;\n}\n","import { useUnwrappedReactor } from '#store';\nimport { LOCAL } from '@powerhousedao/design-system';\nimport { useSwitchboard } from '@powerhousedao/reactor-browser';\nimport {\n logger,\n type PullResponderTrigger,\n type PullResponderTriggerData,\n type Trigger,\n} from 'document-drive';\nimport { useCallback, useMemo, useRef, useState } from 'react';\nimport { useDocumentDriveServer } from './useDocumentDriveServer.js';\n\nexport type ClientErrorHandler = {\n strandsErrorHandler: (\n driveId: string,\n trigger: Trigger,\n status: number,\n errorMessage: string,\n ) => Promise<void>;\n};\n\nconst DELAY_LIMIT = 100000;\n\nconst isListenerIdNotFound = (errorMessage: string, listenerId?: string) => {\n if (!listenerId) return false;\n\n return errorMessage\n .toLocaleLowerCase()\n .includes(`transmitter ${listenerId} not found`);\n};\n\nexport const useClientErrorHandler = (): ClientErrorHandler => {\n const [handlingInProgress, setHandlingInProgress] = useState<string[]>([]);\n const [pullResponderTriggerMap, setPullResponderTriggerMap] = useState<\n Map<string, PullResponderTrigger>\n >(new Map());\n const {\n addTrigger,\n removeTrigger,\n registerNewPullResponderTrigger,\n renameDrive,\n addRemoteDrive,\n documentDrives,\n setDriveSharingType,\n } = useDocumentDriveServer();\n\n const reactor = useUnwrappedReactor();\n const { getDriveIdBySlug } = useSwitchboard(reactor!);\n\n const pullResponderRegisterDelay = useRef<Map<string, number>>(new Map());\n\n const handleStrands400 = useCallback(\n async (driveId: string, trigger: Trigger, handlerCode: string) => {\n setHandlingInProgress(state => [...state, handlerCode]);\n\n const triggerData =\n trigger.data as unknown as PullResponderTriggerData;\n\n try {\n let pullResponderTrigger =\n pullResponderTriggerMap.get(handlerCode);\n\n if (!pullResponderTrigger) {\n pullResponderTrigger =\n await registerNewPullResponderTrigger(\n driveId,\n triggerData.url,\n {\n pullInterval:\n Number(triggerData.interval) || 3000,\n },\n );\n\n pullResponderTriggerMap.set(\n handlerCode,\n pullResponderTrigger,\n );\n setPullResponderTriggerMap(pullResponderTriggerMap);\n }\n\n await removeTrigger(driveId, trigger.id);\n await addTrigger(driveId, pullResponderTrigger);\n\n pullResponderRegisterDelay.current.delete(handlerCode);\n } catch (error) {\n const delay =\n pullResponderRegisterDelay.current.get(handlerCode) || 1;\n pullResponderRegisterDelay.current.set(\n handlerCode,\n delay === DELAY_LIMIT ? delay : delay * 10,\n );\n\n logger.error(error);\n } finally {\n setHandlingInProgress(state =>\n state.filter(code => code !== handlerCode),\n );\n }\n },\n [\n pullResponderTriggerMap,\n removeTrigger,\n addTrigger,\n pullResponderRegisterDelay,\n registerNewPullResponderTrigger,\n ],\n );\n\n const handleDriveNotFound = useCallback(\n async (driveId: string, trigger: Trigger, handlerCode: string) => {\n setHandlingInProgress(state => [...state, handlerCode]);\n try {\n // get local drive by id\n const drive = documentDrives.find(\n drive => drive.id === driveId,\n );\n if (!drive) return;\n await removeTrigger(driveId, trigger.id);\n\n await renameDrive(\n driveId,\n drive.state.global.name + ` (${drive.id})`,\n );\n\n await setDriveSharingType(driveId, LOCAL);\n\n if (trigger.data?.url && drive.slug) {\n const newId = await getDriveIdBySlug(\n trigger.data.url,\n drive.slug,\n );\n if (newId) {\n const urlParts = trigger.data.url.split('/');\n urlParts[urlParts.length - 1] = newId;\n const newUrl = urlParts.join('/');\n\n await addRemoteDrive(newUrl, {\n availableOffline: true,\n sharingType: 'PUBLIC',\n listeners: [],\n triggers: [],\n });\n }\n }\n } catch (e: unknown) {\n logger.error(e);\n } finally {\n setHandlingInProgress(state =>\n state.filter(code => code !== handlerCode),\n );\n }\n },\n [\n documentDrives,\n removeTrigger,\n renameDrive,\n setDriveSharingType,\n getDriveIdBySlug,\n addRemoteDrive,\n ],\n );\n\n const strandsErrorHandler: ClientErrorHandler['strandsErrorHandler'] =\n useCallback(\n async (driveId, trigger, status, errorMessage) => {\n switch (status) {\n case 400: {\n if (\n isListenerIdNotFound(\n errorMessage,\n trigger.data?.listenerId,\n )\n ) {\n const autoRegisterPullResponder =\n localStorage.getItem(\n 'AUTO_REGISTER_PULL_RESPONDER',\n ) !== 'false';\n\n if (!autoRegisterPullResponder) return;\n const handlerCode = `strands:${driveId}:${status}`;\n\n if (handlingInProgress.includes(handlerCode))\n return;\n if (!trigger.data) return;\n\n const delay =\n pullResponderRegisterDelay.current.get(\n handlerCode,\n ) || 0;\n\n setTimeout(\n () =>\n handleStrands400(\n driveId,\n trigger,\n handlerCode,\n ),\n delay,\n );\n }\n\n break;\n }\n\n case 404: {\n const handlerCode = `strands:${driveId}:${status}`;\n if (handlingInProgress.includes(handlerCode)) return;\n setTimeout(\n () =>\n handleDriveNotFound(\n driveId,\n trigger,\n handlerCode,\n ),\n 0,\n );\n break;\n }\n }\n },\n [handleDriveNotFound, handleStrands400, handlingInProgress],\n );\n\n return useMemo(() => ({ strandsErrorHandler }), [strandsErrorHandler]);\n};\n","/**\n * React Router DOM v6.30.1\n *\n * Copyright (c) Remix Software Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE.md file in the root directory of this source tree.\n *\n * @license MIT\n */\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { UNSAFE_mapRouteProperties, UNSAFE_logV6DeprecationWarnings, UNSAFE_DataRouterContext, UNSAFE_DataRouterStateContext, Router, UNSAFE_useRoutesImpl, UNSAFE_NavigationContext, useHref, useResolvedPath, useLocation, useNavigate, createPath, UNSAFE_useRouteId, UNSAFE_RouteContext, useMatches, useNavigation, useBlocker } from 'react-router';\nexport { AbortedDeferredError, Await, MemoryRouter, Navigate, NavigationType, Outlet, Route, Router, Routes, UNSAFE_DataRouterContext, UNSAFE_DataRouterStateContext, UNSAFE_LocationContext, UNSAFE_NavigationContext, UNSAFE_RouteContext, UNSAFE_useRouteId, createMemoryRouter, createPath, createRoutesFromChildren, createRoutesFromElements, defer, generatePath, isRouteErrorResponse, json, matchPath, matchRoutes, parsePath, redirect, redirectDocument, renderMatches, replace, resolvePath, useActionData, useAsyncError, useAsyncValue, useBlocker, useHref, useInRouterContext, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes } from 'react-router';\nimport { stripBasename, UNSAFE_warning, createRouter, createBrowserHistory, createHashHistory, UNSAFE_ErrorResponseImpl, UNSAFE_invariant, joinPaths, IDLE_FETCHER, matchPath } from '@remix-run/router';\nexport { UNSAFE_ErrorResponseImpl } from '@remix-run/router';\n\nfunction _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}\n\nconst defaultMethod = \"get\";\nconst defaultEncType = \"application/x-www-form-urlencoded\";\nfunction isHtmlElement(object) {\n return object != null && typeof object.tagName === \"string\";\n}\nfunction isButtonElement(object) {\n return isHtmlElement(object) && object.tagName.toLowerCase() === \"button\";\n}\nfunction isFormElement(object) {\n return isHtmlElement(object) && object.tagName.toLowerCase() === \"form\";\n}\nfunction isInputElement(object) {\n return isHtmlElement(object) && object.tagName.toLowerCase() === \"input\";\n}\nfunction isModifiedEvent(event) {\n return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);\n}\nfunction shouldProcessLinkClick(event, target) {\n return event.button === 0 && (\n // Ignore everything but left clicks\n !target || target === \"_self\") &&\n // Let browser handle \"target=_blank\" etc.\n !isModifiedEvent(event) // Ignore clicks with modifier keys\n ;\n}\n/**\n * Creates a URLSearchParams object using the given initializer.\n *\n * This is identical to `new URLSearchParams(init)` except it also\n * supports arrays as values in the object form of the initializer\n * instead of just strings. This is convenient when you need multiple\n * values for a given key, but don't want to use an array initializer.\n *\n * For example, instead of:\n *\n * let searchParams = new URLSearchParams([\n * ['sort', 'name'],\n * ['sort', 'price']\n * ]);\n *\n * you can do:\n *\n * let searchParams = createSearchParams({\n * sort: ['name', 'price']\n * });\n */\nfunction createSearchParams(init) {\n if (init === void 0) {\n init = \"\";\n }\n return new URLSearchParams(typeof init === \"string\" || Array.isArray(init) || init instanceof URLSearchParams ? init : Object.keys(init).reduce((memo, key) => {\n let value = init[key];\n return memo.concat(Array.isArray(value) ? value.map(v => [key, v]) : [[key, value]]);\n }, []));\n}\nfunction getSearchParamsForLocation(locationSearch, defaultSearchParams) {\n let searchParams = createSearchParams(locationSearch);\n if (defaultSearchParams) {\n // Use `defaultSearchParams.forEach(...)` here instead of iterating of\n // `defaultSearchParams.keys()` to work-around a bug in Firefox related to\n // web extensions. Relevant Bugzilla tickets:\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1414602\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1023984\n defaultSearchParams.forEach((_, key) => {\n if (!searchParams.has(key)) {\n defaultSearchParams.getAll(key).forEach(value => {\n searchParams.append(key, value);\n });\n }\n });\n }\n return searchParams;\n}\n// One-time check for submitter support\nlet _formDataSupportsSubmitter = null;\nfunction isFormDataSubmitterSupported() {\n if (_formDataSupportsSubmitter === null) {\n try {\n new FormData(document.createElement(\"form\"),\n // @ts-expect-error if FormData supports the submitter parameter, this will throw\n 0);\n _formDataSupportsSubmitter = false;\n } catch (e) {\n _formDataSupportsSubmitter = true;\n }\n }\n return _formDataSupportsSubmitter;\n}\nconst supportedFormEncTypes = new Set([\"application/x-www-form-urlencoded\", \"multipart/form-data\", \"text/plain\"]);\nfunction getFormEncType(encType) {\n if (encType != null && !supportedFormEncTypes.has(encType)) {\n process.env.NODE_ENV !== \"production\" ? UNSAFE_warning(false, \"\\\"\" + encType + \"\\\" is not a valid `encType` for `<Form>`/`<fetcher.Form>` \" + (\"and will default to \\\"\" + defaultEncType + \"\\\"\")) : void 0;\n return null;\n }\n return encType;\n}\nfunction getFormSubmissionInfo(target, basename) {\n let method;\n let action;\n let encType;\n let formData;\n let body;\n if (isFormElement(target)) {\n // When grabbing the action from the element, it will have had the basename\n // prefixed to ensure non-JS scenarios work, so strip it since we'll\n // re-prefix in the router\n let attr = target.getAttribute(\"action\");\n action = attr ? stripBasename(attr, basename) : null;\n method = target.getAttribute(\"method\") || defaultMethod;\n encType = getFormEncType(target.getAttribute(\"enctype\")) || defaultEncType;\n formData = new FormData(target);\n } else if (isButtonElement(target) || isInputElement(target) && (target.type === \"submit\" || target.type === \"image\")) {\n let form = target.form;\n if (form == null) {\n throw new Error(\"Cannot submit a <button> or <input type=\\\"submit\\\"> without a <form>\");\n }\n // <button>/<input type=\"submit\"> may override attributes of <form>\n // When grabbing the action from the element, it will have had the basename\n // prefixed to ensure non-JS scenarios work, so strip it since we'll\n // re-prefix in the router\n let attr = target.getAttribute(\"formaction\") || form.getAttribute(\"action\");\n action = attr ? stripBasename(attr, basename) : null;\n method = target.getAttribute(\"formmethod\") || form.getAttribute(\"method\") || defaultMethod;\n encType = getFormEncType(target.getAttribute(\"formenctype\")) || getFormEncType(form.getAttribute(\"enctype\")) || defaultEncType;\n // Build a FormData object populated from a form and submitter\n formData = new FormData(form, target);\n // If this browser doesn't support the `FormData(el, submitter)` format,\n // then tack on the submitter value at the end. This is a lightweight\n // solution that is not 100% spec compliant. For complete support in older\n // browsers, consider using the `formdata-submitter-polyfill` package\n if (!isFormDataSubmitterSupported()) {\n let {\n name,\n type,\n value\n } = target;\n if (type === \"image\") {\n let prefix = name ? name + \".\" : \"\";\n formData.append(prefix + \"x\", \"0\");\n formData.append(prefix + \"y\", \"0\");\n } else if (name) {\n formData.append(name, value);\n }\n }\n } else if (isHtmlElement(target)) {\n throw new Error(\"Cannot submit element that is not <form>, <button>, or \" + \"<input type=\\\"submit|image\\\">\");\n } else {\n method = defaultMethod;\n action = null;\n encType = defaultEncType;\n body = target;\n }\n // Send body for <Form encType=\"text/plain\" so we encode it into text\n if (formData && encType === \"text/plain\") {\n body = formData;\n formData = undefined;\n }\n return {\n action,\n method: method.toLowerCase(),\n encType,\n formData,\n body\n };\n}\n\nconst _excluded = [\"onClick\", \"relative\", \"reloadDocument\", \"replace\", \"state\", \"target\", \"to\", \"preventScrollReset\", \"viewTransition\"],\n _excluded2 = [\"aria-current\", \"caseSensitive\", \"className\", \"end\", \"style\", \"to\", \"viewTransition\", \"children\"],\n _excluded3 = [\"fetcherKey\", \"navigate\", \"reloadDocument\", \"replace\", \"state\", \"method\", \"action\", \"onSubmit\", \"relative\", \"preventScrollReset\", \"viewTransition\"];\n// HEY YOU! DON'T TOUCH THIS VARIABLE!\n//\n// It is replaced with the proper version at build time via a babel plugin in\n// the rollup config.\n//\n// Export a global property onto the window for React Router detection by the\n// Core Web Vitals Technology Report. This way they can configure the `wappalyzer`\n// to detect and properly classify live websites as being built with React Router:\n// https://github.com/HTTPArchive/wappalyzer/blob/main/src/technologies/r.json\nconst REACT_ROUTER_VERSION = \"6\";\ntry {\n window.__reactRouterVersion = REACT_ROUTER_VERSION;\n} catch (e) {\n // no-op\n}\nfunction createBrowserRouter(routes, opts) {\n return createRouter({\n basename: opts == null ? void 0 : opts.basename,\n future: _extends({}, opts == null ? void 0 : opts.future, {\n v7_prependBasename: true\n }),\n history: createBrowserHistory({\n window: opts == null ? void 0 : opts.window\n }),\n hydrationData: (opts == null ? void 0 : opts.hydrationData) || parseHydrationData(),\n routes,\n mapRouteProperties: UNSAFE_mapRouteProperties,\n dataStrategy: opts == null ? void 0 : opts.dataStrategy,\n patchRoutesOnNavigation: opts == null ? void 0 : opts.patchRoutesOnNavigation,\n window: opts == null ? void 0 : opts.window\n }).initialize();\n}\nfunction createHashRouter(routes, opts) {\n return createRouter({\n basename: opts == null ? void 0 : opts.basename,\n future: _extends({}, opts == null ? void 0 : opts.future, {\n v7_prependBasename: true\n }),\n history: createHashHistory({\n window: opts == null ? void 0 : opts.window\n }),\n hydrationData: (opts == null ? void 0 : opts.hydrationData) || parseHydrationData(),\n routes,\n mapRouteProperties: UNSAFE_mapRouteProperties,\n dataStrategy: opts == null ? void 0 : opts.dataStrategy,\n patchRoutesOnNavigation: opts == null ? void 0 : opts.patchRoutesOnNavigation,\n window: opts == null ? void 0 : opts.window\n }).initialize();\n}\nfunction parseHydrationData() {\n var _window;\n let state = (_window = window) == null ? void 0 : _window.__staticRouterHydrationData;\n if (state && state.errors) {\n state = _extends({}, state, {\n errors: deserializeErrors(state.errors)\n });\n }\n return state;\n}\nfunction deserializeErrors(errors) {\n if (!errors) return null;\n let entries = Object.entries(errors);\n let serialized = {};\n for (let [key, val] of entries) {\n // Hey you! If you change this, please change the corresponding logic in\n // serializeErrors in react-router-dom/server.tsx :)\n if (val && val.__type === \"RouteErrorResponse\") {\n serialized[key] = new UNSAFE_ErrorResponseImpl(val.status, val.statusText, val.data, val.internal === true);\n } else if (val && val.__type === \"Error\") {\n // Attempt to reconstruct the right type of Error (i.e., ReferenceError)\n if (val.__subType) {\n let ErrorConstructor = window[val.__subType];\n if (typeof ErrorConstructor === \"function\") {\n try {\n // @ts-expect-error\n let error = new ErrorConstructor(val.message);\n // Wipe away the client-side stack trace. Nothing to fill it in with\n // because we don't serialize SSR stack traces for security reasons\n error.stack = \"\";\n serialized[key] = error;\n } catch (e) {\n // no-op - fall through and create a normal Error\n }\n }\n }\n if (serialized[key] == null) {\n let error = new Error(val.message);\n // Wipe away the client-side stack trace. Nothing to fill it in with\n // because we don't serialize SSR stack traces for security reasons\n error.stack = \"\";\n serialized[key] = error;\n }\n } else {\n serialized[key] = val;\n }\n }\n return serialized;\n}\nconst ViewTransitionContext = /*#__PURE__*/React.createContext({\n isTransitioning: false\n});\nif (process.env.NODE_ENV !== \"production\") {\n ViewTransitionContext.displayName = \"ViewTransition\";\n}\nconst FetchersContext = /*#__PURE__*/React.createContext(new Map());\nif (process.env.NODE_ENV !== \"production\") {\n FetchersContext.displayName = \"Fetchers\";\n}\n//#endregion\n////////////////////////////////////////////////////////////////////////////////\n//#region Components\n////////////////////////////////////////////////////////////////////////////////\n/**\n Webpack + React 17 fails to compile on any of the following because webpack\n complains that `startTransition` doesn't exist in `React`:\n * import { startTransition } from \"react\"\n * import * as React from from \"react\";\n \"startTransition\" in React ? React.startTransition(() => setState()) : setState()\n * import * as React from from \"react\";\n \"startTransition\" in React ? React[\"startTransition\"](() => setState()) : setState()\n\n Moving it to a constant such as the following solves the Webpack/React 17 issue:\n * import * as React from from \"react\";\n const START_TRANSITION = \"startTransition\";\n START_TRANSITION in React ? React[START_TRANSITION](() => setState()) : setState()\n\n However, that introduces webpack/terser minification issues in production builds\n in React 18 where minification/obfuscation ends up removing the call of\n React.startTransition entirely from the first half of the ternary. Grabbing\n this exported reference once up front resolves that issue.\n\n See https://github.com/remix-run/react-router/issues/10579\n*/\nconst START_TRANSITION = \"startTransition\";\nconst startTransitionImpl = React[START_TRANSITION];\nconst FLUSH_SYNC = \"flushSync\";\nconst flushSyncImpl = ReactDOM[FLUSH_SYNC];\nconst USE_ID = \"useId\";\nconst useIdImpl = React[USE_ID];\nfunction startTransitionSafe(cb) {\n if (startTransitionImpl) {\n startTransitionImpl(cb);\n } else {\n cb();\n }\n}\nfunction flushSyncSafe(cb) {\n if (flushSyncImpl) {\n flushSyncImpl(cb);\n } else {\n cb();\n }\n}\nclass Deferred {\n constructor() {\n this.status = \"pending\";\n this.promise = new Promise((resolve, reject) => {\n this.resolve = value => {\n if (this.status === \"pending\") {\n this.status = \"resolved\";\n resolve(value);\n }\n };\n this.reject = reason => {\n if (this.status === \"pending\") {\n this.status = \"rejected\";\n reject(reason);\n }\n };\n });\n }\n}\n/**\n * Given a Remix Router instance, render the appropriate UI\n */\nfunction RouterProvider(_ref) {\n let {\n fallbackElement,\n router,\n future\n } = _ref;\n let [state, setStateImpl] = React.useState(router.state);\n let [pendingState, setPendingState] = React.useState();\n let [vtContext, setVtContext] = React.useState({\n isTransitioning: false\n });\n let [renderDfd, setRenderDfd] = React.useState();\n let [transition, setTransition] = React.useState();\n let [interruption, setInterruption] = React.useState();\n let fetcherData = React.useRef(new Map());\n let {\n v7_startTransition\n } = future || {};\n let optInStartTransition = React.useCallback(cb => {\n if (v7_startTransition) {\n startTransitionSafe(cb);\n } else {\n cb();\n }\n }, [v7_startTransition]);\n let setState = React.useCallback((newState, _ref2) => {\n let {\n deletedFetchers,\n flushSync: flushSync,\n viewTransitionOpts: viewTransitionOpts\n } = _ref2;\n newState.fetchers.forEach((fetcher, key) => {\n if (fetcher.data !== undefined) {\n fetcherData.current.set(key, fetcher.data);\n }\n });\n deletedFetchers.forEach(key => fetcherData.current.delete(key));\n let isViewTransitionUnavailable = router.window == null || router.window.document == null || typeof router.window.document.startViewTransition !== \"function\";\n // If this isn't a view transition or it's not available in this browser,\n // just update and be done with it\n if (!viewTransitionOpts || isViewTransitionUnavailable) {\n if (flushSync) {\n flushSyncSafe(() => setStateImpl(newState));\n } else {\n optInStartTransition(() => setStateImpl(newState));\n }\n return;\n }\n // flushSync + startViewTransition\n if (flushSync) {\n // Flush through the context to mark DOM elements as transition=ing\n flushSyncSafe(() => {\n // Cancel any pending transitions\n if (transition) {\n renderDfd && renderDfd.resolve();\n transition.skipTransition();\n }\n setVtContext({\n isTransitioning: true,\n flushSync: true,\n currentLocation: viewTransitionOpts.currentLocation,\n nextLocation: viewTransitionOpts.nextLocation\n });\n });\n // Update the DOM\n let t = router.window.document.startViewTransition(() => {\n flushSyncSafe(() => setStateImpl(newState));\n });\n // Clean up after the animation completes\n t.finished.finally(() => {\n flushSyncSafe(() => {\n setRenderDfd(undefined);\n setTransition(undefined);\n setPendingState(undefined);\n setVtContext({\n isTransitioning: false\n });\n });\n });\n flushSyncSafe(() => setTransition(t));\n return;\n }\n // startTransition + startViewTransition\n if (transition) {\n // Interrupting an in-progress transition, cancel and let everything flush\n // out, and then kick off a new transition from the interruption state\n renderDfd && renderDfd.resolve();\n transition.skipTransition();\n setInterruption({\n state: newState,\n currentLocation: viewTransitionOpts.currentLocation,\n nextLocation: viewTransitionOpts.nextLocation\n });\n } else {\n // Completed navigation update with opted-in view transitions, let 'er rip\n setPendingState(newState);\n setVtContext({\n isTransitioning: true,\n flushSync: false,\n currentLocation: viewTransitionOpts.currentLocation,\n nextLocation: viewTransitionOpts.nextLocation\n });\n }\n }, [router.window, transition, renderDfd, fetcherData, optInStartTransition]);\n // Need to use a layout effect here so we are subscribed early enough to\n // pick up on any render-driven redirects/navigations (useEffect/<Navigate>)\n React.useLayoutEffect(() => router.subscribe(setState), [router, setState]);\n // When we start a view transition, create a Deferred we can use for the\n // eventual \"completed\" render\n React.useEffect(() => {\n if (vtContext.isTransitioning && !vtContext.flushSync) {\n setRenderDfd(new Deferred());\n }\n }, [vtContext]);\n // Once the deferred is created, kick off startViewTransition() to update the\n // DOM and then wait on the Deferred to resolve (indicating the DOM update has\n // happened)\n React.useEffect(() => {\n if (renderDfd && pendingState && router.window) {\n let newState = pendingState;\n let renderPromise = renderDfd.promise;\n let transition = router.window.document.startViewTransition(async () => {\n optInStartTransition(() => setStateImpl(newState));\n await renderPromise;\n });\n transition.finished.finally(() => {\n setRenderDfd(undefined);\n setTransition(undefined);\n setPendingState(undefined);\n setVtContext({\n isTransitioning: false\n });\n });\n setTransition(transition);\n }\n }, [optInStartTransition, pendingState, renderDfd, router.window]);\n // When the new location finally renders and is committed to the DOM, this\n // effect will run to resolve the transition\n React.useEffect(() => {\n if (renderDfd && pendingState && state.location.key === pendingState.location.key) {\n renderDfd.resolve();\n }\n }, [renderDfd, transition, state.location, pendingState]);\n // If we get interrupted with a new navigation during a transition, we skip\n // the active transition, let it cleanup, then kick it off again here\n React.useEffect(() => {\n if (!vtContext.isTransitioning && interruption) {\n setPendingState(interruption.state);\n setVtContext({\n isTransitioning: true,\n flushSync: false,\n currentLocation: interruption.currentLocation,\n nextLocation: interruption.nextLocation\n });\n setInterruption(undefined);\n }\n }, [vtContext.isTransitioning, interruption]);\n React.useEffect(() => {\n process.env.NODE_ENV !== \"production\" ? UNSAFE_warning(fallbackElement == null || !router.future.v7_partialHydration, \"`<RouterProvider fallbackElement>` is deprecated when using \" + \"`v7_partialHydration`, use a `HydrateFallback` component instead\") : void 0;\n // Only log this once on initial mount\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n let navigator = React.useMemo(() => {\n return {\n createHref: router.createHref,\n encodeLocation: router.encodeLocation,\n go: n => router.navigate(n),\n push: (to, state, opts) => router.navigate(to, {\n state,\n preventScrollReset: opts == null ? void 0 : opts.preventScrollReset\n }),\n replace: (to, state, opts) => router.navigate(to, {\n replace: true,\n state,\n preventScrollReset: opts == null ? void 0 : opts.preventScrollReset\n })\n };\n }, [router]);\n let basename = router.basename || \"/\";\n let dataRouterContext = React.useMemo(() => ({\n router,\n navigator,\n static: false,\n basename\n }), [router, navigator, basename]);\n let routerFuture = React.useMemo(() => ({\n v7_relativeSplatPath: router.future.v7_relativeSplatPath\n }), [router.future.v7_relativeSplatPath]);\n React.useEffect(() => UNSAFE_logV6DeprecationWarnings(future, router.future), [future, router.future]);\n // The fragment and {null} here are important! We need them to keep React 18's\n // useId happy when we are server-rendering since we may have a <script> here\n // containing the hydrated server-side staticContext (from StaticRouterProvider).\n // useId relies on the component tree structure to generate deterministic id's\n // so we need to ensure it remains the same on the client even though\n // we don't need the <script> tag\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(UNSAFE_DataRouterContext.Provider, {\n value: dataRouterContext\n }, /*#__PURE__*/React.createElement(UNSAFE_DataRouterStateContext.Provider, {\n value: state\n }, /*#__PURE__*/React.createElement(FetchersContext.Provider, {\n value: fetcherData.current\n }, /*#__PURE__*/React.createElement(ViewTransitionContext.Provider, {\n value: vtContext\n }, /*#__PURE__*/React.createElement(Router, {\n basename: basename,\n location: state.location,\n navigationType: state.historyAction,\n navigator: navigator,\n future: routerFuture\n }, state.initialized || router.future.v7_partialHydration ? /*#__PURE__*/React.createElement(MemoizedDataRoutes, {\n routes: router.routes,\n future: router.future,\n state: state\n }) : fallbackElement))))), null);\n}\n// Memoize to avoid re-renders when updating `ViewTransitionContext`\nconst MemoizedDataRoutes = /*#__PURE__*/React.memo(DataRoutes);\nfunction DataRoutes(_ref3) {\n let {\n routes,\n future,\n state\n } = _ref3;\n return UNSAFE_useRoutesImpl(routes, undefined, state, future);\n}\n/**\n * A `<Router>` for use in web browsers. Provides the cleanest URLs.\n */\nfunction BrowserRouter(_ref4) {\n let {\n basename,\n children,\n future,\n window\n } = _ref4;\n let historyRef = React.useRef();\n if (historyRef.current == null) {\n historyRef.current = createBrowserHistory({\n window,\n v5Compat: true\n });\n }\n let history = historyRef.current;\n let [state, setStateImpl] = React.useState({\n action: history.action,\n location: history.location\n });\n let {\n v7_startTransition\n } = future || {};\n let setState = React.useCallback(newState => {\n v7_startTransition && startTransitionImpl ? startTransitionImpl(() => setStateImpl(newState)) : setStateImpl(newState);\n }, [setStateImpl, v7_startTransition]);\n React.useLayoutEffect(() => history.listen(setState), [history, setState]);\n React.useEffect(() => UNSAFE_logV6DeprecationWarnings(future), [future]);\n return /*#__PURE__*/React.createElement(Router, {\n basename: basename,\n children: children,\n location: state.location,\n navigationType: state.action,\n navigator: history,\n future: future\n });\n}\n/**\n * A `<Router>` for use in web browsers. Stores the location in the hash\n * portion of the URL so it is not sent to the server.\n */\nfunction HashRouter(_ref5) {\n let {\n basename,\n children,\n future,\n window\n } = _ref5;\n let historyRef = React.useRef();\n if (historyRef.current == null) {\n historyRef.current = createHashHistory({\n window,\n v5Compat: true\n });\n }\n let history = historyRef.current;\n let [state, setStateImpl] = React.useState({\n action: history.action,\n location: history.location\n });\n let {\n v7_startTransition\n } = future || {};\n let setState = React.useCallback(newState => {\n v7_startTransition && startTransitionImpl ? startTransitionImpl(() => setStateImpl(newState)) : setStateImpl(newState);\n }, [setStateImpl, v7_startTransition]);\n React.useLayoutEffect(() => history.listen(setState), [history, setState]);\n React.useEffect(() => UNSAFE_logV6DeprecationWarnings(future), [future]);\n return /*#__PURE__*/React.createElement(Router, {\n basename: basename,\n children: children,\n location: state.location,\n navigationType: state.action,\n navigator: history,\n future: future\n });\n}\n/**\n * A `<Router>` that accepts a pre-instantiated history object. It's important\n * to note that using your own history object is highly discouraged and may add\n * two versions of the history library to your bundles unless you use the same\n * version of the history library that React Router uses internally.\n */\nfunction HistoryRouter(_ref6) {\n let {\n basename,\n children,\n future,\n history\n } = _ref6;\n let [state, setStateImpl] = React.useState({\n action: history.action,\n location: history.location\n });\n let {\n v7_startTransition\n } = future || {};\n let setState = React.useCallback(newState => {\n v7_startTransition && startTransitionImpl ? startTransitionImpl(() => setStateImpl(newState)) : setStateImpl(newState);\n }, [setStateImpl, v7_startTransition]);\n React.useLayoutEffect(() => history.listen(setState), [history, setState]);\n React.useEffect(() => UNSAFE_logV6DeprecationWarnings(future), [future]);\n return /*#__PURE__*/React.createElement(Router, {\n basename: basename,\n children: children,\n location: state.location,\n navigationType: state.action,\n navigator: history,\n future: future\n });\n}\nif (process.env.NODE_ENV !== \"production\") {\n HistoryRouter.displayName = \"unstable_HistoryRouter\";\n}\nconst isBrowser = typeof window !== \"undefined\" && typeof window.document !== \"undefined\" && typeof window.document.createElement !== \"undefined\";\nconst ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\\/\\/)/i;\n/**\n * The public API for rendering a history-aware `<a>`.\n */\nconst Link = /*#__PURE__*/React.forwardRef(function LinkWithRef(_ref7, ref) {\n let {\n onClick,\n relative,\n reloadDocument,\n replace,\n state,\n target,\n to,\n preventScrollReset,\n viewTransition\n } = _ref7,\n rest = _objectWithoutPropertiesLoose(_ref7, _excluded);\n let {\n basename\n } = React.useContext(UNSAFE_NavigationContext);\n // Rendered into <a href> for absolute URLs\n let absoluteHref;\n let isExternal = false;\n if (typeof to === \"string\" && ABSOLUTE_URL_REGEX.test(to)) {\n // Render the absolute href server- and client-side\n absoluteHref = to;\n // Only check for external origins client-side\n if (isBrowser) {\n try {\n let currentUrl = new URL(window.location.href);\n let targetUrl = to.startsWith(\"//\") ? new URL(currentUrl.protocol + to) : new URL(to);\n let path = stripBasename(targetUrl.pathname, basename);\n if (targetUrl.origin === currentUrl.origin && path != null) {\n // Strip the protocol/origin/basename for same-origin absolute URLs\n to = path + targetUrl.search + targetUrl.hash;\n } else {\n isExternal = true;\n }\n } catch (e) {\n // We can't do external URL detection without a valid URL\n process.env.NODE_ENV !== \"production\" ? UNSAFE_warning(false, \"<Link to=\\\"\" + to + \"\\\"> contains an invalid URL which will probably break \" + \"when clicked - please update to a valid URL path.\") : void 0;\n }\n }\n }\n // Rendered into <a href> for relative URLs\n let href = useHref(to, {\n relative\n });\n let internalOnClick = useLinkClickHandler(to, {\n replace,\n state,\n target,\n preventScrollReset,\n relative,\n viewTransition\n });\n function handleClick(event) {\n if (onClick) onClick(event);\n if (!event.defaultPrevented) {\n internalOnClick(event);\n }\n }\n return (\n /*#__PURE__*/\n // eslint-disable-next-line jsx-a11y/anchor-has-content\n React.createElement(\"a\", _extends({}, rest, {\n href: absoluteHref || href,\n onClick: isExternal || reloadDocument ? onClick : handleClick,\n ref: ref,\n target: target\n }))\n );\n});\nif (process.env.NODE_ENV !== \"production\") {\n Link.displayName = \"Link\";\n}\n/**\n * A `<Link>` wrapper that knows if it's \"active\" or not.\n */\nconst NavLink = /*#__PURE__*/React.forwardRef(function NavLinkWithRef(_ref8, ref) {\n let {\n \"aria-current\": ariaCurrentProp = \"page\",\n caseSensitive = false,\n className: classNameProp = \"\",\n end = false,\n style: styleProp,\n to,\n viewTransition,\n children\n } = _ref8,\n rest = _objectWithoutPropertiesLoose(_ref8, _excluded2);\n let path = useResolvedPath(to, {\n relative: rest.relative\n });\n let location = useLocation();\n let routerState = React.useContext(UNSAFE_DataRouterStateContext);\n let {\n navigator,\n basename\n } = React.useContext(UNSAFE_NavigationContext);\n let isTransitioning = routerState != null &&\n // Conditional usage is OK here because the usage of a data router is static\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useViewTransitionState(path) && viewTransition === true;\n let toPathname = navigator.encodeLocation ? navigator.encodeLocation(path).pathname : path.pathname;\n let locationPathname = location.pathname;\n let nextLocationPathname = routerState && routerState.navigation && routerState.navigation.location ? routerState.navigation.location.pathname : null;\n if (!caseSensitive) {\n locationPathname = locationPathname.toLowerCase();\n nextLocationPathname = nextLocationPathname ? nextLocationPathname.toLowerCase() : null;\n toPathname = toPathname.toLowerCase();\n }\n if (nextLocationPathname && basename) {\n nextLocationPathname = stripBasename(nextLocationPathname, basename) || nextLocationPathname;\n }\n // If the `to` has a trailing slash, look at that exact spot. Otherwise,\n // we're looking for a slash _after_ what's in `to`. For example:\n //\n // <NavLink to=\"/users\"> and <NavLink to=\"/users/\">\n // both want to look for a / at index 6 to match URL `/users/matt`\n const endSlashPosition = toPathname !== \"/\" && toPathname.endsWith(\"/\") ? toPathname.length - 1 : toPathname.length;\n let isActive = locationPathname === toPathname || !end && locationPathname.startsWith(toPathname) && locationPathname.charAt(endSlashPosition) === \"/\";\n let isPending = nextLocationPathname != null && (nextLocationPathname === toPathname || !end && nextLocationPathname.startsWith(toPathname) && nextLocationPathname.charAt(toPathname.length) === \"/\");\n let renderProps = {\n isActive,\n isPending,\n isTransitioning\n };\n let ariaCurrent = isActive ? ariaCurrentProp : undefined;\n let className;\n if (typeof classNameProp === \"function\") {\n className = classNameProp(renderProps);\n } else {\n // If the className prop is not a function, we use a default `active`\n // class for <NavLink />s that are active. In v5 `active` was the default\n // value for `activeClassName`, but we are removing that API and can still\n // use the old default behavior for a cleaner upgrade path and keep the\n // simple styling rules working as they currently do.\n className = [classNameProp, isActive ? \"active\" : null, isPending ? \"pending\" : null, isTransitioning ? \"transitioning\" : null].filter(Boolean).join(\" \");\n }\n let style = typeof styleProp === \"function\" ? styleProp(renderProps) : styleProp;\n return /*#__PURE__*/React.createElement(Link, _extends({}, rest, {\n \"aria-current\": ariaCurrent,\n className: className,\n ref: ref,\n style: style,\n to: to,\n viewTransition: viewTransition\n }), typeof children === \"function\" ? children(renderProps) : children);\n});\nif (process.env.NODE_ENV !== \"production\") {\n NavLink.displayName = \"NavLink\";\n}\n/**\n * A `@remix-run/router`-aware `<form>`. It behaves like a normal form except\n * that the interaction with the server is with `fetch` instead of new document\n * requests, allowing components to add nicer UX to the page as the form is\n * submitted and returns with data.\n */\nconst Form = /*#__PURE__*/React.forwardRef((_ref9, forwardedRef) => {\n let {\n fetcherKey,\n navigate,\n reloadDocument,\n replace,\n state,\n method = defaultMethod,\n action,\n onSubmit,\n relative,\n preventScrollReset,\n viewTransition\n } = _ref9,\n props = _objectWithoutPropertiesLoose(_ref9, _excluded3);\n let submit = useSubmit();\n let formAction = useFormAction(action, {\n relative\n });\n let formMethod = method.toLowerCase() === \"get\" ? \"get\" : \"post\";\n let submitHandler = event => {\n onSubmit && onSubmit(event);\n if (event.defaultPrevented) return;\n event.preventDefault();\n let submitter = event.nativeEvent.submitter;\n let submitMethod = (submitter == null ? void 0 : submitter.getAttribute(\"formmethod\")) || method;\n submit(submitter || event.currentTarget, {\n fetcherKey,\n method: submitMethod,\n navigate,\n replace,\n state,\n relative,\n preventScrollReset,\n viewTransition\n });\n };\n return /*#__PURE__*/React.createElement(\"form\", _extends({\n ref: forwardedRef,\n method: formMethod,\n action: formAction,\n onSubmit: reloadDocument ? onSubmit : submitHandler\n }, props));\n});\nif (process.env.NODE_ENV !== \"production\") {\n Form.displayName = \"Form\";\n}\n/**\n * This component will emulate the browser's scroll restoration on location\n * changes.\n */\nfunction ScrollRestoration(_ref10) {\n let {\n getKey,\n storageKey\n } = _ref10;\n useScrollRestoration({\n getKey,\n storageKey\n });\n return null;\n}\nif (process.env.NODE_ENV !== \"production\") {\n ScrollRestoration.displayName = \"ScrollRestoration\";\n}\n//#endregion\n////////////////////////////////////////////////////////////////////////////////\n//#region Hooks\n////////////////////////////////////////////////////////////////////////////////\nvar DataRouterHook;\n(function (DataRouterHook) {\n DataRouterHook[\"UseScrollRestoration\"] = \"useScrollRestoration\";\n DataRouterHook[\"UseSubmit\"] = \"useSubmit\";\n DataRouterHook[\"UseSubmitFetcher\"] = \"useSubmitFetcher\";\n DataRouterHook[\"UseFetcher\"] = \"useFetcher\";\n DataRouterHook[\"useViewTransitionState\"] = \"useViewTransitionState\";\n})(DataRouterHook || (DataRouterHook = {}));\nvar DataRouterStateHook;\n(function (DataRouterStateHook) {\n DataRouterStateHook[\"UseFetcher\"] = \"useFetcher\";\n DataRouterStateHook[\"UseFetchers\"] = \"useFetchers\";\n DataRouterStateHook[\"UseScrollRestoration\"] = \"useScrollRestoration\";\n})(DataRouterStateHook || (DataRouterStateHook = {}));\n// Internal hooks\nfunction getDataRouterConsoleError(hookName) {\n return hookName + \" must be used within a data router. See https://reactrouter.com/v6/routers/picking-a-router.\";\n}\nfunction useDataRouterContext(hookName) {\n let ctx = React.useContext(UNSAFE_DataRouterContext);\n !ctx ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, getDataRouterConsoleError(hookName)) : UNSAFE_invariant(false) : void 0;\n return ctx;\n}\nfunction useDataRouterState(hookName) {\n let state = React.useContext(UNSAFE_DataRouterStateContext);\n !state ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, getDataRouterConsoleError(hookName)) : UNSAFE_invariant(false) : void 0;\n return state;\n}\n// External hooks\n/**\n * Handles the click behavior for router `<Link>` components. This is useful if\n * you need to create custom `<Link>` components with the same click behavior we\n * use in our exported `<Link>`.\n */\nfunction useLinkClickHandler(to, _temp) {\n let {\n target,\n replace: replaceProp,\n state,\n preventScrollReset,\n relative,\n viewTransition\n } = _temp === void 0 ? {} : _temp;\n let navigate = useNavigate();\n let location = useLocation();\n let path = useResolvedPath(to, {\n relative\n });\n return React.useCallback(event => {\n if (shouldProcessLinkClick(event, target)) {\n event.preventDefault();\n // If the URL hasn't changed, a regular <a> will do a replace instead of\n // a push, so do the same here unless the replace prop is explicitly set\n let replace = replaceProp !== undefined ? replaceProp : createPath(location) === createPath(path);\n navigate(to, {\n replace,\n state,\n preventScrollReset,\n relative,\n viewTransition\n });\n }\n }, [location, navigate, path, replaceProp, state, target, to, preventScrollReset, relative, viewTransition]);\n}\n/**\n * A convenient wrapper for reading and writing search parameters via the\n * URLSearchParams interface.\n */\nfunction useSearchParams(defaultInit) {\n process.env.NODE_ENV !== \"production\" ? UNSAFE_warning(typeof URLSearchParams !== \"undefined\", \"You cannot use the `useSearchParams` hook in a browser that does not \" + \"support the URLSearchParams API. If you need to support Internet \" + \"Explorer 11, we recommend you load a polyfill such as \" + \"https://github.com/ungap/url-search-params.\") : void 0;\n let defaultSearchParamsRef = React.useRef(createSearchParams(defaultInit));\n let hasSetSearchParamsRef = React.useRef(false);\n let location = useLocation();\n let searchParams = React.useMemo(() =>\n // Only merge in the defaults if we haven't yet called setSearchParams.\n // Once we call that we want those to take precedence, otherwise you can't\n // remove a param with setSearchParams({}) if it has an initial value\n getSearchParamsForLocation(location.search, hasSetSearchParamsRef.current ? null : defaultSearchParamsRef.current), [location.search]);\n let navigate = useNavigate();\n let setSearchParams = React.useCallback((nextInit, navigateOptions) => {\n const newSearchParams = createSearchParams(typeof nextInit === \"function\" ? nextInit(searchParams) : nextInit);\n hasSetSearchParamsRef.current = true;\n navigate(\"?\" + newSearchParams, navigateOptions);\n }, [navigate, searchParams]);\n return [searchParams, setSearchParams];\n}\nfunction validateClientSideSubmission() {\n if (typeof document === \"undefined\") {\n throw new Error(\"You are calling submit during the server render. \" + \"Try calling submit within a `useEffect` or callback instead.\");\n }\n}\nlet fetcherId = 0;\nlet getUniqueFetcherId = () => \"__\" + String(++fetcherId) + \"__\";\n/**\n * Returns a function that may be used to programmatically submit a form (or\n * some arbitrary data) to the server.\n */\nfunction useSubmit() {\n let {\n router\n } = useDataRouterContext(DataRouterHook.UseSubmit);\n let {\n basename\n } = React.useContext(UNSAFE_NavigationContext);\n let currentRouteId = UNSAFE_useRouteId();\n return React.useCallback(function (target, options) {\n if (options === void 0) {\n options = {};\n }\n validateClientSideSubmission();\n let {\n action,\n method,\n encType,\n formData,\n body\n } = getFormSubmissionInfo(target, basename);\n if (options.navigate === false) {\n let key = options.fetcherKey || getUniqueFetcherId();\n router.fetch(key, currentRouteId, options.action || action, {\n preventScrollReset: options.preventScrollReset,\n formData,\n body,\n formMethod: options.method || method,\n formEncType: options.encType || encType,\n flushSync: options.flushSync\n });\n } else {\n router.navigate(options.action || action, {\n preventScrollReset: options.preventScrollReset,\n formData,\n body,\n formMethod: options.method || method,\n formEncType: options.encType || encType,\n replace: options.replace,\n state: options.state,\n fromRouteId: currentRouteId,\n flushSync: options.flushSync,\n viewTransition: options.viewTransition\n });\n }\n }, [router, basename, currentRouteId]);\n}\n// v7: Eventually we should deprecate this entirely in favor of using the\n// router method directly?\nfunction useFormAction(action, _temp2) {\n let {\n relative\n } = _temp2 === void 0 ? {} : _temp2;\n let {\n basename\n } = React.useContext(UNSAFE_NavigationContext);\n let routeContext = React.useContext(UNSAFE_RouteContext);\n !routeContext ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, \"useFormAction must be used inside a RouteContext\") : UNSAFE_invariant(false) : void 0;\n let [match] = routeContext.matches.slice(-1);\n // Shallow clone path so we can modify it below, otherwise we modify the\n // object referenced by useMemo inside useResolvedPath\n let path = _extends({}, useResolvedPath(action ? action : \".\", {\n relative\n }));\n // If no action was specified, browsers will persist current search params\n // when determining the path, so match that behavior\n // https://github.com/remix-run/remix/issues/927\n let location = useLocation();\n if (action == null) {\n // Safe to write to this directly here since if action was undefined, we\n // would have called useResolvedPath(\".\") which will never include a search\n path.search = location.search;\n // When grabbing search params from the URL, remove any included ?index param\n // since it might not apply to our contextual route. We add it back based\n // on match.route.index below\n let params = new URLSearchParams(path.search);\n let indexValues = params.getAll(\"index\");\n let hasNakedIndexParam = indexValues.some(v => v === \"\");\n if (hasNakedIndexParam) {\n params.delete(\"index\");\n indexValues.filter(v => v).forEach(v => params.append(\"index\", v));\n let qs = params.toString();\n path.search = qs ? \"?\" + qs : \"\";\n }\n }\n if ((!action || action === \".\") && match.route.index) {\n path.search = path.search ? path.search.replace(/^\\?/, \"?index&\") : \"?index\";\n }\n // If we're operating within a basename, prepend it to the pathname prior\n // to creating the form action. If this is a root navigation, then just use\n // the raw basename which allows the basename to have full control over the\n // presence of a trailing slash on root actions\n if (basename !== \"/\") {\n path.pathname = path.pathname === \"/\" ? basename : joinPaths([basename, path.pathname]);\n }\n return createPath(path);\n}\n// TODO: (v7) Change the useFetcher generic default from `any` to `unknown`\n/**\n * Interacts with route loaders and actions without causing a navigation. Great\n * for any interaction that stays on the same page.\n */\nfunction useFetcher(_temp3) {\n var _route$matches;\n let {\n key\n } = _temp3 === void 0 ? {} : _temp3;\n let {\n router\n } = useDataRouterContext(DataRouterHook.UseFetcher);\n let state = useDataRouterState(DataRouterStateHook.UseFetcher);\n let fetcherData = React.useContext(FetchersContext);\n let route = React.useContext(UNSAFE_RouteContext);\n let routeId = (_route$matches = route.matches[route.matches.length - 1]) == null ? void 0 : _route$matches.route.id;\n !fetcherData ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, \"useFetcher must be used inside a FetchersContext\") : UNSAFE_invariant(false) : void 0;\n !route ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, \"useFetcher must be used inside a RouteContext\") : UNSAFE_invariant(false) : void 0;\n !(routeId != null) ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, \"useFetcher can only be used on routes that contain a unique \\\"id\\\"\") : UNSAFE_invariant(false) : void 0;\n // Fetcher key handling\n // OK to call conditionally to feature detect `useId`\n // eslint-disable-next-line react-hooks/rules-of-hooks\n let defaultKey = useIdImpl ? useIdImpl() : \"\";\n let [fetcherKey, setFetcherKey] = React.useState(key || defaultKey);\n if (key && key !== fetcherKey) {\n setFetcherKey(key);\n } else if (!fetcherKey) {\n // We will only fall through here when `useId` is not available\n setFetcherKey(getUniqueFetcherId());\n }\n // Registration/cleanup\n React.useEffect(() => {\n router.getFetcher(fetcherKey);\n return () => {\n // Tell the router we've unmounted - if v7_fetcherPersist is enabled this\n // will not delete immediately but instead queue up a delete after the\n // fetcher returns to an `idle` state\n router.deleteFetcher(fetcherKey);\n };\n }, [router, fetcherKey]);\n // Fetcher additions\n let load = React.useCallback((href, opts) => {\n !routeId ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, \"No routeId available for fetcher.load()\") : UNSAFE_invariant(false) : void 0;\n router.fetch(fetcherKey, routeId, href, opts);\n }, [fetcherKey, routeId, router]);\n let submitImpl = useSubmit();\n let submit = React.useCallback((target, opts) => {\n submitImpl(target, _extends({}, opts, {\n navigate: false,\n fetcherKey\n }));\n }, [fetcherKey, submitImpl]);\n let FetcherForm = React.useMemo(() => {\n let FetcherForm = /*#__PURE__*/React.forwardRef((props, ref) => {\n return /*#__PURE__*/React.createElement(Form, _extends({}, props, {\n navigate: false,\n fetcherKey: fetcherKey,\n ref: ref\n }));\n });\n if (process.env.NODE_ENV !== \"production\") {\n FetcherForm.displayName = \"fetcher.Form\";\n }\n return FetcherForm;\n }, [fetcherKey]);\n // Exposed FetcherWithComponents\n let fetcher = state.fetchers.get(fetcherKey) || IDLE_FETCHER;\n let data = fetcherData.get(fetcherKey);\n let fetcherWithComponents = React.useMemo(() => _extends({\n Form: FetcherForm,\n submit,\n load\n }, fetcher, {\n data\n }), [FetcherForm, submit, load, fetcher, data]);\n return fetcherWithComponents;\n}\n/**\n * Provides all fetchers currently on the page. Useful for layouts and parent\n * routes that need to provide pending/optimistic UI regarding the fetch.\n */\nfunction useFetchers() {\n let state = useDataRouterState(DataRouterStateHook.UseFetchers);\n return Array.from(state.fetchers.entries()).map(_ref11 => {\n let [key, fetcher] = _ref11;\n return _extends({}, fetcher, {\n key\n });\n });\n}\nconst SCROLL_RESTORATION_STORAGE_KEY = \"react-router-scroll-positions\";\nlet savedScrollPositions = {};\n/**\n * When rendered inside a RouterProvider, will restore scroll positions on navigations\n */\nfunction useScrollRestoration(_temp4) {\n let {\n getKey,\n storageKey\n } = _temp4 === void 0 ? {} : _temp4;\n let {\n router\n } = useDataRouterContext(DataRouterHook.UseScrollRestoration);\n let {\n restoreScrollPosition,\n preventScrollReset\n } = useDataRouterState(DataRouterStateHook.UseScrollRestoration);\n let {\n basename\n } = React.useContext(UNSAFE_NavigationContext);\n let location = useLocation();\n let matches = useMatches();\n let navigation = useNavigation();\n // Trigger manual scroll restoration while we're active\n React.useEffect(() => {\n window.history.scrollRestoration = \"manual\";\n return () => {\n window.history.scrollRestoration = \"auto\";\n };\n }, []);\n // Save positions on pagehide\n usePageHide(React.useCallback(() => {\n if (navigation.state === \"idle\") {\n let key = (getKey ? getKey(location, matches) : null) || location.key;\n savedScrollPositions[key] = window.scrollY;\n }\n try {\n sessionStorage.setItem(storageKey || SCROLL_RESTORATION_STORAGE_KEY, JSON.stringify(savedScrollPositions));\n } catch (error) {\n process.env.NODE_ENV !== \"production\" ? UNSAFE_warning(false, \"Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (\" + error + \").\") : void 0;\n }\n window.history.scrollRestoration = \"auto\";\n }, [storageKey, getKey, navigation.state, location, matches]));\n // Read in any saved scroll locations\n if (typeof document !== \"undefined\") {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useLayoutEffect(() => {\n try {\n let sessionPositions = sessionStorage.getItem(storageKey || SCROLL_RESTORATION_STORAGE_KEY);\n if (sessionPositions) {\n savedScrollPositions = JSON.parse(sessionPositions);\n }\n } catch (e) {\n // no-op, use default empty object\n }\n }, [storageKey]);\n // Enable scroll restoration in the router\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useLayoutEffect(() => {\n let getKeyWithoutBasename = getKey && basename !== \"/\" ? (location, matches) => getKey( // Strip the basename to match useLocation()\n _extends({}, location, {\n pathname: stripBasename(location.pathname, basename) || location.pathname\n }), matches) : getKey;\n let disableScrollRestoration = router == null ? void 0 : router.enableScrollRestoration(savedScrollPositions, () => window.scrollY, getKeyWithoutBasename);\n return () => disableScrollRestoration && disableScrollRestoration();\n }, [router, basename, getKey]);\n // Restore scrolling when state.restoreScrollPosition changes\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useLayoutEffect(() => {\n // Explicit false means don't do anything (used for submissions)\n if (restoreScrollPosition === false) {\n return;\n }\n // been here before, scroll to it\n if (typeof restoreScrollPosition === \"number\") {\n window.scrollTo(0, restoreScrollPosition);\n return;\n }\n // try to scroll to the hash\n if (location.hash) {\n let el = document.getElementById(decodeURIComponent(location.hash.slice(1)));\n if (el) {\n el.scrollIntoView();\n return;\n }\n }\n // Don't reset if this navigation opted out\n if (preventScrollReset === true) {\n return;\n }\n // otherwise go to the top on new locations\n window.scrollTo(0, 0);\n }, [location, restoreScrollPosition, preventScrollReset]);\n }\n}\n/**\n * Setup a callback to be fired on the window's `beforeunload` event. This is\n * useful for saving some data to `window.localStorage` just before the page\n * refreshes.\n *\n * Note: The `callback` argument should be a function created with\n * `React.useCallback()`.\n */\nfunction useBeforeUnload(callback, options) {\n let {\n capture\n } = options || {};\n React.useEffect(() => {\n let opts = capture != null ? {\n capture\n } : undefined;\n window.addEventListener(\"beforeunload\", callback, opts);\n return () => {\n window.removeEventListener(\"beforeunload\", callback, opts);\n };\n }, [callback, capture]);\n}\n/**\n * Setup a callback to be fired on the window's `pagehide` event. This is\n * useful for saving some data to `window.localStorage` just before the page\n * refreshes. This event is better supported than beforeunload across browsers.\n *\n * Note: The `callback` argument should be a function created with\n * `React.useCallback()`.\n */\nfunction usePageHide(callback, options) {\n let {\n capture\n } = options || {};\n React.useEffect(() => {\n let opts = capture != null ? {\n capture\n } : undefined;\n window.addEventListener(\"pagehide\", callback, opts);\n return () => {\n window.removeEventListener(\"pagehide\", callback, opts);\n };\n }, [callback, capture]);\n}\n/**\n * Wrapper around useBlocker to show a window.confirm prompt to users instead\n * of building a custom UI with useBlocker.\n *\n * Warning: This has *a lot of rough edges* and behaves very differently (and\n * very incorrectly in some cases) across browsers if user click addition\n * back/forward navigations while the confirm is open. Use at your own risk.\n */\nfunction usePrompt(_ref12) {\n let {\n when,\n message\n } = _ref12;\n let blocker = useBlocker(when);\n React.useEffect(() => {\n if (blocker.state === \"blocked\") {\n let proceed = window.confirm(message);\n if (proceed) {\n // This timeout is needed to avoid a weird \"race\" on POP navigations\n // between the `window.history` revert navigation and the result of\n // `window.confirm`\n setTimeout(blocker.proceed, 0);\n } else {\n blocker.reset();\n }\n }\n }, [blocker, message]);\n React.useEffect(() => {\n if (blocker.state === \"blocked\" && !when) {\n blocker.reset();\n }\n }, [blocker, when]);\n}\n/**\n * Return a boolean indicating if there is an active view transition to the\n * given href. You can use this value to render CSS classes or viewTransitionName\n * styles onto your elements\n *\n * @param href The destination href\n * @param [opts.relative] Relative routing type (\"route\" | \"path\")\n */\nfunction useViewTransitionState(to, opts) {\n if (opts === void 0) {\n opts = {};\n }\n let vtContext = React.useContext(ViewTransitionContext);\n !(vtContext != null) ? process.env.NODE_ENV !== \"production\" ? UNSAFE_invariant(false, \"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. \" + \"Did you accidentally import `RouterProvider` from `react-router`?\") : UNSAFE_invariant(false) : void 0;\n let {\n basename\n } = useDataRouterContext(DataRouterHook.useViewTransitionState);\n let path = useResolvedPath(to, {\n relative: opts.relative\n });\n if (!vtContext.isTransitioning) {\n return false;\n }\n let currentPath = stripBasename(vtContext.currentLocation.pathname, basename) || vtContext.currentLocation.pathname;\n let nextPath = stripBasename(vtContext.nextLocation.pathname, basename) || vtContext.nextLocation.pathname;\n // Transition is active if we're going to or coming from the indicated\n // destination. This ensures that other PUSH navigations that reverse\n // an indicated transition apply. I.e., on the list view you have:\n //\n // <NavLink to=\"/details/1\" viewTransition>\n //\n // If you click the breadcrumb back to the list view:\n //\n // <NavLink to=\"/list\" viewTransition>\n //\n // We should apply the transition because it's indicated as active going\n // from /list -> /details/1 and therefore should be active on the reverse\n // (even though this isn't strictly a POP reverse)\n return matchPath(path.pathname, nextPath) != null || matchPath(path.pathname, currentPath) != null;\n}\n//#endregion\n\nexport { BrowserRouter, Form, HashRouter, Link, NavLink, RouterProvider, ScrollRestoration, FetchersContext as UNSAFE_FetchersContext, ViewTransitionContext as UNSAFE_ViewTransitionContext, useScrollRestoration as UNSAFE_useScrollRestoration, createBrowserRouter, createHashRouter, createSearchParams, HistoryRouter as unstable_HistoryRouter, usePrompt as unstable_usePrompt, useBeforeUnload, useFetcher, useFetchers, useFormAction, useLinkClickHandler, useSearchParams, useSubmit, useViewTransitionState };\n//# sourceMappingURL=index.js.map\n","import {\n ToastContainer as BaseToastContainer,\n toast as baseToast,\n type ConnectToastOptions,\n} from '@powerhousedao/design-system';\n\nexport const CONNECT_TOAST_CONTAINER_ID = 'connect';\n\nexport const ToastContainer = () => (\n <BaseToastContainer containerId={CONNECT_TOAST_CONTAINER_ID} />\n);\n\ntype ToastArgs = Parameters<typeof baseToast>;\nexport function toast(content: ToastArgs[0], options?: ConnectToastOptions) {\n const {\n type = 'default',\n containerId = CONNECT_TOAST_CONTAINER_ID,\n ...restOptions\n } = options || {};\n return baseToast(content, { type, containerId, ...restOptions });\n}\n","import { ReloadConnectToast } from '#components';\nimport { useReadModeContext } from '#context';\nimport { useDocumentDriveServer, useMakeUiDriveNode } from '#hooks';\nimport { useAsyncReactor } from '#store';\nimport {\n CONFLICT,\n ERROR,\n LOCAL,\n SUCCESS,\n type UiDriveNode,\n} from '@powerhousedao/design-system';\nimport { useUiNodesContext } from '@powerhousedao/reactor-browser';\nimport { logger, type DocumentDriveDocument } from 'document-drive';\nimport { type TFunction } from 'i18next';\nimport { useCallback, useEffect, useRef } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { toast } from '../services/toast.js';\nimport { useClientErrorHandler } from './useClientErrorHandler.js';\nimport { useConnectConfig } from './useConnectConfig.js';\nimport { useDocumentDrives } from './useDocumentDrives.js';\nimport { isLatestVersion } from './utils.js';\n\nexport const useLoadInitialData = () => {\n const { t } = useTranslation();\n const { documentDrives, onSyncStatus } = useDocumentDriveServer();\n const { driveNodes, setDriveNodes } = useUiNodesContext();\n const prevDrivesState = useRef([...driveNodes]);\n const drivesWithError = useRef<UiDriveNode[]>([]);\n const [, , serverSubscribeUpdates] = useDocumentDrives();\n const { readDrives } = useReadModeContext();\n const clientErrorHandler = useClientErrorHandler();\n const reactor = useAsyncReactor();\n const [connectConfig] = useConnectConfig();\n\n async function checkLatestVersion() {\n const result = await isLatestVersion();\n if (result === null) return;\n if (result.isLatest) {\n return true;\n }\n\n if (\n import.meta.env.MODE === 'development' ||\n connectConfig.studioMode ||\n !connectConfig.warnOutdatedApp\n ) {\n logger.warn(\n `Connect is outdated: \\nCurrent: ${result.currentVersion}\\nLatest: ${result.latestVersion}`,\n );\n } else {\n toast(<ReloadConnectToast />, {\n type: 'connect-warning',\n toastId: 'outdated-app',\n autoClose: false,\n });\n }\n }\n\n useEffect(() => {\n checkLatestVersion().catch(console.error);\n }, []);\n\n useEffect(() => {\n const unsubscribe = serverSubscribeUpdates(clientErrorHandler);\n return unsubscribe;\n }, [serverSubscribeUpdates, documentDrives, clientErrorHandler]);\n\n const checkDrivesErrors = useCallback(\n async (driveNodes: UiDriveNode[], t: TFunction) => {\n driveNodes.forEach(drive => {\n const prevDrive = prevDrivesState.current.find(\n prevDrive => prevDrive.id === drive.id,\n );\n\n if (!prevDrive) return;\n\n if (\n drive.sharingType !== LOCAL &&\n drive.syncStatus === SUCCESS &&\n drivesWithError.current.includes(drive)\n ) {\n // remove the drive from the error list\n drivesWithError.current = drivesWithError.current.filter(\n d => d.id !== drive.id,\n );\n\n return toast(t('notifications.driveSyncSuccess'), {\n type: 'connect-success',\n });\n }\n\n if (\n (drive.syncStatus === CONFLICT ||\n drive.syncStatus === ERROR) &&\n drive.syncStatus !== prevDrive.syncStatus\n ) {\n // add the drive to the error list\n drivesWithError.current.push(drive);\n }\n });\n\n prevDrivesState.current = [...driveNodes];\n\n if (drivesWithError.current.length > 0) {\n const isCurrent = await checkLatestVersion();\n if (isCurrent) {\n drivesWithError.current.forEach(drive => {\n toast(\n t(\n `notifications.${drive.syncStatus === CONFLICT ? 'driveSyncConflict' : 'driveSyncError'}`,\n { drive: drive.name },\n ),\n {\n type: 'connect-warning',\n toastId: `${drive.syncStatus === CONFLICT ? 'driveSyncConflict' : 'driveSyncError'}-${drive.id}`,\n },\n );\n });\n }\n }\n },\n [],\n );\n\n useEffect(() => {\n checkDrivesErrors(driveNodes, t).catch(console.error);\n }, [driveNodes, t, checkDrivesErrors]);\n\n const makeUiDriveNode = useMakeUiDriveNode();\n\n const makeUiDriveNodes = useCallback(\n async (documentDrives: DocumentDriveDocument[]) => {\n return Promise.all(documentDrives.map(makeUiDriveNode));\n },\n [makeUiDriveNode],\n );\n\n const updateUiDriveNodes = useCallback(\n async (documentDrives: DocumentDriveDocument[]) => {\n const uiDriveNodes = await makeUiDriveNodes(documentDrives);\n setDriveNodes(uiDriveNodes);\n },\n [makeUiDriveNodes, setDriveNodes],\n );\n useEffect(() => {\n const drives: DocumentDriveDocument[] = [\n ...readDrives,\n ...documentDrives,\n ];\n updateUiDriveNodes(drives).catch(console.error);\n }, [documentDrives, readDrives, updateUiDriveNodes]);\n\n useEffect(() => {\n if (!reactor) {\n return;\n }\n\n const unsub = onSyncStatus(() => updateUiDriveNodes(documentDrives));\n return unsub;\n }, [reactor, documentDrives, onSyncStatus, updateUiDriveNodes]);\n};\n","import {\n DRIVE,\n FILE,\n type UiDriveNode,\n type UiNode,\n} from '@powerhousedao/design-system';\nimport { useUiNodesContext } from '@powerhousedao/reactor-browser/hooks/useUiNodesContext';\nimport { useEffect } from 'react';\nimport { useLocation, useNavigate, useParams } from 'react-router-dom';\n\ntype RouteParams = {\n driveId?: string;\n '*'?: string;\n};\n\nfunction buildPathname(selectedNodePath: UiNode[]) {\n const driveNode = selectedNodePath[0];\n if (!driveNode) {\n return;\n }\n if (driveNode.kind !== DRIVE) {\n throw new Error(\n 'Node path is invalid, first node is not a drive node.',\n );\n }\n const driveNodeComponent = makeDriveNodeUrlComponent(driveNode);\n const nodePathComponents = selectedNodePath\n .slice(1)\n .map(node => encodeURIComponent(node.slug || node.name));\n const pathname = [driveNodeComponent, ...nodePathComponents].join('/');\n return pathname;\n}\n\nfunction makeDriveNodeUrlComponent(driveNode: UiDriveNode) {\n const component = driveNode.slug || driveNode.name || driveNode.id;\n\n return `/d/${encodeURIComponent(component)}`;\n}\n\nfunction getSelectedNodeFromPathname(\n driveNodes: (UiDriveNode | null)[],\n driveIdFromPathname: string | undefined,\n nodeNamesFromPathname: string | undefined,\n) {\n if (!driveIdFromPathname) {\n return null;\n }\n\n const driveId = decodeURIComponent(driveIdFromPathname);\n const driveNode = driveNodes.find(\n node =>\n node?.id === driveId ||\n node?.slug === driveId ||\n node?.name === driveId,\n );\n\n if (!driveNode) return null;\n if (!nodeNamesFromPathname) return driveNode;\n\n const nodeNames = nodeNamesFromPathname\n .split('/')\n .filter(Boolean)\n .map(decodeURIComponent);\n\n let selectedNode: UiNode = driveNode;\n\n for (const nodeName of nodeNames) {\n if (selectedNode.kind === FILE) break;\n\n const nextNode: UiNode | undefined = selectedNode.children.find(\n node => node.slug === nodeName || node.name === nodeName,\n );\n\n if (!nextNode) {\n console.error('Node not found:', nodeName);\n break;\n }\n\n selectedNode = nextNode;\n }\n\n return selectedNode;\n}\n\nexport const useNodeNavigation = () => {\n const navigate = useNavigate();\n const location = useLocation();\n const { search, pathname } = location;\n const params = useParams<RouteParams>();\n const { driveNodes, selectedNode, selectedNodePath, setSelectedNode } =\n useUiNodesContext();\n const driveIdFromPathname = params.driveId;\n const nodeNamesFromPathname = params['*'];\n const selectedNodeFromPathname = getSelectedNodeFromPathname(\n driveNodes,\n driveIdFromPathname,\n nodeNamesFromPathname,\n );\n const selectedNodePathname = buildPathname(selectedNodePath);\n\n // when selectedNodePathname changes, navigate to the new path\n useEffect(() => {\n if (!selectedNodePathname || selectedNodePathname === pathname) return;\n\n navigate({ pathname: selectedNodePathname, search });\n }, [search, navigate, selectedNodePathname]);\n\n // on first load, set the selected node from the pathname\n // defaults to setting the first drive node if no drive node is found\n useEffect(() => {\n if (selectedNode || !selectedNodeFromPathname) return;\n\n setSelectedNode(selectedNodeFromPathname);\n }, [selectedNode, selectedNodeFromPathname, setSelectedNode]);\n\n // respond to changes in the url (browser back and forward buttons)\n // update the selected node accordingly\n useEffect(() => {\n const selectedNodeFromPathname = getSelectedNodeFromPathname(\n driveNodes,\n driveIdFromPathname,\n nodeNamesFromPathname,\n );\n\n if (!selectedNodeFromPathname) return;\n\n setSelectedNode(selectedNodeFromPathname);\n }, [\n driveNodes,\n driveIdFromPathname,\n nodeNamesFromPathname,\n setSelectedNode,\n ]);\n};\n","import * as React from \"react\";\nconst SvgAtlasLogomark = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: 28, height: 32, viewBox: \"0 0 28 32\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { fillRule: \"evenodd\", clipRule: \"evenodd\", d: \"M0.05092 23.7286L0.000163347 23.9993L0 23.9995L0.207853 24.067L27.6823 24.067L27.9995 23.9995L27.9161 23.6913L14.2182 0.209032L13.9998 0L13.749 0.246353L0.05092 23.7286ZM20.9994 11.9999L7.0003 11.9999L13.9998 23.999L20.9994 11.9999Z\", fill: \"url(#paint0_radial_319_20865)\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M14 0L0 23.9998V7.99993L14 0Z\", fill: \"url(#paint1_linear_319_20865)\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M28 24L7.82013e-05 24L14 31.9999L28 24Z\", fill: \"url(#paint2_linear_319_20865)\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M14 0L28 23.9998V7.99993L14 0Z\", fill: \"url(#paint3_linear_319_20865)\" }), /* @__PURE__ */ React.createElement(\"defs\", null, /* @__PURE__ */ React.createElement(\"radialGradient\", { id: \"paint0_radial_319_20865\", cx: 0, cy: 0, r: 1, gradientUnits: \"userSpaceOnUse\", gradientTransform: \"translate(13.9994 16.0344) rotate(-89.9988) scale(16.0344 16.201)\" }, /* @__PURE__ */ React.createElement(\"stop\", { offset: 0.181008, stopColor: \"#FFCD6B\" }), /* @__PURE__ */ React.createElement(\"stop\", { offset: 1, stopColor: \"#EB5EDF\" })), /* @__PURE__ */ React.createElement(\"linearGradient\", { id: \"paint1_linear_319_20865\", x1: -0.031454, y1: 24.041, x2: 13.801, y2: -0.142908, gradientUnits: \"userSpaceOnUse\" }, /* @__PURE__ */ React.createElement(\"stop\", { stopColor: \"#4331E9\" }), /* @__PURE__ */ React.createElement(\"stop\", { offset: 1, stopColor: \"#A273FF\" })), /* @__PURE__ */ React.createElement(\"linearGradient\", { id: \"paint2_linear_319_20865\", x1: -0.0310093, y1: 24, x2: 28.0444, y2: 24, gradientUnits: \"userSpaceOnUse\" }, /* @__PURE__ */ React.createElement(\"stop\", { stopColor: \"#A273FF\" }), /* @__PURE__ */ React.createElement(\"stop\", { offset: 1, stopColor: \"#4331E9\" })), /* @__PURE__ */ React.createElement(\"linearGradient\", { id: \"paint3_linear_319_20865\", x1: 28.0315, y1: 24.041, x2: 14.199, y2: -0.142908, gradientUnits: \"userSpaceOnUse\" }, /* @__PURE__ */ React.createElement(\"stop\", { stopColor: \"#A273FF\" }), /* @__PURE__ */ React.createElement(\"stop\", { offset: 1, stopColor: \"#4331E9\" }))));\nexport default SvgAtlasLogomark;\n","import * as React from \"react\";\nconst SvgRefresh = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: 16, height: 16, viewBox: \"0 0 16 16\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M15.6867 8.03333C15.4933 7.83999 15.1733 7.83999 14.98 8.03333L14.6733 8.34001V8C14.6733 4.32 11.68 1.32666 7.99999 1.32666C5.96666 1.32666 4.06666 2.23999 2.79333 3.82666C2.61999 4.03999 2.65332 4.35999 2.87332 4.52665C3.08666 4.69999 3.40666 4.66666 3.57332 4.44666C4.65999 3.09332 6.27332 2.31999 7.99999 2.31999C11.1267 2.31999 13.6733 4.86666 13.6733 7.99333V8.32666L13.3667 8.02002C13.1733 7.82669 12.8533 7.82669 12.66 8.02002C12.4667 8.21335 12.4667 8.53335 12.66 8.72668L13.82 9.88668C13.8667 9.93334 13.92 9.96666 13.98 9.99333C14.04 10.02 14.1067 10.0333 14.1733 10.0333C14.24 10.0333 14.3 10.02 14.3667 9.99333C14.4267 9.96666 14.48 9.93334 14.5267 9.88668L15.6867 8.72668C15.88 8.54668 15.88 8.22666 15.6867 8.03333Z\", fill: \"#6C7275\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M13.1267 11.4666C12.9133 11.2933 12.5933 11.3266 12.4267 11.5466C11.34 12.9 9.72665 13.6733 7.99998 13.6733C4.87332 13.6733 2.32665 11.1266 2.32665 7.99996V7.66663L2.63332 7.97331C2.73332 8.07331 2.85999 8.11996 2.98665 8.11996C3.11332 8.11996 3.23999 8.07331 3.33999 7.97331C3.53332 7.77998 3.53332 7.45998 3.33999 7.26664L2.17998 6.10661C2.13332 6.05994 2.07998 6.02663 2.01998 5.99996C1.89998 5.94663 1.75998 5.94663 1.63998 5.99996C1.57998 6.02663 1.52665 6.05994 1.47999 6.10661L0.319988 7.26664C0.126654 7.45998 0.126654 7.77998 0.319988 7.97331C0.513321 8.16664 0.833319 8.16664 1.02665 7.97331L1.33332 7.66663V7.99996C1.33332 11.68 4.32665 14.6733 8.00665 14.6733C10.04 14.6733 11.94 13.76 13.2133 12.1733C13.38 11.96 13.3467 11.64 13.1267 11.4666Z\", fill: \"#6C7275\" }));\nexport default SvgRefresh;\n","import AtlasIcon from '#assets/icons/Atlas-Logomark.svg?react';\nimport RefreshIcon from '#assets/icons/refresh.svg?react';\nimport { useDocumentDriveServer } from '#hooks';\nimport { useUnwrappedReactor } from '#store';\nimport { Button } from '@powerhousedao/design-system';\nimport { gql, request } from 'graphql-request';\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { useLocation, useNavigate, useParams } from 'react-router-dom';\nimport { toast } from '../../services/toast';\n\nconst REACTOR_URL = 'https://apps.powerhouse.io/sky-atlas/staging/switchboard';\nconst MIN_LOADING_TIME = 2000;\n\nfunction useReactorUrl() {\n const { search } = useLocation();\n return useMemo(() => {\n const params = new URLSearchParams(search);\n const url = params.get('reactorUrl') ?? REACTOR_URL;\n return url.endsWith('/') ? url : `${url}/`;\n }, [search]);\n}\n\nasync function forkAtlas(\n docId: string,\n reactorUrl: string,\n): Promise<{ ForkAtlas: string }> {\n const document = gql`\n mutation ForkAtlas($docId: PHID) {\n ForkAtlas(docId: $docId)\n }\n `;\n return await request(`${reactorUrl}graphql`, document, { docId });\n}\n\nexport function AtlasImport() {\n const status = useRef<\n 'initial' | 'forking' | 'forked' | 'addingDrive' | 'done' | 'error'\n >('initial');\n const reactor = useUnwrappedReactor();\n const { documentId } = useParams();\n const reactorUrl = useReactorUrl();\n const navigate = useNavigate();\n const { addRemoteDrive } = useDocumentDriveServer();\n const [driveId, setDriveId] = useState<string | undefined>(undefined);\n const [error, setError] = useState<unknown>(undefined);\n const [loading, setLoading] = useState(true);\n const hasError = status.current === 'error';\n\n useEffect(() => {\n if (error) {\n console.error('Error forking Atlas:', error);\n toast('Error forking Atlas', { type: 'error' });\n }\n }, [error]);\n\n async function forkAtlasDocument(documentId: string) {\n const result = await forkAtlas(documentId, reactorUrl);\n const driveId = result.ForkAtlas;\n status.current = 'forked';\n setDriveId(driveId);\n }\n\n const redirectToDrive = useCallback(() => {\n if (driveId && !loading) {\n navigate(`/d/${driveId}`, { replace: true });\n }\n }, [driveId, navigate, loading]);\n\n const addForkDrive = useCallback(\n async (driveId: string) => {\n console.log('Adding remote drive:', driveId);\n const driveUrl = `${reactorUrl}d/${driveId}`;\n try {\n const addedDrive = await addRemoteDrive(driveUrl, {\n sharingType: 'PUBLIC',\n availableOffline: true,\n listeners: [\n {\n block: true,\n callInfo: {\n data: driveUrl,\n name: 'switchboard-push',\n transmitterType: 'SwitchboardPush',\n },\n filter: {\n branch: ['main'],\n documentId: ['*'],\n documentType: ['*'],\n scope: ['global'],\n },\n label: 'Switchboard Sync',\n listenerId: '1',\n system: true,\n },\n ],\n triggers: [],\n });\n status.current = 'done';\n console.log('Added remote drive:', addedDrive);\n setTimeout(() => {\n setLoading(false);\n }, MIN_LOADING_TIME);\n } catch (error) {\n status.current = 'error';\n setLoading(false);\n setError(error);\n }\n },\n [addRemoteDrive, navigate, reactorUrl],\n );\n\n useEffect(() => {\n if (!documentId || status.current !== 'initial') return;\n status.current = 'forking';\n forkAtlasDocument(documentId).catch(error => {\n status.current = 'error';\n setError(error);\n });\n }, [documentId, status]);\n\n useEffect(() => {\n if (!driveId || !reactor || status.current !== 'forked') return;\n status.current = 'addingDrive';\n new Promise<void>(resolve => {\n setTimeout(resolve, 500);\n })\n .then(() => addForkDrive(driveId))\n .catch(error => {\n status.current = 'error';\n setError(error);\n });\n }, [driveId, reactor, status]);\n\n return (\n <div className=\"bg-gray-50 size-full flex justify-center gap-x-4\">\n <div className=\"bg-white rounded-2xl w-full max-w-[850px] drop-shadow-sm p-6\">\n <h1 className=\"text-lg text-gray-900 font-medium\">\n Welcome to the Atlas Explorer\n </h1>\n <div className=\"mt-4 bg-gray-50 border border-gray-200 rounded-xl p-6\">\n <div className=\"bg-slate-50 rounded-2xl min-h-80 flex flex-col justify-center items-center\">\n <div>\n <AtlasIcon />\n </div>\n {hasError ? (\n <div className=\"text-sm text-gray-800 mt-3\">\n Error forking Atlas scope. Please try again.\n </div>\n ) : (\n <div className=\"text-sm text-gray-500 mt-3\">\n Forking Atlas scope...\n </div>\n )}\n <Button\n onClick={\n hasError\n ? window.location.reload.bind(\n window.location,\n )\n : redirectToDrive\n }\n size=\"small\"\n color=\"light\"\n className=\"bg-white border border-gray-200 h-9 px-3 mt-4 text-gray-600\"\n >\n {hasError ? (\n 'Retry'\n ) : loading ? (\n <>\n <RefreshIcon className=\"animate-spin\" />\n Loading\n </>\n ) : (\n 'Continue'\n )}\n </Button>\n </div>\n </div>\n </div>\n </div>\n );\n}\n","'use client';\nimport { createContext, Component, createElement, useContext, useState, useMemo, forwardRef } from 'react';\n\nconst ErrorBoundaryContext = createContext(null);\n\nconst initialState = {\n didCatch: false,\n error: null\n};\nclass ErrorBoundary extends Component {\n constructor(props) {\n super(props);\n this.resetErrorBoundary = this.resetErrorBoundary.bind(this);\n this.state = initialState;\n }\n static getDerivedStateFromError(error) {\n return {\n didCatch: true,\n error\n };\n }\n resetErrorBoundary() {\n const {\n error\n } = this.state;\n if (error !== null) {\n var _this$props$onReset, _this$props;\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n (_this$props$onReset = (_this$props = this.props).onReset) === null || _this$props$onReset === void 0 ? void 0 : _this$props$onReset.call(_this$props, {\n args,\n reason: \"imperative-api\"\n });\n this.setState(initialState);\n }\n }\n componentDidCatch(error, info) {\n var _this$props$onError, _this$props2;\n (_this$props$onError = (_this$props2 = this.props).onError) === null || _this$props$onError === void 0 ? void 0 : _this$props$onError.call(_this$props2, error, info);\n }\n componentDidUpdate(prevProps, prevState) {\n const {\n didCatch\n } = this.state;\n const {\n resetKeys\n } = this.props;\n\n // There's an edge case where if the thing that triggered the error happens to *also* be in the resetKeys array,\n // we'd end up resetting the error boundary immediately.\n // This would likely trigger a second error to be thrown.\n // So we make sure that we don't check the resetKeys on the first call of cDU after the error is set.\n\n if (didCatch && prevState.error !== null && hasArrayChanged(prevProps.resetKeys, resetKeys)) {\n var _this$props$onReset2, _this$props3;\n (_this$props$onReset2 = (_this$props3 = this.props).onReset) === null || _this$props$onReset2 === void 0 ? void 0 : _this$props$onReset2.call(_this$props3, {\n next: resetKeys,\n prev: prevProps.resetKeys,\n reason: \"keys\"\n });\n this.setState(initialState);\n }\n }\n render() {\n const {\n children,\n fallbackRender,\n FallbackComponent,\n fallback\n } = this.props;\n const {\n didCatch,\n error\n } = this.state;\n let childToRender = children;\n if (didCatch) {\n const props = {\n error,\n resetErrorBoundary: this.resetErrorBoundary\n };\n if (typeof fallbackRender === \"function\") {\n childToRender = fallbackRender(props);\n } else if (FallbackComponent) {\n childToRender = createElement(FallbackComponent, props);\n } else if (fallback !== undefined) {\n childToRender = fallback;\n } else {\n throw error;\n }\n }\n return createElement(ErrorBoundaryContext.Provider, {\n value: {\n didCatch,\n error,\n resetErrorBoundary: this.resetErrorBoundary\n }\n }, childToRender);\n }\n}\nfunction hasArrayChanged() {\n let a = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n let b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n return a.length !== b.length || a.some((item, index) => !Object.is(item, b[index]));\n}\n\nfunction assertErrorBoundaryContext(value) {\n if (value == null || typeof value.didCatch !== \"boolean\" || typeof value.resetErrorBoundary !== \"function\") {\n throw new Error(\"ErrorBoundaryContext not found\");\n }\n}\n\nfunction useErrorBoundary() {\n const context = useContext(ErrorBoundaryContext);\n assertErrorBoundaryContext(context);\n const [state, setState] = useState({\n error: null,\n hasError: false\n });\n const memoized = useMemo(() => ({\n resetBoundary: () => {\n context.resetErrorBoundary();\n setState({\n error: null,\n hasError: false\n });\n },\n showBoundary: error => setState({\n error,\n hasError: true\n })\n }), [context.resetErrorBoundary]);\n if (state.hasError) {\n throw state.error;\n }\n return memoized;\n}\n\nfunction withErrorBoundary(component, errorBoundaryProps) {\n const Wrapped = forwardRef((props, ref) => createElement(ErrorBoundary, errorBoundaryProps, createElement(component, {\n ...props,\n ref\n })));\n\n // Format for display in DevTools\n const name = component.displayName || component.name || \"Unknown\";\n Wrapped.displayName = \"withErrorBoundary(\".concat(name, \")\");\n return Wrapped;\n}\n\nexport { ErrorBoundary, ErrorBoundaryContext, useErrorBoundary, withErrorBoundary };\n","import * as React from \"react\";\nconst SvgConnect = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: 107, height: 20, viewBox: \"0 0 107 20\", fill: \"currentColor\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M0.666504 10.1087C0.666504 8.30419 1.056 6.69918 1.83499 5.29371C2.61398 3.8709 3.6959 2.76908 5.08077 1.98827C6.48295 1.1901 8.0669 0.791016 9.83261 0.791016C11.9965 0.791016 13.8487 1.36361 15.3894 2.50881C16.9301 3.654 17.9601 5.21563 18.4794 7.1937H13.5977C13.2342 6.43023 12.7149 5.84896 12.0397 5.44988C11.3819 5.05079 10.6289 4.85125 9.78067 4.85125C8.41311 4.85125 7.30522 5.32842 6.45699 6.28275C5.60876 7.23708 5.18464 8.51241 5.18464 10.1087C5.18464 11.7051 5.60876 12.9804 6.45699 13.9347C7.30522 14.8891 8.41311 15.3662 9.78067 15.3662C10.6289 15.3662 11.3819 15.1667 12.0397 14.7676C12.7149 14.3685 13.2342 13.7872 13.5977 13.0238H18.4794C17.9601 15.0018 16.9301 16.5635 15.3894 17.7087C13.8487 18.8365 11.9965 19.4004 9.83261 19.4004C8.0669 19.4004 6.48295 19.01 5.08077 18.2292C3.6959 17.431 2.61398 16.3292 1.83499 14.9238C1.056 13.5183 0.666504 11.9133 0.666504 10.1087Z\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M26.7553 19.4785C25.3358 19.4785 24.0548 19.1749 22.9123 18.5676C21.7871 17.9603 20.8956 17.0927 20.2378 15.9648C19.5973 14.837 19.277 13.5183 19.277 12.0087C19.277 10.5165 19.6059 9.20646 20.2638 8.07862C20.9216 6.93343 21.8217 6.05718 22.9642 5.44988C24.1068 4.84258 25.3878 4.53893 26.8073 4.53893C28.2267 4.53893 29.5078 4.84258 30.6503 5.44988C31.7928 6.05718 32.693 6.93343 33.3508 8.07862C34.0086 9.20646 34.3375 10.5165 34.3375 12.0087C34.3375 13.5009 33.9999 14.8197 33.3248 15.9648C32.667 17.0927 31.7582 17.9603 30.5983 18.5676C29.4558 19.1749 28.1748 19.4785 26.7553 19.4785ZM26.7553 15.6265C27.6036 15.6265 28.322 15.3142 28.9105 14.6895C29.5164 14.0649 29.8193 13.1713 29.8193 12.0087C29.8193 10.8462 29.5251 9.95257 28.9365 9.32792C28.3652 8.70327 27.6555 8.39095 26.8073 8.39095C25.9417 8.39095 25.2233 8.70327 24.6521 9.32792C24.0808 9.93522 23.7952 10.8288 23.7952 12.0087C23.7952 13.1713 24.0721 14.0649 24.6261 14.6895C25.1973 15.3142 25.9071 15.6265 26.7553 15.6265Z\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M44.483 4.59098C46.1795 4.59098 47.5297 5.14623 48.5337 6.25672C49.5551 7.34986 50.0658 8.85944 50.0658 10.7854V19.2703H45.6515V11.3841C45.6515 10.4124 45.4005 9.6576 44.8985 9.11971C44.3964 8.58181 43.7213 8.31286 42.8731 8.31286C42.0249 8.31286 41.3497 8.58181 40.8477 9.11971C40.3457 9.6576 40.0947 10.4124 40.0947 11.3841V19.2703H35.6545V4.74714H40.0947V6.67315C40.5448 6.03115 41.1507 5.52796 41.9123 5.16358C42.674 4.78185 43.5309 4.59098 44.483 4.59098Z\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M60.9412 4.59098C62.6376 4.59098 63.9879 5.14623 64.9919 6.25672C66.0133 7.34986 66.5239 8.85944 66.5239 10.7854V19.2703H62.1096V11.3841C62.1096 10.4124 61.8586 9.6576 61.3566 9.11971C60.8546 8.58181 60.1795 8.31286 59.3313 8.31286C58.483 8.31286 57.8079 8.58181 57.3059 9.11971C56.8039 9.6576 56.5529 10.4124 56.5529 11.3841V19.2703H52.1126V4.74714H56.5529V6.67315C57.0029 6.03115 57.6088 5.52796 58.3705 5.16358C59.1322 4.78185 59.9891 4.59098 60.9412 4.59098Z\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M82.2291 11.7745C82.2291 12.1909 82.2031 12.6247 82.1512 13.0758H72.1022C72.1715 13.9781 72.4571 14.6722 72.9591 15.158C73.4784 15.6265 74.1103 15.8607 74.8546 15.8607C75.9625 15.8607 76.7329 15.3923 77.1656 14.4553H81.8915C81.6491 15.4096 81.2077 16.2685 80.5672 17.032C79.944 17.7954 79.1564 18.3941 78.2043 18.8278C77.2522 19.2616 76.1876 19.4785 75.0104 19.4785C73.5909 19.4785 72.3272 19.1749 71.2194 18.5676C70.1115 17.9603 69.2459 17.0927 68.6227 15.9648C67.9995 14.837 67.6879 13.5183 67.6879 12.0087C67.6879 10.4991 67.9909 9.18044 68.5968 8.05259C69.2199 6.92475 70.0855 6.05718 71.1934 5.44988C72.3013 4.84258 73.5736 4.53893 75.0104 4.53893C76.4126 4.53893 77.659 4.8339 78.7496 5.42385C79.8402 6.0138 80.6884 6.85534 81.2943 7.94848C81.9175 9.04163 82.2291 10.317 82.2291 11.7745ZM77.685 10.6033C77.685 9.83979 77.4253 9.23249 76.906 8.78135C76.3866 8.33022 75.7375 8.10465 74.9585 8.10465C74.2141 8.10465 73.5823 8.32154 73.063 8.75533C72.561 9.18911 72.2494 9.80509 72.1282 10.6033H77.685Z\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M82.65 12.0087C82.65 10.4991 82.9529 9.18044 83.5588 8.05259C84.182 6.92475 85.0389 6.05718 86.1295 5.44988C87.2374 4.84258 88.5011 4.53893 89.9206 4.53893C91.7382 4.53893 93.2529 5.01609 94.4647 5.97042C95.6937 6.92475 96.4987 8.26949 96.8795 10.0046H92.1537C91.7555 8.89414 90.9852 8.33889 89.8427 8.33889C89.0291 8.33889 88.3799 8.65989 87.8952 9.3019C87.4105 9.92655 87.1681 10.8288 87.1681 12.0087C87.1681 13.1886 87.4105 14.0996 87.8952 14.7416C88.3799 15.3662 89.0291 15.6786 89.8427 15.6786C90.9852 15.6786 91.7555 15.1233 92.1537 14.0128H96.8795C96.4987 15.7133 95.6937 17.0493 94.4647 18.021C93.2356 18.9927 91.7209 19.4785 89.9206 19.4785C88.5011 19.4785 87.2374 19.1749 86.1295 18.5676C85.0389 17.9603 84.182 17.0927 83.5588 15.9648C82.9529 14.837 82.65 13.5183 82.65 12.0087Z\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M106.291 15.4964V19.2703H104.032C102.423 19.2703 101.167 18.8799 100.267 18.0991C99.3672 17.3009 98.9171 16.0082 98.9171 14.221V8.443H97.1514V4.74714H98.9171V1.20745H103.357V4.74714H106.266V8.443H103.357V14.2731C103.357 14.7069 103.461 15.0192 103.669 15.2101C103.877 15.4009 104.223 15.4964 104.708 15.4964H106.291Z\" }));\nexport default SvgConnect;\n","import * as React from \"react\";\nconst SvgLogo = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: 26, height: 26, viewBox: \"0 0 26 26\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M20.105 7.37978C19.9097 7.18452 19.9097 6.86795 20.105 6.67269L22.5725 4.20504C24.9229 6.75889 26.0649 10.0248 25.9972 13.2723L20.105 7.37978ZM16.1222 10.6556C15.927 10.8509 15.927 11.1674 16.1222 11.3627L24.2614 19.5023C25.125 18.0079 25.667 16.378 25.8875 14.7149L19.3289 8.15595C19.1336 7.96068 18.817 7.96068 18.6218 8.15595L16.1222 10.6556ZM0.00284613 12.729C-0.0649083 15.9752 1.07706 19.2411 3.42753 21.7962L5.89504 19.3285C6.09029 19.1333 6.09029 18.8167 5.89504 18.6214L0.00284613 12.729ZM4.20485 22.5723C6.75858 24.9229 10.0256 26.0649 13.2716 25.9972L7.37946 20.1047C7.1842 19.9094 6.8676 19.9094 6.67234 20.1047L4.20485 22.5723ZM13.0519 18.5174C13.2472 18.3222 13.2472 18.0056 13.0519 17.8103L1.73982 6.49772C0.87626 7.99209 0.334223 9.62072 0.113713 11.2851L9.84523 21.0171C10.0405 21.2124 10.3571 21.2124 10.5524 21.0171L13.0519 18.5174ZM9.60276 7.08454C9.78969 6.88798 9.7858 6.57823 9.594 6.38642L5.55009 2.34233C4.93783 2.77105 4.35391 3.25889 3.80695 3.80588C3.25998 4.35287 2.77216 4.93684 2.34346 5.54912L6.3864 9.59111C6.57859 9.78325 6.88907 9.7867 7.08548 9.59887L8.47817 8.26702L9.60276 7.08454ZM11.2072 21.6733C11.012 21.8685 11.012 22.1851 11.2072 22.3804L14.7142 25.8875C16.3785 25.667 18.0071 25.1249 19.5013 24.2613L14.4139 19.1736C14.2186 18.9783 13.902 18.9783 13.7067 19.1736L11.2072 21.6733ZM23.6565 20.4496L11.0843 7.87683C10.8891 7.68156 10.5725 7.68156 10.3772 7.87683L7.87766 10.3765C7.68241 10.5718 7.68241 10.8883 7.87766 11.0836L20.4499 23.6564C21.0622 23.2277 21.6461 22.7398 22.193 22.1929C22.74 21.6459 23.2278 21.0619 23.6565 20.4496ZM17.8445 7.37855C18.0397 7.18329 18.0397 6.86672 17.8445 6.67146L11.2858 0.112477C9.62151 0.332998 7.99294 0.875053 6.49865 1.73866L14.6378 9.87821C14.8331 10.0735 15.1497 10.0735 15.3449 9.87821L17.8445 7.37855ZM21.7951 3.42769C19.2414 1.07712 15.9744 -0.0649114 12.7284 0.00284625L18.6205 5.89529C18.8158 6.09056 19.1324 6.09056 19.3277 5.89529L21.7951 3.42769Z\", fill: \"url(#paint0_linear_526_12008)\" }), /* @__PURE__ */ React.createElement(\"defs\", null, /* @__PURE__ */ React.createElement(\"linearGradient\", { id: \"paint0_linear_526_12008\", x1: 13, y1: 0, x2: 13, y2: 26, gradientUnits: \"userSpaceOnUse\" }, /* @__PURE__ */ React.createElement(\"stop\", { stopColor: \"currentColor\" }), /* @__PURE__ */ React.createElement(\"stop\", { offset: 1, stopColor: \"currentColor\" }))));\nexport default SvgLogo;\n","import { useConnectConfig, useLogin, useShowAddDriveModal } from '#hooks';\nimport {\n ConnectSidebar,\n Icon,\n SidebarAddDriveItem,\n SidebarItem,\n type UiDriveNode,\n} from '@powerhousedao/design-system';\nimport { useUiNodesContext } from '@powerhousedao/reactor-browser';\nimport { logger } from 'document-drive';\nimport { useCallback } from 'react';\nimport { ErrorBoundary } from 'react-error-boundary';\nimport { useNavigate } from 'react-router-dom';\nimport { useModal } from './modal/index.js';\n\nexport default function Sidebar() {\n const { showModal } = useModal();\n const navigate = useNavigate();\n\n const { user, openRenown, logout } = useLogin();\n const { driveNodes, setSelectedNode, selectedNode } = useUiNodesContext();\n const [config] = useConnectConfig();\n const showAddDriveModal = useShowAddDriveModal();\n const connectDebug = localStorage.getItem('CONNECT_DEBUG') === 'true';\n\n const onClickSettings = () => {\n showModal('settingsModal', { onRefresh: () => navigate(0) });\n };\n\n const onRootClick = useCallback(() => {\n setSelectedNode(null);\n navigate('/');\n }, [navigate, setSelectedNode]);\n\n const onAddDriveClick = useCallback(() => {\n showAddDriveModal();\n }, [showAddDriveModal]);\n\n const headerContent = (\n <div className=\"flex h-full items-center\">\n <Icon\n name=\"Connect\"\n className=\"!h-[30px] !w-[100px] cursor-pointer\"\n onClick={onRootClick}\n />\n {connectDebug && (\n <button\n id=\"connect-debug-button\"\n className=\"ml-6\"\n onClick={() => showModal('debugSettingsModal', {})}\n >\n <img src=\"settings.png\" className=\"h-5 text-gray-600\" />\n </button>\n )}\n </div>\n );\n\n const handleDriveClick = useCallback(\n (driveNode: UiDriveNode) => {\n setSelectedNode(driveNode);\n },\n [setSelectedNode],\n );\n\n const etherscanUrl = user?.address\n ? `https://etherscan.io/address/${user.address}`\n : '';\n\n return (\n <ConnectSidebar\n id=\"sidebar\"\n onClick={() => onRootClick()}\n onClickSettings={onClickSettings}\n headerContent={headerContent}\n address={user?.address}\n onLogin={openRenown}\n onDisconnect={logout}\n etherscanUrl={etherscanUrl}\n >\n <ErrorBoundary\n fallback={\n <div className=\"text-center\">\n There was an error loading drives\n </div>\n }\n onError={logger.error}\n >\n {driveNodes.map((node, index) => (\n <SidebarItem\n key={index}\n title={node.name}\n onClick={() => handleDriveClick(node)}\n active={selectedNode?.id === node.id}\n icon={\n node.icon ? (\n <img\n src={node.icon}\n alt={node.name}\n width={32}\n height={32}\n />\n ) : undefined\n }\n />\n ))}\n {config.drives.addDriveEnabled && (\n <SidebarAddDriveItem onClick={onAddDriveClick} />\n )}\n </ErrorBoundary>\n </ConnectSidebar>\n );\n}\n","import IconConnect from '#assets/icons/connect.svg?react';\nimport IconLogo from '#assets/icons/logo.svg?react';\nimport { ModalManager } from '#components';\nimport {\n isElectron,\n isMac,\n useLoadInitialData,\n useLogin,\n useNodeNavigation,\n} from '#hooks';\nimport { logger } from 'document-drive';\nimport { Suspense, useEffect } from 'react';\nimport { Outlet, useNavigate, useSearchParams } from 'react-router-dom';\nimport Sidebar from './sidebar.js';\n\nexport default function Root() {\n useLoadInitialData();\n useNodeNavigation();\n\n const navigate = useNavigate();\n const { login } = useLogin();\n\n useEffect(() => {\n window.electronAPI?.ready();\n }, []);\n\n const [searchParams, setSearchParams] = useSearchParams();\n\n useEffect(() => {\n const userStr = searchParams.get('user');\n if (userStr && login) {\n const userDid = decodeURIComponent(userStr);\n searchParams.delete('user');\n setSearchParams(searchParams);\n login(userDid).catch(logger.error);\n }\n }, [login, searchParams, setSearchParams]);\n\n useEffect(() => {\n const unsubscribe = window.electronAPI?.handleURL((_e, url) => {\n navigate(`/${url}`);\n });\n\n return unsubscribe;\n }, [navigate]);\n\n return (\n <ModalManager>\n <div className=\"h-screen\">\n {isElectron && (\n <div\n className={`h-8 w-full\n ${isMac && 'justify-center'}\n flex items-center bg-gray-50`}\n >\n <IconLogo className=\"ml-1 mr-0.5 p-1.5\" />\n <IconConnect className=\"h-3 w-fit\" />\n </div>\n )}\n <div\n className={`flex items-stretch overflow-auto\n ${isElectron ? 'h-app-height' : 'h-screen'}\n `}\n role=\"presentation\"\n tabIndex={0}\n >\n <Suspense>\n <Sidebar />\n <div className=\"relative flex-1 overflow-auto\">\n <Outlet />\n </div>\n </Suspense>\n </div>\n </div>\n </ModalManager>\n );\n}\n","import { useTranslation } from 'react-i18next';\n\nexport const ReloadConnectToast = () => {\n const { t } = useTranslation();\n\n return (\n <div>\n <p className=\"font-medium\">{t('notifications.reloadApp')}</p>\n <button\n onClick={() => location.reload()}\n className=\"underline decoration-solid underline-offset-2\"\n >\n {t('common.reloadConnect')} 🔄\n </button>\n </div>\n );\n};\n","import {\n useConnectConfig,\n useDocumentDriveServer,\n useShowAddDriveModal,\n} from '#hooks';\nimport { useGetAppNameForEditorId } from '#store';\nimport {\n HomeScreen,\n HomeScreenAddDriveItem,\n HomeScreenItem,\n Icon,\n type UiDriveNode,\n} from '@powerhousedao/design-system';\nimport { useUiNodesContext } from '@powerhousedao/reactor-browser';\nimport { useCallback } from 'react';\n\nfunction getDriveIcon(driveNode: UiDriveNode) {\n if (driveNode.icon) {\n return (\n <img\n src={driveNode.icon}\n alt={driveNode.name}\n height={32}\n width={32}\n />\n );\n }\n if (driveNode.sharingType === 'LOCAL') {\n return <Icon name=\"Hdd\" size={32} />;\n } else {\n return <Icon name=\"Server\" size={32} />;\n }\n}\n\nexport function Home() {\n const getAppDescriptionForEditorId = useGetAppNameForEditorId();\n const showAddDriveModal = useShowAddDriveModal();\n const { documentDrives } = useDocumentDriveServer();\n const { driveNodes, setSelectedNode } = useUiNodesContext();\n const [config] = useConnectConfig();\n const handleDriveClick = useCallback(\n (driveNode: UiDriveNode) => {\n setSelectedNode(driveNode);\n },\n [setSelectedNode],\n );\n\n const onAddDriveClick = useCallback(() => {\n showAddDriveModal();\n }, [showAddDriveModal]);\n\n return (\n <HomeScreen>\n {driveNodes.map(driveNode => {\n const drive = documentDrives.find(d => d.id === driveNode.id);\n const editorId = drive?.meta?.preferredEditor;\n const appName = editorId\n ? getAppDescriptionForEditorId(editorId)\n : undefined;\n return (\n <HomeScreenItem\n key={driveNode.id}\n title={driveNode.name}\n description={appName || 'Drive Explorer App'}\n icon={getDriveIcon(driveNode)}\n onClick={() => handleDriveClick(driveNode)}\n />\n );\n })}\n {config.drives.addDriveEnabled && (\n <HomeScreenAddDriveItem onClick={onAddDriveClick} />\n )}\n </HomeScreen>\n );\n}\n","import connectConfig from '#connect-config';\nimport React, { Suspense } from 'react';\nimport {\n type RouteObject,\n RouterProvider,\n createBrowserRouter,\n createMemoryRouter,\n} from 'react-router-dom';\nimport { Home } from '../pages/home.js';\nimport { AtlasImport } from './demo/atlas-import.js';\nimport Root from './root.js';\n\nconst Content = React.lazy(() => import('../pages/content.js'));\n\nasync function createRouter(routes: RouteObject[]) {\n const isPackaged = await window.electronAPI?.isPackaged();\n const createRouter = isPackaged ? createMemoryRouter : createBrowserRouter;\n return createRouter(routes, {\n basename: connectConfig.routerBasename,\n future: {\n v7_fetcherPersist: true,\n v7_relativeSplatPath: true,\n },\n });\n}\n\nfunction createRoutes() {\n const routes: RouteObject[] = [\n {\n path: '/',\n element: <Home />,\n },\n {\n path: 'd?/:driveId?/*?',\n element: (\n <Suspense>\n <Content />\n </Suspense>\n ),\n },\n {\n path: 'import/:documentId',\n element: <AtlasImport />,\n },\n ];\n\n return [\n {\n path: '/',\n element: (\n <Suspense>\n <Root />\n </Suspense>\n ),\n children: routes,\n },\n {\n element: (\n <Suspense>\n <Root />\n </Suspense>\n ),\n },\n ];\n}\n\nconst routes = createRoutes();\n\nconst RouterAsync = async () => {\n const router = await createRouter(routes);\n\n const Router = () => <RouterProvider router={router} />;\n return Router;\n};\n\nexport default RouterAsync;\n"],"file":"assets/router-C-P_hJmM.js"}