@powerhousedao/connect 6.2.2-dev.83 → 6.2.2-dev.85

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 (38) hide show
  1. package/dist/{ClearStorageModal-BgcSI7cW.js → ClearStorageModal-DyYYPw4W.js} +4 -4
  2. package/dist/{ClearStorageModal-BgcSI7cW.js.map → ClearStorageModal-DyYYPw4W.js.map} +1 -1
  3. package/dist/{DebugSettingsModal-BINM_y9a.js → DebugSettingsModal-CbXLpmzP.js} +6 -6
  4. package/dist/{DebugSettingsModal-BINM_y9a.js.map → DebugSettingsModal-CbXLpmzP.js.map} +1 -1
  5. package/dist/{InspectorModal-YyuBDdhy.js → InspectorModal-qJXsso_d.js} +6 -6
  6. package/dist/{InspectorModal-YyuBDdhy.js.map → InspectorModal-qJXsso_d.js.map} +1 -1
  7. package/dist/{OpenFileDocumentsModal-BVyNBpAH.js → OpenFileDocumentsModal-BZmh6IRH.js} +4 -4
  8. package/dist/{OpenFileDocumentsModal-BVyNBpAH.js.map → OpenFileDocumentsModal-BZmh6IRH.js.map} +1 -1
  9. package/dist/{SettingsModal-DC3JWr8r.js → SettingsModal-ZTNKe5P-.js} +6 -6
  10. package/dist/{SettingsModal-DC3JWr8r.js.map → SettingsModal-ZTNKe5P-.js.map} +1 -1
  11. package/dist/app-loader-O4FY-lcE.js +4 -0
  12. package/dist/{app-loader-OQ3GurIy.js → app-loader-U4qEyPuN.js} +14 -14
  13. package/dist/{app-loader-OQ3GurIy.js.map → app-loader-U4qEyPuN.js.map} +1 -1
  14. package/dist/{build-info-sJS7DZJh.js → build-info-CptFmVjb.js} +5 -5
  15. package/dist/{build-info-sJS7DZJh.js.map → build-info-CptFmVjb.js.map} +1 -1
  16. package/dist/components-BgkpyiHM.js +4 -0
  17. package/dist/{connect.config-ZWoeCSit.js → connect.config-DaHDEUrw.js} +4 -4
  18. package/dist/connect.config-DaHDEUrw.js.map +1 -0
  19. package/dist/{connection-state-CedmAXd-.js → connection-state-3w4liC1X.js} +4 -4
  20. package/dist/{connection-state-CedmAXd-.js.map → connection-state-3w4liC1X.js.map} +1 -1
  21. package/dist/{cookie-banner-CTxjAKt4.js → cookie-banner-BH6bIq24.js} +4 -4
  22. package/dist/{cookie-banner-CTxjAKt4.js.map → cookie-banner-BH6bIq24.js.map} +1 -1
  23. package/dist/{load-DoZNBHVG.js → load-DklnT-pD.js} +8 -8
  24. package/dist/{load-DoZNBHVG.js.map → load-DklnT-pD.js.map} +1 -1
  25. package/dist/main.js +1 -1
  26. package/dist/{pglite-seed-B7bWZwVg.js → pglite-seed-BqAUvNFw.js} +4 -4
  27. package/dist/{pglite-seed-B7bWZwVg.js.map → pglite-seed-BqAUvNFw.js.map} +1 -1
  28. package/dist/{preferences-store-CUBzmf5F.js → preferences-store-_5Cw4_YV.js} +4 -4
  29. package/dist/{preferences-store-CUBzmf5F.js.map → preferences-store-_5Cw4_YV.js.map} +1 -1
  30. package/dist/{reactor-BfFp2Znq.js → reactor-QvQ0Fgkc.js} +68 -34
  31. package/dist/{reactor-BfFp2Znq.js.map → reactor-QvQ0Fgkc.js.map} +1 -1
  32. package/dist/{registerServiceWorker-lSZgPKiH.js → registerServiceWorker-BSzbNfvz.js} +4 -4
  33. package/dist/{registerServiceWorker-lSZgPKiH.js.map → registerServiceWorker-BSzbNfvz.js.map} +1 -1
  34. package/dist/start-connect.js +1 -1
  35. package/package.json +12 -12
  36. package/dist/app-loader-CQ5T0XnK.js +0 -4
  37. package/dist/components-BTXfI280.js +0 -4
  38. package/dist/connect.config-ZWoeCSit.js.map +0 -1
@@ -1,12 +1,12 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="780b6e0d-dd21-51ba-8a7b-a21203e0ad04")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="cc576d3c-bd74-5328-b602-76379f00184c")}catch(e){}}();
3
3
  import { buildTreeUrl, shortGitSha } from "@powerhousedao/shared";
4
4
  //#region src/utils/build-info.ts
5
5
  function getVersion() {
6
- return "6.2.2-dev.83";
6
+ return "6.2.2-dev.85";
7
7
  }
8
8
  function getGitSha() {
9
- return "ebe44292295ea32a81913f3968be5723fd916ac4";
9
+ return "e2a529de5211f831b48f2d22cdbac2919dd35fdb";
10
10
  }
11
11
  /**
12
12
  * Build identity baked in at build time (define PH_CONNECT_BUILD_HASH —
@@ -24,5 +24,5 @@ function getGitUrl() {
24
24
  //#endregion
25
25
  export { shortGitSha as a, getVersion as i, getGitSha as n, getGitUrl as r, getBuildHash as t };
26
26
 
27
- //# sourceMappingURL=build-info-sJS7DZJh.js.map
28
- //# debugId=780b6e0d-dd21-51ba-8a7b-a21203e0ad04
27
+ //# sourceMappingURL=build-info-CptFmVjb.js.map
28
+ //# debugId=cc576d3c-bd74-5328-b602-76379f00184c
@@ -1 +1 @@
1
- {"version":3,"file":"build-info-sJS7DZJh.js","sources":["../src/utils/build-info.ts"],"sourcesContent":["import { buildTreeUrl, shortGitSha } from \"@powerhousedao/shared\";\nimport { packageJson } from \"./package-json.js\";\n\nexport { shortGitSha };\n\ndeclare const CONNECT_VERSION: string | undefined;\ndeclare const CONNECT_GIT_SHA: string | undefined;\ndeclare const PH_CONNECT_BUILD_HASH: string | undefined;\n\nexport function getVersion(): string {\n if (typeof CONNECT_VERSION !== \"undefined\") return CONNECT_VERSION;\n return (\n process.env.WORKSPACE_VERSION ??\n process.env.npm_package_version ??\n packageJson.version\n );\n}\n\nexport function getGitSha(): string {\n if (typeof CONNECT_GIT_SHA !== \"undefined\") return CONNECT_GIT_SHA;\n return process.env.WORKSPACE_GIT_SHA ?? \"unknown\";\n}\n\n/**\n * Build identity baked in at build time (define PH_CONNECT_BUILD_HASH —\n * see builder-tools' connectBuildHashPlugin). Identical builds of the same\n * inputs produce the same hash; any change to the deployed content (Connect\n * version, project config, package list, build options) changes it.\n */\nexport function getBuildHash(): string {\n if (typeof PH_CONNECT_BUILD_HASH !== \"undefined\")\n return PH_CONNECT_BUILD_HASH;\n return \"unknown\";\n}\n\nexport function getGitUrl(): string | null {\n return buildTreeUrl(getGitSha());\n}\n"],"names":[],"mappings":";;;;AASA,SAAgB,aAAqB;AACS,QAAA;;AAQ9C,SAAgB,YAAoB;AACU,QAAA;;;;;;;;AAU9C,SAAgB,eAAuB;AACrC,KAAI,OAAO,0BAA0B,YACnC,QAAO;AACT,QAAO;;AAGT,SAAgB,YAA2B;AACzC,QAAO,aAAa,WAAW,CAAC","debug_id":"780b6e0d-dd21-51ba-8a7b-a21203e0ad04"}
1
+ {"version":3,"file":"build-info-CptFmVjb.js","sources":["../src/utils/build-info.ts"],"sourcesContent":["import { buildTreeUrl, shortGitSha } from \"@powerhousedao/shared\";\nimport { packageJson } from \"./package-json.js\";\n\nexport { shortGitSha };\n\ndeclare const CONNECT_VERSION: string | undefined;\ndeclare const CONNECT_GIT_SHA: string | undefined;\ndeclare const PH_CONNECT_BUILD_HASH: string | undefined;\n\nexport function getVersion(): string {\n if (typeof CONNECT_VERSION !== \"undefined\") return CONNECT_VERSION;\n return (\n process.env.WORKSPACE_VERSION ??\n process.env.npm_package_version ??\n packageJson.version\n );\n}\n\nexport function getGitSha(): string {\n if (typeof CONNECT_GIT_SHA !== \"undefined\") return CONNECT_GIT_SHA;\n return process.env.WORKSPACE_GIT_SHA ?? \"unknown\";\n}\n\n/**\n * Build identity baked in at build time (define PH_CONNECT_BUILD_HASH —\n * see builder-tools' connectBuildHashPlugin). Identical builds of the same\n * inputs produce the same hash; any change to the deployed content (Connect\n * version, project config, package list, build options) changes it.\n */\nexport function getBuildHash(): string {\n if (typeof PH_CONNECT_BUILD_HASH !== \"undefined\")\n return PH_CONNECT_BUILD_HASH;\n return \"unknown\";\n}\n\nexport function getGitUrl(): string | null {\n return buildTreeUrl(getGitSha());\n}\n"],"names":[],"mappings":";;;;AASA,SAAgB,aAAqB;AACS,QAAA;;AAQ9C,SAAgB,YAAoB;AACU,QAAA;;;;;;;;AAU9C,SAAgB,eAAuB;AACrC,KAAI,OAAO,0BAA0B,YACnC,QAAO;AACT,QAAO;;AAGT,SAAgB,YAA2B;AACzC,QAAO,aAAa,WAAW,CAAC","debug_id":"cc576d3c-bd74-5328-b602-76379f00184c"}
@@ -0,0 +1,4 @@
1
+ import { t as AppLoader } from "./app-loader-U4qEyPuN.js";
2
+ export { AppLoader };
3
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="8b4c6099-0c32-5747-b79d-116986f4d022")}catch(e){}}();
4
+ //# debugId=8b4c6099-0c32-5747-b79d-116986f4d022
@@ -1,5 +1,5 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="c1ed429c-57ea-50c5-8ba5-65bed9395b8f")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="0ecbf0ef-7bc1-582e-ab6b-31f3c6665972")}catch(e){}}();
3
3
  import { n as getRuntimeConfig } from "./runtime-config-DL3QjcfM.js";
4
4
  import { loadRuntimeEnv, normalizeBasePath } from "@powerhousedao/shared/connect";
5
5
  import { setLogLevel } from "@powerhousedao/reactor-browser";
