@powerhousedao/connect 6.0.2-staging.7 → 6.0.2-staging.9

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 (61) hide show
  1. package/dist/{AddDriveModal-B9BPORvo.js → AddDriveModal-ZK9-BWMB.js} +3 -3
  2. package/dist/{AddDriveModal-B9BPORvo.js.map → AddDriveModal-ZK9-BWMB.js.map} +1 -1
  3. package/dist/{ClearStorageModal-K1H6NgT6.js → ClearStorageModal-Bfb3ube7.js} +4 -4
  4. package/dist/{ClearStorageModal-K1H6NgT6.js.map → ClearStorageModal-Bfb3ube7.js.map} +1 -1
  5. package/dist/{CookiesPolicyModal-CnVx2R_8.js → CookiesPolicyModal-DiXQV82b.js} +3 -3
  6. package/dist/{CookiesPolicyModal-CnVx2R_8.js.map → CookiesPolicyModal-DiXQV82b.js.map} +1 -1
  7. package/dist/{CreateDocumentModal-TtG7E62x.js → CreateDocumentModal-BhJh4nWt.js} +3 -3
  8. package/dist/{CreateDocumentModal-TtG7E62x.js.map → CreateDocumentModal-BhJh4nWt.js.map} +1 -1
  9. package/dist/{DebugSettingsModal-CTXVmgw0.js → DebugSettingsModal-Ch-Kz25q.js} +6 -6
  10. package/dist/DebugSettingsModal-Ch-Kz25q.js.map +1 -0
  11. package/dist/{DeleteDriveModal-Cb43NeNu.js → DeleteDriveModal-CbuIdjKY.js} +4 -4
  12. package/dist/{DeleteDriveModal-Cb43NeNu.js.map → DeleteDriveModal-CbuIdjKY.js.map} +1 -1
  13. package/dist/{DeleteItemModal-Brq4QKdd.js → DeleteItemModal-9ErYlauT.js} +3 -3
  14. package/dist/{DeleteItemModal-Brq4QKdd.js.map → DeleteItemModal-9ErYlauT.js.map} +1 -1
  15. package/dist/{DisclaimerModal-Dk6PpkZU.js → DisclaimerModal-CfDeiBz8.js} +3 -3
  16. package/dist/{DisclaimerModal-Dk6PpkZU.js.map → DisclaimerModal-CfDeiBz8.js.map} +1 -1
  17. package/dist/{DownloadDocumentWithErrorsModal-B8ZKi2Xy.js → DownloadDocumentWithErrorsModal-KZGWQ4J7.js} +3 -3
  18. package/dist/{DownloadDocumentWithErrorsModal-B8ZKi2Xy.js.map → DownloadDocumentWithErrorsModal-KZGWQ4J7.js.map} +1 -1
  19. package/dist/{DriveSettingsModal-Bnug5LXo.js → DriveSettingsModal-DEk05PS7.js} +3 -3
  20. package/dist/{DriveSettingsModal-Bnug5LXo.js.map → DriveSettingsModal-DEk05PS7.js.map} +1 -1
  21. package/dist/{InspectorModal-EDrjiXPs.js → InspectorModal-DV7lUbNo.js} +6 -6
  22. package/dist/{InspectorModal-EDrjiXPs.js.map → InspectorModal-DV7lUbNo.js.map} +1 -1
  23. package/dist/{MissingPackageModal-BfblPbd8.js → MissingPackageModal-B2EAV_VJ.js} +5 -5
  24. package/dist/MissingPackageModal-B2EAV_VJ.js.map +1 -0
  25. package/dist/{SettingsModal-CoB3RGvB.js → SettingsModal-BIBmbLIY.js} +6 -6
  26. package/dist/{SettingsModal-CoB3RGvB.js.map → SettingsModal-BIBmbLIY.js.map} +1 -1
  27. package/dist/{UpgradeDriveModal-CBLALaaQ.js → UpgradeDriveModal-BwI5E5k3.js} +3 -3
  28. package/dist/{UpgradeDriveModal-CBLALaaQ.js.map → UpgradeDriveModal-BwI5E5k3.js.map} +1 -1
  29. package/dist/{build-info-CmRhqPut.js → build-info-CqrCD80-.js} +4 -4
  30. package/dist/{build-info-CmRhqPut.js.map → build-info-CqrCD80-.js.map} +1 -1
  31. package/dist/{i18n-DLmohU39.js → i18n-4rfcgnb9.js} +3 -3
  32. package/dist/{i18n-DLmohU39.js.map → i18n-4rfcgnb9.js.map} +1 -1
  33. package/dist/{load-DmqBMSTc.js → load-CgVlvt2T.js} +7 -7
  34. package/dist/{load-DmqBMSTc.js.map → load-CgVlvt2T.js.map} +1 -1
  35. package/dist/main.js +1 -1
  36. package/dist/{package-DnmMxPNs.js → package-Qyrfm1QZ.js} +6 -6
  37. package/dist/package-Qyrfm1QZ.js.map +1 -0
  38. package/dist/packages.config-CiH8KJVN.js +32 -0
  39. package/dist/packages.config-CiH8KJVN.js.map +1 -0
  40. package/dist/{pglite-runtime-C1g-4Jxl.js → pglite-runtime-Btp8ZXVH.js} +3 -3
  41. package/dist/{pglite-runtime-C1g-4Jxl.js.map → pglite-runtime-Btp8ZXVH.js.map} +1 -1
  42. package/dist/{pglite-seed-BtXWFpHf.js → pglite-seed-b1mJUaip.js} +4 -4
  43. package/dist/{pglite-seed-BtXWFpHf.js.map → pglite-seed-b1mJUaip.js.map} +1 -1
  44. package/dist/{reactor-Nm3jOev1.js → reactor-DFuRedvV.js} +158 -31
  45. package/dist/reactor-DFuRedvV.js.map +1 -0
  46. package/dist/{registerServiceWorker-LI8_JXt3.js → registerServiceWorker-CMRF2LWE.js} +3 -3
  47. package/dist/{registerServiceWorker-LI8_JXt3.js.map → registerServiceWorker-CMRF2LWE.js.map} +1 -1
  48. package/dist/{sidebar-DPrzR2fJ.js → sidebar-CULALtpz.js} +175 -256
  49. package/dist/sidebar-CULALtpz.js.map +1 -0
  50. package/dist/start-connect.js +1 -1
  51. package/dist/style.css +624 -346
  52. package/dist/{useRegistryPackages-BOX4NMAb.js → useRegistryPackages-DK8swjWd.js} +9 -8
  53. package/dist/useRegistryPackages-DK8swjWd.js.map +1 -0
  54. package/package.json +12 -12
  55. package/public/ph-packages.json +2 -1
  56. package/dist/DebugSettingsModal-CTXVmgw0.js.map +0 -1
  57. package/dist/MissingPackageModal-BfblPbd8.js.map +0 -1
  58. package/dist/package-DnmMxPNs.js.map +0 -1
  59. package/dist/reactor-Nm3jOev1.js.map +0 -1
  60. package/dist/sidebar-DPrzR2fJ.js.map +0 -1
  61. package/dist/useRegistryPackages-BOX4NMAb.js.map +0 -1
@@ -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]="27c6ac1a-bcd5-5b52-9e9f-47e690fbfb54")}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]="e14c7153-8c65-507c-aef7-e5941993e7c4")}catch(e){}}();
3
3
  import { n as toast } from "./toast-DnODOv28.js";
4
4
  import { addDrive, addRemoteDrive, closePHModal, setSelectedDrive, useAppModules, usePHModal, useRenown, useUser } from "@powerhousedao/reactor-browser";
5
5
  import { jsx } from "react/jsx-runtime";
@@ -88,5 +88,5 @@ function AddDriveModal() {
88
88
  //#endregion
89
89
  export { AddDriveModal };
90
90
 
91
- //# sourceMappingURL=AddDriveModal-B9BPORvo.js.map
92
- //# debugId=27c6ac1a-bcd5-5b52-9e9f-47e690fbfb54
91
+ //# sourceMappingURL=AddDriveModal-ZK9-BWMB.js.map
92
+ //# debugId=e14c7153-8c65-507c-aef7-e5941993e7c4
@@ -1 +1 @@
1
- {"version":3,"file":"AddDriveModal-B9BPORvo.js","sources":["../src/components/modal/modals/AddDriveModal.tsx"],"sourcesContent":["import { toast } from \"@powerhousedao/connect/services\";\nimport type {\n AddRemoteDriveInput,\n AppOptions,\n} from \"@powerhousedao/design-system/connect\";\nimport { AddDriveModal as ConnectAddLocalDriveModal } from \"@powerhousedao/design-system/connect\";\nimport {\n addDrive,\n addRemoteDrive,\n closePHModal,\n setSelectedDrive,\n useAppModules,\n usePHModal,\n useRenown,\n useUser,\n} from \"@powerhousedao/reactor-browser\";\nimport { t } from \"i18next\";\n\nasync function requestPublicDriveFromReactor(\n url: string,\n headers?: Record<string, string>,\n): Promise<{ id: string; name: string }> {\n const response = await fetch(url, { headers: headers ?? {} });\n if (!response.ok) {\n throw new Error(`HTTP ${response.status}`);\n }\n return (await response.json()) as { id: string; name: string };\n}\n\nexport function AddDriveModal() {\n const phModal = usePHModal();\n const open = phModal?.type === \"addDrive\";\n const user = useUser();\n const renown = useRenown();\n const appModules = useAppModules();\n const onAddLocalDrive = async (data: AppOptions) => {\n try {\n const app = appModules?.find((a) => a.config.id === data.id);\n const newDrive = await addDrive(\n {\n id: \"\",\n slug: \"\",\n global: {\n name: data.name,\n icon: null,\n },\n local: {\n availableOffline: data.availableOffline,\n sharingType: data.sharingType.toLowerCase(),\n listeners: [],\n triggers: [],\n },\n },\n app?.config.id,\n );\n\n toast(t(\"notifications.addDriveSuccess\"), {\n type: \"connect-success\",\n });\n\n if (!newDrive) {\n return;\n }\n\n setSelectedDrive(newDrive);\n } catch (e) {\n console.error(e);\n }\n };\n\n const onAddRemoteDrive = async (data: AddRemoteDriveInput) => {\n try {\n const driveId = await addRemoteDrive(data.url, data.id);\n\n toast(t(\"notifications.addDriveSuccess\"), {\n type: \"connect-success\",\n });\n\n setSelectedDrive(driveId);\n } catch (e) {\n console.error(e);\n }\n };\n async function onAddLocalDriveSubmit(data: AppOptions) {\n await onAddLocalDrive(data);\n closePHModal();\n }\n\n async function onAddRemoteDriveSubmit(data: AddRemoteDriveInput) {\n await onAddRemoteDrive(data);\n closePHModal();\n }\n\n const ready = !!appModules?.length;\n\n return (\n <ConnectAddLocalDriveModal\n open={open && ready}\n onAddLocalDrive={onAddLocalDriveSubmit}\n onAddRemoteDrive={onAddRemoteDriveSubmit}\n requestPublicDrive={async (url: string) => {\n try {\n if (user) {\n const authToken = await renown?.getBearerToken?.({\n expiresIn: 10,\n aud: url,\n });\n return requestPublicDriveFromReactor(url, {\n Authorization: `Bearer ${authToken}`,\n });\n }\n return requestPublicDriveFromReactor(url);\n } catch (error) {\n console.error(error);\n return requestPublicDriveFromReactor(url);\n }\n }}\n onOpenChange={(status) => {\n if (!status) return closePHModal();\n }}\n appOptions={\n appModules?.map((pkg) => ({\n id: pkg.config.id,\n name: pkg.config.name,\n sharingType: \"LOCAL\",\n availableOffline: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,gBAAc;;CAGhB,MAAM,QAAQ,CAAC,CAAC,YAAY;AAE5B,QACE,oBAACA,iBAAD;EACE,MAAM,QAAQ;EACd,iBAAiB;EACjB,kBAAkB;EAClB,oBAAoB,OAAO,QAAgB;AACzC,OAAI;AACF,QAAI,KAKF,QAAO,8BAA8B,KAAK,EACxC,eAAe,UALC,MAAM,QAAQ,iBAAiB;KAC/C,WAAW;KACX,KAAK;KACN,CAAC,IAGD,CAAC;AAEJ,WAAO,8BAA8B,IAAI;YAClC,OAAO;AACd,YAAQ,MAAM,MAAM;AACpB,WAAO,8BAA8B,IAAI;;;EAG7C,eAAe,WAAW;AACxB,OAAI,CAAC,OAAQ,QAAO,cAAc;;EAEpC,YACE,YAAY,KAAK,SAAS;GACxB,IAAI,IAAI,OAAO;GACf,MAAM,IAAI,OAAO;GACjB,aAAa;GACb,kBAAkB;GACnB,EAAE,IAAI,EAAE;EAEX,CAAA","debug_id":"27c6ac1a-bcd5-5b52-9e9f-47e690fbfb54"}
1
+ {"version":3,"file":"AddDriveModal-ZK9-BWMB.js","sources":["../src/components/modal/modals/AddDriveModal.tsx"],"sourcesContent":["import { toast } from \"@powerhousedao/connect/services\";\nimport type {\n AddRemoteDriveInput,\n AppOptions,\n} from \"@powerhousedao/design-system/connect\";\nimport { AddDriveModal as ConnectAddLocalDriveModal } from \"@powerhousedao/design-system/connect\";\nimport {\n addDrive,\n addRemoteDrive,\n closePHModal,\n setSelectedDrive,\n useAppModules,\n usePHModal,\n useRenown,\n useUser,\n} from \"@powerhousedao/reactor-browser\";\nimport { t } from \"i18next\";\n\nasync function requestPublicDriveFromReactor(\n url: string,\n headers?: Record<string, string>,\n): Promise<{ id: string; name: string }> {\n const response = await fetch(url, { headers: headers ?? {} });\n if (!response.ok) {\n throw new Error(`HTTP ${response.status}`);\n }\n return (await response.json()) as { id: string; name: string };\n}\n\nexport function AddDriveModal() {\n const phModal = usePHModal();\n const open = phModal?.type === \"addDrive\";\n const user = useUser();\n const renown = useRenown();\n const appModules = useAppModules();\n const onAddLocalDrive = async (data: AppOptions) => {\n try {\n const app = appModules?.find((a) => a.config.id === data.id);\n const newDrive = await addDrive(\n {\n id: \"\",\n slug: \"\",\n global: {\n name: data.name,\n icon: null,\n },\n local: {\n availableOffline: data.availableOffline,\n sharingType: data.sharingType.toLowerCase(),\n listeners: [],\n triggers: [],\n },\n },\n app?.config.id,\n );\n\n toast(t(\"notifications.addDriveSuccess\"), {\n type: \"connect-success\",\n });\n\n if (!newDrive) {\n return;\n }\n\n setSelectedDrive(newDrive);\n } catch (e) {\n console.error(e);\n }\n };\n\n const onAddRemoteDrive = async (data: AddRemoteDriveInput) => {\n try {\n const driveId = await addRemoteDrive(data.url, data.id);\n\n toast(t(\"notifications.addDriveSuccess\"), {\n type: \"connect-success\",\n });\n\n setSelectedDrive(driveId);\n } catch (e) {\n console.error(e);\n }\n };\n async function onAddLocalDriveSubmit(data: AppOptions) {\n await onAddLocalDrive(data);\n closePHModal();\n }\n\n async function onAddRemoteDriveSubmit(data: AddRemoteDriveInput) {\n await onAddRemoteDrive(data);\n closePHModal();\n }\n\n const ready = !!appModules?.length;\n\n return (\n <ConnectAddLocalDriveModal\n open={open && ready}\n onAddLocalDrive={onAddLocalDriveSubmit}\n onAddRemoteDrive={onAddRemoteDriveSubmit}\n requestPublicDrive={async (url: string) => {\n try {\n if (user) {\n const authToken = await renown?.getBearerToken?.({\n expiresIn: 10,\n aud: url,\n });\n return requestPublicDriveFromReactor(url, {\n Authorization: `Bearer ${authToken}`,\n });\n }\n return requestPublicDriveFromReactor(url);\n } catch (error) {\n console.error(error);\n return requestPublicDriveFromReactor(url);\n }\n }}\n onOpenChange={(status) => {\n if (!status) return closePHModal();\n }}\n appOptions={\n appModules?.map((pkg) => ({\n id: pkg.config.id,\n name: pkg.config.name,\n sharingType: \"LOCAL\",\n availableOffline: false,\n })) || []\n }\n />\n );\n}\n"],"names":["ConnectAddLocalDriveModal"],"mappings":";;;;;;;;AAkBA,eAAe,8BACb,K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Q;EACd,iBAAiB;EACjB,kBAAkB;EAClB,oBAAoB,OAAO,QAAgB;AACzC,OAAI;AACF,QAAI,KAKF,QAAO,8BAA8B,KAAK,EACxC,eAAe,UALC,MAAM,QAAQ,iBAAiB;KAC/C,WAAW;KACX,KAAK;KACN,CAAC,IAGD,CAAC;AAEJ,WAAO,8BAA8B,IAAI;YAClC,OAAO;AACd,YAAQ,MAAM,MAAM;AACpB,WAAO,8BAA8B,IAAI;;;EAG7C,eAAe,WAAW;AACxB,OAAI,CAAC,OAAQ,QAAO,cAAc;;EAEpC,YACE,YAAY,KAAK,SAAS;GACxB,IAAI,IAAI,OAAO;GACf,MAAM,IAAI,OAAO;GACjB,aAAa;GACb,kBAAkB;GACnB,EAAE,IAAI,EAAE;EAEX,CAAA","debug_id":"e14c7153-8c65-507c-aef7-e5941993e7c4"}
@@ -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]="01f394e7-33a1-572a-8f8b-26a40288748b")}catch(e){}}();
3
- import { t as clearReactorStorage } from "./reactor-Nm3jOev1.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]="533a4634-8f7c-5303-b825-68274fdfcd95")}catch(e){}}();
3
+ import { t as clearReactorStorage } from "./reactor-DFuRedvV.js";
4
4
  import { closePHModal, setSelectedDrive, setSelectedNode, showPHModal, usePHModal } from "@powerhousedao/reactor-browser";
