@powerhousedao/connect 6.2.3-dev.30 → 6.2.3-dev.32
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/{ClearStorageModal-AdZSIFdW.js → ClearStorageModal-D_qIH8xO.js} +4 -4
- package/dist/{ClearStorageModal-AdZSIFdW.js.map → ClearStorageModal-D_qIH8xO.js.map} +1 -1
- package/dist/{DebugSettingsModal-CXpPkAlX.js → DebugSettingsModal-CqTKcFT6.js} +6 -6
- package/dist/{DebugSettingsModal-CXpPkAlX.js.map → DebugSettingsModal-CqTKcFT6.js.map} +1 -1
- package/dist/{InspectorModal-70hotpKN.js → InspectorModal-tGsfYXkd.js} +6 -6
- package/dist/{InspectorModal-70hotpKN.js.map → InspectorModal-tGsfYXkd.js.map} +1 -1
- package/dist/{OpenFileDocumentsModal-CiFLugng.js → OpenFileDocumentsModal-DuMkAI98.js} +4 -4
- package/dist/{OpenFileDocumentsModal-CiFLugng.js.map → OpenFileDocumentsModal-DuMkAI98.js.map} +1 -1
- package/dist/{SettingsModal-C_BAKXH8.js → SettingsModal-B7cyFF6I.js} +6 -6
- package/dist/{SettingsModal-C_BAKXH8.js.map → SettingsModal-B7cyFF6I.js.map} +1 -1
- package/dist/{app-loader-DO63EGMg.js → app-loader-DMtilkt3.js} +14 -14
- package/dist/{app-loader-DO63EGMg.js.map → app-loader-DMtilkt3.js.map} +1 -1
- package/dist/app-loader-DSuZw3NZ.js +4 -0
- package/dist/{build-info-Bk5Cnmdw.js → build-info-CQAER_nk.js} +5 -5
- package/dist/{build-info-Bk5Cnmdw.js.map → build-info-CQAER_nk.js.map} +1 -1
- package/dist/{components-D2qlT90T.js → components-DOnhm8ra.js} +3 -3
- package/dist/{connect.config-Dgs13R1s.js → connect.config-CaXMoB42.js} +20 -9
- package/dist/connect.config-CaXMoB42.js.map +1 -0
- package/dist/{connection-state-Cy8xRCm_.js → connection-state-DJX_vUhI.js} +4 -4
- package/dist/{connection-state-Cy8xRCm_.js.map → connection-state-DJX_vUhI.js.map} +1 -1
- package/dist/{cookie-banner-CSF930bl.js → cookie-banner-BxXvPdIY.js} +4 -4
- package/dist/{cookie-banner-CSF930bl.js.map → cookie-banner-BxXvPdIY.js.map} +1 -1
- package/dist/{load-BZFKfZTj.js → load-uNwKzH6m.js} +8 -8
- package/dist/{load-BZFKfZTj.js.map → load-uNwKzH6m.js.map} +1 -1
- package/dist/main.js +1 -1
- package/dist/{pglite-seed-D6fqQApT.js → pglite-seed-AR1MKM1R.js} +4 -4
- package/dist/{pglite-seed-D6fqQApT.js.map → pglite-seed-AR1MKM1R.js.map} +1 -1
- package/dist/{preferences-store-Bekp7tv-.js → preferences-store-DZUIAkHE.js} +4 -4
- package/dist/{preferences-store-Bekp7tv-.js.map → preferences-store-DZUIAkHE.js.map} +1 -1
- package/dist/{reactor-DUv4N4CY.js → reactor-CHFsGnJ2.js} +6 -6
- package/dist/{reactor-DUv4N4CY.js.map → reactor-CHFsGnJ2.js.map} +1 -1
- package/dist/{registerServiceWorker-Cy1G2rCq.js → registerServiceWorker-smkROQhm.js} +4 -4
- package/dist/{registerServiceWorker-Cy1G2rCq.js.map → registerServiceWorker-smkROQhm.js.map} +1 -1
- package/dist/start-connect.js +1 -1
- package/dist/style.css +151 -19
- package/package.json +13 -13
- package/dist/app-loader-BqUYTF_8.js +0 -4
- package/dist/connect.config-Dgs13R1s.js.map +0 -1
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { t as AppLoader } from "./app-loader-DMtilkt3.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]="a3326a0b-12e3-5748-9b51-ddf32c629492")}catch(e){}}();
|
|
4
|
+
//# debugId=a3326a0b-12e3-5748-9b51-ddf32c629492
|
|
@@ -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]="
|
|
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]="1315ffe2-3a33-535e-84e1-f6055f2fc304")}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.3-dev.
|
|
6
|
+
return "6.2.3-dev.32";
|
|
7
7
|
}
|
|
8
8
|
function getGitSha() {
|
|
9
|
-
return "
|
|
9
|
+
return "3bdb27cbd6657352618b48ad92d708e2e5326160";
|
|
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-
|
|
28
|
-
//# debugId=
|
|
27
|
+
//# sourceMappingURL=build-info-CQAER_nk.js.map
|
|
28
|
+
//# debugId=1315ffe2-3a33-535e-84e1-f6055f2fc304
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-info-
|
|
1
|
+
{"version":3,"file":"build-info-CQAER_nk.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;CACS,OAAA;AAM9C;AAEA,SAAgB,YAAoB;CACU,OAAA;AAE9C;;;;;;;AAQA,SAAgB,eAAuB;CACrC,IAAI,OAAO,0BAA0B,aACnC,OAAO;CACT,OAAO;AACT;AAEA,SAAgB,YAA2B;CACzC,OAAO,aAAa,UAAU,CAAC;AACjC","debug_id":"1315ffe2-3a33-535e-84e1-f6055f2fc304"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as AppSkeleton } from "./app-skeleton--Me5zlSz.js";
|
|
2
|
-
import { _ as EditorLoader, a as Root, b as Analytics, c as DriveIcon, g as AppContainer, i as Router, l as DotsLoader, n as Sidebar, o as Footer, r as SearchBar, s as DocumentEditor, t as AppLoader, u as App, v as DocumentEditorContainer, y as OpenPanel } from "./app-loader-
|
|
2
|
+
import { _ as EditorLoader, a as Root, b as Analytics, c as DriveIcon, g as AppContainer, i as Router, l as DotsLoader, n as Sidebar, o as Footer, r as SearchBar, s as DocumentEditor, t as AppLoader, u as App, v as DocumentEditorContainer, y as OpenPanel } from "./app-loader-DMtilkt3.js";
|
|
3
3
|
export { Analytics, App, AppContainer, AppLoader, AppSkeleton, DocumentEditor, DocumentEditorContainer, DotsLoader, DriveIcon, EditorLoader, Footer, OpenPanel, Root, Router, SearchBar, Sidebar };
|
|
4
|
-
!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]="
|
|
5
|
-
//# debugId=
|
|
4
|
+
!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]="797a6103-79cc-52a9-89e8-79befedfb706")}catch(e){}}();
|
|
5
|
+
//# debugId=797a6103-79cc-52a9-89e8-79befedfb706
|
|
@@ -1,9 +1,25 @@
|
|
|
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]="
|
|
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]="393ad854-91a3-56dd-a42b-613d747ff54e")}catch(e){}}();
|
|
3
3
|
import { n as getRuntimeConfig } from "./runtime-config-DtJIUgYw.js";
|
|
4
4
|
import { loadRuntimeEnv, normalizeBasePath } from "@powerhousedao/shared/connect";
|
|
5
5
|
import { setLogLevel } from "@powerhousedao/reactor-browser";
|
|
6
6
|
import { logger } from "document-model";
|
|
7
|
+
//#region src/utils/openpanel-config.ts
|
|
8
|
+
/**
|
|
9
|
+
* Resolve Connect's OpenPanel settings. The runtime config
|
|
10
|
+
* (`connect.openPanel`, settable per deploy via PH_CONNECT_CONFIG_JSON) wins;
|
|
11
|
+
* the build-time PH_CONNECT_OPENPANEL_* env is the fallback so builds that
|
|
12
|
+
* bake it keep working. An empty clientId leaves OpenPanel disabled.
|
|
13
|
+
*/
|
|
14
|
+
function resolveOpenPanelConfig(runtime, env) {
|
|
15
|
+
return {
|
|
16
|
+
clientId: runtime?.clientId || env.PH_CONNECT_OPENPANEL_CLIENT_ID || "",
|
|
17
|
+
apiUrl: runtime?.apiUrl || env.PH_CONNECT_OPENPANEL_API_URL || void 0,
|
|
18
|
+
trackUiEvents: runtime?.trackUiEvents ?? env.PH_CONNECT_OPENPANEL_TRACK_UI_EVENTS,
|
|
19
|
+
trackOperations: runtime?.trackOperations ?? env.PH_CONNECT_OPENPANEL_TRACK_OPERATIONS
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
7
23
|
//#region src/connect.config.ts
|
|
8
24
|
const env = loadRuntimeEnv({ processEnv: import.meta.env });
|
|
9
25
|
const runtime = getRuntimeConfig().connect;
|
|
@@ -129,12 +145,7 @@ const connectConfig = {
|
|
|
129
145
|
enabled: true,
|
|
130
146
|
externalProcessorsEnabled: true
|
|
131
147
|
},
|
|
132
|
-
openPanel:
|
|
133
|
-
clientId: env.PH_CONNECT_OPENPANEL_CLIENT_ID ?? "",
|
|
134
|
-
apiUrl: env.PH_CONNECT_OPENPANEL_API_URL,
|
|
135
|
-
trackUiEvents: env.PH_CONNECT_OPENPANEL_TRACK_UI_EVENTS,
|
|
136
|
-
trackOperations: env.PH_CONNECT_OPENPANEL_TRACK_OPERATIONS
|
|
137
|
-
},
|
|
148
|
+
openPanel: resolveOpenPanelConfig(runtime.openPanel, env),
|
|
138
149
|
renown: {
|
|
139
150
|
url: runtime.renown?.url,
|
|
140
151
|
networkId: runtime.renown?.networkId,
|
|
@@ -179,5 +190,5 @@ const connectConfig = {
|
|
|
179
190
|
//#endregion
|
|
180
191
|
export { defaultPHDocumentEditorConfig as a, defaultPHAppConfig as i, buildPHGlobalConfig as n, phGlobalConfig as o, connectConfig as r, PH_CONNECT_BASE_PATH as t };
|
|
181
192
|
|
|
182
|
-
//# sourceMappingURL=connect.config-
|
|
183
|
-
//# debugId=
|
|
193
|
+
//# sourceMappingURL=connect.config-CaXMoB42.js.map
|
|
194
|
+
//# debugId=393ad854-91a3-56dd-a42b-613d747ff54e
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connect.config-CaXMoB42.js","sources":["../src/utils/openpanel-config.ts","../src/connect.config.ts"],"sourcesContent":["import type { PHConnectOpenPanel } from \"@powerhousedao/shared/clis\";\n\n/** The build-time (Vite env) OpenPanel settings, as parsed by loadRuntimeEnv. */\nexport type OpenPanelBuildEnv = {\n PH_CONNECT_OPENPANEL_CLIENT_ID?: string;\n PH_CONNECT_OPENPANEL_API_URL?: string;\n PH_CONNECT_OPENPANEL_TRACK_UI_EVENTS: boolean;\n PH_CONNECT_OPENPANEL_TRACK_OPERATIONS: boolean;\n};\n\nexport type ResolvedOpenPanelConfig = {\n clientId: string;\n apiUrl: string | undefined;\n trackUiEvents: boolean;\n trackOperations: boolean;\n};\n\n/**\n * Resolve Connect's OpenPanel settings. The runtime config\n * (`connect.openPanel`, settable per deploy via PH_CONNECT_CONFIG_JSON) wins;\n * the build-time PH_CONNECT_OPENPANEL_* env is the fallback so builds that\n * bake it keep working. An empty clientId leaves OpenPanel disabled.\n */\nexport function resolveOpenPanelConfig(\n runtime: PHConnectOpenPanel | undefined,\n env: OpenPanelBuildEnv,\n): ResolvedOpenPanelConfig {\n return {\n clientId: runtime?.clientId || env.PH_CONNECT_OPENPANEL_CLIENT_ID || \"\",\n apiUrl: runtime?.apiUrl || env.PH_CONNECT_OPENPANEL_API_URL || undefined,\n trackUiEvents:\n runtime?.trackUiEvents ?? env.PH_CONNECT_OPENPANEL_TRACK_UI_EVENTS,\n trackOperations:\n runtime?.trackOperations ?? env.PH_CONNECT_OPENPANEL_TRACK_OPERATIONS,\n };\n}\n","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\";\nimport { resolveOpenPanelConfig } from \"./utils/openpanel-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 // Boot-time constant, so it is read straight off the runtime config rather\n // than through the PHGlobalConfig event machinery. Off unless turned on.\n workflowsEnabled: runtime.app?.workflowsEnabled ?? 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 // Runtime `connect.openPanel` wins; the build-time PH_CONNECT_OPENPANEL_*\n // env is the fallback. An empty clientId (the default) keeps it disabled.\n // `trackUiEvents` is intentionally dormant — no call sites gate on it yet.\n openPanel: resolveOpenPanelConfig(runtime.openPanel, env),\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":";;;;;;;;;;;;;AAuBA,SAAgB,uBACd,SACA,KACyB;CACzB,OAAO;EACL,UAAU,SAAS,YAAY,IAAI,kCAAkC;EACrE,QAAQ,SAAS,UAAU,IAAI,gCAAgC,KAAA;EAC/D,eACE,SAAS,iBAAiB,IAAI;EAChC,iBACE,SAAS,mBAAmB,IAAI;CACpC;AACF;;;AChBA,MAAa,MAAM,eAAe,EAChC,YAAY,YAAY,IAC1B,CAAC;AASD,MAAM,UAAU,iBAAiB,CAAC,CAAC;AAEnC,SAAS,8BAA8B,UAAkB;CACvD,OAAO,SAAS,SAAS,GAAG,IAAI,WAAW,WAAW;AACxD;AAQA,SAAS,oBAAoB;CAC3B,IACE,OAAO,eAAe,eACrB,WAAgD,qBAEjD,OAAO,YAAY,IAAI;CAEzB,OAAO,QAAQ,KAAK,YAAY,YAAY,IAAI;AAClD;AAMA,SAAS,qBAGP;CACA,MAAM,aAAa,QAAQ,KAAK,cAAc;CAa9C,OAAO;EACL,WAAW,KAAA;EACX,sBAAsB,CAAC;EACvB,sBAAsB;EACtB,0BAA0B;EAC1B,yBAAyB;EACzB,2BAA2B;EAC3B,SAAS,IAAI;EACb,UAAU,QAAQ,KAAK;EACvB,qBAAqB;EACrB,iBAAiB;EACjB;EACA,sBAAsB;EACtB,YAAY,IAAI;EAChB,+BAA+B;EAC/B,cAAc,KAAA;EACd,kBAAkB,QAAQ,QAAQ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K,QAAQ,QAAQ;EACrB,SAAS,QAAQ,QAAQ,WAAW;CACtC;CACA,SAAS;EACP,eAAe;EACf,mCAAmC;CACrC;CACA,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;GACjD;GACA,OAAO;IACL,OAAO;KACL,SAAS,QAAQ,QAAQ,UAAU,OAAO;KAC1C,UAAU,QAAQ,QAAQ,UAAU,OAAO;KAC3C,aAAa,QAAQ,QAAQ,UAAU,OAAO;IAChD;IACA,QAAQ;IACR,OAAO;GACT;EACF,EAAA,CAAG;CACL;CACA,cAAc,KAAA;CACd,cAAc,IAAI;AACpB","debug_id":"393ad854-91a3-56dd-a42b-613d747ff54e"}
|
|
@@ -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]="
|
|
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]="5b0fd022-b768-580e-995f-0e6fb5001072")}catch(e){}}();
|
|
3
3
|
import { n as getRuntimeConfig } from "./runtime-config-DtJIUgYw.js";
|
|
4
4
|
import { n as isMigratableMajor, t as coerceMajor, u as readPgVersionFile } from "./pglite-major-BbmMK26m.js";
|
|
5
|
-
import { t as PH_CONNECT_BASE_PATH } from "./connect.config-
|
|
5
|
+
import { t as PH_CONNECT_BASE_PATH } from "./connect.config-CaXMoB42.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-
|
|
126
|
-
//# debugId=
|
|
125
|
+
//# sourceMappingURL=connection-state-DJX_vUhI.js.map
|
|
126
|
+
//# debugId=5b0fd022-b768-580e-995f-0e6fb5001072
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection-state-
|
|
1
|
+
{"version":3,"file":"connection-state-DJX_vUhI.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,KAAK;CACtC,IAAI,UACF,OAAO;CAET,MAAM,OAAO,oBAAoB,MAAM,QAAQ;CAC/C,MAAM,WAAW,MAAM,UAAU,KAAK;CACtC,IAAI,UACF,OAAO,GAAG,KAAK,IAAI,cAAc,UAAU,CAAC;CAE9C,OAAO;AACT;;;ACdA,MAAa,6BAA6B,wBAAwB;CAChE,UAAU;CACV,UAAU,iBAAiB,CAAC,CAAC,QAAQ,UAAU,aAAa,KAAA;AAC9D,CAAC;AAED,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,mBACF;;;ACNA,IAAI;AACJ,IAAI;AACJ,MAAM,iCAAiB,IAAI,IAAgB;AAE3C,IAAI;AACJ,IAAI;AACJ,MAAM,qCAAqB,IAAI,IAAgB;AAE/C,SAAS,qBAAqB;CAC5B,KAAK,MAAM,KAAK,gBAAgB,EAAE;AACpC;AAEA,SAAS,yBAAyB;CAChC,KAAK,MAAM,KAAK,oBAAoB,EAAE;AACxC;AAEA,SAAgB,wBA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MACb;CAEF,SAAS;CACT,KAAK,MAAM,YAAY,CAAC,GAAG,SAAS,GAClC,SAAS;AAEb;AAEA,SAAgB,0BAA0B,UAAkC;CAC1E,UAAU,IAAI,QAAQ;CACtB,aAAa;EACX,UAAU,OAAO,QAAQ;CAC3B;AACF","debug_id":"5b0fd022-b768-580e-995f-0e6fb5001072"}
|
|
@@ -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]="
|
|
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]="34f550d6-36a8-59f2-9684-10eb8b12195d")}catch(e){}}();
|
|
3
3
|
import { t as i18n } from "./i18n-CTgT1HG-.js";
|
|
4
|
-
import { n as useAcceptedCookies, r as useCookieBanner } from "./preferences-store-
|
|
4
|
+
import { n as useAcceptedCookies, r as useCookieBanner } from "./preferences-store-DZUIAkHE.js";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { Trans, useTranslation } from "react-i18next";
|
|
7
7
|
import { CookieBanner as CookieBanner$1 } from "@powerhousedao/design-system/connect";
|
|
@@ -66,5 +66,5 @@ const CookieBanner = () => {
|
|
|
66
66
|
//#endregion
|
|
67
67
|
export { CookieBanner };
|
|
68
68
|
|
|
69
|
-
//# sourceMappingURL=cookie-banner-
|
|
70
|
-
//# debugId=
|
|
69
|
+
//# sourceMappingURL=cookie-banner-BxXvPdIY.js.map
|
|
70
|
+
//# debugId=34f550d6-36a8-59f2-9684-10eb8b12195d
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cookie-banner-
|
|
1
|
+
{"version":3,"file":"cookie-banner-BxXvPdIY.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;CAC/D,OAAO,QAAQ,MAAM,WAAW,OAAO,OAAO,MAAM,OAAO,KAAK;AAClE;AAEA,MAAa,qBAAqB;CAChC,MAAM,EAAE,MAAM,eAAe,KAAA,GAAW;EACtC,aAAa;EACb;CACF,CAAC;CACD,MAAM,CAAC,YAAY,iBAAiB,gBAAgB;CACpD,MAAM,GAAG,sBAAsB,mBAAmB;CAElD,MAAM,eAA8B,CAClC;EACE,IAAI;EACJ,OAAO,EAAE,gCAAgC;EACzC,OAAO;CACT,CACF;CAEA,MAAM,gBAAgB,YAA2B;EAC/C,cAAc,KAAK;EAEnB,IAAI,iBAAiB,SAAS,kBAAkB,GAC9C,oBAAoB,qBAAqB;GACvC,GAAG;GACH,WAAW;EACb,EAAE;CAEN;CAEA,MAAM,qBAAqB;EACzB,cAAc,KAAK;EACnB,0BAA0B;GACxB,WAAW;GACX,YAAY;GACZ,WAAW;EACb,EAAE;CACJ;CAEA,IAAI,CAAC,YACH,OAAO;CAGT,OACE,qBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACE,oBAAC,OAAD,EAAK,WAAU,yCAA0C,CAAA,GACzD,oBAAC,OAAD;GAAK,WAAU;GACb,UAAA,oBAACA,gBAAD;IACE,WAAU;IACV,SAAS;IACT,UAAU;IACV,UAAU;IACV,aAAa,EAAE,qBAAqB;IACpC,aAAa,EAAE,qBAAqB;IAEpC,UAAA,oBAAC,KAAD;KAAG,WAAU;KACX,UAAA,oBAAC,OAAD;MAEE,SAAQ;MACR,YAAY,EACV,GACE,oBAAC,KAAD;OACE,eAAe,YAAY,EAAE,MAAM,gBAAgB,CAAC;OAEpD,WAAU;MACX,GAFM,2BAEN,EAEL;KACD,GAXM,sBAWN;IACA,CAAA;GACW,CAAA;EACb,CAAA,CACF;;AAET","debug_id":"34f550d6-36a8-59f2-9684-10eb8b12195d"}
|
|
@@ -1,13 +1,13 @@
|
|
|
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]="
|
|
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]="7021b8a4-a0a9-5ab1-a097-e577561a1a17")}catch(e){}}();
|
|
3
3
|
import { r as loadRuntimeConfig, t as applyConnectBranding } from "./runtime-config-DtJIUgYw.js";
|
|
4
4
|
import "./i18n-CTgT1HG-.js";
|
|
5
|
-
import { r as connectConfig } from "./connect.config-
|
|
5
|
+
import { r as connectConfig } from "./connect.config-CaXMoB42.js";
|
|
6
6
|
import { n as setUser } from "./sentry-jfDyrxdX.js";
|
|
7
|
-
import { t as getBuildHash } from "./build-info-
|
|
8
|
-
import { a as detectReactorPgMajor, i as detectMigrationMajor } from "./connection-state-
|
|
9
|
-
import { n as seedPendingPgVersion } from "./pglite-seed-
|
|
10
|
-
import { n as createReactor } from "./reactor-
|
|
7
|
+
import { t as getBuildHash } from "./build-info-CQAER_nk.js";
|
|
8
|
+
import { a as detectReactorPgMajor, i as detectMigrationMajor } from "./connection-state-DJX_vUhI.js";
|
|
9
|
+
import { n as seedPendingPgVersion } from "./pglite-seed-AR1MKM1R.js";
|
|
10
|
+
import { n as createReactor } from "./reactor-CHFsGnJ2.js";
|
|
11
11
|
import { useEffect } from "react";
|
|
12
12
|
import { initTheme, useUser } from "@powerhousedao/reactor-browser";
|
|
13
13
|
import { logger } from "document-model";
|
|
@@ -129,5 +129,5 @@ async function loadComponent(localPackage) {
|
|
|
129
129
|
//#endregion
|
|
130
130
|
export { loadComponent };
|
|
131
131
|
|
|
132
|
-
//# sourceMappingURL=load-
|
|
133
|
-
//# debugId=
|
|
132
|
+
//# sourceMappingURL=load-uNwKzH6m.js.map
|
|
133
|
+
//# debugId=7021b8a4-a0a9-5ab1-a097-e577561a1a17
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-
|
|
1
|
+
{"version":3,"file":"load-uNwKzH6m.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 useCheckLatestVers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ACvE,OAAO,WACT,CAAC;EACD,IAAI,CAAC,OAAO,IAAI,OAAO;EACvB,MAAM,OAAQ,MAAM,OAAO,KAAK;EAChC,IAAI,OAAO,KAAK,SAAS,YAAY,CAAC,KAAK,MAAM,OAAO;EACxD,OAAO;GACL;GACA,cAAc,KAAK;GACnB,WAAW,KAAK,SAAS;EAC3B;CACF,QAAQ;EACN,OAAO;CACT;AACF;;;ACzCA,SAAgB,mBAAmB;CACjC,MAAM,OAAO,QAAQ;CACrB,gBAAgB;EACd,IAAI,aAAgC;EACpC,IAAI,MAAM;GAER,MAAM,EAAE,YAAY,aAAa,GAAG,SAAS;GAC7C,aAAa;IAAE,IAAI,KAAK;IAAK,UAAU,KAAK,KAAK;IAAM,GAAG;GAAK;EACjE;EACA,QAAc,UAAU;CAC1B,GAAG,CAAC,IAAI,CAAC;AACX;;;ACHA,eAAsB,cAAc,cAAiC;CACnE,MAAM,qBAAqB;CAC3B,MAAM,QAAQ,IAAI,CAAC,qBAAqB,GAAG,qBAAqB,CAAC,CAAC;CAClE,MAAM,gBAAgB,MAAM,kBAAkB;CAC9C,qBAAqB,aAAa;CAClC,MAAM,cAAc,YAAY;CAChC,OAAO,EACL,UAAU,EAAE,eAAyC;EACnD,UAAU;EAEV,iBAAiB;EAEjB,sBAAsB;EACtB,OAAO;CACT,EACF;AACF","debug_id":"7021b8a4-a0a9-5ab1-a097-e577561a1a17"}
|
package/dist/main.js
CHANGED
|
@@ -5,7 +5,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
5
5
|
//#region main.tsx
|
|
6
6
|
const root = await bootConnect();
|
|
7
7
|
if (root) {
|
|
8
|
-
const { AppLoader } = await import("./app-loader-
|
|
8
|
+
const { AppLoader } = await import("./app-loader-DSuZw3NZ.js");
|
|
9
9
|
root.render(/* @__PURE__ */ jsx(AppLoader, {}));
|
|
10
10
|
}
|
|
11
11
|
//#endregion
|
|
@@ -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]="
|
|
3
|
-
import { l as invalidateReactorPgMajorCache, m as REACTOR_PGLITE_NAME } from "./connection-state-
|
|
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]="472fb35a-9dae-509b-802f-ea816048f7ad")}catch(e){}}();
|
|
3
|
+
import { l as invalidateReactorPgMajorCache, m as REACTOR_PGLITE_NAME } from "./connection-state-DJX_vUhI.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-
|
|
49
|
-
//# debugId=
|
|
48
|
+
//# sourceMappingURL=pglite-seed-AR1MKM1R.js.map
|
|
49
|
+
//# debugId=472fb35a-9dae-509b-802f-ea816048f7ad
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pglite-seed-
|
|
1
|
+
{"version":3,"file":"pglite-seed-AR1MKM1R.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,mBAAmB;CACpD,IAAI,CAAC,KAAK;CAEV,MAAM,QAAQ,SAAS,KAAK,EAAE;CAC9B,QAAQ,KAAK,iCAAiC,MAAM,aAAa;CAEjE,IAAI;EACF,IAAI,UAAU,IAAI;GAChB,MAAM,EAAE,WAAW,MAAM,OAAO;GAChC,MAAM,KAAK,IAAI,OAAO,SAAS,qBAAqB;GACpD,IAAI;IACF,MAAM,GAAG;GACX,UAAU;IACR,MAAM,GAAG,MAAM;GACjB;EACF,OAAO,IAAI,UAAU,IAAI;GACvB,MAAM,EAAE,WAAW,MAAM,OAAO;GAChC,MAAM,KAAK,IAAI,OAAO,SAAS,qBAAqB;GACpD,IAAI;IACF,MAAM,GAAG;GACX,UAAU;IACR,MAAM,GAAG,MAAM;GACjB;EACF,OAAO;GACL,QAAQ,KAAK,qCAAqC,IAAI,WAAW;GACjE;EACF;EACA,QAAQ,KAAK,0BAA0B,MAAM,WAAW;CAC1D,UAAU;EACR,aAAa,WAAW,mBAAmB;EAC3C,8BAA8B;CAChC;AACF","debug_id":"472fb35a-9dae-509b-802f-ea816048f7ad"}
|
|
@@ -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]="
|
|
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]="ee33d4d1-ef09-5b2c-8c8a-cf207add5ce2")}catch(e){}}();
|
|
3
3
|
import { t as getIsEmbedded } from "./useIsEmbedded-BWJ0qb7w.js";
|
|
4
|
-
import { r as connectConfig } from "./connect.config-
|
|
4
|
+
import { r as connectConfig } from "./connect.config-CaXMoB42.js";
|
|
5
5
|
import { useSyncExternalStore } from "react";
|
|
6
6
|
//#region src/hooks/preferences-store.ts
|
|
7
7
|
const namespace = connectConfig.routerBasename;
|
|
@@ -81,5 +81,5 @@ const useCookieBanner = () => {
|
|
|
81
81
|
//#endregion
|
|
82
82
|
export { useAcceptedCookies as n, useCookieBanner as r, setBannerShown as t };
|
|
83
83
|
|
|
84
|
-
//# sourceMappingURL=preferences-store-
|
|
85
|
-
//# debugId=
|
|
84
|
+
//# sourceMappingURL=preferences-store-DZUIAkHE.js.map
|
|
85
|
+
//# debugId=ee33d4d1-ef09-5b2c-8c8a-cf207add5ce2
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preferences-store-
|
|
1
|
+
{"version":3,"file":"preferences-store-DZUIAkHE.js","sources":["../src/hooks/preferences-store.ts"],"sourcesContent":["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":";;;;;;AAKA,MAAM,YAAY,cAAc;;;;;;;;;;;;AAkBhC,MAAa,+BAA+B,GAAG,UAAU;AAQzD,MAAM,mBAAoC;CACxC,WAAW;CACX,WAAW;CACX,YAAY;AACd;AAEA,MAAM,kCAAkB,IAAI,IAAgB;AAE5C,IAAI,kBAAmC,0BAA0B;AAEjE,SAAS,4BAA6C;CACpD,IAAI;EACF,MAAM,QAAQ,aAAa,QAAQ,4BAA4B;EAC/D,OAAO,QAAS,KAAK,MAAM,KAAK,IAAwB;CAC1D,QAAQ;EACN,OAAO;CACT;AACF;AAEA,SAAS,yBAAyB,IAAgB;CAChD,gBAAgB,IAAI,EAAE;CACtB,aAAa;EACX,gBAAgB,OAAO,EAAE;CAC3B;AACF;AAEA,SAAS,qBAAsC;CAC7C,OAAO;AACT;AAEA,SAAgB,mBACd,QACA;CACA,kBAAkB,OAAO,eAAe;CACxC,aAAa,QACX,8BACA,KAAK,UAAU,eAAe,CAChC;CACA,gBAAgB,SAAS,OAAO,GAAG,CAAC;AACtC;AAEA,MAAa,2BAA2B;CAMtC,OAAO,CALS,qBACd,0BACA,oBACA,kBAEY,GAAG,kBAAkB;AACrC;AAMA,MAAa,4BAA4B,GAAG,UAAU;AAEtD,MAAM,kCAAkB,IAAI,IAAgB;AAE5C,IAAI,cAAc,sBAAsB;AAExC,SAAS,wBAAiC;CACxC,IAAI,cAAc,GAAG,OAAO;CAC5B,IAAI;EAEF,OADc,aAAa,QAAQ,yBACxB,MAAM;CACnB,SAAS,OAAO;EACd,QAAQ,MAAM,KAAK;EACnB,OAAO;CACT;AACF;AAEA,SAAS,qBAAqB,IAAgB;CAC5C,gBAAgB,IAAI,EAAE;CACtB,aAAa;EACX,gBAAgB,OAAO,EAAE;CAC3B;AACF;AAEA,SAAS,iBAA0B;CACjC,OAAO;AACT;AAEA,SAAgB,eAAe,OAAgB;CAC7C,cAAc;CACd,aAAa,QAAQ,2BAA2B,KAAK,UAAU,KAAK,CAAC;CACrE,gBAAgB,SAAS,OAAO,GAAG,CAAC;AACtC;AAEA,MAAa,wBAAwB;CAMnC,OAAO,CALO,qBACZ,sBACA,gBACA,cAEU,GAAG,cAAc;AAC/B","debug_id":"ee33d4d1-ef09-5b2c-8c8a-cf207add5ce2"}
|
|
@@ -1,13 +1,13 @@
|
|
|
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]="
|
|
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]="a3855d12-7091-5a48-861e-5fdd3eb884fa")}catch(e){}}();
|
|
3
3
|
import { n as getRuntimeConfig } from "./runtime-config-DtJIUgYw.js";
|
|
4
4
|
import { t as createConnectSignerConfig } from "./renown-trust-DRgHpxlZ.js";
|
|
5
5
|
import { a as resolvePgMajorForRuntime, r as loadPGliteModule } from "./pglite-major-BbmMK26m.js";
|
|
6
|
-
import { n as buildPHGlobalConfig, o as phGlobalConfig, r as connectConfig } from "./connect.config-
|
|
6
|
+
import { n as buildPHGlobalConfig, o as phGlobalConfig, r as connectConfig } from "./connect.config-CaXMoB42.js";
|
|
7
7
|
import { r as toast } from "./toast-C6WW-_O-.js";
|
|
8
8
|
import { r as getSharedDeps, t as BrowserPackageManager } from "./package-manager-BbzIV9aN.js";
|
|
9
|
-
import { i as getVersion, n as getGitSha } from "./build-info-
|
|
10
|
-
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-
|
|
9
|
+
import { i as getVersion, n as getGitSha } from "./build-info-CQAER_nk.js";
|
|
10
|
+
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-DJX_vUhI.js";
|
|
11
11
|
import { createRelationalDb } from "@powerhousedao/shared/processors";
|
|
12
12
|
import { DocumentModelRegistry, DocumentModelResolver, ReactorEventTypes, createReactorHostModuleBase } from "@powerhousedao/reactor";
|
|
13
13
|
import { MessageRouter, RPC_PROTOCOL_VERSION, SyncManagerProxy, connectReactorClient, createInspectorProxy, createPortTransport, createReactorEventBusProxy, createRelationalPgliteProxy, createWorkerAdminClient, postReactorIdentity } from "@powerhousedao/reactor-browser/rpc";
|
|
@@ -1081,5 +1081,5 @@ function getDriveUrl() {
|
|
|
1081
1081
|
//#endregion
|
|
1082
1082
|
export { createReactor as n, clearReactorStorage as t };
|
|
1083
1083
|
|
|
1084
|
-
//# sourceMappingURL=reactor-
|
|
1085
|
-
//# debugId=
|
|
1084
|
+
//# sourceMappingURL=reactor-CHFsGnJ2.js.map
|
|
1085
|
+
//# debugId=a3855d12-7091-5a48-861e-5fdd3eb884fa
|