@@ -32,7 +32,7 @@ function getBuiltInDefaults() {
32
32
  cliVersion: env.PH_CONNECT_CLI_VERSION,
33
33
  fileUploadOperationsChunkSize: 50,
34
34
  gaTrackingId: void 0,
35
- defaultDrivesUrl: runtime.drives?.defaultDrives?.[0]?.url,
35
+ defaultDrivesUrl: runtime.drives?.defaultDrives?.find((drive) => "url" in drive)?.url,
36
36
  drivesPreserveStrategy: runtime.drives?.preserveStrategy,
37
37
  enabledEditors: void 0,
38
38
  disabledEditors: [
@@ -178,5 +178,5 @@ const connectConfig = {
178
178
  //#endregion
179
179
  export { defaultPHDocumentEditorConfig as a, defaultPHAppConfig as i, buildPHGlobalConfig as n, phGlobalConfig as o, connectConfig as r, PH_CONNECT_BASE_PATH as t };
180
180
 
181
- //# sourceMappingURL=connect.config-ZWoeCSit.js.map
182
- //# debugId=c1ed429c-57ea-50c5-8ba5-65bed9395b8f
181
+ //# sourceMappingURL=connect.config-DaHDEUrw.js.map
182
+ //# debugId=0ecbf0ef-7bc1-582e-ab6b-31f3c6665972
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connect.config-DaHDEUrw.js","sources":["../src/connect.config.ts"],"sourcesContent":["import {\n setLogLevel,\n type PHAppConfig,\n type PHDocumentEditorConfig,\n type PHGlobalConfig,\n} from \"@powerhousedao/reactor-browser\";\nimport type { PHConnectRuntimeConfig } from \"@powerhousedao/shared/clis\";\nimport {\n loadRuntimeEnv,\n normalizeBasePath,\n} from \"@powerhousedao/shared/connect\";\nimport { logger } from \"document-model\";\nimport { getRuntimeConfig } from \"./runtime-config.js\";\n\n// Env vars are reserved for version stamps and analytics processor toggles.\n// Everything in the Connect runtime schema (PHConnectRuntimeConfig) is read\n// from `runtime` below. The Sentry release tag is stamped at build time via\n// Vite's `define` so it always matches the sourcemap upload tag CI used.\nexport const env = loadRuntimeEnv({\n processEnv: import.meta.env,\n});\n\ndeclare const PH_CONNECT_SENTRY_RELEASE: string;\n\n// Runtime fields come from the JSON, not env. start-connect.tsx's top-level\n// await guarantees the loader cache is warm by the time this module\n// evaluates, so getRuntimeConfig() resolves synchronously. The cache merges\n// DEFAULT_CONNECT_CONFIG into whatever the file declared, so every leaf\n// under `runtime.*` is guaranteed defined.\nconst runtime = getRuntimeConfig().connect;\n\nfunction getRouterBasenameFromBasePath(basePath: string) {\n return basePath.endsWith(\"/\") ? basePath : basePath + \"/\";\n}\n\n// Runtime deploy base. In dynamic-base builds the plugin rewrites\n// import.meta.env.BASE_URL to (globalThis.__PH_DYNAMIC_BASE__||\"/\"), the same\n// base assets resolve against; it takes precedence so router basename and\n// path stripping match the served subpath. A baked runtime base path\n// (runtime.app.basePath) only applies to concrete-base builds, where the\n// dynamic global is unset.\nfunction getDeployBasePath() {\n if (\n typeof globalThis !== \"undefined\" &&\n (globalThis as { __PH_DYNAMIC_BASE__?: string }).__PH_DYNAMIC_BASE__\n ) {\n return import.meta.env.BASE_URL;\n }\n return runtime.app?.basePath || import.meta.env.BASE_URL;\n}\n\n// Hardcoded literal defaults for `PHGlobalConfig` fields whose env-var\n// source was removed. The fields stay on the type so wired-but-dead SW /\n// hook consumers keep typechecking; values mirror the previous Zod\n// defaults.\nfunction getBuiltInDefaults(): Omit<\n PHGlobalConfig,\n \"basePath\" | \"routerBasename\"\n> {\n const studioMode = runtime.app?.studioMode ?? false;\n // Drive containers, DocumentModel, and vetra builder-spec types are authored\n // via their own drives — never creatable from a generic drive.\n const disabledEditors = [\n \"powerhouse/document-drive\",\n \"powerhouse/reactor-drive\",\n \"powerhouse/document-model\",\n \"powerhouse/app\",\n \"powerhouse/document-editor\",\n \"powerhouse/processor\",\n \"powerhouse/subgraph\",\n \"powerhouse/package\",\n ];\n return {\n allowList: undefined,\n allowedDocumentTypes: [],\n isDragAndDropEnabled: true,\n isEditorDebugModeEnabled: false,\n isEditorReadModeEnabled: false,\n isExternalControlsEnabled: false,\n version: env.PH_CONNECT_VERSION,\n logLevel: runtime.app?.logLevel,\n requiresHardRefresh: true,\n warnOutdatedApp: true,\n studioMode,\n versionCheckInterval: 60 * 60 * 1000,\n cliVersion: env.PH_CONNECT_CLI_VERSION,\n fileUploadOperationsChunkSize: 50,\n gaTrackingId: undefined,\n defaultDrivesUrl: runtime.drives?.defaultDrives?.find(\n (drive) => \"url\" in drive,\n )?.url,\n drivesPreserveStrategy: runtime.drives?.preserveStrategy,\n enabledEditors: undefined,\n disabledEditors,\n\n /* Processors */\n isExternalProcessorsEnabled: true,\n // Analytics off by default; flip to true (or wire a runtime-config field)\n // when we want analytics enabled out of the box.\n isAnalyticsEnabled: false,\n isAnalyticsExternalProcessorsEnabled:\n env.PH_CONNECT_EXTERNAL_ANALYTICS_PROCESSORS_ENABLED,\n analyticsDatabaseName: undefined,\n isRelationalProcessorsEnabled: true,\n isExternalRelationalProcessorsEnabled: true,\n\n renownUrl: runtime.renown?.url,\n renownNetworkId: runtime.renown?.networkId,\n renownChainId: runtime.renown?.chainId,\n switchboardUrl: runtime.renown?.switchboardUrl,\n renownAdapters: runtime.renown?.adapters,\n sentryRelease: PH_CONNECT_SENTRY_RELEASE,\n sentryDsn: runtime.sentry?.dsn ?? undefined,\n sentryEnv: runtime.sentry?.env,\n isDiffAnalyticsEnabled: env.PH_CONNECT_DIFF_ANALYTICS_ENABLED,\n isDriveAnalyticsEnabled: env.PH_CONNECT_DRIVE_ANALYTICS_ENABLED,\n isPublicDrivesEnabled: runtime.drives?.sections?.remote?.enabled,\n isCloudDrivesEnabled: runtime.drives?.sections?.remote?.enabled ?? true,\n isLocalDrivesEnabled: runtime.drives?.sections?.local?.enabled,\n isSentryTracingEnabled: runtime.sentry?.tracing,\n isDocumentModelSelectionSettingsEnabled: false,\n isAddDriveEnabled: runtime.drives?.allowAddDrive,\n isAddPublicDrivesEnabled: runtime.drives?.sections?.remote?.allowAdd,\n isDeletePublicDrivesEnabled: runtime.drives?.sections?.remote?.allowDelete,\n isAddCloudDrivesEnabled: runtime.drives?.sections?.remote?.allowAdd ?? true,\n isDeleteCloudDrivesEnabled:\n runtime.drives?.sections?.remote?.allowDelete ?? true,\n isAddLocalDrivesEnabled: runtime.drives?.sections?.local?.allowAdd,\n isDeleteLocalDrivesEnabled: runtime.drives?.sections?.local?.allowDelete,\n isAnalyticsDatabaseWorkerEnabled: false,\n isExternalPackagesEnabled: runtime.packages?.externalEnabled,\n };\n}\n\nexport function buildPHGlobalConfig(\n basePath: string,\n routerBasename: string,\n connectFromConfig: PHConnectRuntimeConfig,\n): PHGlobalConfig {\n const defaults = getBuiltInDefaults();\n const fileOverrides: Partial<PHGlobalConfig> = {};\n\n if (connectFromConfig.drives?.allowAddDrive !== undefined) {\n fileOverrides.isAddDriveEnabled = connectFromConfig.drives.allowAddDrive;\n }\n\n return {\n basePath,\n routerBasename,\n ...defaults,\n ...fileOverrides,\n };\n}\n\nfunction getPHGlobalConfigFromRuntime(): PHGlobalConfig {\n // Deploy base wins via getDeployBasePath: the dynamic-base global when set,\n // else runtime.app.basePath (DEFAULT_CONNECT_CONFIG guarantees it defined),\n // with a \"/\" fallback as a defensive guard for typecheck.\n const basePath = getDeployBasePath() ?? \"/\";\n const routerBasename = getRouterBasenameFromBasePath(basePath);\n return buildPHGlobalConfig(basePath, routerBasename, runtime);\n}\n\nexport const phGlobalConfig = getPHGlobalConfigFromRuntime();\n\nexport const defaultPHDocumentEditorConfig: PHDocumentEditorConfig = {\n isExternalControlsEnabled: phGlobalConfig.isExternalControlsEnabled,\n};\n\nexport const defaultPHAppConfig: PHAppConfig = {\n allowedDocumentTypes: phGlobalConfig.allowedDocumentTypes,\n isDragAndDropEnabled: phGlobalConfig.isDragAndDropEnabled,\n};\n\n// Set log level from the runtime config (DEFAULT_CONNECT_CONFIG provides a\n// fallback, so this is always defined).\nconst RESOLVED_LOG_LEVEL = runtime.app?.logLevel;\nif (RESOLVED_LOG_LEVEL) {\n setLogLevel(RESOLVED_LOG_LEVEL);\n}\nlogger.debug(\"Setting log level to @level.\", RESOLVED_LOG_LEVEL);\n\n// Normalize the base path to ensure it starts and ends with a forward slash.\nexport const PH_CONNECT_BASE_PATH = normalizeBasePath(\n getDeployBasePath() ?? \"/\",\n);\n\n// Analytics database name — derived deterministically from the base path so\n// instances on different prefixes of one origin do not share an analytics DB.\n// Root resolves to \":analytics\".\nconst PH_CONNECT_ANALYTICS_DATABASE_NAME = `${PH_CONNECT_BASE_PATH.replace(\n /\\//g,\n \"\",\n)}:analytics`;\n\n// The CLOUD section was collapsed into the unified `remote` section. PUBLIC\n// keeps its existing string identifier in the legacy\n// connectConfig.drives.sections map to avoid rippling through downstream UI\n// components — both PUBLIC and the\n// soon-to-be-removed CLOUD readers point at runtime.drives.sections.remote.\nexport const connectConfig = {\n appVersion: env.PH_CONNECT_VERSION,\n studioMode: runtime.app?.studioMode ?? false,\n warnOutdatedApp: phGlobalConfig.warnOutdatedApp,\n appVersionCheckInterval: 60 * 60 * 1000,\n routerBasename: PH_CONNECT_BASE_PATH,\n offline: runtime.app?.offline ?? true,\n aiAssistantEnabled: runtime.ai?.assistantEnabled ?? false,\n externalPackagesEnabled: runtime.packages?.externalEnabled,\n processors: {\n enabled: true,\n externalProcessorsEnabled: true,\n },\n analytics: {\n enabled: true,\n databaseName: PH_CONNECT_ANALYTICS_DATABASE_NAME,\n useWorker: false,\n driveAnalyticsEnabled: env.PH_CONNECT_DRIVE_ANALYTICS_ENABLED,\n diffProcessorEnabled: env.PH_CONNECT_DIFF_ANALYTICS_ENABLED,\n externalProcessorsEnabled: true,\n },\n relational: {\n enabled: true,\n externalProcessorsEnabled: true,\n },\n openPanel: {\n clientId: env.PH_CONNECT_OPENPANEL_CLIENT_ID ?? \"\",\n apiUrl: env.PH_CONNECT_OPENPANEL_API_URL,\n // Intentionally dormant — no call sites gate on this yet; UI-event tracking is future work.\n trackUiEvents: env.PH_CONNECT_OPENPANEL_TRACK_UI_EVENTS,\n trackOperations: env.PH_CONNECT_OPENPANEL_TRACK_OPERATIONS,\n },\n renown: {\n url: runtime.renown?.url,\n networkId: runtime.renown?.networkId,\n chainId: runtime.renown?.chainId,\n namespace: runtime.renown?.namespace,\n switchboardUrl: runtime.renown?.switchboardUrl,\n adapters: runtime.renown?.adapters,\n },\n sentry: {\n release: PH_CONNECT_SENTRY_RELEASE,\n // `dsn: null` (default) means Sentry is disabled — useInitSentry bails.\n dsn: runtime.sentry?.dsn ?? null,\n env: runtime.sentry?.env,\n tracing: runtime.sentry?.tracing ?? false,\n },\n content: {\n showSearchBar: false,\n showDocumentModelSelectionSetting: false,\n },\n drives: {\n addDriveEnabled: runtime.drives?.allowAddDrive,\n preserveStrategy: runtime.drives?.preserveStrategy,\n // The legacy `SharingType` enum still includes a \"CLOUD\" variant.\n // Connect collapsed CLOUD into the unified remote section, so both CLOUD\n // and PUBLIC map to the same `runtime.drives.sections.remote` object —\n // the alias keeps `sections[sharingType]` lookups type-safe for every\n // SharingType value.\n sections: (() => {\n const remote = {\n enabled: runtime.drives?.sections?.remote?.enabled,\n allowAdd: runtime.drives?.sections?.remote?.allowAdd,\n allowDelete: runtime.drives?.sections?.remote?.allowDelete,\n };\n return {\n LOCAL: {\n enabled: runtime.drives?.sections?.local?.enabled,\n allowAdd: runtime.drives?.sections?.local?.allowAdd,\n allowDelete: runtime.drives?.sections?.local?.allowDelete,\n },\n PUBLIC: remote,\n CLOUD: remote,\n };\n })(),\n },\n gaTrackingId: undefined,\n phCliVersion: env.PH_CONNECT_CLI_VERSION,\n} as const;\n"],"names":[],"mappings":";;;;;;;AAkBA,MAAa,MAAM,eAAe,EAChC,YAAY,OAAO,KAAK,KACzB,CAAC;AASF,MAAM,UAAU,kBAAkB,CAAC;AAEnC,SAAS,8BAA8B,UAAkB;AACvD,QAAO,SAAS,SAAS,IAAI,GAAG,WAAW,WAAW;;AASxD,SAAS,oBAAoB;AAC3B,KACE,OAAO,eAAe,eACrB,WAAgD,oBAEjD,QAAO,OAAO,KAAK,IAAI;AAEzB,QAAO,QAAQ,KAAK,YAAY,OAAO,KAAK,IAAI;;AAOlD,SAAS,qB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T,UAAU,IAAI,kCAAkC;EAChD,QAAQ,IAAI;EAEZ,eAAe,IAAI;EACnB,iBAAiB,IAAI;EACtB;CACD,QAAQ;EACN,KAAK,QAAQ,QAAQ;EACrB,WAAW,QAAQ,QAAQ;EAC3B,SAAS,QAAQ,QAAQ;EACzB,WAAW,QAAQ,QAAQ;EAC3B,gBAAgB,QAAQ,QAAQ;EAChC,UAAU,QAAQ,QAAQ;EAC3B;CACD,QAAQ;EACN,SAAS;EAET,KAAK,QAAQ,QAAQ,OAAO;EAC5B,KAAK,QAAQ,QAAQ;EACrB,SAAS,QAAQ,QAAQ,WAAW;EACrC;CACD,SAAS;EACP,eAAe;EACf,mCAAmC;EACpC;CACD,QAAQ;EACN,iBAAiB,QAAQ,QAAQ;EACjC,kBAAkB,QAAQ,QAAQ;EAMlC,iBAAiB;GACf,MAAM,SAAS;IACb,SAAS,QAAQ,QAAQ,UAAU,QAAQ;IAC3C,UAAU,QAAQ,QAAQ,UAAU,QAAQ;IAC5C,aAAa,QAAQ,QAAQ,UAAU,QAAQ;IAChD;AACD,UAAO;IACL,OAAO;KACL,SAAS,QAAQ,QAAQ,UAAU,OAAO;KAC1C,UAAU,QAAQ,QAAQ,UAAU,OAAO;KAC3C,aAAa,QAAQ,QAAQ,UAAU,OAAO;KAC/C;IACD,QAAQ;IACR,OAAO;IACR;MACC;EACL;CACD,cAAc,KAAA;CACd,cAAc,IAAI;CACnB","debug_id":"0ecbf0ef-7bc1-582e-ab6b-31f3c6665972"}
@@ -1,8 +1,8 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="5b248289-41c4-55f9-81fc-41e41793b90f")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="f678f465-b7fd-5e27-bf6c-9ccdf05e9a69")}catch(e){}}();
3
3
  import { n as getRuntimeConfig } from "./runtime-config-DL3QjcfM.js";