5
5
  import { childLogger } from "document-model";
6
6
  import { useState } from "react";
@@ -43,5 +43,5 @@ function ClearStorageModal() {
43
43
  //#endregion
44
44
  export { ClearStorageModal };
45
45
 
46
- //# sourceMappingURL=ClearStorageModal-K1H6NgT6.js.map
47
- //# debugId=01f394e7-33a1-572a-8f8b-26a40288748b
46
+ //# sourceMappingURL=ClearStorageModal-Bfb3ube7.js.map
47
+ //# debugId=533a4634-8f7c-5303-b825-68274fdfcd95
@@ -1 +1 @@
1
- {"version":3,"file":"ClearStorageModal-K1H6NgT6.js","sources":["../src/components/modal/modals/ClearStorageModal.tsx"],"sourcesContent":["import { clearReactorStorage } from \"@powerhousedao/connect/store\";\nimport { ConnectConfirmationModal } from \"@powerhousedao/design-system/connect\";\nimport {\n closePHModal,\n setSelectedDrive,\n setSelectedNode,\n showPHModal,\n usePHModal,\n} from \"@powerhousedao/reactor-browser\";\nimport { childLogger } from \"document-model\";\nimport { useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nconst logger = childLogger([\"ClearStorage\"]);\n\nexport function ClearStorageModal() {\n const phModal = usePHModal();\n const open = phModal?.type === \"clearStorage\";\n const { t } = useTranslation();\n const [loading, setLoading] = useState(false);\n\n function clearStorage() {\n setLoading(true);\n clearReactorStorage()\n .then(() => {\n logger.info(\"Storage cleared\");\n setSelectedDrive(undefined);\n setSelectedNode(undefined);\n window.location.reload();\n })\n .catch((error) => {\n logger.error(\"Error clearing storage: @error\", error);\n setLoading(false);\n });\n }\n\n return (\n <ConnectConfirmationModal\n open={open}\n header={t(\"modals.connectSettings.clearStorage.confirmation.title\")}\n title={t(\"modals.connectSettings.clearStorage.confirmation.title\")}\n body={t(\"modals.connectSettings.clearStorage.confirmation.body\")}\n cancelLabel={t(\"common.cancel\")}\n continueLabel={t(\n \"modals.connectSettings.clearStorage.confirmation.clearButton\",\n )}\n onCancel={() => showPHModal({ type: \"settings\" })}\n onContinue={clearStorage}\n onOpenChange={(status: boolean) => {\n if (!status) return closePHModal();\n }}\n continueButtonProps={{\n disabled: loading,\n }}\n />\n );\n}\n"],"names":["logger"],"mappings":";;;;;;;;;;AAaA,MAAMA,WAAS,YAAY,CAAC,eAAe,CAAC;AAE5C,SAAgB,oBAAoB;CAElC,MAAM,OADU,YAAY,EACN,SAAS;CAC/B,MAAM,EAAE,MAAM,gBAAgB;CAC9B,MAAM,CAAC,SAAS,cAAc,SAAS,MAAM;CAE7C,SAAS,eAAe;AACtB,aAAW,KAAK;AAChB,uBAAqB,CAClB,WAAW;AACV,YAAO,KAAK,kBAAkB;AAC9B,oBAAiB,KAAA,EAAU;AAC3B,mBAAgB,KAAA,EAAU;AAC1B,UAAO,SAAS,QAAQ;IACxB,CACD,OAAO,UAAU;AAChB,YAAO,MAAM,kCAAkC,MAAM;AACrD,cAAW,MAAM;IACjB;;AAGN,QACE,oBAAC,0BAAD;EACQ;EACN,QAAQ,EAAE,yDAAyD;EACnE,OAAO,EAAE,yDAAyD;EAClE,MAAM,EAAE,wDAAwD;EAChE,aAAa,EAAE,gBAAgB;EAC/B,eAAe,EACb,+DACD;EACD,gBAAgB,YAAY,EAAE,MAAM,YAAY,CAAC;EACjD,YAAY;EACZ,eAAe,WAAoB;AACjC,OAAI,CAAC,OAAQ,QAAO,cAAc;;EAEpC,qBAAqB,EACnB,UAAU,SACX;EACD,CAAA","debug_id":"01f394e7-33a1-572a-8f8b-26a40288748b"}
1
+ {"version":3,"file":"ClearStorageModal-Bfb3ube7.js","sources":["../src/components/modal/modals/ClearStorageModal.tsx"],"sourcesContent":["import { clearReactorStorage } from \"@powerhousedao/connect/store\";\nimport { ConnectConfirmationModal } from \"@powerhousedao/design-system/connect\";\nimport {\n closePHModal,\n setSelectedDrive,\n setSelectedNode,\n showPHModal,\n usePHModal,\n} from \"@powerhousedao/reactor-browser\";\nimport { childLogger } from \"document-model\";\nimport { useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nconst logger = childLogger([\"ClearStorage\"]);\n\nexport function ClearStorageModal() {\n const phModal = usePHModal();\n const open = phModal?.type === \"clearStorage\";\n const { t } = useTranslation();\n const [loading, setLoading] = useState(false);\n\n function clearStorage() {\n setLoading(true);\n clearReactorStorage()\n .then(() => {\n logger.info(\"Storage cleared\");\n setSelectedDrive(undefined);\n setSelectedNode(undefined);\n window.location.reload();\n })\n .catch((error) => {\n logger.error(\"Error clearing storage: @error\", error);\n setLoading(false);\n });\n }\n\n return (\n <ConnectConfirmationModal\n open={open}\n header={t(\"modals.connectSettings.clearStorage.confirmation.title\")}\n title={t(\"modals.connectSettings.clearStorage.confirmation.title\")}\n body={t(\"modals.connectSettings.clearStorage.confirmation.body\")}\n cancelLabel={t(\"common.cancel\")}\n continueLabel={t(\n \"modals.connectSettings.clearStorage.confirmation.clearButton\",\n )}\n onCancel={() => showPHModal({ type: \"settings\" })}\n onContinue={clearStorage}\n onOpenChange={(status: boolean) => {\n if (!status) return closePHModal();\n }}\n continueButtonProps={{\n disabled: loading,\n }}\n />\n );\n}\n"],"names":["logger"],"mappings":";;;;;;;;;;AAaA,MAAMA,WAAS,YAAY,CAAC,eAAe,CAAC;AAE5C,SAAgB,oBAAoB;CAElC,MAAM,OADU,YAAY,EACN,SAAS;CAC/B,MAAM,EAAE,MAAM,gBAAgB;CAC9B,MAAM,CAAC,SAAS,cAAc,SAAS,MAAM;CAE7C,SAAS,eAAe;AACtB,aAAW,KAAK;AAChB,uBAAqB,CAClB,WAAW;AACV,YAAO,KAAK,kBAAkB;AAC9B,oBAAiB,KAAA,EAAU;AAC3B,mBAAgB,KAAA,EAAU;AAC1B,UAAO,SAAS,QAAQ;IACxB,CACD,OAAO,UAAU;AAChB,YAAO,MAAM,kCAAkC,MAAM;AACrD,cAAW,MAAM;IACjB;;AAGN,QACE,oBAAC,0BAAD;EACQ;EACN,QAAQ,EAAE,yDAAyD;EACnE,OAAO,EAAE,yDAAyD;EAClE,MAAM,EAAE,wDAAwD;EAChE,aAAa,EAAE,gBAAgB;EAC/B,eAAe,EACb,+DACD;EACD,gBAAgB,YAAY,EAAE,MAAM,YAAY,CAAC;EACjD,YAAY;EACZ,eAAe,WAAoB;AACjC,OAAI,CAAC,OAAQ,QAAO,cAAc;;EAEpC,qBAAqB,EACnB,UAAU,SACX;EACD,CAAA","debug_id":"533a4634-8f7c-5303-b825-68274fdfcd95"}
@@ -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]="02412d0f-6fdc-5291-b117-519329e3501e")}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]="f576f630-a4f5-5bef-8804-c42ffaa56fab")}catch(e){}}();
3
3
  import { closePHModal, usePHModal } from "@powerhousedao/reactor-browser";
4
4
  import { Trans, useTranslation } from "react-i18next";
5
5
  import { jsx } from "react/jsx-runtime";
@@ -29,5 +29,5 @@ const CookiesPolicyModal = () => {
29
29
  //#endregion
30
30
  export { CookiesPolicyModal };
31
31
 
32
- //# sourceMappingURL=CookiesPolicyModal-CnVx2R_8.js.map
33
- //# debugId=02412d0f-6fdc-5291-b117-519329e3501e
32
+ //# sourceMappingURL=CookiesPolicyModal-DiXQV82b.js.map
33
+ //# debugId=f576f630-a4f5-5bef-8804-c42ffaa56fab
@@ -1 +1 @@
1
- {"version":3,"file":"CookiesPolicyModal-CnVx2R_8.js","sources":["../src/components/modal/modals/CookiesPolicyModal.tsx"],"sourcesContent":["import { ReadRequiredModal } from \"@powerhousedao/design-system/connect\";\nimport { closePHModal, usePHModal } from \"@powerhousedao/reactor-browser\";\nimport { Trans, useTranslation } from \"react-i18next\";\n\nexport const CookiesPolicyModal: React.FC = () => {\n const phModal = usePHModal();\n const open = phModal?.type === \"cookiesPolicy\";\n const { t } = useTranslation();\n\n return (\n <ReadRequiredModal\n open={open}\n header={t(\"modals.cookiesPolicy.title\")}\n body={\n <Trans\n i18nKey=\"modals.cookiesPolicy.body\"\n components={{\n subtitle: <h2 className=\"mb-4 text-lg font-bold\" />,\n p: <p className=\"mb-2\" />,\n list: <ul className=\"mb-4 list-disc pl-6\" />,\n bullet: <li />,\n }}\n />\n }\n bodyProps={{ className: \"text-left\" }}\n closeLabel=\"Close\"\n onContinue={() => closePHModal()}\n overlayProps={{ style: { zIndex: 10000 } }}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;AAIA,MAAa,2BAAqC;CAEhD,MAAM,OADU,YAAY,EACN,SAAS;CAC/B,MAAM,EAAE,MAAM,gBAAgB;AAE9B,QACE,oBAAC,mBAAD;EACQ;EACN,QAAQ,EAAE,6BAA6B;EACvC,MACE,oBAAC,OAAD;GACE,SAAQ;GACR,YAAY;IACV,UAAU,oBAAC,MAAD,EAAI,WAAU,0BAA2B,CAAA;IACnD,GAAG,oBAAC,KAAD,EAAG,WAAU,QAAS,CAAA;IACzB,MAAM,oBAAC,MAAD,EAAI,WAAU,uBAAwB,CAAA;IAC5C,QAAQ,oBAAC,MAAD,EAAM,CAAA;IACf;GACD,CAAA;EAEJ,WAAW,EAAE,WAAW,aAAa;EACrC,YAAW;EACX,kBAAkB,cAAc;EAChC,cAAc,EAAE,OAAO,EAAE,QAAQ,KAAO,EAAE;EAC1C,CAAA","debug_id":"02412d0f-6fdc-5291-b117-519329e3501e"}
1
+ {"version":3,"file":"CookiesPolicyModal-DiXQV82b.js","sources":["../src/components/modal/modals/CookiesPolicyModal.tsx"],"sourcesContent":["import { ReadRequiredModal } from \"@powerhousedao/design-system/connect\";\nimport { closePHModal, usePHModal } from \"@powerhousedao/reactor-browser\";\nimport { Trans, useTranslation } from \"react-i18next\";\n\nexport const CookiesPolicyModal: React.FC = () => {\n const phModal = usePHModal();\n const open = phModal?.type === \"cookiesPolicy\";\n const { t } = useTranslation();\n\n return (\n <ReadRequiredModal\n open={open}\n header={t(\"modals.cookiesPolicy.title\")}\n body={\n <Trans\n i18nKey=\"modals.cookiesPolicy.body\"\n components={{\n subtitle: <h2 className=\"mb-4 text-lg font-bold\" />,\n p: <p className=\"mb-2\" />,\n list: <ul className=\"mb-4 list-disc pl-6\" />,\n bullet: <li />,\n }}\n />\n }\n bodyProps={{ className: \"text-left\" }}\n closeLabel=\"Close\"\n onContinue={() => closePHModal()}\n overlayProps={{ style: { zIndex: 10000 } }}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;AAIA,MAAa,2BAAqC;CAEhD,MAAM,OADU,YAAY,EACN,SAAS;CAC/B,MAAM,EAAE,MAAM,gBAAgB;AAE9B,QACE,oBAAC,mBAAD;EACQ;EACN,QAAQ,EAAE,6BAA6B;EACvC,MACE,oBAAC,OAAD;GACE,SAAQ;GACR,YAAY;IACV,UAAU,oBAAC,MAAD,EAAI,WAAU,0BAA2B,CAAA;IACnD,GAAG,oBAAC,KAAD,EAAG,WAAU,QAAS,CAAA;IACzB,MAAM,oBAAC,MAAD,EAAI,WAAU,uBAAwB,CAAA;IAC5C,QAAQ,oBAAC,MAAD,EAAM,CAAA;IACf;GACD,CAAA;EAEJ,WAAW,EAAE,WAAW,aAAa;EACrC,YAAW;EACX,kBAAkB,cAAc;EAChC,cAAc,EAAE,OAAO,EAAE,QAAQ,KAAO,EAAE;EAC1C,CAAA","debug_id":"f576f630-a4f5-5bef-8804-c42ffaa56fab"}
@@ -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]="a5b5a8fd-871e-5d18-97ab-33ba5a254b03")}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]="92f444b3-92ca-5810-8204-57a5e4af3816")}catch(e){}}();
3
3
  import { addDocument, closePHModal, setSelectedNode, useDocumentModelModuleById, usePHModal, useParentFolderForSelectedNode, useSelectedDriveSafe, useSelectedFolder } from "@powerhousedao/reactor-browser";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  import { CreateDocumentModal as CreateDocumentModal$1 } from "@powerhousedao/design-system/connect";
