@powerhousedao/connect 3.3.0-dev.7 → 3.3.0-staging.0
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.
- package/dist/assets/{AddDriveModal.Bv4kh_hr.js → AddDriveModal.z9bFHIXa.js} +2 -2
- package/dist/assets/{AddDriveModal.Bv4kh_hr.js.map → AddDriveModal.z9bFHIXa.js.map} +1 -1
- package/dist/assets/{CreateDocumentModal.BeNsKpp9.js → CreateDocumentModal.4P8BKarY.js} +2 -2
- package/dist/assets/{CreateDocumentModal.BeNsKpp9.js.map → CreateDocumentModal.4P8BKarY.js.map} +1 -1
- package/dist/assets/{DebugSettingsModal.Dcc5viNF.js → DebugSettingsModal.Zij5wROb.js} +2 -2
- package/dist/assets/{DebugSettingsModal.Dcc5viNF.js.map → DebugSettingsModal.Zij5wROb.js.map} +1 -1
- package/dist/assets/{SettingsModal.CtMTUsW1.js → SettingsModal.BEszTB9y.js} +2 -2
- package/dist/assets/{SettingsModal.CtMTUsW1.js.map → SettingsModal.BEszTB9y.js.map} +1 -1
- package/dist/assets/{app.D475fRDK.js → app.ArTwFyr1.js} +4 -4
- package/dist/assets/{app.D475fRDK.js.map → app.ArTwFyr1.js.map} +1 -1
- package/dist/assets/{atlas-import.DBbB_3kS.js → atlas-import.Wl58iY_f.js} +2 -2
- package/dist/assets/{atlas-import.DBbB_3kS.js.map → atlas-import.Wl58iY_f.js.map} +1 -1
- package/dist/assets/connect.config.aBnLZYTW.js +2 -0
- package/dist/assets/{connect.config.CuZ-60m9.js.map → connect.config.aBnLZYTW.js.map} +1 -1
- package/dist/assets/{content.BaebtyFY.js → content.CNYVLYa4.js} +2 -2
- package/dist/assets/{content.BaebtyFY.js.map → content.CNYVLYa4.js.map} +1 -1
- package/dist/assets/{cookie-banner.DSWB4hij.js → cookie-banner.BSJ-WPRY.js} +2 -2
- package/dist/assets/{cookie-banner.DSWB4hij.js.map → cookie-banner.BSJ-WPRY.js.map} +1 -1
- package/dist/assets/{home.rHfN37tC.js → home.oTGv1sKV.js} +2 -2
- package/dist/assets/{home.rHfN37tC.js.map → home.oTGv1sKV.js.map} +1 -1
- package/dist/assets/{index.DZlpbhmV.js → index.C6sQB7G2.js} +2 -2
- package/dist/assets/{index.DZlpbhmV.js.map → index.C6sQB7G2.js.map} +1 -1
- package/dist/assets/{index.xY1sxJx6.js → index.CAzWx5I7.js} +3 -3
- package/dist/assets/{index.xY1sxJx6.js.map → index.CAzWx5I7.js.map} +1 -1
- package/dist/assets/{index.qzHLb1Gh.js → index.CgA22PO7.js} +2 -2
- package/dist/assets/{index.qzHLb1Gh.js.map → index.CgA22PO7.js.map} +1 -1
- package/dist/assets/{index.SisqrPyj.js → index.DWZK1OL2.js} +2 -2
- package/dist/assets/{index.SisqrPyj.js.map → index.DWZK1OL2.js.map} +1 -1
- package/dist/assets/{index.B6PZ8Ar1.js → index.Dcxr7jSg.js} +2 -2
- package/dist/assets/{index.B6PZ8Ar1.js.map → index.Dcxr7jSg.js.map} +1 -1
- package/dist/assets/{index.1VvRArDT.js → index.DjwKW0y0.js} +2 -2
- package/dist/assets/{index.1VvRArDT.js.map → index.DjwKW0y0.js.map} +1 -1
- package/dist/assets/{main.CNdgwKoZ.js → main.B2FMUY0R.js} +3 -3
- package/dist/assets/{main.CNdgwKoZ.js.map → main.B2FMUY0R.js.map} +1 -1
- package/dist/assets/{modal.CtOMdsBk.js → modal.B70wlhFP.js} +3 -3
- package/dist/assets/{modal.CtOMdsBk.js.map → modal.B70wlhFP.js.map} +1 -1
- package/dist/assets/{modals.E6NpvR0b.js → modals.BH09LbAs.js} +2 -2
- package/dist/assets/{modals.E6NpvR0b.js.map → modals.BH09LbAs.js.map} +1 -1
- package/dist/assets/{registerServiceWorker.C0elqN6O.js → registerServiceWorker.DAAwLhB_.js} +2 -2
- package/dist/assets/{registerServiceWorker.C0elqN6O.js.map → registerServiceWorker.DAAwLhB_.js.map} +1 -1
- package/dist/assets/{root.BxA9v7yF.js → root.DnXil1MK.js} +2 -2
- package/dist/assets/{root.BxA9v7yF.js.map → root.DnXil1MK.js.map} +1 -1
- package/dist/assets/{useAcceptedCookies.rOdc2zB5.js → useAcceptedCookies.Br76D40I.js} +2 -2
- package/dist/assets/{useAcceptedCookies.rOdc2zB5.js.map → useAcceptedCookies.Br76D40I.js.map} +1 -1
- package/dist/assets/useConnectConfig.DbCQ5P20.js +2 -0
- package/dist/assets/{useConnectConfig.CYaRGzL8.js.map → useConnectConfig.DbCQ5P20.js.map} +1 -1
- package/dist/assets/{useDefaultDocumentModelEditor.BeMYbE49.js → useDefaultDocumentModelEditor.z03czPm3.js} +2 -2
- package/dist/assets/{useDefaultDocumentModelEditor.BeMYbE49.js.map → useDefaultDocumentModelEditor.z03czPm3.js.map} +1 -1
- package/dist/assets/{useDocumentDriveServer.Dg8t7hz_.js → useDocumentDriveServer.DxDkkVNr.js} +2 -2
- package/dist/assets/{useDocumentDriveServer.Dg8t7hz_.js.map → useDocumentDriveServer.DxDkkVNr.js.map} +1 -1
- package/dist/assets/{useFeatureFlags.ByQD9y0j.js → useFeatureFlags.DmV025o7.js} +2 -2
- package/dist/assets/{useFeatureFlags.ByQD9y0j.js.map → useFeatureFlags.DmV025o7.js.map} +1 -1
- package/dist/assets/{user.DCpcqF7h.js → user.DmfvK6iu.js} +4 -4
- package/dist/assets/{user.DCpcqF7h.js.map → user.DmfvK6iu.js.map} +1 -1
- package/dist/index.html +1 -1
- package/dist/vite-envs.sh +1 -1
- package/package.json +9 -9
- package/dist/assets/connect.config.CuZ-60m9.js +0 -2
- package/dist/assets/useConnectConfig.CYaRGzL8.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as y,jsx as o}from"react/jsx-runtime";import{u as b}from"./useAcceptedCookies.
|
|
2
|
-
//# sourceMappingURL=cookie-banner.
|
|
1
|
+
import{jsxs as y,jsx as o}from"react/jsx-runtime";import{u as b}from"./useAcceptedCookies.Br76D40I.js";import{c as v}from"./connect.config.aBnLZYTW.js";import{useSyncExternalStore as g}from"react";import{i as l}from"./i18next.CqOP20KE.js";import{s as k,a as w,u as S}from"./useTranslation.BpVv6XIW.js";import{useModal as C}from"./modal.B70wlhFP.js";import{t as D}from"./index.I_oLMCM2.js";import{T as B}from"./Trans.BS3_JvNk.js";import"./browser.BkwNmV2Z.js";import"react-dom";const x={type:"3rdParty",init(e){k(e.options.react),w(e)}},A={cancel:"Cancel",delete:"Delete",continue:"Continue",empty:"Empty",create:"Create",save:"Save",export:"Export",reload:"Reload",reloadConnect:"Click here to reload Connect"},T={placeholder:"Search Powerhouse",filterLabel:"File type"},N={sections:{folders:{title:"Folders",empty:"No folders 🗂️"},documents:{title:"Documents and files",empty:"No documents or files 📄"}}},E={options:{switchboardLink:"Switchboard Link"}},I={deleteItem:{folder:{header:"Delete “{{item}}” folder?",body:"Are you sure you want to delete this folder? All files and subfolders within it will be removed."},file:{header:"Delete “{{item}}” file?",body:"Are you sure you want to delete this file?"}},deleteDrive:{title:'Delete "{{label}}" drive?',body:"Are you sure you want to delete this drive? All files and subfolders within it will be removed. Do you want to proceed?",inputPlaceholder:"Enter drive name..."},upgradeDrive:{header:"Upgrade to cloud drive",body:"You are moving files from a private to a shared drive. These files will become accessible to others in the shared drive.Do you want to proceed?"},createDocument:{header:"Create a new document",placeholder:"Document name"},connectSettings:{title:"Settings",body:"These settings will apply to all drives.",clearStorage:{button:"Clear Storage",description:"Delete previous session data",confirmation:{title:"Clear Storage",body:"Are you sure you want to clear the storage? This will remove all previous session data.",clearButton:"Clear Storage"}},enabledDocumentTypes:{title:"Document Models",description:"Documents enabled",allSelected:"All documents are selected"}},exportDocumentWithErrors:{title:"Your document contains errors",body:"Your document contains structure errors. Do you want to export it anyway?"},disclaimer:{title:"Disclaimer",body:"All content provided herein our website, hyperlinked sites, associated applications, forums, blogs, social media accounts and other platforms (“Site”) is for your general information only, procured from third party sources. We make no warranties of any kind in relation to our content, including but not limited to accuracy and updatedness. No part of the content that we provide constitutes financial advice, legal advice or any other form of advice meant for your specific reliance for any purpose. Any use or reliance on our content is solely at your own risk and discretion. You should conduct your own research, review, analyse and verify our content before relying on them. Trading is a highly risky activity that can lead to major losses, please therefore consult your financial advisor before making any decision. No content on our Site is meant to be a solicitation or offer."},cookiesPolicy:{title:"Cookies Policy",body:"<subtitle>Use of Cookies and Similar Technologies</subtitle><p>The Site is using cookies. Cookies are small text files that are placed on your computer by websites that you visit. They are widely used in order to make websites work, or work more efficiently, as well as to provide information to the owners of the site. Cookies are typically stored on your computer´s hard drive.Information collected from cookies is used by us to evaluate the effectiveness of our Site and analyze trends. The information collected from cookies allows us to determine such things as which parts of the Site are most visited and difficulties our visitors may experience in accessing the SIte. With this knowledge, we can improve the quality of your experience on the Site by recognizing and delivering more of the most desired features and information, as well as by resolving access difficulties.</p><p>We use third party service providers, to assist us in better understanding the use of our Site. Our service providers will place cookies on the hard drive of your computer (or use similar technologies) and will receive information that we select that will educate us on such things as how visitors navigate around our Site. This information is aggregated to provide statistical data about our users browsing actions and patterns, and does not personally identify individuals. This information may include:</p><p>Computer or mobile device information, Website usage information, such as:<list></p><bullet>Page views,</bullet><bullet>Button clicks,</bullet><bullet>Input form changes (without the values being entered),</bullet><bullet>Errors.</bullet></list><p>Our service providers analyses this information and provides us with aggregate reports. The information and analysis provided by our service providers will be used to assist us in better understanding our visitors interests in our Site and how to better serve those interests. If you want to avoid using cookies altogether, you can disable cookies in your browser. However, disabling cookies might make it impossible for you to use certain features of the Site. Your use of the Site with a browser that is configured to accept cookies constitutes an acceptance of our and third-party cookies.</p>"}},P={deleteDriveSuccess:"Drive successfully deleted",deleteFolderSuccess:"Folder deleted",fileDeleteSuccess:"File deleted",addDriveSuccess:"New drive successfully added",driveSyncSuccess:"Drive synced successfully",driveSyncError:"Error synchronizing drive {{drive}}",driveSyncConflict:"Conflict error detected in {{drive}}",reloadApp:"It seems like you're running an outdated version of the app. Please reload Connect to get the latest version."},j={cookiePolicy:"Cookie Policy",termsOfUse:"Terms of Use",disclaimer:"Disclaimer",builtWith:"Built with <icon /> Powerhouse"},F={message:"This website uses cookies for analytic purposes only. Cookies are anonymous and do not link to user data. We collect information to improve the user experience and validate UI changes. You can still use the page without cookies. For more information, please read our <a>cookies policy.</a>",accept:"Accept configured cookies",reject:"Reject all cookies",cookies:{functional:"Functional cookies",analytics:"Analytics cookies"}},O={common:A,searchbar:T,folderView:N,files:E,modals:I,notifications:P,footer:j,cookieBanner:F},R={en:{code:"en",name:"English",translation:O}};l.use(x).init({resources:R,fallbackLng:"en",debug:!1,interpolation:{escapeValue:!1}}).catch(e=>{console.error(e)});const W=v.routerBasename,c=`${W}:display-cookie-banner`,n=new Set;let d=Y();function Y(){try{return localStorage.getItem(c)!=="false"}catch(e){return console.error(e),!0}}function a(){return d}function L(e){d=e,localStorage.setItem(c,JSON.stringify(e))}function U(e){return n.add(e),()=>n.delete(e)}const z=()=>[g(U,a,a),L],K=(e,i)=>e.some(t=>t.id===i&&t.value),ee=()=>{const{t:e}=S(void 0,{useSuspense:!0,i18n:l}),{showModal:i}=C(),[t,s]=z(),[,r]=b(),u=[{id:"analytics-cookie",label:e("cookieBanner.cookies.analytics"),value:!0}],m=p=>{s(!1),K(p,"analytics-cookie")&&r(h=>({...h,analytics:!0}))},f=()=>{s(!1),r(()=>({analytics:!1,functional:!1,marketing:!1}))};return t?y("div",{className:"absolute inset-0 z-[10000] backdrop-blur-sm",children:[o("div",{className:"absolute inset-0 bg-black opacity-15"}),o("div",{className:"absolute inset-x-0 bottom-0 flex justify-center bg-white px-10 pb-16 pt-10 shadow-lg",children:o(D,{className:"max-w-[1024px] ",cookies:u,onSubmit:m,onReject:f,submitLabel:e("cookieBanner.accept"),rejectLabel:e("cookieBanner.reject"),children:o("p",{className:"font-semibold text-gray-500",children:o(B,{i18nKey:"cookieBanner.message",components:{a:o("a",{onClick:()=>i("cookiesPolicy",{}),className:"cursor-pointer text-gray-900 hover:underline"},"cookieBanner.message-link")}},"cookieBanner.message")})})})]}):null};export{ee as CookieBanner};
|
|
2
|
+
//# sourceMappingURL=cookie-banner.BSJ-WPRY.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cookie-banner.
|
|
1
|
+
{"version":3,"file":"cookie-banner.BSJ-WPRY.js","sources":["../../../../node_modules/.pnpm/react-i18next@13.5.0_i18next@23.16.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-i18next/dist/es/initReactI18next.js","../../src/i18n/index.ts","../../src/hooks/useCookiebanner.ts","../../src/components/cookie-banner.tsx"],"sourcesContent":["import { setDefaults } from './defaults.js';\nimport { setI18n } from './i18nInstance.js';\nexport const initReactI18next = {\n type: '3rdParty',\n init(instance) {\n setDefaults(instance.options.react);\n setI18n(instance);\n }\n};","import i18n, { type Resource } from 'i18next';\nimport { initReactI18next } from 'react-i18next';\n\nimport translationEN from './locales/en.json' with { type: 'json' };\n\nconst resources: Resource = {\n en: {\n code: 'en',\n name: 'English',\n translation: translationEN,\n },\n};\n\ni18n.use(initReactI18next)\n .init({\n resources,\n fallbackLng: 'en',\n debug: false,\n interpolation: {\n escapeValue: false,\n },\n })\n .catch((e: unknown) => {\n console.error(e);\n });\n\nexport default i18n;\n","import connectConfig from '#connect-config';\nimport { useSyncExternalStore } from 'react';\n\nconst namespace = connectConfig.routerBasename;\n\nexport const COOKIE_BANNER_KEY_STORAGE = `${namespace}:display-cookie-banner`;\n\nconst listeners = new Set<() => void>();\n\nlet bannerShown = getInitial();\n\nfunction getInitial(): boolean {\n try {\n const value = localStorage.getItem(COOKIE_BANNER_KEY_STORAGE);\n return value !== 'false';\n } catch (error) {\n console.error(error);\n return true;\n }\n}\n\nfunction getCookieBannerState(): boolean {\n return bannerShown;\n}\n\nfunction setCookieBannerState(state: boolean) {\n bannerShown = state;\n localStorage.setItem(COOKIE_BANNER_KEY_STORAGE, JSON.stringify(state));\n}\n\nfunction subscribe(fn: () => void) {\n listeners.add(fn);\n return () => listeners.delete(fn);\n}\n\nexport const useCookieBanner = () => {\n const cookieBannerShown = useSyncExternalStore(\n subscribe,\n getCookieBannerState,\n getCookieBannerState,\n );\n return [cookieBannerShown, setCookieBannerState] as const;\n};\n","import {\n type CookieInput,\n CookieBanner as PHCookieBanner,\n} from '@powerhousedao/design-system';\nimport { Trans, useTranslation } from 'react-i18next';\nimport { useAcceptedCookies } from '../hooks/useAcceptedCookies.js';\nimport { useCookieBanner } from '../hooks/useCookiebanner.js';\nimport i18n from '../i18n';\nimport { useModal } from './modal/index.js';\n\nconst isCookieAccepted = (cookies: CookieInput[], id: string) => {\n return cookies.some(cookie => cookie.id === id && cookie.value);\n};\n\nexport const CookieBanner = () => {\n const { t } = useTranslation(undefined, {\n useSuspense: true,\n i18n,\n });\n const { showModal } = useModal();\n const [showBanner, setShowBanner] = useCookieBanner();\n const [, setAcceptedCookies] = useAcceptedCookies();\n\n const cookiesInput: CookieInput[] = [\n {\n id: 'analytics-cookie',\n label: t('cookieBanner.cookies.analytics'),\n value: true,\n },\n ];\n\n const handleAccept = (cookies: CookieInput[]) => {\n setShowBanner(false);\n\n if (isCookieAccepted(cookies, 'analytics-cookie')) {\n setAcceptedCookies(acceptedCookies => ({\n ...acceptedCookies,\n analytics: true,\n }));\n }\n };\n\n const handleReject = () => {\n setShowBanner(false);\n setAcceptedCookies(() => ({\n analytics: false,\n functional: false,\n marketing: false,\n }));\n };\n\n if (!showBanner) {\n return null;\n }\n\n return (\n <div className=\"absolute inset-0 z-[10000] backdrop-blur-sm\">\n <div className=\"absolute inset-0 bg-black opacity-15\" />\n <div className=\"absolute inset-x-0 bottom-0 flex justify-center bg-white px-10 pb-16 pt-10 shadow-lg\">\n <PHCookieBanner\n className=\"max-w-[1024px] \"\n cookies={cookiesInput}\n onSubmit={handleAccept}\n onReject={handleReject}\n submitLabel={t('cookieBanner.accept')}\n rejectLabel={t('cookieBanner.reject')}\n >\n <p className=\"font-semibold text-gray-500\">\n <Trans\n key={'cookieBanner.message'}\n i18nKey=\"cookieBanner.message\"\n components={{\n a: (\n <a\n onClick={() =>\n showModal('cookiesPolicy', {})\n }\n key={'cookieBanner.message-link'}\n className=\"cursor-pointer text-gray-900 hover:underline\"\n />\n ),\n }}\n />\n </p>\n </PHCookieBanner>\n </div>\n </div>\n );\n};\n"],"names":["initReactI18next","instance","setDefaults","setI18n","resources","translationEN","i18n","namespace","connectConfig","COOKIE_BANNER_KEY_STORAGE","listeners","bannerShown","getInitial","error","getCookieBannerState","setCookieBannerState","state","subscribe","fn","useCookieBanner","useSyncExternalStore","isCookieAccepted","cookies","id","cookie","CookieBanner","t","useTranslation","showModal","useModal","showBanner","setShowBanner","setAcceptedCookies","useAcceptedCookies","cookiesInput","handleAccept","acceptedCookies","handleReject","jsxs","jsx","PHCookieBanner","Trans"],"mappings":"6dAEO,MAAMA,EAAmB,CAC9B,KAAM,WACN,KAAKC,EAAU,CACbC,EAAYD,EAAS,QAAQ,KAAK,EAClCE,EAAQF,CAAQ,CACpB,CACA,47LCHMG,EAAsB,CACxB,GAAI,CACA,KAAM,KACN,KAAM,UACN,YAAaC,CAAA,CAErB,EAEAC,EAAK,IAAIN,CAAgB,EACpB,KAAK,CACF,UAAAI,EACA,YAAa,KACb,MAAO,GACP,cAAe,CACX,YAAa,EAAA,CAErB,CAAC,EACA,MAAO,GAAe,CACnB,QAAQ,MAAM,CAAC,CACnB,CAAC,ECrBL,MAAMG,EAAYC,EAAc,eAEnBC,EAA4B,GAAGF,CAAS,yBAE/CG,MAAgB,IAEtB,IAAIC,EAAcC,EAAA,EAElB,SAASA,GAAsB,CAC3B,GAAI,CAEA,OADc,aAAa,QAAQH,CAAyB,IAC3C,OAAA,OACZI,EAAO,CACZ,eAAQ,MAAMA,CAAK,EACZ,EAAA,CAEf,CAEA,SAASC,GAAgC,CACrC,OAAOH,CACX,CAEA,SAASI,EAAqBC,EAAgB,CAC1CL,EAAcK,EACd,aAAa,QAAQP,EAA2B,KAAK,UAAUO,CAAK,CAAC,CACzE,CAEA,SAASC,EAAUC,EAAgB,CAC/B,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AA,CAET,CAER,EAZK,sBAAA,CAaT,CACJ,CAAA,CAAA,CACJ,CACJ,CAAA,EACJ,EAlCO,IAoCf","x_google_ignoreList":[0]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as C,jsx as r}from"react/jsx-runtime";import{useCallback as c}from"react";import{a as A}from"./user.
|
|
2
|
-
//# sourceMappingURL=home.
|
|
1
|
+
import{jsxs as C,jsx as r}from"react/jsx-runtime";import{useCallback as c}from"react";import{a as A}from"./user.DmfvK6iu.js";import{w as g,H as v,x as I,y as S,z as p}from"./index.I_oLMCM2.js";import{u as x}from"./modals.BH09LbAs.js";import{u as H}from"./useDocumentDriveServer.DxDkkVNr.js";import{u as k}from"./useConnectConfig.DbCQ5P20.js";import"./connect.config.aBnLZYTW.js";import"./browser.BkwNmV2Z.js";import"./index.CAzWx5I7.js";import"react-dom/client";import"./app-skeleton.js";import"react-dom";import"./i18next.CqOP20KE.js";import"./slug.C6xW_7Wm.js";import"./modal.B70wlhFP.js";import"./useFeatureFlags.DmV025o7.js";function E(o){return o.icon?r("img",{src:o.icon,alt:o.name,height:32,width:32}):o.sharingType==="LOCAL"?r(p,{name:"Hdd",size:32}):r(p,{name:"Server",size:32})}function Q(){const o=A(),i=x(),{documentDrives:a}=H(),{driveNodes:d,setSelectedNode:n}=g(),[u]=k(),l=c(e=>{n(e)},[n]),f=c(()=>{i()},[i]);return C(v,{children:[d.map(e=>{var s;const t=a.find(h=>h.header.id===e.id),m=(s=t==null?void 0:t.header.meta)==null?void 0:s.preferredEditor,D=m?o(m):void 0;return r(I,{title:e.name,description:D||"Drive Explorer App",icon:E(e),onClick:()=>l(e)},e.id)}),u.drives.addDriveEnabled&&r(S,{onClick:f})]})}export{Q as Home};
|
|
2
|
+
//# sourceMappingURL=home.oTGv1sKV.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"home.
|
|
1
|
+
{"version":3,"file":"home.oTGv1sKV.js","sources":["../../src/pages/home.tsx"],"sourcesContent":["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(\n d => d.header.id === driveNode.id,\n );\n const editorId = drive?.header.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"],"names":["getDriveIcon","driveNode","jsx","Icon","Home","getAppDescriptionForEditorId","useGetAppNameForEditorId","showAddDriveModal","useShowAddDriveModal","documentDrives","useDocumentDriveServer","driveNodes","setSelectedNode","useUiNodesContext","config","useConnectConfig","handleDriveClick","useCallback","onAddDriveClick","HomeScreen","drive","d","editorId","_a","appName","HomeScreenItem","HomeScreenAddDriveItem"],"mappings":"qnBAgBA,SAASA,EAAaC,EAAwB,CAC1C,OAAIA,EAAU,KAENC,EAAC,MAAA,CACG,IAAKD,EAAU,KACf,IAAKA,EAAU,KACf,OAAQ,GACR,MAAO,EAAA,CAAA,EAIfA,EAAU,cAAgB,QACnBC,EAACC,EAAA,CAAK,KAAK,MAAM,KAAM,GAAI,EAE3BD,EAACC,EAAA,CAAK,KAAK,SAAS,KAAM,GAAI,CAE7C,CAEO,SAASC,GAAO,CACnB,MAAMC,EAA+BC,EAAA,EAC/BC,EAAoBC,EAAA,EACpB,CAAE,eAAAC,CAAA,EAAmBC,EAAA,EACrB,CAAE,WAAAC,EAAY,gBAAAC,CAAA,EAAoBC,EAAA,EAClC,CAACC,CAAM,EAAIC,EAAA,EACXC,EAAmBC,EACpBhB,GAA2B,CACxBW,EAAgBX,CAAS,CAAA,EAE7B,CAACW,CAAe,CAAA,EAGdM,EAAkBD,EAAY,IAAM,CACtCV,EAAA,CAAkB,EACnB,CAACA,CAAiB,CAAC,EAEtB,SACKY,EAAA,CACI,SAAA,CAAAR,EAAW,IAAIV,GAAa,OACzB,MAAMmB,EAAQX,EAAe,KACzBY,GAAKA,EAAE,OAAO,KAAOpB,EAAU,EAAA,EAE7BqB,GAAWC,EAAAH,GAAA,YAAAA,EAAO,OAAO,OAAd,YAAAG,EAAoB,gBAC/BC,EAAUF,EACVjB,EAA6BiB,CAAQ,EACrC,OACN,OACIpB,EAACuB,EAAA,CAEG,MAAOxB,EAAU,KACjB,YAAauB,GAAW,qBACxB,KAAMxB,EAAaC,CAAS,EAC5B,QAAS,IAAMe,EAAiBf,CAAS,CAAA,EAJpCA,EAAU,EAAA,CAKnB,CAEP,EACAa,EAAO,OAAO,iBACXZ,EAACwB,EAAA,CAAuB,QAASR,CAAA,CAAiB,CAAA,EAE1D,CAER"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var v=Object.defineProperty;var _=(r,e,t)=>e in r?v(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var S=(r,e,t)=>_(r,typeof e!="symbol"?e+"":e,t);import{k as O}from"./index.I_oLMCM2.js";import{A as n,D as I}from"./app.
|
|
2
|
-
//# sourceMappingURL=index.
|
|
1
|
+
var v=Object.defineProperty;var _=(r,e,t)=>e in r?v(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var S=(r,e,t)=>_(r,typeof e!="symbol"?e+"":e,t);import{k as O}from"./index.I_oLMCM2.js";import{A as n,D as I}from"./app.ArTwFyr1.js";import"react";import"react/jsx-runtime";import"react-dom";import"./connect.config.aBnLZYTW.js";import"./browser.BkwNmV2Z.js";import"./user.DmfvK6iu.js";import"./index.CAzWx5I7.js";import"react-dom/client";import"./app-skeleton.js";import"./useFeatureFlags.DmV025o7.js";import"./useAcceptedCookies.Br76D40I.js";import"./useConnectConfig.DbCQ5P20.js";import"./index.CAUjMUXb.js";import"./registerServiceWorker.DAAwLhB_.js";class w{constructor(e,t=O(["processor","document-analytics"])){S(this,"analyticsStore");S(this,"logger");this.analyticsStore=e,this.logger=t}async onStrands(e){if(e.length!==0)for(const t of e){if(t.operations.length===0)continue;const D=t.operations[0],u=n.fromString(`ph/doc/${t.driveId}/${t.documentId}/${t.branch}/${t.scope}`);D.index===0&&await this.clearSource(u);const{driveId:s,documentId:f,branch:E,scope:a}=t,p=s===f?"DRIVE":"NODE",l=50;for(let o=0;o<t.operations.length;o+=l){const i=t.operations.slice(o,o+l),c=[];for(const d of i){const g=d.index,h={source:u,metric:"DocumentOperations",start:I.fromISO(d.timestamp),value:1,dimensions:{drive:n.fromString(`ph/doc/drive/${s}/${E}/${a}/${g}`),operation:n.fromString(`ph/doc/operation/${d.type}/${d.index}`),target:n.fromString(`ph/doc/target/${s}/${p}/${f}`)}};for(c.push(h);c.length>=l;){const y=c.splice(0,l);await this.analyticsStore.addSeriesValues(y)}}c.length>0&&await this.analyticsStore.addSeriesValues(c)}}}async onDisconnect(){}async clearSource(e){try{await this.analyticsStore.clearSeriesBySource(e,!0)}catch(t){this.logger.error("Failed to clear source",t)}}}const $=["ADD_FILE","ADD_FOLDER"],T=["COPY_NODE"],C=["UPDATE_FILE","UPDATE_NODE"],A=["MOVE_NODE"],N=["DELETE_NODE"],V=[...$,...T,...C,...A,...N];class b{constructor(e,t=O(["processor","drive-analytics"])){S(this,"analyticsStore");S(this,"logger");this.analyticsStore=e,this.logger=t}async onStrands(e){if(e.length!==0)for(const t of e){if(t.operations.length===0)continue;const D=t.operations[0],u=n.fromString(`ph/drive/${t.documentId}/${t.branch}/${t.scope}`);D.index===0&&await this.clearSource(u);const{documentId:s,branch:f,scope:E}=t,a=50;for(let p=0;p<t.operations.length;p+=a){const l=t.operations.slice(p,p+a),o=[];for(const i of l){const c=i.index,d=this.getActionType(i.type),g=V.includes(i.type)?"NODE":"DRIVE";let h=s;if(g==="NODE"){const m=i.input;h=m.id||m.targetId||m.srcFolder||s}const y={source:u,metric:"DriveOperations",start:I.fromISO(i.timestamp),value:1,dimensions:{drive:n.fromString(`ph/drive/${s}/${f}/${E}/${c}`),operation:n.fromString(`ph/drive/operation/${i.type}/${i.index}`),target:n.fromString(`ph/drive/target/${g}/${h}`),actionType:n.fromString(`ph/drive/actionType/${d}/${h}`)}};for(o.push(y);o.length>=a;){const m=o.splice(0,a);await this.analyticsStore.addSeriesValues(m)}}o.length>0&&await this.analyticsStore.addSeriesValues(o)}}}async onDisconnect(){}getActionType(e){return $.includes(e)?"CREATED":T.includes(e)?"DUPLICATED":N.includes(e)?"REMOVED":A.includes(e)?"MOVED":"UPDATED"}async clearSource(e){try{await this.analyticsStore.clearSeriesBySource(e,!0)}catch(t){this.logger.error("Failed to clear source",t)}}}const J=r=>e=>[{processor:new b(r.analyticsStore),filter:{branch:["main"],documentId:["*"],scope:["*"],documentType:["powerhouse/document-drive"]}},{processor:new w(r.analyticsStore),filter:{branch:["main"],documentId:["*"],scope:["*"],documentType:["*"]}}];export{w as DocumentAnalyticsProcessor,b as DriveAnalyticsProcessor,J as processorFactory};
|
|
2
|
+
//# sourceMappingURL=index.C6sQB7G2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.DZlpbhmV.js","sources":["../../../../packages/common/dist/drive-analytics/processor/document-processor.js","../../../../packages/common/dist/drive-analytics/processor/drive-processor.js","../../../../packages/common/dist/drive-analytics/processor/index.js"],"sourcesContent":["import { AnalyticsPath, DateTime, } from \"@powerhousedao/reactor-browser/analytics\";\nimport { childLogger } from \"document-drive\";\nexport class DocumentAnalyticsProcessor {\n analyticsStore;\n logger;\n constructor(analyticsStore, logger = childLogger([\"processor\", \"document-analytics\"])) {\n this.analyticsStore = analyticsStore;\n this.logger = logger;\n //\n }\n async onStrands(strands) {\n if (strands.length === 0) {\n return;\n }\n for (const strand of strands) {\n // skip empty strands\n if (strand.operations.length === 0) {\n continue;\n }\n const firstOp = strand.operations[0];\n const source = AnalyticsPath.fromString(`ph/doc/${strand.driveId}/${strand.documentId}/${strand.branch}/${strand.scope}`);\n if (firstOp.index === 0) {\n await this.clearSource(source);\n }\n const { driveId, documentId, branch, scope } = strand;\n const target = driveId === documentId ? \"DRIVE\" : \"NODE\";\n const CHUNK_SIZE = 50;\n for (let i = 0; i < strand.operations.length; i += CHUNK_SIZE) {\n const chunk = strand.operations.slice(i, i + CHUNK_SIZE);\n const buffer = [];\n for (const operation of chunk) {\n const revision = operation.index;\n const seriesInput = {\n source,\n metric: \"DocumentOperations\",\n start: DateTime.fromISO(operation.timestamp),\n value: 1,\n dimensions: {\n drive: AnalyticsPath.fromString(`ph/doc/drive/${driveId}/${branch}/${scope}/${revision}`),\n operation: AnalyticsPath.fromString(`ph/doc/operation/${operation.type}/${operation.index}`),\n target: AnalyticsPath.fromString(`ph/doc/target/${driveId}/${target}/${documentId}`),\n },\n };\n buffer.push(seriesInput);\n while (buffer.length >= CHUNK_SIZE) {\n const batch = buffer.splice(0, CHUNK_SIZE);\n await this.analyticsStore.addSeriesValues(batch);\n }\n }\n if (buffer.length > 0) {\n await this.analyticsStore.addSeriesValues(buffer);\n }\n }\n }\n }\n async onDisconnect() { }\n async clearSource(source) {\n try {\n await this.analyticsStore.clearSeriesBySource(source, true);\n }\n catch (e) {\n this.logger.error(\"Failed to clear source\", e);\n }\n }\n}\n//# sourceMappingURL=document-processor.js.map","import { AnalyticsPath, DateTime, } from \"@powerhousedao/reactor-browser/analytics\";\nimport { childLogger } from \"document-drive\";\nconst CREATE_NODE_ACTIONS = [\"ADD_FILE\", \"ADD_FOLDER\"];\nconst DUPLICATE_NODE_ACTIONS = [\"COPY_NODE\"];\nconst UPDATE_NODE_ACTIONS = [\"UPDATE_FILE\", \"UPDATE_NODE\"];\nconst MOVE_NODE_ACTIONS = [\"MOVE_NODE\"];\nconst REMOVE_NODE_ACTIONS = [\"DELETE_NODE\"];\nconst NODE_ACTIONS = [\n ...CREATE_NODE_ACTIONS,\n ...DUPLICATE_NODE_ACTIONS,\n ...UPDATE_NODE_ACTIONS,\n ...MOVE_NODE_ACTIONS,\n ...REMOVE_NODE_ACTIONS,\n];\nexport class DriveAnalyticsProcessor {\n analyticsStore;\n logger;\n constructor(analyticsStore, logger = childLogger([\"processor\", \"drive-analytics\"])) {\n this.analyticsStore = analyticsStore;\n this.logger = logger;\n //\n }\n async onStrands(strands) {\n if (strands.length === 0) {\n return;\n }\n for (const strand of strands) {\n // skip empty strands\n if (strand.operations.length === 0) {\n continue;\n }\n const firstOp = strand.operations[0];\n const source = AnalyticsPath.fromString(`ph/drive/${strand.documentId}/${strand.branch}/${strand.scope}`);\n if (firstOp.index === 0) {\n await this.clearSource(source);\n }\n const { documentId: driveId, branch, scope } = strand;\n const CHUNK_SIZE = 50;\n for (let i = 0; i < strand.operations.length; i += CHUNK_SIZE) {\n const chunk = strand.operations.slice(i, i + CHUNK_SIZE);\n const buffer = [];\n for (const operation of chunk) {\n const revision = operation.index;\n const actionType = this.getActionType(operation.type);\n const target = NODE_ACTIONS.includes(operation.type)\n ? \"NODE\"\n : \"DRIVE\";\n let targetId = driveId;\n if (target === \"NODE\") {\n const operationInput = operation.input;\n targetId =\n operationInput.id ||\n operationInput.targetId ||\n operationInput.srcFolder ||\n driveId;\n }\n const seriesInput = {\n source,\n metric: \"DriveOperations\",\n start: DateTime.fromISO(operation.timestamp),\n value: 1,\n dimensions: {\n drive: AnalyticsPath.fromString(`ph/drive/${driveId}/${branch}/${scope}/${revision}`),\n operation: AnalyticsPath.fromString(`ph/drive/operation/${operation.type}/${operation.index}`),\n target: AnalyticsPath.fromString(`ph/drive/target/${target}/${targetId}`),\n actionType: AnalyticsPath.fromString(`ph/drive/actionType/${actionType}/${targetId}`),\n },\n };\n buffer.push(seriesInput);\n while (buffer.length >= CHUNK_SIZE) {\n const batch = buffer.splice(0, CHUNK_SIZE);\n await this.analyticsStore.addSeriesValues(batch);\n }\n }\n if (buffer.length > 0) {\n await this.analyticsStore.addSeriesValues(buffer);\n }\n }\n }\n }\n async onDisconnect() { }\n getActionType(action) {\n if (CREATE_NODE_ACTIONS.includes(action)) {\n return \"CREATED\";\n }\n if (DUPLICATE_NODE_ACTIONS.includes(action)) {\n return \"DUPLICATED\";\n }\n if (REMOVE_NODE_ACTIONS.includes(action)) {\n return \"REMOVED\";\n }\n if (MOVE_NODE_ACTIONS.includes(action)) {\n return \"MOVED\";\n }\n return \"UPDATED\";\n }\n async clearSource(source) {\n try {\n await this.analyticsStore.clearSeriesBySource(source, true);\n }\n catch (e) {\n this.logger.error(\"Failed to clear source\", e);\n }\n }\n}\n//# sourceMappingURL=drive-processor.js.map","import { DocumentAnalyticsProcessor } from \"./document-processor.js\";\nimport { DriveAnalyticsProcessor } from \"./drive-processor.js\";\nexport const processorFactory = (module) => (driveId) => {\n return [\n {\n processor: new DriveAnalyticsProcessor(module.analyticsStore),\n filter: {\n branch: [\"main\"],\n documentId: [\"*\"],\n scope: [\"*\"],\n documentType: [\"powerhouse/document-drive\"],\n },\n },\n {\n processor: new DocumentAnalyticsProcessor(module.analyticsStore),\n filter: {\n branch: [\"main\"],\n documentId: [\"*\"],\n scope: [\"*\"],\n documentType: [\"*\"],\n },\n },\n ];\n};\nexport * from \"./document-processor.js\";\nexport * from \"./drive-processor.js\";\n//# sourceMappingURL=index.js.map"],"names":["DocumentAnalyticsProcessor","analyticsStore","logger","childLogger","__publicField","strands","strand","firstOp","source","AnalyticsPath","driveId","documentId","branch","scope","target","CHUNK_SIZE","i","chunk","buffer","operation","revision","seriesInput","DateTime","batch","e","CREATE_NODE_ACTIONS","DUPLICATE_NODE_ACTIONS","UPDATE_NODE_ACTIONS","MOVE_NODE_ACTIONS","REMOVE_NODE_ACTIONS","NODE_ACTIONS","DriveAnalyticsProcessor","actionType","targetId","operationInput","action","processorFactory","module"],"mappings":"8pBAEO,MAAMA,CAA2B,CAGpC,YAAYC,EAAgBC,EAASC,EAAY,CAAC,YAAa,oBAAoB,CAAC,EAAG,CAFvFC,EAAA,uBACAA,EAAA,eAEI,KAAK,eAAiBH,EACtB,KAAK,OAASC,CAEtB,CACI,MAAM,UAAUG,EAAS,CACrB,GAAIA,EAAQ,SAAW,EAGvB,UAAWC,KAAUD,EAAS,CAE1B,GAAIC,EAAO,WAAW,SAAW,EAC7B,SAEJ,MAAMC,EAAUD,EAAO,WAAW,CAAC,EAC7BE,EAASC,EAAc,WAAW,UAAUH,EAAO,OAAO,IAAIA,EAAO,UAAU,IAAIA,EAAO,MAAM,IAAIA,EAAO,KAAK,EAAE,EACpHC,EAAQ,QAAU,GAClB,MAAM,KAAK,YAAYC,CAAM,EAEjC,KAAM,CAAE,QAAAE,EAAS,WAAAC,EAAY,OAAAC,EAAQ,MAAAC,CAAK,EAAKP,EACzCQ,EAASJ,IAAYC,EAAa,QAAU,OAC5CI,EAAa,GACnB,QAASC,EAAI,EAAGA,EAAIV,EAAO,WAAW,OAAQU,GAAKD,EA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,EAAE,CAChH,CACA,EAEoB,IADAf,EAAO,KAAKG,CAAW,EAChBH,EAAO,QAAUH,GAAY,CAChC,MAAMQ,EAAQL,EAAO,OAAO,EAAGH,CAAU,EACzC,MAAM,KAAK,eAAe,gBAAgBQ,CAAK,CACvE,CACA,CACoBL,EAAO,OAAS,GAChB,MAAM,KAAK,eAAe,gBAAgBA,CAAM,CAEpE,CACA,CACA,CACI,MAAM,cAAe,CAAA,CACrB,cAAciB,EAAQ,CAClB,OAAIV,EAAoB,SAASU,CAAM,EAC5B,UAEPT,EAAuB,SAASS,CAAM,EAC/B,aAEPN,EAAoB,SAASM,CAAM,EAC5B,UAEPP,EAAkB,SAASO,CAAM,EAC1B,QAEJ,SACf,CACI,MAAM,YAAY3B,EAAQ,CACtB,GAAI,CACA,MAAM,KAAK,eAAe,oBAAoBA,EAAQ,EAAI,CACtE,OACegB,EAAG,CACN,KAAK,OAAO,MAAM,yBAA0BA,CAAC,CACzD,CACA,CACA,CCtGY,MAACY,EAAoBC,GAAY3B,GAClC,CACH,CACI,UAAW,IAAIqB,EAAwBM,EAAO,cAAc,EAC5D,OAAQ,CACJ,OAAQ,CAAC,MAAM,EACf,WAAY,CAAC,GAAG,EAChB,MAAO,CAAC,GAAG,EACX,aAAc,CAAC,2BAA2B,CAC1D,CACA,EACQ,CACI,UAAW,IAAIrC,EAA2BqC,EAAO,cAAc,EAC/D,OAAQ,CACJ,OAAQ,CAAC,MAAM,EACf,WAAY,CAAC,GAAG,EAChB,MAAO,CAAC,GAAG,EACX,aAAc,CAAC,GAAG,CAClC,CACA,CACA"}
|
|
1
|
+
{"version":3,"file":"index.C6sQB7G2.js","sources":["../../../../packages/common/dist/drive-analytics/processor/document-processor.js","../../../../packages/common/dist/drive-analytics/processor/drive-processor.js","../../../../packages/common/dist/drive-analytics/processor/index.js"],"sourcesContent":["import { AnalyticsPath, DateTime, } from \"@powerhousedao/reactor-browser/analytics\";\nimport { childLogger } from \"document-drive\";\nexport class DocumentAnalyticsProcessor {\n analyticsStore;\n logger;\n constructor(analyticsStore, logger = childLogger([\"processor\", \"document-analytics\"])) {\n this.analyticsStore = analyticsStore;\n this.logger = logger;\n //\n }\n async onStrands(strands) {\n if (strands.length === 0) {\n return;\n }\n for (const strand of strands) {\n // skip empty strands\n if (strand.operations.length === 0) {\n continue;\n }\n const firstOp = strand.operations[0];\n const source = AnalyticsPath.fromString(`ph/doc/${strand.driveId}/${strand.documentId}/${strand.branch}/${strand.scope}`);\n if (firstOp.index === 0) {\n await this.clearSource(source);\n }\n const { driveId, documentId, branch, scope } = strand;\n const target = driveId === documentId ? \"DRIVE\" : \"NODE\";\n const CHUNK_SIZE = 50;\n for (let i = 0; i < strand.operations.length; i += CHUNK_SIZE) {\n const chunk = strand.operations.slice(i, i + CHUNK_SIZE);\n const buffer = [];\n for (const operation of chunk) {\n const revision = operation.index;\n const seriesInput = {\n source,\n metric: \"DocumentOperations\",\n start: DateTime.fromISO(operation.timestamp),\n value: 1,\n dimensions: {\n drive: AnalyticsPath.fromString(`ph/doc/drive/${driveId}/${branch}/${scope}/${revision}`),\n operation: AnalyticsPath.fromString(`ph/doc/operation/${operation.type}/${operation.index}`),\n target: AnalyticsPath.fromString(`ph/doc/target/${driveId}/${target}/${documentId}`),\n },\n };\n buffer.push(seriesInput);\n while (buffer.length >= CHUNK_SIZE) {\n const batch = buffer.splice(0, CHUNK_SIZE);\n await this.analyticsStore.addSeriesValues(batch);\n }\n }\n if (buffer.length > 0) {\n await this.analyticsStore.addSeriesValues(buffer);\n }\n }\n }\n }\n async onDisconnect() { }\n async clearSource(source) {\n try {\n await this.analyticsStore.clearSeriesBySource(source, true);\n }\n catch (e) {\n this.logger.error(\"Failed to clear source\", e);\n }\n }\n}\n//# sourceMappingURL=document-processor.js.map","import { AnalyticsPath, DateTime, } from \"@powerhousedao/reactor-browser/analytics\";\nimport { childLogger } from \"document-drive\";\nconst CREATE_NODE_ACTIONS = [\"ADD_FILE\", \"ADD_FOLDER\"];\nconst DUPLICATE_NODE_ACTIONS = [\"COPY_NODE\"];\nconst UPDATE_NODE_ACTIONS = [\"UPDATE_FILE\", \"UPDATE_NODE\"];\nconst MOVE_NODE_ACTIONS = [\"MOVE_NODE\"];\nconst REMOVE_NODE_ACTIONS = [\"DELETE_NODE\"];\nconst NODE_ACTIONS = [\n ...CREATE_NODE_ACTIONS,\n ...DUPLICATE_NODE_ACTIONS,\n ...UPDATE_NODE_ACTIONS,\n ...MOVE_NODE_ACTIONS,\n ...REMOVE_NODE_ACTIONS,\n];\nexport class DriveAnalyticsProcessor {\n analyticsStore;\n logger;\n constructor(analyticsStore, logger = childLogger([\"processor\", \"drive-analytics\"])) {\n this.analyticsStore = analyticsStore;\n this.logger = logger;\n //\n }\n async onStrands(strands) {\n if (strands.length === 0) {\n return;\n }\n for (const strand of strands) {\n // skip empty strands\n if (strand.operations.length === 0) {\n continue;\n }\n const firstOp = strand.operations[0];\n const source = AnalyticsPath.fromString(`ph/drive/${strand.documentId}/${strand.branch}/${strand.scope}`);\n if (firstOp.index === 0) {\n await this.clearSource(source);\n }\n const { documentId: driveId, branch, scope } = strand;\n const CHUNK_SIZE = 50;\n for (let i = 0; i < strand.operations.length; i += CHUNK_SIZE) {\n const chunk = strand.operations.slice(i, i + CHUNK_SIZE);\n const buffer = [];\n for (const operation of chunk) {\n const revision = operation.index;\n const actionType = this.getActionType(operation.type);\n const target = NODE_ACTIONS.includes(operation.type)\n ? \"NODE\"\n : \"DRIVE\";\n let targetId = driveId;\n if (target === \"NODE\") {\n const operationInput = operation.input;\n targetId =\n operationInput.id ||\n operationInput.targetId ||\n operationInput.srcFolder ||\n driveId;\n }\n const seriesInput = {\n source,\n metric: \"DriveOperations\",\n start: DateTime.fromISO(operation.timestamp),\n value: 1,\n dimensions: {\n drive: AnalyticsPath.fromString(`ph/drive/${driveId}/${branch}/${scope}/${revision}`),\n operation: AnalyticsPath.fromString(`ph/drive/operation/${operation.type}/${operation.index}`),\n target: AnalyticsPath.fromString(`ph/drive/target/${target}/${targetId}`),\n actionType: AnalyticsPath.fromString(`ph/drive/actionType/${actionType}/${targetId}`),\n },\n };\n buffer.push(seriesInput);\n while (buffer.length >= CHUNK_SIZE) {\n const batch = buffer.splice(0, CHUNK_SIZE);\n await this.analyticsStore.addSeriesValues(batch);\n }\n }\n if (buffer.length > 0) {\n await this.analyticsStore.addSeriesValues(buffer);\n }\n }\n }\n }\n async onDisconnect() { }\n getActionType(action) {\n if (CREATE_NODE_ACTIONS.includes(action)) {\n return \"CREATED\";\n }\n if (DUPLICATE_NODE_ACTIONS.includes(action)) {\n return \"DUPLICATED\";\n }\n if (REMOVE_NODE_ACTIONS.includes(action)) {\n return \"REMOVED\";\n }\n if (MOVE_NODE_ACTIONS.includes(action)) {\n return \"MOVED\";\n }\n return \"UPDATED\";\n }\n async clearSource(source) {\n try {\n await this.analyticsStore.clearSeriesBySource(source, true);\n }\n catch (e) {\n this.logger.error(\"Failed to clear source\", e);\n }\n }\n}\n//# sourceMappingURL=drive-processor.js.map","import { DocumentAnalyticsProcessor } from \"./document-processor.js\";\nimport { DriveAnalyticsProcessor } from \"./drive-processor.js\";\nexport const processorFactory = (module) => (driveId) => {\n return [\n {\n processor: new DriveAnalyticsProcessor(module.analyticsStore),\n filter: {\n branch: [\"main\"],\n documentId: [\"*\"],\n scope: [\"*\"],\n documentType: [\"powerhouse/document-drive\"],\n },\n },\n {\n processor: new DocumentAnalyticsProcessor(module.analyticsStore),\n filter: {\n branch: [\"main\"],\n documentId: [\"*\"],\n scope: [\"*\"],\n documentType: [\"*\"],\n },\n },\n ];\n};\nexport * from \"./document-processor.js\";\nexport * from \"./drive-processor.js\";\n//# sourceMappingURL=index.js.map"],"names":["DocumentAnalyticsProcessor","analyticsStore","logger","childLogger","__publicField","strands","strand","firstOp","source","AnalyticsPath","driveId","documentId","branch","scope","target","CHUNK_SIZE","i","chunk","buffer","operation","revision","seriesInput","DateTime","batch","e","CREATE_NODE_ACTIONS","DUPLICATE_NODE_ACTIONS","UPDATE_NODE_ACTIONS","MOVE_NODE_ACTIONS","REMOVE_NODE_ACTIONS","NODE_ACTIONS","DriveAnalyticsProcessor","actionType","targetId","operationInput","action","processorFactory","module"],"mappings":"8pBAEO,MAAMA,CAA2B,CAGpC,YAAYC,EAAgBC,EAASC,EAAY,CAAC,YAAa,oBAAoB,CAAC,EAAG,CAFvFC,EAAA,uBACAA,EAAA,eAEI,KAAK,eAAiBH,EACtB,KAAK,OAASC,CAEtB,CACI,MAAM,UAAUG,EAAS,CACrB,GAAIA,EAAQ,SAAW,EAGvB,UAAWC,KAAUD,EAAS,CAE1B,GAAIC,EAAO,WAAW,SAAW,EAC7B,SAEJ,MAAMC,EAAUD,EAAO,WAAW,CAAC,EAC7BE,EAASC,EAAc,WAAW,UAAUH,EAAO,OAAO,IAAIA,EAAO,UAAU,IAAIA,EAAO,MAAM,IAAIA,EAAO,KAAK,EAAE,EACpHC,EAAQ,QAAU,GAClB,MAAM,KAAK,YAAYC,CAAM,EAEjC,KAAM,CAAE,QAAAE,EAAS,WAAAC,EAAY,OAAAC,EAAQ,MAAAC,CAAK,EAAKP,EACzCQ,EAASJ,IAAYC,EAAa,QAAU,OAC5CI,EAAa,GACnB,QAASC,EAAI,EAAGA,EAAIV,EAAO,WAAW,OAAQU,GAAKD,EAAY,CAC3D,MAAME,EAAQX,EAAO,WAAW,MAAMU,EAAGA,EAAID,CAAU,EACjDG,EAAS,CAAA,EACf,UAAWC,KAAaF,EAAO,CAC3B,MAAMG,EAAWD,EAAU,MACrBE,EAAc,CAChB,OAAAb,EACA,OAAQ,qBACR,MAAOc,EAAS,QAAQH,EAAU,SAAS,EAC3C,MAAO,EACP,WAAY,CACR,MAAOV,EAAc,WAAW,gBAAgBC,CAAO,IAAIE,CAAM,IAAIC,CAAK,IAAIO,CAAQ,EAAE,EACxF,UAAWX,EAAc,WAAW,oBAAoBU,EAAU,IAAI,IAAIA,EAAU,KAAK,EAAE,EAC3F,OAAQV,EAAc,WAAW,iBAAiBC,CAAO,I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EJ,SACf,CACI,MAAM,YAAY3B,EAAQ,CACtB,GAAI,CACA,MAAM,KAAK,eAAe,oBAAoBA,EAAQ,EAAI,CACtE,OACegB,EAAG,CACN,KAAK,OAAO,MAAM,yBAA0BA,CAAC,CACzD,CACA,CACA,CCtGY,MAACY,EAAoBC,GAAY3B,GAClC,CACH,CACI,UAAW,IAAIqB,EAAwBM,EAAO,cAAc,EAC5D,OAAQ,CACJ,OAAQ,CAAC,MAAM,EACf,WAAY,CAAC,GAAG,EAChB,MAAO,CAAC,GAAG,EACX,aAAc,CAAC,2BAA2B,CAC1D,CACA,EACQ,CACI,UAAW,IAAIrC,EAA2BqC,EAAO,cAAc,EAC/D,OAAQ,CACJ,OAAQ,CAAC,MAAM,EACf,WAAY,CAAC,GAAG,EAChB,MAAO,CAAC,GAAG,EACX,aAAc,CAAC,GAAG,CAClC,CACA,CACA"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./app.
|
|
2
|
-
import{createRoot as oe}from"react-dom/client";import{a as l,u as D,b as ne,c as re,P as ae,_ as k}from"./index.I_oLMCM2.js";import{jsxs as H,jsx as p}from"react/jsx-runtime";import{useCallback as de,useEffect as se,StrictMode as ce,Suspense as j,lazy as F}from"react";import{A as ue}from"./app-skeleton.js";const A={},ie=Symbol((A?"production":void 0)!=="production"?"RESET":""),K=e=>typeof(e==null?void 0:e.then)=="function";function le(e=()=>{try{return window.localStorage}catch(o){(A?"production":void 0)!=="production"&&typeof window<"u"&&console.warn(o);return}},t){var o;let r,n;const u={getItem:(s,c)=>{var i,m;const S=w=>{if(w=w||"",r!==w){try{n=JSON.parse(w,void 0)}catch{return c}r=w}return n},g=(m=(i=e())==null?void 0:i.getItem(s))!=null?m:null;return K(g)?g.then(S):S(g)},setItem:(s,c)=>{var i;return(i=e())==null?void 0:i.setItem(s,JSON.stringify(c,void 0))},removeItem:s=>{var c;return(c=e())==null?void 0:c.removeItem(s)}},d=s=>(c,i,m)=>s(c,S=>{let g;try{g=JSON.parse(S||"")}catch{g=m}i(g)});let a;try{a=(o=e())==null?void 0:o.subscribe}catch{}return!a&&typeof window<"u"&&typeof window.addEventListener=="function"&&window.Storage&&(a=(s,c)=>{if(!(e()instanceof window.Storage))return()=>{};const i=m=>{m.storageArea===e()&&m.key===s&&c(m.newValue)};return window.addEventListener("storage",i),()=>{window.removeEventListener("storage",i)}}),a&&(u.subscribe=d(a)),u}const me=le();function ut(e,t,o=me,r){const n=l(t);return(A?"production":void 0)!=="production"&&(n.debugPrivate=!0),n.onMount=d=>{d(o.getItem(e,t));let a;return o.subscribe&&(a=o.subscribe(e,d,t)),a},l(d=>d(n),(d,a,s)=>{const c=typeof s=="function"?s(d(n)):s;return c===ie?(a(n,t),o.removeItem(e)):K(c)?c.then(i=>(a(n,i),o.setItem(e,i))):(a(n,c),o.setItem(e,c))})}const E=new WeakMap,be=(e,t)=>(E.has(t)?E:E.set(t,e())).get(t),fe=e=>typeof(e==null?void 0:e.then)=="function",J={state:"loading"};function b(e){return be(()=>{const t=new WeakMap,o=l(0);(A?"production":void 0)!=="production"&&(o.debugPrivate=!0);const r=l((n,{setSelf:u})=>{n(o);let d;try{d=n(e)}catch(i){return{state:"hasError",error:i}}if(!fe(d))return{state:"hasData",data:d};const a=d,s=t.get(a);if(s)return s;a.then(i=>{t.set(a,{state:"hasData",data:i}),u()},i=>{t.set(a,{state:"hasError",error:i}),u()});const c=t.get(a);return c||(t.set(a,J),J)},(n,u)=>{u(o,d=>d+1)});return(A?"production":void 0)!=="production"&&(r.debugPrivate=!0),l(n=>n(r))},e)}const $=(e,t,o)=>(t.has(o)?t:t.set(o,e())).get(o),pe=new WeakMap,Ae=(e,t,o)=>{const r=$(()=>new WeakMap,pe,t);return $(e,r,o)},ve=e=>typeof(e==null?void 0:e.then)=="function",he=()=>{};function f(e,t=he){return Ae(()=>{const o=new WeakMap,r=new WeakMap,n=l(0);(A?"production":void 0)!=="production"&&(n.debugPrivate=!0);const u=l((d,{setSelf:a})=>{d(n);const s=d(u),c=d(e);if(!ve(c))return{v:c};if(c!==(s==null?void 0:s.p)&&c.then(i=>{r.set(c,i),a()},i=>{o.set(c,i),a()}),o.has(c))throw o.get(c);return r.has(c)?{p:c,v:r.get(c)}:s&&"v"in s?{p:c,f:t(s.v),v:s.v}:{p:c,f:t()}},(d,a)=>{a(n,s=>s+1)});return u.init=void 0,(A?"production":void 0)!=="production"&&(u.debugPrivate=!0),l(d=>{const a=d(u);return"f"in a?a.f:a.v},(d,a,...s)=>a(e,...s))},e,t)}function _(e,t){const o=l(0);return(A?"production":void 0)!=="production"&&(o.debugPrivate=!0),l((r,n)=>(r(o),e(r,n)),(r,n,...u)=>{if(u.length===0)n(o,d=>d+1);else if((A?"production":void 0)!=="production")throw new Error("refresh must be called without arguments")})}function it(e){const t=l(void 0);return delete t.init,Object.defineProperty(t,"init",{get(){return e()}}),t}const h="NOT_SET";function v(){return new Promise(()=>{})}function ge(e){const t=/^\/d\/[^/]+\/([^/]+)$/.exec(e);return t?t[1]:void 0}function we(e){if(!e)return;const o=/\b[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\b/.exec(e);return o?o[0]:void 0}function De(e){const t=ge(e),o=we(t);return o||t}function Le(e){const t=/^\/d\/([^/]+)/.exec(e);return t?t[1]:null}function Se(e){return e.replaceAll(/\s/g,"-")}async function Pe(e,t,o,r){if(typeof window>"u"||!r||!e)return;const n=window.location.pathname,u=await _e(e,n,t);Me(u,n,o)}async function _e(e,t,o){const r=Le(t),n=await e.getDrives(),d=(await Promise.all(n.map(a=>e.getDrive(a)))).find(a=>a.header.slug===r||a.header.id===r);return o(d==null?void 0:d.header.id),d}function Me(e,t,o){const r=De(t),n=e==null?void 0:e.state.global.nodes,u=n==null?void 0:n.find(d=>d.id===r||Se(d.name)===r);o(u==null?void 0:u.id)}function Ie(){return D(M)}function Re(e){return e?e.kind.toUpperCase()==="FOLDER":!1}const P=l(h);P.debugLabel="baseReactorAtom";const O=l(async e=>{const t=e(P);return t===h?v():t});O.debugLabel="reactorAtom";const q=l(null,(e,t,o)=>{e(P)===h&&t(P,o)});q.debugLabel="setReactorAtom";const C=b(O);C.debugLabel="loadableReactorAtom";const Q=f(O);Q.debugLabel="unwrappedReactorAtom";const M=_(async e=>{const t=e(C);if(t.state!=="hasData")return v();const o=t.data;if(!o)return[];const r=await o.getDrives();return(await Promise.all(r.map(u=>o.getDrive(u)))).filter(u=>!!u)});M.debugLabel="drivesAtom";const X=b(M);X.debugLabel="loadableDrivesAtom";const ye=f(M);ye.debugLabel="unwrappedDrivesAtom";const N=l(h);N.debugLabel="baseSelectedDriveIdAtom";const I=l(e=>{const t=e(N),o=e(X);return t===h||o.state!=="hasData"?v():o.data.find(n=>n.header.id===t)},(e,t,o)=>{t(N,o),t(L,void 0)});I.debugLabel="selectedDriveAtom";const x=b(I);x.debugLabel="loadableSelectedDriveAtom";const Ee=f(I);Ee.debugLabel="unwrappedSelectedDriveAtom";const T=l(async e=>{const t=e(x);if(t.state!=="hasData")return v();const o=t.data;return o==null?void 0:o.state.global.nodes});T.debugLabel="nodesAtom";const Y=b(T);Y.debugLabel="loadableNodesAtom";const Ne=f(T);Ne.debugLabel="unwrappedNodesAtom";const L=l(h);L.debugLabel="selectedNodeIdAtom";const Z=l(null,(e,t,o)=>{t(L,o)});Z.debugLabel="setSelectedNodeAtom";const U=l(e=>{const t=e(Y),o=e(L);if(o===h||t.state!=="hasData")return v();const r=t.data,n=r==null?void 0:r.filter(Re);return n==null?void 0:n.find(u=>u.id===o)});U.debugLabel="selectedFolderAtom";const ke=b(U);ke.debugLabel="loadableSelectedFolderAtom";const Fe=f(U);Fe.debugLabel="unwrappedSelectedFolderAtom";const R=_(async e=>{var a;const t=e(C),o=e(x);if(t.state!=="hasData"||o.state!=="hasData")return v();const r=t.data,n=(a=o.data)==null?void 0:a.header.id;if(!r||!n)return[];const u=await r.getDocuments(n);return await Promise.all(u.map(s=>r.getDocument(n,s)))});R.debugLabel="documentsAtom";const ee=b(R);ee.debugLabel="loadableDocumentsAtom";const Oe=f(R);Oe.debugLabel="unwrappedDocumentsAtom";const W=l(e=>{const t=e(ee),o=e(L);return o===h||t.state!=="hasData"?v():t.data.find(n=>n.header.id===o)});W.debugLabel="selectedDocumentAtom";const Ce=b(W);Ce.debugLabel="loadableSelectedDocumentAtom";const xe=f(W);xe.debugLabel="unwrappedSelectedDocumentAtom";const y=l(Promise.resolve(void 0));y.debugLabel="phPackagesAtom";const Te=l(null,(e,t,o)=>{t(y,Promise.resolve(o))});Te.debugLabel="setPhPackagesAtom";const B=b(y);B.debugLabel="loadablePhPackagesAtom";const Ue=f(y);Ue.debugLabel="unwrappedPhPackagesAtom";const V=_(async e=>{const t=e(B);if(t.state!=="hasData")return v();const o=t.data;return o==null?void 0:o.map(r=>r.documentModels).flat()});V.debugLabel="documentModelModulesAtom";const We=b(V);We.debugLabel="loadableDocumentModelModulesAtom";const Be=f(V);Be.debugLabel="unwrappedDocumentModelModulesAtom";const z=_(async e=>{const t=e(B);if(t.state!=="hasData")return v();const o=t.data;return o==null?void 0:o.map(r=>r.editors).flat()});z.debugLabel="editorModulesAtom";const Ve=b(z);Ve.debugLabel="loadableEditorModulesAtom";const ze=f(z);ze.debugLabel="unwrappedEditorModulesAtom";const je=l(void 0);je.debugLabel="processorManagerAtom";const Je=l({appVersion:void 0,studioMode:!1,warnOutdatedApp:!1,routerBasename:void 0,analyticsDatabaseName:void 0,sentry:{dsn:void 0,env:void 0,tracing:void 0},content:{showSearchBar:!0,showDocumentModelSelectionSetting:!0},drives:{addDriveEnabled:!0,sections:{LOCAL:{enabled:!0,allowAdd:!0,allowDelete:!0},CLOUD:{enabled:!0,allowAdd:!0,allowDelete:!0},PUBLIC:{enabled:!0,allowAdd:!0,allowDelete:!0}}},gaTrackingId:void 0,phCliVersion:void 0});Je.debugLabel="configAtom";function $e(){return D(R)}function Ge(){const e=Ie(),t=$e();return de(()=>{e(),t()},[e,t])}function He(){return ne(Q)}function Ke(e,t=!0){const o=He(),r=D(q),n=D(I),u=D(Z),d=Ge();se(()=>{if(o)return;async function a(){const s=await e();s.on("syncStatus",(c,i,m)=>{console.log("syncStatus",c,i,m),d()}),s.on("strandUpdate",()=>{console.log("strandUpdate"),d()}),s.on("defaultRemoteDrive",()=>{console.log("defaultRemoteDrive"),d()}),r(s),await Pe(s,n,u,t)}a().catch(console.error)},[r,e,d,t])}var qe=()=>null;const G=re();function Qe({reactor:e}){return Ke(()=>Promise.resolve(e)),null}function Xe({reactor:e,children:t}){return H(ae,{store:G,children:[p(qe,{store:G}),e&&p(Qe,{reactor:e}),t]})}const Ye=F(()=>k(()=>import("./app.
|
|
3
|
-
//# sourceMappingURL=index.
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./app.ArTwFyr1.js","./index.I_oLMCM2.js","./connect.config.aBnLZYTW.js","./browser.BkwNmV2Z.js","./user.DmfvK6iu.js","./useFeatureFlags.DmV025o7.js","./useAcceptedCookies.Br76D40I.js","./useConnectConfig.DbCQ5P20.js","./index.CAUjMUXb.js","./registerServiceWorker.DAAwLhB_.js","./cookie-banner.BSJ-WPRY.js","./i18next.CqOP20KE.js","./useTranslation.BpVv6XIW.js","./modal.B70wlhFP.js","./Trans.BS3_JvNk.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{createRoot as oe}from"react-dom/client";import{a as l,u as D,b as ne,c as re,P as ae,_ as k}from"./index.I_oLMCM2.js";import{jsxs as H,jsx as p}from"react/jsx-runtime";import{useCallback as de,useEffect as se,StrictMode as ce,Suspense as j,lazy as F}from"react";import{A as ue}from"./app-skeleton.js";const A={},ie=Symbol((A?"production":void 0)!=="production"?"RESET":""),K=e=>typeof(e==null?void 0:e.then)=="function";function le(e=()=>{try{return window.localStorage}catch(o){(A?"production":void 0)!=="production"&&typeof window<"u"&&console.warn(o);return}},t){var o;let r,n;const u={getItem:(s,c)=>{var i,m;const S=w=>{if(w=w||"",r!==w){try{n=JSON.parse(w,void 0)}catch{return c}r=w}return n},g=(m=(i=e())==null?void 0:i.getItem(s))!=null?m:null;return K(g)?g.then(S):S(g)},setItem:(s,c)=>{var i;return(i=e())==null?void 0:i.setItem(s,JSON.stringify(c,void 0))},removeItem:s=>{var c;return(c=e())==null?void 0:c.removeItem(s)}},d=s=>(c,i,m)=>s(c,S=>{let g;try{g=JSON.parse(S||"")}catch{g=m}i(g)});let a;try{a=(o=e())==null?void 0:o.subscribe}catch{}return!a&&typeof window<"u"&&typeof window.addEventListener=="function"&&window.Storage&&(a=(s,c)=>{if(!(e()instanceof window.Storage))return()=>{};const i=m=>{m.storageArea===e()&&m.key===s&&c(m.newValue)};return window.addEventListener("storage",i),()=>{window.removeEventListener("storage",i)}}),a&&(u.subscribe=d(a)),u}const me=le();function ut(e,t,o=me,r){const n=l(t);return(A?"production":void 0)!=="production"&&(n.debugPrivate=!0),n.onMount=d=>{d(o.getItem(e,t));let a;return o.subscribe&&(a=o.subscribe(e,d,t)),a},l(d=>d(n),(d,a,s)=>{const c=typeof s=="function"?s(d(n)):s;return c===ie?(a(n,t),o.removeItem(e)):K(c)?c.then(i=>(a(n,i),o.setItem(e,i))):(a(n,c),o.setItem(e,c))})}const E=new WeakMap,be=(e,t)=>(E.has(t)?E:E.set(t,e())).get(t),fe=e=>typeof(e==null?void 0:e.then)=="function",J={state:"loading"};function b(e){return be(()=>{const t=new WeakMap,o=l(0);(A?"production":void 0)!=="production"&&(o.debugPrivate=!0);const r=l((n,{setSelf:u})=>{n(o);let d;try{d=n(e)}catch(i){return{state:"hasError",error:i}}if(!fe(d))return{state:"hasData",data:d};const a=d,s=t.get(a);if(s)return s;a.then(i=>{t.set(a,{state:"hasData",data:i}),u()},i=>{t.set(a,{state:"hasError",error:i}),u()});const c=t.get(a);return c||(t.set(a,J),J)},(n,u)=>{u(o,d=>d+1)});return(A?"production":void 0)!=="production"&&(r.debugPrivate=!0),l(n=>n(r))},e)}const $=(e,t,o)=>(t.has(o)?t:t.set(o,e())).get(o),pe=new WeakMap,Ae=(e,t,o)=>{const r=$(()=>new WeakMap,pe,t);return $(e,r,o)},ve=e=>typeof(e==null?void 0:e.then)=="function",he=()=>{};function f(e,t=he){return Ae(()=>{const o=new WeakMap,r=new WeakMap,n=l(0);(A?"production":void 0)!=="production"&&(n.debugPrivate=!0);const u=l((d,{setSelf:a})=>{d(n);const s=d(u),c=d(e);if(!ve(c))return{v:c};if(c!==(s==null?void 0:s.p)&&c.then(i=>{r.set(c,i),a()},i=>{o.set(c,i),a()}),o.has(c))throw o.get(c);return r.has(c)?{p:c,v:r.get(c)}:s&&"v"in s?{p:c,f:t(s.v),v:s.v}:{p:c,f:t()}},(d,a)=>{a(n,s=>s+1)});return u.init=void 0,(A?"production":void 0)!=="production"&&(u.debugPrivate=!0),l(d=>{const a=d(u);return"f"in a?a.f:a.v},(d,a,...s)=>a(e,...s))},e,t)}function _(e,t){const o=l(0);return(A?"production":void 0)!=="production"&&(o.debugPrivate=!0),l((r,n)=>(r(o),e(r,n)),(r,n,...u)=>{if(u.length===0)n(o,d=>d+1);else if((A?"production":void 0)!=="production")throw new Error("refresh must be called without arguments")})}function it(e){const t=l(void 0);return delete t.init,Object.defineProperty(t,"init",{get(){return e()}}),t}const h="NOT_SET";function v(){return new Promise(()=>{})}function ge(e){const t=/^\/d\/[^/]+\/([^/]+)$/.exec(e);return t?t[1]:void 0}function we(e){if(!e)return;const o=/\b[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\b/.exec(e);return o?o[0]:void 0}function De(e){const t=ge(e),o=we(t);return o||t}function Le(e){const t=/^\/d\/([^/]+)/.exec(e);return t?t[1]:null}function Se(e){return e.replaceAll(/\s/g,"-")}async function Pe(e,t,o,r){if(typeof window>"u"||!r||!e)return;const n=window.location.pathname,u=await _e(e,n,t);Me(u,n,o)}async function _e(e,t,o){const r=Le(t),n=await e.getDrives(),d=(await Promise.all(n.map(a=>e.getDrive(a)))).find(a=>a.header.slug===r||a.header.id===r);return o(d==null?void 0:d.header.id),d}function Me(e,t,o){const r=De(t),n=e==null?void 0:e.state.global.nodes,u=n==null?void 0:n.find(d=>d.id===r||Se(d.name)===r);o(u==null?void 0:u.id)}function Ie(){return D(M)}function Re(e){return e?e.kind.toUpperCase()==="FOLDER":!1}const P=l(h);P.debugLabel="baseReactorAtom";const O=l(async e=>{const t=e(P);return t===h?v():t});O.debugLabel="reactorAtom";const q=l(null,(e,t,o)=>{e(P)===h&&t(P,o)});q.debugLabel="setReactorAtom";const C=b(O);C.debugLabel="loadableReactorAtom";const Q=f(O);Q.debugLabel="unwrappedReactorAtom";const M=_(async e=>{const t=e(C);if(t.state!=="hasData")return v();const o=t.data;if(!o)return[];const r=await o.getDrives();return(await Promise.all(r.map(u=>o.getDrive(u)))).filter(u=>!!u)});M.debugLabel="drivesAtom";const X=b(M);X.debugLabel="loadableDrivesAtom";const ye=f(M);ye.debugLabel="unwrappedDrivesAtom";const N=l(h);N.debugLabel="baseSelectedDriveIdAtom";const I=l(e=>{const t=e(N),o=e(X);return t===h||o.state!=="hasData"?v():o.data.find(n=>n.header.id===t)},(e,t,o)=>{t(N,o),t(L,void 0)});I.debugLabel="selectedDriveAtom";const x=b(I);x.debugLabel="loadableSelectedDriveAtom";const Ee=f(I);Ee.debugLabel="unwrappedSelectedDriveAtom";const T=l(async e=>{const t=e(x);if(t.state!=="hasData")return v();const o=t.data;return o==null?void 0:o.state.global.nodes});T.debugLabel="nodesAtom";const Y=b(T);Y.debugLabel="loadableNodesAtom";const Ne=f(T);Ne.debugLabel="unwrappedNodesAtom";const L=l(h);L.debugLabel="selectedNodeIdAtom";const Z=l(null,(e,t,o)=>{t(L,o)});Z.debugLabel="setSelectedNodeAtom";const U=l(e=>{const t=e(Y),o=e(L);if(o===h||t.state!=="hasData")return v();const r=t.data,n=r==null?void 0:r.filter(Re);return n==null?void 0:n.find(u=>u.id===o)});U.debugLabel="selectedFolderAtom";const ke=b(U);ke.debugLabel="loadableSelectedFolderAtom";const Fe=f(U);Fe.debugLabel="unwrappedSelectedFolderAtom";const R=_(async e=>{var a;const t=e(C),o=e(x);if(t.state!=="hasData"||o.state!=="hasData")return v();const r=t.data,n=(a=o.data)==null?void 0:a.header.id;if(!r||!n)return[];const u=await r.getDocuments(n);return await Promise.all(u.map(s=>r.getDocument(n,s)))});R.debugLabel="documentsAtom";const ee=b(R);ee.debugLabel="loadableDocumentsAtom";const Oe=f(R);Oe.debugLabel="unwrappedDocumentsAtom";const W=l(e=>{const t=e(ee),o=e(L);return o===h||t.state!=="hasData"?v():t.data.find(n=>n.header.id===o)});W.debugLabel="selectedDocumentAtom";const Ce=b(W);Ce.debugLabel="loadableSelectedDocumentAtom";const xe=f(W);xe.debugLabel="unwrappedSelectedDocumentAtom";const y=l(Promise.resolve(void 0));y.debugLabel="phPackagesAtom";const Te=l(null,(e,t,o)=>{t(y,Promise.resolve(o))});Te.debugLabel="setPhPackagesAtom";const B=b(y);B.debugLabel="loadablePhPackagesAtom";const Ue=f(y);Ue.debugLabel="unwrappedPhPackagesAtom";const V=_(async e=>{const t=e(B);if(t.state!=="hasData")return v();const o=t.data;return o==null?void 0:o.map(r=>r.documentModels).flat()});V.debugLabel="documentModelModulesAtom";const We=b(V);We.debugLabel="loadableDocumentModelModulesAtom";const Be=f(V);Be.debugLabel="unwrappedDocumentModelModulesAtom";const z=_(async e=>{const t=e(B);if(t.state!=="hasData")return v();const o=t.data;return o==null?void 0:o.map(r=>r.editors).flat()});z.debugLabel="editorModulesAtom";const Ve=b(z);Ve.debugLabel="loadableEditorModulesAtom";const ze=f(z);ze.debugLabel="unwrappedEditorModulesAtom";const je=l(void 0);je.debugLabel="processorManagerAtom";const Je=l({appVersion:void 0,studioMode:!1,warnOutdatedApp:!1,routerBasename:void 0,analyticsDatabaseName:void 0,sentry:{dsn:void 0,env:void 0,tracing:void 0},content:{showSearchBar:!0,showDocumentModelSelectionSetting:!0},drives:{addDriveEnabled:!0,sections:{LOCAL:{enabled:!0,allowAdd:!0,allowDelete:!0},CLOUD:{enabled:!0,allowAdd:!0,allowDelete:!0},PUBLIC:{enabled:!0,allowAdd:!0,allowDelete:!0}}},gaTrackingId:void 0,phCliVersion:void 0});Je.debugLabel="configAtom";function $e(){return D(R)}function Ge(){const e=Ie(),t=$e();return de(()=>{e(),t()},[e,t])}function He(){return ne(Q)}function Ke(e,t=!0){const o=He(),r=D(q),n=D(I),u=D(Z),d=Ge();se(()=>{if(o)return;async function a(){const s=await e();s.on("syncStatus",(c,i,m)=>{console.log("syncStatus",c,i,m),d()}),s.on("strandUpdate",()=>{console.log("strandUpdate"),d()}),s.on("defaultRemoteDrive",()=>{console.log("defaultRemoteDrive"),d()}),r(s),await Pe(s,n,u,t)}a().catch(console.error)},[r,e,d,t])}var qe=()=>null;const G=re();function Qe({reactor:e}){return Ke(()=>Promise.resolve(e)),null}function Xe({reactor:e,children:t}){return H(ae,{store:G,children:[p(qe,{store:G}),e&&p(Qe,{reactor:e}),t]})}const Ye=F(()=>k(()=>import("./app.ArTwFyr1.js").then(e=>e.e),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url)),Ze=F(()=>k(()=>import("./cookie-banner.BSJ-WPRY.js"),__vite__mapDeps([10,6,2,1,3,11,12,13,14]),import.meta.url).then(e=>({default:e.CookieBanner}))),et=F(()=>k(()=>import("./modal.B70wlhFP.js"),__vite__mapDeps([13,1]),import.meta.url).then(e=>({default:e.ModalManager}))),tt=p(ce,{children:H(Xe,{children:[p(j,{fallback:p(ue,{}),name:"AppLoader",children:p(Ye,{})}),p(j,{name:"CookieBanner",children:p(et,{children:p(Ze,{})})})]})});function ot(e){oe(e).render(tt)}const te=document.getElementById("app");if(!te)throw new Error("#app element not found!");ot(te);const lt=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));export{it as a,G as b,ut as c,lt as i,b as l,f as u};
|
|
3
|
+
//# sourceMappingURL=index.CAzWx5I7.js.map
|