4
4
  import { n as isMigratableMajor, t as coerceMajor, u as readPgVersionFile } from "./pglite-major-B39aOEiE.js";
5
- import { t as PH_CONNECT_BASE_PATH } from "./connect.config-ZWoeCSit.js";
5
+ import { t as PH_CONNECT_BASE_PATH } from "./connect.config-DaHDEUrw.js";
6
6
  import { ROOT_STORAGE_NAMESPACE, getStorageNamespace } from "@powerhousedao/shared/connect";
7
7
  import { DEFAULT_RELATIONAL_PROCESSOR_DB_NAME, hashNamespace } from "@powerhousedao/shared/processors";
8
8
  //#region src/utils/reactor-namespace.ts
@@ -122,5 +122,5 @@ function subscribeWorkerConnection(listener) {
122
122
  //#endregion
123
123
  export { detectReactorPgMajor as a, getCachedReactorPgMajor as c, subscribeReactorPgMajor as d, PRIMARY_IDB_NAMES as f, RELATIONAL_PGLITE_NAME as h, detectMigrationMajor as i, invalidateReactorPgMajorCache as l, REACTOR_PGLITE_NAME as m, setWorkerConnectionStatus as n, detectRelationalPgMajor as o, REACTOR_INSTANCE_NAMESPACE as p, subscribeWorkerConnection as r, getCachedMigrationMajor as s, getWorkerConnectionStatus as t, subscribeMigrationMajor as u };
124
124
 
125
- //# sourceMappingURL=connection-state-CedmAXd-.js.map
126
- //# debugId=5b248289-41c4-55f9-81fc-41e41793b90f
125
+ //# sourceMappingURL=connection-state-3w4liC1X.js.map
126
+ //# debugId=f678f465-b7fd-5e27-bf6c-9ccdf05e9a69
@@ -1 +1 @@
1
- {"version":3,"file":"connection-state-CedmAXd-.js","sources":["../src/utils/reactor-namespace.ts","../src/utils/storage-namespace.ts","../src/utils/pglite-runtime.ts","../src/connection-state.ts"],"sourcesContent":["import { getStorageNamespace } from \"@powerhousedao/shared/connect\";\nimport { hashNamespace } from \"@powerhousedao/shared/processors\";\n\nexport type ReactorNamespaceInput = {\n basePath: string;\n explicit?: string;\n endpoint?: string;\n};\n\nexport function resolveReactorNamespace(input: ReactorNamespaceInput): string {\n const explicit = input.explicit?.trim();\n if (explicit) {\n return explicit;\n }\n const base = getStorageNamespace(input.basePath);\n const endpoint = input.endpoint?.trim();\n if (endpoint) {\n return `${base}--${hashNamespace(endpoint, 8)}`;\n }\n return base;\n}\n","import { DEFAULT_RELATIONAL_PROCESSOR_DB_NAME } from \"@powerhousedao/shared/processors\";\nimport { ROOT_STORAGE_NAMESPACE } from \"@powerhousedao/shared/connect\";\nimport { PH_CONNECT_BASE_PATH } from \"../connect.config.js\";\nimport { getRuntimeConfig } from \"../runtime-config.js\";\nimport { resolveReactorNamespace } from \"./reactor-namespace.js\";\n\nexport const REACTOR_INSTANCE_NAMESPACE = resolveReactorNamespace({\n basePath: PH_CONNECT_BASE_PATH,\n explicit: getRuntimeConfig().connect.instance?.namespace ?? undefined,\n});\n\nexport const REACTOR_PGLITE_NAME = REACTOR_INSTANCE_NAMESPACE;\n\nexport const RELATIONAL_PGLITE_NAME =\n REACTOR_INSTANCE_NAMESPACE === ROOT_STORAGE_NAMESPACE\n ? DEFAULT_RELATIONAL_PROCESSOR_DB_NAME\n : `${REACTOR_INSTANCE_NAMESPACE}-${DEFAULT_RELATIONAL_PROCESSOR_DB_NAME}`;\n\n// Here, not pglite-idb.ts, so those IDB helpers stay free of runtime-config\n// and remain importable by the reactor SharedWorker.\nexport const REACTOR_IDB_NAME = `/pglite/${REACTOR_PGLITE_NAME}`;\nexport const RELATIONAL_IDB_NAME = `/pglite/${RELATIONAL_PGLITE_NAME}`;\nexport const PRIMARY_IDB_NAMES = [\n REACTOR_IDB_NAME,\n RELATIONAL_IDB_NAME,\n] as const;\n","import { readPgVersionFile } from \"./pglite-idb.js\";\nimport {\n coerceMajor,\n isMigratableMajor,\n type DetectedMajor,\n} from \"./pglite-major.js\";\nimport { REACTOR_IDB_NAME, RELATIONAL_IDB_NAME } from \"./storage-namespace.js\";\n\nexport {\n CURRENT_PG_MAJOR,\n SUPPORTED_PG_MAJORS,\n coerceMajor,\n resolvePgMajorForRuntime,\n loadPGliteModule,\n loadPgDump,\n type SupportedPgMajor,\n type DetectedMajor,\n} from \"./pglite-major.js\";\n\nlet cachedReactorMajor: DetectedMajor | undefined;\nlet inflight: Promise<DetectedMajor> | undefined;\nconst majorListeners = new Set<() => void>();\n\nlet cachedMigrationMajor: DetectedMajor | undefined;\nlet migrationInflight: Promise<DetectedMajor> | undefined;\nconst migrationListeners = new Set<() => void>();\n\nfunction notifyMajorChanged() {\n for (const l of majorListeners) l();\n}\n\nfunction notifyMigrationChanged() {\n for (const l of migrationListeners) l();\n}\n\nexport function subscribeReactorPgMajor(cb: () => void): () => void {\n majorListeners.add(cb);\n return () => {\n majorListeners.delete(cb);\n };\n}\n\nexport async function detectReactorPgMajor(): Promise<DetectedMajor> {\n if (cachedReactorMajor !== undefined) return cachedReactorMajor;\n if (inflight) return inflight;\n\n inflight = (async () => {\n const major = coerceMajor(await readPgVersionFile(REACTOR_IDB_NAME));\n cachedReactorMajor = major;\n notifyMajorChanged();\n return major;\n })();\n try {\n return await inflight;\n } finally {\n inflight = undefined;\n }\n}\n\nexport function getCachedReactorPgMajor(): DetectedMajor | undefined {\n return cachedReactorMajor;\n}\n\nexport function invalidateReactorPgMajorCache(): void {\n cachedReactorMajor = undefined;\n cachedMigrationMajor = undefined;\n notifyMajorChanged();\n notifyMigrationChanged();\n}\n\nexport async function detectRelationalPgMajor(): Promise<DetectedMajor> {\n return coerceMajor(await readPgVersionFile(RELATIONAL_IDB_NAME));\n}\n\nexport function subscribeMigrationMajor(cb: () => void): () => void {\n migrationListeners.add(cb);\n return () => {\n migrationListeners.delete(cb);\n };\n}\n\nexport function getCachedMigrationMajor(): DetectedMajor | undefined {\n return cachedMigrationMajor;\n}\n\n/**\n * Legacy major the migration banner should prompt for: the first primary store\n * (reactor or relational) on a supported, non-current major. Spans both stores\n * to match migrateAllIfNeeded.\n */\nexport async function detectMigrationMajor(): Promise<DetectedMajor> {\n if (cachedMigrationMajor !== undefined) return cachedMigrationMajor;\n if (migrationInflight) return migrationInflight;\n\n migrationInflight = (async () => {\n const majors = await Promise.all([\n readPgVersionFile(REACTOR_IDB_NAME),\n readPgVersionFile(RELATIONAL_IDB_NAME),\n ]);\n const legacy = majors.find(isMigratableMajor) ?? null;\n cachedMigrationMajor = legacy;\n notifyMigrationChanged();\n return legacy;\n })();\n try {\n return await migrationInflight;\n } finally {\n migrationInflight = undefined;\n }\n}\n","export type WorkerConnectionStatus = \"connected\" | \"lost\";\n\nlet status: WorkerConnectionStatus = \"connected\";\nconst listeners = new Set<() => void>();\n\nexport function getWorkerConnectionStatus(): WorkerConnectionStatus {\n return status;\n}\n\nexport function setWorkerConnectionStatus(next: WorkerConnectionStatus): void {\n if (status === next) {\n return;\n }\n status = next;\n for (const listener of [...listeners]) {\n listener();\n }\n}\n\nexport function subscribeWorkerConnection(listener: () => void): () => void {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n}\n"],"names":[],"mappings":";;;;;;;;AASA,SAAgB,wBAAwB,OAAsC;CAC5E,MAAM,WAAW,MAAM,UAAU,MAAM;AACvC,KAAI,SACF,QAAO;CAET,MAAM,OAAO,oBAAoB,MAAM,SAAS;CAChD,MAAM,WAAW,MAAM,UAAU,MAAM;AACvC,KAAI,SACF,QAAO,GAAG,KAAK,IAAI,cAAc,UAAU,EAAE;AAE/C,QAAO;;;;ACbT,MAAa,6BAA6B,wBAAwB;CAChE,UAAU;CACV,UAAU,kBAAkB,CAAC,QAAQ,UAAU,aAAa,KAAA;CAC7D,CAAC;AAEF,MAAa,sBAAsB;AAEnC,MAAa,yBACX,+BAA+B,yBAC3B,uCACA,GAAG,2BAA2B,GAAG;AAIvC,MAAa,mBAAmB,WAAW;AAC3C,MAAa,sBAAsB,WAAW;AAC9C,MAAa,oBAAoB,CAC/B,kBACA,oBACD;;;ACND,IAAI;AACJ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AAoB,KAAA;;;;;ACzGxB,IAAI,SAAiC;AACrC,MAAM,4BAAY,IAAI,KAAiB;AAEvC,SAAgB,4BAAoD;AAClE,QAAO;;AAGT,SAAgB,0BAA0B,MAAoC;AAC5E,KAAI,WAAW,KACb;AAEF,UAAS;AACT,MAAK,MAAM,YAAY,CAAC,GAAG,UAAU,CACnC,WAAU;;AAId,SAAgB,0BAA0B,UAAkC;AAC1E,WAAU,IAAI,SAAS;AACvB,cAAa;AACX,YAAU,OAAO,SAAS","debug_id":"5b248289-41c4-55f9-81fc-41e41793b90f"}
1
+ {"version":3,"file":"connection-state-3w4liC1X.js","sources":["../src/utils/reactor-namespace.ts","../src/utils/storage-namespace.ts","../src/utils/pglite-runtime.ts","../src/connection-state.ts"],"sourcesContent":["import { getStorageNamespace } from \"@powerhousedao/shared/connect\";\nimport { hashNamespace } from \"@powerhousedao/shared/processors\";\n\nexport type ReactorNamespaceInput = {\n basePath: string;\n explicit?: string;\n endpoint?: string;\n};\n\nexport function resolveReactorNamespace(input: ReactorNamespaceInput): string {\n const explicit = input.explicit?.trim();\n if (explicit) {\n return explicit;\n }\n const base = getStorageNamespace(input.basePath);\n const endpoint = input.endpoint?.trim();\n if (endpoint) {\n return `${base}--${hashNamespace(endpoint, 8)}`;\n }\n return base;\n}\n","import { DEFAULT_RELATIONAL_PROCESSOR_DB_NAME } from \"@powerhousedao/shared/processors\";\nimport { ROOT_STORAGE_NAMESPACE } from \"@powerhousedao/shared/connect\";\nimport { PH_CONNECT_BASE_PATH } from \"../connect.config.js\";\nimport { getRuntimeConfig } from \"../runtime-config.js\";\nimport { resolveReactorNamespace } from \"./reactor-namespace.js\";\n\nexport const REACTOR_INSTANCE_NAMESPACE = resolveReactorNamespace({\n basePath: PH_CONNECT_BASE_PATH,\n explicit: getRuntimeConfig().connect.instance?.namespace ?? undefined,\n});\n\nexport const REACTOR_PGLITE_NAME = REACTOR_INSTANCE_NAMESPACE;\n\nexport const RELATIONAL_PGLITE_NAME =\n REACTOR_INSTANCE_NAMESPACE === ROOT_STORAGE_NAMESPACE\n ? DEFAULT_RELATIONAL_PROCESSOR_DB_NAME\n : `${REACTOR_INSTANCE_NAMESPACE}-${DEFAULT_RELATIONAL_PROCESSOR_DB_NAME}`;\n\n// Here, not pglite-idb.ts, so those IDB helpers stay free of runtime-config\n// and remain importable by the reactor SharedWorker.\nexport const REACTOR_IDB_NAME = `/pglite/${REACTOR_PGLITE_NAME}`;\nexport const RELATIONAL_IDB_NAME = `/pglite/${RELATIONAL_PGLITE_NAME}`;\nexport const PRIMARY_IDB_NAMES = [\n REACTOR_IDB_NAME,\n RELATIONAL_IDB_NAME,\n] as const;\n","import { readPgVersionFile } from \"./pglite-idb.js\";\nimport {\n coerceMajor,\n isMigratableMajor,\n type DetectedMajor,\n} from \"./pglite-major.js\";\nimport { REACTOR_IDB_NAME, RELATIONAL_IDB_NAME } from \"./storage-namespace.js\";\n\nexport {\n CURRENT_PG_MAJOR,\n SUPPORTED_PG_MAJORS,\n coerceMajor,\n resolvePgMajorForRuntime,\n loadPGliteModule,\n loadPgDump,\n type SupportedPgMajor,\n type DetectedMajor,\n} from \"./pglite-major.js\";\n\nlet cachedReactorMajor: DetectedMajor | undefined;\nlet inflight: Promise<DetectedMajor> | undefined;\nconst majorListeners = new Set<() => void>();\n\nlet cachedMigrationMajor: DetectedMajor | undefined;\nlet migrationInflight: Promise<DetectedMajor> | undefined;\nconst migrationListeners = new Set<() => void>();\n\nfunction notifyMajorChanged() {\n for (const l of majorListeners) l();\n}\n\nfunction notifyMigrationChanged() {\n for (const l of migrationListeners) l();\n}\n\nexport function subscribeReactorPgMajor(cb: () => void): () => void {\n majorListeners.add(cb);\n return () => {\n majorListeners.delete(cb);\n };\n}\n\nexport async function detectReactorPgMajor(): Promise<DetectedMajor> {\n if (cachedReactorMajor !== undefined) return cachedReactorMajor;\n if (inflight) return inflight;\n\n inflight = (async () => {\n const major = coerceMajor(await readPgVersionFile(REACTOR_IDB_NAME));\n cachedReactorMajor = major;\n notifyMajorChanged();\n return major;\n })();\n try {\n return await inflight;\n } finally {\n inflight = undefined;\n }\n}\n\nexport function getCachedReactorPgMajor(): DetectedMajor | undefined {\n return cachedReactorMajor;\n}\n\nexport function invalidateReactorPgMajorCache(): void {\n cachedReactorMajor = undefined;\n cachedMigrationMajor = undefined;\n notifyMajorChanged();\n notifyMigrationChanged();\n}\n\nexport async function detectRelationalPgMajor(): Promise<DetectedMajor> {\n return coerceMajor(await readPgVersionFile(RELATIONAL_IDB_NAME));\n}\n\nexport function subscribeMigrationMajor(cb: () => void): () => void {\n migrationListeners.add(cb);\n return () => {\n migrationListeners.delete(cb);\n };\n}\n\nexport function getCachedMigrationMajor(): DetectedMajor | undefined {\n return cachedMigrationMajor;\n}\n\n/**\n * Legacy major the migration banner should prompt for: the first primary store\n * (reactor or relational) on a supported, non-current major. Spans both stores\n * to match migrateAllIfNeeded.\n */\nexport async function detectMigrationMajor(): Promise<DetectedMajor> {\n if (cachedMigrationMajor !== undefined) return cachedMigrationMajor;\n if (migrationInflight) return migrationInflight;\n\n migrationInflight = (async () => {\n const majors = await Promise.all([\n readPgVersionFile(REACTOR_IDB_NAME),\n readPgVersionFile(RELATIONAL_IDB_NAME),\n ]);\n const legacy = majors.find(isMigratableMajor) ?? null;\n cachedMigrationMajor = legacy;\n notifyMigrationChanged();\n return legacy;\n })();\n try {\n return await migrationInflight;\n } finally {\n migrationInflight = undefined;\n }\n}\n","export type WorkerConnectionStatus = \"connected\" | \"lost\";\n\nlet status: WorkerConnectionStatus = \"connected\";\nconst listeners = new Set<() => void>();\n\nexport function getWorkerConnectionStatus(): WorkerConnectionStatus {\n return status;\n}\n\nexport function setWorkerConnectionStatus(next: WorkerConnectionStatus): void {\n if (status === next) {\n return;\n }\n status = next;\n for (const listener of [...listeners]) {\n listener();\n }\n}\n\nexport function subscribeWorkerConnection(listener: () => void): () => void {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n}\n"],"names":[],"mappings":";;;;;;;;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BAAwB;;AAG1B,eAAsB,0BAAkD;AACtE,QAAO,YAAY,MAAM,kBAAkB,oBAAoB,CAAC;;AAGlE,SAAgB,wBAAwB,IAA4B;AAClE,oBAAmB,IAAI,GAAG;AAC1B,cAAa;AACX,qBAAmB,OAAO,GAAG;;;AAIjC,SAAgB,0BAAqD;AACnE,QAAO;;;;;;;AAQT,eAAsB,uBAA+C;AACnE,KAAI,yBAAyB,KAAA,EAAW,QAAO;AAC/C,KAAI,kBAAmB,QAAO;AAE9B,sBAAqB,YAAY;EAK/B,MAAM,UAJS,MAAM,QAAQ,IAAI,CAC/B,kBAAkB,iBAAiB,EACnC,kBAAkB,oBAAoB,CACvC,CAAC,EACoB,KAAK,kBAAkB,IAAI;AACjD,yBAAuB;AACvB,0BAAwB;AACxB,SAAO;KACL;AACJ,KAAI;AACF,SAAO,MAAM;WACL;AACR,sBAAoB,KAAA;;;;;ACzGxB,IAAI,SAAiC;AACrC,MAAM,4BAAY,IAAI,KAAiB;AAEvC,SAAgB,4BAAoD;AAClE,QAAO;;AAGT,SAAgB,0BAA0B,MAAoC;AAC5E,KAAI,WAAW,KACb;AAEF,UAAS;AACT,MAAK,MAAM,YAAY,CAAC,GAAG,UAAU,CACnC,WAAU;;AAId,SAAgB,0BAA0B,UAAkC;AAC1E,WAAU,IAAI,SAAS;AACvB,cAAa;AACX,YAAU,OAAO,SAAS","debug_id":"f678f465-b7fd-5e27-bf6c-9ccdf05e9a69"}
@@ -1,7 +1,7 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="1ad79a82-69f6-5f74-bbad-7c34923ce7ba")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="5dc522b0-5423-5c74-8f11-6044a6947ba3")}catch(e){}}();
3
3
  import { t as i18n } from "./i18n-CWO0vYVd.js";