@@ -27,5 +27,5 @@ const CreateDocumentModal = () => {
27
27
  //#endregion
28
28
  export { CreateDocumentModal };
29
29
 
30
- //# sourceMappingURL=CreateDocumentModal-TtG7E62x.js.map
31
- //# debugId=a5b5a8fd-871e-5d18-97ab-33ba5a254b03
30
+ //# sourceMappingURL=CreateDocumentModal-BhJh4nWt.js.map
31
+ //# debugId=92f444b3-92ca-5810-8204-57a5e4af3816
@@ -1 +1 @@
1
- {"version":3,"file":"CreateDocumentModal-TtG7E62x.js","sources":["../src/components/modal/modals/CreateDocumentModal.tsx"],"sourcesContent":["import { CreateDocumentModal as ConnectCreateDocumentModal } from \"@powerhousedao/design-system/connect\";\nimport {\n addDocument,\n closePHModal,\n setSelectedNode,\n useDocumentModelModuleById,\n useParentFolderForSelectedNode,\n usePHModal,\n useSelectedDriveSafe,\n useSelectedFolder,\n} from \"@powerhousedao/reactor-browser\";\n\nexport const CreateDocumentModal: React.FC = () => {\n const phModal = usePHModal();\n const open = phModal?.type === \"createDocument\";\n const documentType = open ? phModal.documentType : undefined;\n const documentModel = useDocumentModelModuleById(documentType);\n const [selectedDrive] = useSelectedDriveSafe();\n const selectedFolder = useSelectedFolder();\n const parentFolder = useParentFolderForSelectedNode();\n\n const onCreateDocument = async (documentName: string) => {\n closePHModal();\n if (!selectedDrive || !documentModel) return;\n\n const node = await addDocument(\n selectedDrive.header.id,\n documentName || `New ${documentModel.documentModel.global.name}`,\n documentModel.documentModel.global.id,\n selectedFolder?.id ?? parentFolder?.id,\n );\n setSelectedNode(node);\n };\n\n return (\n <ConnectCreateDocumentModal\n open={open}\n onContinue={onCreateDocument}\n onOpenChange={(status: boolean) => {\n if (!status) return closePHModal();\n }}\n />\n );\n};\n"],"names":["ConnectCreateDocumentModal"],"mappings":";;;;;;AAYA,MAAa,4BAAsC;CACjD,MAAM,UAAU,YAAY;CAC5B,MAAM,OAAO,SAAS,SAAS;CAE/B,MAAM,gBAAgB,2BADD,OAAO,QAAQ,eAAe,KAAA,EACW;CAC9D,MAAM,CAAC,iBAAiB,sBAAsB;CAC9C,MAAM,iBAAiB,mBAAmB;CAC1C,MAAM,eAAe,gCAAgC;CAErD,MAAM,mBAAmB,OAAO,iBAAyB;AACvD,gBAAc;AACd,MAAI,CAAC,iBAAiB,CAAC,cAAe;AAQtC,kBANa,MAAM,YACjB,cAAc,OAAO,IACrB,gBAAgB,OAAO,cAAc,cAAc,OAAO,QAC1D,cAAc,cAAc,OAAO,IACnC,gBAAgB,MAAM,cAAc,GACrC,CACoB;;AAGvB,QACE,oBAACA,uBAAD;EACQ;EACN,YAAY;EACZ,eAAe,WAAoB;AACjC,OAAI,CAAC,OAAQ,QAAO,cAAc;;EAEpC,CAAA","debug_id":"a5b5a8fd-871e-5d18-97ab-33ba5a254b03"}
1
+ {"version":3,"file":"CreateDocumentModal-BhJh4nWt.js","sources":["../src/components/modal/modals/CreateDocumentModal.tsx"],"sourcesContent":["import { CreateDocumentModal as ConnectCreateDocumentModal } from \"@powerhousedao/design-system/connect\";\nimport {\n addDocument,\n closePHModal,\n setSelectedNode,\n useDocumentModelModuleById,\n useParentFolderForSelectedNode,\n usePHModal,\n useSelectedDriveSafe,\n useSelectedFolder,\n} from \"@powerhousedao/reactor-browser\";\n\nexport const CreateDocumentModal: React.FC = () => {\n const phModal = usePHModal();\n const open = phModal?.type === \"createDocument\";\n const documentType = open ? phModal.documentType : undefined;\n const documentModel = useDocumentModelModuleById(documentType);\n const [selectedDrive] = useSelectedDriveSafe();\n const selectedFolder = useSelectedFolder();\n const parentFolder = useParentFolderForSelectedNode();\n\n const onCreateDocument = async (documentName: string) => {\n closePHModal();\n if (!selectedDrive || !documentModel) return;\n\n const node = await addDocument(\n selectedDrive.header.id,\n documentName || `New ${documentModel.documentModel.global.name}`,\n documentModel.documentModel.global.id,\n selectedFolder?.id ?? parentFolder?.id,\n );\n setSelectedNode(node);\n };\n\n return (\n <ConnectCreateDocumentModal\n open={open}\n onContinue={onCreateDocument}\n onOpenChange={(status: boolean) => {\n if (!status) return closePHModal();\n }}\n />\n );\n};\n"],"names":["ConnectCreateDocumentModal"],"mappings":";;;;;;AAYA,MAAa,4BAAsC;CACjD,MAAM,UAAU,YAAY;CAC5B,MAAM,OAAO,SAAS,SAAS;CAE/B,MAAM,gBAAgB,2BADD,OAAO,QAAQ,eAAe,KAAA,EACW;CAC9D,MAAM,CAAC,iBAAiB,sBAAsB;CAC9C,MAAM,iBAAiB,mBAAmB;CAC1C,MAAM,eAAe,gCAAgC;CAErD,MAAM,mBAAmB,OAAO,iBAAyB;AACvD,gBAAc;AACd,MAAI,CAAC,iBAAiB,CAAC,cAAe;AAQtC,kBANa,MAAM,YACjB,cAAc,OAAO,IACrB,gBAAgB,OAAO,cAAc,cAAc,OAAO,QAC1D,cAAc,cAAc,OAAO,IACnC,gBAAgB,MAAM,cAAc,GACrC,CACoB;;AAGvB,QACE,oBAACA,uBAAD;EACQ;EACN,YAAY;EACZ,eAAe,WAAoB;AACjC,OAAI,CAAC,OAAQ,QAAO,cAAc;;EAEpC,CAAA","debug_id":"92f444b3-92ca-5810-8204-57a5e4af3816"}
@@ -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]="9146e627-fcab-5688-8d1d-e33196656cd3")}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]="ac3fd5bb-646e-58a8-ad3c-9e49f82b5f0d")}catch(e){}}();
3
3
  import { t as connectConfig } from "./connect.config-Cuh0hj_Q.js";
4
- import { n as getGitUrl, r as shortGitSha, t as getGitSha } from "./build-info-CmRhqPut.js";
5
- import { t as serviceWorkerManager } from "./registerServiceWorker-LI8_JXt3.js";
4
+ import { n as getGitUrl, r as shortGitSha, t as getGitSha } from "./build-info-CqrCD80-.js";
5
+ import { t as serviceWorkerManager } from "./registerServiceWorker-CMRF2LWE.js";
6
6
  import { closePHModal, usePHModal } from "@powerhousedao/reactor-browser";
7
7
  import { useEffect, useState } from "react";
8
8
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -26,7 +26,7 @@ const DebugSettingsModal = () => {
26
26
  },
27
27
  contentProps: { className: "rounded-2xl" },
28
28
  children: /* @__PURE__ */ jsxs("div", {
29
- className: "w-[700px] rounded-2xl p-6",
29
+ className: "w-[700px] rounded-2xl bg-white p-6",
30
30
  children: [
31
31
  /* @__PURE__ */ jsxs("div", {
32
32
  className: "mb-6 flex justify-between",
@@ -168,5 +168,5 @@ const DebugSettingsModal = () => {
168
168
  //#endregion
169
169
  export { DebugSettingsModal };
170
170
 
171
- //# sourceMappingURL=DebugSettingsModal-CTXVmgw0.js.map
172
- //# debugId=9146e627-fcab-5688-8d1d-e33196656cd3
171
+ //# sourceMappingURL=DebugSettingsModal-Ch-Kz25q.js.map
172
+ //# debugId=ac3fd5bb-646e-58a8-ad3c-9e49f82b5f0d
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DebugSettingsModal-Ch-Kz25q.js","sources":["../src/components/modal/modals/DebugSettingsModal.tsx"],"sourcesContent":["import { connectConfig } from \"@powerhousedao/connect/config\";\nimport {\n getGitSha,\n getGitUrl,\n serviceWorkerManager,\n shortGitSha,\n} from \"@powerhousedao/connect/utils\";\nimport { Icon, Modal, PowerhouseButton } from \"@powerhousedao/design-system\";\nimport { Combobox, FormInput } from \"@powerhousedao/design-system/connect\";\nimport { closePHModal, usePHModal } from \"@powerhousedao/reactor-browser\";\nimport { useEffect, useState } from \"react\";\n\nexport const DebugSettingsModal: React.FC = () => {\n const phModal = usePHModal();\n const open = phModal?.type === \"debugSettings\";\n\n const [appVersion, setAppVersion] = useState(connectConfig.appVersion);\n const [serviceWorkerDebugMode, setServiceWorkerDebugMode] = useState({\n label: serviceWorkerManager.debug ? \"Enabled\" : \"Disabled\",\n value: serviceWorkerManager.debug,\n });\n\n useEffect(() => {\n serviceWorkerManager.setDebug(serviceWorkerDebugMode.value);\n }, [serviceWorkerDebugMode]);\n\n return (\n <Modal\n open={open}\n onOpenChange={(status) => {\n if (!status) return closePHModal();\n }}\n contentProps={{\n className: \"rounded-2xl\",\n }}\n >\n <div className=\"w-[700px] rounded-2xl bg-white p-6\">\n <div className=\"mb-6 flex justify-between\">\n <div className=\"text-xl font-bold\">Debug Tools</div>\n <button id=\"close-modal\" onClick={() => closePHModal()}>\n <Icon name=\"Xmark\" size={28} />\n </button>\n </div>\n <div className=\"flex text-sm font-bold\">\n <Icon name=\"Ring\" size={22} />\n <span className=\"ml-2\">App Version: {connectConfig.appVersion}</span>\n {(() => {\n const sha = getGitSha();\n if (sha === \"unknown\") return null;\n const url = getGitUrl();\n const label = shortGitSha(sha);\n return url ? (\n <a\n className=\"ml-2 font-mono text-xs font-normal text-blue-600 hover:underline\"\n href={url}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n title={sha}\n >\n ({label})\n </a>\n ) : (\n <span\n className=\"ml-2 font-mono text-xs font-normal text-gray-500\"\n title={sha}\n >\n ({label})\n </span>\n );\n })()}\n </div>\n <div className=\"mt-4 flex text-sm font-bold\">\n <Icon name=\"Hdd\" size={22} />\n <span className=\"ml-2\">Drive Tools:</span>\n </div>\n\n <div className=\"mt-4 flex text-sm font-bold\">\n <Icon name=\"Gear\" size={22} />\n <span className=\"ml-2\">Service Worker Tools:</span>\n </div>\n <div className=\"mt-2 flex items-end justify-between pl-4\">\n <div className=\"w-[400px]\">\n <label htmlFor=\"serviceWorkerDebugMode\" className=\"text-xs\">\n Service Worker Debug Mode:\n </label>\n <Combobox\n id=\"serviceWorkerDebugMode\"\n onChange={(value) => {\n setServiceWorkerDebugMode(\n value as typeof serviceWorkerDebugMode,\n );\n }}\n value={serviceWorkerDebugMode}\n options={[\n { label: \"Enabled\", value: true },\n { label: \"Disabled\", value: false },\n ]}\n />\n </div>\n </div>\n <div className=\"mt-2 flex items-end justify-between pl-4\">\n <div className=\"w-[400px]\">\n <label htmlFor=\"appVersion\" className=\"text-xs\">\n Set invalid app version:\n </label>\n <FormInput\n containerClassName=\"p-1 bg-white border border-gray-200 rounded-md text-sm\"\n inputClassName=\"text-xs font-normal\"\n id=\"appVersion\"\n icon={\n <div className=\"flex h-full items-center text-xs\">Version:</div>\n }\n value={appVersion}\n onChange={(element) => setAppVersion(element.target.value)}\n />\n </div>\n <div className=\"mb-1 flex items-center justify-center\">\n <PowerhouseButton\n color={appVersion === \"\" ? \"light\" : \"red\"}\n size=\"small\"\n disabled={appVersion === \"\"}\n onClick={() => {\n // @ts-expect-error todo add send message method to service worker manager class\n serviceWorkerManager.sendMessage({\n type: \"SET_APP_VERSION\",\n version: appVersion,\n });\n setAppVersion(\"\");\n }}\n >\n Add Invalid App Version\n </PowerhouseButton>\n </div>\n </div>\n </div>\n </Modal>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;AAYA,MAAa,2BAAqC;CAEhD,MAAM,OADU,YAAY,EACN,SAAS;CAE/B,MAAM,CAAC,YAAY,iBAAiB,SAAS,cAAc,WAAW;CACtE,MAAM,CAAC,wBAAwB,6BAA6B,SAAS;EACnE,OAAO,qBAAqB,QAAQ,YAAY;EAChD,OAAO,qBAAqB;EAC7B,CAAC;AAEF,iBAAgB;AACd,uBAAqB,SAAS,uBAAuB,MAAM;IAC1D,CAAC,uBAAuB,CAAC;AAE5B,QACE,oBAAC,OAAD;EACQ;EACN,eAAe,WAAW;AACxB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oBAAC,UAAD;OACE,IAAG;OACH,WAAW,UAAU;AACnB,kCACE,MACD;;OAEH,OAAO;OACP,SAAS,CACP;QAAE,OAAO;QAAW,OAAO;QAAM,EACjC;QAAE,OAAO;QAAY,OAAO;QAAO,CACpC;OACD,CAAA,CACE;;KACF,CAAA;IACN,qBAAC,OAAD;KAAK,WAAU;eAAf,CACE,qBAAC,OAAD;MAAK,WAAU;gBAAf,CACE,oBAAC,SAAD;OAAO,SAAQ;OAAa,WAAU;iBAAU;OAExC,CAAA,EACR,oBAAC,WAAD;OACE,oBAAmB;OACnB,gBAAe;OACf,IAAG;OACH,MACE,oBAAC,OAAD;QAAK,WAAU;kBAAmC;QAAc,CAAA;OAElE,OAAO;OACP,WAAW,YAAY,cAAc,QAAQ,OAAO,MAAM;OAC1D,CAAA,CACE;SACN,oBAAC,OAAD;MAAK,WAAU;gBACb,oBAAC,kBAAD;OACE,OAAO,eAAe,KAAK,UAAU;OACrC,MAAK;OACL,UAAU,eAAe;OACzB,eAAe;AAEb,6BAAqB,YAAY;SAC/B,MAAM;SACN,SAAS;SACV,CAAC;AACF,sBAAc,GAAG;;iBAEpB;OAEkB,CAAA;MACf,CAAA,CACF;;IACF;;EACA,CAAA","debug_id":"ac3fd5bb-646e-58a8-ad3c-9e49f82b5f0d"}
@@ -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]="e1b60fc8-972a-5012-8233-640d10094e20")}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]="165f41a9-889e-5d44-bc73-daf0bda57062")}catch(e){}}();
3
3
  import { n as toast } from "./toast-DnODOv28.js";
4
4
  import { closePHModal, deleteDrive, setSelectedDrive, useDriveById, useDrives, usePHModal } from "@powerhousedao/reactor-browser";
5
5
  import { useTranslation } from "react-i18next";
@@ -12,6 +12,7 @@ const DeleteDriveModal = () => {
12
12
  const driveId = open ? phModal.driveId : void 0;
13
13
  const [drive] = useDriveById(driveId);
14
14
  const drives = useDrives();
15
+ const { t } = useTranslation();
15
16
  if (!drive) return null;
16
17
  async function onDeleteDrive() {
17
18
  if (!driveId) return;
@@ -20,7 +21,6 @@ const DeleteDriveModal = () => {
20
21
  closePHModal();
21
22
  toast(t("notifications.deleteDriveSuccess"), { type: "connect-deleted" });
22
23
  }
23
- const { t } = useTranslation();
24
24
  return /* @__PURE__ */ jsx(ConnectDeleteDriveModal, {
25
25
  open,
26
26
  driveName: drive.header.name,
@@ -39,5 +39,5 @@ const DeleteDriveModal = () => {
39
39
  //#endregion
40
40
  export { DeleteDriveModal };
41
41
 
42
- //# sourceMappingURL=DeleteDriveModal-Cb43NeNu.js.map
43
- //# debugId=e1b60fc8-972a-5012-8233-640d10094e20
42
+ //# sourceMappingURL=DeleteDriveModal-CbuIdjKY.js.map
43
+ //# debugId=165f41a9-889e-5d44-bc73-daf0bda57062
@@ -1 +1 @@
1
- {"version":3,"file":"DeleteDriveModal-Cb43NeNu.js","sources":["../src/components/modal/modals/DeleteDriveModal.tsx"],"sourcesContent":["import { toast } from \"@powerhousedao/connect/services\";\nimport { ConnectDeleteDriveModal } from \"@powerhousedao/design-system/connect\";\nimport {\n closePHModal,\n deleteDrive,\n setSelectedDrive,\n useDriveById,\n useDrives,\n usePHModal,\n} from \"@powerhousedao/reactor-browser\";\nimport { useTranslation } from \"react-i18next\";\n\nexport const DeleteDriveModal: React.FC = () => {\n const phModal = usePHModal();\n const open = phModal?.type === \"deleteDrive\";\n const driveId = open ? phModal.driveId : undefined;\n const [drive] = useDriveById(driveId);\n const drives = useDrives();\n if (!drive) {\n return null;\n }\n async function onDeleteDrive() {\n if (!driveId) {\n return;\n }\n await deleteDrive(driveId);\n\n setSelectedDrive(drives?.[0]);\n closePHModal();\n\n toast(t(\"notifications.deleteDriveSuccess\"), {\n type: \"connect-deleted\",\n });\n }\n\n const { t } = useTranslation();\n\n return (\n <ConnectDeleteDriveModal\n open={open}\n driveName={drive.header.name}\n onCancel={closePHModal}\n header={t(\"modals.deleteDrive.title\", { label: drive.header.name })}\n body={t(\"modals.deleteDrive.body\")}\n inputPlaceholder={t(\"modals.deleteDrive.inputPlaceholder\")}\n cancelLabel={t(\"common.cancel\")}\n continueLabel={t(\"common.delete\")}\n onContinue={() => onDeleteDrive()}\n onOpenChange={(status: boolean) => {\n if (!status) return closePHModal();\n }}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;;AAYA,MAAa,yBAAmC;CAC9C,MAAM,UAAU,YAAY;CAC5B,MAAM,OAAO,SAAS,SAAS;CAC/B,MAAM,UAAU,OAAO,QAAQ,UAAU,KAAA;CACzC,MAAM,CAAC,SAAS,aAAa,QAAQ;CACrC,MAAM,SAAS,WAAW;AAC1B,KAAI,CAAC,MACH,QAAO;CAET,eAAe,gBAAgB;AAC7B,MAAI,CAAC,QACH;AAEF,QAAM,YAAY,QAAQ;AAE1B,mBAAiB,SAAS,GAAG;AAC7B,gBAAc;AAEd,QAAM,EAAE,mCAAmC,EAAE,EAC3C,MAAM,mBACP,CAAC;;CAGJ,MAAM,EAAE,MAAM,gBAAgB;AAE9B,QACE,oBAAC,yBAAD;EACQ;EACN,WAAW,MAAM,OAAO;EACxB,UAAU;EACV,QAAQ,EAAE,4BAA4B,EAAE,OAAO,MAAM,OAAO,MAAM,CAAC;EACnE,MAAM,EAAE,0BAA0B;EAClC,kBAAkB,EAAE,sCAAsC;EAC1D,aAAa,EAAE,gBAAgB;EAC/B,eAAe,EAAE,gBAAgB;EACjC,kBAAkB,eAAe;EACjC,eAAe,WAAoB;AACjC,OAAI,CAAC,OAAQ,QAAO,cAAc;;EAEpC,CAAA","debug_id":"e1b60fc8-972a-5012-8233-640d10094e20"}
1
+ {"version":3,"file":"DeleteDriveModal-CbuIdjKY.js","sources":["../src/components/modal/modals/DeleteDriveModal.tsx"],"sourcesContent":["import { toast } from \"@powerhousedao/connect/services\";\nimport { ConnectDeleteDriveModal } from \"@powerhousedao/design-system/connect\";\nimport {\n closePHModal,\n deleteDrive,\n setSelectedDrive,\n useDriveById,\n useDrives,\n usePHModal,\n} from \"@powerhousedao/reactor-browser\";\nimport { useTranslation } from \"react-i18next\";\n\nexport const DeleteDriveModal: React.FC = () => {\n const phModal = usePHModal();\n const open = phModal?.type === \"deleteDrive\";\n const driveId = open ? phModal.driveId : undefined;\n const [drive] = useDriveById(driveId);\n const drives = useDrives();\n const { t } = useTranslation();\n\n if (!drive) {\n return null;\n }\n async function onDeleteDrive() {\n if (!driveId) {\n return;\n }\n await deleteDrive(driveId);\n\n setSelectedDrive(drives?.[0]);\n closePHModal();\n\n toast(t(\"notifications.deleteDriveSuccess\"), {\n type: \"connect-deleted\",\n });\n }\n\n return (\n <ConnectDeleteDriveModal\n open={open}\n driveName={drive.header.name}\n onCancel={closePHModal}\n header={t(\"modals.deleteDrive.title\", { label: drive.header.name })}\n body={t(\"modals.deleteDrive.body\")}\n inputPlaceholder={t(\"modals.deleteDrive.inputPlaceholder\")}\n cancelLabel={t(\"common.cancel\")}\n continueLabel={t(\"common.delete\")}\n onContinue={() => onDeleteDrive()}\n onOpenChange={(status: boolean) => {\n if (!status) return closePHModal();\n }}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;;AAYA,MAAa,yBAAmC;CAC9C,MAAM,UAAU,YAAY;CAC5B,MAAM,OAAO,SAAS,SAAS;CAC/B,MAAM,UAAU,OAAO,QAAQ,UAAU,KAAA;CACzC,MAAM,CAAC,SAAS,aAAa,QAAQ;CACrC,MAAM,SAAS,WAAW;CAC1B,MAAM,EAAE,MAAM,gBAAgB;AAE9B,KAAI,CAAC,MACH,QAAO;CAET,eAAe,gBAAgB;AAC7B,MAAI,CAAC,QACH;AAEF,QAAM,YAAY,QAAQ;AAE1B,mBAAiB,SAAS,GAAG;AAC7B,gBAAc;AAEd,QAAM,EAAE,mCAAmC,EAAE,EAC3C,MAAM,mBACP,CAAC;;AAGJ,QACE,oBAAC,yBAAD;EACQ;EACN,WAAW,MAAM,OAAO;EACxB,UAAU;EACV,QAAQ,EAAE,4BAA4B,EAAE,OAAO,MAAM,OAAO,MAAM,CAAC;EACnE,MAAM,EAAE,0BAA0B;EAClC,kBAAkB,EAAE,sCAAsC;EAC1D,aAAa,EAAE,gBAAgB;EAC/B,eAAe,EAAE,gBAAgB;EACjC,kBAAkB,eAAe;EACjC,eAAe,WAAoB;AACjC,OAAI,CAAC,OAAQ,QAAO,cAAc;;EAEpC,CAAA","debug_id":"165f41a9-889e-5d44-bc73-daf0bda57062"}
@@ -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]="22e26ea9-9650-5be5-9e5d-cf1f2baba2bb")}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]="17042bf5-f602-5def-b8d9-d39220e5c71c")}catch(e){}}();
3
3
  import { n as toast } from "./toast-DnODOv28.js";
