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AEJ,UAAC0K,OAAAA,CAAK9J,UCpPJ,U,SDqPCF,CAAC,CAAC,wCAAwC,E,GAE7C,UAACJ,EAAAA,SAASA,CAAAA,CAACF,SAAU,E,MAErB,K,OAIV,UAACuK,EAAAA,EAAoBA,CAAAA,CAAAA,G,MAK/B,EAEO,SAASC,IACd,IAAMpB,EAAQqB,CAAAA,EAAAA,EAAAA,EAAAA,IACd,MAAOC,CAAAA,EAAAA,EAAAA,EAAAA,EAAqBtB,GAC1B,WAACuB,KAAAA,C,UACEvB,EAAMwB,MAAM,CAAC,IAAExB,EAAMyB,UAAU,C,GAGlC,UAAC7L,EAAsBA,CAAAA,EAE3B,C","sources":["webpack://@affine/web/../core/src/components/share-page-not-found-error.tsx","webpack://@affine/web/../core/src/pages/share/share-footer.tsx","webpack://@affine/web/../core/src/pages/share/share-footer.css.ts","webpack://@affine/web/../core/src/components/cloud/share-header-right-item/authenticated-item.tsx","webpack://@affine/web/../core/src/components/cloud/share-header-right-item/styles.css.ts","webpack://@affine/web/../core/src/components/cloud/share-header-right-item/present.tsx","webpack://@affine/web/../core/src/components/cloud/share-header-right-item/user-avatar.tsx","webpack://@affine/web/../core/src/components/cloud/share-header-right-item/index.tsx","webpack://@affine/web/../core/src/pages/share/share-header.tsx","webpack://@affine/web/../core/src/pages/share/share-header.css.ts","webpack://@affine/web/../core/src/pages/share/share-detail-page.tsx","webpack://@affine/web/../core/src/pages/share/share-detail-page.css.ts"],"sourcesContent":["import { Empty } from '@affine/component';\nimport { Logo1Icon } from '@blocksuite/icons/rc';\n\nexport const SharePageNotFoundError = () => {\n return (\n \n \n \n \n \n \n );\n};\n","import { useI18n } from '@affine/i18n';\nimport { ArrowRightBigIcon } from '@blocksuite/icons/rc';\n\nimport * as styles from './share-footer.css';\n\nexport const ShareFooter = () => {\n const t = useI18n();\n return (\n
\n
\n
\n {t['com.arms.share-page.footer.description']()}\n
\n \n {t['com.arms.share-page.footer.get-started']()}\n \n \n
\n
\n );\n};\n","import \"../core/src/pages/share/share-footer.css.ts.vanilla.css!=!../../../../../../node_modules/@vanilla-extract/webpack-plugin/virtualFileLoader/dist/vanilla-extract-webpack-plugin-virtualFileLoader.cjs.js?{\\\"fileName\\\":\\\"../core/src/pages/share/share-footer.css.ts.vanilla.css\\\",\\\"source\\\":\\\"Ll8xeTAxM2VrMCB7CiAgZGlzcGxheTogZmxleDsKICBmbGV4LWRpcmVjdGlvbjogY29sdW1uOwogIGFsaWduLWl0ZW1zOiBjZW50ZXI7CiAganVzdGlmeS1jb250ZW50OiBjZW50ZXI7CiAgei1pbmRleDogMTsKICB3aWR0aDogMTAwJTsKICBtYXgtd2lkdGg6IHZhcigtLWFmZmluZS1lZGl0b3Itd2lkdGgpOwogIG1hcmdpbi1sZWZ0OiBhdXRvOwogIG1hcmdpbi1yaWdodDogYXV0bzsKICBwYWRkaW5nLWxlZnQ6IHZhcigtLWFmZmluZS1lZGl0b3Itc2lkZS1wYWRkaW5nKTsKICBwYWRkaW5nLXJpZ2h0OiB2YXIoLS1hZmZpbmUtZWRpdG9yLXNpZGUtcGFkZGluZyk7CiAgbWFyZ2luLWJvdHRvbTogMjAwcHg7Cn0KLl8xeTAxM2VrMSB7CiAgZGlzcGxheTogZmxleDsKICBmbGV4LWRpcmVjdGlvbjogY29sdW1uOwogIGFsaWduLWl0ZW1zOiBjZW50ZXI7CiAganVzdGlmeS1jb250ZW50OiBjZW50ZXI7CiAgZ2FwOiA4cHg7CiAgd2lkdGg6IDEwMCU7CiAgcGFkZGluZzogMTJweDsKICBiYWNrZ3JvdW5kOiB2YXIoLS1hZmZpbmUtYmFja2dyb3VuZC1vdmVybGF5LXBhbmVsLWNvbG9yKTsKfQouXzF5MDEzZWsyIHsKICBmb250LXNpemU6IHZhcigtLWFmZmluZS1mb250LXNtKTsKICBjb2xvcjogdmFyKC0tYWZmaW5lLXRleHQtc2Vjb25kYXJ5LWNvbG9yKTsKICB0ZXh0LWFsaWduOiBjZW50ZXI7Cn0KLl8xeTAxM2VrMyB7CiAgZGlzcGxheTogZmxleDsKICBwYWRkaW5nOiAwcHggNHB4OwogIGp1c3RpZnktY29udGVudDogY2VudGVyOwogIGFsaWduLWl0ZW1zOiBjZW50ZXI7CiAgZ2FwOiA0cHg7CiAgY29sb3I6IHZhcigtLWFmZmluZS1ibGFjayk7Cn0KLl8xeTAxM2VrMzp2aXNpdGVkIHsKICBjb2xvcjogdmFyKC0tYWZmaW5lLWJsYWNrKTsKfQpAbWVkaWEgc2NyZWVuIGFuZCAobWF4LXdpZHRoOiA4MDBweCkgewogIC5fMXkwMTNlazAgewogICAgcGFkZGluZy1sZWZ0OiAyNHB4OwogICAgcGFkZGluZy1yaWdodDogMjRweDsKICB9Cn0=\\\"}!../../../../../../node_modules/@vanilla-extract/webpack-plugin/extracted.js\"\nexport var description = '_1y013ek2';\nexport var footer = '_1y013ek1';\nexport var footerContainer = '_1y013ek0';\nexport var getStartLink = '_1y013ek3';","import { Button } from '@affine/component/ui/button';\nimport { useNavigateHelper } from '@affine/core/hooks/use-navigate-helper';\nimport { useI18n } from '@affine/i18n';\nimport {\n useLiveData,\n useService,\n WorkspacesService,\n} from '@toeverything/infra';\nimport { useCallback, useEffect } from 'react';\n\nimport type { ShareHeaderRightItemProps } from './index';\nimport * as styles from './styles.css';\n\nexport const AuthenticatedItem = ({\n setIsMember,\n ...props\n}: { setIsMember: (value: boolean) => void } & ShareHeaderRightItemProps) => {\n const { workspaceId, pageId } = props;\n\n const workspacesService = useService(WorkspacesService);\n const workspaces = useLiveData(workspacesService.list.workspaces$);\n const isMember = workspaces?.some(workspace => workspace.id === workspaceId);\n const t = useI18n();\n const { jumpToPage } = useNavigateHelper();\n\n const handleEdit = useCallback(() => {\n jumpToPage(workspaceId, pageId);\n }, [workspaceId, pageId, jumpToPage]);\n\n useEffect(() => {\n if (isMember) {\n setIsMember(true);\n }\n }, [isMember, setIsMember]);\n\n if (isMember) {\n return (\n \n {t['Edit']()}\n \n );\n }\n\n return null;\n};\n","import \"../core/src/components/cloud/share-header-right-item/styles.css.ts.vanilla.css!=!../../../../../../../node_modules/@vanilla-extract/webpack-plugin/virtualFileLoader/dist/vanilla-extract-webpack-plugin-virtualFileLoader.cjs.js?{\\\"fileName\\\":\\\"../core/src/components/cloud/share-header-right-item/styles.css.ts.vanilla.css\\\",\\\"source\\\":\\\"#H4sIAAAAAAAAA61V246bMBB9z1dYkSotD14RctmUVaX+R7WqjD2AN8a2bJOwrfLvFQYSIJCm1T4yc5g5M3Nm/PxznUTvpAjR7wVCjFstyEeMUgHV6wKh99I6nn5gqqQD6WJEQTowtYsInknMHRS2b06VdNjyXxCjaKN9EFoaq0yMtOIdiipRW47EPGFM0pRLwA4qh7XhBTF1QqFM8Lo4L547hvGRW+6Aeab/EWA1XeJMHRnRMVrtmgo0YYzLLEYh2teWa9DIBz1x5vIYrRp0DjzLXYyisPlOCD1kRpWSjQgnyjAwF6o9clJJGKT5wYgjmFtcQJGA+bZ0poTl27CkRCh6mP4NWAYCrH3wx7X3zxMXhB6CuUGecu7Ae/sFjkC6NG0cvApbcIVtTpg6jbOVzimJuZRgWkQwJGuP2awqOjZX/MZjLzPd6Go81e20VHraHqTw9soGU8P3vlNr3IbhXNN8P3qdu7R+snuJIZ0nGAm0Xbq29YYwXtq4s/7rPl9bsptp2k2m1lraelgggLpOzhMdpUqUhcTNsoUzHK0mFHAC7gQgH6D60t/JaD9aymnW2/DL+Hq1dD7jJgqopW24PMQo7FPde6ren5la+KsaX3CJW/oD9NcHj3STzxHj7pDqblbYVO5HsBn1KhquBWnY3tsCWwQ3qt81qldHMKmoi8w5Y80k/cm+OkAIri23nl+9C9jPvhbQyRB9j1vyd27ths4+HRaokqz/eHwW6fGAh0fivPheAOMEWWoAJCKSoaeCVJ0GdptQV4Gvb/49SImwsHy7f/BvXhiEzr2o63nQ+Q9vFkgsKQgAAA==\\\"}!../../../../../../../node_modules/@vanilla-extract/webpack-plugin/extracted.js\"\nexport var accountCard = '_3b2jam6';\nexport var avatar = '_3b2jam7';\nexport var content = '_3b2jam8';\nexport var editButton = '_3b2jam4';\nexport var headerDivider = '_3b2jam2';\nexport var iconWrapper = '_3b2jam0';\nexport var nameContainer = '_3b2jam9';\nexport var presentButton = '_3b2jam3';\nexport var rightItemContainer = '_3b2jam1';\nexport var userEmail = '_3b2jamb';\nexport var userName = '_3b2jama';\nexport var userPlanButton = '_3b2jam5';","import { Button } from '@affine/component/ui/button';\nimport { useI18n } from '@affine/i18n';\nimport { PresentationIcon } from '@blocksuite/icons/rc';\n\nimport { usePresent } from '../../blocksuite/block-suite-header/present/use-present';\nimport * as styles from './styles.css';\n\nexport const PresentButton = () => {\n const t = useI18n();\n const { isPresent, handlePresent } = usePresent();\n\n return (\n }\n className={styles.presentButton}\n onClick={() => handlePresent()}\n disabled={isPresent}\n >\n {t['com.arms.share-page.header.present']()}\n \n );\n};\n","import { Avatar } from '@affine/component/ui/avatar';\nimport {\n Menu,\n MenuIcon,\n MenuItem,\n MenuSeparator,\n} from '@affine/component/ui/menu';\nimport { useAsyncCallback } from '@affine/core/hooks/affine-async-hooks';\nimport { useI18n } from '@affine/i18n';\nimport { SignOutIcon } from '@blocksuite/icons/rc';\nimport { useLiveData, useService } from '@toeverything/infra';\nimport { useEffect, useMemo } from 'react';\n\nimport { AuthService, SubscriptionService } from '../../../modules/cloud';\nimport * as styles from './styles.css';\n\nconst UserInfo = () => {\n const authService = useService(AuthService);\n const user = useLiveData(authService.session.account$);\n const subscription = useService(SubscriptionService).subscription;\n useEffect(() => {\n subscription.revalidate();\n }, [subscription]);\n const plan = useLiveData(subscription.pro$)?.plan;\n\n if (!user) {\n // TODO(@eyhn): loading UI\n return null;\n }\n return (\n
\n \n\n
\n
\n
\n {user.label}\n
\n {plan &&
{plan}
}\n
\n
\n {user.email}\n
\n
\n
\n );\n};\n\nexport const PublishPageUserAvatar = () => {\n const authService = useService(AuthService);\n const user = useLiveData(authService.session.account$);\n const t = useI18n();\n\n const handleSignOut = useAsyncCallback(async () => {\n await authService.signOut();\n }, [authService]);\n\n const menuItem = useMemo(() => {\n return (\n <>\n \n \n \n \n \n }\n data-testid=\"share-page-sign-out-option\"\n onClick={handleSignOut}\n >\n {t['com.arms.workspace.cloud.account.logout']()}\n \n \n );\n }, [handleSignOut, t]);\n\n if (!user) {\n return null;\n }\n\n return (\n \n
\n \n
\n \n );\n};\n","import { AuthService } from '@affine/core/modules/cloud';\nimport { type DocMode, useLiveData, useService } from '@toeverything/infra';\nimport { useState } from 'react';\n\nimport { AuthenticatedItem } from './authenticated-item';\nimport { PresentButton } from './present';\nimport * as styles from './styles.css';\nimport { PublishPageUserAvatar } from './user-avatar';\n\nexport type ShareHeaderRightItemProps = {\n workspaceId: string;\n pageId: string;\n publishMode: DocMode;\n};\n\nconst ShareHeaderRightItem = ({ ...props }: ShareHeaderRightItemProps) => {\n const loginStatus = useLiveData(useService(AuthService).session.status$);\n const { publishMode } = props;\n const [isMember, setIsMember] = useState(false);\n\n // TODO(@JimmFly): Add TOC\n return (\n
\n {loginStatus === 'authenticated' ? (\n \n ) : null}\n {publishMode === 'edgeless' ? : null}\n {loginStatus === 'authenticated' ? (\n <>\n \n \n \n ) : null}\n
\n );\n};\n\nexport default ShareHeaderRightItem;\n","// import { EditorModeSwitch } from '@affine/core/components/blocksuite/block-suite-mode-switch';\nimport ShareHeaderRightItem from '@affine/core/components/cloud/share-header-right-item';\nimport type { DocCollection } from '@blocksuite/store';\nimport type { DocMode } from '@toeverything/infra';\n\nimport { BlocksuiteHeaderTitle } from '../../components/blocksuite/block-suite-header/title/index';\nimport * as styles from './share-header.css';\n\nexport function ShareHeader({\n pageId,\n publishMode,\n docCollection,\n}: {\n pageId: string;\n publishMode: DocMode;\n docCollection: DocCollection;\n}) {\n return (\n
\n {/* edgeless/page 변환 버튼 */}\n \n
\n \n
\n );\n}\n","import \"../core/src/pages/share/share-header.css.ts.vanilla.css!=!../../../../../../node_modules/@vanilla-extract/webpack-plugin/virtualFileLoader/dist/vanilla-extract-webpack-plugin-virtualFileLoader.cjs.js?{\\\"fileName\\\":\\\"../core/src/pages/share/share-header.css.ts.vanilla.css\\\",\\\"source\\\":\\\"Ll8xbG9zZmRjMCB7CiAgZGlzcGxheTogZmxleDsKICBoZWlnaHQ6IDUycHg7CiAgd2lkdGg6IDEwMCU7CiAgYWxpZ24taXRlbXM6IGNlbnRlcjsKICBmbGV4LXNocmluazogMDsKICBiYWNrZ3JvdW5kOiB2YXIoLS1hZmZpbmUtYmFja2dyb3VuZC1wcmltYXJ5LWNvbG9yKTsKICBib3JkZXItYm90dG9tOiAxcHggc29saWQgdmFyKC0tYWZmaW5lLWJvcmRlci1jb2xvcik7CiAgcGFkZGluZzogMCAxNnB4Owp9Ci5fMWxvc2ZkYzEgewogIGZsZXgtZ3JvdzogMTsKICBtaW4td2lkdGg6IDEycHg7Cn0=\\\"}!../../../../../../node_modules/@vanilla-extract/webpack-plugin/extracted.js\"\nexport var header = '_1losfdc0';\nexport var spacer = '_1losfdc1';","import { Scrollable } from '@affine/component';\nimport { useActiveBlocksuiteEditor } from '@affine/core/hooks/use-block-suite-editor';\nimport { usePageDocumentTitle } from '@affine/core/hooks/use-global-state';\nimport { AuthService } from '@affine/core/modules/cloud';\nimport { WorkspaceFlavour } from '@affine/env/workspace';\nimport { useI18n } from '@affine/i18n';\nimport { noop } from '@blocksuite/global/utils';\nimport { Logo1Icon } from '@blocksuite/icons/rc';\nimport type { AffineEditorContainer } from '@blocksuite/presets';\nimport type { Doc as BlockSuiteDoc } from '@blocksuite/store';\nimport type { Doc, DocMode, Workspace } from '@toeverything/infra';\nimport {\n DocsService,\n EmptyBlobStorage,\n FrameworkScope,\n ReadonlyDocStorage,\n useLiveData,\n useService,\n WorkspaceFlavourProvider,\n WorkspacesService,\n} from '@toeverything/infra';\nimport clsx from 'clsx';\nimport { useCallback, useEffect, useState } from 'react';\nimport type { LoaderFunction } from 'react-router-dom';\nimport {\n isRouteErrorResponse,\n redirect,\n useLoaderData,\n useRouteError,\n} from 'react-router-dom';\n\nimport { AppContainer } from '../../components/affine/app-container';\nimport { PageDetailEditor } from '../../components/page-detail-editor';\nimport { SharePageNotFoundError } from '../../components/share-page-not-found-error';\nimport { MainContainer } from '../../components/workspace';\nimport { PeekViewManagerModal } from '../../modules/peek-view';\nimport { CloudBlobStorage } from '../../modules/workspace-engine/impls/engine/blob-cloud';\nimport * as styles from './share-detail-page.css';\nimport { ShareFooter } from './share-footer';\nimport { ShareHeader } from './share-header';\n\ntype DocPublishMode = 'edgeless' | 'page';\n\nexport type CloudDoc = {\n arrayBuffer: ArrayBuffer;\n publishMode: DocPublishMode;\n};\n\nexport async function downloadBinaryFromCloud(\n rootGuid: string,\n pageGuid: string\n): Promise {\n const response = await fetch(`/api/workspaces/${rootGuid}/docs/${pageGuid}`);\n if (response.ok) {\n const publishMode = (response.headers.get('publish-mode') ||\n 'page') as DocPublishMode;\n const arrayBuffer = await response.arrayBuffer();\n\n // return both arrayBuffer and publish mode\n return { arrayBuffer, publishMode };\n }\n\n return null;\n}\n\ntype LoaderData = {\n pageId: string;\n workspaceId: string;\n publishMode: DocMode;\n pageArrayBuffer: ArrayBuffer;\n workspaceArrayBuffer: ArrayBuffer;\n};\n\nfunction assertDownloadResponse(\n value: CloudDoc | null\n): asserts value is CloudDoc {\n if (\n !value ||\n !((value as CloudDoc).arrayBuffer instanceof ArrayBuffer) ||\n typeof (value as CloudDoc).publishMode !== 'string'\n ) {\n throw new Error('value is not a valid download response');\n }\n}\n\nexport const loader: LoaderFunction = async ({ params }) => {\n const workspaceId = params?.workspaceId;\n const pageId = params?.pageId;\n if (!workspaceId || !pageId) {\n return redirect('/404');\n }\n\n const [workspaceResponse, pageResponse] = await Promise.all([\n downloadBinaryFromCloud(workspaceId, workspaceId),\n downloadBinaryFromCloud(workspaceId, pageId),\n ]);\n assertDownloadResponse(workspaceResponse);\n const { arrayBuffer: workspaceArrayBuffer } = workspaceResponse;\n assertDownloadResponse(pageResponse);\n const { arrayBuffer: pageArrayBuffer, publishMode } = pageResponse;\n\n return {\n workspaceId,\n pageId,\n publishMode,\n workspaceArrayBuffer,\n pageArrayBuffer,\n } satisfies LoaderData;\n};\n\nexport const Component = () => {\n const {\n workspaceId,\n pageId: docId,\n publishMode,\n workspaceArrayBuffer,\n pageArrayBuffer,\n } = useLoaderData() as LoaderData;\n const workspacesService = useService(WorkspacesService);\n\n const t = useI18n();\n const [workspace, setWorkspace] = useState(null);\n const [page, setPage] = useState(null);\n const [_, setActiveBlocksuiteEditor] = useActiveBlocksuiteEditor();\n\n const defaultCloudProvider = workspacesService.framework.get(\n WorkspaceFlavourProvider('CLOUD')\n );\n\n useEffect(() => {\n // create a workspace for share page\n const { workspace } = workspacesService.open(\n {\n metadata: {\n id: workspaceId,\n flavour: WorkspaceFlavour.AFFINE_CLOUD,\n },\n isSharedMode: true,\n },\n {\n ...defaultCloudProvider,\n getEngineProvider(workspaceId) {\n return {\n getDocStorage() {\n return new ReadonlyDocStorage({\n [workspaceId]: new Uint8Array(workspaceArrayBuffer),\n [docId]: new Uint8Array(pageArrayBuffer),\n });\n },\n getAwarenessConnections() {\n return [];\n },\n getDocServer() {\n return null;\n },\n getLocalBlobStorage() {\n return EmptyBlobStorage;\n },\n getRemoteBlobStorages() {\n return [new CloudBlobStorage(workspaceId)];\n },\n };\n },\n }\n );\n\n setWorkspace(workspace);\n\n workspace.engine\n .waitForRootDocReady()\n .then(() => {\n const { doc } = workspace.scope.get(DocsService).open(docId);\n\n workspace.docCollection.awarenessStore.setReadonly(\n doc.blockSuiteDoc.blockCollection,\n true\n );\n\n setPage(doc);\n })\n .catch(err => {\n console.error(err);\n });\n }, [\n defaultCloudProvider,\n pageArrayBuffer,\n docId,\n workspaceArrayBuffer,\n workspaceId,\n workspacesService,\n ]);\n\n const pageTitle = useLiveData(page?.title$);\n\n usePageDocumentTitle(pageTitle);\n const authService = useService(AuthService);\n const loginStatus = useLiveData(authService.session.status$);\n\n const onEditorLoad = useCallback(\n (_: BlockSuiteDoc, editor: AffineEditorContainer) => {\n setActiveBlocksuiteEditor(editor);\n return noop;\n },\n [setActiveBlocksuiteEditor]\n );\n\n if (!workspace || !page) {\n return;\n }\n\n return (\n \n \n \n \n
\n
\n \n \n \n \n {publishMode === 'page' ? : null}\n \n \n \n {loginStatus !== 'authenticated' ? (\n \n \n {t['com.arms.share-page.footer.built-with']()}\n \n \n \n ) : null}\n
\n
\n
\n \n
\n
\n
\n );\n};\n\nexport function ErrorBoundary() {\n const error = useRouteError();\n return isRouteErrorResponse(error) ? (\n

\n {error.status} {error.statusText}\n

\n ) : (\n \n );\n}\n","import \"../core/src/pages/share/share-detail-page.css.ts.vanilla.css!=!../../../../../../node_modules/@vanilla-extract/webpack-plugin/virtualFileLoader/dist/vanilla-extract-webpack-plugin-virtualFileLoader.cjs.js?{\\\"fileName\\\":\\\"../core/src/pages/share/share-detail-page.css.ts.vanilla.css\\\",\\\"source\\\":\\\"LmtkY2h0cjAgewogIGRpc3BsYXk6IGZsZXg7CiAgaGVpZ2h0OiAxMDAlOwogIG92ZXJmbG93OiBoaWRkZW47CiAgd2lkdGg6IDEwMCU7Cn0KLmtkY2h0cjEgewogIGRpc3BsYXk6IGZsZXg7CiAgZmxleDogMTsKICBoZWlnaHQ6IDEwMCU7CiAgcG9zaXRpb246IHJlbGF0aXZlOwogIGZsZXgtZGlyZWN0aW9uOiBjb2x1bW47CiAgbWluLXdpZHRoOiAwOwogIG92ZXJmbG93OiBoaWRkZW47CiAgYmFja2dyb3VuZDogdmFyKC0tYWZmaW5lLWJhY2tncm91bmQtcHJpbWFyeS1jb2xvcik7Cn0KLmtkY2h0cjIgewogIHBvc2l0aW9uOiByZWxhdGl2ZTsKICBkaXNwbGF5OiBmbGV4OwogIGZsZXgtZGlyZWN0aW9uOiBjb2x1bW47CiAgZmxleC1zaHJpbms6IDA7CiAgei1pbmRleDogMDsKfQoua2RjaHRyMyB7CiAgcG9zaXRpb246IGFic29sdXRlOwogIHJpZ2h0OiA1MCU7CiAgdHJhbnNmb3JtOiB0cmFuc2xhdGVYKDUwJSk7CiAgYm90dG9tOiAyMHB4OwogIHotaW5kZXg6IHZhcigtLWFmZmluZS16LWluZGV4LXBvcG92ZXIpOwogIGN1cnNvcjogcG9pbnRlcjsKICBkaXNwbGF5OiBmbGV4OwogIGFsaWduLWl0ZW1zOiBjZW50ZXI7CiAgYmFja2dyb3VuZDogdmFyKC0tYWZmaW5lLWJsYWNrKTsKICBib3JkZXItcmFkaXVzOiA4cHg7CiAgYm9yZGVyOiAxcHggc29saWQgdmFyKC0tYWZmaW5lLXB1cmUtYmxhY2stMTApOwogIGJveC1zaGFkb3c6IHZhcigtLWFmZmluZS1idXR0b24taW5uZXItc2hhZG93KTsKICBjb2xvcjogdmFyKC0tYWZmaW5lLXdoaXRlKTsKICBwYWRkaW5nOiA4cHggMThweDsKICBnYXA6IDRweDsKfQoua2RjaHRyNCB7CiAgcGFkZGluZzogMHB4IDRweDsKICBmb250LXNpemU6IHZhcigtLWFmZmluZS1mb250LWJhc2UpOwogIGZvbnQtd2VpZ2h0OiA3MDA7CiAgd2hpdGUtc3BhY2U6IG5vd3JhcDsKfQpAbWVkaWEgcHJpbnQgewogIC5rZGNodHIzIHsKICAgIGRpc3BsYXk6IG5vbmU7CiAgfQp9\\\"}!../../../../../../node_modules/@vanilla-extract/webpack-plugin/extracted.js\"\nexport var editorContainer = 'kdchtr2';\nexport var link = 'kdchtr3';\nexport var linkText = 'kdchtr4';\nexport var mainContainer = 'kdchtr1';\nexport var root = 'kdchtr0';"],"names":["SharePageNotFoundError","div","style","width","height","display","flexDirection","justifyContent","alignItems","a","href","target","rel","position","top","left","fontSize","cursor","Logo1Icon","Empty","description","ShareFooter","t","useI18n","className","ArrowRightBigIcon","AuthenticatedItem","setIsMember","props","workspaceId","pageId","workspacesService","useService","WorkspacesService","workspaces","useLiveData","list","workspaces$","isMember","some","workspace","id","jumpToPage","useNavigateHelper","handleEdit","useCallback","useEffect","Button","onClick","data-testid","PresentButton","isPresent","handlePresent","usePresent","prefix","PresentationIcon","disabled","UserInfo","authService","AuthService","user","session","account$","subscription","SubscriptionService","revalidate","plan","pro$","Avatar","size","name","label","url","avatar","title","email","PublishPageUserAvatar","handleSignOut","useAsyncCallback","signOut","menuItem","useMemo","MenuSeparator","MenuItem","preFix","MenuIcon","SignOutIcon","Menu","items","contentOptions","transform","loginStatus","status$","publishMode","useState","data-is-member","data-is-edgeless","ShareHeader","docCollection","BlocksuiteHeaderTitle","isPublic","ShareHeaderRightItem","downloadBinaryFromCloud","rootGuid","pageGuid","response","fetch","ok","headers","get","arrayBuffer","assertDownloadResponse","value","ArrayBuffer","loader","params","redirect","workspaceResponse","pageResponse","Promise","all","workspaceArrayBuffer","pageArrayBuffer","Component","docId","useLoaderData","setWorkspace","page","setPage","_","setActiveBlocksuiteEditor","useActiveBlocksuiteEditor","defaultCloudProvider","framework","WorkspaceFlavourProvider","open","metadata","flavour","WorkspaceFlavour","AFFINE_CLOUD","isSharedMode","getEngineProvider","getDocStorage","ReadonlyDocStorage","Uint8Array","getAwarenessConnections","getDocServer","getLocalBlobStorage","EmptyBlobStorage","getRemoteBlobStorages","CloudBlobStorage","engine","waitForRootDocReady","then","doc","scope","DocsService","awarenessStore","setReadonly","blockSuiteDoc","blockCollection","catch","err","console","error","pageTitle","title$","usePageDocumentTitle","onEditorLoad","editor","noop","FrameworkScope","AppContainer","MainContainer","collection","Scrollable","Root","Viewport","clsx","PageDetailEditor","onLoad","Scrollbar","span","PeekViewManagerModal","ErrorBoundary","useRouteError","isRouteErrorResponse","h1","status","statusText"],"sourceRoot":""}