4
- import { n as useCookieBanner, t as useAcceptedCookies } from "./preferences-store-CUBzmf5F.js";
4
+ import { n as useCookieBanner, t as useAcceptedCookies } from "./preferences-store-_5Cw4_YV.js";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import { Trans, useTranslation } from "react-i18next";
7
7
  import { showPHModal } from "@powerhousedao/reactor-browser";
@@ -66,5 +66,5 @@ const CookieBanner = () => {
66
66
  //#endregion
67
67
  export { CookieBanner };
68
68
 
69
- //# sourceMappingURL=cookie-banner-CTxjAKt4.js.map
70
- //# debugId=1ad79a82-69f6-5f74-bbad-7c34923ce7ba
69
+ //# sourceMappingURL=cookie-banner-BH6bIq24.js.map
70
+ //# debugId=5dc522b0-5423-5c74-8f11-6044a6947ba3
@@ -1 +1 @@
1
- {"version":3,"file":"cookie-banner-CTxjAKt4.js","sources":["../src/components/cookie-banner.tsx"],"sourcesContent":["import {\n useAcceptedCookies,\n useCookieBanner,\n} from \"../hooks/preferences-store.js\";\nimport type { CookieInput } from \"@powerhousedao/design-system/connect\";\nimport { CookieBanner as PHCookieBanner } from \"@powerhousedao/design-system/connect\";\nimport { showPHModal } from \"@powerhousedao/reactor-browser\";\nimport { Trans, useTranslation } from \"react-i18next\";\nimport { i18n } from \"@powerhousedao/connect/i18n\";\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 [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-primary opacity-15\" />\n <div className=\"absolute inset-x-0 bottom-0 flex justify-center bg-background px-10 pt-10 pb-16 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-muted-foreground\">\n <Trans\n key={\"cookieBanner.message\"}\n i18nKey=\"cookieBanner.message\"\n components={{\n a: (\n <a\n onClick={() => showPHModal({ type: \"cookiesPolicy\" })}\n key={\"cookieBanner.message-link\"}\n className=\"cursor-pointer text-foreground hover:underline\"\n />\n ),\n }}\n />\n </p>\n </PHCookieBanner>\n </div>\n </div>\n );\n};\n"],"names":["PHCookieBanner"],"mappings":";;;;;;;;;AAUA,MAAM,oBAAoB,SAAwB,OAAe;AAC/D,QAAO,QAAQ,MAAM,WAAW,OAAO,OAAO,MAAM,OAAO,MAAM;;AAGnE,MAAa,qBAAqB;CAChC,MAAM,EAAE,MAAM,eAAe,KAAA,GAAW;EACtC,aAAa;EACb;EACD,CAAC;CACF,MAAM,CAAC,YAAY,iBAAiB,iBAAiB;CACrD,MAAM,GAAG,sBAAsB,oBAAoB;CAEnD,MAAM,eAA8B,CAClC;EACE,IAAI;EACJ,OAAO,EAAE,iCAAiC;EAC1C,OAAO;EACR,CACF;CAED,MAAM,gBAAgB,YAA2B;AAC/C,gBAAc,MAAM;AAEpB,MAAI,iBAAiB,SAAS,mBAAmB,CAC/C,qBAAoB,qBAAqB;GACvC,GAAG;GACH,WAAW;GACZ,EAAE;;CAIP,MAAM,qBAAqB;AACzB,gBAAc,MAAM;AACpB,4BAA0B;GACxB,WAAW;GACX,YAAY;GACZ,WAAW;GACZ,EAAE;;AAGL,KAAI,CAAC,WACH,QAAO;AAGT,QACE,qBAAC,OAAD;EAAK,WAAU;YAAf,CACE,oBAAC,OAAD,EAAK,WAAU,0CAA2C,CAAA,EAC1D,oBAAC,OAAD;GAAK,WAAU;aACb,oBAACA,gBAAD;IACE,WAAU;IACV,SAAS;IACT,UAAU;IACV,UAAU;IACV,aAAa,EAAE,sBAAsB;IACrC,aAAa,EAAE,sBAAsB;cAErC,oBAAC,KAAD;KAAG,WAAU;eACX,oBAAC,OAAD;MAEE,SAAQ;MACR,YAAY,EACV,GACE,oBAAC,KAAD;OACE,eAAe,YAAY,EAAE,MAAM,iBAAiB,CAAC;OAErD,WAAU;OACV,EAFK,4BAEL,EAEL;MACD,EAXK,uBAWL;KACA,CAAA;IACW,CAAA;GACb,CAAA,CACF","debug_id":"1ad79a82-69f6-5f74-bbad-7c34923ce7ba"}
1
+ {"version":3,"file":"cookie-banner-BH6bIq24.js","sources":["../src/components/cookie-banner.tsx"],"sourcesContent":["import {\n useAcceptedCookies,\n useCookieBanner,\n} from \"../hooks/preferences-store.js\";\nimport type { CookieInput } from \"@powerhousedao/design-system/connect\";\nimport { CookieBanner as PHCookieBanner } from \"@powerhousedao/design-system/connect\";\nimport { showPHModal } from \"@powerhousedao/reactor-browser\";\nimport { Trans, useTranslation } from \"react-i18next\";\nimport { i18n } from \"@powerhousedao/connect/i18n\";\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 [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-primary opacity-15\" />\n <div className=\"absolute inset-x-0 bottom-0 flex justify-center bg-background px-10 pt-10 pb-16 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-muted-foreground\">\n <Trans\n key={\"cookieBanner.message\"}\n i18nKey=\"cookieBanner.message\"\n components={{\n a: (\n <a\n onClick={() => showPHModal({ type: \"cookiesPolicy\" })}\n key={\"cookieBanner.message-link\"}\n className=\"cursor-pointer text-foreground hover:underline\"\n />\n ),\n }}\n />\n </p>\n </PHCookieBanner>\n </div>\n </div>\n );\n};\n"],"names":["PHCookieBanner"],"mappings":";;;;;;;;;AAUA,MAAM,oBAAoB,SAAwB,OAAe;AAC/D,QAAO,QAAQ,MAAM,WAAW,OAAO,OAAO,MAAM,OAAO,MAAM;;AAGnE,MAAa,qBAAqB;CAChC,MAAM,EAAE,MAAM,eAAe,KAAA,GAAW;EACtC,aAAa;EACb;EACD,CAAC;CACF,MAAM,CAAC,YAAY,iBAAiB,iBAAiB;CACrD,MAAM,GAAG,sBAAsB,oBAAoB;CAEnD,MAAM,eAA8B,CAClC;EACE,IAAI;EACJ,OAAO,EAAE,iCAAiC;EAC1C,OAAO;EACR,CACF;CAED,MAAM,gBAAgB,YAA2B;AAC/C,gBAAc,MAAM;AAEpB,MAAI,iBAAiB,SAAS,mBAAmB,CAC/C,qBAAoB,qBAAqB;GACvC,GAAG;GACH,WAAW;GACZ,EAAE;;CAIP,MAAM,qBAAqB;AACzB,gBAAc,MAAM;AACpB,4BAA0B;GACxB,WAAW;GACX,YAAY;GACZ,WAAW;GACZ,EAAE;;AAGL,KAAI,CAAC,WACH,QAAO;AAGT,QACE,qBAAC,OAAD;EAAK,WAAU;YAAf,CACE,oBAAC,OAAD,EAAK,WAAU,0CAA2C,CAAA,EAC1D,oBAAC,OAAD;GAAK,WAAU;aACb,oBAACA,gBAAD;IACE,WAAU;IACV,SAAS;IACT,UAAU;IACV,UAAU;IACV,aAAa,EAAE,sBAAsB;IACrC,aAAa,EAAE,sBAAsB;cAErC,oBAAC,KAAD;KAAG,WAAU;eACX,oBAAC,OAAD;MAEE,SAAQ;MACR,YAAY,EACV,GACE,oBAAC,KAAD;OACE,eAAe,YAAY,EAAE,MAAM,iBAAiB,CAAC;OAErD,WAAU;OACV,EAFK,4BAEL,EAEL;MACD,EAXK,uBAWL;KACA,CAAA;IACW,CAAA;GACb,CAAA,CACF","debug_id":"5dc522b0-5423-5c74-8f11-6044a6947ba3"}
@@ -1,11 +1,11 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="cda88064-1abc-517c-9349-f07e1d755427")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="2364ffcd-df5f-5b83-88fd-b306ec98f26e")}catch(e){}}();
3
3
  import { r as loadRuntimeConfig, t as applyConnectBranding } from "./runtime-config-DL3QjcfM.js";