4
4
  import { closePHModal, deleteNode, setSelectedNode, useNodeById, useNodeParentFolderById, usePHModal, useSelectedDriveId } from "@powerhousedao/reactor-browser";
5
5
  import "react";
@@ -38,5 +38,5 @@ const DeleteItemModal = () => {
38
38
  //#endregion
39
39
  export { DeleteItemModal };
40
40
 
41
- //# sourceMappingURL=DeleteItemModal-Brq4QKdd.js.map
42
- //# debugId=22e26ea9-9650-5be5-9e5d-cf1f2baba2bb
41
+ //# sourceMappingURL=DeleteItemModal-9ErYlauT.js.map
42
+ //# debugId=17042bf5-f602-5def-b8d9-d39220e5c71c
@@ -1 +1 @@
1
- {"version":3,"file":"DeleteItemModal-Brq4QKdd.js","sources":["../src/components/modal/modals/DeleteItemModal.tsx"],"sourcesContent":["import { toast } from \"@powerhousedao/connect/services\";\nimport { ConnectDeleteItemModal } from \"@powerhousedao/design-system/connect\";\nimport {\n closePHModal,\n deleteNode,\n setSelectedNode,\n useNodeById,\n useNodeParentFolderById,\n usePHModal,\n useSelectedDriveId,\n} from \"@powerhousedao/reactor-browser\";\nimport React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nexport const DeleteItemModal: React.FC = () => {\n const phModal = usePHModal();\n const open = phModal?.type === \"deleteItem\";\n const id = open ? phModal.id : undefined;\n const { t } = useTranslation();\n const node = useNodeById(id);\n const name = node?.name;\n const kind = node?.kind;\n const selectedDriveId = useSelectedDriveId();\n const nodeParentFolder = useNodeParentFolderById(node?.parentFolder);\n async function onDelete() {\n if (!selectedDriveId || !id) {\n return;\n }\n closePHModal();\n\n const i18nKey =\n kind === \"FOLDER\"\n ? \"notifications.deleteFolderSuccess\"\n : \"notifications.fileDeleteSuccess\";\n\n await deleteNode(selectedDriveId, id);\n\n setSelectedNode(nodeParentFolder);\n\n toast(t(i18nKey), { type: \"connect-deleted\" });\n }\n\n return (\n <ConnectDeleteItemModal\n open={open}\n onDelete={() => onDelete()}\n onCancel={() => closePHModal()}\n header={t(`modals.deleteItem.${kind?.toLowerCase()}.header`, {\n item: name,\n })}\n body={t(`modals.deleteItem.${kind?.toLowerCase()}.body`)}\n cancelLabel={t(\"common.cancel\")}\n deleteLabel={t(\"common.delete\")}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAcA,MAAa,wBAAkC;CAC7C,MAAM,UAAU,YAAY;CAC5B,MAAM,OAAO,SAAS,SAAS;CAC/B,MAAM,KAAK,OAAO,QAAQ,KAAK,KAAA;CAC/B,MAAM,EAAE,MAAM,gBAAgB;CAC9B,MAAM,OAAO,YAAY,GAAG;CAC5B,MAAM,OAAO,MAAM;CACnB,MAAM,OAAO,MAAM;CACnB,MAAM,kBAAkB,oBAAoB;CAC5C,MAAM,mBAAmB,wBAAwB,MAAM,aAAa;CACpE,eAAe,WAAW;AACxB,MAAI,CAAC,mBAAmB,CAAC,GACvB;AAEF,gBAAc;EAEd,MAAM,UACJ,SAAS,WACL,sCACA;AAEN,QAAM,WAAW,iBAAiB,GAAG;AAErC,kBAAgB,iBAAiB;AAEjC,QAAM,EAAE,QAAQ,EAAE,EAAE,MAAM,mBAAmB,CAAC;;AAGhD,QACE,oBAAC,wBAAD;EACQ;EACN,gBAAgB,UAAU;EAC1B,gBAAgB,cAAc;EAC9B,QAAQ,EAAE,qBAAqB,MAAM,aAAa,CAAC,UAAU,EAC3D,MAAM,MACP,CAAC;EACF,MAAM,EAAE,qBAAqB,MAAM,aAAa,CAAC,OAAO;EACxD,aAAa,EAAE,gBAAgB;EAC/B,aAAa,EAAE,gBAAgB;EAC/B,CAAA","debug_id":"22e26ea9-9650-5be5-9e5d-cf1f2baba2bb"}
1
+ {"version":3,"file":"DeleteItemModal-9ErYlauT.js","sources":["../src/components/modal/modals/DeleteItemModal.tsx"],"sourcesContent":["import { toast } from \"@powerhousedao/connect/services\";\nimport { ConnectDeleteItemModal } from \"@powerhousedao/design-system/connect\";\nimport {\n closePHModal,\n deleteNode,\n setSelectedNode,\n useNodeById,\n useNodeParentFolderById,\n usePHModal,\n useSelectedDriveId,\n} from \"@powerhousedao/reactor-browser\";\nimport React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nexport const DeleteItemModal: React.FC = () => {\n const phModal = usePHModal();\n const open = phModal?.type === \"deleteItem\";\n const id = open ? phModal.id : undefined;\n const { t } = useTranslation();\n const node = useNodeById(id);\n const name = node?.name;\n const kind = node?.kind;\n const selectedDriveId = useSelectedDriveId();\n const nodeParentFolder = useNodeParentFolderById(node?.parentFolder);\n async function onDelete() {\n if (!selectedDriveId || !id) {\n return;\n }\n closePHModal();\n\n const i18nKey =\n kind === \"FOLDER\"\n ? \"notifications.deleteFolderSuccess\"\n : \"notifications.fileDeleteSuccess\";\n\n await deleteNode(selectedDriveId, id);\n\n setSelectedNode(nodeParentFolder);\n\n toast(t(i18nKey), { type: \"connect-deleted\" });\n }\n\n return (\n <ConnectDeleteItemModal\n open={open}\n onDelete={() => onDelete()}\n onCancel={() => closePHModal()}\n header={t(`modals.deleteItem.${kind?.toLowerCase()}.header`, {\n item: name,\n })}\n body={t(`modals.deleteItem.${kind?.toLowerCase()}.body`)}\n cancelLabel={t(\"common.cancel\")}\n deleteLabel={t(\"common.delete\")}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAcA,MAAa,wBAAkC;CAC7C,MAAM,UAAU,YAAY;CAC5B,MAAM,OAAO,SAAS,SAAS;CAC/B,MAAM,KAAK,OAAO,QAAQ,KAAK,KAAA;CAC/B,MAAM,EAAE,MAAM,gBAAgB;CAC9B,MAAM,OAAO,YAAY,GAAG;CAC5B,MAAM,OAAO,MAAM;CACnB,MAAM,OAAO,MAAM;CACnB,MAAM,kBAAkB,oBAAoB;CAC5C,MAAM,mBAAmB,wBAAwB,MAAM,aAAa;CACpE,eAAe,WAAW;AACxB,MAAI,CAAC,mBAAmB,CAAC,GACvB;AAEF,gBAAc;EAEd,MAAM,UACJ,SAAS,WACL,sCACA;AAEN,QAAM,WAAW,iBAAiB,GAAG;AAErC,kBAAgB,iBAAiB;AAEjC,QAAM,EAAE,QAAQ,EAAE,EAAE,MAAM,mBAAmB,CAAC;;AAGhD,QACE,oBAAC,wBAAD;EACQ;EACN,gBAAgB,UAAU;EAC1B,gBAAgB,cAAc;EAC9B,QAAQ,EAAE,qBAAqB,MAAM,aAAa,CAAC,UAAU,EAC3D,MAAM,MACP,CAAC;EACF,MAAM,EAAE,qBAAqB,MAAM,aAAa,CAAC,OAAO;EACxD,aAAa,EAAE,gBAAgB;EAC/B,aAAa,EAAE,gBAAgB;EAC/B,CAAA","debug_id":"17042bf5-f602-5def-b8d9-d39220e5c71c"}
@@ -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]="0e987691-5c7d-583b-a176-13c0375d5fdd")}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]="7207edb3-ac8d-53c8-a948-e88ad51c1720")}catch(e){}}();
3
3
  import { closePHModal, usePHModal } from "@powerhousedao/reactor-browser";
4
4
  import "react";
5
5
  import { useTranslation } from "react-i18next";
@@ -20,5 +20,5 @@ const DisclaimerModal = () => {
20
20
  //#endregion
21
21
  export { DisclaimerModal };
22
22
 
23
- //# sourceMappingURL=DisclaimerModal-Dk6PpkZU.js.map
24
- //# debugId=0e987691-5c7d-583b-a176-13c0375d5fdd
23
+ //# sourceMappingURL=DisclaimerModal-CfDeiBz8.js.map
24
+ //# debugId=7207edb3-ac8d-53c8-a948-e88ad51c1720
@@ -1 +1 @@
1
- {"version":3,"file":"DisclaimerModal-Dk6PpkZU.js","sources":["../src/components/modal/modals/DisclaimerModal.tsx"],"sourcesContent":["import { ReadRequiredModal } from \"@powerhousedao/design-system/connect\";\nimport { closePHModal, usePHModal } from \"@powerhousedao/reactor-browser\";\nimport React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nexport const DisclaimerModal: React.FC = () => {\n const phModal = usePHModal();\n const open = phModal?.type === \"disclaimer\";\n\n const { t } = useTranslation();\n\n return (\n <ReadRequiredModal\n open={open}\n header={t(\"modals.disclaimer.title\")}\n body={t(\"modals.disclaimer.body\")}\n closeLabel=\"Close\"\n onContinue={() => closePHModal()}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;;AAKA,MAAa,wBAAkC;CAE7C,MAAM,OADU,YAAY,EACN,SAAS;CAE/B,MAAM,EAAE,MAAM,gBAAgB;AAE9B,QACE,oBAAC,mBAAD;EACQ;EACN,QAAQ,EAAE,0BAA0B;EACpC,MAAM,EAAE,yBAAyB;EACjC,YAAW;EACX,kBAAkB,cAAc;EAChC,CAAA","debug_id":"0e987691-5c7d-583b-a176-13c0375d5fdd"}
1
+ {"version":3,"file":"DisclaimerModal-CfDeiBz8.js","sources":["../src/components/modal/modals/DisclaimerModal.tsx"],"sourcesContent":["import { ReadRequiredModal } from \"@powerhousedao/design-system/connect\";\nimport { closePHModal, usePHModal } from \"@powerhousedao/reactor-browser\";\nimport React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nexport const DisclaimerModal: React.FC = () => {\n const phModal = usePHModal();\n const open = phModal?.type === \"disclaimer\";\n\n const { t } = useTranslation();\n\n return (\n <ReadRequiredModal\n open={open}\n header={t(\"modals.disclaimer.title\")}\n body={t(\"modals.disclaimer.body\")}\n closeLabel=\"Close\"\n onContinue={() => closePHModal()}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;;AAKA,MAAa,wBAAkC;CAE7C,MAAM,OADU,YAAY,EACN,SAAS;CAE/B,MAAM,EAAE,MAAM,gBAAgB;AAE9B,QACE,oBAAC,mBAAD;EACQ;EACN,QAAQ,EAAE,0BAA0B;EACpC,MAAM,EAAE,yBAAyB;EACjC,YAAW;EACX,kBAAkB,cAAc;EAChC,CAAA","debug_id":"7207edb3-ac8d-53c8-a948-e88ad51c1720"}
@@ -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]="11bbd5bb-1a95-5038-9924-5e4d0633b28e")}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]="38e1ed7f-7882-5c78-9bf2-fc4dd946f5b8")}catch(e){}}();
3
3
  import { closePHModal, exportFile, useDocumentById, usePHModal, validateDocument } from "@powerhousedao/reactor-browser";
4
4
  import { useTranslation } from "react-i18next";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -40,5 +40,5 @@ function DownloadDocumentWithErrorsModal() {
40
40
  //#endregion
41
41
  export { DownloadDocumentWithErrorsModal };
42
42
 
43
- //# sourceMappingURL=DownloadDocumentWithErrorsModal-B8ZKi2Xy.js.map
44
- //# debugId=11bbd5bb-1a95-5038-9924-5e4d0633b28e
43
+ //# sourceMappingURL=DownloadDocumentWithErrorsModal-KZGWQ4J7.js.map
44
+ //# debugId=38e1ed7f-7882-5c78-9bf2-fc4dd946f5b8
@@ -1 +1 @@
1
- {"version":3,"file":"DownloadDocumentWithErrorsModal-B8ZKi2Xy.js","sources":["../src/components/modal/modals/DownloadDocumentWithErrorsModal.tsx"],"sourcesContent":["import { ConnectConfirmationModal } from \"@powerhousedao/design-system/connect\";\nimport {\n closePHModal,\n exportFile,\n useDocumentById,\n usePHModal,\n validateDocument,\n} from \"@powerhousedao/reactor-browser\";\nimport { useTranslation } from \"react-i18next\";\nexport function DownloadDocumentWithErrorsModal() {\n const phModal = usePHModal();\n const open = phModal?.type === \"downloadDocumentWithErrors\";\n const documentId = open ? phModal.documentId : undefined;\n const [document] = useDocumentById(documentId);\n const { t } = useTranslation();\n\n if (!document) {\n return null;\n }\n\n const validationErrors = validateDocument(document);\n return (\n <ConnectConfirmationModal\n header={t(\"modals.downloadDocumentWithErrors.title\")}\n title={t(\"modals.downloadDocumentWithErrors.title\")}\n body={\n <div>\n <p>{t(\"modals.downloadDocumentWithErrors.body\")}</p>\n <ul className=\"mt-4 flex list-disc flex-col items-start px-4 text-xs\">\n {validationErrors.map((error, index) => (\n <li key={index}>{error.message}</li>\n ))}\n </ul>\n </div>\n }\n cancelLabel={t(\"common.cancel\")}\n continueLabel={t(\"common.export\")}\n onCancel={() => closePHModal()}\n onContinue={async () => {\n try {\n await exportFile(document);\n } catch (error) {\n console.error(error);\n } finally {\n closePHModal();\n }\n }}\n open={open}\n onOpenChange={(status: boolean) => {\n if (!status) return closePHModal();\n }}\n />\n );\n}\n"],"names":[],"mappings":";;;;;;;AASA,SAAgB,kCAAkC;CAChD,MAAM,UAAU,YAAY;CAC5B,MAAM,OAAO,SAAS,SAAS;CAE/B,MAAM,CAAC,YAAY,gBADA,OAAO,QAAQ,aAAa,KAAA,EACD;CAC9C,MAAM,EAAE,MAAM,gBAAgB;AAE9B,KAAI,CAAC,SACH,QAAO;CAGT,MAAM,mBAAmB,iBAAiB,SAAS;AACnD,QACE,oBAAC,0BAAD;EACE,QAAQ,EAAE,0CAA0C;EACpD,OAAO,EAAE,0CAA0C;EACnD,MACE,qBAAC,OAAD,EAAA,UAAA,CACE,oBAAC,KAAD,EAAA,UAAI,EAAE,yCAAyC,EAAK,CAAA,EACpD,oBAAC,MAAD;GAAI,WAAU;aACX,iBAAiB,KAAK,OAAO,UAC5B,oBAAC,MAAD,EAAA,UAAiB,MAAM,SAAa,EAA3B,MAA2B,CACpC;GACC,CAAA,CACD,EAAA,CAAA;EAER,aAAa,EAAE,gBAAgB;EAC/B,eAAe,EAAE,gBAAgB;EACjC,gBAAgB,cAAc;EAC9B,YAAY,YAAY;AACtB,OAAI;AACF,UAAM,WAAW,SAAS;YACnB,OAAO;AACd,YAAQ,MAAM,MAAM;aACZ;AACR,kBAAc;;;EAGZ;EACN,eAAe,WAAoB;AACjC,OAAI,CAAC,OAAQ,QAAO,cAAc;;EAEpC,CAAA","debug_id":"11bbd5bb-1a95-5038-9924-5e4d0633b28e"}
1
+ {"version":3,"file":"DownloadDocumentWithErrorsModal-KZGWQ4J7.js","sources":["../src/components/modal/modals/DownloadDocumentWithErrorsModal.tsx"],"sourcesContent":["import { ConnectConfirmationModal } from \"@powerhousedao/design-system/connect\";\nimport {\n closePHModal,\n exportFile,\n useDocumentById,\n usePHModal,\n validateDocument,\n} from \"@powerhousedao/reactor-browser\";\nimport { useTranslation } from \"react-i18next\";\nexport function DownloadDocumentWithErrorsModal() {\n const phModal = usePHModal();\n const open = phModal?.type === \"downloadDocumentWithErrors\";\n const documentId = open ? phModal.documentId : undefined;\n const [document] = useDocumentById(documentId);\n const { t } = useTranslation();\n\n if (!document) {\n return null;\n }\n\n const validationErrors = validateDocument(document);\n return (\n <ConnectConfirmationModal\n header={t(\"modals.downloadDocumentWithErrors.title\")}\n title={t(\"modals.downloadDocumentWithErrors.title\")}\n body={\n <div>\n <p>{t(\"modals.downloadDocumentWithErrors.body\")}</p>\n <ul className=\"mt-4 flex list-disc flex-col items-start px-4 text-xs\">\n {validationErrors.map((error, index) => (\n <li key={index}>{error.message}</li>\n ))}\n </ul>\n </div>\n }\n cancelLabel={t(\"common.cancel\")}\n continueLabel={t(\"common.export\")}\n onCancel={() => closePHModal()}\n onContinue={async () => {\n try {\n await exportFile(document);\n } catch (error) {\n console.error(error);\n } finally {\n closePHModal();\n }\n }}\n open={open}\n onOpenChange={(status: boolean) => {\n if (!status) return closePHModal();\n }}\n />\n );\n}\n"],"names":[],"mappings":";;;;;;;AASA,SAAgB,kCAAkC;CAChD,MAAM,UAAU,YAAY;CAC5B,MAAM,OAAO,SAAS,SAAS;CAE/B,MAAM,CAAC,YAAY,gBADA,OAAO,QAAQ,aAAa,KAAA,EACD;CAC9C,MAAM,EAAE,MAAM,gBAAgB;AAE9B,KAAI,CAAC,SACH,QAAO;CAGT,MAAM,mBAAmB,iBAAiB,SAAS;AACnD,QACE,oBAAC,0BAAD;EACE,QAAQ,EAAE,0CAA0C;EACpD,OAAO,EAAE,0CAA0C;EACnD,MACE,qBAAC,OAAD,EAAA,UAAA,CACE,oBAAC,KAAD,EAAA,UAAI,EAAE,yCAAyC,EAAK,CAAA,EACpD,oBAAC,MAAD;GAAI,WAAU;aACX,iBAAiB,KAAK,OAAO,UAC5B,oBAAC,MAAD,EAAA,UAAiB,MAAM,SAAa,EAA3B,MAA2B,CACpC;GACC,CAAA,CACD,EAAA,CAAA;EAER,aAAa,EAAE,gBAAgB;EAC/B,eAAe,EAAE,gBAAgB;EACjC,gBAAgB,cAAc;EAC9B,YAAY,YAAY;AACtB,OAAI;AACF,UAAM,WAAW,SAAS;YACnB,OAAO;AACd,YAAQ,MAAM,MAAM;aACZ;AACR,kBAAc;;;EAGZ;EACN,eAAe,WAAoB;AACjC,OAAI,CAAC,OAAQ,QAAO,cAAc;;EAEpC,CAAA","debug_id":"38e1ed7f-7882-5c78-9bf2-fc4dd946f5b8"}
@@ -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]="14e41981-7dc9-519d-af37-bcc503c27c60")}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]="8c6e26dd-7f0a-5259-b2d4-eee9e2f5dec1")}catch(e){}}();
3
3
  import { closePHModal, driveCollectionId, renameDrive, setDriveAvailableOffline, setDriveSharingType, showPHModal, useDriveById, useDriveSystemInfo, usePHModal, useSyncList } from "@powerhousedao/reactor-browser";
4
4
  import { useMemo } from "react";
5
5
  import { jsx } from "react/jsx-runtime";
@@ -47,5 +47,5 @@ function DriveSettingsModal() {
47
47
  //#endregion
48
48
  export { DriveSettingsModal };
49
49
 
50
- //# sourceMappingURL=DriveSettingsModal-Bnug5LXo.js.map
51
- //# debugId=14e41981-7dc9-519d-af37-bcc503c27c60
50
+ //# sourceMappingURL=DriveSettingsModal-DEk05PS7.js.map
51
+ //# debugId=8c6e26dd-7f0a-5259-b2d4-eee9e2f5dec1
@@ -1 +1 @@
1
- {"version":3,"file":"DriveSettingsModal-Bnug5LXo.js","sources":["../src/components/modal/modals/DriveSettingsModal.tsx"],"sourcesContent":["import { DriveSettingsModal as ConnectDriveSettingsModal } from \"@powerhousedao/design-system/connect\";\nimport {\n closePHModal,\n driveCollectionId,\n renameDrive,\n setDriveAvailableOffline,\n setDriveSharingType,\n showPHModal,\n useDriveById,\n useDriveSystemInfo,\n usePHModal,\n useSyncList,\n} from \"@powerhousedao/reactor-browser\";\nimport type { DocumentDriveDocument } from \"@powerhousedao/shared/document-drive\";\nimport type { SharingType } from \"@powerhousedao/shared/document-drive\";\nimport { useMemo } from \"react\";\n\nexport function DriveSettingsModal() {\n const phModal = usePHModal();\n const open = phModal?.type === \"driveSettings\";\n const driveId = open ? phModal.driveId : undefined;\n const [drive] = useDriveById(driveId);\n const remotes = useSyncList();\n\n const isRemoteDrive = useMemo(() => {\n if (!drive) return false;\n return remotes.some(\n (remote) =>\n remote.collectionId === driveCollectionId(\"main\", drive.header.id),\n );\n }, [remotes, drive]);\n\n const systemInfo = useDriveSystemInfo(drive);\n\n if (!driveId || !drive) {\n return null;\n }\n\n async function onRenameDrive(drive: DocumentDriveDocument, newName: string) {\n await renameDrive(drive.header.id, newName);\n }\n\n async function onChangeSharingType(\n drive: DocumentDriveDocument,\n newSharingType: SharingType,\n ) {\n await setDriveSharingType(drive.header.id, newSharingType);\n }\n\n async function onChangeAvailableOffline(\n drive: DocumentDriveDocument,\n newAvailableOffline: boolean,\n ) {\n await setDriveAvailableOffline(drive.header.id, newAvailableOffline);\n }\n\n return (\n <ConnectDriveSettingsModal\n drive={drive}\n sharingType={isRemoteDrive ? \"PUBLIC\" : \"LOCAL\"}\n availableOffline={!isRemoteDrive}\n systemInfo={systemInfo}\n open={open}\n onRenameDrive={onRenameDrive}\n onDeleteDrive={() => showPHModal({ type: \"deleteDrive\", driveId })}\n onChangeAvailableOffline={onChangeAvailableOffline}\n onChangeSharingType={onChangeSharingType}\n onOpenChange={(status) => {\n if (!status) return closePHModal();\n }}\n />\n );\n}\n"],"names":["ConnectDriveSettingsModal"],"mappings":";;;;;;;AAiBA,SAAgB,qBAAqB;CACnC,MAAM,UAAU,YAAY;CAC5B,MAAM,OAAO,SAAS,SAAS;CAC/B,MAAM,UAAU,OAAO,QAAQ,UAAU,KAAA;CACzC,MAAM,CAAC,SAAS,aAAa,QAAQ;CACrC,MAAM,UAAU,aAAa;CAE7B,MAAM,gBAAgB,cAAc;AAClC,MAAI,CAAC,MAAO,QAAO;AACnB,SAAO,QAAQ,MACZ,WACC,OAAO,iBAAiB,kBAAkB,QAAQ,MAAM,OAAO,GAAG,CACrE;IACA,CAAC,SAAS,MAAM,CAAC;CAEpB,MAAM,aAAa,mBAAmB,MAAM;AAE5C,KAAI,CAAC,WAAW,CAAC,MACf,QAAO;CAGT,eAAe,cAAc,OAA8B,SAAiB;AAC1E,QAAM,YAAY,MAAM,OAAO,IAAI,QAAQ;;CAG7C,eAAe,oBACb,OACA,gBACA;AACA,QAAM,oBAAoB,MAAM,OAAO,IAAI,eAAe;;CAG5D,eAAe,yBACb,OACA,qBACA;AACA,QAAM,yBAAyB,MAAM,OAAO,IAAI,oBAAoB;;AAGtE,QACE,oBAACA,sBAAD;EACS;EACP,aAAa,gBAAgB,WAAW;EACxC,kBAAkB,CAAC;EACP;EACN;EACS;EACf,qBAAqB,YAAY;GAAE,MAAM;GAAe;GAAS,CAAC;EACxC;EACL;EACrB,eAAe,WAAW;AACxB,OAAI,CAAC,OAAQ,QAAO,cAAc;;EAEpC,CAAA","debug_id":"14e41981-7dc9-519d-af37-bcc503c27c60"}
1
+ {"version":3,"file":"DriveSettingsModal-DEk05PS7.js","sources":["../src/components/modal/modals/DriveSettingsModal.tsx"],"sourcesContent":["import { DriveSettingsModal as ConnectDriveSettingsModal } from \"@powerhousedao/design-system/connect\";\nimport {\n closePHModal,\n driveCollectionId,\n renameDrive,\n setDriveAvailableOffline,\n setDriveSharingType,\n showPHModal,\n useDriveById,\n useDriveSystemInfo,\n usePHModal,\n useSyncList,\n} from \"@powerhousedao/reactor-browser\";\nimport type { DocumentDriveDocument } from \"@powerhousedao/shared/document-drive\";\nimport type { SharingType } from \"@powerhousedao/shared/document-drive\";\nimport { useMemo } from \"react\";\n\nexport function DriveSettingsModal() {\n const phModal = usePHModal();\n const open = phModal?.type === \"driveSettings\";\n const driveId = open ? phModal.driveId : undefined;\n const [drive] = useDriveById(driveId);\n const remotes = useSyncList();\n\n const isRemoteDrive = useMemo(() => {\n if (!drive) return false;\n return remotes.some(\n (remote) =>\n remote.collectionId === driveCollectionId(\"main\", drive.header.id),\n );\n }, [remotes, drive]);\n\n const systemInfo = useDriveSystemInfo(drive);\n\n if (!driveId || !drive) {\n return null;\n }\n\n async function onRenameDrive(drive: DocumentDriveDocument, newName: string) {\n await renameDrive(drive.header.id, newName);\n }\n\n async function onChangeSharingType(\n drive: DocumentDriveDocument,\n newSharingType: SharingType,\n ) {\n await setDriveSharingType(drive.header.id, newSharingType);\n }\n\n async function onChangeAvailableOffline(\n drive: DocumentDriveDocument,\n newAvailableOffline: boolean,\n ) {\n await setDriveAvailableOffline(drive.header.id, newAvailableOffline);\n }\n\n return (\n <ConnectDriveSettingsModal\n drive={drive}\n sharingType={isRemoteDrive ? \"PUBLIC\" : \"LOCAL\"}\n availableOffline={!isRemoteDrive}\n systemInfo={systemInfo}\n open={open}\n onRenameDrive={onRenameDrive}\n onDeleteDrive={() => showPHModal({ type: \"deleteDrive\", driveId })}\n onChangeAvailableOffline={onChangeAvailableOffline}\n onChangeSharingType={onChangeSharingType}\n onOpenChange={(status) => {\n if (!status) return closePHModal();\n }}\n />\n );\n}\n"],"names":["ConnectDriveSettingsModal"],"mappings":";;;;;;;AAiBA,SAAgB,qBAAqB;CACnC,MAAM,UAAU,YAAY;CAC5B,MAAM,OAAO,SAAS,SAAS;CAC/B,MAAM,UAAU,OAAO,QAAQ,UAAU,KAAA;CACzC,MAAM,CAAC,SAAS,aAAa,QAAQ;CACrC,MAAM,UAAU,aAAa;CAE7B,MAAM,gBAAgB,cAAc;AAClC,MAAI,CAAC,MAAO,QAAO;AACnB,SAAO,QAAQ,MACZ,WACC,OAAO,iBAAiB,kBAAkB,QAAQ,MAAM,OAAO,GAAG,CACrE;IACA,CAAC,SAAS,MAAM,CAAC;CAEpB,MAAM,aAAa,mBAAmB,MAAM;AAE5C,KAAI,CAAC,WAAW,CAAC,MACf,QAAO;CAGT,eAAe,cAAc,OAA8B,SAAiB;AAC1E,QAAM,YAAY,MAAM,OAAO,IAAI,QAAQ;;CAG7C,eAAe,oBACb,OACA,gBACA;AACA,QAAM,oBAAoB,MAAM,OAAO,IAAI,eAAe;;CAG5D,eAAe,yBACb,OACA,qBACA;AACA,QAAM,yBAAyB,MAAM,OAAO,IAAI,oBAAoB;;AAGtE,QACE,oBAACA,sBAAD;EACS;EACP,aAAa,gBAAgB,WAAW;EACxC,kBAAkB,CAAC;EACP;EACN;EACS;EACf,qBAAqB,YAAY;GAAE,MAAM;GAAe;GAAS,CAAC;EACxC;EACL;EACrB,eAAe,WAAW;AACxB,OAAI,CAAC,OAAQ,QAAO,cAAc;;EAEpC,CAAA","debug_id":"8c6e26dd-7f0a-5259-b2d4-eee9e2f5dec1"}
@@ -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]="700d62e7-ad53-5101-970d-d967aa02fc0c")}catch(e){}}();
3
- import { c as subscribeReactorPgMajor, o as loadPgDump, r as getCachedReactorPgMajor, s as resolvePgMajorForRuntime } from "./pglite-runtime-C1g-4Jxl.js";
4
- import { t as PENDING_PG_SEED_KEY } from "./pglite-seed-BtXWFpHf.js";
5
- import { t as clearReactorStorage } from "./reactor-Nm3jOev1.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]="d7acea58-7847-5ed8-a6b6-878e7b667a40")}catch(e){}}();
3
+ import { c as subscribeReactorPgMajor, o as loadPgDump, r as getCachedReactorPgMajor, s as resolvePgMajorForRuntime } from "./pglite-runtime-Btp8ZXVH.js";
4
+ import { t as PENDING_PG_SEED_KEY } from "./pglite-seed-b1mJUaip.js";
5
+ import { t as clearReactorStorage } from "./reactor-DFuRedvV.js";
6
6
  import { DocumentIntegrityService, InMemoryQueue, PollBehavior, REACTOR_SCHEMA, addRemoteDrive, closePHModal, useConnectionStates, useDatabase, usePGlite, usePHModal, useReactorClientModule, useSync } from "@powerhousedao/reactor-browser";
7
7
  import { useCallback, useMemo, useSyncExternalStore } from "react";
8
8
  import { jsx } from "react/jsx-runtime";