4
- import { t as getBuildHash } from "./build-info-sJS7DZJh.js";
5
- import { r as connectConfig } from "./connect.config-ZWoeCSit.js";
6
- import { n as createReactor } from "./reactor-BfFp2Znq.js";
7
- import { a as detectReactorPgMajor, i as detectMigrationMajor } from "./connection-state-CedmAXd-.js";
8
- import { n as seedPendingPgVersion } from "./pglite-seed-B7bWZwVg.js";
4
+ import { t as getBuildHash } from "./build-info-CptFmVjb.js";
5
+ import { r as connectConfig } from "./connect.config-DaHDEUrw.js";
6
+ import { n as createReactor } from "./reactor-QvQ0Fgkc.js";
7
+ import { a as detectReactorPgMajor, i as detectMigrationMajor } from "./connection-state-3w4liC1X.js";
8
+ import { n as seedPendingPgVersion } from "./pglite-seed-BqAUvNFw.js";
9
9
  import { n as setUser } from "./sentry-QXKgQmr2.js";
10
10
  import { useEffect } from "react";
11
11
  import { initTheme, useUser } from "@powerhousedao/reactor-browser";
@@ -127,5 +127,5 @@ async function loadComponent(localPackage) {
127
127
  //#endregion
128
128
  export { loadComponent };
129
129
 
130
- //# sourceMappingURL=load-DoZNBHVG.js.map
131
- //# debugId=cda88064-1abc-517c-9349-f07e1d755427
130
+ //# sourceMappingURL=load-DklnT-pD.js.map
131
+ //# debugId=2364ffcd-df5f-5b83-88fd-b306ec98f26e
@@ -1 +1 @@
1
- {"version":3,"file":"load-DoZNBHVG.js","sources":["../src/hooks/useCheckLatestVersion.ts","../src/hooks/utils.ts","../src/store/user.ts","../src/components/load.tsx"],"sourcesContent":["import { connectConfig } from \"@powerhousedao/connect/config\";\nimport { getBuildHashStatus } from \"@powerhousedao/connect/hooks\";\nimport { logger } from \"document-model\";\nimport { useEffect } from \"react\";\n\n// Session-scoped guard: records the deployed hash this tab already reloaded\n// for, so a broken or rolling deploy (server hash keeps changing under us)\n// cannot turn the tab into a reload loop. Cleared implicitly with the tab.\nconst RELOADED_FOR_KEY = \"ph-reloaded-for-build-hash\";\n\n/**\n * Drop the service worker's stale caches (precache + the NetworkFirst shell\n * cache) before reloading onto a new deploy, so the post-reload navigation\n * is answered from the network / fresh build instead of leftovers of the\n * build we are leaving. Best-effort: if the Caches API is unavailable or a\n * delete fails, the reload still picks up the new shell (the navigation\n * route is NetworkFirst).\n */\nasync function clearStaleCaches(): Promise<void> {\n try {\n if (!(\"caches\" in window)) return;\n const keys = await window.caches.keys();\n await Promise.all(\n keys\n .filter((key) => key.includes(\"precache\") || key.includes(\"ph-shell\"))\n .map((key) => window.caches.delete(key)),\n );\n } catch (error) {\n logger.warn(\n \"Failed to clear stale caches before update reload @error\",\n error,\n );\n }\n}\n\n/**\n * Detects that the server is serving a different build than the one this\n * page was loaded from (a new deploy) and reloads onto it — once per session\n * per deployed hash. Checked on mount and whenever the tab returns to the\n * foreground, so a deploy that lands while the tab sits open is picked up on\n * the next focus without a manual reload. The in-tab \"new version available\"\n * service-worker prompt (ServiceWorkerUpdatePrompt) remains the opt-in path\n * for workers that are waiting but not yet controlling.\n */\nexport const useCheckLatestVersion = () => {\n useEffect(() => {\n if (\n import.meta.env.MODE === \"development\" ||\n connectConfig.studioMode ||\n !connectConfig.warnOutdatedApp\n ) {\n return;\n }\n\n const checkBuildHash = async () => {\n const status = await getBuildHashStatus();\n if (!status || status.isCurrent) return;\n\n const reloadedFor = window.sessionStorage.getItem(RELOADED_FOR_KEY);\n if (reloadedFor === status.deployedHash) return;\n window.sessionStorage.setItem(RELOADED_FOR_KEY, status.deployedHash);\n\n logger.info(\n \"New deploy detected — reloading from build @currentHash to @deployedHash\",\n status.currentHash,\n status.deployedHash,\n );\n await clearStaleCaches();\n window.location.reload();\n };\n\n void checkBuildHash();\n const onVisibilityChange = () => {\n if (document.visibilityState === \"visible\") void checkBuildHash();\n };\n document.addEventListener(\"visibilitychange\", onVisibilityChange);\n return () => {\n document.removeEventListener(\"visibilitychange\", onVisibilityChange);\n };\n }, []);\n};\n","import { getBuildHash } from \"../utils/build-info.js\";\n\nexport const isMac = window.navigator.appVersion.includes(\"Mac\");\n\nexport interface BuildHashStatus {\n /** Hash baked into the running build. */\n currentHash: string;\n /** Hash the server is currently serving. */\n deployedHash: string;\n /** true when the running build matches what the server serves. */\n isCurrent: boolean;\n}\n\n/**\n * Same-origin build-identity probe. The build bakes a hash of the inputs that\n * determine the deployed content into the bundle (define\n * `PH_CONNECT_BUILD_HASH`, see builder-tools' connectBuildHashPlugin) and\n * emits `build-hash.json` next to the app (served no-cache). Comparing the\n * two tells us whether the server is serving a different build than the one\n * this page was loaded from — the reliable \"a new deploy went out\" signal.\n * Unlike the old GitHub-raw version check it works on localhost (it compares\n * against what the origin actually serves, not a remote branch head) and\n * needs no network beyond the app's own origin.\n *\n * Returns null when there is nothing to compare: dev/studio builds (no hash\n * baked), a server predating `build-hash.json`, an offline fetch, or a\n * malformed body.\n */\nexport const getBuildHashStatus = async (): Promise<BuildHashStatus | null> => {\n const currentHash = getBuildHash();\n if (!currentHash || currentHash === \"unknown\") return null;\n try {\n const result = await fetch(`${import.meta.env.BASE_URL}build-hash.json`, {\n cache: \"no-cache\",\n });\n if (!result.ok) return null;\n const data = (await result.json()) as { hash?: unknown };\n if (typeof data.hash !== \"string\" || !data.hash) return null;\n return {\n currentHash,\n deployedHash: data.hash,\n isCurrent: data.hash === currentHash,\n };\n } catch {\n return null;\n }\n};\n","import { useUser } from \"@powerhousedao/reactor-browser\";\nimport type { User as SentryUser } from \"@sentry/react\";\nimport { useEffect } from \"react\";\nimport { setUser as setSentryUser } from \"../services/sentry.js\";\n\nexport function useSetSentryUser() {\n const user = useUser();\n useEffect(() => {\n let sentryUser: SentryUser | null = null;\n if (user) {\n // saves the user info except the credential\n const { credential: _credential, ...rest } = user;\n sentryUser = { id: rest.did, username: rest.ens?.name, ...rest };\n }\n setSentryUser(sentryUser);\n }, [user]);\n}\n","import { useCheckLatestVersion } from \"@powerhousedao/connect/hooks\";\nimport \"@powerhousedao/connect/i18n\";\nimport { createReactor, useSetSentryUser } from \"@powerhousedao/connect/store\";\nimport {\n detectMigrationMajor,\n detectReactorPgMajor,\n seedPendingPgVersion,\n} from \"@powerhousedao/connect/utils\";\nimport { initTheme } from \"@powerhousedao/reactor-browser\";\nimport type { DocumentModelLib } from \"document-model\";\nimport { type ReactNode } from \"react\";\nimport { applyConnectBranding, loadRuntimeConfig } from \"../runtime-config.js\";\n\nexport async function loadComponent(localPackage?: DocumentModelLib) {\n await seedPendingPgVersion();\n await Promise.all([detectReactorPgMajor(), detectMigrationMajor()]);\n const runtimeConfig = await loadRuntimeConfig();\n applyConnectBranding(runtimeConfig);\n await createReactor(localPackage);\n return {\n default: ({ children }: { children?: ReactNode }) => {\n initTheme();\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useSetSentryUser();\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useCheckLatestVersion();\n return children;\n },\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;AAQA,MAAM,mBAAmB;;;;;;;;;AAUzB,eAAe,mBAAkC;AAC/C,KAAI;AACF,MAAI,EAAE,YAAY,QAAS;EAC3B,MAAM,OAAO,MAAM,OAAO,OAAO,MAAM;AACvC,QAAM,QAAQ,IACZ,KACG,QAAQ,QAAQ,IAAI,SAAS,WAAW,IAAI,IAAI,SAAS,WAAW,CAAC,CACrE,KAAK,QAAQ,OAAO,OAAO,OAAO,IAAI,CAAC,CAC3C;UACM,OAAO;AACd,SAAO,KACL,4DACA,MACD;;;;;;;;;;;;AAaL,MAAa,8BAA8B;AACzC,iBAAgB;AACd,MACE,OAAO,KAAK,IAAI,SAAS,iBACzB,cAAc,cACd,CAAC,cAAc,gBAEf;EAGF,MAAM,iBAAiB,YAAY;GACjC,MAAM,SAAS,MAAM,oBAAoB;AACzC,OAAI,CAAC,UAAU,OAAO,UAAW;AAGjC,OADoB,OAAO,eAAe,QAAQ,iBAAiB,KAC/C,OAAO,aAAc;AACzC,UAAO,eAAe,QAAQ,kBAAkB,OAAO,aAAa;AAEpE,UA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X,oBAAkB;AAElB,yBAAuB;AACvB,SAAO;IAEV","debug_id":"cda88064-1abc-517c-9349-f07e1d755427"}
1
+ {"version":3,"file":"load-DklnT-pD.js","sources":["../src/hooks/useCheckLatestVersion.ts","../src/hooks/utils.ts","../src/store/user.ts","../src/components/load.tsx"],"sourcesContent":["import { connectConfig } from \"@powerhousedao/connect/config\";\nimport { getBuildHashStatus } from \"@powerhousedao/connect/hooks\";\nimport { logger } from \"document-model\";\nimport { useEffect } from \"react\";\n\n// Session-scoped guard: records the deployed hash this tab already reloaded\n// for, so a broken or rolling deploy (server hash keeps changing under us)\n// cannot turn the tab into a reload loop. Cleared implicitly with the tab.\nconst RELOADED_FOR_KEY = \"ph-reloaded-for-build-hash\";\n\n/**\n * Drop the service worker's stale caches (precache + the NetworkFirst shell\n * cache) before reloading onto a new deploy, so the post-reload navigation\n * is answered from the network / fresh build instead of leftovers of the\n * build we are leaving. Best-effort: if the Caches API is unavailable or a\n * delete fails, the reload still picks up the new shell (the navigation\n * route is NetworkFirst).\n */\nasync function clearStaleCaches(): Promise<void> {\n try {\n if (!(\"caches\" in window)) return;\n const keys = await window.caches.keys();\n await Promise.all(\n keys\n .filter((key) => key.includes(\"precache\") || key.includes(\"ph-shell\"))\n .map((key) => window.caches.delete(key)),\n );\n } catch (error) {\n logger.warn(\n \"Failed to clear stale caches before update reload @error\",\n error,\n );\n }\n}\n\n/**\n * Detects that the server is serving a different build than the one this\n * page was loaded from (a new deploy) and reloads onto it — once per session\n * per deployed hash. Checked on mount and whenever the tab returns to the\n * foreground, so a deploy that lands while the tab sits open is picked up on\n * the next focus without a manual reload. The in-tab \"new version available\"\n * service-worker prompt (ServiceWorkerUpdatePrompt) remains the opt-in path\n * for workers that are waiting but not yet controlling.\n */\nexport const useCheckLatestVersion = () => {\n useEffect(() => {\n if (\n import.meta.env.MODE === \"development\" ||\n connectConfig.studioMode ||\n !connectConfig.warnOutdatedApp\n ) {\n return;\n }\n\n const checkBuildHash = async () => {\n const status = await getBuildHashStatus();\n if (!status || status.isCurrent) return;\n\n const reloadedFor = window.sessionStorage.getItem(RELOADED_FOR_KEY);\n if (reloadedFor === status.deployedHash) return;\n window.sessionStorage.setItem(RELOADED_FOR_KEY, status.deployedHash);\n\n logger.info(\n \"New deploy detected — reloading from build @currentHash to @deployedHash\",\n status.currentHash,\n status.deployedHash,\n );\n await clearStaleCaches();\n window.location.reload();\n };\n\n void checkBuildHash();\n const onVisibilityChange = () => {\n if (document.visibilityState === \"visible\") void checkBuildHash();\n };\n document.addEventListener(\"visibilitychange\", onVisibilityChange);\n return () => {\n document.removeEventListener(\"visibilitychange\", onVisibilityChange);\n };\n }, []);\n};\n","import { getBuildHash } from \"../utils/build-info.js\";\n\nexport const isMac = window.navigator.appVersion.includes(\"Mac\");\n\nexport interface BuildHashStatus {\n /** Hash baked into the running build. */\n currentHash: string;\n /** Hash the server is currently serving. */\n deployedHash: string;\n /** true when the running build matches what the server serves. */\n isCurrent: boolean;\n}\n\n/**\n * Same-origin build-identity probe. The build bakes a hash of the inputs that\n * determine the deployed content into the bundle (define\n * `PH_CONNECT_BUILD_HASH`, see builder-tools' connectBuildHashPlugin) and\n * emits `build-hash.json` next to the app (served no-cache). Comparing the\n * two tells us whether the server is serving a different build than the one\n * this page was loaded from — the reliable \"a new deploy went out\" signal.\n * Unlike the old GitHub-raw version check it works on localhost (it compares\n * against what the origin actually serves, not a remote branch head) and\n * needs no network beyond the app's own origin.\n *\n * Returns null when there is nothing to compare: dev/studio builds (no hash\n * baked), a server predating `build-hash.json`, an offline fetch, or a\n * malformed body.\n */\nexport const getBuildHashStatus = async (): Promise<BuildHashStatus | null> => {\n const currentHash = getBuildHash();\n if (!currentHash || currentHash === \"unknown\") return null;\n try {\n const result = await fetch(`${import.meta.env.BASE_URL}build-hash.json`, {\n cache: \"no-cache\",\n });\n if (!result.ok) return null;\n const data = (await result.json()) as { hash?: unknown };\n if (typeof data.hash !== \"string\" || !data.hash) return null;\n return {\n currentHash,\n deployedHash: data.hash,\n isCurrent: data.hash === currentHash,\n };\n } catch {\n return null;\n }\n};\n","import { useUser } from \"@powerhousedao/reactor-browser\";\nimport type { User as SentryUser } from \"@sentry/react\";\nimport { useEffect } from \"react\";\nimport { setUser as setSentryUser } from \"../services/sentry.js\";\n\nexport function useSetSentryUser() {\n const user = useUser();\n useEffect(() => {\n let sentryUser: SentryUser | null = null;\n if (user) {\n // saves the user info except the credential\n const { credential: _credential, ...rest } = user;\n sentryUser = { id: rest.did, username: rest.ens?.name, ...rest };\n }\n setSentryUser(sentryUser);\n }, [user]);\n}\n","import { useCheckLatestVersion } from \"@powerhousedao/connect/hooks\";\nimport \"@powerhousedao/connect/i18n\";\nimport { createReactor, useSetSentryUser } from \"@powerhousedao/connect/store\";\nimport {\n detectMigrationMajor,\n detectReactorPgMajor,\n seedPendingPgVersion,\n} from \"@powerhousedao/connect/utils\";\nimport { initTheme } from \"@powerhousedao/reactor-browser\";\nimport type { DocumentModelLib } from \"document-model\";\nimport { type ReactNode } from \"react\";\nimport { applyConnectBranding, loadRuntimeConfig } from \"../runtime-config.js\";\n\nexport async function loadComponent(localPackage?: DocumentModelLib) {\n await seedPendingPgVersion();\n await Promise.all([detectReactorPgMajor(), detectMigrationMajor()]);\n const runtimeConfig = await loadRuntimeConfig();\n applyConnectBranding(runtimeConfig);\n await createReactor(localPackage);\n return {\n default: ({ children }: { children?: ReactNode }) => {\n initTheme();\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useSetSentryUser();\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useCheckLatestVersion();\n return children;\n },\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;AAQA,MAAM,mBAAmB;;;;;;;;;AAUzB,eAAe,mBAAkC;AAC/C,KAAI;AACF,MAAI,EAAE,YAAY,QAAS;EAC3B,MAAM,OAAO,MAAM,OAAO,OAAO,MAAM;AACvC,QAAM,QAAQ,IACZ,KACG,QAAQ,QAAQ,IAAI,SAAS,WAAW,IAAI,IAAI,SAAS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tB,iBAAgB;EACd,IAAI,aAAgC;AACpC,MAAI,MAAM;GAER,MAAM,EAAE,YAAY,aAAa,GAAG,SAAS;AAC7C,gBAAa;IAAE,IAAI,KAAK;IAAK,UAAU,KAAK,KAAK;IAAM,GAAG;IAAM;;AAElE,UAAc,WAAW;IACxB,CAAC,KAAK,CAAC;;;;ACFZ,eAAsB,cAAc,cAAiC;AACnE,OAAM,sBAAsB;AAC5B,OAAM,QAAQ,IAAI,CAAC,sBAAsB,EAAE,sBAAsB,CAAC,CAAC;AAEnE,sBADsB,MAAM,mBAAmB,CACZ;AACnC,OAAM,cAAc,aAAa;AACjC,QAAO,EACL,UAAU,EAAE,eAAyC;AACnD,aAAW;AAEX,oBAAkB;AAElB,yBAAuB;AACvB,SAAO;IAEV","debug_id":"2364ffcd-df5f-5b83-88fd-b306ec98f26e"}
package/dist/main.js CHANGED
@@ -6,7 +6,7 @@ import { jsx } from "react/jsx-runtime";
6
6
  //#region main.tsx
7
7
  if (!window.ph) window.ph = {};
8
8
  await loadRuntimeConfig();
9
- const { AppLoader } = await import("./app-loader-CQ5T0XnK.js");
9
+ const { AppLoader } = await import("./app-loader-O4FY-lcE.js");
10
10
  createRoot(document.getElementById("root")).render(/* @__PURE__ */ jsx(AppLoader, {}));
11
11
  //#endregion
12
12
 
@@ -1,6 +1,6 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="decf4688-7fc8-5759-8e98-b8d17b31201c")}catch(e){}}();
3
- import { l as invalidateReactorPgMajorCache, m as REACTOR_PGLITE_NAME } from "./connection-state-CedmAXd-.js";
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="80c44266-18c5-5681-aebc-58df7e206589")}catch(e){}}();
3
+ import { l as invalidateReactorPgMajorCache, m as REACTOR_PGLITE_NAME } from "./connection-state-3w4liC1X.js";
4
4
  //#region src/utils/pglite-seed.ts