@@ -371,5 +371,5 @@ const InspectorModal = () => {
371
371
  //#endregion
372
372
  export { InspectorModal };
373
373
 
374
- //# sourceMappingURL=InspectorModal-EDrjiXPs.js.map
375
- //# debugId=700d62e7-ad53-5101-970d-d967aa02fc0c
374
+ //# sourceMappingURL=InspectorModal-DV7lUbNo.js.map
375
+ //# debugId=d7acea58-7847-5ed8-a6b6-878e7b667a40
@@ -1 +1 @@
1
- {"version":3,"file":"InspectorModal-EDrjiXPs.js","sources":["../src/components/modal/modals/InspectorModal/useDbExplorer.ts","../src/components/modal/modals/InspectorModal/useDebugInspector.ts","../src/components/modal/modals/InspectorModal/useIntegrityInspector.ts","../src/components/modal/modals/InspectorModal/useProcessorsInspector.ts","../src/components/modal/modals/InspectorModal/useQueueInspector.ts","../src/components/modal/modals/InspectorModal/useRemotesInspector.ts","../src/components/modal/modals/InspectorModal/InspectorModal.tsx"],"sourcesContent":["import {\n getCachedReactorPgMajor,\n loadPgDump,\n resolvePgMajorForRuntime,\n} from \"@powerhousedao/connect/utils\";\nimport type {\n FilterGroup,\n SortOptions,\n} from \"@powerhousedao/design-system/connect\";\nimport {\n REACTOR_SCHEMA,\n useDatabase,\n usePGlite,\n useReactorClientModule,\n type IQueue,\n} from \"@powerhousedao/reactor-browser\";\nimport { sql } from \"kysely\";\nimport { useCallback } from \"react\";\n\nasync function quiesceQueue(queue: IQueue): Promise<void> {\n await new Promise<void>((resolve) => queue.block(() => resolve()));\n}\n\n// The reactor runs with `relaxedDurability: true`, which makes PGlite's\n// `syncToFs()` fire the IDBFS→IndexedDB write and return without awaiting\n// Emscripten's syncfs callback. `close()` also doesn't flush. Calling\n// `FS.syncfs(false, cb)` directly gives us a callback that fires from the\n// IDBFS transaction's `oncomplete` — i.e. after IDB has actually committed.\nasync function syncPgliteToIdb(pglite: {\n readonly Module: {\n readonly FS: {\n syncfs(populate: boolean, cb: (err: Error | null) => void): void;\n };\n };\n}): Promise<void> {\n await new Promise<void>((resolve, reject) => {\n pglite.Module.FS.syncfs(false, (err) => (err ? reject(err) : resolve()));\n });\n}\n\ntype ColumnInfo = {\n readonly name: string;\n readonly dataType: string;\n readonly isNullable: boolean;\n};\n\ntype TableInfo = {\n readonly name: string;\n readonly columns: ColumnInfo[];\n};\n\ntype ColumnRow = {\n table_name: string;\n column_name: string;\n data_type: string;\n is_nullable: string;\n};\n\ntype GetTableRowsOptions = {\n readonly schema?: string;\n readonly limit: number;\n readonly offset: number;\n readonly sort?: SortOptions;\n readonly filters?: FilterGroup;\n};\n\ntype TablePage = {\n readonly columns: string[];\n readonly rows: Record<string, unknown>[];\n readonly total: number | null;\n};\n\nconst PRIORITY_COLUMNS = [\n \"documentType\",\n \"documentId\",\n \"scope\",\n \"branch\",\n \"index\",\n \"skip\",\n] as const;\n\nexport function useDbExplorer() {\n const database = useDatabase();\n const pglite = usePGlite();\n const reactorClientModule = useReactorClientModule();\n const reactor = reactorClientModule?.reactorModule?.reactor;\n const queue = reactorClientModule?.reactorModule?.queue;\n\n const getTables = useCallback(async (): Promise<TableInfo[]> => {\n if (!database) return [];\n\n const result = await sql<ColumnRow>`\n SELECT\n c.table_name,\n c.column_name,\n c.data_type,\n c.is_nullable\n FROM information_schema.columns c\n INNER JOIN information_schema.tables t\n ON c.table_name = t.table_name\n AND c.table_schema = t.table_schema\n WHERE c.table_schema = ${REACTOR_SCHEMA}\n AND t.table_type = 'BASE TABLE'\n ORDER BY c.table_name, c.ordinal_position\n `.execute(database);\n\n const tableMap = new Map<string, ColumnInfo[]>();\n for (const row of result.rows) {\n if (!tableMap.has(row.table_name)) {\n tableMap.set(row.table_name, []);\n }\n tableMap.get(row.table_name)!.push({\n name: row.column_name,\n dataType: row.data_type,\n isNullable: row.is_nullable === \"YES\",\n });\n }\n\n return Array.from(tableMap).map(([name, columns]) => {\n const columnNames = columns.map((col) => col.name);\n const orderedColumns = [\n ...PRIORITY_COLUMNS.filter((col) => columnNames.includes(col)).map(\n (col) => columns.find((c) => c.name === col)!,\n ),\n ...columns.filter(\n (col) =>\n !PRIORITY_COLUMNS.includes(\n col.name as (typeof PRIORITY_COLUMNS)[number],\n ),\n ),\n ];\n return {\n name,\n columns: orderedColumns,\n };\n });\n }, [database]);\n\n const getTableRows = useCallback(\n async (table: string, options: GetTableRowsOptions): Promise<TablePage> => {\n if (!database) {\n return { columns: [], rows: [], total: null };\n }\n\n const limit = options.limit;\n const offset = options.offset;\n const sort = options.sort;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const filters = options.filters;\n const tableRef = sql.raw(`${REACTOR_SCHEMA}.\"${table}\"`);\n\n // Build WHERE clause from filters\n let whereClause = sql``;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (filters?.clauses && filters.clauses.length > 0) {\n const conditions: ReturnType<typeof sql>[] = [];\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n for (let i = 0; i < filters.clauses.length; i++) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment\n const clause = filters.clauses[i];\n if (!clause) continue;\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const columnRef = sql.raw(`\"${clause.column}\"`);\n\n let condition: ReturnType<typeof sql>;\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (clause.operator === \"IS NULL\") {\n condition = sql`${columnRef} IS NULL`;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n } else if (clause.operator === \"IS NOT NULL\") {\n condition = sql`${columnRef} IS NOT NULL`;\n } else if (\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n clause.operator === \"LIKE\" ||\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n clause.operator === \"ILIKE\"\n ) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment\n const value = clause.value;\n const operator =\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n clause.operator === \"LIKE\" ? sql`LIKE` : sql`ILIKE`;\n condition = sql`${columnRef} ${operator} ${value}`;\n } else {\n // For =, !=, >, <, >=, <=\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument\n const operator = sql.raw(clause.operator);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment\n const value = clause.value;\n\n // Try to parse as number if it looks like a number\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n let parsedValue: string | number = value;\n if (\n value !== \"\" &&\n !isNaN(Number(value)) &&\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access\n value.trim() !== \"\"\n ) {\n parsedValue = Number(value);\n }\n\n condition = sql`${columnRef} ${operator} ${parsedValue}`;\n }\n\n conditions.push(condition);\n\n // Add connector if not the last clause\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (i < filters.clauses.length - 1) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment\n const connector = filters.connectors?.[i] ?? \"AND\";\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n conditions.push(sql.raw(connector));\n }\n }\n\n // Combine all conditions\n if (conditions.length > 0) {\n whereClause = sql`WHERE ${sql.join(conditions, sql` `)}`;\n }\n }\n\n // Build main query\n let query;\n if (sort) {\n const columnRef = sql.raw(`\"${sort.column}\"`);\n const direction = sort.direction === \"desc\" ? sql`DESC` : sql`ASC`;\n query = sql<Record<string, unknown>>`\n SELECT * FROM ${tableRef}\n ${whereClause}\n ORDER BY ${columnRef} ${direction}\n LIMIT ${limit} OFFSET ${offset}\n `;\n } else {\n query = sql<Record<string, unknown>>`\n SELECT * FROM ${tableRef}\n ${whereClause}\n LIMIT ${limit} OFFSET ${offset}\n `;\n }\n\n const result = await query.execute(database);\n\n // Build count query with same filters\n const countQuery = sql<{ count: string }>`\n SELECT COUNT(*) as count FROM ${tableRef}\n ${whereClause}\n `;\n const countResult = await countQuery.execute(database);\n const total = countResult.rows[0]\n ? parseInt(countResult.rows[0].count, 10)\n : null;\n\n const rawColumns =\n result.rows.length > 0 ? Object.keys(result.rows[0]) : [];\n const columns = [\n ...PRIORITY_COLUMNS.filter((col) => rawColumns.includes(col)),\n ...rawColumns.filter(\n (col) =>\n !PRIORITY_COLUMNS.includes(\n col as (typeof PRIORITY_COLUMNS)[number],\n ),\n ),\n ];\n\n return {\n columns,\n rows: result.rows,\n total,\n };\n },\n [database],\n );\n\n const onExportDb = useCallback(async () => {\n if (!pglite) return;\n\n if (queue) await quiesceQueue(queue);\n\n try {\n const major = resolvePgMajorForRuntime(getCachedReactorPgMajor() ?? null);\n const pgDump = await loadPgDump(major);\n const dump = await pgDump({ pg: pglite });\n const sqlContent = await dump.text();\n\n const blob = new Blob([sqlContent], { type: \"text/sql\" });\n const url = URL.createObjectURL(blob);\n const a = document.createElement(\"a\");\n a.href = url;\n a.download = `database-export-${Date.now()}.sql`;\n a.click();\n URL.revokeObjectURL(url);\n } finally {\n queue?.unblock();\n }\n }, [pglite, queue]);\n\n const onImportDb = useCallback(\n async (sqlContent: string) => {\n if (!pglite) return;\n\n if (queue) await quiesceQueue(queue);\n\n if (reactor) {\n const status = reactor.kill();\n await status.completed;\n }\n\n // Drop every user-created schema before restoring. Processors may own\n // schemas beyond `reactor`, so dropping only that one leaves orphans\n // whose tables collide with whatever the dump recreates. The dump\n // itself emits `CREATE SCHEMA ...;` statements, so we don't pre-create.\n // `standard_conforming_strings=off` matches pg_dump's escape-string\n // literals so doubled backslashes in JSONB collapse correctly.\n await pglite.transaction(async (tx) => {\n const schemas = await tx.query<{ nspname: string }>(\n `SELECT nspname FROM pg_namespace\n WHERE nspname NOT IN ('pg_catalog', 'pg_toast', 'information_schema', 'public')\n AND nspname NOT LIKE 'pg_temp_%'\n AND nspname NOT LIKE 'pg_toast_temp_%'`,\n );\n for (const { nspname } of schemas.rows) {\n await tx.exec(`DROP SCHEMA IF EXISTS \"${nspname}\" CASCADE`);\n }\n try {\n await tx.exec(\"SET standard_conforming_strings = off;\");\n } catch {\n // PG17 still accepts this but log if it ever fails.\n }\n await tx.exec(sqlContent);\n await tx.exec(`SET search_path TO ${REACTOR_SCHEMA}`);\n });\n\n // Flush IDBFS → IndexedDB synchronously. PGlite's own syncToFs is\n // fire-and-forget under relaxedDurability, and close() doesn't run\n // a final sync, so we drive Emscripten's syncfs directly — its\n // callback fires from the IDB transaction's oncomplete, guaranteeing\n // the writes have committed before we reload.\n await syncPgliteToIdb(pglite);\n\n window.location.reload();\n // reload() is asynchronous; without blocking here the DBExplorer caller\n // would continue and call loadTables() against an in-flight shutdown.\n await new Promise(() => {});\n },\n [pglite, queue, reactor],\n );\n\n const getDefaultSort = useCallback(\n (table: string): SortOptions | undefined => {\n if (table === \"Operation\") {\n return { column: \"timestampUtcMs\", direction: \"desc\" };\n }\n return undefined;\n },\n [],\n );\n\n return {\n getTables,\n getTableRows,\n getDefaultSort,\n onExportDb,\n onImportDb,\n };\n}\n","import { clearReactorStorage } from \"@powerhousedao/connect/store\";\nimport {\n getCachedReactorPgMajor,\n PENDING_PG_SEED_KEY,\n subscribeReactorPgMajor,\n} from \"@powerhousedao/connect/utils\";\nimport { useCallback, useSyncExternalStore } from \"react\";\n\nconst SUPPORTED_PG_VERSIONS = [16, 17] as const;\n\nexport function useDebugInspector() {\n const currentPgVersion = useSyncExternalStore(\n subscribeReactorPgMajor,\n getCachedReactorPgMajor,\n () => undefined,\n );\n\n const onResetToPgVersion = useCallback(async (major: number) => {\n console.info(`[debug-inspector] Reset requested: PG${major}`);\n try {\n localStorage.setItem(PENDING_PG_SEED_KEY, String(major));\n console.info(`[debug-inspector] Clearing reactor storage...`);\n await clearReactorStorage();\n console.info(`[debug-inspector] Storage cleared. Reloading...`);\n window.location.reload();\n } catch (err) {\n console.error(\"[debug-inspector] Reset failed:\", err);\n localStorage.removeItem(PENDING_PG_SEED_KEY);\n throw err;\n }\n }, []);\n\n return {\n supportedPgVersions: SUPPORTED_PG_VERSIONS,\n currentPgVersion: currentPgVersion ?? null,\n onResetToPgVersion,\n };\n}\n","import type { IntegrityInspectorProps } from \"@powerhousedao/design-system/connect\";\nimport {\n DocumentIntegrityService,\n useReactorClientModule,\n} from \"@powerhousedao/reactor-browser\";\nimport { useCallback, useMemo } from \"react\";\n\nexport function useIntegrityInspector(): IntegrityInspectorProps | undefined {\n const reactorClientModule = useReactorClientModule();\n const reactorModule = reactorClientModule?.reactorModule;\n\n const service = useMemo(() => {\n if (!reactorModule) return undefined;\n\n return new DocumentIntegrityService(\n reactorModule.keyframeStore,\n reactorModule.operationStore,\n reactorModule.writeCache,\n reactorModule.documentView,\n reactorModule.documentModelRegistry,\n );\n }, [reactorModule]);\n\n const onValidate = useCallback(\n async (documentId: string, branch?: string) => {\n if (!service) {\n throw new Error(\"Reactor module not available\");\n }\n return service.validateDocument(documentId, branch);\n },\n [service],\n );\n\n const onRebuildKeyframes = useCallback(\n async (documentId: string, branch?: string) => {\n if (!service) {\n throw new Error(\"Reactor module not available\");\n }\n return service.rebuildKeyframes(documentId, branch);\n },\n [service],\n );\n\n const onRebuildSnapshots = useCallback(\n async (documentId: string, branch?: string) => {\n if (!service) {\n throw new Error(\"Reactor module not available\");\n }\n return service.rebuildSnapshots(documentId, branch);\n },\n [service],\n );\n\n if (!service) {\n return undefined;\n }\n\n return {\n onValidate,\n onRebuildKeyframes,\n onRebuildSnapshots,\n };\n}\n","import type { ProcessorsInspectorProps } from \"@powerhousedao/design-system/connect\";\nimport { useReactorClientModule } from \"@powerhousedao/reactor-browser\";\nimport { useCallback, useMemo } from \"react\";\n\nexport function useProcessorsInspector(): ProcessorsInspectorProps | undefined {\n const reactorClientModule = useReactorClientModule();\n const processorManager = reactorClientModule?.reactorModule?.processorManager;\n\n const hasProcessorManager = useMemo(\n () => processorManager != null,\n [processorManager],\n );\n\n const getProcessors = useCallback(async () => {\n if (!processorManager) {\n return [];\n }\n\n return processorManager.getAll().map((tracked) => ({\n processorId: tracked.processorId,\n factoryId: tracked.factoryId,\n driveId: tracked.driveId,\n processorIndex: tracked.processorIndex,\n lastOrdinal: tracked.lastOrdinal,\n status: tracked.status,\n lastError: tracked.lastError,\n lastErrorTimestamp: tracked.lastErrorTimestamp,\n }));\n }, [processorManager]);\n\n const onRetry = useCallback(\n async (processorId: string) => {\n if (!processorManager) return;\n const tracked = processorManager.get(processorId);\n if (tracked) {\n await tracked.retry();\n }\n },\n [processorManager],\n );\n\n if (!hasProcessorManager) {\n return undefined;\n }\n\n return {\n getProcessors,\n onRetry,\n };\n}\n","import type {\n QueueInspectorProps,\n QueueState,\n} from \"@powerhousedao/design-system/connect\";\nimport {\n InMemoryQueue,\n useReactorClientModule,\n type Job,\n} from \"@powerhousedao/reactor-browser\";\nimport { useCallback, useMemo } from \"react\";\n\nexport function useQueueInspector(): QueueInspectorProps | undefined {\n const reactorClientModule = useReactorClientModule();\n const queue = reactorClientModule?.reactorModule?.queue;\n\n const inMemoryQueue = useMemo(() => {\n if (queue instanceof InMemoryQueue) {\n return queue;\n }\n return undefined;\n }, [queue]);\n\n const getQueueState = useCallback(async (): Promise<QueueState> => {\n if (!inMemoryQueue) {\n return {\n isPaused: false,\n pendingJobs: [],\n executingJobs: [],\n totalPending: 0,\n totalExecuting: 0,\n };\n }\n\n const pendingJobs = inMemoryQueue.getPendingJobs();\n const executingJobIds = inMemoryQueue.getExecutingJobIds();\n\n const executingJobs: Job[] = [];\n for (const jobIdSet of executingJobIds.values()) {\n for (const jobId of jobIdSet) {\n const job = inMemoryQueue.getJob(jobId);\n if (job) {\n executingJobs.push(job);\n }\n }\n }\n\n return {\n isPaused: inMemoryQueue.paused,\n pendingJobs,\n executingJobs,\n totalPending: pendingJobs.length,\n totalExecuting: executingJobs.length,\n };\n }, [inMemoryQueue]);\n\n const onPause = useCallback(async (): Promise<void> => {\n if (inMemoryQueue) {\n inMemoryQueue.pause();\n }\n }, [inMemoryQueue]);\n\n const onResume = useCallback(async (): Promise<void> => {\n if (inMemoryQueue) {\n await inMemoryQueue.resume();\n }\n }, [inMemoryQueue]);\n\n if (!inMemoryQueue) {\n return undefined;\n }\n\n return {\n getQueueState,\n onPause,\n onResume,\n };\n}\n","import type {\n ConnectionStateSnapshot,\n Remote,\n} from \"@powerhousedao/reactor-browser\";\nimport {\n addRemoteDrive,\n PollBehavior,\n useConnectionStates,\n useSync,\n} from \"@powerhousedao/reactor-browser\";\nimport { useCallback } from \"react\";\n\nexport function useRemotesInspector(): {\n getRemotes: () => Promise<Remote[]>;\n removeRemote: (name: string) => Promise<void>;\n addRemoteManual: (url: string) => Promise<void>;\n triggerPull: (name: string) => void;\n connectionStates: ReadonlyMap<string, ConnectionStateSnapshot>;\n} {\n const syncManager = useSync();\n if (!syncManager) {\n throw new Error(\"Sync manager not found\");\n }\n\n const connectionStates = useConnectionStates();\n\n const getRemotes = useCallback(() => {\n return Promise.resolve(syncManager.list());\n }, [syncManager]);\n\n const removeRemote = useCallback(\n (name: string) => syncManager.remove(name),\n [syncManager],\n );\n\n const addRemoteManual = useCallback(async (url: string) => {\n await addRemoteDrive(url, undefined, {\n pollBehavior: PollBehavior.Manual,\n });\n }, []);\n\n const triggerPull = useCallback(\n (name: string) => syncManager.triggerPull(name),\n [syncManager],\n );\n\n return {\n getRemotes,\n removeRemote,\n addRemoteManual,\n triggerPull,\n connectionStates,\n };\n}\n","import { InspectorModal as ConnectInspectorModal } from \"@powerhousedao/design-system/connect\";\nimport { REACTOR_SCHEMA } from \"@powerhousedao/reactor-browser\";\nimport { closePHModal, usePHModal } from \"@powerhousedao/reactor-browser\";\nimport { useDbExplorer } from \"./useDbExplorer.js\";\nimport { useDebugInspector } from \"./useDebugInspector.js\";\nimport { useIntegrityInspector } from \"./useIntegrityInspector.js\";\nimport { useProcessorsInspector } from \"./useProcessorsInspector.js\";\nimport { useQueueInspector } from \"./useQueueInspector.js\";\nimport { useRemotesInspector } from \"./useRemotesInspector.js\";\n\nconst DEFAULT_PAGE_SIZE = 25;\n\nexport const InspectorModal: React.FC = () => {\n const phModal = usePHModal();\n const open = phModal?.type === \"inspector\";\n\n const { getTables, getTableRows, getDefaultSort, onExportDb, onImportDb } =\n useDbExplorer();\n const {\n getRemotes,\n removeRemote,\n addRemoteManual,\n triggerPull,\n connectionStates,\n } = useRemotesInspector();\n const queueInspectorProps = useQueueInspector();\n const processorsInspectorProps = useProcessorsInspector();\n const integrityInspectorProps = useIntegrityInspector();\n const { currentPgVersion, supportedPgVersions, onResetToPgVersion } =\n useDebugInspector();\n\n return (\n <ConnectInspectorModal\n open={open}\n onOpenChange={(status) => {\n if (!status) closePHModal();\n }}\n dbExplorerProps={{\n schema: REACTOR_SCHEMA,\n getTables,\n getTableRows,\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n getDefaultSort,\n pageSize: DEFAULT_PAGE_SIZE,\n onExportDb,\n onImportDb,\n pgVersionControl: {\n currentPgVersion,\n supportedPgVersions,\n onResetToPgVersion,\n },\n }}\n remotesInspectorProps={{\n getRemotes,\n removeRemote,\n addRemoteManual,\n triggerPull,\n connectionStates,\n }}\n queueInspectorProps={queueInspectorProps}\n processorsInspectorProps={processorsInspectorProps}\n integrityInspectorProps={integrityInspectorProps}\n />\n );\n};\n"],"names":["ConnectInspectorModal"],"mappings":";;;;;;;;;;;AAmBA,eAAe,aAAa,OAA8B;AACxD,OAAM,IAAI,SAAe,YAAY,MAAM,YAAY,SAAS,CAAC,CAAC;;AAQpE,eAAe,gBAAgB,QAMb;AAChB,OAAM,IAAI,SAAe,SAAS,WAAW;AAC3C,SAAO,OAAO,GAAG,OAAO,QAAQ,QAAS,MAAM,OAAO,IAAI,GAAG,SAAS,CAAE;GACxE;;AAmCJ,MAAM,mBAAmB;CACvB;CACA;CACA;CACA;CACA;CACA;CACD;AAED,SAAgB,gBAAgB;CAC9B,MAAM,WAAW,aAAa;CAC9B,MAAM,SAAS,WAAW;CAC1B,MAAM,sBAAsB,wBAAwB;CACpD,MAAM,UAAU,qBAAqB,eAAe;CACpD,MAAM,QAAQ,qBAAqB,eAAe;CAElD,MAAM,YAAY,YAAY,YAAkC;AAC9D,MAAI,CAAC,SAAU,QAAO,EAAE;EAExB,MAAM,SAAS,MAAM,GAAc;;;;;;;;;;+BAUR,eAAe;;;MAGxC,QAAQ,SAAS;EAEnB,MAAM,2BAAW,IAAI,KAA2B;AAChD,OAAK,MAAM,OAAO,OAAO,MAAM;AAC7B,OAAI,CAAC,SAAS,IAAI,IAAI,WAAW,CAC/B,UAAS,IAAI,IAAI,YAAY,EAAE,CAAC;AAElC,YAAS,IAAI,IAAI,WAAW,CAAE,KAAK;IACjC,MAAM,IAAI;IACV,UAAU,IAAI;IACd,YAAY,IAAI,gBAAgB;IACjC,CAAC;;AAGJ,SAAO,MAAM,KAAK,SAAS,CAAC,KAAK,CAAC,MAAM,aAAa;GACnD,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EAE7B,iBAAiB;GACf,QAAQ;GACR;GACA;GAEA;GACA,UAAU;GACV;GACA;GACA,kBAAkB;IAChB;IACA;IACA;IACD;GACF;EACD,uBAAuB;GACrB;GACA;GACA;GACA;GACA;GACD;EACoB;EACK;EACD;EACzB,CAAA","debug_id":"700d62e7-ad53-5101-970d-d967aa02fc0c"}
1
+ {"version":3,"file":"InspectorModal-DV7lUbNo.js","sources":["../src/components/modal/modals/InspectorModal/useDbExplorer.ts","../src/components/modal/modals/InspectorModal/useDebugInspector.ts","../src/components/modal/modals/InspectorModal/useIntegrityInspector.ts","../src/components/modal/modals/InspectorModal/useProcessorsInspector.ts","../src/components/modal/modals/InspectorModal/useQueueInspector.ts","../src/components/modal/modals/InspectorModal/useRemotesInspector.ts","../src/components/modal/modals/InspectorModal/InspectorModal.tsx"],"sourcesContent":["import {\n getCachedReactorPgMajor,\n loadPgDump,\n resolvePgMajorForRuntime,\n} from \"@powerhousedao/connect/utils\";\nimport type {\n FilterGroup,\n SortOptions,\n} from \"@powerhousedao/design-system/connect\";\nimport {\n REACTOR_SCHEMA,\n useDatabase,\n usePGlite,\n useReactorClientModule,\n type IQueue,\n} from \"@powerhousedao/reactor-browser\";\nimport { sql } from \"kysely\";\nimport { useCallback } from \"react\";\n\nasync function quiesceQueue(queue: IQueue): Promise<void> {\n await new Promise<void>((resolve) => queue.block(() => resolve()));\n}\n\n// The reactor runs with `relaxedDurability: true`, which makes PGlite's\n// `syncToFs()` fire the IDBFS→IndexedDB write and return without awaiting\n// Emscripten's syncfs callback. `close()` also doesn't flush. Calling\n// `FS.syncfs(false, cb)` directly gives us a callback that fires from the\n// IDBFS transaction's `oncomplete` — i.e. after IDB has actually committed.\nasync function syncPgliteToIdb(pglite: {\n readonly Module: {\n readonly FS: {\n syncfs(populate: boolean, cb: (err: Error | null) => void): void;\n };\n };\n}): Promise<void> {\n await new Promise<void>((resolve, reject) => {\n pglite.Module.FS.syncfs(false, (err) => (err ? reject(err) : resolve()));\n });\n}\n\ntype ColumnInfo = {\n readonly name: string;\n readonly dataType: string;\n readonly isNullable: boolean;\n};\n\ntype TableInfo = {\n readonly name: string;\n readonly columns: ColumnInfo[];\n};\n\ntype ColumnRow = {\n table_name: string;\n column_name: string;\n data_type: string;\n is_nullable: string;\n};\n\ntype GetTableRowsOptions = {\n readonly schema?: string;\n readonly limit: number;\n readonly offset: number;\n readonly sort?: SortOptions;\n readonly filters?: FilterGroup;\n};\n\ntype TablePage = {\n readonly columns: string[];\n readonly rows: Record<string, unknown>[];\n readonly total: number | null;\n};\n\nconst PRIORITY_COLUMNS = [\n \"documentType\",\n \"documentId\",\n \"scope\",\n \"branch\",\n \"index\",\n \"skip\",\n] as const;\n\nexport function useDbExplorer() {\n const database = useDatabase();\n const pglite = usePGlite();\n const reactorClientModule = useReactorClientModule();\n const reactor = reactorClientModule?.reactorModule?.reactor;\n const queue = reactorClientModule?.reactorModule?.queue;\n\n const getTables = useCallback(async (): Promise<TableInfo[]> => {\n if (!database) return [];\n\n const result = await sql<ColumnRow>`\n SELECT\n c.table_name,\n c.column_name,\n c.data_type,\n c.is_nullable\n FROM information_schema.columns c\n INNER JOIN information_schema.tables t\n ON c.table_name = t.table_name\n AND c.table_schema = t.table_schema\n WHERE c.table_schema = ${REACTOR_SCHEMA}\n AND t.table_type = 'BASE TABLE'\n ORDER BY c.table_name, c.ordinal_position\n `.execute(database);\n\n const tableMap = new Map<string, ColumnInfo[]>();\n for (const row of result.rows) {\n if (!tableMap.has(row.table_name)) {\n tableMap.set(row.table_name, []);\n }\n tableMap.get(row.table_name)!.push({\n name: row.column_name,\n dataType: row.data_type,\n isNullable: row.is_nullable === \"YES\",\n });\n }\n\n return Array.from(tableMap).map(([name, columns]) => {\n const columnNames = columns.map((col) => col.name);\n const orderedColumns = [\n ...PRIORITY_COLUMNS.filter((col) => columnNames.includes(col)).map(\n (col) => columns.find((c) => c.name === col)!,\n ),\n ...columns.filter(\n (col) =>\n !PRIORITY_COLUMNS.includes(\n col.name as (typeof PRIORITY_COLUMNS)[number],\n ),\n ),\n ];\n return {\n name,\n columns: orderedColumns,\n };\n });\n }, [database]);\n\n const getTableRows = useCallback(\n async (table: string, options: GetTableRowsOptions): Promise<TablePage> => {\n if (!database) {\n return { columns: [], rows: [], total: null };\n }\n\n const limit = options.limit;\n const offset = options.offset;\n const sort = options.sort;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const filters = options.filters;\n const tableRef = sql.raw(`${REACTOR_SCHEMA}.\"${table}\"`);\n\n // Build WHERE clause from filters\n let whereClause = sql``;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (filters?.clauses && filters.clauses.length > 0) {\n const conditions: ReturnType<typeof sql>[] = [];\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n for (let i = 0; i < filters.clauses.length; i++) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment\n const clause = filters.clauses[i];\n if (!clause) continue;\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const columnRef = sql.raw(`\"${clause.column}\"`);\n\n let condition: ReturnType<typeof sql>;\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (clause.operator === \"IS NULL\") {\n condition = sql`${columnRef} IS NULL`;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n } else if (clause.operator === \"IS NOT NULL\") {\n condition = sql`${columnRef} IS NOT NULL`;\n } else if (\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n clause.operator === \"LIKE\" ||\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n clause.operator === \"ILIKE\"\n ) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment\n const value = clause.value;\n const operator =\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n clause.operator === \"LIKE\" ? sql`LIKE` : sql`ILIKE`;\n condition = sql`${columnRef} ${operator} ${value}`;\n } else {\n // For =, !=, >, <, >=, <=\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument\n const operator = sql.raw(clause.operator);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment\n const value = clause.value;\n\n // Try to parse as number if it looks like a number\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n let parsedValue: string | number = value;\n if (\n value !== \"\" &&\n !isNaN(Number(value)) &&\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access\n value.trim() !== \"\"\n ) {\n parsedValue = Number(value);\n }\n\n condition = sql`${columnRef} ${operator} ${parsedValue}`;\n }\n\n conditions.push(condition);\n\n // Add connector if not the last clause\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (i < filters.clauses.length - 1) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment\n const connector = filters.connectors?.[i] ?? \"AND\";\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n conditions.push(sql.raw(connector));\n }\n }\n\n // Combine all conditions\n if (conditions.length > 0) {\n whereClause = sql`WHERE ${sql.join(conditions, sql` `)}`;\n }\n }\n\n // Build main query\n let query;\n if (sort) {\n const columnRef = sql.raw(`\"${sort.column}\"`);\n const direction = sort.direction === \"desc\" ? sql`DESC` : sql`ASC`;\n query = sql<Record<string, unknown>>`\n SELECT * FROM ${tableRef}\n ${whereClause}\n ORDER BY ${columnRef} ${direction}\n LIMIT ${limit} OFFSET ${offset}\n `;\n } else {\n query = sql<Record<string, unknown>>`\n SELECT * FROM ${tableRef}\n ${whereClause}\n LIMIT ${limit} OFFSET ${offset}\n `;\n }\n\n const result = await query.execute(database);\n\n // Build count query with same filters\n const countQuery = sql<{ count: string }>`\n SELECT COUNT(*) as count FROM ${tableRef}\n ${whereClause}\n `;\n const countResult = await countQuery.execute(database);\n const total = countResult.rows[0]\n ? parseInt(countResult.rows[0].count, 10)\n : null;\n\n const rawColumns =\n result.rows.length > 0 ? Object.keys(result.rows[0]) : [];\n const columns = [\n ...PRIORITY_COLUMNS.filter((col) => rawColumns.includes(col)),\n ...rawColumns.filter(\n (col) =>\n !PRIORITY_COLUMNS.includes(\n col as (typeof PRIORITY_COLUMNS)[number],\n ),\n ),\n ];\n\n return {\n columns,\n rows: result.rows,\n total,\n };\n },\n [database],\n );\n\n const onExportDb = useCallback(async () => {\n if (!pglite) return;\n\n if (queue) await quiesceQueue(queue);\n\n try {\n const major = resolvePgMajorForRuntime(getCachedReactorPgMajor() ?? null);\n const pgDump = await loadPgDump(major);\n const dump = await pgDump({ pg: pglite });\n const sqlContent = await dump.text();\n\n const blob = new Blob([sqlContent], { type: \"text/sql\" });\n const url = URL.createObjectURL(blob);\n const a = document.createElement(\"a\");\n a.href = url;\n a.download = `database-export-${Date.now()}.sql`;\n a.click();\n URL.revokeObjectURL(url);\n } finally {\n queue?.unblock();\n }\n }, [pglite, queue]);\n\n const onImportDb = useCallback(\n async (sqlContent: string) => {\n if (!pglite) return;\n\n if (queue) await quiesceQueue(queue);\n\n if (reactor) {\n const status = reactor.kill();\n await status.completed;\n }\n\n // Drop every user-created schema before restoring. Processors may own\n // schemas beyond `reactor`, so dropping only that one leaves orphans\n // whose tables collide with whatever the dump recreates. The dump\n // itself emits `CREATE SCHEMA ...;` statements, so we don't pre-create.\n // `standard_conforming_strings=off` matches pg_dump's escape-string\n // literals so doubled backslashes in JSONB collapse correctly.\n await pglite.transaction(async (tx) => {\n const schemas = await tx.query<{ nspname: string }>(\n `SELECT nspname FROM pg_namespace\n WHERE nspname NOT IN ('pg_catalog', 'pg_toast', 'information_schema', 'public')\n AND nspname NOT LIKE 'pg_temp_%'\n AND nspname NOT LIKE 'pg_toast_temp_%'`,\n );\n for (const { nspname } of schemas.rows) {\n await tx.exec(`DROP SCHEMA IF EXISTS \"${nspname}\" CASCADE`);\n }\n try {\n await tx.exec(\"SET standard_conforming_strings = off;\");\n } catch {\n // PG17 still accepts this but log if it ever fails.\n }\n await tx.exec(sqlContent);\n await tx.exec(`SET search_path TO ${REACTOR_SCHEMA}`);\n });\n\n // Flush IDBFS → IndexedDB synchronously. PGlite's own syncToFs is\n // fire-and-forget under relaxedDurability, and close() doesn't run\n // a final sync, so we drive Emscripten's syncfs directly — its\n // callback fires from the IDB transaction's oncomplete, guaranteeing\n // the writes have committed before we reload.\n await syncPgliteToIdb(pglite);\n\n window.location.reload();\n // reload() is asynchronous; without blocking here the DBExplorer caller\n // would continue and call loadTables() against an in-flight shutdown.\n await new Promise(() => {});\n },\n [pglite, queue, reactor],\n );\n\n const getDefaultSort = useCallback(\n (table: string): SortOptions | undefined => {\n if (table === \"Operation\") {\n return { column: \"timestampUtcMs\", direction: \"desc\" };\n }\n return undefined;\n },\n [],\n );\n\n return {\n getTables,\n getTableRows,\n getDefaultSort,\n onExportDb,\n onImportDb,\n };\n}\n","import { clearReactorStorage } from \"@powerhousedao/connect/store\";\nimport {\n getCachedReactorPgMajor,\n PENDING_PG_SEED_KEY,\n subscribeReactorPgMajor,\n} from \"@powerhousedao/connect/utils\";\nimport { useCallback, useSyncExternalStore } from \"react\";\n\nconst SUPPORTED_PG_VERSIONS = [16, 17] as const;\n\nexport function useDebugInspector() {\n const currentPgVersion = useSyncExternalStore(\n subscribeReactorPgMajor,\n getCachedReactorPgMajor,\n () => undefined,\n );\n\n const onResetToPgVersion = useCallback(async (major: number) => {\n console.info(`[debug-inspector] Reset requested: PG${major}`);\n try {\n localStorage.setItem(PENDING_PG_SEED_KEY, String(major));\n console.info(`[debug-inspector] Clearing reactor storage...`);\n await clearReactorStorage();\n console.info(`[debug-inspector] Storage cleared. Reloading...`);\n window.location.reload();\n } catch (err) {\n console.error(\"[debug-inspector] Reset failed:\", err);\n localStorage.removeItem(PENDING_PG_SEED_KEY);\n throw err;\n }\n }, []);\n\n return {\n supportedPgVersions: SUPPORTED_PG_VERSIONS,\n currentPgVersion: currentPgVersion ?? null,\n onResetToPgVersion,\n };\n}\n","import type { IntegrityInspectorProps } from \"@powerhousedao/design-system/connect\";\nimport {\n DocumentIntegrityService,\n useReactorClientModule,\n} from \"@powerhousedao/reactor-browser\";\nimport { useCallback, useMemo } from \"react\";\n\nexport function useIntegrityInspector(): IntegrityInspectorProps | undefined {\n const reactorClientModule = useReactorClientModule();\n const reactorModule = reactorClientModule?.reactorModule;\n\n const service = useMemo(() => {\n if (!reactorModule) return undefined;\n\n return new DocumentIntegrityService(\n reactorModule.keyframeStore,\n reactorModule.operationStore,\n reactorModule.writeCache,\n reactorModule.documentView,\n reactorModule.documentModelRegistry,\n );\n }, [reactorModule]);\n\n const onValidate = useCallback(\n async (documentId: string, branch?: string) => {\n if (!service) {\n throw new Error(\"Reactor module not available\");\n }\n return service.validateDocument(documentId, branch);\n },\n [service],\n );\n\n const onRebuildKeyframes = useCallback(\n async (documentId: string, branch?: string) => {\n if (!service) {\n throw new Error(\"Reactor module not available\");\n }\n return service.rebuildKeyframes(documentId, branch);\n },\n [service],\n );\n\n const onRebuildSnapshots = useCallback(\n async (documentId: string, branch?: string) => {\n if (!service) {\n throw new Error(\"Reactor module not available\");\n }\n return service.rebuildSnapshots(documentId, branch);\n },\n [service],\n );\n\n if (!service) {\n return undefined;\n }\n\n return {\n onValidate,\n onRebuildKeyframes,\n onRebuildSnapshots,\n };\n}\n","import type { ProcessorsInspectorProps } from \"@powerhousedao/design-system/connect\";\nimport { useReactorClientModule } from \"@powerhousedao/reactor-browser\";\nimport { useCallback, useMemo } from \"react\";\n\nexport function useProcessorsInspector(): ProcessorsInspectorProps | undefined {\n const reactorClientModule = useReactorClientModule();\n const processorManager = reactorClientModule?.reactorModule?.processorManager;\n\n const hasProcessorManager = useMemo(\n () => processorManager != null,\n [processorManager],\n );\n\n const getProcessors = useCallback(async () => {\n if (!processorManager) {\n return [];\n }\n\n return processorManager.getAll().map((tracked) => ({\n processorId: tracked.processorId,\n factoryId: tracked.factoryId,\n driveId: tracked.driveId,\n processorIndex: tracked.processorIndex,\n lastOrdinal: tracked.lastOrdinal,\n status: tracked.status,\n lastError: tracked.lastError,\n lastErrorTimestamp: tracked.lastErrorTimestamp,\n }));\n }, [processorManager]);\n\n const onRetry = useCallback(\n async (processorId: string) => {\n if (!processorManager) return;\n const tracked = processorManager.get(processorId);\n if (tracked) {\n await tracked.retry();\n }\n },\n [processorManager],\n );\n\n if (!hasProcessorManager) {\n return undefined;\n }\n\n return {\n getProcessors,\n onRetry,\n };\n}\n","import type {\n QueueInspectorProps,\n QueueState,\n} from \"@powerhousedao/design-system/connect\";\nimport {\n InMemoryQueue,\n useReactorClientModule,\n type Job,\n} from \"@powerhousedao/reactor-browser\";\nimport { useCallback, useMemo } from \"react\";\n\nexport function useQueueInspector(): QueueInspectorProps | undefined {\n const reactorClientModule = useReactorClientModule();\n const queue = reactorClientModule?.reactorModule?.queue;\n\n const inMemoryQueue = useMemo(() => {\n if (queue instanceof InMemoryQueue) {\n return queue;\n }\n return undefined;\n }, [queue]);\n\n const getQueueState = useCallback(async (): Promise<QueueState> => {\n if (!inMemoryQueue) {\n return {\n isPaused: false,\n pendingJobs: [],\n executingJobs: [],\n totalPending: 0,\n totalExecuting: 0,\n };\n }\n\n const pendingJobs = inMemoryQueue.getPendingJobs();\n const executingJobIds = inMemoryQueue.getExecutingJobIds();\n\n const executingJobs: Job[] = [];\n for (const jobIdSet of executingJobIds.values()) {\n for (const jobId of jobIdSet) {\n const job = inMemoryQueue.getJob(jobId);\n if (job) {\n executingJobs.push(job);\n }\n }\n }\n\n return {\n isPaused: inMemoryQueue.paused,\n pendingJobs,\n executingJobs,\n totalPending: pendingJobs.length,\n totalExecuting: executingJobs.length,\n };\n }, [inMemoryQueue]);\n\n const onPause = useCallback(async (): Promise<void> => {\n if (inMemoryQueue) {\n inMemoryQueue.pause();\n }\n }, [inMemoryQueue]);\n\n const onResume = useCallback(async (): Promise<void> => {\n if (inMemoryQueue) {\n await inMemoryQueue.resume();\n }\n }, [inMemoryQueue]);\n\n if (!inMemoryQueue) {\n return undefined;\n }\n\n return {\n getQueueState,\n onPause,\n onResume,\n };\n}\n","import type {\n ConnectionStateSnapshot,\n Remote,\n} from \"@powerhousedao/reactor-browser\";\nimport {\n addRemoteDrive,\n PollBehavior,\n useConnectionStates,\n useSync,\n} from \"@powerhousedao/reactor-browser\";\nimport { useCallback } from \"react\";\n\nexport function useRemotesInspector(): {\n getRemotes: () => Promise<Remote[]>;\n removeRemote: (name: string) => Promise<void>;\n addRemoteManual: (url: string) => Promise<void>;\n triggerPull: (name: string) => void;\n connectionStates: ReadonlyMap<string, ConnectionStateSnapshot>;\n} {\n const syncManager = useSync();\n if (!syncManager) {\n throw new Error(\"Sync manager not found\");\n }\n\n const connectionStates = useConnectionStates();\n\n const getRemotes = useCallback(() => {\n return Promise.resolve(syncManager.list());\n }, [syncManager]);\n\n const removeRemote = useCallback(\n (name: string) => syncManager.remove(name),\n [syncManager],\n );\n\n const addRemoteManual = useCallback(async (url: string) => {\n await addRemoteDrive(url, undefined, {\n pollBehavior: PollBehavior.Manual,\n });\n }, []);\n\n const triggerPull = useCallback(\n (name: string) => syncManager.triggerPull(name),\n [syncManager],\n );\n\n return {\n getRemotes,\n removeRemote,\n addRemoteManual,\n triggerPull,\n connectionStates,\n };\n}\n","import { InspectorModal as ConnectInspectorModal } from \"@powerhousedao/design-system/connect\";\nimport { REACTOR_SCHEMA } from \"@powerhousedao/reactor-browser\";\nimport { closePHModal, usePHModal } from \"@powerhousedao/reactor-browser\";\nimport { useDbExplorer } from \"./useDbExplorer.js\";\nimport { useDebugInspector } from \"./useDebugInspector.js\";\nimport { useIntegrityInspector } from \"./useIntegrityInspector.js\";\nimport { useProcessorsInspector } from \"./useProcessorsInspector.js\";\nimport { useQueueInspector } from \"./useQueueInspector.js\";\nimport { useRemotesInspector } from \"./useRemotesInspector.js\";\n\nconst DEFAULT_PAGE_SIZE = 25;\n\nexport const InspectorModal: React.FC = () => {\n const phModal = usePHModal();\n const open = phModal?.type === \"inspector\";\n\n const { getTables, getTableRows, getDefaultSort, onExportDb, onImportDb } =\n useDbExplorer();\n const {\n getRemotes,\n removeRemote,\n addRemoteManual,\n triggerPull,\n connectionStates,\n } = useRemotesInspector();\n const queueInspectorProps = useQueueInspector();\n const processorsInspectorProps = useProcessorsInspector();\n const integrityInspectorProps = useIntegrityInspector();\n const { currentPgVersion, supportedPgVersions, onResetToPgVersion } =\n useDebugInspector();\n\n return (\n <ConnectInspectorModal\n open={open}\n onOpenChange={(status) => {\n if (!status) closePHModal();\n }}\n dbExplorerProps={{\n schema: REACTOR_SCHEMA,\n getTables,\n getTableRows,\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n getDefaultSort,\n pageSize: DEFAULT_PAGE_SIZE,\n onExportDb,\n onImportDb,\n pgVersionControl: {\n currentPgVersion,\n supportedPgVersions,\n onResetToPgVersion,\n },\n }}\n remotesInspectorProps={{\n getRemotes,\n removeRemote,\n addRemoteManual,\n triggerPull,\n connectionStates,\n }}\n queueInspectorProps={queueInspectorProps}\n processorsInspectorProps={processorsInspectorProps}\n integrityInspectorProps={integrityInspectorProps}\n />\n );\n};\n"],"names":["ConnectInspectorModal"],"mappings":";;;;;;;;;;;AAmBA,eAAe,aAAa,OAA8B;AACxD,OAAM,IAAI,SAAe,YAAY,MAAM,YAAY,SAAS,CAAC,CAAC;;AAQpE,eAAe,gBAAgB,QAMb;AAChB,OAAM,IAAI,SAAe,SAAS,WAAW;AAC3C,SAAO,OAAO,GAAG,OAAO,QAAQ,QAAS,MAAM,OAAO,IAAI,GAAG,SAAS,CAAE;GACxE;;AAmCJ,MAAM,mBAAmB;CACvB;CACA;CACA;CACA;CACA;CACA;CACD;AAED,SAAgB,gBAAgB;CAC9B,MAAM,WAAW,aAAa;CAC9B,MAAM,SAAS,WAAW;CAC1B,MAAM,sBAAsB,wBAAwB;CACpD,MAAM,UAAU,qBAAqB,eAAe;CACpD,MAAM,QAAQ,qBAAqB,eAAe;CAElD,MAAM,YAAY,YAAY,YAAk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,KAAK,EAC/C,CAAC,YAAY,CACd;EAOC;EACD;;;;AC1CH,MAAM,oBAAoB;AAE1B,MAAa,uBAAiC;CAE5C,MAAM,OADU,YAAY,EACN,SAAS;CAE/B,MAAM,EAAE,WAAW,cAAc,gBAAgB,YAAY,eAC3D,eAAe;CACjB,MAAM,EACJ,YACA,cACA,iBACA,aACA,qBACE,qBAAqB;CACzB,MAAM,sBAAsB,mBAAmB;CAC/C,MAAM,2BAA2B,wBAAwB;CACzD,MAAM,0BAA0B,uBAAuB;CACvD,MAAM,EAAE,kBAAkB,qBAAqB,uBAC7C,mBAAmB;AAErB,QACE,oBAACA,kBAAD;EACQ;EACN,eAAe,WAAW;AACxB,OAAI,CAAC,OAAQ,eAAc;;EAE7B,iBAAiB;GACf,QAAQ;GACR;GACA;GAEA;GACA,UAAU;GACV;GACA;GACA,kBAAkB;IAChB;IACA;IACA;IACD;GACF;EACD,uBAAuB;GACrB;GACA;GACA;GACA;GACA;GACD;EACoB;EACK;EACD;EACzB,CAAA","debug_id":"d7acea58-7847-5ed8-a6b6-878e7b667a40"}
@@ -1,9 +1,9 @@
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]="10e44922-dfff-55f1-b545-07561480fdec")}catch(e){}}();
3
- import { t as useRegistryPackages } from "./useRegistryPackages-BOX4NMAb.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]="47da785e-a4a8-5f3d-befb-8c72431e7d8e")}catch(e){}}();
3
+ import { t as useRegistryPackages } from "./useRegistryPackages-DK8swjWd.js";
4
4
  import { closePHModal, usePHModal, useVetraPackageManager } from "@powerhousedao/reactor-browser";
5
5
  import { jsx } from "react/jsx-runtime";
6
- import { PackageInstallModal } from "@powerhousedao/design-system/connect/index";
6
+ import { PackageInstallModal } from "@powerhousedao/design-system/connect";
7
7
  //#region src/components/modal/modals/MissingPackageModal.tsx
8
8
  function ConnectMissingPackageModal() {
9
9
  const phModal = usePHModal();
@@ -33,5 +33,5 @@ function ConnectMissingPackageModal() {
33
33
  //#endregion
34
34
  export { ConnectMissingPackageModal };
35
35
 
36
- //# sourceMappingURL=MissingPackageModal-BfblPbd8.js.map
37
- //# debugId=10e44922-dfff-55f1-b545-07561480fdec
36
+ //# sourceMappingURL=MissingPackageModal-B2EAV_VJ.js.map
37
+ //# debugId=47da785e-a4a8-5f3d-befb-8c72431e7d8e
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MissingPackageModal-B2EAV_VJ.js","sources":["../src/components/modal/modals/MissingPackageModal.tsx"],"sourcesContent":["import { useRegistryPackages } from \"@powerhousedao/connect/hooks\";\nimport {\n PackageInstallModal,\n type PendingPackageInstallation,\n} from \"@powerhousedao/design-system/connect\";\nimport {\n closePHModal,\n usePHModal,\n useVetraPackageManager,\n} from \"@powerhousedao/reactor-browser\";\n\nexport function ConnectMissingPackageModal() {\n const phModal = usePHModal();\n const { registryPackageList, updateRegistryPackageStatus } =\n useRegistryPackages();\n const packageManager = useVetraPackageManager();\n const open = phModal?.type === \"missingPackage\";\n\n const documentType = open ? phModal.documentType : undefined;\n\n if (!packageManager || !documentType) return null;\n\n const pendingInstallations: PendingPackageInstallation[] = registryPackageList\n .filter((rp) => rp.documentTypes.includes(documentType))\n .map((rp) => ({\n documentType,\n packageName: rp.name,\n }));\n\n async function onInstall(packageName: string) {\n const result = await packageManager?.addPackage(packageName);\n if (result?.type === \"success\") {\n updateRegistryPackageStatus(packageName, \"registry-install\");\n }\n }\n\n function onDismiss(packageName: string) {\n updateRegistryPackageStatus(packageName, \"dismissed\");\n }\n\n return (\n <PackageInstallModal\n pendingInstallations={pendingInstallations}\n onInstall={onInstall}\n onDismiss={onDismiss}\n onOpenChange={(status: boolean) => {\n if (!status) return closePHModal();\n }}\n />\n );\n}\n"],"names":[],"mappings":";;;;;;;AAWA,SAAgB,6BAA6B;CAC3C,MAAM,UAAU,YAAY;CAC5B,MAAM,EAAE,qBAAqB,gCAC3B,qBAAqB;CACvB,MAAM,iBAAiB,wBAAwB;CAG/C,MAAM,eAFO,SAAS,SAAS,mBAEH,QAAQ,eAAe,KAAA;AAEnD,KAAI,CAAC,kBAAkB,CAAC,aAAc,QAAO;CAE7C,MAAM,uBAAqD,oBACxD,QAAQ,OAAO,GAAG,cAAc,SAAS,aAAa,CAAC,CACvD,KAAK,QAAQ;EACZ;EACA,aAAa,GAAG;EACjB,EAAE;CAEL,eAAe,UAAU,aAAqB;AAE5C,OADe,MAAM,gBAAgB,WAAW,YAAY,GAChD,SAAS,UACnB,6BAA4B,aAAa,mBAAmB;;CAIhE,SAAS,UAAU,aAAqB;AACtC,8BAA4B,aAAa,YAAY;;AAGvD,QACE,oBAAC,qBAAD;EACwB;EACX;EACA;EACX,eAAe,WAAoB;AACjC,OAAI,CAAC,OAAQ,QAAO,cAAc;;EAEpC,CAAA","debug_id":"47da785e-a4a8-5f3d-befb-8c72431e7d8e"}