5
5
  const PENDING_PG_SEED_KEY = "ph:pending-pg-seed";
6
6
  /**
@@ -45,5 +45,5 @@ async function seedPendingPgVersion() {
45
45
  //#endregion
46
46
  export { seedPendingPgVersion as n, PENDING_PG_SEED_KEY as t };
47
47
 
48
- //# sourceMappingURL=pglite-seed-B7bWZwVg.js.map
49
- //# debugId=decf4688-7fc8-5759-8e98-b8d17b31201c
48
+ //# sourceMappingURL=pglite-seed-BqAUvNFw.js.map
49
+ //# debugId=80c44266-18c5-5681-aebc-58df7e206589
@@ -1 +1 @@
1
- {"version":3,"file":"pglite-seed-B7bWZwVg.js","sources":["../src/utils/pglite-seed.ts"],"sourcesContent":["import { invalidateReactorPgMajorCache } from \"./pglite-runtime.js\";\nimport { REACTOR_PGLITE_NAME } from \"./storage-namespace.js\";\n\nexport const PENDING_PG_SEED_KEY = \"ph:pending-pg-seed\";\n\n/**\n * If the Debug Inspector requested a forced PG version reset, this runs\n * before the reactor is created on the subsequent page load: opens a fresh\n * PGlite of the requested major against the reactor data dir, lets `initdb`\n * populate `PG_VERSION`, then closes. The next step of app boot then\n * detects this fresh data dir and picks the matching runtime.\n */\nexport async function seedPendingPgVersion(): Promise<void> {\n const raw = localStorage.getItem(PENDING_PG_SEED_KEY);\n if (!raw) return;\n\n const major = parseInt(raw, 10);\n console.info(`[pglite-seed] Seeding fresh PG${major} data dir...`);\n\n try {\n if (major === 16) {\n const { PGlite } = await import(\"pglite-legacy-02\");\n const pg = new PGlite(`idb://${REACTOR_PGLITE_NAME}`);\n try {\n await pg.waitReady;\n } finally {\n await pg.close();\n }\n } else if (major === 17) {\n const { PGlite } = await import(\"@electric-sql/pglite\");\n const pg = new PGlite(`idb://${REACTOR_PGLITE_NAME}`);\n try {\n await pg.waitReady;\n } finally {\n await pg.close();\n }\n } else {\n console.warn(`[pglite-seed] Unsupported version ${raw}, skipping`);\n return;\n }\n console.info(`[pglite-seed] Seeded PG${major} data dir.`);\n } finally {\n localStorage.removeItem(PENDING_PG_SEED_KEY);\n invalidateReactorPgMajorCache();\n }\n}\n"],"names":[],"mappings":";;;;AAGA,MAAa,sBAAsB;;;;;;;;AASnC,eAAsB,uBAAsC;CAC1D,MAAM,MAAM,aAAa,QAAQ,oBAAoB;AACrD,KAAI,CAAC,IAAK;CAEV,MAAM,QAAQ,SAAS,KAAK,GAAG;AAC/B,SAAQ,KAAK,iCAAiC,MAAM,cAAc;AAElE,KAAI;AACF,MAAI,UAAU,IAAI;GAChB,MAAM,EAAE,WAAW,MAAM,OAAO;GAChC,MAAM,KAAK,IAAI,OAAO,SAAS,sBAAsB;AACrD,OAAI;AACF,UAAM,GAAG;aACD;AACR,UAAM,GAAG,OAAO;;aAET,UAAU,IAAI;GACvB,MAAM,EAAE,WAAW,MAAM,OAAO;GAChC,MAAM,KAAK,IAAI,OAAO,SAAS,sBAAsB;AACrD,OAAI;AACF,UAAM,GAAG;aACD;AACR,UAAM,GAAG,OAAO;;SAEb;AACL,WAAQ,KAAK,qCAAqC,IAAI,YAAY;AAClE;;AAEF,UAAQ,KAAK,0BAA0B,MAAM,YAAY;WACjD;AACR,eAAa,WAAW,oBAAoB;AAC5C,iCAA+B","debug_id":"decf4688-7fc8-5759-8e98-b8d17b31201c"}
1
+ {"version":3,"file":"pglite-seed-BqAUvNFw.js","sources":["../src/utils/pglite-seed.ts"],"sourcesContent":["import { invalidateReactorPgMajorCache } from \"./pglite-runtime.js\";\nimport { REACTOR_PGLITE_NAME } from \"./storage-namespace.js\";\n\nexport const PENDING_PG_SEED_KEY = \"ph:pending-pg-seed\";\n\n/**\n * If the Debug Inspector requested a forced PG version reset, this runs\n * before the reactor is created on the subsequent page load: opens a fresh\n * PGlite of the requested major against the reactor data dir, lets `initdb`\n * populate `PG_VERSION`, then closes. The next step of app boot then\n * detects this fresh data dir and picks the matching runtime.\n */\nexport async function seedPendingPgVersion(): Promise<void> {\n const raw = localStorage.getItem(PENDING_PG_SEED_KEY);\n if (!raw) return;\n\n const major = parseInt(raw, 10);\n console.info(`[pglite-seed] Seeding fresh PG${major} data dir...`);\n\n try {\n if (major === 16) {\n const { PGlite } = await import(\"pglite-legacy-02\");\n const pg = new PGlite(`idb://${REACTOR_PGLITE_NAME}`);\n try {\n await pg.waitReady;\n } finally {\n await pg.close();\n }\n } else if (major === 17) {\n const { PGlite } = await import(\"@electric-sql/pglite\");\n const pg = new PGlite(`idb://${REACTOR_PGLITE_NAME}`);\n try {\n await pg.waitReady;\n } finally {\n await pg.close();\n }\n } else {\n console.warn(`[pglite-seed] Unsupported version ${raw}, skipping`);\n return;\n }\n console.info(`[pglite-seed] Seeded PG${major} data dir.`);\n } finally {\n localStorage.removeItem(PENDING_PG_SEED_KEY);\n invalidateReactorPgMajorCache();\n }\n}\n"],"names":[],"mappings":";;;;AAGA,MAAa,sBAAsB;;;;;;;;AASnC,eAAsB,uBAAsC;CAC1D,MAAM,MAAM,aAAa,QAAQ,oBAAoB;AACrD,KAAI,CAAC,IAAK;CAEV,MAAM,QAAQ,SAAS,KAAK,GAAG;AAC/B,SAAQ,KAAK,iCAAiC,MAAM,cAAc;AAElE,KAAI;AACF,MAAI,UAAU,IAAI;GAChB,MAAM,EAAE,WAAW,MAAM,OAAO;GAChC,MAAM,KAAK,IAAI,OAAO,SAAS,sBAAsB;AACrD,OAAI;AACF,UAAM,GAAG;aACD;AACR,UAAM,GAAG,OAAO;;aAET,UAAU,IAAI;GACvB,MAAM,EAAE,WAAW,MAAM,OAAO;GAChC,MAAM,KAAK,IAAI,OAAO,SAAS,sBAAsB;AACrD,OAAI;AACF,UAAM,GAAG;aACD;AACR,UAAM,GAAG,OAAO;;SAEb;AACL,WAAQ,KAAK,qCAAqC,IAAI,YAAY;AAClE;;AAEF,UAAQ,KAAK,0BAA0B,MAAM,YAAY;WACjD;AACR,eAAa,WAAW,oBAAoB;AAC5C,iCAA+B","debug_id":"80c44266-18c5-5681-aebc-58df7e206589"}
@@ -1,6 +1,6 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="7ee144fc-a693-58c8-af52-d8a71988cf51")}catch(e){}}();
3
- import { r as connectConfig } from "./connect.config-ZWoeCSit.js";
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="dbbeb3d8-22d7-5df6-a263-a0c970e9578b")}catch(e){}}();
3
+ import { r as connectConfig } from "./connect.config-DaHDEUrw.js";
4
4
  import { useSyncExternalStore } from "react";
5
5
  //#region src/hooks/useIsEmbedded.ts
6
6
  /**
@@ -100,5 +100,5 @@ const useCookieBanner = () => {
100
100
  //#endregion
101
101
  export { useIsEmbedded as i, useCookieBanner as n, getIsEmbedded as r, useAcceptedCookies as t };
102
102
 
103
- //# sourceMappingURL=preferences-store-CUBzmf5F.js.map
104
- //# debugId=7ee144fc-a693-58c8-af52-d8a71988cf51
103
+ //# sourceMappingURL=preferences-store-_5Cw4_YV.js.map
104
+ //# debugId=dbbeb3d8-22d7-5df6-a263-a0c970e9578b
@@ -1 +1 @@
1
- {"version":3,"file":"preferences-store-CUBzmf5F.js","sources":["../src/hooks/useIsEmbedded.ts","../src/hooks/preferences-store.ts"],"sourcesContent":["/**\n * Detects whether Connect is being rendered inside another app (e.g. inside\n * an iframe in the vetra-cli drive editor). When `?embed=1` is present in the\n * URL, chrome that doesn't make sense in the embedded context — the cookie\n * banner, the outer sidebar — is suppressed.\n */\nexport function getIsEmbedded(): boolean {\n if (typeof window === \"undefined\") return false;\n try {\n const params = new URLSearchParams(window.location.search);\n const value = params.get(\"embed\");\n return value !== null && value !== \"0\" && value !== \"false\";\n } catch {\n return false;\n }\n}\n\nexport function useIsEmbedded(): boolean {\n return getIsEmbedded();\n}\n","import { connectConfig } from \"@powerhousedao/connect/config\";\nimport { useSyncExternalStore } from \"react\";\n\nimport { getIsEmbedded } from \"./useIsEmbedded.js\";\n\nconst namespace = connectConfig.routerBasename;\n\n/**\n * Block-proof home for Connect's consent and banner state.\n *\n * The file name deliberately avoids words that appear in ad-blocker\n * filter lists (cookie, banner, consent, analytics, ...). Modules in the\n * app's critical import chain import from here, never from files whose\n * URLs match those filters. If an ad blocker blocks the lazy-loaded\n * cookie-banner chunk instead, the app simply never shows the banner —\n * which leaves the flags at their rejected defaults (analytics off) —\n * and everything else keeps working.\n */\n\n// ---------------------------------------------------------------------------\n// Accepted cookies (analytics / marketing / functional)\n// ---------------------------------------------------------------------------\n\nexport const ACCEPTED_COOKIES_KEY_STORAGE = `${namespace}:acceptedCookies`;\n\nexport interface AcceptedCookies {\n analytics: boolean;\n marketing: boolean;\n functional: boolean;\n}\n\nconst REJECTED_COOKIES: AcceptedCookies = {\n analytics: false,\n marketing: false,\n functional: false,\n};\n\nconst cookieListeners = new Set<() => void>();\n\nlet acceptedCookies: AcceptedCookies = getInitialAcceptedCookies();\n\nfunction getInitialAcceptedCookies(): AcceptedCookies {\n try {\n const value = localStorage.getItem(ACCEPTED_COOKIES_KEY_STORAGE);\n return value ? (JSON.parse(value) as AcceptedCookies) : REJECTED_COOKIES;\n } catch {\n return REJECTED_COOKIES;\n }\n}\n\nfunction subscribeAcceptedCookies(fn: () => void) {\n cookieListeners.add(fn);\n return () => {\n cookieListeners.delete(fn);\n };\n}\n\nfunction getAcceptedCookies(): AcceptedCookies {\n return acceptedCookies;\n}\n\nexport function setAcceptedCookies(\n setter: (prev: AcceptedCookies) => AcceptedCookies,\n) {\n acceptedCookies = setter(acceptedCookies);\n localStorage.setItem(\n ACCEPTED_COOKIES_KEY_STORAGE,\n JSON.stringify(acceptedCookies),\n );\n cookieListeners.forEach((fn) => fn());\n}\n\nexport const useAcceptedCookies = () => {\n const cookies = useSyncExternalStore(\n subscribeAcceptedCookies,\n getAcceptedCookies,\n getAcceptedCookies,\n );\n return [cookies, setAcceptedCookies] as const;\n};\n\n// ---------------------------------------------------------------------------\n// Cookie banner visibility\n// ---------------------------------------------------------------------------\n\nexport const COOKIE_BANNER_KEY_STORAGE = `${namespace}:display-cookie-banner`;\n\nconst bannerListeners = new Set<() => void>();\n\nlet bannerShown = getInitialBannerShown();\n\nfunction getInitialBannerShown(): boolean {\n if (getIsEmbedded()) return false;\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 subscribeBannerShown(fn: () => void) {\n bannerListeners.add(fn);\n return () => {\n bannerListeners.delete(fn);\n };\n}\n\nfunction getBannerShown(): boolean {\n return bannerShown;\n}\n\nexport function setBannerShown(state: boolean) {\n bannerShown = state;\n localStorage.setItem(COOKIE_BANNER_KEY_STORAGE, JSON.stringify(state));\n bannerListeners.forEach((fn) => fn());\n}\n\nexport const useCookieBanner = () => {\n const shown = useSyncExternalStore(\n subscribeBannerShown,\n getBannerShown,\n getBannerShown,\n );\n return [shown, setBannerShown] as const;\n};\n"],"names":[],"mappings":";;;;;;;;;;;AAMA,SAAgB,gBAAyB;AACvC,KAAI,OAAO,WAAW,YAAa,QAAO;AAC1C,KAAI;EAEF,MAAM,QADS,IAAI,gBAAgB,OAAO,SAAS,OAAO,CACrC,IAAI,QAAQ;AACjC,SAAO,UAAU,QAAQ,UAAU,OAAO,UAAU;SAC9C;AACN,SAAO;;;AAIX,SAAgB,gBAAyB;AACvC,QAAO,eAAe;;;;ACbxB,MAAM,YAAY,cAAc;;;;;;;;;;;;AAkBhC,MAAa,+BAA+B,GAAG,UAAU;AAQzD,MAAM,mBAAoC;CACxC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Cw4_YV.js","sources":["../src/hooks/useIsEmbedded.ts","../src/hooks/preferences-store.ts"],"sourcesContent":["/**\n * Detects whether Connect is being rendered inside another app (e.g. inside\n * an iframe in the vetra-cli drive editor). When `?embed=1` is present in the\n * URL, chrome that doesn't make sense in the embedded context — the cookie\n * banner, the outer sidebar — is suppressed.\n */\nexport function getIsEmbedded(): boolean {\n if (typeof window === \"undefined\") return false;\n try {\n const params = new URLSearchParams(window.location.search);\n const value = params.get(\"embed\");\n return value !== null && value !== \"0\" && value !== \"false\";\n } catch {\n return false;\n }\n}\n\nexport function useIsEmbedded(): boolean {\n return getIsEmbedded();\n}\n","import { connectConfig } from \"@powerhousedao/connect/config\";\nimport { useSyncExternalStore } from \"react\";\n\nimport { getIsEmbedded } from \"./useIsEmbedded.js\";\n\nconst namespace = connectConfig.routerBasename;\n\n/**\n * Block-proof home for Connect's consent and banner state.\n *\n * The file name deliberately avoids words that appear in ad-blocker\n * filter lists (cookie, banner, consent, analytics, ...). Modules in the\n * app's critical import chain import from here, never from files whose\n * URLs match those filters. If an ad blocker blocks the lazy-loaded\n * cookie-banner chunk instead, the app simply never shows the banner —\n * which leaves the flags at their rejected defaults (analytics off) —\n * and everything else keeps working.\n */\n\n// ---------------------------------------------------------------------------\n// Accepted cookies (analytics / marketing / functional)\n// ---------------------------------------------------------------------------\n\nexport const ACCEPTED_COOKIES_KEY_STORAGE = `${namespace}:acceptedCookies`;\n\nexport interface AcceptedCookies {\n analytics: boolean;\n marketing: boolean;\n functional: boolean;\n}\n\nconst REJECTED_COOKIES: AcceptedCookies = {\n analytics: false,\n marketing: false,\n functional: false,\n};\n\nconst cookieListeners = new Set<() => void>();\n\nlet acceptedCookies: AcceptedCookies = getInitialAcceptedCookies();\n\nfunction getInitialAcceptedCookies(): AcceptedCookies {\n try {\n const value = localStorage.getItem(ACCEPTED_COOKIES_KEY_STORAGE);\n return value ? (JSON.parse(value) as AcceptedCookies) : REJECTED_COOKIES;\n } catch {\n return REJECTED_COOKIES;\n }\n}\n\nfunction subscribeAcceptedCookies(fn: () => void) {\n cookieListeners.add(fn);\n return () => {\n cookieListeners.delete(fn);\n };\n}\n\nfunction getAcceptedCookies(): AcceptedCookies {\n return acceptedCookies;\n}\n\nexport function setAcceptedCookies(\n setter: (prev: AcceptedCookies) => AcceptedCookies,\n) {\n acceptedCookies = setter(acceptedCookies);\n localStorage.setItem(\n ACCEPTED_COOKIES_KEY_STORAGE,\n JSON.stringify(acceptedCookies),\n );\n cookieListeners.forEach((fn) => fn());\n}\n\nexport const useAcceptedCookies = () => {\n const cookies = useSyncExternalStore(\n subscribeAcceptedCookies,\n getAcceptedCookies,\n getAcceptedCookies,\n );\n return [cookies, setAcceptedCookies] as const;\n};\n\n// ---------------------------------------------------------------------------\n// Cookie banner visibility\n// ---------------------------------------------------------------------------\n\nexport const COOKIE_BANNER_KEY_STORAGE = `${namespace}:display-cookie-banner`;\n\nconst bannerListeners = new Set<() => void>();\n\nlet bannerShown = getInitialBannerShown();\n\nfunction getInitialBannerShown(): boolean {\n if (getIsEmbedded()) return false;\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 subscribeBannerShown(fn: () => void) {\n bannerListeners.add(fn);\n return () => {\n bannerListeners.delete(fn);\n };\n}\n\nfunction getBannerShown(): boolean {\n return bannerShown;\n}\n\nexport function setBannerShown(state: boolean) {\n bannerShown = state;\n localStorage.setItem(COOKIE_BANNER_KEY_STORAGE, JSON.stringify(state));\n bannerListeners.forEach((fn) => fn());\n}\n\nexport const useCookieBanner = () => {\n const shown = useSyncExternalStore(\n subscribeBannerShown,\n getBannerShown,\n getBannerShown,\n );\n return [shown, setBannerShown] as const;\n};\n"],"names":[],"mappings":";;;;;;;;;;;AAMA,SAAgB,gBAAyB;AACvC,KAAI,OAAO,WAAW,YAAa,QAAO;AAC1C,KAAI;EAEF,MAAM,QADS,IAAI,gBAAgB,OAAO,SAAS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;AACd,cAAa,QAAQ,2BAA2B,KAAK,UAAU,MAAM,CAAC;AACtE,iBAAgB,SAAS,OAAO,IAAI,CAAC;;AAGvC,MAAa,wBAAwB;AAMnC,QAAO,CALO,qBACZ,sBACA,gBACA,eACD,EACc,eAAe","debug_id":"dbbeb3d8-22d7-5df6-a263-a0c970e9578b"}
@@ -1,11 +1,11 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="d85b5365-a991-50e4-9633-e5d06784d3d2")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="90805a4d-c977-57fb-be3b-622efa28e561")}catch(e){}}();
3
3
  import { n as getRuntimeConfig } from "./runtime-config-DL3QjcfM.js";
4
4
  import { a as resolvePgMajorForRuntime, r as loadPGliteModule } from "./pglite-major-B39aOEiE.js";
5
- import { i as getVersion, n as getGitSha } from "./build-info-sJS7DZJh.js";
6
- import { n as buildPHGlobalConfig, o as phGlobalConfig } from "./connect.config-ZWoeCSit.js";
5
+ import { i as getVersion, n as getGitSha } from "./build-info-CptFmVjb.js";
6
+ import { n as buildPHGlobalConfig, o as phGlobalConfig } from "./connect.config-DaHDEUrw.js";
7
7
  import { t as refreshPwaManifestLink } from "./pwa-manifest-link-DIgOSo2Q.js";
8
- import { a as detectReactorPgMajor, h as RELATIONAL_PGLITE_NAME, m as REACTOR_PGLITE_NAME, n as setWorkerConnectionStatus, o as detectRelationalPgMajor, p as REACTOR_INSTANCE_NAMESPACE } from "./connection-state-CedmAXd-.js";
8
+ import { a as detectReactorPgMajor, h as RELATIONAL_PGLITE_NAME, m as REACTOR_PGLITE_NAME, n as setWorkerConnectionStatus, o as detectRelationalPgMajor, p as REACTOR_INSTANCE_NAMESPACE } from "./connection-state-3w4liC1X.js";
9
9
  import { r as toast } from "./toast-BXIGd4Eb.js";
10
10
  import { PWA_IDB_KEY, PWA_IDB_NAME, PWA_IDB_STORE, PWA_IDB_VERSION, mergePwaConfig, withInferredCategory } from "@powerhousedao/shared/connect";
11
11
  import { createRelationalDb } from "@powerhousedao/shared/processors";
@@ -13,7 +13,7 @@ import { DocumentModelRegistry, DocumentModelResolver, ReactorEventTypes, create
13
13
  import { MessageRouter, RPC_PROTOCOL_VERSION, SyncManagerProxy, connectReactorClient, createInspectorProxy, createPortTransport, createReactorEventBusProxy, createRelationalPgliteProxy, createWorkerAdminClient, postReactorIdentity } from "@powerhousedao/reactor-browser/rpc";
14
14
  import { Kysely } from "kysely";
15
15
  import { PGliteDialect } from "kysely-pglite-dialect";
16
- import { BrowserLocalStorage, ChannelScheme as ChannelScheme$1, DRIVE_DOCUMENT_TYPES, DocumentCache, DocumentChangeType, ReactorBuilder as ReactorBuilder$1, ReactorClientBuilder as ReactorClientBuilder$1, RegistryClient, addPHEventHandlers, addRemoteDrive, createAnalyticsStore, extractDriveSlugFromPath, extractNodeSlugFromPath, getDrives, isDriveAuthError, login, refreshReactorDataClient, setAttachmentService, setDefaultPHGlobalConfig, setDocumentCache, setDriveMetadata, setDrives, setFeatures, setPGliteDB, setPHToast, setPackageDiscoveryService, setReactorClient, setReactorClientModule, setRenown, setSelectedDrive, setSelectedNode, setVetraPackageManager, waitForDocumentReady } from "@powerhousedao/reactor-browser";
16
+ import { BrowserLocalStorage, ChannelScheme as ChannelScheme$1, DRIVE_DOCUMENT_TYPES, DocumentCache, DocumentChangeType, ReactorBuilder as ReactorBuilder$1, ReactorClientBuilder as ReactorClientBuilder$1, RegistryClient, addDrive, addPHEventHandlers, addRemoteDrive, createAnalyticsStore, extractDriveSlugFromPath, extractNodeSlugFromPath, getDrives, isDriveAuthError, login, refreshReactorDataClient, setAttachmentService, setDefaultPHGlobalConfig, setDocumentCache, setDriveMetadata, setDrives, setFeatures, setPGliteDB, setPHToast, setPackageDiscoveryService, setReactorClient, setReactorClientModule, setRenown, setSelectedDrive, setSelectedNode, setVetraPackageManager, waitForDocumentReady } from "@powerhousedao/reactor-browser";
17
17
  import { ConsoleLogger, logger, setLogLevel as setLogLevel$1 } from "document-model";
18
18
  import { BrowserKeyStorage, RenownBuilder, RenownCryptoBuilder, createSignatureVerifier } from "@renown/sdk";
19
19
  import { PwaConfigSchema } from "@powerhousedao/shared/document-model";
@@ -183,40 +183,74 @@ function getDefaultDrives(runtimeConfig) {
183
183
  * Add default drives for the new reactor via sync manager.
184
184
  *
185
185
  * Drives register concurrently so a slow or unreachable drive can't delay the
186
- * others — in particular the one the URL slug resolves to. Retries with linear
187
- * backoff to handle the common race where Connect's dev server is ready before
188
- * the switchboard has finished binding its port.
186
+ * others — in particular the one the URL slug resolves to. Remote drives
187
+ * retry with linear backoff to handle the common race where Connect's dev
188
+ * server is ready before the switchboard has finished binding its port.
189
189
  *
190
- * @param drives - Array of drive objects with url, optional name and icon
190
+ * Each entry is either a remote drive (a URL registered with the sync
191
+ * manager, waited on for initial backfill) or a local drive (created once in
192
+ * this browser's local reactor; its fixed id makes later boots skip it).
193
+ *
194
+ * @param drives - Array of default-drive entries
191
195
  */
192
196
  async function addDefaultDrivesForNewReactor(drives) {
197
+ await Promise.all(drives.map((drive) => "url" in drive ? addRemoteDefaultDrive(drive) : addLocalDefaultDrive(drive)));
198
+ }
199
+ async function addRemoteDefaultDrive(drive) {
193
200
  const MAX_ATTEMPTS = 3;
194
201
  const BACKOFF_MS = 2e3;
195
- await Promise.all(drives.map(async (drive) => {
196
- let driveId;
197
- for (let attempt = 1; attempt <= MAX_ATTEMPTS; attempt++) try {
198
- driveId = await addRemoteDrive(drive.url);
199
- break;
200
- } catch (error) {
201
- if (isDriveAuthError(error)) break;
202
- if (attempt === MAX_ATTEMPTS) console.error(`Failed to add default drive ${drive.url} after ${MAX_ATTEMPTS} attempts:`, error);
203
- else {
204
- const delay = BACKOFF_MS * attempt;
205
- console.warn(`Default drive ${drive.url} not reachable (attempt ${attempt}/${MAX_ATTEMPTS}), retrying in ${delay}ms...`);
206
- await new Promise((resolve) => setTimeout(resolve, delay));
207
- }
202
+ let driveId;
203
+ for (let attempt = 1; attempt <= MAX_ATTEMPTS; attempt++) try {
204
+ driveId = await addRemoteDrive(drive.url);
205
+ break;
206
+ } catch (error) {
207
+ if (isDriveAuthError(error)) break;
208
+ if (attempt === MAX_ATTEMPTS) console.error(`Failed to add default drive ${drive.url} after ${MAX_ATTEMPTS} attempts:`, error);
209
+ else {
210
+ const delay = BACKOFF_MS * attempt;
211
+ console.warn(`Default drive ${drive.url} not reachable (attempt ${attempt}/${MAX_ATTEMPTS}), retrying in ${delay}ms...`);
212
+ await new Promise((resolve) => setTimeout(resolve, delay));
208
213
  }
209
- if (driveId && (drive.name || drive.icon)) try {
210
- const reactorClient = window.ph?.reactorClientModule?.client;
211
- if (reactorClient) await waitForDocumentReady(reactorClient, driveId, { timeoutMs: 15e3 });
212
- await setDriveMetadata(driveId, {
213
- name: drive.name,
214
- icon: drive.icon
215
- });
216
- } catch (error) {
217
- console.warn(`Default drive ${drive.url} was added but metadata update failed:`, error);
214
+ }
215
+ if (driveId && (drive.name || drive.icon)) try {
216
+ const reactorClient = window.ph?.reactorClientModule?.client;
217
+ if (reactorClient) await waitForDocumentReady(reactorClient, driveId, { timeoutMs: 15e3 });
218
+ await setDriveMetadata(driveId, {
219
+ name: drive.name,
220
+ icon: drive.icon
221
+ });
222
+ } catch (error) {
223
+ console.warn(`Default drive ${drive.url} was added but metadata update failed:`, error);
224
+ }
225
+ }
226
+ /**
227
+ * Create a configured local default drive in this browser's local reactor.
228
+ * The drive is only created when the configured id is not already taken, so
229
+ * repeated boots are idempotent and a drive the user deleted stays deleted.
230
+ * Name and icon are written straight into the created document's global state
231
+ * (no setDriveMetadata round-trip), and `app` maps to the drive's preferred
232
+ * editor.
233
+ */
234
+ async function addLocalDefaultDrive(drive) {
235
+ if (!drive.id) {
236
+ console.error("Ignoring local default drive with no id:", JSON.stringify(drive));
237
+ return;
238
+ }
239
+ try {
240
+ const reactorClient = window.ph?.reactorClientModule?.client;
241
+ if (reactorClient) {
242
+ if (await reactorClient.isDocumentIdTaken(drive.id)) return;
218
243
  }
219
- }));
244
+ await addDrive({
245
+ id: drive.id,
246
+ global: {
247
+ name: drive.name ?? "",
248
+ icon: drive.icon ?? null
249
+ }
250
+ }, drive.app);
251
+ } catch (error) {
252
+ console.error(`Failed to create local default drive ${drive.id}:`, error);
253
+ }
220
254
  }
221
255
  //#endregion
222
256
  //#region src/feature-flags.ts
@@ -1417,5 +1451,5 @@ function getDriveUrl() {
1417
1451
  //#endregion
1418
1452
  export { createReactor as n, clearReactorStorage as t };
1419
1453
 
1420
- //# sourceMappingURL=reactor-BfFp2Znq.js.map
1421
- //# debugId=d85b5365-a991-50e4-9633-e5d06784d3d2
1454
+ //# sourceMappingURL=reactor-QvQ0Fgkc.js.map
1455
+ //# debugId=90805a4d-c977-57fb-be3b-622efa28e561